vagrant-zones 0.1.71 → 0.1.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a8502a47d1fddbed3fcd5df3876a39563bdbbb1b9ccdd6e3670f7966a686034
4
- data.tar.gz: c90a6246364fcfc76b2069eedac12fd0e8e0a32804a458de64ebf53a8ff1b937
3
+ metadata.gz: 1db5834991b56f5766c88f90ff5f227e3dd26bd77d48df861b9983807bf24432
4
+ data.tar.gz: 58146a70bed428cd95df64bc3df9bf4766d1090a4003aea6e22fbcfa4255f1a4
5
5
  SHA512:
6
- metadata.gz: 5bf9727ed10ed184e4469377f94799ee700efa91f1336b8a02a285cc8999f5a6468862e9a8c59620b2ec552a474507a362aa6c0f877aee374abfc0b2a18bba13
7
- data.tar.gz: ce34f071b7afa2685430560149b64957f2e81779a64182919411d893462fc839c34f1dc80b86f5334fa383f95640d9c026a2002cd1b9c2d56e53bac919bc62af
6
+ metadata.gz: 37f9361e1db8bb106ff23499263f98e182a6b8d2470956000e66e2db77ecca7bdf6f066f4da72a5ee1c27fab41dd84aac61e18ff1b337dcbad1fcd0702ff18e9
7
+ data.tar.gz: 430adac41fa0b0ae65a98d8d3156b4da11b552b19d3130bc6246a6f4492314c18fa792ad963fbc88573bb057b2c2616538db7bff50cfd60a60d1575072ab2f61
@@ -19,7 +19,7 @@ jobs:
19
19
  runs-on: ubuntu-latest
20
20
  strategy:
21
21
  matrix:
22
- ruby-version: ['2.6', '2.7', '3.0']
22
+ ruby-version: ['2.7', '3.0']
23
23
 
24
24
  steps:
