Merge "NetApp: Define 'preferred' to False instead of none"

This commit is contained in:
Jenkins 2017-07-20 18:50:17 +00:00 committed by Gerrit Code Review
commit c81793d7bb
4 changed files with 13 additions and 2 deletions

View File

@ -3072,6 +3072,11 @@ def export_location_metadata_update(context, export_location_uuid, metadata,
# that will not take effect using one session and we will rewrite,
# in that case, single record - first one added with this call.
session = get_session()
if meta_value is None:
LOG.warning("%s should be properly defined in the driver.",
meta_key)
item = {"value": meta_value, "updated_at": timeutils.utcnow()}
meta_ref = _export_location_metadata_get_query(

View File

@ -742,7 +742,7 @@ class NetAppCmodeFileStorageLibrary(object):
if home_node:
preferred = interface.get('home-node') == home_node
else:
preferred = None
preferred = False
addresses[address] = {
'is_admin_only': is_admin_only,

View File

@ -1120,7 +1120,7 @@ class NetAppFileStorageLibraryTestCase(test.TestCase):
expected = copy.deepcopy(fake.INTERFACE_ADDRESSES_WITH_METADATA)
for key, value in expected.items():
value['preferred'] = None
value['preferred'] = False
self.assertEqual(expected, result)
mock_get_aggregate_node.assert_called_once_with(fake.POOL_NAME)

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixed the NetApp driver to report the correct value of the "preferred"
export location metadata where it cannot determine if there are any
"preferred" export locations.