We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaaa571 commit 2d07539Copy full SHA for 2d07539
extensions/MaaS/maas.py
@@ -18,6 +18,7 @@
18
19
import sys
20
import json
21
+import time
22
from requests_oauthlib import OAuth1Session
23
24
@@ -200,8 +201,12 @@ def reboot(self):
200
201
sysid = self.data.get("system_id")
202
if not sysid:
203
fail("system_id missing for reboot")
- self.call_maas("POST", f"/machines/{sysid}/", {"op": "power_cycle"})
204
- succeed({"status": "success", "power_state": "PowerOn"})
+
205
+ self.call_maas("POST", f"/machines/{sysid}/", {"op": "power_off"})
206
+ time.sleep(5)
207
+ self.call_maas("POST", f"/machines/{sysid}/", {"op": "power_on"})
208
209
+ succeed({"status": "success", "power_state": "PowerOn", "message": "Reboot completed"})
210
211
def status(self):
212
0 commit comments