Skip to content

Commit 6f70821

Browse files
author
guido tijskens
committed
oci-utils 0.12.6-12
1 parent 1834d89 commit 6f70821

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+992
-103
lines changed

buildrpm/oci-utils.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: oci-utils
22
Version: 0.12.6
3-
Release: 10%{?dist}
3+
Release: 12%{?dist}
44
Url: http://cloud.oracle.com/iaas
55
Summary: Oracle Cloud Infrastructure utilities
66
License: UPL
@@ -176,6 +176,12 @@ rm -rf %{buildroot}
176176
/opt/oci-utils/tests/__init__*
177177

178178
%changelog
179+
* Thu Feb 10 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.6-12
180+
- LINUX-12063 attach detach attach detach "is already detached" error
181+
182+
* Tue Feb 8 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.6-11
183+
- fixed timing issue with ocid refresh
184+
179185
* Fri Feb 4 2022 Guido Tijskens <guido.tijskens@oracle.com> -- 0.12.6-10
180186
- LINUX-12038 oci-utils-0.12.6-9.el7 oci-iscsi-config has errors Error running fdisk
181187

lib/oci_utils/cache.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def load_cache(global_file, user_file=None, max_age=None):
155155
cache_timestamp = get_timestamp(cache_fname)
156156
if max_age:
157157
if datetime.fromtimestamp(cache_timestamp) + max_age < datetime.now():
158+
_logger.debug('Max age reached.')
158159
return 0, None
159160

160161
try:
@@ -164,6 +165,7 @@ def load_cache(global_file, user_file=None, max_age=None):
164165
fcntl.lockf(cache_fd, fcntl.LOCK_SH)
165166
except IOError:
166167
# can't access file
168+
_logger.debug('Failed to load cache %s', cache_fname)
167169
return 0, None
168170

169171
try:
@@ -241,9 +243,12 @@ def write_cache(cache_content, cache_fname, fallback_fname=None, mode=None):
241243
-------
242244
Return the cache timestamp for success, None for failure
243245
"""
244-
_logger.debug('_Writing cache file %s.', cache_fname)
246+
_logger.debug('_Writing to cache file')
247+
_logger.debug('Cache file %s.', cache_fname)
248+
_logger.debug('Cache content %s.', cache_content)
245249
fname = cache_fname
246-
# try to save in cache_file first
250+
#
251+
# try to write in cache_file first
247252
try:
248253
cachedir = os.path.dirname(cache_fname)
249254
if not os.path.exists(cachedir):
@@ -254,6 +259,7 @@ def write_cache(cache_content, cache_fname, fallback_fname=None, mode=None):
254259
cache_fd = os.open(cache_fname, os.O_WRONLY | os.O_CREAT)
255260
cache_file = os.fdopen(cache_fd, 'w')
256261
except (OSError, IOError):
262+
#
257263
# can't write to cache_fname, try fallback_fname
258264
if not fallback_fname:
259265
return None
@@ -268,6 +274,7 @@ def write_cache(cache_content, cache_fname, fallback_fname=None, mode=None):
268274
cache_file = os.fdopen(cache_fd, 'w')
269275
fname = fallback_fname
270276
except (OSError, IOError):
277+
#
271278
# can't write to fallback file either, give up
272279
return None
273280
try:
@@ -286,6 +293,7 @@ def write_cache(cache_content, cache_fname, fallback_fname=None, mode=None):
286293
except Exception:
287294
fcntl.lockf(cache_fd, fcntl.LOCK_UN)
288295
cache_file.close()
296+
_logger.debug('Failed to write cache %s', cache_fname)
289297
return None
290298

291299
return cache_timestamp

0 commit comments

Comments
 (0)