diff --git a/openmanod b/openmanod index d87653d2d69baf702de83287f3bb341c15848cca..4cac18c72ab6cd35a5733887a4a82f7b629b7b8e 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 9a2e5e1cf20e5ba951c2d6a923d38e44a7926b34..0782023c2547c962fca66f96f469c78386c4bf27 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 988b6ca0469f04666b319edded7c1bdcd071528b..ef9d62ca4e4f9cbb87e9104a5d7d0d8f37f48c4d 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 073a752274d0ec5149d8552ecdbe9cd11fbcdf5c..4a897a3603d1521a1397899accec303b82ad7058 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: