puppetdb_query 0.0.15 → 0.0.16

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: 711ddb59ea4403cea75c0558be6889dc08d7abed
4
- data.tar.gz: 790d435eb2d8a7ac735d290809e8f21cb71fc4bf
3
+ metadata.gz: 6a5b1ad53ece3f1e0cdbbfeb3cb0f73cf2146f39
4
+ data.tar.gz: c6bf6b738648819a82de72ba51456f3bee19e3c3
5
5
  SHA512:
6
- metadata.gz: 0a9978112475e22a82091798e511e756ff83cd76909ec6feed77ce5f6ec5aad304c6b6e426388aa61c425ace701aba8e0b8feeb198998d2e12312ba9ab9a699a
7
- data.tar.gz: 47077f1bf3a02b3c8c093cc1c5e9def12f80979af08cca796715c9206a96397372ec248e8ea09f46a605e9a710bd2792db06246ad907a3f1a22e4c5aa4fc1ff7
6
+ metadata.gz: 6b1f053c70c6f7b06e933b750c69abaccac71d78828e84530f6cdfbeb8680cc2c3f8d144e1db2453c4357d3deeae25d61fe5bb542f6cfecdf1f722e875f9f86b
7
+ data.tar.gz: ccdbf761cd99a8890daa6a7c4f8fe7e453c9bcc21b7825ed8035336e9052c2c5a6c79ef436ce11fc330e2148f530331b37ce0f5f068cee0b84be64859e97c9bb
@@ -20,8 +20,6 @@ module PuppetDBQuery
20
20
  Timeout.timeout(60 * minutes - seconds) do
21
21
  updater = PuppetDBQuery::Updater.new(source, destination)
22
22
 
23
- updater.update_node_properties
24
-
25
23
  # make a full update
26
24
  timestamp = Time.now
27
25
  updater.update2
@@ -7,10 +7,12 @@ module PuppetDBQuery
7
7
 
8
8
  attr_reader :source
9
9
  attr_reader :destination
10
+ attr_reader :source_node_properties
10
11
 
11
12
  def initialize(source, destination)
12
13
  @source = source
13
14
  @destination = destination
15
+ @source_node_properties = {}
14
16
  end
15
17
 
16
18
  # update by deleting missing nodes and iterating over all nodes and
@@ -18,9 +20,10 @@ module PuppetDBQuery
18
20
  #
19
21
  # mongo: 1598 nodes in 63.46 seconds
20
22
  def update1
23
+ update_node_properties
21
24
  logger.info "update1 started (full update)"
22
25
  tsb = Time.now
23
- source_nodes = source.nodes
26
+ source_nodes = source_node_properties.keys
24
27
  destination_nodes = destination.nodes
25
28
  delete_missing(destination_nodes, source_nodes)
26
29
  errors = false
@@ -42,9 +45,10 @@ module PuppetDBQuery
42
45
  #
43
46
  # mongo: 1597 nodes in 35.31 seconds
44
47
  def update2
48
+ update_node_properties
45
49
  logger.info "update2 started (full update)"
46
50
  tsb = Time.now
47
- source_nodes = source.nodes
51
+ source_nodes = source_node_properties.keys
48
52
  destination_nodes = destination.nodes
49
53
  delete_missing(destination_nodes, source_nodes)
50
54
  errors = false
@@ -67,9 +71,10 @@ module PuppetDBQuery
67
71
  #
68
72
  # mongo: 56 nodes in 2.62 seconds
69
73
  def update3(last_update_timestamp)
74
+ update_node_properties
70
75
  logger.info "update3 started (incremental)"
71
76
  tsb = Time.now
72
- source_nodes = source.nodes
77
+ source_nodes = source_node_properties.keys
73
78
  destination_nodes = destination.nodes
74
79
  delete_missing(destination_nodes, source_nodes)
75
80
  errors = false
@@ -93,10 +98,10 @@ module PuppetDBQuery
93
98
  def update_node_properties
94
99
  logger.info "update_node_properties started"
95
100
  tsb = Time.now
96
- source_node_properties = source.node_properties
101
+ @source_node_properties = source.node_properties
97
102
  destination.node_properties_update(source_node_properties)
98
103
  tse = Time.now
99
- logger.info "update_node_properties updated #{source_node_properties.size} nodes " \
104
+ logger.info "update_node_properties got #{source_node_properties.size} nodes " \
100
105
  "in #{tse - tsb}"
101
106
  destination.meta_node_properties_update(tsb, tse)
102
107
  end
@@ -1,3 +1,3 @@
1
1
  module PuppetDBQuery
2
- VERSION = "0.0.15".freeze
2
+ VERSION = "0.0.16".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.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Meyling