25
25
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.73](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.72...v0.1.73) (2023-08-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Stable OmniOS Networking via DLADM and zlogin ([93e338b](https://github.com/STARTcloud/vagrant-zones/commit/93e338b84c83d4572d6cd1aa4689e130e23d39c8))
9
+
10
+ ## [0.1.72](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.71...v0.1.72) (2023-02-06)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * confirmation push ([8518bd1](https://github.com/STARTcloud/vagrant-zones/commit/8518bd11139ce3ff7433135a59cfedad07702b0a))
16
+ * dhcp, gatherip, root home ([a6458be](https://github.com/STARTcloud/vagrant-zones/commit/a6458befefb2d4092cf1080904da48bb863d3d92))
17
+ * lint a little ([a46728b](https://github.com/STARTcloud/vagrant-zones/commit/a46728b549b2a078c1d61a65ce3fcfe47c1f609f))
18
+ * lint a little more ([1106aa4](https://github.com/STARTcloud/vagrant-zones/commit/1106aa44cbf43aafc483427c4850b216438cf327))
19
+ * lint a little more ([0a66c99](https://github.com/STARTcloud/vagrant-zones/commit/0a66c99f6846a4527467f9e2d7273e8554acc259))
20
+ * unassisted dhcp ([917e713](https://github.com/STARTcloud/vagrant-zones/commit/917e713cd82db591c28f46453912dd6aef45edae))
21
+ * unassisted dhcp ([9e55438](https://github.com/STARTcloud/vagrant-zones/commit/9e55438020f6c0d203298a2066cedae6013a15a2))
22
+ * unassisted dhcp ([1501a9a](https://github.com/STARTcloud/vagrant-zones/commit/1501a9a04136c204e47ef283d016fec3179e067b))
23
+ * unassisted dhcp ([b24b784](https://github.com/STARTcloud/vagrant-zones/commit/b24b784e2fad31566467358b30c98338257ceab5))
24
+ * unassisted dhcp ([866660c](https://github.com/STARTcloud/vagrant-zones/commit/866660ce249d2fee6a87c61318012dc8befe48a2))
25
+ * unassisted dhcp ([130e4d3](https://github.com/STARTcloud/vagrant-zones/commit/130e4d369503f0130e56d3947bae5d2ef2754b19))
26
+ * unassisted dhcp ([f3faed4](https://github.com/STARTcloud/vagrant-zones/commit/f3faed405f6a75432bab84d2fb3eec1d4f62c23f))
27
+
3
28
  ## [0.1.71](https://github.com/STARTcloud/vagrant-zones/compare/v0.1.70...v0.1.71) (2023-02-04)
4
29
 
5
30
 
data/Gemfile CHANGED
@@ -11,4 +11,15 @@ end
11
11
 
12
12
  group :plugins do
13
13
  gemspec
14
+ gem 'bundler', '~> 2.2', '>= 2.2.3'
15
+ gem 'code-scanning-rubocop', '~> 0.5', '>= 0.5.0'
16
+ gem 'rake', '~> 13.0', '>= 13.0.6'
17
+ gem 'rspec', '~> 3.4'
18
+ gem 'rspec-core', '~> 3.4'
19
+ gem 'rspec-expectations', '~> 3.10', '>= 3.10.0'
20
+ gem 'rspec-mocks', '~> 3.10', '>= 3.10.0'
21
+ gem 'rubocop', '~> 1.0'
22
+ gem 'rubocop-rake', '~> 0.6', '>= 0.6.0'
23
+ gem 'rubocop-rspec', '~> 2.4', '>= 2.4.0'
24
+ gem 'ruby-progressbar', '~> 1.11', '>= 1.11.0'
14
25
  end
@@ -15,7 +15,7 @@ module VagrantPlugins
15
15
 
16
16
  def call(env)
17
17
  @machine = env[:machine]
18
- @driver = @machine.provider.driver
18
+ @driver = @machine.provider.driver
19
19
  @driver.halt(env[:ui])
20
20
  @driver.destroy(env[:ui])
21
21
  @driver.delete_dataset(env[:ui])
@@ -21,7 +21,7 @@ module VagrantPlugins
21
21
 
22
22
  def validate_uuid_format(uuid)
23
23
  uuid_regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
24
- return true if uuid_regex.match?(uuid.to_s.downcase)
24
+ true if uuid_regex.match?(uuid.to_s.downcase)
25
25
  end
26
26
 
27
27
  def call(env)
@@ -97,8 +97,8 @@ module VagrantPlugins
97
97
  @app.call(env)
98
98
  end
99
99
 
100
- def execute(*cmd, **opts, &block)
101
- @executor.execute(*cmd, **opts, &block)
100
+ def execute(...)
101
+ @executor.execute(...)
102
102
  end
103
103
 
104
104
  def check(uuid, env_ui)
@@ -20,8 +20,8 @@ module VagrantPlugins
20
20
  env['package.output'] ||= 'package.box'
21
21
  end
22
22
 
23
- def execute(*cmd, **opts, &block)
24
- @executor.execute(*cmd, **opts, &block)
23
+ def execute(...)
24
+ @executor.execute(...)
25
25
  end
26
26
 
27
27
  def call(env)
@@ -54,8 +54,8 @@ module VagrantPlugins
54
54
  end
55
55
 
56
56
  # Execute System commands
57
- def execute(*cmd, **opts, &block)
58
- @executor.execute(*cmd, **opts, &block)
57
+ def execute(...)
58
+ @executor.execute(...)
59
59
  end
60
60
 
61
61
  ## Begin installation for zone
@@ -82,7 +82,7 @@ module VagrantPlugins
82
82
  config = @machine.provider_config
83
83
  uii.info(I18n.t('vagrant_zones.control')) if config.debug
84
84
  case control
85
- when 'restart'
85
+ when 'rmatch(/estart'
86
86
  command = 'sudo shutdown -r'
87
87
  command = config.safe_restart unless config.safe_restart.nil?
88
88
  ssh_run_command(uii, command)
@@ -98,7 +98,7 @@ module VagrantPlugins
98
98
  ## Run commands over SSH instead of ZLogin
99
99
  def ssh_run_command(uii, command)
100
100
  config = @machine.provider_config
101
- ip = get_ip_address('runsshcommmand')
101
+ ip = get_ip_address(uii)
102
102
  user = user(@machine)
103
103
  key = userprivatekeypath(@machine).to_s
104
104
  port = sshport(@machine).to_s
@@ -233,7 +233,7 @@ module VagrantPlugins
233
233
  ip = if opts[:ip].empty?
234
234
  nil
235
235
  else
236
- opts[:ip].gsub(/\t/, '')
236
+ opts[:ip].gsub("\t", '')
237
237
  end
238
238
  uii.info(I18n.t('vagrant_zones.ipaddress') + ip) if config.debug
239
239
  ip
@@ -258,38 +258,57 @@ module VagrantPlugins
258
258
  end
259
259
 
260
260
  ## If DHCP and Zlogin, get the IP address
261
- def get_ip_address(_function)
261
+ def get_ip_address(_uii)
262
262
  config = @machine.provider_config
263
263
  name = @machine.name
264
+ lcheck = config.lcheck
265
+ lcheck = ':~' if config.lcheck.nil?
266
+ alcheck = config.alcheck
267
+ alcheck = 'login:' if config.alcheck.nil?
268
+ pcheck = 'Password:'
269
+
264
270
  @machine.config.vm.networks.each do |_adaptertype, opts|
265
- responses = []
266
- nic_type = nictype(opts)
271
+ ip = nil
267
272
  if opts[:dhcp4] && opts[:managed]
268
- vnic_name = "vnic#{nic_type}#{vtype(config)}_#{config.partition_id}_#{opts[:nic_number]}"
273
+ vnic_name = "vnic#{nictype(opts)}#{vtype(config)}_#{config.partition_id}_#{opts[:nic_number]}"
269
274
  PTY.spawn("pfexec zlogin -C #{name}") do |zlogin_read, zlogin_write, pid|
270
- command = "ip -4 addr show dev #{vnic_name} | head -n -1 | tail -1 | awk '{ print $2 }' | cut -f1 -d\"/\" \n"
271
- zlogin_read.expect(/\n/) { zlogin_write.printf(command) }
272
- Timeout.timeout(config.clean_shutdown_time) do
275
+ Timeout.timeout(config.setup_wait) do
276
+ rsp = []
277
+ command = "ip -4 addr show dev #{vnic_name} | grep -Po 'inet \\K[\\d.]+' \r\n"
278
+ i = 0
279
+ logged_in = false
273
280
  loop do
274
- zlogin_read.expect(/\r\n/) { |line| responses.push line }
275
- if responses[-1].to_s.match(/(?:[0-9]{1,3}\.){3}[0-9]{1,3}/)
276
- ip = responses[-1][0].rstrip.gsub(/\e\[\?2004l/, '').lstrip
277
- return nil if ip.empty?
278
- return ip.gsub(/\t/, '') unless ip.empty?
281
+ zlogin_read.expect(/\r\n/) { |line| rsp.push line }
282
+ logged_in = true if rsp[-1].to_s.match(/(#{Regexp.quote(lcheck)})/) || rsp[-1].to_s.match(/(:~)/)
283
+ zlogin_write.printf("\r\n") if i < 1
284
+ i += 1
279
285
 
280
- break
281
- end
282
- errormessage = "==> #{name} ==> Command ==> #{command} \nFailed with ==> #{responses[-1]}"
283
- raise errormessage if responses[-1].to_s.match(/Error Code: \b(?!0\b)\d{1,4}\b/)
286
+ break if logged_in || rsp[-1].to_s.match(/(#{Regexp.quote(alcheck)})/)
287
+ end
288
+
289
+ unless logged_in
290
+ zlogin_write.printf("#{user(@machine)}\n") if zlogin_read.expect(/#{Regexp.quote(alcheck)}/)
291
+ zlogin_write.printf("#{vagrantuserpass(@machine)}\n") if zlogin_read.expect(/#{Regexp.quote(pcheck)}/)
292
+ logged_in = true if zlogin_read.expect(/#{Regexp.quote(lcheck)}/)
293
+ end
294
+
295
+ puts 'Gathering IP' if config.debug_boot
296
+ zlogin_write.printf(command) if logged_in
297
+ loop do
298
+ zlogin_read.expect(/\r\n/) { |line| rsp.push line }
299
+ ip = rsp[-1].to_s.match(/((?:[0-9]{1,3}\.){3}[0-9]{1,3})/)
300
+
301
+ break if rsp[-1].to_s.match(/((?:[0-9]{1,3}\.){3}[0-9]{1,3})/)
284
302
  end
303
+ Process.kill('HUP', pid)
285
304
  end
286
- Process.kill('HUP', pid)
287
305
  end
306
+ return ip[0] unless ip[0].empty? || ip[0].nil?
288
307
  elsif (opts[:dhcp4] == false || opts[:dhcp4].nil?) && opts[:managed]
289
308
  ip = opts[:ip].to_s
290
309
  return nil if ip.empty?
291
310
 
292
- return ip.gsub(/\t/, '')
311
+ return ip.gsub("\t", '')
293
312
  end
294
313
  end
295
314
  end
@@ -512,8 +531,7 @@ module VagrantPlugins
512
531
  netplan4 = %( nameservers:\n addresses: [#{servers[0]['nameserver']} , #{servers[1]['nameserver']}] )
513
532
  netplan = netplan1 + netplan2 + netplan3 + netplan4
514
533
  cmd = "echo -e '#{netplan}' | sudo tee /etc/netplan/#{vnic_name}.yaml"
515
- infomessage = I18n.t('vagrant_zones.netplan_applied_static') + "/etc/netplan/#{vnic_name}.yaml"
516
- uii.info(infomessage) if ssh_run_command(uii, cmd)
534
+ uii.info(I18n.t('vagrant_zones.netplan_applied_static') + "/etc/netplan/#{vnic_name}.yaml") if ssh_run_command(uii, cmd)
517
535
 
518
536
  ## Apply the Configuration
519
537
  uii.info(I18n.t('vagrant_zones.netplan_applied')) if ssh_run_command(uii, 'sudo netplan apply')
@@ -534,22 +552,24 @@ module VagrantPlugins
534
552
  phys_if = 'pfexec dladm show-phys -m -o LINK,ADDRESS,CLIENT | tail -n +2'
535
553
  phys_if_results = ssh_run_command(uii, phys_if).split("\n")
536
554
  device = ''
555
+ interface = ''
537
556
  phys_if_results.each do |entry|
538
557
  e_mac = ''
539
- entries = entry.strip.split
558
+ entries = entry.strip.split("\r")[1].split
540
559
  entries[1].split(':').each { |x| e_mac += "#{format('%02x', x.to_i(16))}:" }
541
560
  e_mac = e_mac[0..-2]
542
561
  device = entries[0] if e_mac.match(/#{mac}/)
562
+ interface = entries[2] if e_mac.match(/#{mac}/)
543
563
  end
544
564
 
545
- delete_if = "pfexec ipadm delete-if #{device}"
546
- rename_link = "pfexec dladm rename-link #{device} #{vnic_name}"
565
+ delete_if = interface.match(/--/) ? '' : "pfexec ipadm delete-if #{device} && "
566
+ rename_link = "pfexec dladm rename-link #{device} #{vnic_name} && "
547
567
  if_create = "pfexec ipadm create-if #{vnic_name}"
548
568
  static_addr = "pfexec ipadm create-addr -T static -a #{ip}/#{shrtsubnet} #{vnic_name}/v4vagrant"
549
- net_cmd = "#{delete_if} && #{rename_link} && #{if_create} && #{static_addr}"
569
+ net_cmd = "#{delete_if} #{rename_link} #{if_create} && #{static_addr}"
550
570
  uii.info(I18n.t('vagrant_zones.dladm_applied')) if ssh_run_command(uii, net_cmd)
551
-
552
- route_add = "pfexec route -p add default #{defrouter}"
571
+ route_add = ''
572
+ route_add = "pfexec route -p add default #{defrouter}" unless defrouter.nil?
553
573
  uii.info(I18n.t('vagrant_zones.dladm_route_applied')) if ssh_run_command(uii, route_add)
554
574
 
555
575
  ns_string = "nameserver #{servers[0]['nameserver']}\nnameserver #{servers[1]['nameserver']}"
@@ -557,6 +577,48 @@ module VagrantPlugins
557
577
  uii.info(I18n.t('vagrant_zones.dladm_dns_applied')) if ssh_run_command(uii, dns_set.to_s)
558
578
  end
559
579
 
580
+ ## Setup vnics for Zones using zlogin for solaris like OSes -- ie dladm
581
+ def zoneniczloginsetup_dladm(uii, opts, mac)
582
+ ip = ipaddress(uii, opts)
583
+ defrouter = opts[:gateway].to_s
584
+ vnic_name = vname(uii, opts)
585
+ shrtsubnet = IPAddr.new(opts[:netmask].to_s).to_i.to_s(2).count('1').to_s
586
+ servers = dnsservers(uii, opts)
587
+ uii.info(I18n.t('vagrant_zones.configure_interface_using_vnic_dladm'))
588
+ uii.info(" #{vnic_name}")
589
+
590
+ # loop through each phys if and run code if physif matches #{mac}
591
+ segments = mac.split(':')
592
+ new_segments = segments.map { |segment| segment.to_i(16).to_s(16) }
593
+ sanitized_mac = new_segments.join(':')
594
+ phys_if = "pfexec dladm show-phys -m -o LINK,ADDRESS,CLIENT | tail -n +2 | grep #{sanitized_mac}"
595
+ phys_if_results = zlogin(uii, phys_if)
596
+ device = ''
597
+ interface = ''
598
+ phys_if_results.each do |entry|
599
+ e_mac = ''
600
+ entries = entry.strip.split("\r")[1].split
601
+ entries[1].split(':').each { |x| e_mac += "#{format('%02x', x.to_i(16))}:" }
602
+ e_mac = e_mac[0..-2]
603
+ device = entries[0] if e_mac.match(/#{mac}/)
604
+ interface = entries[2] if e_mac.match(/#{mac}/)
605
+ end
606
+
607
+ delete_if = interface.match(/--/) ? '' : "pfexec ipadm delete-if #{device} && "
608
+ rename_link = "pfexec dladm rename-link #{device} #{vnic_name} && "
609
+ if_create = "pfexec ipadm create-if #{vnic_name}"
610
+ static_addr = "pfexec ipadm create-addr -T static -a #{ip}/#{shrtsubnet} #{vnic_name}/v4vagrant"
611
+ net_cmd = "#{delete_if} #{rename_link} #{if_create} && #{static_addr}"
612
+ uii.info(I18n.t('vagrant_zones.dladm_applied')) if zlogin(uii, net_cmd)
613
+ route_add = "pfexec route -p add default #{defrouter}"
614
+ route_add = 'echo True' if opts[:gateway].nil?
615
+ uii.info(I18n.t('vagrant_zones.dladm_route_applied')) if zlogin(uii, route_add)
616
+
617
+ ns_string = "nameserver #{servers[0]['nameserver']}\nnameserver #{servers[1]['nameserver']}"
618
+ dns_set = "pfexec echo '#{ns_string}' | pfexec tee /etc/resolv.conf"
619
+ uii.info(I18n.t('vagrant_zones.dladm_dns_applied')) if zlogin(uii, dns_set.to_s)
620
+ end
621
+
560
622
  ## zonecfg function for for nat Networking
561
623
  def natnicconfig(uii, opts)
562
624
  config = @machine.provider_config
@@ -1048,8 +1110,15 @@ module VagrantPlugins
1048
1110
  mac = mac[0..-2]
1049
1111
  end
1050
1112
 
1113
+ ## Code Block to Detect OS
1114
+ cmd = 'uname -a'
1115
+ uii.info(I18n.t('vagrant_zones.os_detect'))
1116
+ os_detected = zlogin(uii, cmd)
1117
+ uii.info('Zone OS detected as: OmniOS') if os_detected.to_s.match(/SunOS/)
1118
+
1051
1119
  zoneniczloginsetup_windows(uii, opts, mac) if config.os_type.to_s.match(/windows/)
1052
- zoneniczloginsetup_netplan(uii, opts, mac) unless config.os_type.to_s.match(/windows/)
1120
+ zoneniczloginsetup_dladm(uii, opts, mac) if os_detected.to_s.match(/SunOS/)
1121
+ zoneniczloginsetup_netplan(uii, opts, mac) if !config.os_type.to_s.match(/windows/) && !os_detected.to_s.match(/SunOS/)
1053
1122
  end
1054
1123
 
1055
1124
  ## This setups the Netplan based OS Networking via Zlogin
@@ -1074,7 +1143,6 @@ module VagrantPlugins
1074
1143
  cmd = "echo '#{netplan}' > /etc/netplan/#{vnic_name}.yaml"
1075
1144
  infomessage = I18n.t('vagrant_zones.netplan_applied_static') + "/etc/netplan/#{vnic_name}.yaml"
1076
1145
  uii.info(infomessage) if zlogin(uii, cmd)
1077
- ## Apply the Configuration
1078
1146
  uii.info(I18n.t('vagrant_zones.netplan_applied')) if zlogin(uii, 'netplan apply')
1079
1147
  end
1080
1148
 
@@ -1187,7 +1255,7 @@ module VagrantPlugins
1187
1255
  zlogin_write.printf("\n")
1188
1256
  if zlogin_read.expect(/#{lcheck}/)
1189
1257
  uii.info(I18n.t('vagrant_zones.automated-zlogin-root'))
1190
- zlogin_write.printf("sudo su\n")
1258
+ zlogin_write.printf("sudo su -\n")
1191
1259
  sleep(config.login_wait)
1192
1260
  Process.kill('HUP', pid)
1193
1261
  end
@@ -1321,6 +1389,7 @@ module VagrantPlugins
1321
1389
  name = @machine.name
1322
1390
  config = @machine.provider_config
1323
1391
  rsp = []
1392
+ execute_return = ''
1324
1393
  PTY.spawn("pfexec zlogin -C #{name}") do |zread, zwrite, pid|
1325
1394
  Timeout.timeout(config.setup_wait) do
1326
1395
  error_check = "echo \"Error Code: $?\"\n"
@@ -1328,10 +1397,11 @@ module VagrantPlugins
1328
1397
  runonce = true
1329
1398
  loop do
1330
1399
  zread.expect(/\n/) { |line| rsp.push line }
1331
- puts(rsp[-1].to_s) if config.debug
1400
+ puts(rsp[-1]) if config.debug
1332
1401
  zwrite.printf("#{cmd}\r\n") if runonce
1333
1402
  zwrite.printf(error_check.to_s) if runonce
1334
1403
  runonce = false
1404
+ execute_return = rsp[-4] if rsp[-1].to_s.match(/Error Code: 0/)
1335
1405
  break if rsp[-1].to_s.match(/Error Code: 0/)
1336
1406
 
1337
1407
  em = "#{cmd} \nFailed with ==> #{rsp[-1]}"
@@ -1341,6 +1411,7 @@ module VagrantPlugins
1341
1411
  end
1342
1412
  Process.kill('HUP', pid)
1343
1413
  end
1414
+ execute_return
1344
1415
  end
1345
1416
 
1346
1417
  # This checks if the user exists on the VM, usually for LX zones
@@ -1436,7 +1507,7 @@ module VagrantPlugins
1436
1507
  ## List ZFS Snapshots, helper function to sort and display
1437
1508
  def zfssnaplistdisp(zfs_snapshots, uii, index, disk)
1438
1509
  uii.info("\n Disk Number: #{index}\n Disk Path: #{disk}")
1439
- zfssnapshots = zfs_snapshots.split(/\n/).reverse
1510
+ zfssnapshots = zfs_snapshots.split("\n").reverse
1440
1511
  zfssnapshots << "Snapshot\t\t\t\tUsed\tAvailable\tRefer\tPath"
1441
1512
  pml, rml, aml, uml, sml = 0
1442
1513
  zfssnapshots.reverse.each do |snapshot|
@@ -1509,7 +1580,7 @@ module VagrantPlugins
1509
1580
  datasets.each do |disk|
1510
1581
  output = execute(false, "#{@pfexec} zfs list -t snapshot -o name | grep #{disk}")
1511
1582
  ## Never delete the source when doing all
1512
- output = output.split(/\n/).drop(1)
1583
+ output = output.split("\n").drop(1)
1513
1584
  ## Delete in Reverse order
1514
1585
  output.reverse.each do |snaps|
1515
1586
  cmd = "#{@pfexec} zfs destroy #{snaps}"
@@ -1523,7 +1594,7 @@ module VagrantPlugins
1523
1594
  next unless dindex.to_i == opts[:dataset].to_i
1524
1595
 
1525
1596
  output = execute(false, "#{@pfexec} zfs list -t snapshot -o name | grep #{disk}")
1526
- output = output.split(/\n/).drop(1)
1597
+ output = output.split("\n").drop(1)
1527
1598
  output.each_with_index do |snaps, spindex|
1528
1599
  if opts[:snapshot_name].to_i == spindex && opts[:snapshot_name].to_s != 'all'
1529
1600
  uii.info(" - #{snaps}")
@@ -1567,7 +1638,7 @@ module VagrantPlugins
1567
1638
  h.each do |_k, d|
1568
1639
  next unless opts[:delete] == d || opts[:delete] == 'all'
1569
1640
 
1570
- cj = cronjobs[d.to_sym].to_s.gsub(/\*/, '\*')
1641
+ cj = cronjobs[d.to_sym].to_s.gsub('*', '\*')
1571
1642
  rc = "#{rmcr}'#{cj}' | #{sc}"
1572
1643
  uii.info(" - Removing Cron: #{cj}") unless cronjobs[d.to_sym].nil?
1573
1644
  execute(false, rc) unless cronjobs[d.to_sym].nil?
@@ -36,7 +36,7 @@ module VagrantPlugins
36
36
  private_key_path: driver.userprivatekeypath(@machine).to_s,
37
37
  PasswordAuthentication: passwordauth
38
38
  }
39
- return ssh_info unless ssh_info.nil?
39
+ ssh_info unless ssh_info.nil?
40
40
  end
41
41
 
42
42
  # This should return an action callable for the given name.
@@ -2,7 +2,7 @@
2
2
 
3
3
  module VagrantPlugins
4
4
  module ProviderZone
5
- VERSION = '0.1.71'
5
+ VERSION = '0.1.73'
6
6
  NAME = 'vagrant-zones'
7
7
  end
8
8
  end
@@ -27,22 +27,11 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ['lib']
29
29
 
30
- spec.required_ruby_version = '>= 2.6.0'
30
+ spec.required_ruby_version = '>= 2.7.0'
31
31
  spec.required_rubygems_version = '>= 1.3.6'
32
32
  spec.add_runtime_dependency 'i18n', '~> 1.0'
33
33
  spec.add_runtime_dependency 'iniparse', '~> 1.0'
34
34
  spec.add_runtime_dependency 'log4r', '~> 1.1'
35
35
  spec.add_runtime_dependency 'netaddr', '~> 2.0', '>= 2.0.4'
36
36
  spec.add_runtime_dependency 'ruby_expect', '~> 1.7', '>= 1.7.5'
37
- spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.3'
38
- spec.add_development_dependency 'code-scanning-rubocop', '~> 0.5', '>= 0.5.0'
39
- spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
40
- spec.add_development_dependency 'rspec', '~> 3.4'
41
- spec.add_development_dependency 'rspec-core', '~> 3.4'
42
- spec.add_development_dependency 'rspec-expectations', '~> 3.10', '>= 3.10.0'
43
- spec.add_development_dependency 'rspec-mocks', '~> 3.10', '>= 3.10.0'
44
- spec.add_development_dependency 'rubocop', '~> 1.0'
45
- spec.add_development_dependency 'rubocop-rake', '~> 0.6', '>= 0.6.0'
46
- spec.add_development_dependency 'rubocop-rspec', '~> 2.4', '>= 2.4.0'
47
- spec.add_development_dependency 'ruby-progressbar', '~> 1.11', '>= 1.11.0'
48
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-zones
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.71
4
+ version: 0.1.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gilbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-04 00:00:00.000000000 Z
11
+ date: 2023-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -92,208 +92,6 @@ dependencies:
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: 1.7.5
95
- - !ruby/object:Gem::Dependency
96
- name: bundler
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '2.2'
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: 2.2.3
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '2.2'
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 2.2.3
115
- - !ruby/object:Gem::Dependency
116
- name: code-scanning-rubocop
117
- requirement: !ruby/object:Gem::Requirement
118
- requirements:
119
- - - "~>"
120
- - !ruby/object:Gem::Version
121
- version: '0.5'
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.5.0
125
- type: :development
126
- prerelease: false
127
- version_requirements: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '0.5'
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 0.5.0
135
- - !ruby/object:Gem::Dependency
136
- name: rake
137
- requirement: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '13.0'
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- version: 13.0.6
145
- type: :development
146
- prerelease: false
147
- version_requirements: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '13.0'
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: 13.0.6
155
- - !ruby/object:Gem::Dependency
156
- name: rspec
157
- requirement: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - "~>"
160
- - !ruby/object:Gem::Version
161
- version: '3.4'
162
- type: :development
163
- prerelease: false
164
- version_requirements: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - "~>"
167
- - !ruby/object:Gem::Version
168
- version: '3.4'
169
- - !ruby/object:Gem::Dependency
170
- name: rspec-core
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - "~>"
174
- - !ruby/object:Gem::Version
175
- version: '3.4'
176
- type: :development
177
- prerelease: false
178
- version_requirements: !ruby/object:Gem::Requirement
179
- requirements:
180
- - - "~>"
181
- - !ruby/object:Gem::Version
182
- version: '3.4'
183
- - !ruby/object:Gem::Dependency
184
- name: rspec-expectations
185
- requirement: !ruby/object:Gem::Requirement
186
- requirements:
187
- - - "~>"
188
- - !ruby/object:Gem::Version
189
- version: '3.10'
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- version: 3.10.0
193
- type: :development
194
- prerelease: false
195
- version_requirements: !ruby/object:Gem::Requirement
196
- requirements:
197
- - - "~>"
198
- - !ruby/object:Gem::Version
199
- version: '3.10'
200
- - - ">="
201
- - !ruby/object:Gem::Version
202
- version: 3.10.0
203
- - !ruby/object:Gem::Dependency
204
- name: rspec-mocks
205
- requirement: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - "~>"
208
- - !ruby/object:Gem::Version
209
- version: '3.10'
210
- - - ">="
211
- - !ruby/object:Gem::Version
212
- version: 3.10.0
213
- type: :development
214
- prerelease: false
215
- version_requirements: !ruby/object:Gem::Requirement
216
- requirements:
217
- - - "~>"
218
- - !ruby/object:Gem::Version
219
- version: '3.10'
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: 3.10.0
223
- - !ruby/object:Gem::Dependency
224
- name: rubocop
225
- requirement: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - "~>"
228
- - !ruby/object:Gem::Version
229
- version: '1.0'
230
- type: :development
231
- prerelease: false
232
- version_requirements: !ruby/object:Gem::Requirement
233
- requirements:
234
- - - "~>"
235
- - !ruby/object:Gem::Version
236
- version: '1.0'
237
- - !ruby/object:Gem::Dependency
238
- name: rubocop-rake
239
- requirement: !ruby/object:Gem::Requirement
240
- requirements:
241
- - - "~>"
242
- - !ruby/object:Gem::Version
243
- version: '0.6'
244
- - - ">="
245
- - !ruby/object:Gem::Version
246
- version: 0.6.0
247
- type: :development
248
- prerelease: false
249
- version_requirements: !ruby/object:Gem::Requirement
250
- requirements:
251
- - - "~>"
252
- - !ruby/object:Gem::Version
253
- version: '0.6'
254
- - - ">="
255
- - !ruby/object:Gem::Version
256
- version: 0.6.0
257
- - !ruby/object:Gem::Dependency
258
- name: rubocop-rspec
259
- requirement: !ruby/object:Gem::Requirement
260
- requirements:
261
- - - "~>"
262
- - !ruby/object:Gem::Version
263
- version: '2.4'
264
- - - ">="
265
- - !ruby/object:Gem::Version
266
- version: 2.4.0
267
- type: :development
268
- prerelease: false
269
- version_requirements: !ruby/object:Gem::Requirement
270
- requirements:
271
- - - "~>"
272
- - !ruby/object:Gem::Version
273
- version: '2.4'
274
- - - ">="
275
- - !ruby/object:Gem::Version
276
- version: 2.4.0
277
- - !ruby/object:Gem::Dependency
278
- name: ruby-progressbar
279
- requirement: !ruby/object:Gem::Requirement
280
- requirements:
281
- - - "~>"
282
- - !ruby/object:Gem::Version
283
- version: '1.11'
284
- - - ">="
285
- - !ruby/object:Gem::Version
286
- version: 1.11.0
287
- type: :development
288
- prerelease: false
289
- version_requirements: !ruby/object:Gem::Requirement
290
- requirements:
291
- - - "~>"
292
- - !ruby/object:Gem::Version
293
- version: '1.11'
294
- - - ">="
295
- - !ruby/object:Gem::Version
296
- version: 1.11.0
297
95
  description: Vagrant provider plugin to support zones
298
96
  email:
299
97
  - support@prominic.net
@@ -385,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
385
183
  requirements:
386
184
  - - ">="
387
185
  - !ruby/object:Gem::Version
388
- version: 2.6.0
186
+ version: 2.7.0
389
187
  required_rubygems_version: !ruby/object:Gem::Requirement
390
188
  requirements:
391
189
  - - ">="