invalid_networks = []
for k, v in yml["resources"].items():
- if not isinstance(v, dict):
- continue
- if "properties" not in v:
+ if not has_properties(v):
continue
if property_uses_get_resource(v, "network"):
continue
networks = []
for k, v in yml["resources"].items():
- if not isinstance(v, dict):
- continue
- if "properties" not in v:
+ if not has_properties(v) or v.get("type") not in ["OS::Neutron::Net"]:
continue
# need to check if contrail networks also require subnet
# and it is defined the same as neutron networks
# if v.get("type") not in NETWORK_RESOURCE_TYPES:
- if v.get("type") not in ["OS::Neutron::Net"]:
- continue
networks.append(k)
for k, v in yml["resources"].items():
- if not isinstance(v, dict):
- continue
- if "properties" not in v:
- continue
- if v.get("type") != "OS::Neutron::Subnet":
+ if not has_properties(v) and v.get("type") != "OS::Neutron::Subnet":
continue
network_prop = v.get("properties", {}).get("network", {}).get("get_resource")
x += 1
assert not networks, "Networks detected without subnet {}".format(networks)
+
+
+def has_properties(resource):
+ """
+ checks resource is a Neutron Subnet
+ """
+ return isinstance(resource, dict) and "properties" in resource
import pytest
from tests import cached_yaml as yaml
-from .helpers import validates
+from .helpers import validates, is_nova_server
@validates("R-901331", "R-481670", "R-663631")
invalid_nova_servers = set()
for k, v in yml["resources"].items():
- if not isinstance(v, dict):
- continue
- if "properties" not in v:
- continue
- if "type" not in v:
- continue
- if v["type"] != "OS::Nova::Server":
+ if not is_nova_server(v):
continue
for k2, v2 in v["properties"].items():
- If more than one vm_type is detected all vm_types will
be returned
"""
- if not isinstance(resource, dict):
- return set()
if not is_nova_server(resource):
return set()
def is_nova_server(resource):
- return (
- "type" in resource
- and "properties" in resource
- and resource.get("type") == "OS::Nova::Server"
- )
+ return isinstance(resource, dict) and "type" in resource and "properties" in resource and resource.get("type") == "OS::Nova::Server"
def get_vm_type_for_nova_server(resource):
#
#
-VERSION = "5.0.0"
+VERSION = "5.0.1"
BRANCH = "master"
RELEASE = "elalto"
<groupId>org.onap.vvp.validation-scripts</groupId>
<artifactId>validation-scripts</artifactId>
<packaging>pom</packaging>
- <version>5.0.0</version>
+ <version>5.0.1</version>
<name>vvp-validation-scripts</name>
<properties>
--- /dev/null
+distribution_type: 'container'
+container_release_tag: '5.0.1'
+project: 'vvp'
+log_dir: 'vvp-validation-scripts-master-docker-java-daily/259/'
+ref: f5190cf61981eff1eb59157d4d2f8bd06acb3570
+containers:
+ - name: 'vvp/validation-scripts'
+ version: '5.0.0-20190925T142421Z'