Total Complexity | 0 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | '''send command to miner''' |
||
2 | |||
3 | from backend.fcmcomponent import ComponentName |
||
4 | from backend.fcmapp import ApplicationService |
||
5 | from helpers.antminerhelper import getminerconfig, print_response |
||
6 | |||
7 | APP = ApplicationService(ComponentName.fullcycle) |
||
8 | |||
9 | MINER = APP.getminerbyname('TEST') |
||
10 | MINER.ftpport = '22' |
||
11 | |||
12 | RESPONSE = getminerconfig(MINER, APP.sshlogin()) |
||
13 | print_response(RESPONSE) |
||
14 | |||
15 | ACCESS_ORIGINAL = APP.antminer.getaccesslevel(MINER) |
||
16 | print('original', ACCESS_ORIGINAL) |
||
17 | if ACCESS_ORIGINAL != 'restricted': |
||
18 | APP.antminer.set_restricted(MINER) |
||
19 | APP.antminer.waitforonline(MINER) |
||
20 | |||
21 | ACCESS_RESTRICTED = APP.antminer.getaccesslevel(MINER) |
||
22 | print('restricted', ACCESS_RESTRICTED) |
||
23 | APP.antminer.set_privileged(MINER) |
||
24 | APP.antminer.waitforonline(MINER) |
||
25 | |||
26 | ACCESS_PRIVILEGED = APP.antminer.getaccesslevel(MINER) |
||
27 | print('privileged', ACCESS_PRIVILEGED) |
||
28 | #APP.antminer.restartssh(MINER) |
||
29 | #APP.antminer.waitforonline(MINER) |
||
30 | |||
31 | ACCESS_AFTERRESET = APP.antminer.getaccesslevel(MINER) |
||
32 | #input('press any key...') |
||
33 |