Enabling Flake8 and import sorting
Enabling flake8 verifications in tox.ini and adding import sorting.
All the plugins have been fixed for flake8 errors and the imports
have been sorted.
Change-Id: Icdefe9a877e891a683cc833315e4c3f94fffbab9
Signed-off-by: sousaedu <eduardo.sousa@canonical.com>
diff --git a/NG-RO/osm_ng_ro/html_out.py b/NG-RO/osm_ng_ro/html_out.py
index 132bf68..1b01cb8 100644
--- a/NG-RO/osm_ng_ro/html_out.py
+++ b/NG-RO/osm_ng_ro/html_out.py
@@ -15,9 +15,10 @@
Contains html text in variables to make and html response
"""
-import yaml
-from http import HTTPStatus
from html import escape as html_escape
+from http import HTTPStatus
+
+import yaml
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py
index b95667f..706454d 100644
--- a/NG-RO/osm_ng_ro/ns.py
+++ b/NG-RO/osm_ng_ro/ns.py
@@ -16,39 +16,39 @@
# limitations under the License.
##
-# import yaml
+from http import HTTPStatus
import logging
-from typing import Any, Dict, Tuple
+from random import choice as random_choice
+from threading import Lock
+from time import time
from traceback import format_exc as traceback_format_exc
-from osm_ng_ro.ns_thread import NsWorker, NsWorkerException, deep_get
-from osm_ng_ro.validation import validate_input, deploy_schema
+from typing import Any, Dict, Tuple
+from uuid import uuid4
+
+from cryptography.hazmat.backends import default_backend as crypto_default_backend
+from cryptography.hazmat.primitives import serialization as crypto_serialization
+from cryptography.hazmat.primitives.asymmetric import rsa
+from jinja2 import (
+ Environment,
+ StrictUndefined,
+ TemplateError,
+ TemplateNotFound,
+ UndefinedError,
+)
from osm_common import (
- dbmongo,
dbmemory,
+ dbmongo,
fslocal,
fsmongo,
- msglocal,
msgkafka,
+ msglocal,
version as common_version,
)
from osm_common.dbbase import DbException
from osm_common.fsbase import FsException
from osm_common.msgbase import MsgException
-from http import HTTPStatus
-from uuid import uuid4
-from threading import Lock
-from random import choice as random_choice
-from time import time
-from jinja2 import (
- Environment,
- TemplateError,
- TemplateNotFound,
- StrictUndefined,
- UndefinedError,
-)
-from cryptography.hazmat.primitives import serialization as crypto_serialization
-from cryptography.hazmat.primitives.asymmetric import rsa
-from cryptography.hazmat.backends import default_backend as crypto_default_backend
+from osm_ng_ro.ns_thread import deep_get, NsWorker, NsWorkerException
+from osm_ng_ro.validation import deploy_schema, validate_input
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
min_common_version = "0.1.16"
diff --git a/NG-RO/osm_ng_ro/ns_thread.py b/NG-RO/osm_ng_ro/ns_thread.py
index 5df74c5..01c894d 100644
--- a/NG-RO/osm_ng_ro/ns_thread.py
+++ b/NG-RO/osm_ng_ro/ns_thread.py
@@ -24,25 +24,23 @@
A ro_task can contain several 'tasks', each one with a target, where to store the results
"""
-import logging
-import queue
-import threading
-import time
-import yaml
from copy import deepcopy
from http import HTTPStatus
+import logging
from os import mkdir
-from importlib_metadata import entry_points
+import queue
from shutil import rmtree
+import threading
+import time
from unittest.mock import Mock
-# from osm_common import dbmongo, dbmemory, fslocal, fsmongo, msglocal, msgkafka, version as common_version
+from importlib_metadata import entry_points
from osm_common.dbbase import DbException
-from osm_ro_plugin.vim_dummy import VimDummyConnector
-from osm_ro_plugin.sdn_dummy import SdnDummyConnector
-from osm_ro_plugin import vimconn, sdnconn
from osm_ng_ro.vim_admin import LockRenew
-
+from osm_ro_plugin import sdnconn, vimconn
+from osm_ro_plugin.sdn_dummy import SdnDummyConnector
+from osm_ro_plugin.vim_dummy import VimDummyConnector
+import yaml
__author__ = "Alfonso Tierno"
__date__ = "$28-Sep-2017 12:07:15$"
diff --git a/NG-RO/osm_ng_ro/ro_main.py b/NG-RO/osm_ng_ro/ro_main.py
index c9cad85..eb5ff6c 100644
--- a/NG-RO/osm_ng_ro/ro_main.py
+++ b/NG-RO/osm_ng_ro/ro_main.py
@@ -18,29 +18,30 @@
# limitations under the License.
##
-import cherrypy
-import time
+
+from codecs import getreader
+import getopt
+from http import HTTPStatus
import json
-import yaml
-import osm_ng_ro.html_out as html
import logging
import logging.handlers
-import getopt
+from os import environ, path
import sys
+import time
-from osm_ng_ro.ns import Ns, NsException
-from osm_ng_ro.validation import ValidationError
-from osm_ng_ro.vim_admin import VimAdminThread
+import cherrypy
from osm_common.dbbase import DbException
from osm_common.fsbase import FsException
from osm_common.msgbase import MsgException
-from http import HTTPStatus
-from codecs import getreader
-from os import environ, path
from osm_ng_ro import version as ro_version, version_date as ro_version_date
+import osm_ng_ro.html_out as html
+from osm_ng_ro.ns import Ns, NsException
+from osm_ng_ro.validation import ValidationError
+from osm_ng_ro.vim_admin import VimAdminThread
+import yaml
+
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
-
__version__ = "0.1." # file version, not NBI version
version_date = "May 2020"
diff --git a/NG-RO/osm_ng_ro/tests/test_ns.py b/NG-RO/osm_ng_ro/tests/test_ns.py
index 6cc5f77..34590c1 100644
--- a/NG-RO/osm_ng_ro/tests/test_ns.py
+++ b/NG-RO/osm_ng_ro/tests/test_ns.py
@@ -16,7 +16,7 @@
#######################################################################################
import unittest
-from unittest.mock import patch, Mock
+from unittest.mock import Mock, patch
from osm_ng_ro.ns import Ns
diff --git a/NG-RO/osm_ng_ro/validation.py b/NG-RO/osm_ng_ro/validation.py
index efd940c..91ea613 100644
--- a/NG-RO/osm_ng_ro/validation.py
+++ b/NG-RO/osm_ng_ro/validation.py
@@ -13,9 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from jsonschema import validate as js_v, exceptions as js_e
from http import HTTPStatus
+from jsonschema import exceptions as js_e, validate as js_v
+
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
__version__ = "0.1"
version_date = "Jun 2020"
diff --git a/NG-RO/osm_ng_ro/vim_admin.py b/NG-RO/osm_ng_ro/vim_admin.py
index d875272..2582ee2 100644
--- a/NG-RO/osm_ng_ro/vim_admin.py
+++ b/NG-RO/osm_ng_ro/vim_admin.py
@@ -19,15 +19,15 @@
It is in charge of load tasks assigned to VIMs that nobody is in chage of it
"""
-import logging
-import threading
import asyncio
from http import HTTPStatus
+import logging
+import threading
+from time import time
-from osm_common import dbmongo, dbmemory, msglocal, msgkafka
+from osm_common import dbmemory, dbmongo, msgkafka, msglocal
from osm_common.dbbase import DbException
from osm_common.msgbase import MsgException
-from time import time
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
diff --git a/NG-RO/setup.py b/NG-RO/setup.py
index 4661386..b60a3b8 100644
--- a/NG-RO/setup.py
+++ b/NG-RO/setup.py
@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from setuptools import setup, find_packages
+from setuptools import find_packages, setup
_name = "osm_ng_ro"
_version_command = ("git describe --match v* --tags --long --dirty", "pep440-git-full")