File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -52,24 +52,36 @@ def status():
52
52
"internetConnectivity" : True ,
53
53
"temp" : "40" ,
54
54
"uptime" : "5h" ,
55
- "status" : "ok" ,
56
- "internetConnectivity" : True ,
57
- "temp" : "40" ,
58
- "uptime" : "5h" ,
59
55
}
60
56
61
-
62
57
# Hardware and software information (STUB)
63
58
def info ():
64
- backend_commit = subprocess .check_output (["git" , "rev-parse" , "HEAD" ])[0 :7 ].decode ('utf-8' )
59
+ # [:-2] strips out '\n' (cat)
60
+ try :
61
+ backend_commit = subprocess .check_output (["git" , "rev-parse" , "HEAD" ])[0 :7 ].decode ('utf-8' )
62
+ except :
63
+ backend_commit = 'undefined'
64
+ try :
65
+ coderbot_version = subprocess .check_output (["cat" , "/etc/coderbot/version" ]).decode ('utf-8' )[:- 2 ]
66
+ except :
67
+ coderbot_version = 'undefined'
68
+ try :
69
+ kernel = subprocess .check_output (["uname" , "-r" ]).decode ('utf-8' )[:- 2 ]
70
+ except :
71
+ kernel = 'undefined'
72
+
73
+ try :
74
+ update_status = subprocess .check_output (["cat" , "/etc/coderbot/update_status" ]).decode ('utf-8' )[:- 2 ]
75
+ except :
76
+ update_status = 'undefined'
77
+
65
78
return {
66
79
"model" : 1 ,
67
80
"serial" : 2 ,
68
- "cbVersion" : 3 ,
69
- "backendVersion" : 4 ,
81
+ "version" : coderbot_version ,
70
82
"backend commit build" : backend_commit ,
71
- "vueVersion" : 5 ,
72
- "kernel " : 6 ,
83
+ "kernel" : kernel ,
84
+ "update status " : update_status ,
73
85
}
74
86
75
87
You can’t perform that action at this time.
0 commit comments