Merge "glance_image: Drop broken location parameter"

This commit is contained in:
Zuul 2024-08-05 08:47:12 +00:00 committed by Gerrit Code Review
commit 6767388dce
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.