Merge "Comply with iLO model of usage for one-time boot"

This commit is contained in:
Jenkins 2016-08-10 01:12:55 +00:00 committed by Gerrit Code Review
commit 87f974a371
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},