Skip to content

Commit

Permalink
Fix: server shutdown fails
Browse files Browse the repository at this point in the history
  • Loading branch information
undecaf committed Sep 20, 2024
1 parent 76b3040 commit 86bb0ba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/hetzner_snap_and_rotate/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def main() -> int:
log(f'{i:3}. {sn.description}', LOG_DEBUG)

except Exception as ex:
log(ex.__str__(), LOG_ERR)
log(repr(ex), LOG_ERR)

except Exception as ex:
log(ex.__str__(), LOG_ERR)
log(repr(ex), LOG_ERR)

return 0

Expand Down
2 changes: 1 addition & 1 deletion src/hetzner_snap_and_rotate/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.1'
__version__ = '1.0.2'
2 changes: 1 addition & 1 deletion src/hetzner_snap_and_rotate/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def read_config(sys_argv: list[str]):
config_file.close()

except Exception as ex:
print(f'Invalid configuration: {ex.__str__()}', file=sys.stderr)
print(f'Invalid configuration: {repr(ex)}', file=sys.stderr)
exit(1)

def of_server(self, name: str):
Expand Down
4 changes: 2 additions & 2 deletions src/hetzner_snap_and_rotate/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def power(self, turn_on: bool):
try:
log(f'Server [{self.name}]: shutting down', LOG_NOTICE)
if not global_config.dry_run:
self.perform_action(ServerAction.SHUTDOWN, self.config.shutdown_timeout)
self.perform_action(ServerAction.SHUTDOWN, timeout = self.config.shutdown_timeout)
log(f'Server [{self.name}]: has been shut down', LOG_INFO)

except TimeoutError:
log(f'Server [{self.name}]: unable to shut down, powering off', LOG_WARNING)
if not global_config.dry_run:
self.perform_action(ServerAction.POWER_OFF, self.config.shutdown_timeout)
self.perform_action(ServerAction.POWER_OFF, timeout = self.config.shutdown_timeout)
log(f'Server [{self.name}]: has been powered off', LOG_INFO)

def snapshot_name(self,
Expand Down

0 comments on commit 86bb0ba

Please sign in to comment.