Commit 93f4860e authored by Samuel Gaist's avatar Samuel Gaist
Browse files

[common] Unified logger.error calls

Make them follow the style used by other logger calls.
parent 3fed6c19
Pipeline #20461 passed with stages
in 24 minutes and 48 seconds
...@@ -398,7 +398,7 @@ def make_up_local_list(prefix, type, requirements): ...@@ -398,7 +398,7 @@ def make_up_local_list(prefix, type, requirements):
try: try:
root = os.path.join(prefix, TYPE_NOSTORAGE[type]) root = os.path.join(prefix, TYPE_NOSTORAGE[type])
except: except:
logger.error("Selected type is not valid: %s" % type) logger.error("Selected type is not valid: %s", type)
return 1 return 1
l = glob.glob(os.path.join(root, TYPE_GLOB[type])) l = glob.glob(os.path.join(root, TYPE_GLOB[type]))
...@@ -506,7 +506,7 @@ def display_local_path(prefix, type, names): ...@@ -506,7 +506,7 @@ def display_local_path(prefix, type, names):
try: try:
selected_type = TYPE_PLURAL[type] selected_type = TYPE_PLURAL[type]
except: except:
logger.error("Selected type is not valid: %s"%type) logger.error("Selected type is not valid: %s", type)
return 1 return 1
else: else:
selected_type = TYPE_NOSTORAGE[type] selected_type = TYPE_NOSTORAGE[type]
...@@ -553,7 +553,7 @@ def edit_local_file(prefix, editor, type, name): ...@@ -553,7 +553,7 @@ def edit_local_file(prefix, editor, type, name):
try: try:
selected_type = TYPE_PLURAL[type] selected_type = TYPE_PLURAL[type]
except: except:
logger.error("Selected type is not valid: %s" % type) logger.error("Selected type is not valid: %s", type)
return 1 return 1
else: else:
selected_type = TYPE_NOSTORAGE[type] selected_type = TYPE_NOSTORAGE[type]
...@@ -567,7 +567,7 @@ def edit_local_file(prefix, editor, type, name): ...@@ -567,7 +567,7 @@ def edit_local_file(prefix, editor, type, name):
elif type in json_objects: elif type in json_objects:
ext = ".json" ext = ".json"
else: else:
logger.error("Selected type is not valid: %s" % type) logger.error("Selected type is not valid: %s", type)
root = os.path.join(prefix, selected_type) root = os.path.join(prefix, selected_type)
object_path = os.path.join(root, name + ext) object_path = os.path.join(root, name + ext)
...@@ -586,10 +586,10 @@ def edit_local_file(prefix, editor, type, name): ...@@ -586,10 +586,10 @@ def edit_local_file(prefix, editor, type, name):
cmd = "%s %s"%(editor, object_path) cmd = "%s %s"%(editor, object_path)
os.system(cmd) os.system(cmd)
else: else:
logger.error("Not a valid file: %s" % object_path) logger.error("Not a valid file: %s", object_path)
return 1 return 1
except: except:
logger.error("File does not exist: %s" % object_path) logger.error("File does not exist: %s", object_path)
return 1 return 1
return 0 return 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment