diff --git a/karbor/api/v1/plans.py b/karbor/api/v1/plans.py index 3f986b59..0670487b 100644 --- a/karbor/api/v1/plans.py +++ b/karbor/api/v1/plans.py @@ -70,10 +70,6 @@ class PlanViewBuilder(common.ViewBuilder): _collection_name = "plans" - def __init__(self): - """Initialize view builder.""" - super(PlanViewBuilder, self).__init__() - def detail(self, request, plan): """Detailed view of a single plan.""" diff --git a/karbor/api/v1/protectables.py b/karbor/api/v1/protectables.py index e339487b..693f5794 100644 --- a/karbor/api/v1/protectables.py +++ b/karbor/api/v1/protectables.py @@ -56,10 +56,6 @@ class ProtectableViewBuilder(common.ViewBuilder): _collection_name = "protectables" - def __init__(self): - """Initialize view builder.""" - super(ProtectableViewBuilder, self).__init__() - def show(self, request, protectable_type): """Detailed view of a single protectable_type.""" protectable_type_ref = { diff --git a/karbor/api/v1/providers.py b/karbor/api/v1/providers.py index 54cc1bf6..5494e8e5 100644 --- a/karbor/api/v1/providers.py +++ b/karbor/api/v1/providers.py @@ -76,10 +76,6 @@ class ProviderViewBuilder(common.ViewBuilder): _collection_name = "providers" - def __init__(self): - """Initialize view builder.""" - super(ProviderViewBuilder, self).__init__() - def detail(self, request, provider): """Detailed view of a single provider.""" provider_ref = { @@ -130,10 +126,6 @@ class CheckpointViewBuilder(common.ViewBuilder): _collection_name = "checkpoints" - def __init__(self): - """Initialize view builder.""" - super(CheckpointViewBuilder, self).__init__() - def detail(self, request, checkpoint): """Detailed view of a single checkpoint.""" checkpoint_ref = { diff --git a/karbor/api/v1/restores.py b/karbor/api/v1/restores.py index a2a3b986..93038bf4 100644 --- a/karbor/api/v1/restores.py +++ b/karbor/api/v1/restores.py @@ -68,10 +68,6 @@ class RestoreViewBuilder(common.ViewBuilder): _collection_name = "restores" - def __init__(self): - """Initialize view builder.""" - super(RestoreViewBuilder, self).__init__() - def detail(self, request, restore): """Detailed view of a single restore.""" restore_ref = { diff --git a/karbor/cmd/manage.py b/karbor/cmd/manage.py index cab799ce..fbfe15c2 100644 --- a/karbor/cmd/manage.py +++ b/karbor/cmd/manage.py @@ -54,9 +54,6 @@ def args(*args, **kwargs): class DbCommands(object): """Class for managing the database.""" - def __init__(self): - pass - @args('version', nargs='?', default=None, help='Database version') def sync(self, version=None): @@ -91,9 +88,6 @@ class DbCommands(object): class VersionCommands(object): """Class for exposing the codebase version.""" - def __init__(self): - pass - def list(self): print(version.version_string()) @@ -104,9 +98,6 @@ class VersionCommands(object): class ConfigCommands(object): """Class for exposing the flags defined by flag_file(s).""" - def __init__(self): - pass - @args('param', nargs='?', default=None, help='Configuration parameter to display (default: %(default)s)') def list(self, param=None): diff --git a/karbor/loadables.py b/karbor/loadables.py index 546bac25..fc7979c4 100644 --- a/karbor/loadables.py +++ b/karbor/loadables.py @@ -46,6 +46,7 @@ from karbor import exception class BaseLoader(object): def __init__(self, loadable_cls_type): + super(BaseLoader, self).__init__() mod = sys.modules[self.__class__.__module__] self.path = os.path.abspath(mod.__path__[0]) self.package = mod.__package__ diff --git a/karbor/rpc.py b/karbor/rpc.py index 12ec4e4a..18a40c60 100644 --- a/karbor/rpc.py +++ b/karbor/rpc.py @@ -92,6 +92,7 @@ class RequestContextSerializer(messaging.Serializer): def __init__(self, base): self._base = base + super(RequestContextSerializer, self).__init__() def serialize_entity(self, context, entity): if not self._base: diff --git a/karbor/service.py b/karbor/service.py index 7404c234..56b1f913 100644 --- a/karbor/service.py +++ b/karbor/service.py @@ -330,6 +330,7 @@ class WSGIService(service.ServiceBase): self.app, host=self.host, port=self.port) + super(WSGIService, self).__init__() def _get_manager(self): """Initialize a Manager object appropriate for this service. @@ -431,6 +432,7 @@ def wait(): class Launcher(object): def __init__(self): + super(Launcher, self).__init__() self.launch_service = serve self.wait = wait diff --git a/karbor/services/operationengine/engine/executors/base.py b/karbor/services/operationengine/engine/executors/base.py index 882fea36..44afc48c 100644 --- a/karbor/services/operationengine/engine/executors/base.py +++ b/karbor/services/operationengine/engine/executors/base.py @@ -23,6 +23,7 @@ import six class BaseExecutor(object): def __init__(self, operation_manager): self._operation_manager = operation_manager + super(BaseExecutor, self).__init__() @abstractmethod def execute_operation(self, operation_id, triggered_time, diff --git a/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py b/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py index 8f2c844a..d36bdefa 100644 --- a/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py +++ b/karbor/services/operationengine/engine/executors/scheduled_operation_executor.py @@ -32,9 +32,6 @@ class ScheduledOperationExecutor(base.BaseExecutor): 'is_canceled': 'is_canceled' } - def __init__(self, operation_manager): - super(ScheduledOperationExecutor, self).__init__(operation_manager) - def execute_operation(self, operation_id, triggered_time, expect_start_time, window_time, **kwargs): diff --git a/karbor/services/operationengine/engine/triggers/timetrigger/time_trigger.py b/karbor/services/operationengine/engine/triggers/timetrigger/time_trigger.py index 28f3a60c..b8793a82 100644 --- a/karbor/services/operationengine/engine/triggers/timetrigger/time_trigger.py +++ b/karbor/services/operationengine/engine/triggers/timetrigger/time_trigger.py @@ -50,6 +50,7 @@ LOG = logging.getLogger(__name__) class TriggerOperationGreenThread(object): def __init__(self, first_run_time, function): + super(TriggerOperationGreenThread, self).__init__() self._is_sleeping = True self._pre_run_time = None self._running = False diff --git a/karbor/services/operationengine/engine/triggers/timetrigger/timeformats/crontab_time.py b/karbor/services/operationengine/engine/triggers/timetrigger/timeformats/crontab_time.py index 18d37278..e11467c8 100644 --- a/karbor/services/operationengine/engine/triggers/timetrigger/timeformats/crontab_time.py +++ b/karbor/services/operationengine/engine/triggers/timetrigger/timeformats/crontab_time.py @@ -25,6 +25,7 @@ class Crontab(timeformats.TimeFormat): def __init__(self, start_time, pattern): self._start_time = start_time self._pattern = pattern + super(Crontab, self).__init__(start_time, pattern) @classmethod def check_time_format(cls, pattern): diff --git a/karbor/services/operationengine/operation_manager.py b/karbor/services/operationengine/operation_manager.py index 996512dc..3e436b64 100644 --- a/karbor/services/operationengine/operation_manager.py +++ b/karbor/services/operationengine/operation_manager.py @@ -22,6 +22,7 @@ from karbor.services.operationengine import operations class OperationManager(object): """Manage all operation classes which are defined at operations dir.""" def __init__(self, user_trust_manager): + super(OperationManager, self).__init__() self._user_trust_manager = user_trust_manager all_ops = operations.all_operations() self._ops_map = {op.OPERATION_TYPE: op(self._user_trust_manager) diff --git a/karbor/services/operationengine/operations/base.py b/karbor/services/operationengine/operations/base.py index 11b2382c..d75ff498 100644 --- a/karbor/services/operationengine/operations/base.py +++ b/karbor/services/operationengine/operations/base.py @@ -46,6 +46,7 @@ class Operation(object): OPERATION_TYPE = "" def __init__(self, user_trust_manager): + super(Operation, self).__init__() self._user_trust_manager = user_trust_manager self._karbor_endpoint = None diff --git a/karbor/services/operationengine/operations/protect_operation.py b/karbor/services/operationengine/operations/protect_operation.py index 262b2eca..f4eb1c11 100644 --- a/karbor/services/operationengine/operations/protect_operation.py +++ b/karbor/services/operationengine/operations/protect_operation.py @@ -25,9 +25,6 @@ class ProtectOperation(base.Operation): OPERATION_TYPE = "protect" - def __init__(self, user_trust_manager): - super(ProtectOperation, self).__init__(user_trust_manager) - def check_operation_definition(self, operation_definition): provider_id = operation_definition.get("provider_id") if not provider_id or not uuidutils.is_uuid_like(provider_id): diff --git a/karbor/services/operationengine/user_trust_manager.py b/karbor/services/operationengine/user_trust_manager.py index b1d5c5b7..a9fea1cd 100644 --- a/karbor/services/operationengine/user_trust_manager.py +++ b/karbor/services/operationengine/user_trust_manager.py @@ -20,6 +20,7 @@ LOG = logging.getLogger(__name__) class UserTrustManager(object): def __init__(self): + super(UserTrustManager, self).__init__() self._user_trust_map = {} self._skp = karbor_keystone_plugin.KarborKeystonePlugin() diff --git a/karbor/services/protection/bank_plugin.py b/karbor/services/protection/bank_plugin.py index d0905809..882f75b5 100644 --- a/karbor/services/protection/bank_plugin.py +++ b/karbor/services/protection/bank_plugin.py @@ -37,6 +37,7 @@ class LeasePlugin(object): @six.add_metaclass(abc.ABCMeta) class BankPlugin(object): def __init__(self, config=None): + super(BankPlugin, self).__init__() self._config = config @abc.abstractmethod @@ -74,6 +75,7 @@ class Bank(object): _KEY_DOT_VALIDATION = re.compile('/\.{1,2}(/|$)') def __init__(self, plugin): + super(Bank, self).__init__() self._plugin = plugin def _normalize_key(self, key): @@ -160,6 +162,7 @@ class BankSection(object): _SECTION_DOT_VALIDATION = re.compile('/\.{1,2}(/|$)') def __init__(self, bank, section, is_writable=True): + super(BankSection, self).__init__() self._validate_section(section) self._bank = bank diff --git a/karbor/services/protection/checkpoint.py b/karbor/services/protection/checkpoint.py index 252779ea..5ff36d7c 100644 --- a/karbor/services/protection/checkpoint.py +++ b/karbor/services/protection/checkpoint.py @@ -34,6 +34,7 @@ class Checkpoint(object): def __init__(self, checkpoint_section, indices_section, bank_lease, checkpoint_id): + super(Checkpoint, self).__init__() self._id = checkpoint_id self._checkpoint_section = checkpoint_section self._indices_section = indices_section diff --git a/karbor/services/protection/flows/delete.py b/karbor/services/protection/flows/delete.py index bf9ea0b1..fa71d2d9 100644 --- a/karbor/services/protection/flows/delete.py +++ b/karbor/services/protection/flows/delete.py @@ -19,9 +19,6 @@ LOG = logging.getLogger(__name__) class InitiateDeleteTask(task.Task): - def __init__(self): - super(InitiateDeleteTask, self).__init__() - def execute(self, checkpoint, *args, **kwargs): LOG.debug("Initiate delete checkpoint_id: %s", checkpoint.id) checkpoint.status = constants.CHECKPOINT_STATUS_DELETING @@ -34,9 +31,6 @@ class InitiateDeleteTask(task.Task): class CompleteDeleteTask(task.Task): - def __init__(self, *args, **kwargs): - super(CompleteDeleteTask, self).__init__(*args, **kwargs) - def execute(self, checkpoint): LOG.debug("Complete delete checkpoint_id: %s", checkpoint.id) checkpoint.delete() diff --git a/karbor/services/protection/flows/protect.py b/karbor/services/protection/flows/protect.py index f4fa9de1..6c7ed1d6 100644 --- a/karbor/services/protection/flows/protect.py +++ b/karbor/services/protection/flows/protect.py @@ -20,9 +20,6 @@ LOG = logging.getLogger(__name__) class InitiateProtectTask(task.Task): - def __init__(self): - super(InitiateProtectTask, self).__init__() - def execute(self, checkpoint, *args, **kwargs): LOG.debug("Initiate protect checkpoint_id: %s", checkpoint.id) checkpoint.status = constants.CHECKPOINT_STATUS_PROTECTING @@ -35,9 +32,6 @@ class InitiateProtectTask(task.Task): class CompleteProtectTask(task.Task): - def __init__(self): - super(CompleteProtectTask, self).__init__() - def execute(self, checkpoint): LOG.debug("Complete protect checkpoint_id: %s", checkpoint.id) checkpoint.status = constants.CHECKPOINT_STATUS_AVAILABLE diff --git a/karbor/services/protection/flows/restore.py b/karbor/services/protection/flows/restore.py index 5492a262..403c2ce4 100644 --- a/karbor/services/protection/flows/restore.py +++ b/karbor/services/protection/flows/restore.py @@ -35,9 +35,6 @@ LOG = logging.getLogger(__name__) class InitiateRestoreTask(task.Task): - def __init__(self): - super(InitiateRestoreTask, self).__init__() - def execute(self, restore, *args, **kwargs): LOG.debug("Initiate restore restore_id: %s", restore.id) restore['status'] = constants.RESTORE_STATUS_IN_PROGRESS @@ -50,9 +47,6 @@ class InitiateRestoreTask(task.Task): class CompleteRestoreTask(task.Task): - def __init__(self): - super(CompleteRestoreTask, self).__init__() - def execute(self, restore, *args, **kwargs): LOG.debug("Complete restore restore_id: %s", restore.id) restore['status'] = constants.RESTORE_STATUS_SUCCESS @@ -62,9 +56,6 @@ class CompleteRestoreTask(task.Task): class CreateHeatTask(task.Task): default_provides = ['heat_client', 'heat_template'] - def __init__(self, *args, **kwargs): - super(CreateHeatTask, self).__init__(*args, **kwargs) - def execute(self, context, heat_conf): LOG.info('Creating Heat template. Target: "%s"' % heat_conf.get('auth_url', '(None)')) @@ -79,9 +70,6 @@ class CreateHeatTask(task.Task): class CreateStackTask(task.Task): default_provides = 'stack_id' - def __init__(self, *args, **kwargs): - super(CreateStackTask, self).__init__(*args, **kwargs) - def execute(self, heat_client, heat_template): stack_name = "restore_%s" % uuidutils.generate_uuid() if heat_template.len() == 0: @@ -100,10 +88,6 @@ class CreateStackTask(task.Task): class SyncRestoreStatusTask(task.Task): - - def __init__(self, *args, **kwargs): - super(SyncRestoreStatusTask, self).__init__(*args, **kwargs) - def execute(self, stack_id, heat_client, restore): if stack_id is None: LOG.info('Not syncing Heat stack status, stack is empty') diff --git a/karbor/services/protection/flows/worker.py b/karbor/services/protection/flows/worker.py index a9c56354..39afbcb7 100644 --- a/karbor/services/protection/flows/worker.py +++ b/karbor/services/protection/flows/worker.py @@ -36,6 +36,7 @@ CONF.register_opts(workflow_opts) class Worker(object): def __init__(self, engine_path=None): + super(Worker, self).__init__() try: self.workflow_engine = self._load_engine(engine_path) except Exception: diff --git a/karbor/services/protection/flows/workflow.py b/karbor/services/protection/flows/workflow.py index 336ec158..0eedb1e9 100644 --- a/karbor/services/protection/flows/workflow.py +++ b/karbor/services/protection/flows/workflow.py @@ -87,9 +87,6 @@ class WorkFlowEngine(object): class TaskFlowEngine(WorkFlowEngine): - def __init__(self): - super(TaskFlowEngine, self).__init__() - def build_flow(self, flow_name, flow_type='graph'): if flow_type == 'linear': return linear_flow.Flow(flow_name) diff --git a/karbor/services/protection/graph.py b/karbor/services/protection/graph.py index eab70316..e6c25f3c 100644 --- a/karbor/services/protection/graph.py +++ b/karbor/services/protection/graph.py @@ -111,6 +111,7 @@ class GraphWalkerListener(object): class GraphWalker(object): def __init__(self): + super(GraphWalker, self).__init__() self._listeners = [] def register_listener(self, graph_walker_listener): diff --git a/karbor/services/protection/protectable_plugin.py b/karbor/services/protection/protectable_plugin.py index 7b222944..0d396859 100644 --- a/karbor/services/protection/protectable_plugin.py +++ b/karbor/services/protection/protectable_plugin.py @@ -21,6 +21,7 @@ class ProtectablePlugin(object): """ def __init__(self, context=None): + super(ProtectablePlugin, self).__init__() self._context = context def instance(self, context): diff --git a/karbor/services/protection/protectable_registry.py b/karbor/services/protection/protectable_registry.py index 20cc0da4..073eba9a 100644 --- a/karbor/services/protection/protectable_registry.py +++ b/karbor/services/protection/protectable_registry.py @@ -31,6 +31,7 @@ def _raise_extension_exception(extmanager, ep, err): class ProtectableRegistry(object): def __init__(self): + super(ProtectableRegistry, self).__init__() self._protectable_map = {} self._plugin_map = {} diff --git a/karbor/services/protection/protection_plugin.py b/karbor/services/protection/protection_plugin.py index ef3e71ed..85235972 100644 --- a/karbor/services/protection/protection_plugin.py +++ b/karbor/services/protection/protection_plugin.py @@ -12,9 +12,6 @@ class Operation(object): - def __init__(self): - super(Operation, self).__init__() - def on_prepare_begin(self, checkpoint, resource, context, parameters, **kwargs): """on_prepare_begin hook runs before any child resource's hooks run @@ -73,6 +70,7 @@ class Operation(object): class ProtectionPlugin(object): def __init__(self, config=None): + super(ProtectionPlugin, self).__init__() self._config = config def get_protect_operation(self, resource): diff --git a/karbor/services/protection/protection_plugins/image/image_protection_plugin.py b/karbor/services/protection/protection_plugins/image/image_protection_plugin.py index 570cd73d..f9f574be 100644 --- a/karbor/services/protection/protection_plugins/image/image_protection_plugin.py +++ b/karbor/services/protection/protection_plugins/image/image_protection_plugin.py @@ -173,9 +173,6 @@ class ProtectOperation(protection_plugin.Operation): class DeleteOperation(protection_plugin.Operation): - def __init__(self): - super(DeleteOperation, self).__init__() - def on_main(self, checkpoint, resource, context, parameters, **kwargs): image_id = resource.id bank_section = checkpoint.get_resource_bank_section(image_id) @@ -275,6 +272,7 @@ class RestoreOperation(protection_plugin.Operation): class ImageBankIO(object): def __init__(self, bank_section, sorted_objects): + super(ImageBankIO, self).__init__() self.bank_section = bank_section self.sorted_objects = sorted_objects self.obj_size = len(sorted_objects) diff --git a/karbor/services/protection/protection_plugins/noop_plugin.py b/karbor/services/protection/protection_plugins/noop_plugin.py index fa6405c7..a31077af 100644 --- a/karbor/services/protection/protection_plugins/noop_plugin.py +++ b/karbor/services/protection/protection_plugins/noop_plugin.py @@ -15,9 +15,6 @@ from karbor.services.protection import protection_plugin class NoopOperation(protection_plugin.Operation): - def __init__(self): - super(NoopOperation, self).__init__() - def on_prepare_begin(self, *args, **kwargs): pass @@ -32,9 +29,6 @@ class NoopOperation(protection_plugin.Operation): class NoopProtectionPlugin(protection_plugin.ProtectionPlugin): - def __init__(self, config=None): - super(NoopProtectionPlugin, self).__init__(config) - def get_protect_operation(self, resource): return NoopOperation() diff --git a/karbor/services/protection/protection_plugins/server/nova_protection_plugin.py b/karbor/services/protection/protection_plugins/server/nova_protection_plugin.py index 61cfa782..46457664 100644 --- a/karbor/services/protection/protection_plugins/server/nova_protection_plugin.py +++ b/karbor/services/protection/protection_plugins/server/nova_protection_plugin.py @@ -30,9 +30,6 @@ FLOATING_IP_ASSOCIATION = 'OS::Nova::FloatingIPAssociation' class ProtectOperation(protection_plugin.Operation): - def __init__(self): - super(ProtectOperation, self).__init__() - def on_main(self, checkpoint, resource, context, parameters, **kwargs): server_id = resource.id bank_section = checkpoint.get_resource_bank_section(server_id) @@ -144,9 +141,6 @@ class ProtectOperation(protection_plugin.Operation): class DeleteOperation(protection_plugin.Operation): - def __init__(self): - super(DeleteOperation, self).__init__() - def on_main(self, checkpoint, resource, context, parameters, **kwargs): resource_id = resource.id bank_section = checkpoint.get_resource_bank_section(resource_id) @@ -176,9 +170,6 @@ class DeleteOperation(protection_plugin.Operation): class RestoreOperation(protection_plugin.Operation): - def __init__(self): - super(RestoreOperation, self).__init__() - def on_complete(self, checkpoint, resource, context, parameters, **kwargs): original_server_id = resource.id heat_template = kwargs.get("heat_template") @@ -322,9 +313,6 @@ class RestoreOperation(protection_plugin.Operation): class NovaProtectionPlugin(protection_plugin.ProtectionPlugin): _SUPPORT_RESOURCE_TYPES = [constants.SERVER_RESOURCE_TYPE] - def __init__(self, config=None): - super(NovaProtectionPlugin, self).__init__(config) - @classmethod def get_supported_resources_types(cls): return cls._SUPPORT_RESOURCE_TYPES diff --git a/karbor/services/protection/protection_plugins/volume/cinder_protection_plugin.py b/karbor/services/protection/protection_plugins/volume/cinder_protection_plugin.py index 46fe5807..668908b4 100644 --- a/karbor/services/protection/protection_plugins/volume/cinder_protection_plugin.py +++ b/karbor/services/protection/protection_plugins/volume/cinder_protection_plugin.py @@ -267,9 +267,6 @@ class ProtectOperation(protection_plugin.Operation): class RestoreOperation(protection_plugin.Operation): - def __init__(self): - super(RestoreOperation, self).__init__() - def on_main(self, checkpoint, resource, context, parameters, heat_template, **kwargs): resource_id = resource.id diff --git a/karbor/services/protection/restore_heat.py b/karbor/services/protection/restore_heat.py index 00e4d6d6..debba125 100644 --- a/karbor/services/protection/restore_heat.py +++ b/karbor/services/protection/restore_heat.py @@ -22,6 +22,7 @@ LOG = logging.getLogger(__name__) class HeatResource(object): def __init__(self, resource_id, type): + super(HeatResource, self).__init__() self.resource_id = resource_id self._type = type self._properties = {} @@ -44,6 +45,7 @@ class HeatTemplate(object): description = "karbor restore template" def __init__(self): + super(HeatTemplate, self).__init__() self._resources = [] self._original_id_resource_map = {} self._original_id_parameter_map = {} diff --git a/karbor/tests/base.py b/karbor/tests/base.py index 98f1659a..5715e092 100644 --- a/karbor/tests/base.py +++ b/karbor/tests/base.py @@ -34,6 +34,7 @@ _DB_CACHE = None class Database(fixtures.Fixture): def __init__(self, db_api, db_migrate, sql_connection): + super(Database, self).__init__() self.sql_connection = sql_connection # Suppress logging for test runs diff --git a/karbor/tests/fullstack/karbor_base.py b/karbor/tests/fullstack/karbor_base.py index 275aee8d..f5b49524 100644 --- a/karbor/tests/fullstack/karbor_base.py +++ b/karbor/tests/fullstack/karbor_base.py @@ -122,6 +122,7 @@ class ObjectStore(object): """ def __init__(self): + super(ObjectStore, self).__init__() self._close_funcs = [] def store(self, obj, close_func=None): diff --git a/karbor/tests/fullstack/karbor_objects.py b/karbor/tests/fullstack/karbor_objects.py index dd9233b7..1584bb15 100644 --- a/karbor/tests/fullstack/karbor_objects.py +++ b/karbor/tests/fullstack/karbor_objects.py @@ -30,6 +30,7 @@ DEFAULT_NETWORK = "private" class Checkpoint(object): def __init__(self): + super(Checkpoint, self).__init__() self.id = None self._provider_id = None self.karbor_client = base._get_karbor_client() @@ -69,6 +70,7 @@ class Plan(object): _name_id = 0 def __init__(self): + super(Plan, self).__init__() self.id = None self.karbor_client = base._get_karbor_client() @@ -104,6 +106,7 @@ class Plan(object): class Restore(object): def __init__(self): + super(Restore, self).__init__() self.id = None self.karbor_client = base._get_karbor_client() @@ -138,6 +141,7 @@ class Trigger(object): _name_id = 0 def __init__(self): + super(Trigger, self).__init__() self.id = None self.karbor_client = base._get_karbor_client() @@ -163,6 +167,7 @@ class ScheduledOperation(object): _name_id = 0 def __init__(self): + super(ScheduledOperation, self).__init__() self.id = None self.karbor_client = base._get_karbor_client() @@ -194,6 +199,7 @@ class Server(object): _name_id = 0 def __init__(self): + super(Server, self).__init__() self.id = None self._name = None self.nova_client = base._get_nova_client() @@ -304,6 +310,7 @@ class Volume(object): _name_id = 0 def __init__(self): + super(Volume, self).__init__() self.id = None self._name = None self.cinder_client = base._get_cinder_client() @@ -366,6 +373,7 @@ class Share(object): _name_id = 0 def __init__(self): + super(Share, self).__init__() self.id = None self._name = None self.manila_client = base._get_manila_client() diff --git a/karbor/tests/unit/api/v1/test_scheduled_operation.py b/karbor/tests/unit/api/v1/test_scheduled_operation.py index b4566b60..2dbfa1c5 100644 --- a/karbor/tests/unit/api/v1/test_scheduled_operation.py +++ b/karbor/tests/unit/api/v1/test_scheduled_operation.py @@ -25,6 +25,7 @@ from karbor.tests.unit.api.v1 import test_triggers class FakeRemoteOperationApi(object): def __init__(self): + super(FakeRemoteOperationApi, self).__init__() self._create_operation_exception = None self._delete_operation_exception = None diff --git a/karbor/tests/unit/clients/test_eisoo.py b/karbor/tests/unit/clients/test_eisoo.py index c1a6feac..964d28dd 100644 --- a/karbor/tests/unit/clients/test_eisoo.py +++ b/karbor/tests/unit/clients/test_eisoo.py @@ -21,6 +21,7 @@ from karbor.tests import base class FakeConfig(object): def __init__(self): + super(FakeConfig, self).__init__() self.eisoo_client = EisooClient() def __call__(self, args): @@ -32,6 +33,7 @@ class FakeConfig(object): class EisooClient(object): def __init__(self): + super(EisooClient, self).__init__() self.eisoo_endpoint = 'eisoo_endpoint' self.eisoo_app_id = 'eisoo_app_id' self.eisoo_app_secret = 'eisoo_app_secret' diff --git a/karbor/tests/unit/objects/test_scheduled_operation_state.py b/karbor/tests/unit/objects/test_scheduled_operation_state.py index 84f6a447..3ce841a3 100644 --- a/karbor/tests/unit/objects/test_scheduled_operation_state.py +++ b/karbor/tests/unit/objects/test_scheduled_operation_state.py @@ -108,6 +108,7 @@ class TestScheduledOperationStateList(test_objects.BaseObjectsTestCase): class FakeEnv(object): def __init__(self, ctx): + super(FakeEnv, self).__init__() self.context = ctx def do_init(self): diff --git a/karbor/tests/unit/operationengine/engine/executors/test_green_thread_executor.py b/karbor/tests/unit/operationengine/engine/executors/test_green_thread_executor.py index 5e125930..0f6c30ba 100644 --- a/karbor/tests/unit/operationengine/engine/executors/test_green_thread_executor.py +++ b/karbor/tests/unit/operationengine/engine/executors/test_green_thread_executor.py @@ -25,6 +25,7 @@ from karbor.tests import base class FakeOperationManager(object): def __init__(self): + super(FakeOperationManager, self).__init__() self._op_id = 0 def run_operation(self, operation_type, operation_definition, **kwargs): diff --git a/karbor/tests/unit/operationengine/engine/triggers/test_trigger_manager.py b/karbor/tests/unit/operationengine/engine/triggers/test_trigger_manager.py index dcbe9b2e..c049554e 100644 --- a/karbor/tests/unit/operationengine/engine/triggers/test_trigger_manager.py +++ b/karbor/tests/unit/operationengine/engine/triggers/test_trigger_manager.py @@ -22,6 +22,8 @@ from karbor.tests import base class FakeTrigger(triggers.BaseTrigger): def __init__(self, trigger_id, trigger_property, executor): + super(FakeTrigger, self).__init__(trigger_id, trigger_property, + executor) self._ops = set() def shutdown(self): diff --git a/karbor/tests/unit/operationengine/engine/triggers/timetrigger/test_time_trigger.py b/karbor/tests/unit/operationengine/engine/triggers/timetrigger/test_time_trigger.py index 009123bc..25c1ab76 100644 --- a/karbor/tests/unit/operationengine/engine/triggers/timetrigger/test_time_trigger.py +++ b/karbor/tests/unit/operationengine/engine/triggers/timetrigger/test_time_trigger.py @@ -24,7 +24,7 @@ from karbor.tests import base class FakeTimeFormat(object): def __init__(self, start_time, pattern): - pass + super(FakeTimeFormat, self).__init__() @classmethod def check_time_format(cls, pattern): @@ -39,6 +39,7 @@ class FakeTimeFormat(object): class FakeExecutor(object): def __init__(self): + super(FakeExecutor, self).__init__() self._ops = {} def execute_operation(self, operation_id, triggered_time, diff --git a/karbor/tests/unit/operationengine/operations/test_protect_operation.py b/karbor/tests/unit/operationengine/operations/test_protect_operation.py index 4162d04a..eff5e2a9 100644 --- a/karbor/tests/unit/operationengine/operations/test_protect_operation.py +++ b/karbor/tests/unit/operationengine/operations/test_protect_operation.py @@ -40,6 +40,7 @@ class FakeCheckPoint(object): class FakeKarborClient(object): def __init__(self): + super(FakeKarborClient, self).__init__() self._check_point = FakeCheckPoint() @property diff --git a/karbor/tests/unit/operationengine/test_manager.py b/karbor/tests/unit/operationengine/test_manager.py index c2dd5b8e..91330fdc 100644 --- a/karbor/tests/unit/operationengine/test_manager.py +++ b/karbor/tests/unit/operationengine/test_manager.py @@ -24,6 +24,7 @@ from karbor.tests import base class FakeTriggerManager(object): def __init__(self): + super(FakeTriggerManager, self).__init__() self._trigger = {} def register_operation(self, trigger_id, operation_id, **kwargs): diff --git a/karbor/tests/unit/protection/fake_clients.py b/karbor/tests/unit/protection/fake_clients.py index 1b01a736..c246a241 100644 --- a/karbor/tests/unit/protection/fake_clients.py +++ b/karbor/tests/unit/protection/fake_clients.py @@ -39,4 +39,5 @@ class FakeHeatClient(object): return FakeStacks[stack_id] def __init__(self): + super(FakeHeatClient, self).__init__() self.stacks = self.Stacks() diff --git a/karbor/tests/unit/protection/fake_swift_client.py b/karbor/tests/unit/protection/fake_swift_client.py index 5f5df7da..e0d9da38 100644 --- a/karbor/tests/unit/protection/fake_swift_client.py +++ b/karbor/tests/unit/protection/fake_swift_client.py @@ -18,7 +18,7 @@ from swiftclient import ClientException class FakeSwiftClient(object): def __init__(self, *args, **kwargs): - pass + super(FakeSwiftClient, self).__init__() @classmethod def connection(cls, *args, **kargs): @@ -27,6 +27,7 @@ class FakeSwiftClient(object): class FakeSwiftConnection(object): def __init__(self, *args, **kwargs): + super(FakeSwiftConnection, self).__init__() self.swiftdir = tempfile.mkdtemp() self.object_headers = {} diff --git a/karbor/tests/unit/protection/fakes.py b/karbor/tests/unit/protection/fakes.py index 5e9fc5f4..d28c04f6 100644 --- a/karbor/tests/unit/protection/fakes.py +++ b/karbor/tests/unit/protection/fakes.py @@ -70,6 +70,7 @@ def fake_protection_plan(): } return protection_plan + plan_resources = [A, B, C, D] @@ -193,6 +194,7 @@ class FakeProtectionPlugin(protection_plugin.ProtectionPlugin): class FakeCheckpoint(object): def __init__(self): + super(FakeCheckpoint, self).__init__() self.id = 'fake_checkpoint' self.status = 'available' self.resource_graph = resource_graph @@ -241,9 +243,6 @@ class FakeProvider(provider.PluggableProtectionProvider): class FakeFlowEngine(object): - def __init__(self): - super(FakeFlowEngine, self).__init__() - def create_task(self, function, requires=None, provides=None, inject=None, **kwargs): name = kwargs.get('name', None) diff --git a/karbor/tests/unit/protection/test_cinder_protection_plugin.py b/karbor/tests/unit/protection/test_cinder_protection_plugin.py index 061b7107..13d91aee 100644 --- a/karbor/tests/unit/protection/test_cinder_protection_plugin.py +++ b/karbor/tests/unit/protection/test_cinder_protection_plugin.py @@ -62,6 +62,7 @@ def call_hooks(operation, checkpoint, resource, context, parameters, **kwargs): class FakeCheckpoint(object): def __init__(self, section): + super(FakeCheckpoint, self).__init__() self.bank_section = section self.id = "fake_id" @@ -71,6 +72,7 @@ class FakeCheckpoint(object): class BackupResponse(object): def __init__(self, bkup_id, final_status, working_status, time_to_work): + super(BackupResponse, self).__init__() self._final_status = final_status self._working_status = working_status self._time_to_work = time_to_work diff --git a/karbor/tests/unit/protection/test_glance_protection_plugin.py b/karbor/tests/unit/protection/test_glance_protection_plugin.py index 03eb9c34..b3c12497 100644 --- a/karbor/tests/unit/protection/test_glance_protection_plugin.py +++ b/karbor/tests/unit/protection/test_glance_protection_plugin.py @@ -81,6 +81,7 @@ def call_hooks(operation, checkpoint, resource, context, parameters, **kwargs): class CheckpointCollection(object): def __init__(self): + super(CheckpointCollection, self).__init__() self.bank_section = fake_bank_section def get_resource_bank_section(self, resource_id): diff --git a/karbor/tests/unit/protection/test_graph.py b/karbor/tests/unit/protection/test_graph.py index 8edef112..53ff41e9 100644 --- a/karbor/tests/unit/protection/test_graph.py +++ b/karbor/tests/unit/protection/test_graph.py @@ -197,6 +197,7 @@ class GraphBuilderTest(base.TestCase): class _TestGraphWalkerListener(graph.GraphWalkerListener): def __init__(self, expected_event_stream, test): + super(_TestGraphWalkerListener, self).__init__() # Because the testing famework is badly designed # I need to have a reference to the test to raise assertions self._test = test diff --git a/karbor/tests/unit/protection/test_nova_protection_plugin.py b/karbor/tests/unit/protection/test_nova_protection_plugin.py index aea56bf6..5e3dd858 100644 --- a/karbor/tests/unit/protection/test_nova_protection_plugin.py +++ b/karbor/tests/unit/protection/test_nova_protection_plugin.py @@ -30,6 +30,7 @@ import mock class Server(object): def __init__(self, id, addresses, availability_zone, flavor, key_name, security_groups): + super(Server, self).__init__() self.id = id self.addresses = addresses self.__setattr__("OS-EXT-AZ:availability_zone", availability_zone) @@ -41,6 +42,7 @@ class Server(object): class Volume(object): def __init__(self, id, volume_type, status, bootable, attachments, name=None): + super(Volume, self).__init__() self.id = id self.volume_type = volume_type self.status = status @@ -51,6 +53,7 @@ class Volume(object): class Image(object): def __init__(self, id, status, disk_format, container_format): + super(Image, self).__init__() self.id = id self.status = status self.disk_format = disk_format @@ -152,6 +155,7 @@ class FakeNovaClient(object): return None def __init__(self): + super(FakeNovaClient, self).__init__() self.servers = self.Servers() @@ -171,6 +175,7 @@ class FakeGlanceClient(object): return None def __init__(self): + super(FakeGlanceClient, self).__init__() self.images = self.Images() @@ -186,6 +191,7 @@ class FakeCinderClient(object): return None def __init__(self): + super(FakeCinderClient, self).__init__() self.volumes = self.Volumes() @@ -241,6 +247,7 @@ ResourceNode = collections.namedtuple( class Checkpoint(object): def __init__(self): + super(Checkpoint, self).__init__() self.id = "checkpoint_id" self.graph = [] diff --git a/karbor/tests/unit/protection/test_swift_bank_plugin.py b/karbor/tests/unit/protection/test_swift_bank_plugin.py index 2fb96f0e..cf13b44f 100644 --- a/karbor/tests/unit/protection/test_swift_bank_plugin.py +++ b/karbor/tests/unit/protection/test_swift_bank_plugin.py @@ -25,6 +25,7 @@ CONF = cfg.CONF class FakeConf(object): def __init__(self): + super(FakeConf, self).__init__() self.lease_expire_window = 600 self.lease_renew_window = 120 self.lease_validity_window = 100 diff --git a/karbor/wsgi/common.py b/karbor/wsgi/common.py index 2bbc3fcc..130451b0 100644 --- a/karbor/wsgi/common.py +++ b/karbor/wsgi/common.py @@ -133,6 +133,7 @@ class Middleware(Application): return _factory def __init__(self, application): + super(Middleware, self).__init__() self.application = application def process_request(self, req): diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py index e279159a..3a21b065 100644 --- a/tools/install_venv_common.py +++ b/tools/install_venv_common.py @@ -35,6 +35,7 @@ class InstallVenv(object): def __init__(self, root, venv, requirements, test_requirements, py_version, project): + super(InstallVenv, self).__init__() self.root = root self.venv = venv self.requirements = requirements