@@ -727,7 +727,7 @@ def zoneniccreate(uii, opts)
727
727
uii . info ( I18n . t ( 'vagrant_zones.creating_vnic' ) )
728
728
uii . info ( " #{ vnic_name } " )
729
729
command = "#{ @pfexec } dladm create-vnic -l #{ opts [ :bridge ] } -m #{ mac } "
730
- command += " -v #{ opts [ :vlan ] } " unless opts [ :vlan ] . nil? || ( opts [ :vlan ] ) . zero?
730
+ command += " -v #{ opts [ :vlan ] } " unless opts [ :vlan ] . nil? || opts [ :vlan ] . zero?
731
731
command += " #{ vnic_name } "
732
732
execute ( false , command )
733
733
end
@@ -928,9 +928,9 @@ def zonecfgshareddisks(uii, _name, config, zcfg)
928
928
## zonecfg function for CPU Configurations
929
929
def zonecfgcpu ( uii , _name , config , zcfg )
930
930
uii . info ( I18n . t ( 'vagrant_zones.zonecfgcpu' ) ) if config . debug
931
- if config . cpu_configuration == 'simple' && ( config . brand == ' bhyve' || config . brand == 'kvm' )
931
+ if config . cpu_configuration == 'simple' && %w[ bhyve kvm ] . include? ( config . brand )
932
932
execute ( false , %(#{ zcfg } "add attr; set name=vcpus; set value=#{ config . cpus } ; set type=string; end;") )
933
- elsif config . cpu_configuration == 'complex' && ( config . brand == ' bhyve' || config . brand == 'kvm' )
933
+ elsif config . cpu_configuration == 'complex' && %w[ bhyve kvm ] . include? ( config . brand )
934
934
hash = config . complex_cpu_conf [ 0 ]
935
935
cstring = %(sockets=#{ hash [ 'sockets' ] } ,cores=#{ hash [ 'cores' ] } ,threads=#{ hash [ 'threads' ] } )
936
936
execute ( false , %(#{ zcfg } 'add attr; set name=vcpus; set value="#{ cstring } "; set type=string; end;') )
@@ -1129,7 +1129,7 @@ def zonenicstpzloginsetup(uii, opts, config)
1129
1129
1130
1130
## This setups the Netplan based OS Networking via Zlogin
1131
1131
def zoneniczloginsetup_netplan ( uii , opts , mac )
1132
- zlogin ( uii , 'rm -rf /etc/netplan/*.yaml' ) if ( opts [ :nic_number ] ) . zero?
1132
+ zlogin ( uii , 'rm -rf /etc/netplan/*.yaml' ) if opts [ :nic_number ] . zero?
1133
1133
ip = ipaddress ( uii , opts )
1134
1134
vnic_name = vname ( uii , opts )
1135
1135
servers = dnsservers ( uii , opts ) . map { |server | server [ 'nameserver' ] } . join ( ', ' ) unless opts [ :dns ] . nil?
@@ -1644,7 +1644,7 @@ def zfssnapcronlist(uii, disk, opts, cronjobs)
1644
1644
uii . info ( I18n . t ( 'vagrant_zones.cron_entries' ) )
1645
1645
h = { h : 'hourly' , d : 'daily' , w : 'weekly' , m : 'monthly' }
1646
1646
h . each do |( _k , d ) |
1647
- next unless opts [ :list ] == d || opts [ :list ] == 'all'
1647
+ next unless [ d , 'all' ] . include? ( opts [ :list ] )
1648
1648
1649
1649
uii . info ( cronjobs [ d . to_sym ] ) unless cronjobs [ d . to_sym ] . nil?
1650
1650
end
@@ -1659,7 +1659,7 @@ def zfssnapcrondelete(uii, disk, opts, cronjobs)
1659
1659
h = { h : 'hourly' , d : 'daily' , w : 'weekly' , m : 'monthly' }
1660
1660
uii . info ( I18n . t ( 'vagrant_zones.cron_delete' ) )
1661
1661
h . each do |( _k , d ) |
1662
- next unless opts [ :delete ] == d || opts [ :delete ] == 'all'
1662
+ next unless [ d , 'all' ] . include? ( opts [ :delete ] )
1663
1663
1664
1664
cj = cronjobs [ d . to_sym ] . to_s . gsub ( '*' , '\*' )
1665
1665
rc = "#{ rmcr } '#{ cj } ' | #{ sc } "
0 commit comments