Fix flake8 errors in vCD connector
[osm/RO.git] / RO-VIM-vmware / osm_rovim_vmware / vimconn_vmware.py
index 5a58cf9..b0a6ed3 100644 (file)
@@ -1907,6 +1907,7 @@ class vimconnector(vimconn.VimConnector):
         start=False,
         image_id=None,
         flavor_id=None,
+        affinity_group_list=[],
         net_list=[],
         cloud_config=None,
         disk_list=None,
@@ -5457,18 +5458,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"
@@ -6230,7 +6231,7 @@ class vimconnector(vimconn.VimConnector):
                     )
                     return None
 
-                deviceId = hex(host_pci_dev.deviceId % 2 ** 16).lstrip("0x")
+                deviceId = hex(host_pci_dev.deviceId % 2**16).lstrip("0x")
                 backing = vim.VirtualPCIPassthroughDeviceBackingInfo(
                     deviceId=deviceId,
                     id=host_pci_dev.id,
@@ -7493,13 +7494,10 @@ if [ "$1" = "precustomization" ];then
 
                 for device in devices:
                     if type(device) is vim.vm.device.VirtualDisk:
-                        if (
-                            isinstance(
-                                device.backing,
-                                vim.vm.device.VirtualDisk.FlatVer2BackingInfo,
-                            )
-                            and hasattr(device.backing, "fileName")
-                        ):
+                        if isinstance(
+                            device.backing,
+                            vim.vm.device.VirtualDisk.FlatVer2BackingInfo,
+                        ) and hasattr(device.backing, "fileName"):
                             disk_info["full_path"] = device.backing.fileName
                             disk_info["datastore"] = device.backing.datastore
                             disk_info["capacityKB"] = device.capacityInKB