diff options
author | Ezhilarasi <ezhrajam@in.ibm.com> | 2019-09-18 21:14:44 +0530 |
---|---|---|
committer | Ezhilarasi R <ezhrajam@in.ibm.com> | 2019-09-18 16:03:19 +0000 |
commit | f5190cf61981eff1eb59157d4d2f8bd06acb3570 (patch) | |
tree | ad636c971242fdfbca8f264fe07ba7c6cf9b7339 | |
parent | 083e8d0575d80d5d539a4ef83d8f4800074b7bcd (diff) |
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.py | 8 |
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" + |