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
......@@ -75,9 +75,25 @@ def _DiagnoseOSStatus(obj):
if _DiagnoseOSValid(obj):
return "valid (path: %s)" % obj.path
return "valid"
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.
obj: an diagnostic object as returned by OpDiagnoseOS
string: the OS path
if _DiagnoseOSValid(obj):
return obj.path
return obj.args[1]
def _DiagnoseByOS(rlist):
Markdown is supported
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