aboutsummaryrefslogtreecommitdiffstats
path: root/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2020-03-10 21:09:28 +0000
committerliamfallon <liam.fallon@est.tech>2020-03-11 15:41:13 +0000
commit938108832179d5ca9b28e5cb981ce5602ca59344 (patch)
tree0bdb6b0c3d0b42b42ca8805451c190b707133bfe /examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js
parent4eb64b73443620c8588ee48b54d225326ff4550e (diff)
Adapt vCPE example for Rhino Javascript
Minor changes to Javascript source for execution under the Rhino script engine. Issue-ID: POLICY-2106 Change-Id: Ib7e30ce0067a11ea1bb3ca8d197c796dba9ea091 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js')
-rw-r--r--examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js b/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js
index 2d41e5f90..b16404292 100644
--- a/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js
+++ b/examples/examples-onap-vcpe/src/main/resources/logic/standalone/ConfigureBlackWhiteListTask.js
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,21 +30,24 @@ var targetType = executor.inFields.get("targetType");
var target = executor.inFields.get("target");
var black = executor.inFields.get("black");
-var returnValue = executor.isTrue;
+var returnValue = true;
-if (targetType === "VNF") {
+if (targetType == "VNF") {
executor.getContextAlbum("VnfIdWhiteBlackListAlbum").put(target, black);
executor.logger.info("added VNF ID \"" + target + "\" with black flag \"" + black + "\" to VNF ID list");
}
-else if (targetType === "Service") {
+else if (targetType == "Service") {
executor.getContextAlbum("ServiceIdWhiteBlackListAlbum").put(target, black);
executor.logger.info("added Service ID \"" + target + "\" with black flag \"" + black + "\" to Service ID list");
}
-else if (targetType === "VServer") {
+else if (targetType == "VServer") {
executor.getContextAlbum("VServerIdWhiteBlackListAlbum").put(target, black);
executor.logger.info("added VServer ID \"" + target + "\" with black flag \"" + black + "\" to VServer ID list");
}
else {
executor.logger.warn("unknown target type \"" + targetType + "\" specified");
- returnValue = executor.isFalse;
+ returnValue = false;
}
+
+returnValue;
+