petasos 0.5.3 → 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: aa99f3e5d9f11e0330a51234fbfa8ed194368cf471a3d70306e4751fdd716e79
4
- data.tar.gz: dd22a538aab970b00ab9535c034ff07c44562b6d80fd7bf7b6abaf461bcacfb2
3
+ metadata.gz: 39d93a4f419014e335b1fb03924f369d4bcb7ef14e76418eddcb93105844f6b8
4
+ data.tar.gz: f63704886a9e202c15608b4cc1369fec219ea349835f23e41816e0ef014a7dfe
5
5
  SHA512:
6
- metadata.gz: fba6de2e29d35efcba72bed8d2fe2afad5b63aa45aab4d1924da9e81e6ea9e6916984ecdf4b0ee3a06bc7d15a66279267a0cda77596f85955ca1092f2fb59625
7
- data.tar.gz: b2f040050ae79ca54120ed1aabc94b0933ab9258a685f51129b5e5d04b09b0a6b9cdf79da88391ffd8fcd320ba5010004baf394f370c1330d80a0e3ccff45b2d
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} && 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} && 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} && 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} && 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.3
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Myers