X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=RO-VIM-openstack%2Fosm_rovim_openstack%2Fvimconn_openstack.py;h=8cb19ffece3996c0f2aa449dafd2848daeb038d2;hp=f6bba2f475bfc84ddd046da0efbb26d027a48d5d;hb=64b39c5deaba0dceb9c5f4844a235c1af84a8bee;hpb=6869ae75906503f44ac538fd2c49270af15db772 diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index f6bba2f4..8cb19ffe 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -72,8 +72,8 @@ netStatus2manoFormat={'ACTIVE':'ACTIVE','PAUSED':'PAUSED','INACTIVE':'INACTIVE', supportedClassificationTypes = ['legacy_flow_classifier'] #global var to have a timeout creating and deleting volumes -volume_timeout = 600 -server_timeout = 600 +volume_timeout = 1800 +server_timeout = 1800 class SafeDumper(yaml.SafeDumper): @@ -395,17 +395,17 @@ class vimconnector(vimconn.vimconnector): # method before the implemented VIM connectors are called. def _format_exception(self, exception): - '''Transform a keystone, nova, neutron exception into a vimconn exception''' + """Transform a keystone, nova, neutron exception into a vimconn exception discovering the cause""" - message_error = exception.message + message_error = str(exception) if isinstance(exception, (neExceptions.NetworkNotFoundClient, nvExceptions.NotFound, ksExceptions.NotFound, gl1Exceptions.HTTPNotFound)): raise vimconn.vimconnNotFoundException(type(exception).__name__ + ": " + message_error) elif isinstance(exception, (HTTPException, gl1Exceptions.HTTPException, gl1Exceptions.CommunicationError, - ConnectionError, ksExceptions.ConnectionError, neExceptions.ConnectionFailed)): + ConnectionError, ksExceptions.ConnectionError, neExceptions.ConnectionFailed)): raise vimconn.vimconnConnectionException(type(exception).__name__ + ": " + message_error) - elif isinstance(exception, (KeyError, nvExceptions.BadRequest, ksExceptions.BadRequest)): + elif isinstance(exception, (KeyError, nvExceptions.BadRequest, ksExceptions.BadRequest)): raise vimconn.vimconnException(type(exception).__name__ + ": " + message_error) elif isinstance(exception, (nvExceptions.ClientException, ksExceptions.ClientException, neExceptions.NeutronException)): @@ -514,7 +514,8 @@ class vimconnector(vimconn.vimconnector): 'dhcp_start_address': ip_schema, first IP to grant 'dhcp_count': number of IPs to grant. 'shared': if this network can be seen/use by other tenants/organization - 'provider_network_profile': (optional) contains {segmentation-id: vlan, provider-network: vim_netowrk} + 'provider_network_profile': (optional) contains {segmentation-id: vlan, network-type: vlan|vxlan, + physical-network: physnet-label} Returns a tuple with the network identifier and created_items, or raises an exception on error created_items can be None or a dictionary where this method can include key-values that will be passed to the method delete_network. Can be used to store created segments, created l2gw connections, etc. @@ -557,7 +558,10 @@ class vimconnector(vimconn.vimconnector): if not self.config.get('multisegment_support'): network_dict["provider:physical_network"] = provider_physical_network - network_dict["provider:network_type"] = "vlan" + if provider_network_profile and "network-type" in provider_network_profile: + network_dict["provider:network_type"] = provider_network_profile["network-type"] + else: + network_dict["provider:network_type"] = self.config.get('dataplane_network_type','vlan') if vlan: network_dict["provider:segmentation_id"] = vlan else: