Skip to content

Commit

Permalink
pep8: fix coriolis/a-e/, coriolis/exception.py, coriolis/rpc.py, cori…
Browse files Browse the repository at this point in the history
…olis/wsman.py
  • Loading branch information
Cristi1324 committed Oct 5, 2023
1 parent b914955 commit 91a4a58
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 18 deletions.
2 changes: 0 additions & 2 deletions coriolis/cmd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

import eventlet

from coriolis import conf

eventlet.monkey_patch()
2 changes: 1 addition & 1 deletion coriolis/conductor/rpc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def check_create_registration_for_service(
mapped_regions=mapped_regions, providers=providers,
specs=specs)
return worker_service
except Exception as ex:
except Exception:
LOG.warn(
"Failed to register service with specs %s. Retrying again in "
"%d seconds. Error was: %s", props, retry_period,
Expand Down
3 changes: 2 additions & 1 deletion coriolis/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@
MINION_POOL_STATUS_DEALLOCATING_MACHINES,
MINION_POOL_STATUS_DEALLOCATING_SHARED_RESOURCES]

MINION_MACHINE_IDENTIFIER_FORMAT = "coriolis-pool-%(pool_id)s-minion-%(minion_id)s"
MINION_MACHINE_IDENTIFIER_FORMAT = (
"coriolis-pool-%(pool_id)s-minion-%(minion_id)s")
MINION_MACHINE_STATUS_UNINITIALIZED = "UNINITIALIZED"
MINION_MACHINE_STATUS_HEALTHCHECKING = "HEALTHCHECKING"
MINION_MACHINE_STATUS_ALLOCATING = "ALLOCATING"
Expand Down
2 changes: 0 additions & 2 deletions coriolis/endpoint_options/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# Copyright 2020 Cloudbase Solutions Srl
# All Rights Reserved.
6 changes: 4 additions & 2 deletions coriolis/endpoint_options/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ def get_endpoint_destination_options(

def get_endpoint_source_minion_pool_options(
self, ctxt, endpoint_id, env=None, option_names=None):
return self._rpc_minion_manager_client.get_endpoint_source_minion_pool_options(
return (self._rpc_minion_manager_client.
get_endpoint_source_minion_pool_options)(
ctxt, endpoint_id, env, option_names)

def get_endpoint_destination_minion_pool_options(
self, ctxt, endpoint_id, env=None, option_names=None):
return self._rpc_minion_manager_client.get_endpoint_destination_minion_pool_options(
return (self._rpc_minion_manager_client.
get_endpoint_destination_minion_pool_options)(
ctxt, endpoint_id, env, option_names)
2 changes: 0 additions & 2 deletions coriolis/endpoint_resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# Copyright 2020 Cloudbase Solutions Srl
# All Rights Reserved.
6 changes: 4 additions & 2 deletions coriolis/endpoints/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ def validate_source_environment(self, ctxt, endpoint_id, source_env):
@utils.bad_request_on_error("Invalid source minion pool environment: %s")
def validate_endpoint_source_minion_pool_options(
self, ctxt, endpoint_id, pool_environment):
return self._rpc_minion_manager_client.validate_endpoint_source_minion_pool_options(
return (self._rpc_minion_manager_client.
validate_endpoint_source_minion_pool_options)(
ctxt, endpoint_id, pool_environment)

@utils.bad_request_on_error(
"Invalid destination minion pool environment: %s")
def validate_endpoint_destination_minion_pool_options(
self, ctxt, endpoint_id, pool_environment):
return self._rpc_minion_manager_client.validate_endpoint_destination_minion_pool_options(
return (self._rpc_minion_manager_client.
validate_endpoint_destination_minion_pool_options)(
ctxt, endpoint_id, pool_environment)
3 changes: 2 additions & 1 deletion coriolis/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ class OSMorphingToolsNotFound(NotFound):

class OSDetectToolsNotFound(NotFound):
message = _(
'No "%(os_type)s" OS detect tools were able to identify the OS for this VM. '
'No "%(os_type)s" OS detect tools were able to identify the OS for '
' this VM. '
'This would indicate that it was either not possible to determine the '
'exact OS release, or this OS release is not supported by Coriolis. '
'Suggestions include performing any needed OSMorphing steps manually '
Expand Down
2 changes: 0 additions & 2 deletions coriolis/rpc.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.

import contextlib
import coriolis.exception
import oslo_messaging as messaging

from oslo_config import cfg
from oslo_log import log as logging

from coriolis import context
from coriolis import utils


rpc_opts = [
Expand Down
6 changes: 3 additions & 3 deletions coriolis/wsman.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def connect(self, url, username, auth=None, password=None,

@classmethod
def from_connection_info(cls, connection_info, timeout=DEFAULT_TIMEOUT):
""" Returns a wsman.WSManConnection object for the provided conn info. """
""" Returns a wsman.WSManConnection obj for the provided conn info. """
if not isinstance(connection_info, dict):
raise ValueError(
"WSMan connection must be a dict. Got type '%s', value: %s" %
Expand All @@ -63,8 +63,8 @@ def from_connection_info(cls, connection_info, timeout=DEFAULT_TIMEOUT):
missing = [key for key in required_keys if key not in connection_info]
if missing:
raise ValueError(
"The following keys were missing from WSMan connection info %s. "
"Got: %s" % (missing, connection_info))
"The following keys were missing from WSMan connection "
"info %s. Got: %s" % (missing, connection_info))

host = connection_info["ip"]
port = connection_info.get("port", 5986)
Expand Down

0 comments on commit 91a4a58

Please sign in to comment.