fixed cli conditions

This commit is contained in:
Manuel Romero
2022-09-19 12:49:31 +02:00
parent 12f0e627a1
commit 7ec3c6b1c5
2 changed files with 7 additions and 6 deletions

View File

@@ -70,12 +70,12 @@ async function init(type) {
var filter = {
"isDestroyed":false,
"isDeleted": false,
"$or": [ {"runForever":{ "$exists": false }}, {"runForever": false}],
"$and": [{ "$or": [ {"runForever":{ "$exists": false }}, {"runForever": false}]}],
"statusVms": "Stopped",
"$or": [
"$and": [{"$or": [
{ "options": {"$exists": true}, "options.vm1": { "$exists": true } },
{ "vmImage": {"$exists": true}, "vmImage.vm1": { "$exists": true } },
]
]}]
};
if ( type === "warning" ) {
filter.pendingNextAction = {$ne: "destroy"};

View File

@@ -61,13 +61,14 @@ async function init(type) {
var filter = {
"isDestroyed": false,
"isDeleted": false,
"$or": [ {"runForever":{ "$exists": false }}, {"runForever": false}],
"$and": [{ "$or": [ {"runForever":{ "$exists": false }}, {"runForever": false}]}],
"statusVms": "Running",
"$or": [
"$and": [{"$or": [
{ "options": {"$exists": true}, "options.vm1": { "$exists": true } },
{ "vmImage": {"$exists": true}, "vmImage.vm1": { "$exists": true } },
]
]}]
};
if ( type === "warning" ) {
filter.pendingNextAction = { $ne: "stopVms" };
cb = doSendEmailWarning;