Skip to content
Snippets Groups Projects
Commit 5efc50fc authored by Guido Trotter's avatar Guido Trotter
Browse files

Separate OS status and path

Make _DiagnoseOSStatus only return a status message for the OS diagnose object
and create a new _DiagnoseOSPath function to get the path out. This will let us
be more flexible in the messages we display to the user.

Reviewed-By: imsnah
parent 5d0fe286
No related branches found
No related tags found
No related merge requests found
......@@ -75,9 +75,25 @@ def _DiagnoseOSStatus(obj):
"""
if _DiagnoseOSValid(obj):
return "valid (path: %s)" % obj.path
return "valid"
else:
return "%s (path: %s)" % (obj.args[2], obj.args[1])
return obj.args[2]
def _DiagnoseOSPath(obj):
"""Get the path out of an OS diagnose object.
Args:
obj: an diagnostic object as returned by OpDiagnoseOS
Returns:
string: the OS path
"""
if _DiagnoseOSValid(obj):
return obj.path
else:
return obj.args[1]
def _DiagnoseByOS(rlist):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment