glance_image: Drop broken location parameter

The location parameter works only with Image v1 API, which was removed
in glance 17.0.0 (rocky). Remove the parameter because the same
functionality is not supported by Image v2 API.

Because the parameter has been broken for long and no bug has been
reported so far, we can safely assume that this parameter is not used
by anyone. So remove the parameter directly with a formal deprecation
step skipped.

Change-Id: I79e6dd5a4abb57d3d7cb1f9a4bbabbb163f02c77
This commit is contained in:
Takashi Kajinami 2024-08-01 23:19:52 +09:00
parent 24c2d603bc
commit 5d69cd44e6
3 changed files with 8 additions and 11 deletions

View File

@ -23,6 +23,7 @@ Puppet::Type.type(:glance_image).provide(
def create
temp_file = false
if @resource[:source]
if @resource[:proxy]
proxy_uri = URI(@resource[:proxy])
@ -45,14 +46,10 @@ Puppet::Type.type(:glance_image).provide(
location = "--file=#{temp_file.path}"
end
# location cannot handle file://
# location does not import, so no sense in doing anything more than this
elsif @resource[:location]
location = "--location=#{@resource[:location]}"
else
raise(Puppet::Error, "Must specify either source or location")
raise(Puppet::Error, "The source parameter is required to create an image")
end
opts = [@resource[:name]]
opts << (@resource[:is_public] == :true ? '--public' : '--private')

View File

@ -38,11 +38,6 @@ Puppet::Type.newtype(:glance_image) do
newvalues(/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/)
end
newparam(:location) do
desc "The permanent location of the image. Optional"
newvalues(/\S+/)
end
newproperty(:is_public) do
desc "Whether the image is public or not. Default true"
newvalues(/(y|Y)es/, /(n|N)o/, /(t|T)rue/, /(f|F)alse/, true, false)

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``location`` parameter of the ``glance_image`` resource type has been
removed. This parameter has never been functional with Image v2 API.