- continue # lets only check parameters shall we?
-
- # checking parameter uses get_param
- parameter = nested_dict.get(prop, "get_param")
- if not parameter:
- msg = (
- "Unexpected parameter format for OS::Neutron::Port {} property {}: {}. "
- + "Please consult the heat guidelines documentation for details."
- ).format(rid, resource_property, prop)
- invalid_ips.append(msg) # should this be a failure?
- continue
-
- # getting parameter if the get_param uses list, and getting official HEAT parameter type
- parameter_type = parameter_type_to_heat_type(parameter)
- if parameter_type == "comma_delimited_list":
- parameter = parameter[0]
- elif parameter_type != "string":
- continue
-
- # checking parameter format = type defined in template
- heat_parameter_type = nested_dict.get(heat_parameters, parameter, "type")
- if not heat_parameter_type or heat_parameter_type != parameter_type:
- msg = (
- "OS::Neutron::Port {} parameter {} defined as type {} "
- + "is being used as type {} in the heat template"
- ).format(
- resource_property, parameter, heat_parameter_type, parameter_type
- )
- invalid_ips.append(msg)
- continue
-
- # if parameter type is not in regx dict, then it is not supported by automation
- regx_dict = regx[port_type].get(parameter_type)
- if not regx_dict:
- msg = (
- "WARNING: OS::Neutron::Port {} parameter {} defined as type {} "
- + "is not supported by platform automation. If this VNF is not able "
- + "to adhere to this requirement, please consult the Heat Orchestration "
- + "Template guidelines for alternative solutions. If already adhering to "
- + "an alternative provided by the heat guidelines, please disregard this "
- + "message."
- ).format(resource_property, parameter, parameter_type)
- invalid_ips.append(msg)
- continue
-
- # checking if param adheres to guidelines format
- regexp = regx[port_type][parameter_type]["machine"]
- readable_format = regx[port_type][parameter_type]["readable"]
- match = regexp.match(parameter)
- if not match:
- msg = "{} parameter {} does not follow format {}".format(
- resource_property, parameter, readable_format
- )
- invalid_ips.append(msg)
- continue
-
- # checking that parameter includes correct vm_type/network_role
- parameter_checks = regx.get("parameter_to_resource_comparisons", [])
- for check in parameter_checks:
- resource_match = port_match.group(check)
- if (
- resource_match
- and not parameter.startswith(resource_match)
- and parameter.find("_{}_".format(resource_match)) == -1
- ):
+
+ # checking parameter uses get_param
+ parameter = param.get("get_param")
+ if not parameter:
+ msg = (
+ "Unexpected parameter format for {} {} property {}: {}. "
+ + "Please consult the heat guidelines documentation for details."
+ ).format(resource_type, rid, properties, param)
+ invalid_parameters.append(msg) # should this be a failure?
+ continue
+
+ # getting parameter if the get_param uses list, and getting official HEAT parameter type
+ parameter_type = parameter_type_to_heat_type(parameter)
+ if parameter_type == "comma_delimited_list":
+ parameter = parameter[0]
+ elif parameter_type != "string":
+ continue
+
+ # checking parameter format = parameter type defined in parameters section
+ heat_parameter_type = nested_dict.get(heat_parameters, parameter, "type")
+ if not heat_parameter_type or heat_parameter_type != parameter_type: