From d7f55ede4486fc778adff30beaff5555c08008b2 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Mon, 13 Jul 2020 10:19:41 +0200 Subject: [PATCH] Always pass --name when flushing keystone_service Running "openstack service set --description=" will throw an error [1]. The error occurs because the request to Keystone must include any of enabled, name or type to satisfy the minProperties of the patch request. This patch always sets the --name parameter when calling the openstack command so that we satisfy this requirement. [1] http://paste.openstack.org/show/795869/ Change-Id: Ie4e2fe62ee7734f657f765c352ba542360c0e1d7 (cherry picked from commit fc30737487a9bf8b998605455c59f96c7bf99f04) (cherry picked from commit d33843dc19ae6ffb4321c1d8139bea6444556978) (cherry picked from commit 09b61ff81753c42d109c192b2f755d8249e34763) (cherry picked from commit 906178cf1f7543733a0cac1b20fce62acbe278c7) --- lib/puppet/provider/keystone_service/openstack.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/puppet/provider/keystone_service/openstack.rb b/lib/puppet/provider/keystone_service/openstack.rb index 848fdd303..44792ed84 100644 --- a/lib/puppet/provider/keystone_service/openstack.rb +++ b/lib/puppet/provider/keystone_service/openstack.rb @@ -95,6 +95,9 @@ Puppet::Type.type(:keystone_service).provide( def flush options = [] if @property_flush && !@property_flush.empty? + # NOTE(tobias.urdin): Always pass --name to make sure we satisfy the minProperties + # for the request to Keystone. + options << "--name=#{resource[:name]}" options << "--description=#{resource[:description]}" if @property_flush[:description] options << "--type=#{resource[:type]}" if @property_flush[:type] self.class.request('service', 'set', [@property_hash[:id]] + options) unless options.empty?