Fix USM tox issues

This commit fix tox issues.

Test Plan
PASS: run tox and verify no errors

Story: 2010676
Task: 50743

Change-Id: I00ca6a6f323ed26d165a17255de2f660ba126a2e
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
This commit is contained in:
Heitor Matsui
2024-08-05 19:05:53 -03:00
parent 0562755ef1
commit 349e75f11e
5 changed files with 9 additions and 8 deletions

View File

@@ -77,6 +77,7 @@ def get_sysinv_client(token, endpoint):
msg = "Failed to get sysinv client. Error: %s" % str(e)
raise Exception(msg)
def call_api(token_id, method, api_cmd, api_cmd_headers=None,
api_cmd_payload=None, timeout_in_secs=40):

View File

@@ -139,9 +139,9 @@ class PatchService(object):
if utils.get_management_version(hostname=constants.PREBOOTSTRAP_HOSTNAME
) == constants.ADDRESS_VERSION_IPV6:
self.sock_out = socket.socket(socket.AF_INET6,
socket.SOCK_DGRAM)
socket.SOCK_DGRAM)
self.sock_in = socket.socket(socket.AF_INET6,
socket.SOCK_DGRAM)
socket.SOCK_DGRAM)
self.sock_out.setblocking(0)
self.sock_in.setblocking(0)
@@ -153,9 +153,9 @@ class PatchService(object):
self.sock_in.bind(('', self.port))
else:
self.sock_out = socket.socket(socket.AF_INET,
socket.SOCK_DGRAM)
socket.SOCK_DGRAM)
self.sock_in = socket.socket(socket.AF_INET,
socket.SOCK_DGRAM)
socket.SOCK_DGRAM)
self.sock_out.setblocking(0)
self.sock_in.setblocking(0)
@@ -167,7 +167,6 @@ class PatchService(object):
return self.sock_in
def setup_socket(self):
self.socket_lock_acquire()

View File

@@ -60,7 +60,7 @@ class SoftwareAPI:
self.end_update()
def update_deploy(self, from_release=None, to_release=None, feed_repo=None, commit_id=None,
reboot_required: bool = None, state: DEPLOY_STATES = None):
reboot_required: bool = None, state: DEPLOY_STATES = None):
self.begin_update()
try:
self.deploy_handler.update(

View File

@@ -2746,8 +2746,8 @@ class PatchController(PatchService):
self.install_releases_thread(deployment_list, feed_repo)
msg_info += "%s is now starting, await for the states: " \
"[deploy-start-done | deploy-start-failed] in " \
"'software deploy show'\n" % deployment_list
"[deploy-start-done | deploy-start-failed] in " \
"'software deploy show'\n" % deployment_list
elif operation == "remove":
collect_current_load_for_hosts(deploy_sw_version, hostname=hostname)

View File

@@ -61,6 +61,7 @@ def is_host_locked_and_online(host):
return True
return False
def are_all_hosts_unlocked_and_online():
for ihost in get_ihost_list():
if ihost.administrative != constants.ADMIN_UNLOCKED or ihost.availability != constants.AVAILABILITY_AVAILABLE: