Merge "openstack: Remove metadata limit checks"

Zuul 10 months ago committed by Gerrit Code Review
commit 67c1cb2db8

@ -257,10 +257,7 @@ Selecting the OpenStack driver adds the following options to the
.. attr:: meta
:type: dict
Arbitrary key/value metadata to store for this server using
the Nova metadata service. A maximum of five entries is
allowed, and both keys and values must be 255 characters or
Arbitrary key/value metadata to store as glance image properties.
.. attr:: connection-type
:type: string

@ -265,16 +265,6 @@ class OpenStackProviderConfig(ProviderConfig):
# This dict is expanded and used as custom properties when
# the image is uploaded.
i.meta = image.get('meta', {})
# 5 elements, and no key or value can be > 255 chars
# per Nova API rules
if i.meta:
if len(i.meta) > 5 or \
any([len(k) > 255 or len(v) > 255
for k, v in i.meta.items()]):
# soft-fail
# self.log.error("Invalid metadata for %s; ignored"
# %
i.meta = {}
for image in self.provider.get('cloud-images', []):
i = ProviderCloudImage()

@ -0,0 +1,13 @@
- |
Removes diskimage.meta checks from the OpenStack driver. The limit of only
5 entries is anachronistic and now removed. Rather than trying to pre-guess
what OpenStack wants the metadata is now passed as-is and OpenStack will
reject it at upload time.
Previously, metadata was checked by nodepool and invalid values would cause
all metadata to be silently ignored. Now, metadata will be passed directly
to glance, and an API error will occur. This may mean that images that
previously uploaded (with no metadata) will now cause an API error when