petasos 0.5.0 → 0.5.1

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: d13f219555d9e62adf300ef1f708222955c8ebec955e64843a679624c53fc2f1
4
- data.tar.gz: b24a1fd6cf6f055f9340d28aa06de4b7096f7a363d7c617daeaf3e2fb0838b96
3
+ metadata.gz: 4ff98d0ee0f69c09a8436007524d6650b8ed5e82c4f2ced088b0a8da72ac31cd
4
+ data.tar.gz: 4e16bc991db6f87baa0f056e64834251749c290b3e6aba9db66586ff6850a2fb
5
5
  SHA512:
6
- metadata.gz: 135cf3a94737ec8a8d13e824c3c20c4c4c6f7089ed6d279c9339109d5f346d877a697dded2f2f11147c375527a8ca8d3a13f15ae77a718592d121838521d0385
7
- data.tar.gz: 385e42e07d43317eb4aac5d9082bb195ad79c664e26e5770bdb60a976f9737fe1ff99f167bcd5c57da6ddbfde06d34e6f96bd40cd1ab5b99cae238140a372c4c
6
+ metadata.gz: d0cc807729014a25f679cfadddcc8ee6851b2312438790e193ebd4b38ce9182d1a4ee4a0d0da07685eee1b125671841f1b7758b1708699d6b2328bd8ea74bab8
7
+ data.tar.gz: 9b44f27902559d5b0d3df48ab822186d3de4f28627b86a0f1288000e4d1e61ad7985348ea6efaf03bb94d9ba654941b48ec72a2febe6d851d5825b83753c3f46
@@ -17,11 +17,6 @@ class Petasos::Distributor
17
17
  @nodes[node["name"]] = Petasos::Node.new(node)
18
18
  end
19
19
 
20
- @nodes.values.each do |node|
21
- puts "Running `petasos locations` on #{node.name} before distribution begins"
22
- `ssh #{node.host} \"cd #{node.path} && petasos locations\"`
23
- end
24
-
25
20
  @manifests = {}
26
21
  @nodes.each_pair do |node_name, node|
27
22
  @manifests[node_name] = node.manifests
@@ -88,7 +83,7 @@ class Petasos::Distributor
88
83
  destination_seen_file_hash = get_seen_file_hash(pool_storage.first, pool_storage[1], pool_name)
89
84
  export_paths.each do |export_path|
90
85
  unless destination_seen_file_hash[File.basename(export_path)]
91
- puts "moving #{File.basename(export_path)} from #{from_node.name} to #{to_node.name}"
86
+ puts "exporting #{File.basename(export_path)} from #{from_node.name} to #{to_node.name}"
92
87
  `scp #{from_node.host}:#{export_path}* #{to_node.host}:#{pool_storage.last}`
93
88
  end
94
89
  end
@@ -101,6 +96,8 @@ class Petasos::Distributor
101
96
  # and then put it back where it came from
102
97
  `scp #{completed_export_file_path} #{from_node.host}:#{from_node.path}`
103
98
  `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\"`
104
101
  end
105
102
 
106
103
  # {"wow-ah"=>
data/lib/petasos/node.rb CHANGED
@@ -10,6 +10,10 @@ class Petasos::Node
10
10
  @config = config
11
11
  @manifests = []
12
12
  `mkdir -p #{config["name"]}`
13
+
14
+ puts "Running `petasos locations` on #{name} before distribution begins"
15
+ `ssh #{host} \"cd #{path} && petasos locations\"`
16
+
13
17
  grab_manifest_and_exports
14
18
  parse_manifests
15
19
  end
data/lib/petasos.rb CHANGED
@@ -7,9 +7,14 @@ class Petasos
7
7
  class Error < StandardError; end
8
8
 
9
9
  def run(mode = "")
10
- process_locations
11
- unless mode == "locations"
12
- process_distribution if File.file?(File.join(Dir.pwd, "petasos_distribution-config.yaml"))
10
+ unless File.file?("petasos_is_running")
11
+ `touch petasos_is_running`
12
+ process_locations
13
+ unless mode == "locations"
14
+ process_distribution if File.file?(File.join(Dir.pwd, "petasos_distribution-config.yaml"))
15
+ process_locations
16
+ end
17
+ `rm petasos_is_running`
13
18
  end
14
19
  end
15
20
 
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.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Myers