projects
/
osm
/
RO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reformat files according to new black validation
[osm/RO.git]
/
RO-VIM-openstack
/
osm_rovim_openstack
/
vimconn_openstack.py
diff --git
a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
index
3539cc5
..
9faf98d
100644
(file)
--- a/
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
+++ b/
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
@@
-1548,7
+1548,6
@@
class vimconnector(vimconn.VimConnector):
return new_flavor.id
except nvExceptions.Conflict as e:
return new_flavor.id
except nvExceptions.Conflict as e:
-
if change_name_if_used and retry < max_retries:
continue
if change_name_if_used and retry < max_retries:
continue
@@
-1892,7
+1891,6
@@
class vimconnector(vimconn.VimConnector):
# For VF
elif net["type"] == "VF" or net["type"] == "SR-IOV":
# For VF
elif net["type"] == "VF" or net["type"] == "SR-IOV":
-
port_dict["binding:vnic_type"] = "direct"
# VIO specific Changes
port_dict["binding:vnic_type"] = "direct"
# VIO specific Changes
@@
-2080,7
+2078,6
@@
class vimconnector(vimconn.VimConnector):
key_id = "vim_volume_id" if "vim_volume_id" in disk.keys() else "vim_id"
if disk.get(key_id):
key_id = "vim_volume_id" if "vim_volume_id" in disk.keys() else "vim_id"
if disk.get(key_id):
-
block_device_mapping["vd" + chr(base_disk_index)] = disk[key_id]
existing_vim_volumes.append({"id": disk[key_id]})
block_device_mapping["vd" + chr(base_disk_index)] = disk[key_id]
existing_vim_volumes.append({"id": disk[key_id]})
@@
-2160,7
+2157,6
@@
class vimconnector(vimconn.VimConnector):
key_id = "vim_volume_id" if "vim_volume_id" in disk.keys() else "vim_id"
if disk.get(key_id):
key_id = "vim_volume_id" if "vim_volume_id" in disk.keys() else "vim_id"
if disk.get(key_id):
-
# Use existing persistent volume
block_device_mapping["vd" + chr(base_disk_index)] = disk[key_id]
existing_vim_volumes.append({"id": disk[key_id]})
# Use existing persistent volume
block_device_mapping["vd" + chr(base_disk_index)] = disk[key_id]
existing_vim_volumes.append({"id": disk[key_id]})
@@
-2491,7
+2487,6
@@
class vimconnector(vimconn.VimConnector):
# In case of RO in HA there can be conflicts, two RO trying to assign same floating IP, so retry
# several times
while not assigned:
# In case of RO in HA there can be conflicts, two RO trying to assign same floating IP, so retry
# several times
while not assigned:
-
free_floating_ip = self._get_free_floating_ip(
server, floating_network
)
free_floating_ip = self._get_free_floating_ip(
server, floating_network
)
@@
-2588,7
+2583,6
@@
class vimconnector(vimconn.VimConnector):
self.neutron.update_port(port[0], port_update)
except Exception:
self.neutron.update_port(port[0], port_update)
except Exception:
-
raise vimconn.VimConnException(
"It was not possible to disable port security for port {}".format(
port[0]
raise vimconn.VimConnException(
"It was not possible to disable port security for port {}".format(
port[0]
@@
-2895,7
+2889,6
@@
class vimconnector(vimconn.VimConnector):
k_id (str): Port id in the VIM
"""
try:
k_id (str): Port id in the VIM
"""
try:
-
port_dict = self.neutron.list_ports()
existing_ports = [port["id"] for port in port_dict["ports"] if port_dict]
port_dict = self.neutron.list_ports()
existing_ports = [port["id"] for port in port_dict["ports"] if port_dict]
@@
-2903,7
+2896,6
@@
class vimconnector(vimconn.VimConnector):
self.neutron.delete_port(k_id)
except Exception as e:
self.neutron.delete_port(k_id)
except Exception as e:
-
self.logger.error("Error deleting port: {}: {}".format(type(e).__name__, e))
def _delete_volumes_by_id_wth_cinder(
self.logger.error("Error deleting port: {}: {}".format(type(e).__name__, e))
def _delete_volumes_by_id_wth_cinder(
@@
-2985,7
+2977,6
@@
class vimconnector(vimconn.VimConnector):
k_item, k_id = self._get_item_name_id(k)
if k_item == "volume":
k_item, k_id = self._get_item_name_id(k)
if k_item == "volume":
-
unavailable_vol = self._delete_volumes_by_id_wth_cinder(
k, k_id, volumes_to_hold, created_items
)
unavailable_vol = self._delete_volumes_by_id_wth_cinder(
k, k_id, volumes_to_hold, created_items
)
@@
-2994,7
+2985,6
@@
class vimconnector(vimconn.VimConnector):
keep_waiting = True
elif k_item == "floating_ip":
keep_waiting = True
elif k_item == "floating_ip":
-
self._delete_floating_ip_by_id(k, k_id, created_items)
except Exception as e:
self._delete_floating_ip_by_id(k, k_id, created_items)
except Exception as e:
@@
-3216,7
+3206,8
@@
class vimconnector(vimconn.VimConnector):
def action_vminstance(self, vm_id, action_dict, created_items={}):
"""Send and action over a VM instance from VIM
def action_vminstance(self, vm_id, action_dict, created_items={}):
"""Send and action over a VM instance from VIM
- Returns None or the console dict if the action was successfully sent to the VIM"""
+ Returns None or the console dict if the action was successfully sent to the VIM
+ """
self.logger.debug("Action over VM '%s': %s", vm_id, str(action_dict))
try:
self.logger.debug("Action over VM '%s': %s", vm_id, str(action_dict))
try: