From a592c45104638d331dc1b49539cd83a25ecefdc5 Mon Sep 17 00:00:00 2001 From: Eric Mesa Date: Wed, 18 Sep 2024 19:15:52 -0400 Subject: [PATCH] Fix for dictionaries so that missing keys don't crash the program --- requirements.txt | 4 ++-- snapintime/__init__.py | 4 ++-- snapintime/create_local_snapshots.py | 2 +- snapintime/remote_backup.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index b548c90..a920a13 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -xdgenvpy -rich \ No newline at end of file +xdgenvpy == 2.4.0 +rich == 13.7.1 \ No newline at end of file diff --git a/snapintime/__init__.py b/snapintime/__init__.py index 1359fc8..b427e34 100644 --- a/snapintime/__init__.py +++ b/snapintime/__init__.py @@ -1,7 +1,7 @@ __author__ = "Eric Mesa" -__version__ = "2.2.0" +__version__ = "2.2.1" __license__ = "GNU GPL v3.0" -__copyright__: str = "(c) 2014 - 2023 Eric Mesa" +__copyright__: str = "(c) 2014 - 2024 Eric Mesa" __email__: str = "ericsbinaryworld at gmail dot com" diff --git a/snapintime/create_local_snapshots.py b/snapintime/create_local_snapshots.py index 23f5a5f..bacf401 100644 --- a/snapintime/create_local_snapshots.py +++ b/snapintime/create_local_snapshots.py @@ -59,7 +59,7 @@ def main(): # pragma: no cover our_config = config.import_config() results = iterate_configs(date_time_for_backup, our_config) for result in results: - log.info(f"Ran: {result['Command']}. Command had a return code of {result['Return Code']}") + log.info(f"Ran: {result.get('Command')}. Command had a return code of {result.get('Return Code')}") log.info(f"Result was: {str(result['Output'])}") diff --git a/snapintime/remote_backup.py b/snapintime/remote_backup.py index 882b5e6..36119cd 100644 --- a/snapintime/remote_backup.py +++ b/snapintime/remote_backup.py @@ -103,7 +103,7 @@ def main(): # pragma: no cover our_config = config.import_config() results = iterate_over_subvolumes(our_config) for result in results: - log.info(f"\nRan {result['Command']} with a return code of {result['Return Code']}") + log.info(f"\nRan {result.get('Command')} with a return code of {result.get('Return Code')}") log.info(f"Result was: {str(result['Output'])}\n")