Skip to content

Commit

Permalink
Updates for pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mshriver committed Nov 21, 2022
1 parent c972650 commit c347e53
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 0 additions & 2 deletions wrapanapi/entities/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from abc import ABCMeta
from abc import abstractmethod

import six

from wrapanapi.entities.base import Entity
from wrapanapi.entities.base import EntityMixin
from wrapanapi.exceptions import MultipleItemsError
Expand Down
2 changes: 1 addition & 1 deletion wrapanapi/systems/msazure.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def list_resources_from_hours_old(self, resource_group=None, hours_old=0):

def remove_resource_group_of_old_resources(self, resource_group=None, hours_old=0):
"""
Used for clean_up jobs to remove group containing resources older than hours_old numeric value.
Used for clean_up jobs to remove group containing resources older than hours_old.
Age is calculated as difference of current time and resource creation timestamp.
"""

Expand Down
8 changes: 3 additions & 5 deletions wrapanapi/systems/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,11 @@ def mark_as_template(self, template_name=None, **kwargs):
wait_for(lambda: self._api.images.get(uuid).status == "ACTIVE", num_sec=900, delay=5)
self.delete()
wait_for(lambda: not self.exists, num_sec=180, delay=5)
except Exception as e:
self.logger.error(
"Could not mark %s as a OpenStack template! (%s)", original_name, str(e)
)
except Exception:
self.logger.exception("Could not mark %s as a OpenStack template!", original_name)
try:
self.rename(original_name) # Clean up after ourselves
except Exception as e:
except Exception:
self.logger.exception(
"Failed to rename %s back to original name (%s)", image_name, original_name
)
Expand Down
7 changes: 4 additions & 3 deletions wrapanapi/systems/scvmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ def creation_time(self):
).astimezone(pytz.UTC)

def _do_vm(self, action, params=""):
cmd = 'Get-SCVirtualMachine -ID "{}" -VMMServer $scvmm_server | {}-SCVirtualMachine {}'.format(
self._id, action, params
).strip()
cmd = (
'Get-SCVirtualMachine -ID "{}" -VMMServer $scvmm_server '
"| {}-SCVirtualMachine {}".format(self._id, action, params).strip()
)
self.logger.info(cmd)
self._run_script(cmd)
return True
Expand Down

0 comments on commit c347e53

Please sign in to comment.