Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkProminic authored Aug 17, 2024
1 parent a892d05 commit 04d665d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/vagrant-zones/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,16 @@ def natnicconfig(uii, opts)
vnic_name = vname(uii, opts)
uii.info(I18n.t('vagrant_zones.nat_vnic_setup'))
uii.info(" #{vnic_name}")
strt = "#{@pfexec} zonecfg -z #{@machine.name} "
zonecfg = "#{@pfexec} zonecfg -z #{@machine.name} "
cie = config.cloud_init_enabled
case config.brand
when 'lx'
shrtstr1 = %(set allowed-address=#{allowed_address}; add property (name=gateway,value="#{defrouter}"); )
shrtstr2 = %(add property (name=ips,value="#{allowed_address}"); add property (name=primary,value="true"); end;)
execute(false, %(#{strt}set global-nic=auto; #{shrtstr1} #{shrtstr2}"))
execute(false, %(#{zonecfg}set global-nic=auto; #{shrtstr1} #{shrtstr2}"))
when 'bhyve'
execute(false, %(#{strt}"add net; set physical=#{vnic_name}; end;")) unless cie
execute(false, %(#{strt}"add net; set physical=#{vnic_name}; set allowed-address=#{allowed_address}; end;")) if cie
execute(false, %(#{zonecfg}"add net; set physical=#{vnic_name}; end;")) unless cie
execute(false, %(#{zonecfg}"add net; set physical=#{vnic_name}; set allowed-address=#{allowed_address}; end;")) if cie
end
end

Expand Down Expand Up @@ -1045,20 +1045,20 @@ def zonecfgnicconfig(uii, opts)
config = @machine.provider_config
uii.info(I18n.t('vagrant_zones.vnic_setup'))
uii.info(" #{vnic_name}")
strt = "#{@pfexec} zonecfg -z #{@machine.name} "
zonecfg = "#{@pfexec} zonecfg -z #{@machine.name} "
cie = config.cloud_init_enabled
aa = config.allowed_address
case config.brand
when 'lx'
shrtstr1 = %(set allowed-address=#{allowed_address}; add property (name=gateway,value="#{defrouter}"); )
shrtstr2 = %(add property (name=ips,value="#{allowed_address}"); add property (name=primary,value="true"); end;)
execute(false, %(#{strt}set global-nic=auto; #{shrtstr1} #{shrtstr2}"))
execute(false, %(#{zonecfg}set global-nic=auto; #{shrtstr1} #{shrtstr2}"))
when 'bhyve'
vlan_option = opts[:vlan].nil? || opts[:vlan].zero? ? '' : "set vlan-id=#{opts[:vlan]}; "
base_cmd = if config.on_demand_vnics
%(#{strt}"add net; set physical=#{vnic_name}; #{vlan_option}set global-nic=#{opts[:bridge]}; )
%(#{zonecfg}"add net; set physical=#{vnic_name}; #{vlan_option}set global-nic=#{opts[:bridge]}; )
else
%(#{strt}"add net; set physical=#{vnic_name}; )
%(#{zonecfg}"add net; set physical=#{vnic_name}; )
end
execute(false, %(#{base_cmd}end;)) unless cie
execute(false, %(#{base_cmd}set allowed-address=#{allowed_address}; end;)) if cie && aa
Expand Down

0 comments on commit 04d665d

Please sign in to comment.