1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-04 17:47:00 +03:00

F #3440: Allow logical switch empty constructor (#3840)

This allows creation of opaque network and virtual wire
objects without id and tz id
This commit is contained in:
Angel Luis Moya Gonzalez 2019-10-14 12:14:47 +02:00 committed by Tino Vázquez
parent 71661c50db
commit a7e2f33eed
2 changed files with 25 additions and 25 deletions

View File

@ -32,19 +32,19 @@ module NSXDriver
if ls_id
initialize_with_id(ls_id)
else
raise 'Missing transport zone id' unless tz_id
if tz_id
if ls_data
@ls_id = new_logical_switch(ls_data)
raise 'Opaque Network not created in NSX' unless @ls_id
raise 'Missing logical switch data' unless ls_data
@ls_id = new_logical_switch(ls_data)
raise 'Opaque Network not created in NSX' unless @ls_id
# Construct URL of the created logical switch
@url_ls = @base_url + SECTION_LS + @ls_id
@ls_vni = ls_vni
@ls_name = ls_name
@tz_id = ls_tz
@admin_display = 'UP'
# Construct URL of the created logical switch
@url_ls = @base_url + SECTION_LS + @ls_id
@ls_vni = ls_vni
@ls_name = ls_name
@tz_id = ls_tz
@admin_display = 'UP'
end
end
end
end

View File

@ -38,20 +38,20 @@ module NSXDriver
if ls_id
initialize_with_id(ls_id)
else
raise 'Missing transport zone id' unless tz_id
if tz_id
if ls_data
@ls_id = new_logical_switch(ls_data, tz_id)
raise 'Virtual Wire not created in NSX' unless @ls_id
raise 'Missing logical switch data' unless ls_data
@ls_id = new_logical_switch(ls_data, tz_id)
raise 'Virtual Wire not created in NSX' unless @ls_id
# Construct URL of the created logical switch
@url_ls = @base_url + SECTION_LS + @ls_id
@ls_vni = ls_vni
@ls_name = ls_name
@tz_id = ls_tz
@tenant_id = 'virtual wire tenant'
@guest_vlan_allowed = false
# Construct URL of the created logical switch
@url_ls = @base_url + SECTION_LS + @ls_id
@ls_vni = ls_vni
@ls_name = ls_name
@tz_id = ls_tz
@tenant_id = 'virtual wire tenant'
@guest_vlan_allowed = false
end
end
end
end