X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ice_validator%2Ftests%2Fhelpers.py;h=fd78c7581fc9227f9e9ef4a6569f1c0c6cfa1303;hb=9ccbfe7e20b3914c37c0dec50762cec9da8a63c6;hp=c73a1181bada0f433823820c38025151ea733187;hpb=503041fb7ec395fe57e418d584c4a5d06f4c9877;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/helpers.py b/ice_validator/tests/helpers.py index c73a118..fd78c75 100644 --- a/ice_validator/tests/helpers.py +++ b/ice_validator/tests/helpers.py @@ -324,3 +324,17 @@ def prop_iterator(resource, *props): yield from prop_iterator(x, *props) elif isinstance(prop, dict): yield from prop_iterator(prop, *props) + + +def get_param(property_value): + """ + Returns the first parameter name from a get_param or None if get_param is + not used + """ + if property_value and isinstance(property_value, dict): + param = property_value.get("get_param") + if param and isinstance(param, list) and len(param) > 0: + return param[0] + else: + return param + return None