1 | # |
---|
2 | # Copyright (C) 2021 Soleta Networks <info@soleta.eu> |
---|
3 | # |
---|
4 | # This program is free software: you can redistribute it and/or modify it under |
---|
5 | # the terms of the GNU Affero General Public License as published by the |
---|
6 | # Free Software Foundation; either version 3 of the License, or |
---|
7 | # (at your option) any later version. |
---|
8 | |
---|
9 | import os |
---|
10 | from src.ogRest import ThreadState |
---|
11 | |
---|
12 | |
---|
13 | class OgLinuxOperations: |
---|
14 | |
---|
15 | def _restartBrowser(self, url): |
---|
16 | raise NotImplementedError |
---|
17 | |
---|
18 | def poweroff(self): |
---|
19 | os.system('systemctl poweroff') |
---|
20 | |
---|
21 | def reboot(self): |
---|
22 | os.system('systemctl reboot') |
---|
23 | |
---|
24 | def shellrun(self, request, ogRest): |
---|
25 | raise NotImplementedError |
---|
26 | |
---|
27 | def session(self, request, ogRest): |
---|
28 | raise NotImplementedError |
---|
29 | |
---|
30 | def hardware(self, path, ogRest): |
---|
31 | raise NotImplementedError |
---|
32 | |
---|
33 | def setup(self, request, ogRest): |
---|
34 | raise NotImplementedError |
---|
35 | |
---|
36 | def image_restore(self, request, ogRest): |
---|
37 | raise NotImplementedError |
---|
38 | |
---|
39 | def image_create(self, path, request, ogRest): |
---|
40 | raise NotImplementedError |
---|
41 | |
---|
42 | def refresh(self, ogRest): |
---|
43 | return {"status": "LINUX"} |
---|
44 | |
---|
45 | def probe(self, ogRest): |
---|
46 | return {'status': 'LINUX' if ogRest.state != ThreadState.BUSY else 'BSY'} |
---|