Skip to content

Commit 9760980

Browse files
misc: use CONTROLLER_CACHE_PATH in log messages adn remove unnecessary logging
Signed-off-by: Mathieu Labourier <[email protected]>
1 parent 1dbb248 commit 9760980

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

drivers/linstorvolumemanager.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ def get_cached_controller_uri():
206206
with open(CONTROLLER_CACHE_PATH, "r") as f:
207207
return f.read().strip()
208208
except Exception as e:
209-
util.SMlog('Unable to read controller uri cache file at {}/{} : {}'.format(
210-
CONTROLLER_CACHE_DIRECTORY,
211-
CONTROLLER_CACHE_FILE,
209+
util.SMlog('Unable to read controller uri cache file at {} : {}'.format(
210+
CONTROLLER_CACHE_PATH,
212211
e
213212
))
214213
return None
@@ -217,9 +216,8 @@ def delete_controller_uri_cache():
217216
try:
218217
os.remove(CONTROLLER_CACHE_PATH)
219218
except Exception as e:
220-
util.SMlog('Unable to write controller uri cache file at {}/{} : {}'.format(
221-
CONTROLLER_CACHE_DIRECTORY,
222-
CONTROLLER_CACHE_FILE,
219+
util.SMlog('Unable to write controller uri cache file at {} : {}'.format(
220+
CONTROLLER_CACHE_PATH,
223221
e
224222
))
225223

@@ -233,9 +231,8 @@ def write_controller_uri_cache(uri):
233231
with open(CONTROLLER_CACHE_PATH, "w") as f:
234232
f.write(uri)
235233
except Exception as e:
236-
util.SMlog('Unable to write controller uri cache file at {}/{} : {}'.format(
237-
CONTROLLER_CACHE_DIRECTORY,
238-
CONTROLLER_CACHE_FILE,
234+
util.SMlog('Unable to write controller uri cache file at {} : {}'.format(
235+
CONTROLLER_CACHE_PATH,
239236
e
240237
))
241238

@@ -492,7 +489,6 @@ def create_from_cache(
492489
"""
493490
uri = get_cached_controller_uri()
494491
if not uri:
495-
logger("Cached controller URI not found, rebuilding cache...")
496492
uri = build_controller_uri_cache()
497493
if not uri:
498494
raise LinstorVolumeManagerError(

0 commit comments

Comments
 (0)