summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2016-09-06 12:46:38 +0200
committerDmitry Tantsur <divius.inside@gmail.com>2016-09-06 12:46:38 +0200
commit695515ab6128c8e3c5578c7a584420f78f440a5b (patch)
tree0be544ae0ddaa6c9973876062f1dd0ec26e297e1
parent0a8abdd462f9a6acc3571a95147c19752416f14e (diff)
downloadironic-python-agent-695515ab6128c8e3c5578c7a584420f78f440a5b.tar.gz
[Mitaka only] Fix incomplete root device hints validation
Fixes two root device hints, 'wwn_with_extension' and 'wwn_vendor_extension', that were implemented and documented, but were not added to the list of supported root device hints, and thus fail validation. This code was completely rewritten on master, so this change is not a backport. Change-Id: I7bcc8c10d461b388f306c467e42d1e72f4e8a0f7 Closes-Bug: #1620563
-rw-r--r--ironic_python_agent/tests/unit/test_utils.py12
-rw-r--r--ironic_python_agent/utils.py4
-rw-r--r--releasenotes/notes/wwn-hints-295c2998e3a7b03c.yaml5
3 files changed, 20 insertions, 1 deletions
diff --git a/ironic_python_agent/tests/unit/test_utils.py b/ironic_python_agent/tests/unit/test_utils.py
index fd1cd5d6..05e02761 100644
--- a/ironic_python_agent/tests/unit/test_utils.py
+++ b/ironic_python_agent/tests/unit/test_utils.py
@@ -414,6 +414,18 @@ class GetAgentParamsTestCase(test_base.BaseTestCase):
self.assertEqual(expected, result)
@mock.patch.object(utils, 'get_agent_params')
+ def test_parse_root_device_hints_wwn(self, mock_get_params):
+ mock_get_params.return_value = {
+ 'root_device': 'wwn=abcd,wwn_vendor_extension=ext,'
+ 'wwn_with_extension=abcd_ext',
+ 'ipa-api-url': 'http://1.2.3.4:1234'
+ }
+ expected = {'wwn': 'abcd', 'wwn_vendor_extension': 'ext',
+ 'wwn_with_extension': 'abcd_ext'}
+ result = utils.parse_root_device_hints()
+ self.assertEqual(expected, result)
+
+ @mock.patch.object(utils, 'get_agent_params')
def test_parse_root_device_hints_no_hints(self, mock_get_params):
mock_get_params.return_value = {
'ipa-api-url': 'http://1.2.3.4:1234'
diff --git a/ironic_python_agent/utils.py b/ironic_python_agent/utils.py
index d647e2dd..9de42231 100644
--- a/ironic_python_agent/utils.py
+++ b/ironic_python_agent/utils.py
@@ -28,7 +28,9 @@ from ironic_python_agent import errors
LOG = logging.getLogger(__name__)
-SUPPORTED_ROOT_DEVICE_HINTS = set(('size', 'model', 'wwn', 'serial', 'vendor'))
+SUPPORTED_ROOT_DEVICE_HINTS = set(('size', 'model', 'wwn', 'serial', 'vendor',
+ 'wwn_with_extension',
+ 'wwn_vendor_extension'))
# Agent parameters can be passed by kernel command-line arguments and/or
# by virtual media. Virtual media parameters passed would be available
diff --git a/releasenotes/notes/wwn-hints-295c2998e3a7b03c.yaml b/releasenotes/notes/wwn-hints-295c2998e3a7b03c.yaml
new file mode 100644
index 00000000..f7f1cb48
--- /dev/null
+++ b/releasenotes/notes/wwn-hints-295c2998e3a7b03c.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - Fix two root device hints, 'wwn_with_extension' and 'wwn_vendor_extension',
+ that were implemented and documented, but were not added to the list of
+ supported root device hints, and thus fail validation.