Comply with iLO model of usage for one-time boot

After a review from Shivanand and a talk in the #openstack-ironic channel, the
understanding is that we should use the BootSourceOverrideEnabled=Once to comply
with iLO's model to use that REST endpoint.

http://eavesdrop.openstack.org/irclogs/%23openstack-ironic/%23openstack-ironic.2016-08-02.log.html#t2016-08-02T14:09:58

Change-Id: Ic650defd699f9330d54c2345fcaa0797a3e79e55
This commit is contained in:
Thiago Paiva 2016-08-02 11:34:31 -03:00
parent c52a05ad81
commit 53808945f6
2 changed files with 6 additions and 2 deletions

View File

@ -196,7 +196,9 @@ def set_onetime_boot(host_ip, x_auth_token, boot_target, allow_insecure=False):
raise exceptions.IloException(
"ERROR: %s is not a supported boot option.\n" % boot_target)
else:
body = {"Boot": {"BootSourceOverrideTarget": boot_target}}
body = {"Boot": {"BootSourceOverrideTarget": boot_target,
"BootSourceOverrideEnabled": "Once"}
}
headers = {"Content-Type": "application/json"}
status_code, _, response = rest_patch(host_ip, member_uri, headers,
body, x_auth_token,

View File

@ -16,6 +16,7 @@
# limitations under the License.
import copy
import json
import mock
import requests
import six.moves.http_client as http_client
@ -392,7 +393,8 @@ class OneViewClientTestCase(unittest.TestCase):
oneview_client.set_boot_device(node_info, 'HardDisk', onetime=True)
mock_patch.assert_called_once_with(
'https://' + my_host + '/rest/v1/Systems/1',
data='{"Boot": {"BootSourceOverrideTarget": "Hdd"}}',
data=json.dumps({"Boot": {"BootSourceOverrideTarget": "Hdd",
"BootSourceOverrideEnabled": "Once"}}),
headers={
'Content-Type': 'application/json',
'X-Auth-Token': key},