Merge "nova_flavor: Refactor property setter"

This commit is contained in:
Zuul 2022-02-14 20:00:29 +00:00 committed by Gerrit Code Review
commit c008eb0143
1 changed files with 12 additions and 26 deletions

View File

@ -51,32 +51,18 @@ Puppet::Type.type(:nova_flavor).provide(
mk_resource_methods
def is_public=(value)
fail('is_public is read only')
end
def id=(value)
fail('id is read only')
end
def ram=(value)
fail('ram is read only')
end
def disk=(value)
fail('disk is read only')
end
def vcpus=(value)
fail('vcpus is read only')
end
def swap=(value)
fail('swap is read only')
end
def rxtx_factor=(value)
fail('rxtx_factor is read only')
[
:is_public,
:id,
:ram,
:disk,
:vcpus,
:swap,
:rtxt_factor,
].each do |attr|
define_method(attr.to_s + "=") do |value|
fail("{#attr.to_s} is read only")
end
end
def properties=(value)