ey_cloud_server 1.4.37 → 1.4.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ey_backup/engines/postgresql_engine.rb +7 -0
- data/lib/ey_cloud_server/version.rb +1 -1
- data/spec/config.yml +11 -0
- metadata +6 -4
@@ -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
|
|
data/spec/config.yml
ADDED
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:
|
4
|
+
hash: 73
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
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-
|
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
|