petasos 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/lib/petasos/distributor.rb +3 -6
- data/lib/petasos/node.rb +4 -0
- data/lib/petasos.rb +8 -3
- 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: 4ff98d0ee0f69c09a8436007524d6650b8ed5e82c4f2ced088b0a8da72ac31cd
|
4
|
+
data.tar.gz: 4e16bc991db6f87baa0f056e64834251749c290b3e6aba9db66586ff6850a2fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0cc807729014a25f679cfadddcc8ee6851b2312438790e193ebd4b38ce9182d1a4ee4a0d0da07685eee1b125671841f1b7758b1708699d6b2328bd8ea74bab8
|
7
|
+
data.tar.gz: 9b44f27902559d5b0d3df48ab822186d3de4f28627b86a0f1288000e4d1e61ad7985348ea6efaf03bb94d9ba654941b48ec72a2febe6d851d5825b83753c3f46
|
data/lib/petasos/distributor.rb
CHANGED
@@ -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 "
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
|