Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- desc "Amend to allow MySQL"
- task :for_mysql do
- core_persistence_file = "#{BASE_DIR}/clc/modules/core/resources/META-INF/persistence.xml"
- replace_in_files core_persistence_file, '<property name="hibernate.connection.driver.class" value=".*"/>', '<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>'
- replace_in_files core_persistence_file, '<property name="hibernate.connection.url" value=".*"/>', '<property name="hibernate.connection.url" value="jdbc:mysql://localhost/euca"/>'
- replace_in_files core_persistence_file, '<property name="hibernate.connection.username" value=".*"/>', '<property name="hibernate.connection.username" value="euca"/>'
- replace_in_files core_persistence_file, '<property name="hibernate.connection.password" value=".*"/>', '<property name="hibernate.connection.password" value="Pa55w0rd"/>'
- replace_in_files core_persistence_file, '<property name="hibernate.dialect" value=".*"/>', '<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>'
- image_mgr_persistence_file = "#{BASE_DIR}/clc/modules/image-manager/resources/META-INF/persistence.xml"
- 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"/>'
- replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.url" value=".*"/>', '<property name="hibernate.connection.url" value="jdbc:mysql://localhost/eucavols"/>'
- replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.username" value=".*"/>', '<property name="hibernate.connection.username" value="euca"/>'
- replace_in_files image_mgr_persistence_file, '<property name="hibernate.connection.password" value=".*"/>', '<property name="hibernate.connection.password" value="Pa55w0rd"/>'
- replace_in_files image_mgr_persistence_file, '<property name="hibernate.dialect" value=".*"/>', '<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>'
- counters_file = "#{BASE_DIR}/clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/Counters.java"
- replace_in_files counters_file, 'COUNTERS', 'counters'
- grant_info_file = "#{BASE_DIR}/clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/GrantInfo.java"
- replace_in_files grant_info_file, '@Column\(name="read"\)', '@Column(name="is_read")'
- replace_in_files grant_info_file, '@Column\(name="write"\)', '@Column(name="is_write")'
- entity_wrapper_file = "#{BASE_DIR}/clc/modules/core/src/edu/ucsb/eucalyptus/cloud/entities/EntityWrapper.java"
- replace_in_files entity_wrapper_file, 'stmt.execute\( "SET WRITE_DELAY 100 MILLIS" \);', '//stmt.execute( "SET WRITE_DELAY 100 MILLIS" ); //removed for mysql'
- end
Add Comment
Please, Sign In to add comment