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-azure
/
osm_rovim_azure
/
vimconn_azure.py
diff --git
a/RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
b/RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
index
362d14e
..
332a1ea
100755
(executable)
--- a/
RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
+++ b/
RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
@@
-57,7
+57,6
@@
def find_in_list(the_list, condition_lambda):
class vimconnector(vimconn.VimConnector):
class vimconnector(vimconn.VimConnector):
-
# Translate azure provisioning state to OSM provision state
# The first three ones are the transitional status once a user initiated action has been requested
# Once the operation is complete, it will transition into the states Succeeded or Failed
# Translate azure provisioning state to OSM provision state
# The first three ones are the transitional status once a user initiated action has been requested
# Once the operation is complete, it will transition into the states Succeeded or Failed
@@
-415,7
+414,7
@@
class vimconnector(vimconn.VimConnector):
return
except CloudError as e:
if e.error.error and "notfound" in e.error.error.lower():
return
except CloudError as e:
if e.error.error and "notfound" in e.error.error.lower():
- pass
+ self.logger.exception("CloudError Exception occured.")
# continue and create it
else:
self._format_vimconn_exception(e)
# continue and create it
else:
self._format_vimconn_exception(e)
@@
-995,7
+994,6
@@
class vimconnector(vimconn.VimConnector):
self._format_vimconn_exception(e)
def _build_os_profile(self, vm_name, cloud_config, image_id):
self._format_vimconn_exception(e)
def _build_os_profile(self, vm_name, cloud_config, image_id):
-
# initial os_profile
os_profile = {"computer_name": vm_name}
# initial os_profile
os_profile = {"computer_name": vm_name}
@@
-1426,7
+1424,6
@@
class vimconnector(vimconn.VimConnector):
self._format_vimconn_exception(e)
def delete_inuse_nic(self, nic_name):
self._format_vimconn_exception(e)
def delete_inuse_nic(self, nic_name):
-
# Obtain nic data
nic_data = self.conn_vnet.network_interfaces.get(self.resource_group, nic_name)
# Obtain nic data
nic_data = self.conn_vnet.network_interfaces.get(self.resource_group, nic_name)
@@
-1449,7
+1446,6
@@
class vimconnector(vimconn.VimConnector):
# TODO - check if there is a public ip to delete and delete it
if network_interfaces:
# TODO - check if there is a public ip to delete and delete it
if network_interfaces:
-
# Deallocate the vm
async_vm_deallocate = (
self.conn_compute.virtual_machines.begin_deallocate(
# Deallocate the vm
async_vm_deallocate = (
self.conn_compute.virtual_machines.begin_deallocate(
@@
-1481,7
+1477,7
@@
class vimconnector(vimconn.VimConnector):
nic_delete.wait()
self.logger.debug("deleted NIC name: %s", nic_name)
nic_delete.wait()
self.logger.debug("deleted NIC name: %s", nic_name)
- def delete_vminstance(self, vm_id, created_items=None):
+ def delete_vminstance(self, vm_id, created_items=None
, volumes_to_hold=None
):
"""Deletes a vm instance from the vim."""
self.logger.debug(
"deleting VM instance {} - {}".format(self.resource_group, vm_id)
"""Deletes a vm instance from the vim."""
self.logger.debug(
"deleting VM instance {} - {}".format(self.resource_group, vm_id)
@@
-2010,6
+2006,16
@@
class vimconnector(vimconn.VimConnector):
# TODO: Add support for migration
raise vimconn.VimConnNotImplemented("Not implemented")
# TODO: Add support for migration
raise vimconn.VimConnNotImplemented("Not implemented")
+ def resize_instance(self, vm_id, flavor_id=None):
+ """
+ resize a vdu
+ param:
+ vm_id: ID of an instance
+ flavor_id: flavor id to resize the vdu
+ """
+ # TODO: Add support for resize
+ raise vimconn.VimConnNotImplemented("Not implemented")
+
if __name__ == "__main__":
# Init logger
if __name__ == "__main__":
# Init logger