Reformat files according to new black validation
Change-Id: Ia8570535a3d06b87fcf4c7ef6652256086d5fdc1
Signed-off-by: Gulsum Atici <gulsum.atici@canonical.com>
diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py
index f2e3405..d964912 100644
--- a/NG-RO/osm_ng_ro/ns.py
+++ b/NG-RO/osm_ng_ro/ns.py
@@ -1008,12 +1008,10 @@
== "persistent-storage:persistent-storage"
):
for vdu_volume in vdu_instantiation_volumes_list:
-
if (
vdu_volume["vim-volume-id"]
and root_disk["id"] == vdu_volume["name"]
):
-
persistent_root_disk[vsd["id"]] = {
"vim_volume_id": vdu_volume["vim-volume-id"],
"image_id": vdu.get("sw-image-desc"),
@@ -1025,7 +1023,6 @@
return disk_list, persistent_root_disk
else:
-
if root_disk.get("size-of-storage"):
persistent_root_disk[vsd["id"]] = {
"image_id": vdu.get("sw-image-desc"),
@@ -1065,9 +1062,7 @@
and disk["id"] not in persistent_root_disk.keys()
):
for vdu_volume in vdu_instantiation_volumes_list:
-
if vdu_volume["vim-volume-id"] and disk["id"] == vdu_volume["name"]:
-
persistent_disk[disk["id"]] = {
"vim_volume_id": vdu_volume["vim-volume-id"],
}
@@ -1282,9 +1277,11 @@
)
if vdu_instantiation_volumes_list:
-
# Find the root volumes and add to the disk_list
- (disk_list, persistent_root_disk,) = Ns.find_persistent_root_volumes(
+ (
+ disk_list,
+ persistent_root_disk,
+ ) = Ns.find_persistent_root_volumes(
vnfd, target_vdu, vdu_instantiation_volumes_list, disk_list
)
@@ -1298,7 +1295,6 @@
)
else:
-
# vdu_instantiation_volumes_list is empty
for vdu in vnfd.get("vdu", ()):
if vdu["name"] == target_vdu["vdu-name"]:
@@ -1434,7 +1430,6 @@
vim_details = yaml.safe_load(f"{vim_details_text}")
for iface_index, interface in enumerate(existing_vdu["interfaces"]):
-
if "port-security-enabled" in interface:
interface["port_security"] = interface.pop("port-security-enabled")
@@ -2773,7 +2768,6 @@
task_index += 1
break
else:
-
for vdu_index, vdu in enumerate(db_vnfr["vdur"]):
extra_dict["params"] = {
"vim_vm_id": vdu["vim-id"],
diff --git a/NG-RO/osm_ng_ro/ns_thread.py b/NG-RO/osm_ng_ro/ns_thread.py
index 80d4aa7..2a3c57c 100644
--- a/NG-RO/osm_ng_ro/ns_thread.py
+++ b/NG-RO/osm_ng_ro/ns_thread.py
@@ -1037,7 +1037,6 @@
return self.new(ro_task, task_create_index, None)
def new(self, ro_task, task_index, task_depends):
-
task = ro_task["tasks"][task_index]
task_id = task["task_id"]
target_vim = self.my_vims[ro_task["target_id"]]
@@ -2419,7 +2418,10 @@
)
if task["action"] == "DELETE":
- (new_status, db_vim_info_update,) = self._delete_task(
+ (
+ new_status,
+ db_vim_info_update,
+ ) = self._delete_task(
ro_task, task_index, task_depends, db_ro_task_update
)
new_status = (
@@ -2467,7 +2469,10 @@
else:
refresh_at = ro_task["vim_info"]["refresh_at"]
if refresh_at and refresh_at != -1 and now > refresh_at:
- (new_status, db_vim_info_update,) = self.item2class[
+ (
+ new_status,
+ db_vim_info_update,
+ ) = self.item2class[
task["item"]
].refresh(ro_task)
_update_refresh(new_status)
diff --git a/NG-RO/osm_ng_ro/tests/test_ns.py b/NG-RO/osm_ng_ro/tests/test_ns.py
index af44850..02561b7 100644
--- a/NG-RO/osm_ng_ro/tests/test_ns.py
+++ b/NG-RO/osm_ng_ro/tests/test_ns.py
@@ -1494,7 +1494,6 @@
self,
epa_params,
):
-
target_flavor = {}
indata = {
"vnf": [
@@ -1521,7 +1520,6 @@
self,
epa_params,
):
-
target_flavor = {
"no-target-flavor": "here",
}
@@ -1544,7 +1542,6 @@
self,
epa_params,
):
-
expected_result = {
"find_params": {
"flavor_data": {
@@ -1589,7 +1586,6 @@
self,
epa_params,
):
-
expected_result = {
"find_params": {
"flavor_data": {
@@ -1747,7 +1743,6 @@
self,
epa_params,
):
-
expected_result = {
"find_params": {
"flavor_data": {
@@ -1924,7 +1919,6 @@
self,
epa_params,
):
-
expected_result = {
"find_params": {
"flavor_data": {
diff --git a/NG-RO/osm_ng_ro/vim_admin.py b/NG-RO/osm_ng_ro/vim_admin.py
index 3350d43..b6e34e1 100644
--- a/NG-RO/osm_ng_ro/vim_admin.py
+++ b/NG-RO/osm_ng_ro/vim_admin.py
@@ -39,7 +39,6 @@
class LockRenew:
-
renew_list = []
# ^ static method, common for all RO. Time ordered list of dictionaries with information of locks that needs to
# be renewed. The time order is achieved as it is appended at the end
diff --git a/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/tests/test_sdn_asssist_juniper_contrail.py b/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/tests/test_sdn_asssist_juniper_contrail.py
index 8ef04e1..144603a 100644
--- a/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/tests/test_sdn_asssist_juniper_contrail.py
+++ b/RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/tests/test_sdn_asssist_juniper_contrail.py
@@ -35,7 +35,6 @@
@patch("osm_rosdn_juniper_contrail.sdn_api.UnderlayApi")
def test_juniper_contrail_sdn_with_ssl_cert(self, mock_underlay_api):
-
config = {
"ca_cert": "/path/to/certfile",
"project": "test_project",
diff --git a/RO-VIM-aws/osm_rovim_aws/vimconn_aws.py b/RO-VIM-aws/osm_rovim_aws/vimconn_aws.py
index 5fc0704..41dde2c 100644
--- a/RO-VIM-aws/osm_rovim_aws/vimconn_aws.py
+++ b/RO-VIM-aws/osm_rovim_aws/vimconn_aws.py
@@ -865,7 +865,6 @@
else:
for index, subnet in enumerate(net_list):
-
net_intr = self.conn_vpc.create_network_interface(
subnet_id=subnet.get("net_id"),
groups=None,
diff --git a/RO-VIM-azure/osm_rovim_azure/vimconn_azure.py b/RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
index 0b31d02..332a1ea 100755
--- a/RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
+++ b/RO-VIM-azure/osm_rovim_azure/vimconn_azure.py
@@ -57,7 +57,6 @@
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
@@ -995,7 +994,6 @@
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}
@@ -1426,7 +1424,6 @@
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)
@@ -1449,7 +1446,6 @@
# 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(
diff --git a/RO-VIM-gcp/osm_rovim_gcp/vimconn_gcp.py b/RO-VIM-gcp/osm_rovim_gcp/vimconn_gcp.py
index e8ecbb3..04e459d 100644
--- a/RO-VIM-gcp/osm_rovim_gcp/vimconn_gcp.py
+++ b/RO-VIM-gcp/osm_rovim_gcp/vimconn_gcp.py
@@ -40,7 +40,6 @@
class vimconnector(vimconn.VimConnector):
-
# Translate Google Cloud 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
@@ -306,7 +305,6 @@
self.logger.debug("create network name %s, ip_profile %s", net_name, ip_profile)
try:
-
self.logger.debug("creating network_name: {}".format(net_name))
network = "projects/{}/global/networks/default".format(self.project)
@@ -375,7 +373,6 @@
)
try:
-
self.logger.debug("creating subnet_name: {}".format(subnet_name))
subnetwork_body = {
@@ -424,7 +421,6 @@
)
try:
-
if self.reload_client:
self._reload_connection()
@@ -504,7 +500,6 @@
self.logger.debug("Deleting network: {}".format(str(net_id)))
try:
-
net_name = self._get_resource_name_from_resource_id(net_id)
# Check associated VMs
diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
index bbc8426..02d7e85 100644
--- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
+++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
@@ -2553,7 +2553,8 @@
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:
diff --git a/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py b/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py
index a9bd0ff..9ad628b 100644
--- a/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py
+++ b/RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py
@@ -936,7 +936,8 @@
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]
diff --git a/integration-tests/test_vimconn_gcp.py b/integration-tests/test_vimconn_gcp.py
index ea9783b..2285f21 100644
--- a/integration-tests/test_vimconn_gcp.py
+++ b/integration-tests/test_vimconn_gcp.py
@@ -35,7 +35,6 @@
class TestGCPOperations:
-
gcp_conn = None
time_id = datetime.today().strftime("%Y%m%d%H%M%S")
vim_id = "gcp-test-" + time_id
diff --git a/releasenotes/notes/reformat_for_new_black_version-048d755335bacd3a.yaml b/releasenotes/notes/reformat_for_new_black_version-048d755335bacd3a.yaml
new file mode 100644
index 0000000..155dab0
--- /dev/null
+++ b/releasenotes/notes/reformat_for_new_black_version-048d755335bacd3a.yaml
@@ -0,0 +1,20 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+other:
+ - |
+ Reformat files according to new black validation.