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:
		| @@ -196,7 +196,9 @@ def set_onetime_boot(host_ip, x_auth_token, boot_target, allow_insecure=False): | |||||||
|             raise exceptions.IloException( |             raise exceptions.IloException( | ||||||
|                 "ERROR: %s is not a supported boot option.\n" % boot_target) |                 "ERROR: %s is not a supported boot option.\n" % boot_target) | ||||||
|         else: |         else: | ||||||
|             body = {"Boot": {"BootSourceOverrideTarget": boot_target}} |             body = {"Boot": {"BootSourceOverrideTarget": boot_target, | ||||||
|  |                              "BootSourceOverrideEnabled": "Once"} | ||||||
|  |                     } | ||||||
|             headers = {"Content-Type": "application/json"} |             headers = {"Content-Type": "application/json"} | ||||||
|             status_code, _, response = rest_patch(host_ip, member_uri, headers, |             status_code, _, response = rest_patch(host_ip, member_uri, headers, | ||||||
|                                                   body, x_auth_token, |                                                   body, x_auth_token, | ||||||
|   | |||||||
| @@ -16,6 +16,7 @@ | |||||||
| #    limitations under the License. | #    limitations under the License. | ||||||
|  |  | ||||||
| import copy | import copy | ||||||
|  | import json | ||||||
| import mock | import mock | ||||||
| import requests | import requests | ||||||
| import six.moves.http_client as http_client | 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) |         oneview_client.set_boot_device(node_info, 'HardDisk', onetime=True) | ||||||
|         mock_patch.assert_called_once_with( |         mock_patch.assert_called_once_with( | ||||||
|             'https://' + my_host + '/rest/v1/Systems/1', |             'https://' + my_host + '/rest/v1/Systems/1', | ||||||
|             data='{"Boot": {"BootSourceOverrideTarget": "Hdd"}}', |             data=json.dumps({"Boot": {"BootSourceOverrideTarget": "Hdd", | ||||||
|  |                                       "BootSourceOverrideEnabled": "Once"}}), | ||||||
|             headers={ |             headers={ | ||||||
|                 'Content-Type': 'application/json', |                 'Content-Type': 'application/json', | ||||||
|                 'X-Auth-Token': key}, |                 'X-Auth-Token': key}, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Thiago Paiva
					Thiago Paiva