Guest User

Untitled

a guest
Jun 14th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. desc "Amend to allow MySQL"
  2. task :for_mysql do
  3. core_persistence_file = "#{BASE_DIR}/clc/modules/core/resources/META-INF/persistence.xml"
  4. replace_in_files core_persistence_file, '<property name="hibernate.connection.driver.class" value=".*"/>', '<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>'
  5. replace_in_files core_persistence_file, '<property name="hibernate.connection.url" value=".*"/>', '<property name="hibernate.connection.url" value="jdbc:mysql://localhost/euca"/>'
  6. replace_in_files core_persistence_file, '<property name="hibernate.connection.username" value=".*"/>', '<property name="hibernate.connection.username" value="euca"/>'
  7. replace_in_files core_persistence_file, '<property name="hibernate.connection.password" value=".*"/>', '<property name="hibernate.connection.password" value="Pa55w0rd"/>'
  8. replace_in_files core_persistence_file, '<property name="hibernate.dialect" value=".*"/>', '<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>'
  9.  
  10. image_mgr_persistence_file = "#{BASE_DIR}/clc/modules/image-manager/resources/META-INF/persistence.xml"
  11. replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.driver.class" value=".*"/>', '<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>'
  12. replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.url" value=".*"/>', '<property name="hibernate.connection.url" value="jdbc:mysql://localhost/eucavols"/>'
  13. replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.username" value=".*"/>', '<property name="hibernate.connection.username" value="euca"/>'
  14. replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.password" value=".*"/>', '<property name="hibernate.connection.password" value="Pa55w0rd"/>'
  15. replace_in_files image_mgr_persistence_file, '<property name="hibernate.dialect" value=".*"/>', '<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>'
  16.  
  17. counters_file = "#{BASE_DIR}/clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/Counters.java"
  18. replace_in_files counters_file, 'COUNTERS', 'counters'
  19.  
  20. grant_info_file = "#{BASE_DIR}/clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/GrantInfo.java"
  21. replace_in_files grant_info_file, '@Column\(name="read"\)', '@Column(name="is_read")'
  22. replace_in_files grant_info_file, '@Column\(name="write"\)', '@Column(name="is_write")'
  23.  
  24. entity_wrapper_file = "#{BASE_DIR}/clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/EntityWrapper.java"
  25. replace_in_files entity_wrapper_file, 'stmt.execute\( "SET WRITE_DELAY 100 MILLIS" \);', '//stmt.execute( "SET WRITE_DELAY 100 MILLIS" ); //removed for mysql'
  26.  
  27.  
  28. end
Add Comment
Please, Sign In to add comment