Skip to content

Commit

Permalink
OpenBMC: Try hard power off
Browse files Browse the repository at this point in the history
We fall back to the soft power off.

this is all not really documented anywhere (unfortunately), and this
is all going by what-I've-been-told-on-an-internal-IBM-slack-channel
at *best* (along with some memories of the past).

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
stewartsmith committed Nov 15, 2017
1 parent b18a6ba commit d1b760d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions common/OpTestOpenBMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,18 @@ def power_soft(self):

'''
power off server:
curl -c cjar b cjar -k -H "Content-Type: application/json" -X PUT
-d '{"data": "xyz.openbmc_project.State.Host.Transition.Off"}'
https://bmc/xyz/openbmc_project/state/chassis0/attr/RequestedHostTransition
https://bmc/xyz/openbmc_project/state/host0/attr/RequestedHostTransition
'''
def power_off(self):
data = '\'{\"data\" : \"xyz.openbmc_project.State.Chassis.Transition.Off\"}\''
obj = "/xyz/openbmc_project/state/chassis0/attr/RequestedPowerTransition"
try:
self.curl.feed_data(dbus_object=obj, operation='rw', command="PUT", data=data)
self.curl.run()
except FailedCurlInvocation as f:
print "# Ignoring failure powering off chassis, trying powering off host"
pass
data = '\'{\"data\" : \"xyz.openbmc_project.State.Host.Transition.Off\"}\''
obj = "/xyz/openbmc_project/state/host0/attr/RequestedHostTransition"
self.curl.feed_data(dbus_object=obj, operation='rw', command="PUT", data=data)
Expand Down

0 comments on commit d1b760d

Please sign in to comment.