puppetdb_query 0.0.33 → 0.0.34

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
  SHA1:
3
- metadata.gz: 70a9767d6cb69f3d7270938bdfc71d477f02988f
4
- data.tar.gz: 30dd2aec2e32755cf2a304d8547af04d72a66c56
3
+ metadata.gz: 02703369147399b805387f43717be7874b561e11
4
+ data.tar.gz: a406412f8fafc587eb987b124713a1a203a7be16
5
5
  SHA512:
6
- metadata.gz: e9fa831eaa07e0f0a6b25a738390f8a3b4e2a5d12c9feae4b4f363437f5867ef803314b4081cd078a5cb1b0567ac53ec05d29055af455559ffa21c893c261c94
7
- data.tar.gz: 2e746b17722457f60c4ed4a06418731d8c8f3405ba56ac02e21b191d54a4014fc9067e3a50e4924c057982f3274c6e6ad479fcbe31d39ceb86cef69947bf8dc3
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 nodes
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 node_facts(node)
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.nodes
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.node_facts(node))
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.node_facts(node))
84
+ destination.node_update(node, source.single_node_facts(node))
85
85
  rescue
86
86
  errors = true
87
87
  logging.error $!
@@ -1,3 +1,3 @@
1
1
  module PuppetDBQuery
2
- VERSION = "0.0.33".freeze
2
+ VERSION = "0.0.34".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetdb_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33
4
+ version: 0.0.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Meyling