diff --git a/lib/vsc/__init__.py b/lib/vsc/__init__.py index a98e5dc..ebd2719 100644 --- a/lib/vsc/__init__.py +++ b/lib/vsc/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2024 Ghent University +# Copyright 2015-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/__init__.py b/lib/vsc/utils/__init__.py index a98e5dc..ebd2719 100644 --- a/lib/vsc/utils/__init__.py +++ b/lib/vsc/utils/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2015-2024 Ghent University +# Copyright 2015-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/availability.py b/lib/vsc/utils/availability.py index 100a842..7f2f1ef 100644 --- a/lib/vsc/utils/availability.py +++ b/lib/vsc/utils/availability.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/cache.py b/lib/vsc/utils/cache.py index f791415..f0c25ae 100644 --- a/lib/vsc/utils/cache.py +++ b/lib/vsc/utils/cache.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -143,7 +143,13 @@ def load(self, key): @returns: (timestamp, data) if there is data for the given key, None otherwise. """ - return self.new_shelf.get(key, None) or self.shelf.get(key, None) + result = None + if self.new_shelf is not None: + result = self.new_shelf.get(key, None) + if result is None and self.shelf is not None: + return self.shelf.get(key, None) + + return result def retain(self): """Retain non-updated data on close.""" @@ -163,6 +169,8 @@ def close(self): self.log.error('cannot open the file cache at %s for writing', self.filename) else: if self.retain_old: + if self.shelf is None: + self.shelf = {} self.shelf.update(self.new_shelf) self.new_shelf = self.shelf diff --git a/lib/vsc/utils/fs_store.py b/lib/vsc/utils/fs_store.py index 823a32d..26544a5 100644 --- a/lib/vsc/utils/fs_store.py +++ b/lib/vsc/utils/fs_store.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/graphyte.py b/lib/vsc/utils/graphyte.py index db15d56..ac8129e 100644 --- a/lib/vsc/utils/graphyte.py +++ b/lib/vsc/utils/graphyte.py @@ -1,5 +1,5 @@ # -# Copyright 2024-2024 Ghent University +# Copyright 2024-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/lock.py b/lib/vsc/utils/lock.py index e7a22f0..9226b8d 100644 --- a/lib/vsc/utils/lock.py +++ b/lib/vsc/utils/lock.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/nagios.py b/lib/vsc/utils/nagios.py index cd3dc1e..156345d 100644 --- a/lib/vsc/utils/nagios.py +++ b/lib/vsc/utils/nagios.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/pickle_files.py b/lib/vsc/utils/pickle_files.py index 4099948..3886054 100644 --- a/lib/vsc/utils/pickle_files.py +++ b/lib/vsc/utils/pickle_files.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/rest_oauth.py b/lib/vsc/utils/rest_oauth.py index 6ae5352..abb97c6 100644 --- a/lib/vsc/utils/rest_oauth.py +++ b/lib/vsc/utils/rest_oauth.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/script_tools.py b/lib/vsc/utils/script_tools.py index 65ada20..d32bd35 100644 --- a/lib/vsc/utils/script_tools.py +++ b/lib/vsc/utils/script_tools.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/timestamp.py b/lib/vsc/utils/timestamp.py index b61244f..5eb6e42 100644 --- a/lib/vsc/utils/timestamp.py +++ b/lib/vsc/utils/timestamp.py @@ -1,5 +1,5 @@ # -# Copyright 2009-2024 Ghent University +# Copyright 2009-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/lib/vsc/utils/timestamp_pid_lockfile.py b/lib/vsc/utils/timestamp_pid_lockfile.py index d73fe38..ad1470c 100644 --- a/lib/vsc/utils/timestamp_pid_lockfile.py +++ b/lib/vsc/utils/timestamp_pid_lockfile.py @@ -1,5 +1,5 @@ # -# Copyright 2012-2024 Ghent University +# Copyright 2012-2025 Ghent University # # This file is part of vsc-utils, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/setup.py b/setup.py index 51c38d6..e5b5d4b 100755 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ ] PACKAGE = { - 'version': '2.2.8', + 'version': '2.2.9', 'author': [ag, sdw], 'maintainer': [ag, sdw], 'excluded_pkgs_rpm': ['vsc', 'vsc.utils'], # vsc is default, vsc.utils is provided by vsc-base