handle cases where vednor information is missing (#98)
This commit is contained in:
@@ -136,12 +136,15 @@ def get_os():
|
|||||||
|
|
||||||
|
|
||||||
def get_manufacturer():
|
def get_manufacturer():
|
||||||
|
try:
|
||||||
if 'Raspberry' not in check_model_name():
|
if 'Raspberry' not in check_model_name():
|
||||||
full_cmd = "cat /proc/cpuinfo | grep 'vendor'| uniq"
|
full_cmd = "cat /proc/cpuinfo | grep 'vendor'| uniq"
|
||||||
pretty_name = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
pretty_name = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode("utf-8")
|
||||||
pretty_name = pretty_name.split(':')[1].replace('\n', '')
|
pretty_name = pretty_name.split(':')[1].replace('\n', '')
|
||||||
else:
|
else:
|
||||||
pretty_name = 'Raspberry Pi'
|
pretty_name = 'Raspberry Pi'
|
||||||
|
except Exception:
|
||||||
|
pretty_name = 'Unknown'
|
||||||
|
|
||||||
return(pretty_name)
|
return(pretty_name)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user