puppetdb_query 0.0.33 → 0.0.34
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/puppetdb_query/puppetdb.rb +2 -2
- data/lib/puppetdb_query/updater.rb +3 -3
- data/lib/puppetdb_query/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02703369147399b805387f43717be7874b561e11
|
4
|
+
data.tar.gz: a406412f8fafc587eb987b124713a1a203a7be16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e875642df066576133fd92b667f30bf5e761911e252aeb06a8e406b62cf037b8c780c603424c24caad3acd194df43b03b68c5e3652704de31b1498bb64871a
|
7
|
+
data.tar.gz: ee7b72fdc1e4ca9f5a82159a0d3403a82b3600972b6ebe683abe34ab607944990d35402c439da0752be4c683b77dc16a35a9602775281f21c78fabc18f00250b
|
@@ -18,7 +18,7 @@ module PuppetDBQuery
|
|
18
18
|
end
|
19
19
|
|
20
20
|
# get array of node names
|
21
|
-
def
|
21
|
+
def all_nodes
|
22
22
|
api_nodes.reject { |data| data['deactivated'] }.map { |data| data['certname'] }
|
23
23
|
end
|
24
24
|
|
@@ -46,7 +46,7 @@ module PuppetDBQuery
|
|
46
46
|
end
|
47
47
|
|
48
48
|
# get hash of facts for given node name
|
49
|
-
def
|
49
|
+
def single_node_facts(node)
|
50
50
|
json = get_json("#{@nodes_url}/#{node}/facts", 10)
|
51
51
|
return nil if json.include?("error")
|
52
52
|
Hash[json.map { |data| [data["name"], data["value"]] }]
|
@@ -24,12 +24,12 @@ module PuppetDBQuery
|
|
24
24
|
logger.info "update1 started (full update)"
|
25
25
|
tsb = Time.now
|
26
26
|
source_nodes = source_node_properties.keys
|
27
|
-
destination_nodes = destination.
|
27
|
+
destination_nodes = destination.all_nodes
|
28
28
|
delete_missing(destination_nodes, source_nodes)
|
29
29
|
errors = false
|
30
30
|
source_nodes.each do |node|
|
31
31
|
begin
|
32
|
-
destination.node_update(node, source.
|
32
|
+
destination.node_update(node, source.single_node_facts(node))
|
33
33
|
rescue
|
34
34
|
errors = true
|
35
35
|
logging.error $!
|
@@ -81,7 +81,7 @@ module PuppetDBQuery
|
|
81
81
|
modified = source.nodes_update_facts_since(last_update_timestamp)
|
82
82
|
modified.each do |node|
|
83
83
|
begin
|
84
|
-
destination.node_update(node, source.
|
84
|
+
destination.node_update(node, source.single_node_facts(node))
|
85
85
|
rescue
|
86
86
|
errors = true
|
87
87
|
logging.error $!
|