diff --git a/openstack/compute/v2/metadata.py b/openstack/compute/v2/metadata.py index e585871f7..b1f554d1e 100644 --- a/openstack/compute/v2/metadata.py +++ b/openstack/compute/v2/metadata.py @@ -19,7 +19,8 @@ from openstack import utils class MetadataMixin(object): def _metadata(self, method, key=None, clear=False, delete=False, - **metadata): + metadata=None): + metadata = metadata or {} for k, v in metadata.items(): if not isinstance(v, six.string_types): raise ValueError("The value for %s (%s) must be " @@ -84,7 +85,7 @@ class MetadataMixin(object): if not metadata: return dict() - result = self._metadata(session.post, **metadata) + result = self._metadata(session.post, metadata=metadata) return result["metadata"] def delete_metadata(self, session, keys): diff --git a/releasenotes/notes/metadata-key-name-bugfix-77612a825c5145d7.yaml b/releasenotes/notes/metadata-key-name-bugfix-77612a825c5145d7.yaml new file mode 100644 index 000000000..892fb85f2 --- /dev/null +++ b/releasenotes/notes/metadata-key-name-bugfix-77612a825c5145d7.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Fixed a bug related to metadata's key name. An exception was + raised when setting it to "delete"," clear" or "key"