vcenter_lib_mongodb 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vcenter_lib_mongodb/mongodb.rb +2 -2
- data/lib/vcenter_lib_mongodb/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: c75d0f6f35e90e5448cee99d4620aa1467f8fcbe
|
4
|
+
data.tar.gz: e1b47adb7c8e0fc0c1e634a17fe57fdfc2da1c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eded0bdf423a2d746da1d4e44f6310760fcc40d71b72ebebb183ae33fe91cb3f390420df9a3c8952529b65cdce23b4e8c9ed9594b12bf8328ad08068a73801b
|
7
|
+
data.tar.gz: 13d8ce665f819bded3ec7671a3c22db72e512d6cbc928120d6f1620d2a941be15836c6ed6c99efa9d04a38a9467bd151231c3ef67b01db70a489c5ecf6e534d5
|
@@ -34,9 +34,9 @@ module VcenterLibMongodb
|
|
34
34
|
#
|
35
35
|
# @param query [String] a query for VMs.
|
36
36
|
# nil or white space only string will return all VMs
|
37
|
-
# @return [Array<String>] names of
|
37
|
+
# @return [Array<String>] names of VMs that fulfill the query
|
38
38
|
def query_vms(query)
|
39
|
-
return
|
39
|
+
return all_vms if query.nil? || query.strip.empty?
|
40
40
|
mongo_query = convert.query(query)
|
41
41
|
collection = connection[vms_collection]
|
42
42
|
collection.find(mongo_query).batch_size(999).projection(_id: 1).map { |k| k[:_id] }
|