Clean up imports based on flake8

A number of changes were done to the imports in the files.
 - Clean up flake8 H301 multiple imports per line
 - Remove noqa from top of files, allowing flake8 to run
on all files.
 - Clean up relative imports in most places. This will
simplify python3 support later.
 - Partially sort the imports. A later commit will
enable that check since doing that here would have made
the changeset even bigger.

Story: 2003499
Task: 26561
Change-Id: Id5f95559f0d4604f4db1a1d74098063fd510142c
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
changes/91/604191/2
Al Bailey 4 years ago
parent 2d39affda2
commit 65a8eca8e1
  1. 2
      nfv/nfv-client/nfv_client/openstack/openstack.py
  2. 2
      nfv/nfv-client/nfv_client/openstack/sw_update.py
  3. 30
      nfv/nfv-client/nfv_client/sw_update/__init__.py
  4. 3
      nfv/nfv-client/setup.py
  5. 27
      nfv/nfv-common/nfv_common/alarm/__init__.py
  6. 10
      nfv/nfv-common/nfv_common/alarm/_alarm_module.py
  7. 7
      nfv/nfv-common/nfv_common/alarm/_alarm_thread.py
  8. 4
      nfv/nfv-common/nfv_common/alarm/handlers/v1/__init__.py
  9. 4
      nfv/nfv-common/nfv_common/alarm/objects/__init__.py
  10. 14
      nfv/nfv-common/nfv_common/alarm/objects/v1/__init__.py
  11. 4
      nfv/nfv-common/nfv_common/alarm/objects/v1/_alarm_defs.py
  12. 4
      nfv/nfv-common/nfv_common/catalog/__init__.py
  13. 2
      nfv/nfv-common/nfv_common/catalog/_catalog_module.py
  14. 16
      nfv/nfv-common/nfv_common/catalog/model/__init__.py
  15. 3
      nfv/nfv-common/nfv_common/catalog/model/_defs.py
  16. 3
      nfv/nfv-common/nfv_common/catalog/model/_vnf_descriptor.py
  17. 5
      nfv/nfv-common/nfv_common/catalog/plugin/v1/_catalog_plugin.py
  18. 18
      nfv/nfv-common/nfv_common/debug/__init__.py
  19. 2
      nfv/nfv-common/nfv_common/debug/_debug_config.py
  20. 3
      nfv/nfv-common/nfv_common/debug/_debug_defs.py
  21. 14
      nfv/nfv-common/nfv_common/debug/_debug_log.py
  22. 12
      nfv/nfv-common/nfv_common/debug/_debug_module.py
  23. 4
      nfv/nfv-common/nfv_common/debug/_debug_thread.py
  24. 23
      nfv/nfv-common/nfv_common/event_log/__init__.py
  25. 8
      nfv/nfv-common/nfv_common/event_log/_event_log_module.py
  26. 2
      nfv/nfv-common/nfv_common/event_log/_event_log_thread.py
  27. 4
      nfv/nfv-common/nfv_common/event_log/handlers/v1/__init__.py
  28. 4
      nfv/nfv-common/nfv_common/event_log/objects/__init__.py
  29. 15
      nfv/nfv-common/nfv_common/event_log/objects/v1/__init__.py
  30. 4
      nfv/nfv-common/nfv_common/event_log/objects/v1/_event_log_defs.py
  31. 39
      nfv/nfv-common/nfv_common/forensic/__init__.py
  32. 2
      nfv/nfv-common/nfv_common/forensic/_analysis.py
  33. 11
      nfv/nfv-common/nfv_common/forensic/_nfv_vim_parser.py
  34. 7
      nfv/nfv-common/nfv_common/schedule/__init__.py
  35. 15
      nfv/nfv-common/nfv_common/selobj/__init__.py
  36. 7
      nfv/nfv-common/nfv_common/selobj/_selobj_module.py
  37. 17
      nfv/nfv-common/nfv_common/state_machine/__init__.py
  38. 2
      nfv/nfv-common/nfv_common/state_machine/_state_machine.py
  39. 7
      nfv/nfv-common/nfv_common/state_machine/_state_task.py
  40. 5
      nfv/nfv-common/nfv_common/state_machine/_state_task_result.py
  41. 2
      nfv/nfv-common/nfv_common/state_machine/_state_task_work.py
  42. 3
      nfv/nfv-common/nfv_common/state_machine/_state_task_work_result.py
  43. 22
      nfv/nfv-common/nfv_common/strategy/__init__.py
  44. 8
      nfv/nfv-common/nfv_common/strategy/_strategy.py
  45. 4
      nfv/nfv-common/nfv_common/strategy/_strategy_defs.py
  46. 11
      nfv/nfv-common/nfv_common/strategy/_strategy_phase.py
  47. 3
      nfv/nfv-common/nfv_common/strategy/_strategy_result.py
  48. 7
      nfv/nfv-common/nfv_common/strategy/_strategy_stage.py
  49. 2
      nfv/nfv-common/nfv_common/strategy/_strategy_step.py
  50. 11
      nfv/nfv-common/nfv_common/tasks/__init__.py
  51. 8
      nfv/nfv-common/nfv_common/tasks/_task.py
  52. 2
      nfv/nfv-common/nfv_common/tasks/_task_future.py
  53. 13
      nfv/nfv-common/nfv_common/tasks/_task_scheduler.py
  54. 2
      nfv/nfv-common/nfv_common/tasks/_task_work.py
  55. 4
      nfv/nfv-common/nfv_common/tasks/_task_worker.py
  56. 2
      nfv/nfv-common/nfv_common/tasks/_task_worker_pool.py
  57. 6
      nfv/nfv-common/nfv_common/tasks/unit_test.py
  58. 6
      nfv/nfv-common/nfv_common/tcp/__init__.py
  59. 2
      nfv/nfv-common/nfv_common/tcp/_tcp_server.py
  60. 6
      nfv/nfv-common/nfv_common/tcp/unit_test.py
  61. 6
      nfv/nfv-common/nfv_common/thread/__init__.py
  62. 6
      nfv/nfv-common/nfv_common/thread/_thread.py
  63. 3
      nfv/nfv-common/nfv_common/thread/_thread_progress_marker.py
  64. 19
      nfv/nfv-common/nfv_common/timers/__init__.py
  65. 2
      nfv/nfv-common/nfv_common/timers/_timer.py
  66. 4
      nfv/nfv-common/nfv_common/timers/_timer_module.py
  67. 2
      nfv/nfv-common/nfv_common/timers/_timer_scheduler.py
  68. 2
      nfv/nfv-common/nfv_common/timers/_timestamp.py
  69. 3
      nfv/nfv-common/setup.py
  70. 3
      nfv/nfv-docs/doc_builder.py
  71. 2
      nfv/nfv-plugins/nfv_plugins/alarm_handlers/file_storage.py
  72. 2
      nfv/nfv-plugins/nfv_plugins/alarm_handlers/fm.py
  73. 2
      nfv/nfv-plugins/nfv_plugins/event_log_handlers/file_storage.py
  74. 2
      nfv/nfv-plugins/nfv_plugins/event_log_handlers/fm.py
  75. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_block_storage_api.py
  76. 25
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_compute_api.py
  77. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_guest_api.py
  78. 8
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_identity_api.py
  79. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_image_api.py
  80. 24
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_infrastructure_api.py
  81. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_network_api.py
  82. 8
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/nfvi_sw_mgmt_api.py
  83. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/ceilometer.py
  84. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/cinder.py
  85. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/fm.py
  86. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/glance.py
  87. 8
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/guest.py
  88. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/heat.py
  89. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/keystone.py
  90. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/mtc.py
  91. 10
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/neutron.py
  92. 15
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/nova.py
  93. 8
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/objects.py
  94. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/openstack.py
  95. 2
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/openstack_log.py
  96. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/patching.py
  97. 19
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/rest_api.py
  98. 9
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/rpc_listener.py
  99. 4
      nfv/nfv-plugins/nfv_plugins/nfvi_plugins/openstack/sysinv.py
  100. 3
      nfv/nfv-plugins/setup.py
  101. Some files were not shown because too many files have changed in this diff Show More

