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 +4 -4
- data/lib/puppetdb_query/mongodb.rb +15 -0
- 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: e6c38fe303c945961d63d95b9c917d61c8c5c02d
|
4
|
+
data.tar.gz: 1124c261e90d691c2e87e257b3db10c576c3af8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|