Pin flake8 version in tox.ini to 6.1.0
[osm/RO.git] / RO-VIM-vmware / osm_rovim_vmware / vimconn_vmware.py
index e06b2f9..6852747 100644 (file)
@@ -936,7 +936,8 @@ class vimconnector(vimconn.VimConnector):
 
     def get_network(self, net_id):
         """Method obtains network details of net_id VIM network
-        Return a dict with  the fields at filter_dict (see get_network_list) plus some VIM specific>}, ...]"""
+        Return a dict with  the fields at filter_dict (see get_network_list) plus some VIM specific>}, ...]
+        """
         try:
             _, vdc = self.get_vdc_details()
             vdc_id = vdc.get("id").split(":")[3]
@@ -5450,18 +5451,18 @@ class vimconnector(vimconn.VimConnector):
                     return None
 
                 if add_vdc_rest_url is not None and provider_vdc_ref is not None:
-                    data = """ <CreateVdcParams name="{0:s}" xmlns="http://www.vmware.com/vcloud/v1.5"><Description>{1:s}</Description>
-                            <AllocationModel>ReservationPool</AllocationModel>
-                            <ComputeCapacity><Cpu><Units>MHz</Units><Allocated>2048</Allocated><Limit>2048</Limit></Cpu>
-                            <Memory><Units>MB</Units><Allocated>2048</Allocated><Limit>2048</Limit></Memory>
-                            </ComputeCapacity><NicQuota>0</NicQuota><NetworkQuota>100</NetworkQuota>
-                            <VdcStorageProfile><Enabled>true</Enabled><Units>MB</Units><Limit>20480</Limit><Default>true</Default></VdcStorageProfile>
-                            <ProviderVdcReference
-                            name="Main Provider"
-                            href="{2:s}" />
-                    <UsesFastProvisioning>true</UsesFastProvisioning></CreateVdcParams>""".format(
-                        escape(vdc_name), escape(vdc_name), provider_vdc_ref
-                    )
+                    data = (
+                        ' <CreateVdcParams name="{0:s}" xmlns="http://www.vmware.com/vcloud/v1.5">'
+                        "<Description>{1:s}</Description>"
+                        "<AllocationModel>ReservationPool</AllocationModel>"
+                        "<ComputeCapacity><Cpu><Units>MHz</Units><Allocated>2048</Allocated><Limit>2048</Limit>"
+                        "</Cpu><Memory><Units>MB</Units><Allocated>2048</Allocated><Limit>2048</Limit></Memory>"
+                        "</ComputeCapacity><NicQuota>0</NicQuota><NetworkQuota>100</NetworkQuota>"
+                        "<VdcStorageProfile><Enabled>true</Enabled><Units>MB</Units><Limit>20480</Limit>"
+                        "<Default>true</Default></VdcStorageProfile>"
+                        '<ProviderVdcReference name="Main Provider" href="{2:s}" />'
+                        "<UsesFastProvisioning>true</UsesFastProvisioning></CreateVdcParams>"
+                    ).format(escape(vdc_name), escape(vdc_name), provider_vdc_ref)
                     headers[
                         "Content-Type"
                     ] = "application/vnd.vmware.admin.createVdcParams+xml"
@@ -6329,7 +6330,7 @@ class vimconnector(vimconn.VimConnector):
                         ].spec.ip.ipAddress
 
                         for device in vm_obj.config.hardware.device:
-                            if type(device) == vim.vm.device.VirtualPCIPassthrough:
+                            if device.isinstance(vim.vm.device.VirtualPCIPassthrough):
                                 device_details = {
                                     "devide_id": device.backing.id,
                                     "pciSlotNumber": device.slotInfo.pciSlotNumber,