aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzhilarasi <ezhrajam@in.ibm.com>2019-09-18 21:14:44 +0530
committerEzhilarasi R <ezhrajam@in.ibm.com>2019-09-18 16:03:19 +0000
commitf5190cf61981eff1eb59157d4d2f8bd06acb3570 (patch)
treead636c971242fdfbca8f264fe07ba7c6cf9b7339
parent083e8d0575d80d5d539a4ef83d8f4800074b7bcd (diff)
added Is_nova_server method to helpers5.0.15.0.0
Added is_nova_server check to helpers to remove coginitve complexity in test files Change-Id: I20e68730947cc6472d693eca782bbee36a3c9e1b Issue-ID: VVP-285 Signed-off-by: Ezhilarasi <ezhrajam@in.ibm.com>
-rw-r--r--ice_validator/tests/helpers.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ice_validator/tests/helpers.py b/ice_validator/tests/helpers.py
index fefa8de..291464d 100644
--- a/ice_validator/tests/helpers.py
+++ b/ice_validator/tests/helpers.py
@@ -412,3 +412,11 @@ def remove(sequence, exclude, key=None):
key_func = key if key else lambda x: x
result = (s for s in sequence if key_func(s) not in exclude)
return set(result) if isinstance(sequence, Set) else list(result)
+
+
+def is_nova_server(resource):
+ """
+ checks resource is a nova server
+ """
+ return isinstance(resource, dict) and "type" in resource and "properties" in resource and resource.get("type") == "OS::Nova::Server"
+