Skip to content

Commit

Permalink
The "_id" attribute should be added only for VMDB objects.
Browse files Browse the repository at this point in the history
The "_id" attribute is not meant for fields like password::dialog_password_field.

https://bugzilla.redhat.com/show_bug.cgi?id=1619385
  • Loading branch information
lfu committed Sep 13, 2018
1 parent e0ec9ba commit 2b29f8f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def process_args_attribute(args, args_key)
if args_key.include?(CLASS_SEPARATOR)
key, klass = get_key_name_and_klass_from_key(args_key)
value = args.delete(args_key)
args["#{key}_id"] = value unless @attributes.key?(key)
args["#{key}_id"] = value if attribute_for_vmdb_object?(klass, value) && !@attributes.key?(key)
args[key] = MiqAeObject.convert_value_based_on_datatype(value, klass)
else
args[args_key.downcase] = args.delete(args_key) if args_key != args_key.downcase
Expand Down Expand Up @@ -854,5 +854,9 @@ def classify_value(value)
return self[value]
end
end

def attribute_for_vmdb_object?(klass, value)
klass.safe_constantize && value.to_i.nonzero?
end
end
end

0 comments on commit 2b29f8f

Please sign in to comment.