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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d54a5b700fe0b66ec0d9dfd97bf5e27b2d37818af231761b81e40105ae4b4c4a
4
- data.tar.gz: 34e1d0416daa3011955f99f323ac6a0538e48f44aae091507e1c058daf29c9d5
3
+ metadata.gz: 39d93a4f419014e335b1fb03924f369d4bcb7ef14e76418eddcb93105844f6b8
4
+ data.tar.gz: f63704886a9e202c15608b4cc1369fec219ea349835f23e41816e0ef014a7dfe
5
5
  SHA512:
6
- metadata.gz: ae3cbe118ea54dd02fb2d0dfa9609b023cc7ba111f8aaab4bf4fd82f315b70d4219aff9e1219631546e9b8db403c0dc6abcc0dc4657057c45f5ef06696ceafc2
7
- data.tar.gz: 3b15a8baa046e3281e2fe43b96775a7f2b4956ed3211c6163767b2e5d4366866889137bdaa970c81de6ca31a27c5a8b7e25b28e347c9f6ba1343c8b06f7fa196
6
+ metadata.gz: 1d23e48b013ef4ae6705d36b869f82c752bdcc8b24c0d7c6bc77be6d57df19301cd2034cfffd297e5e22ab4f5c0d59e835889a1112337bc3b8893e3077a678af
7
+ data.tar.gz: 98c872d72102e6127a2ff5ccf8a2962750602b217c9e36897ebfd640f96c626bed89669db892eb1caee255a54743b1196fd1ca00b40a4ddde381859ad7dc9f51
@@ -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
- puts "Running `petasos locations` on #{to_node.name} after export from #{from_node.name}"
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
- puts "Running `petasos locations` on #{from_node.name} after completing its exports"
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
- puts "Running `petasos locations` on #{to_node.name} after backfill from #{from_node.name}"
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
- puts "Running `petasos locations` on #{name} before distribution begins"
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"]}/`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petasos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Myers