mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
bug #4583: allow the use of : in nic extra attrs
This commit is contained in:
1 parent
50b70181b1
commit
4dff8953e2
1 file changed
+21
@@ -936,6 +936,27 @@ EOT
|
||||
|
||||
objects.each do |obj|
|
||||
obj, *extra_attributes = obj.split(":")
|
||||
|
||||
# When extra attributes do not contain = character include
|
||||
# them in the previous value. Fixes adding MAC addresses. These
|
||||
# contain ":" character also used as extra attributes separator.
|
||||
#
|
||||
# It may be needed to strip the value from start and end quotes
|
||||
# as the value could be written as this:
|
||||
#
|
||||
# --nic 'some_net:mac="00:0A:12:34:56:78"'
|
||||
#
|
||||
attrs = []
|
||||
extra_attributes.each do |str|
|
||||
if str.include?("=")
|
||||
attrs << str
|
||||
else
|
||||
attrs.last << ":#{str}"
|
||||
end
|
||||
end
|
||||
|
||||
extra_attributes = attrs
|
||||
|
||||
res=parse_user_object(obj)
|
||||
return [-1, "#{section.capitalize} \"#{obj}\" malformed"] if !res
|
||||
user, object=*res
|
||||
|
||||
Reference in new issue
Block a user