petasos 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/petasos/distributor.rb +3 -6
- data/lib/petasos/node.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39d93a4f419014e335b1fb03924f369d4bcb7ef14e76418eddcb93105844f6b8
|
4
|
+
data.tar.gz: f63704886a9e202c15608b4cc1369fec219ea349835f23e41816e0ef014a7dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d23e48b013ef4ae6705d36b869f82c752bdcc8b24c0d7c6bc77be6d57df19301cd2034cfffd297e5e22ab4f5c0d59e835889a1112337bc3b8893e3077a678af
|
7
|
+
data.tar.gz: 98c872d72102e6127a2ff5ccf8a2962750602b217c9e36897ebfd640f96c626bed89669db892eb1caee255a54743b1196fd1ca00b40a4ddde381859ad7dc9f51
|
data/lib/petasos/distributor.rb
CHANGED
@@ -87,8 +87,7 @@ class Petasos::Distributor
|
|
87
87
|
`scp #{from_node.host}:#{export_path}* #{to_node.host}:#{pool_storage.last}`
|
88
88
|
end
|
89
89
|
end
|
90
|
-
|
91
|
-
`ssh #{to_node.host} \'cd #{to_node.path} && bash -lc \"petasos locations\"\'`
|
90
|
+
to_node.run_petasos_locations("after export from #{from_node.name}")
|
92
91
|
end
|
93
92
|
# mark it as completed
|
94
93
|
completed_export_file_path = File.join(Dir.pwd, "completed-#{File.basename(exports_file_path)}")
|
@@ -96,8 +95,7 @@ class Petasos::Distributor
|
|
96
95
|
# and then put it back where it came from
|
97
96
|
`scp #{completed_export_file_path} #{from_node.host}:#{from_node.path}`
|
98
97
|
`rm #{completed_export_file_path}`
|
99
|
-
|
100
|
-
`ssh #{from_node.host} \'cd #{from_node.path} && bash -lc \"petasos locations\"\'`
|
98
|
+
from_node.run_petasos_locations("after completing its exports")
|
101
99
|
end
|
102
100
|
|
103
101
|
# {"wow-ah"=>
|
@@ -129,8 +127,7 @@ class Petasos::Distributor
|
|
129
127
|
end
|
130
128
|
end
|
131
129
|
|
132
|
-
|
133
|
-
`ssh #{to_node.host} \'cd #{to_node.path} && bash -lc \"petasos locations\"\'`
|
130
|
+
to_node.run_petasos_locations("after backfill from #{from_node.name}")
|
134
131
|
end
|
135
132
|
end
|
136
133
|
end
|
data/lib/petasos/node.rb
CHANGED
@@ -11,8 +11,7 @@ class Petasos::Node
|
|
11
11
|
@manifests = []
|
12
12
|
`mkdir -p #{config["name"]}`
|
13
13
|
|
14
|
-
|
15
|
-
`ssh #{host} \'cd #{path} && bash -lc \"petasos locations\"\'`
|
14
|
+
run_petasos_locations("before distribution begins")
|
16
15
|
|
17
16
|
grab_manifest_and_exports
|
18
17
|
parse_manifests
|
@@ -30,6 +29,15 @@ class Petasos::Node
|
|
30
29
|
config["path"]
|
31
30
|
end
|
32
31
|
|
32
|
+
def petasos_locations_command
|
33
|
+
config["petasos_command"] || "\'cd #{path} && bash -lc \"petasos locations\"\'"
|
34
|
+
end
|
35
|
+
|
36
|
+
def run_petasos_locations(context = "")
|
37
|
+
puts "Running `petasos locations` on #{name} #{context}"
|
38
|
+
`ssh #{host} #{petasos_locations_command}`
|
39
|
+
end
|
40
|
+
|
33
41
|
def grab_manifest_and_exports
|
34
42
|
`scp #{config["host"]}:#{config["path"]}/manifest* #{config["name"]}/`
|
35
43
|
`scp #{config["host"]}:#{config["path"]}/exports* #{config["name"]}/`
|