@ -6,7 +6,7 @@
import json
import urllib2
from objects import Token
from nfv_client.openstack.objects import Token
class OpenStackServices(object):

@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#
import json
import rest_api
from nfv_client.openstack import rest_api
class StrategyStep(object):

@ -2,19 +2,17 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _sw_update import STRATEGY_NAME_SW_PATCH
from _sw_update import STRATEGY_NAME_SW_UPGRADE
from _sw_update import APPLY_TYPE_SERIAL
from _sw_update import APPLY_TYPE_PARALLEL
from _sw_update import APPLY_TYPE_IGNORE
from _sw_update import INSTANCE_ACTION_MIGRATE
from _sw_update import INSTANCE_ACTION_STOP_START
from _sw_update import ALARM_RESTRICTIONS_STRICT
from _sw_update import ALARM_RESTRICTIONS_RELAXED
from _sw_update import create_strategy
from _sw_update import delete_strategy
from _sw_update import apply_strategy
from _sw_update import abort_strategy
from _sw_update import show_strategy
from nfv_client.sw_update._sw_update import STRATEGY_NAME_SW_PATCH # noqa: F401
from nfv_client.sw_update._sw_update import STRATEGY_NAME_SW_UPGRADE # noqa: F401
from nfv_client.sw_update._sw_update import APPLY_TYPE_SERIAL # noqa: F401
from nfv_client.sw_update._sw_update import APPLY_TYPE_PARALLEL # noqa: F401
from nfv_client.sw_update._sw_update import APPLY_TYPE_IGNORE # noqa: F401
from nfv_client.sw_update._sw_update import INSTANCE_ACTION_MIGRATE # noqa: F401
from nfv_client.sw_update._sw_update import INSTANCE_ACTION_STOP_START # noqa: F401
from nfv_client.sw_update._sw_update import ALARM_RESTRICTIONS_STRICT # noqa: F401
from nfv_client.sw_update._sw_update import ALARM_RESTRICTIONS_RELAXED # noqa: F401
from nfv_client.sw_update._sw_update import create_strategy # noqa: F401
from nfv_client.sw_update._sw_update import delete_strategy # noqa: F401
from nfv_client.sw_update._sw_update import apply_strategy # noqa: F401
from nfv_client.sw_update._sw_update import abort_strategy # noqa: F401
from nfv_client.sw_update._sw_update import show_strategy # noqa: F401

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from setuptools import setup, find_packages
from setuptools import find_packages
from setuptools import setup
setup(
name='nfv_client',

@ -3,17 +3,18 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from objects.v1 import ALARM_CONTEXT
from objects.v1 import ALARM_TYPE
from objects.v1 import ALARM_EVENT_TYPE
from objects.v1 import ALARM_PROBABLE_CAUSE
from objects.v1 import ALARM_SEVERITY
from objects.v1 import ALARM_TREND_INDICATION
from objects.v1 import AlarmStateData
from objects.v1 import AlarmThresholdData
from objects.v1 import AlarmData
from nfv_common.alarm.objects.v1 import ALARM_CONTEXT # noqa: F401
from nfv_common.alarm.objects.v1 import ALARM_TYPE # noqa: F401
from nfv_common.alarm.objects.v1 import ALARM_EVENT_TYPE # noqa: F401
from nfv_common.alarm.objects.v1 import ALARM_PROBABLE_CAUSE # noqa: F401
from nfv_common.alarm.objects.v1 import ALARM_SEVERITY # noqa: F401
from nfv_common.alarm.objects.v1 import ALARM_TREND_INDICATION # noqa: F401
from nfv_common.alarm.objects.v1 import AlarmStateData # noqa: F401
from nfv_common.alarm.objects.v1 import AlarmThresholdData # noqa: F401
from nfv_common.alarm.objects.v1 import AlarmData # noqa: F401
from _alarm_module import alarm_raise, alarm_clear
from _alarm_module import alarm_subsystem_sane, alarm_initialize, alarm_finalize
from nfv_common.alarm._alarm_module import alarm_clear # noqa: F401
from nfv_common.alarm._alarm_module import alarm_finalize # noqa: F401
from nfv_common.alarm._alarm_module import alarm_initialize # noqa: F401
from nfv_common.alarm._alarm_module import alarm_raise # noqa: F401
from nfv_common.alarm._alarm_module import alarm_subsystem_sane # noqa: F401

@ -12,7 +12,7 @@ def alarm_raise(alarm_uuid, alarm_data):
"""
Raise an alarm
"""
from _alarm_thread import AlarmThread
from nfv_common.alarm._alarm_thread import AlarmThread
AlarmThread().alarm_raise(alarm_uuid, alarm_data)
@ -20,7 +20,7 @@ def alarm_clear(alarm_uuid):
"""
Clear an alarm
"""
from _alarm_thread import AlarmThread
from nfv_common.alarm._alarm_thread import AlarmThread
AlarmThread().alarm_clear(alarm_uuid)
@ -28,7 +28,7 @@ def alarm_subsystem_sane():
"""
Returns true if the alarm subsystem is healthy
"""
from _alarm_thread import AlarmThread
from nfv_common.alarm._alarm_thread import AlarmThread
return 600 >= AlarmThread().stall_elapsed_secs
@ -36,7 +36,7 @@ def alarm_initialize(config):
"""
Initialize the alarm subsystem
"""
from _alarm_thread import AlarmThread
from nfv_common.alarm._alarm_thread import AlarmThread
AlarmThread(config).start()
@ -44,5 +44,5 @@ def alarm_finalize():
"""
Finalize the alarm subsystem
"""
from _alarm_thread import AlarmThread
from nfv_common.alarm._alarm_thread import AlarmThread
AlarmThread().stop(max_wait_in_seconds=5)

@ -3,15 +3,16 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import six
import datetime
import six
from nfv_common import debug
from nfv_common import thread
from nfv_common import timers
from nfv_common.helpers import Singleton, coroutine
from nfv_common.helpers import coroutine
from nfv_common.helpers import Singleton
from _alarm_handlers import AlarmHandlers
from nfv_common.alarm._alarm_handlers import AlarmHandlers
DLOG = debug.debug_get_logger('nfv_common.alarm.alarm_thread')

@ -3,6 +3,4 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _alarm_handler import AlarmHandler
from nfv_common.alarm.handlers.v1._alarm_handler import AlarmHandler # noqa: F401

@ -3,6 +3,4 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
import v1
import nfv_common.alarm.objects.v1 # noqa: F401

@ -3,8 +3,12 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _alarm_defs import ALARM_CONTEXT, ALARM_TYPE, ALARM_EVENT_TYPE
from _alarm_defs import ALARM_PROBABLE_CAUSE, ALARM_SEVERITY, ALARM_TREND_INDICATION
from _alarm_data import AlarmData, AlarmStateData, AlarmThresholdData
from nfv_common.alarm.objects.v1._alarm_defs import ALARM_CONTEXT # noqa: F401
from nfv_common.alarm.objects.v1._alarm_defs import ALARM_EVENT_TYPE # noqa: F401
from nfv_common.alarm.objects.v1._alarm_defs import ALARM_TYPE # noqa: F401
from nfv_common.alarm.objects.v1._alarm_defs import ALARM_PROBABLE_CAUSE # noqa: F401
from nfv_common.alarm.objects.v1._alarm_defs import ALARM_SEVERITY # noqa: F401
from nfv_common.alarm.objects.v1._alarm_defs import ALARM_TREND_INDICATION # noqa: F401
from nfv_common.alarm.objects.v1._alarm_data import AlarmData # noqa: F401
from nfv_common.alarm.objects.v1._alarm_data import AlarmStateData # noqa: F401
from nfv_common.alarm.objects.v1._alarm_data import AlarmThresholdData # noqa: F401

@ -5,7 +5,9 @@
#
import six
from nfv_common.helpers import Constants, Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Constants
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -3,6 +3,4 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
import model
import nfv_common.catalog.model # noqa: F401

@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from _catalog_backend import CatalogBackend
from nfv_common.catalog._catalog_backend import CatalogBackend
_catalog_backend = None

@ -3,9 +3,13 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _defs import CONNECTION_TYPE, CONNECTIVITY_TYPE
from _vnf_descriptor import VNFD, ConnectionPointVNFD, VirtualLink
from _vnf_descriptor import DeploymentFlavor, ConstituentVDU
from _vnf_descriptor import VDU, VNFC, ConnectionPointVNFC
from nfv_common.catalog.model._defs import CONNECTION_TYPE # noqa: F401
from nfv_common.catalog.model._defs import CONNECTIVITY_TYPE # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import ConnectionPointVNFC # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import ConnectionPointVNFD # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import ConstituentVDU # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import DeploymentFlavor # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import VDU # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import VirtualLink # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import VNFC # noqa: F401
from nfv_common.catalog.model._vnf_descriptor import VNFD # noqa: F401

@ -4,7 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#
import six
from nfv_common.helpers import Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -3,7 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from _defs import CONNECTIVITY_TYPE, CONNECTION_TYPE
from nfv_common.catalog.model._defs import CONNECTION_TYPE
from nfv_common.catalog.model._defs import CONNECTIVITY_TYPE
#
# Virtual Network Function Descriptor - Class Layout

@ -4,7 +4,10 @@
# SPDX-License-Identifier: Apache-2.0
#
import six
from abc import ABCMeta, abstractproperty, abstractmethod
from abc import ABCMeta
from abc import abstractmethod
from abc import abstractproperty
@six.add_metaclass(ABCMeta)

@ -2,11 +2,13 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _debug_defs import DEBUG_LEVEL
from _debug_log import debug_trace, debug_get_logger, debug_dump_loggers
from _debug_module import debug_register_config_change_callback
from _debug_module import debug_deregister_config_change_callback
from _debug_module import debug_get_config, debug_reload_config
from _debug_module import debug_initialize, debug_finalize
from nfv_common.debug._debug_defs import DEBUG_LEVEL # noqa: F401
from nfv_common.debug._debug_log import debug_trace # noqa: F401
from nfv_common.debug._debug_log import debug_get_logger # noqa: F401
from nfv_common.debug._debug_log import debug_dump_loggers # noqa: F401
from nfv_common.debug._debug_module import debug_register_config_change_callback # noqa: F401
from nfv_common.debug._debug_module import debug_deregister_config_change_callback # noqa: F401
from nfv_common.debug._debug_module import debug_get_config # noqa: F401
from nfv_common.debug._debug_module import debug_reload_config # noqa: F401
from nfv_common.debug._debug_module import debug_initialize # noqa: F401
from nfv_common.debug._debug_module import debug_finalize # noqa: F401

@ -6,7 +6,7 @@
import six
from six.moves import configparser
from _debug_defs import DEBUG_LEVEL
from nfv_common.debug._debug_defs import DEBUG_LEVEL
from nfv_common.helpers import Singleton

@ -5,7 +5,8 @@
#
import six
from nfv_common.helpers import Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -3,17 +3,17 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import datetime
import functools
import inspect
import logging
import os
import six
import sys
import inspect
import logging
import datetime
import functools
from _debug_defs import DEBUG_LEVEL
from _debug_thread import DebugLoggingThread
from _debug_module import Debug
from nfv_common.debug._debug_defs import DEBUG_LEVEL
from nfv_common.debug._debug_thread import DebugLoggingThread
from nfv_common.debug._debug_module import Debug
_debug_loggers = {}

@ -8,9 +8,9 @@ import sys
from nfv_common.helpers import Singleton
from _debug_defs import DEBUG_LEVEL
from _debug_config import DebugConfig
from _debug_thread import DebugLoggingThread
from nfv_common.debug._debug_defs import DEBUG_LEVEL
from nfv_common.debug._debug_config import DebugConfig
from nfv_common.debug._debug_thread import DebugLoggingThread
@six.add_metaclass(Singleton)
@ -47,7 +47,8 @@ class Debug(object):
"""
Load debug configuration settings
"""
from _debug_log import debug_get_logger, debug_set_loggers_level
from nfv_common.debug._debug_log import debug_get_logger
from nfv_common.debug._debug_log import debug_set_loggers_level
if self._debug_config is not None:
self._debug_config.load()
@ -61,7 +62,8 @@ class Debug(object):
"""
Reload debug configuration settings
"""
from _debug_log import debug_get_logger, debug_set_loggers_level
from nfv_common.debug._debug_log import debug_get_logger
from nfv_common.debug._debug_log import debug_set_loggers_level
if self._debug_config is not None:
self._debug_config.load()

@ -3,11 +3,11 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import logging
import multiprocessing
import six
import sys
import logging
import threading
import multiprocessing
from logging.handlers import SysLogHandler

@ -3,14 +3,15 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from objects.v1 import EVENT_ID
from objects.v1 import EVENT_CONTEXT
from objects.v1 import EVENT_TYPE
from objects.v1 import EVENT_IMPORTANCE
from objects.v1 import EVENT_INITIATED_BY
from objects.v1 import EventLogStateData
from objects.v1 import EventLogThresholdData, EventLogData
from _event_log_module import event_log, event_log_subsystem_sane
from _event_log_module import event_log_initialize, event_log_finalize
from nfv_common.event_log.objects.v1 import EVENT_ID # noqa: F401
from nfv_common.event_log.objects.v1 import EVENT_CONTEXT # noqa: F401
from nfv_common.event_log.objects.v1 import EVENT_TYPE # noqa: F401
from nfv_common.event_log.objects.v1 import EVENT_IMPORTANCE # noqa: F401
from nfv_common.event_log.objects.v1 import EVENT_INITIATED_BY # noqa: F401
from nfv_common.event_log.objects.v1 import EventLogStateData # noqa: F401
from nfv_common.event_log.objects.v1 import EventLogThresholdData # noqa: F401
from nfv_common.event_log.objects.v1 import EventLogData # noqa: F401
from nfv_common.event_log._event_log_module import event_log # noqa: F401
from nfv_common.event_log._event_log_module import event_log_subsystem_sane # noqa: F401
from nfv_common.event_log._event_log_module import event_log_initialize # noqa: F401
from nfv_common.event_log._event_log_module import event_log_finalize # noqa: F401

@ -9,7 +9,7 @@ def event_log(log_data):
"""
Log a particular event
"""
from _event_log_thread import EventLogThread
from nfv_common.event_log._event_log_thread import EventLogThread
EventLogThread().log(log_data)
@ -17,7 +17,7 @@ def event_log_subsystem_sane():
"""
Returns true if the event log subsystem is healthy
"""
from _event_log_thread import EventLogThread
from nfv_common.event_log._event_log_thread import EventLogThread
return 600 >= EventLogThread().stall_elapsed_secs
@ -25,7 +25,7 @@ def event_log_initialize(config):
"""
Initialize the event log subsystem
"""
from _event_log_thread import EventLogThread
from nfv_common.event_log._event_log_thread import EventLogThread
EventLogThread(config).start()
@ -33,5 +33,5 @@ def event_log_finalize():
"""
Finalize the event log subsystem
"""
from _event_log_thread import EventLogThread
from nfv_common.event_log._event_log_thread import EventLogThread
EventLogThread().stop(max_wait_in_seconds=5)

@ -9,7 +9,7 @@ from nfv_common import debug
from nfv_common import thread
from nfv_common.helpers import Singleton
from _event_log_handlers import EventLogHandlers
from nfv_common.event_log._event_log_handlers import EventLogHandlers
DLOG = debug.debug_get_logger('nfv_common.event_log.event_log_thread')

@ -3,6 +3,4 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _event_log_handler import EventLogHandler
from nfv_common.event_log.handlers.v1._event_log_handler import EventLogHandler # noqa: F401

@ -3,6 +3,4 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
import v1
import nfv_common.event_log.objects.v1 # noqa: F401

@ -3,10 +3,11 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _event_log_defs import EVENT_ID, EVENT_CONTEXT, EVENT_TYPE, EVENT_IMPORTANCE
from _event_log_defs import EVENT_INITIATED_BY
from _event_log_data import EventLogStateData
from _event_log_data import EventLogThresholdData
from _event_log_data import EventLogData
from nfv_common.event_log.objects.v1._event_log_defs import EVENT_ID # noqa: F401
from nfv_common.event_log.objects.v1._event_log_defs import EVENT_CONTEXT # noqa: F401
from nfv_common.event_log.objects.v1._event_log_defs import EVENT_TYPE # noqa: F401
from nfv_common.event_log.objects.v1._event_log_defs import EVENT_IMPORTANCE # noqa: F401
from nfv_common.event_log.objects.v1._event_log_defs import EVENT_INITIATED_BY # noqa: F401
from nfv_common.event_log.objects.v1._event_log_data import EventLogStateData # noqa: F401
from nfv_common.event_log.objects.v1._event_log_data import EventLogThresholdData # noqa: F401
from nfv_common.event_log.objects.v1._event_log_data import EventLogData # noqa: F401

@ -5,7 +5,9 @@
#
import six
from nfv_common.helpers import Constants, Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Constants
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -3,23 +3,22 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _evidence import evidence_from_files
from _analysis import analysis_instance_start_success
from _analysis import analysis_instance_stop_success
from _analysis import analysis_instance_pause_success
from _analysis import analysis_instance_unpause_success
from _analysis import analysis_instance_suspend_success
from _analysis import analysis_instance_resume_success
from _analysis import analysis_instance_reboot_success
from _analysis import analysis_instance_rebuild_success
from _analysis import analysis_instance_live_migrate_success
from _analysis import analysis_instance_cold_migrate_success
from _analysis import analysis_instance_cold_migrate_confirm_success
from _analysis import analysis_instance_cold_migrate_revert_success
from _analysis import analysis_instance_resize_success
from _analysis import analysis_instance_resize_confirm_success
from _analysis import analysis_instance_resize_revert_success
from _analysis import analysis_stdout
from _forensic_module import forensic_initialize, forensic_finalize
from nfv_common.forensic._evidence import evidence_from_files # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_start_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_stop_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_pause_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_unpause_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_suspend_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_resume_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_reboot_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_rebuild_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_live_migrate_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_cold_migrate_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_cold_migrate_confirm_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_cold_migrate_revert_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_resize_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_resize_confirm_success # noqa: F401
from nfv_common.forensic._analysis import analysis_instance_resize_revert_success # noqa: F401
from nfv_common.forensic._analysis import analysis_stdout # noqa: F401
from nfv_common.forensic._forensic_module import forensic_initialize # noqa: F401
from nfv_common.forensic._forensic_module import forensic_finalize # noqa: F401

@ -5,7 +5,7 @@
#
from nfv_common import debug
from _defs import NFV_VIM
from nfv_common.forensic._defs import NFV_VIM
DLOG = debug.debug_get_logger('forensic-analysis')

@ -3,13 +3,18 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import datetime
import os
import re
import yaml
import datetime
from pyparsing import Word, Combine, Suppress, Literal, Regex
from pyparsing import nums, alphas
from pyparsing import alphas
from pyparsing import Combine
from pyparsing import Literal
from pyparsing import nums
from pyparsing import Regex
from pyparsing import Suppress
from pyparsing import Word
class NfvVimParser(object):

@ -3,7 +3,6 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _schedule_module import schedule_function_call
from _schedule_module import schedule_initialize, schedule_finalize
from nfv_common.schedule._schedule_module import schedule_function_call # noqa: F401
from nfv_common.schedule._schedule_module import schedule_initialize # noqa: F401
from nfv_common.schedule._schedule_module import schedule_finalize # noqa: F401

@ -3,9 +3,12 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _selobj_module import selobj_add_read_obj, selobj_del_read_obj
from _selobj_module import selobj_add_write_obj, selobj_del_write_obj
from _selobj_module import selobj_add_error_callback, selobj_del_error_callback
from _selobj_module import selobj_dispatch, selobj_initialize, selobj_finalize
from nfv_common.selobj._selobj_module import selobj_add_read_obj # noqa: F401
from nfv_common.selobj._selobj_module import selobj_del_read_obj # noqa: F401
from nfv_common.selobj._selobj_module import selobj_add_write_obj # noqa: F401
from nfv_common.selobj._selobj_module import selobj_del_write_obj # noqa: F401
from nfv_common.selobj._selobj_module import selobj_add_error_callback # noqa: F401
from nfv_common.selobj._selobj_module import selobj_del_error_callback # noqa: F401
from nfv_common.selobj._selobj_module import selobj_dispatch # noqa: F401
from nfv_common.selobj._selobj_module import selobj_initialize # noqa: F401
from nfv_common.selobj._selobj_module import selobj_finalize # noqa: F401

@ -3,9 +3,9 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import socket
import select
import errno
import select
import socket
from nfv_common import debug
@ -85,7 +85,8 @@ def selobj_dispatch(timeout_in_ms):
Dispatch selection objects that have become readable or writeable
within the given time period
"""
from nfv_common import timers, histogram
from nfv_common import histogram
from nfv_common import timers
global _read_callbacks, _write_callbacks, _error_callbacks

@ -3,12 +3,11 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _state import State
from _state_task import StateTask
from _state_task_work import StateTaskWork
from _state_task_result import STATE_TASK_RESULT, state_task_result_update
from _state_task_work_result import STATE_TASK_WORK_RESULT
from _state_exception import StateException
from _state_machine import StateMachine
from nfv_common.state_machine._state import State # noqa: F401
from nfv_common.state_machine._state_task import StateTask # noqa: F401
from nfv_common.state_machine._state_task_work import StateTaskWork # noqa: F401
from nfv_common.state_machine._state_task_result import STATE_TASK_RESULT # noqa: F401
from nfv_common.state_machine._state_task_result import state_task_result_update # noqa: F401
from nfv_common.state_machine._state_task_work_result import STATE_TASK_WORK_RESULT # noqa: F401
from nfv_common.state_machine._state_exception import StateException # noqa: F401
from nfv_common.state_machine._state_machine import StateMachine # noqa: F401

@ -7,7 +7,7 @@ import weakref
from nfv_common import debug
from _state_exception import StateException
from nfv_common.state_machine._state_exception import StateException
DLOG = debug.debug_get_logger('nfv_common.state_machine.state_machine')

@ -3,12 +3,13 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import timers
from nfv_common import debug
from nfv_common import timers
from nfv_common.helpers import coroutine
from _state_task_result import STATE_TASK_RESULT, state_task_result_update
from _state_task_work_result import STATE_TASK_WORK_RESULT
from nfv_common.state_machine._state_task_result import STATE_TASK_RESULT
from nfv_common.state_machine._state_task_result import state_task_result_update
from nfv_common.state_machine._state_task_work_result import STATE_TASK_WORK_RESULT
DLOG = debug.debug_get_logger('nfv_common.state_machine.state_task')

@ -5,9 +5,10 @@
#
import six
from nfv_common.helpers import Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Singleton
from _state_task_work_result import STATE_TASK_WORK_RESULT
from nfv_common.state_machine._state_task_work_result import STATE_TASK_WORK_RESULT
@six.add_metaclass(Singleton)

@ -7,7 +7,7 @@ import weakref
from nfv_common import debug
from _state_task_result import STATE_TASK_WORK_RESULT
from nfv_common.state_machine._state_task_result import STATE_TASK_WORK_RESULT
DLOG = debug.debug_get_logger('nfv_common.state_machine.state_task_work')

@ -5,7 +5,8 @@
#
import six
from nfv_common.helpers import Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -3,13 +3,15 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _strategy_defs import STRATEGY_APPLY_TYPE, STRATEGY_STATE, STRATEGY_PHASE
from _strategy_defs import STRATEGY_ALARM_RESTRICTION_TYPES
from _strategy_result import STRATEGY_RESULT, STRATEGY_PHASE_RESULT
from _strategy_result import STRATEGY_STAGE_RESULT, STRATEGY_STEP_RESULT
from _strategy_step import StrategyStep
from _strategy_stage import StrategyStage
from _strategy_phase import StrategyPhase
from _strategy import Strategy
from nfv_common.strategy._strategy_defs import STRATEGY_APPLY_TYPE # noqa: F401
from nfv_common.strategy._strategy_defs import STRATEGY_STATE # noqa: F401
from nfv_common.strategy._strategy_defs import STRATEGY_PHASE # noqa: F401
from nfv_common.strategy._strategy_defs import STRATEGY_ALARM_RESTRICTION_TYPES # noqa: F401
from nfv_common.strategy._strategy_result import STRATEGY_RESULT # noqa: F401
from nfv_common.strategy._strategy_result import STRATEGY_PHASE_RESULT # noqa: F401
from nfv_common.strategy._strategy_result import STRATEGY_STAGE_RESULT # noqa: F401
from nfv_common.strategy._strategy_result import STRATEGY_STEP_RESULT # noqa: F401
from nfv_common.strategy._strategy_step import StrategyStep # noqa: F401
from nfv_common.strategy._strategy_stage import StrategyStage # noqa: F401
from nfv_common.strategy._strategy_phase import StrategyPhase # noqa: F401
from nfv_common.strategy._strategy import Strategy # noqa: F401

@ -7,9 +7,11 @@ import json
from nfv_common import debug
from _strategy_defs import STRATEGY_PHASE, STRATEGY_STATE
from _strategy_result import STRATEGY_RESULT, strategy_result_update
from _strategy_phase import StrategyPhase
from nfv_common.strategy._strategy_defs import STRATEGY_PHASE
from nfv_common.strategy._strategy_defs import STRATEGY_STATE
from nfv_common.strategy._strategy_result import STRATEGY_RESULT
from nfv_common.strategy._strategy_result import strategy_result_update
from nfv_common.strategy._strategy_phase import StrategyPhase
DLOG = debug.debug_get_logger('nfv_common.strategy')

@ -5,7 +5,9 @@
#
import six
from nfv_common.helpers import Constant, Constants, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Constants
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -7,14 +7,15 @@ import weakref
from datetime import datetime
from nfv_common import timers
from nfv_common import debug
from nfv_common import timers
from nfv_common.helpers import coroutine
from _strategy_defs import STRATEGY_PHASE
from _strategy_result import STRATEGY_PHASE_RESULT, STRATEGY_STAGE_RESULT
from _strategy_result import STRATEGY_STEP_RESULT
from _strategy_result import strategy_phase_result_update
from nfv_common.strategy._strategy_defs import STRATEGY_PHASE
from nfv_common.strategy._strategy_result import STRATEGY_PHASE_RESULT
from nfv_common.strategy._strategy_result import STRATEGY_STAGE_RESULT
from nfv_common.strategy._strategy_result import STRATEGY_STEP_RESULT
from nfv_common.strategy._strategy_result import strategy_phase_result_update
DLOG = debug.debug_get_logger('nfv_common.strategy.phase')

@ -5,7 +5,8 @@
#
import six
from nfv_common.helpers import Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Singleton
@six.add_metaclass(Singleton)

@ -7,12 +7,13 @@ import weakref
from datetime import datetime
from nfv_common import timers
from nfv_common import debug
from nfv_common import timers
from nfv_common.helpers import coroutine
from _strategy_result import STRATEGY_STAGE_RESULT, STRATEGY_STEP_RESULT
from _strategy_result import strategy_stage_result_update
from nfv_common.strategy._strategy_result import STRATEGY_STAGE_RESULT
from nfv_common.strategy._strategy_result import STRATEGY_STEP_RESULT
from nfv_common.strategy._strategy_result import strategy_stage_result_update
DLOG = debug.debug_get_logger('nfv_common.strategy.stage')

@ -7,7 +7,7 @@ import weakref
from nfv_common import debug
from _strategy_result import STRATEGY_STEP_RESULT
from nfv_common.strategy._strategy_result import STRATEGY_STEP_RESULT
DLOG = debug.debug_get_logger('nfv_common.strategy.step')

@ -3,9 +3,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _task import TASK_PRIORITY, Task
from _task_future import TaskFuture
from _task_scheduler import TaskScheduler
from _task_worker_pool import TaskWorkerPool
from nfv_common.tasks._task import TASK_PRIORITY # noqa: F401
from nfv_common.tasks._task import Task # noqa: F401
from nfv_common.tasks._task_future import TaskFuture # noqa: F401
from nfv_common.tasks._task_scheduler import TaskScheduler # noqa: F401
from nfv_common.tasks._task_worker_pool import TaskWorkerPool # noqa: F401

@ -3,13 +3,15 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import six
import collections
import six
from nfv_common import debug
from nfv_common.helpers import Constants, Constant, Singleton
from nfv_common.helpers import Constant
from nfv_common.helpers import Constants
from nfv_common.helpers import Singleton
from _task_result import TaskResult
from nfv_common.tasks._task_result import TaskResult
DLOG = debug.debug_get_logger('nfv_common.tasks.task')

@ -5,7 +5,7 @@
#
from nfv_common import debug
from _task_work import TaskWork
from nfv_common.tasks._task_work import TaskWork
DLOG = debug.debug_get_logger('nfv_common.tasks.task_future')

@ -3,18 +3,19 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import inspect
import collections
import inspect
from nfv_common import debug
from nfv_common import timers
from nfv_common import selobj
from nfv_common import selectable
from nfv_common import histogram
from nfv_common import selectable
from nfv_common import selobj
from nfv_common import timers
from nfv_common.helpers import coroutine
from _task import Task, TASK_PRIORITY
from _task_future import TaskFuture
from nfv_common.tasks._task import Task
from nfv_common.tasks._task import TASK_PRIORITY
from nfv_common.tasks._task_future import TaskFuture
DLOG = debug.debug_get_logger('nfv_common.tasks.task_scheduler')

@ -4,8 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import debug
from nfv_common import timers
from nfv_common import exceptions
from nfv_common import timers
from nfv_common.helpers import Result
DLOG = debug.debug_get_logger('nfv_common.tasks.task_work')

@ -3,10 +3,10 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common import thread
from nfv_common import debug
from nfv_common import histogram
from nfv_common import thread
from nfv_common import timers
from nfv_common import debug
DLOG = debug.debug_get_logger('nfv_common.tasks.task_worker')

@ -7,7 +7,7 @@ import collections
from nfv_common import debug
from _task_worker import TaskWorkerThread
from nfv_common.tasks._task_worker import TaskWorkerThread
DLOG = debug.debug_get_logger('nfv_common.tasks.task_worker_pool')

@ -5,14 +5,14 @@
#
import six
from nfv_common import debug
from nfv_common import config
from nfv_common import debug
from nfv_common import selobj
from nfv_common import timers
from nfv_common.helpers import coroutine
from _task_worker_pool import TaskWorkerPool
from _task_scheduler import TaskScheduler
from nfv_common.tasks._task_worker_pool import TaskWorkerPool
from nfv_common.tasks._task_scheduler import TaskScheduler
DLOG = debug.debug_get_logger('unit_test', debug_level=debug.DEBUG_LEVEL.INFO)

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _tcp_connection import TCPConnection
from _tcp_server import TCPServer
from nfv_common.tcp._tcp_connection import TCPConnection # noqa: F401
from nfv_common.tcp._tcp_server import TCPServer # noqa: F401

@ -7,7 +7,7 @@ from nfv_common import debug
from nfv_common import selobj
from nfv_common.helpers import coroutine
from _tcp_connection import TCPConnection
from nfv_common.tcp._tcp_connection import TCPConnection
DLOG = debug.debug_get_logger('nfv_common.tcp')

@ -3,15 +3,15 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import time
import argparse
import time
from nfv_common import debug
from nfv_common import selobj
from nfv_common import timers
from _tcp_server import TCPServer
from _tcp_connection import TCPConnection
from nfv_common.tcp._tcp_server import TCPServer
from nfv_common.tcp._tcp_connection import TCPConnection
def message_handler(client_connection, msg):

@ -3,7 +3,5 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# flake8: noqa
#
from _thread import Thread
from _thread_worker import ThreadWorker
from nfv_common.thread._thread import Thread # noqa: F401
from nfv_common.thread._thread_worker import ThreadWorker # noqa: F401

@ -3,18 +3,18 @@
#
# SPDX-License-Identifier: Apache-2.0
#
import sys
import ctypes
import signal
import sys
from multiprocessing import Process
from nfv_common import debug
from nfv_common import selectable
from nfv_common import selobj
from nfv_common import timers
from nfv_common import selectable
from nfv_common.helpers import coroutine
from _thread_progress_marker import ThreadProgressMarker
from nfv_common.thread._thread_progress_marker import ThreadProgressMarker
DLOG = debug.debug_get_logger('nfv_common.thread')

@ -4,7 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#