Skip to content
Snippets Groups Projects
Commit f430c358 authored by nkour's avatar nkour
Browse files

ask uname as our last chance to detect OS [thanks kael for command]

parent 0109d921
No related branches found
No related tags found
No related merge requests found
......@@ -136,6 +136,11 @@ def get_os_info():
elif path_to_file.endswith('lfs-release'): # file just has version
text = distro_name + ' ' + text
return text
# our last chance, ask uname and strip it
uname_output = helpers.get_output_of_command('uname -a | cut -d" " -f1,3')
if uname_output is not None:
return uname_output
return 'N/A'
class Connection:
......
......@@ -372,3 +372,15 @@ def one_account_connected():
one_connected = True
break
return one_connected
def get_output_of_command(command):
try:
child_stdin, child_stdout = os.popen2(command)
except ValueError:
return None
output = child_stdout.readlines()
child_stdout.close()
child_stdin.close()
return output
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