diff --git a/src/common/connection.py b/src/common/connection.py index 45411e195..7f21593b3 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -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: diff --git a/src/common/helpers.py b/src/common/helpers.py index 8ef6dc210..20613a994 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -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