puppetdb_query 0.0.26 → 0.0.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cddabf7a48c8c357641c4ea40575cb50f485123
4
- data.tar.gz: a2a684dddd3498ea4d424d1f314e85db38045c76
3
+ metadata.gz: e6c38fe303c945961d63d95b9c917d61c8c5c02d
4
+ data.tar.gz: 1124c261e90d691c2e87e257b3db10c576c3af8f
5
5
  SHA512:
6
- metadata.gz: 6a150df7840528d416bb168eadfb50685c0f1df1b8ec8e63a3643174f4f57d54553d0d941ca1f4f06a09cc8b72dece1849bf8f943dd027d958dce78082c15a4c
7
- data.tar.gz: 7e28e73a34afd5d8f23fb4f180c359ff462e43e075b1489742308030055bef824e102928f040548f8fdf568c2859770b9cf7eb4997610dad602ace4b506ca0f9
6
+ metadata.gz: 8762d09ad64e6d97f425e75151fc3dd27fea2ff828d5b7f750ae6e370319fdd1f4e281ebc80e73f81dc8e02378abbff7d744ee1cadb212000f22d81806a6a02e
7
+ data.tar.gz: 56c59951a4d8f54e8921a4d845681c93959e03bdcb67e890afe9a0f8642572bc54a04eb27e5b6a030485b33c5b23c9689977831fd9f556e6e500827a4658d34c
@@ -69,6 +69,21 @@ module PuppetDBQuery
69
69
  result
70
70
  end
71
71
 
72
+ # get nodes and their facts that fulfill given mongodb query and have at least one
73
+ # value for one the given fact names
74
+ #
75
+ # @param query mongodb query
76
+ # @param facts [Array<String>] get these facts in the result, eg ['fqdn'], empty for all
77
+ def query_facts_exists(query, facts = [])
78
+ result = query_facts(query, facts = [])
79
+ unless fact_names.empty?
80
+ result.keep_if do |k, v|
81
+ fact_names.any? {|f| !v[f].nil? }
82
+ end
83
+ end
84
+ result
85
+ end
86
+
72
87
  # get nodes and their facts for a pattern
73
88
  #
74
89
  # @param query mongodb query
@@ -1,3 +1,3 @@
1
1
  module PuppetDBQuery
2
- VERSION = "0.0.26".freeze
2
+ VERSION = "0.0.27".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.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Meyling