ey_cloud_server 1.4.37 → 1.4.39

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,13 @@ module EY
43
43
  end
44
44
 
45
45
  def drop_database(database_name)
46
+ stdout = StringIO.new()
47
+ active_connections = spawn(%Q{PGPASSWORD='#{password}' psql -U postgres -t -c "select count(*) from pg_stat_activity where datname='#{database_name}';"}, stdout)
48
+
49
+ if stdout.string.to_i > 0
50
+ EY::Backup.logger.fatal(%Q{ERROR: Target database has active connections. For more information, see "Restore or load a database" in docs.engineyard.com})
51
+ end
52
+
46
53
  spawn("PGPASSWORD='#{password}' dropdb -h #{host} -U#{username} #{database_name}")
47
54
  end
48
55
 
@@ -1,5 +1,5 @@
1
1
  module EY
2
2
  module CloudServer
3
- VERSION = '1.4.37'
3
+ VERSION = '1.4.39'
4
4
  end
5
5
  end
data/spec/config.yml ADDED
@@ -0,0 +1,11 @@
1
+ ---
2
+ tmp_dir:
3
+ data_json:
4
+ mysql_user: root
5
+ mysql_password:
6
+ mysql_host: localhost
7
+ postgresql_user: postgres
8
+ postgresql_password:
9
+ postgresql_host: localhost
10
+ aws_secret_id: 'abcd123.id'
11
+ aws_secret_key: 'abcd123.key'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey_cloud_server
3
3
  version: !ruby/object:Gem::Version
4
- hash: 77
4
+ hash: 73
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 37
10
- version: 1.4.37
9
+ - 39
10
+ version: 1.4.39
11
11
  platform: ruby
12
12
  authors:
13
13
  - EngineYard
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-08 00:00:00 Z
18
+ date: 2012-02-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json
@@ -251,6 +251,7 @@ files:
251
251
  - spec/big-brother_spec.rb
252
252
  - spec/bucket_minder_spec.rb
253
253
  - spec/config-example.yml
254
+ - spec/config.yml
254
255
  - spec/ey_api_spec.rb
255
256
  - spec/ey_backup/backend_spec.rb
256
257
  - spec/ey_backup/backup_spec.rb
@@ -309,6 +310,7 @@ test_files:
309
310
  - spec/big-brother_spec.rb
310
311
  - spec/bucket_minder_spec.rb
311
312
  - spec/config-example.yml
313
+ - spec/config.yml
312
314
  - spec/ey_api_spec.rb
313
315
  - spec/ey_backup/backend_spec.rb
314
316
  - spec/ey_backup/backup_spec.rb