From: tierno Date: Thu, 4 Jul 2019 16:23:20 +0000 (+0000) Subject: Feature 7318 check vim-create connectivity and credentials X-Git-Tag: v6.0.4rc1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=fda8ff303ad0a3315fb74e2b3d3e14143ee73260;p=osm%2FRO.git Feature 7318 check vim-create connectivity and credentials change version to be aligned with OSM Change-Id: Id5a95c51397a4b8722bd8042cabf0f2f0c67d684 Signed-off-by: tierno --- diff --git a/openmanod b/openmanod index d87653d2..4cac18c7 100755 --- a/openmanod +++ b/openmanod @@ -53,8 +53,8 @@ import osm_ro __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ = "$26-aug-2014 11:09:29$" -__version__ = "0.6.20" -version_date = "May 2019" +__version__ = "6.0.2.post0" +version_date = "Aug 2019" database_version = 39 # expected database schema version global global_config diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index 9a2e5e1c..0782023c 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -5189,7 +5189,13 @@ def datacenter_action(mydb, tenant_id, datacenter, action_dict): #get datacenter info datacenter_id, myvim = get_datacenter_by_name_uuid(mydb, tenant_id, datacenter) - if 'net-update' in action_dict: + if 'check-connectivity' in action_dict: + try: + myvim.check_vim_connectivity() + except vimconn.vimconnException as e: + #logger.error("nfvo.datacenter_action() Not possible to get_network_list from VIM: %s ", str(e)) + raise NfvoException(str(e), e.http_code) + elif 'net-update' in action_dict: try: nets = myvim.get_network_list(filter_dict={'shared': True, 'admin_state_up': True, 'status': 'ACTIVE'}) #print content diff --git a/osm_ro/openmano_schemas.py b/osm_ro/openmano_schemas.py index 988b6ca0..ef9d62ca 100644 --- a/osm_ro/openmano_schemas.py +++ b/osm_ro/openmano_schemas.py @@ -257,8 +257,9 @@ datacenter_action_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "type":"object", "properties":{ - "net-update":{"type":"null",}, - "net-edit":{ + "check-connectivity": {"type": "null"}, + "net-update": {"type": "null"}, + "net-edit": { "type":"object", "properties":{ "net": name_schema, #name or uuid of net to change diff --git a/osm_ro/vimconn_openstack.py b/osm_ro/vimconn_openstack.py index 073a7522..4a897a36 100644 --- a/osm_ro/vimconn_openstack.py +++ b/osm_ro/vimconn_openstack.py @@ -448,6 +448,10 @@ class vimconnector(vimconn.vimconnector): self.security_groups_id = None raise vimconn.vimconnConnectionException("Not found security group {} for this tenant".format(sg)) + def check_vim_connectivity(self): + # just get network list to check connectivity and credentials + self.get_network_list(filter_dict={}) + def get_tenant_list(self, filter_dict={}): '''Obtain tenants of VIM filter_dict can contain the following keys: