vagrant-guests-clearlinux 1.0.10 → 1.0.11

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: 12094580e496d770684e515b9a0fbfd2ac902dd17e13d0ff487d0379453f1eaa
4
- data.tar.gz: 37858543d3c4f9a7403ee45f12e8228852a79c48ed322034e4c57d6e55998470
3
+ metadata.gz: 9a0bf27d01315661bbd39dc82ba6c5bbaea3d8e21264be124ba4227184e68dd6
4
+ data.tar.gz: 3937c110ed621d7db7a1b74e618fac4f68ec62451d5a869e5386ac8bee7eb377
5
5
  SHA512:
6
- metadata.gz: fce946a88c504d93b04a721dd9d9bfe87d670d6e7a62e684947d9b3133325cba9332d9f19568adef58b918a81cd076a0dbe2dc35d87185d475c893ac232f4a3d
7
- data.tar.gz: ee7700810f32b3ffc4cdaa8165459b2f4a9e0fdea7ed2a46ea892dae640c8dae19d0a5cf7446419ffab5d154d2ffa1a3b32345b4952df41c6531490ccffb664a
6
+ metadata.gz: 6af48e6b54266051c699c98e76121050d1cf2530cd5f14af523444b4d127f2c497e983b4194923ab7595b04502f55d74168f42338474a5c3c936648c45f4b605
7
+ data.tar.gz: 6070645fcefa9fed672be4bfb32c54ce9230a6491379b1a361d949bbc92b04980f8f341cc22c4af0975ea9a762fd55e43ce68993761851de6a5ab5ef434cdef1
data/README.md CHANGED
@@ -17,7 +17,7 @@ To build and install the plugin directly from this repo:
17
17
  ```
18
18
  $ bundle install
19
19
  $ bundle exec rake build
20
- $ vagrant plugin install pkg/vagrant-guests-clearlinux-1.0.10.gem
20
+ $ vagrant plugin install pkg/vagrant-guests-clearlinux-1.0.11.gem
21
21
  ```
22
22
 
23
23
  You can run RSpec with:
@@ -41,47 +41,46 @@ module VagrantPlugins
41
41
  @@logger = Log4r::Logger.new('vagrant::guest::clearlinux::configure_networks')
42
42
 
43
43
  def self.configure_networks(machine, networks)
44
- machine.communicate.tap do |comm|
45
-
46
- # Read network interface names
47
- interfaces = []
48
- comm.sudo("ifconfig -a | grep -E '^en|^eth' | cut -f1 -d' '") do |_, result|
49
- interfaces = result.split("\n")
50
- end
44
+ comm = machine.communicate
45
+ # Read network interface names
46
+ interfaces = []
47
+ comm.sudo("ifconfig -a | grep -E '^en|^eth' | cut -f1 -d' '") do |_, result|
48
+ interfaces = result.split("\n")
49
+ end
51
50
 
52
- # Configure interfaces
53
- networks.each do |network|
54
- interface = network[:interface].to_i
51
+ # Configure interfaces
52
+ networks.each do |network|
53
+ interface = network[:interface].to_i
55
54
 
56
- iface = interfaces[interface]
57
- if iface.nil?
58
- @@logger.warn("Could not find match rule for network #{network.inspect}")
59
- next
60
- end
61
- comm.sudo("mkdir -p /etc/systemd/network/")
62
- unit_name = find_network_file comm, iface
63
- comm.sudo("rm -f /etc/systemd/network/#{unit_name}")
55
+ iface = interfaces[interface]
56
+ if iface.nil?
57
+ @@logger.warn("Could not find match rule for network #{network.inspect}")
58
+ next
59
+ end
60
+ comm.sudo("mkdir -p /etc/systemd/network/")
61
+ unit_name = find_network_file comm, iface
62
+ comm.sudo("rm -f /etc/systemd/network/#{unit_name}")
64
63
 
65
- if network[:type] == :static
66
- cidr = IPAddr.new(network[:netmask]).to_cidr
67
- address = format('%s/%s', network[:ip], cidr)
68
- unit_file = format(STATIC_NETWORK, iface, address)
69
- elsif network[:type] == :dhcp
70
- unit_file = format(DHCP_NETWORK, iface)
71
- end
64
+ if network[:type] == :static
65
+ cidr = IPAddr.new(network[:netmask]).to_cidr
66
+ address = format('%s/%s', network[:ip], cidr)
67
+ unit_file = format(STATIC_NETWORK, iface, address)
68
+ elsif network[:type] == :dhcp
69
+ unit_file = format(DHCP_NETWORK, iface)
70
+ end
72
71
 
73
- temp = Tempfile.new('vagrant')
74
- temp.binmode
75
- temp.write(unit_file)
76
- temp.close
72
+ temp = Tempfile.new('vagrant')
73
+ temp.binmode
74
+ temp.write(unit_file)
75
+ temp.close
77
76
 
78
- comm.upload(temp.path, "/tmp/#{unit_name}")
79
- comm.sudo("mv /tmp/#{unit_name} /etc/systemd/network/")
80
- comm.sudo("chown root:root /etc/systemd/network/#{unit_name}")
81
- comm.sudo("chmod a+r /etc/systemd/network/#{unit_name}")
82
- end
83
- comm.sudo('systemctl restart systemd-networkd')
77
+ comm.upload(temp.path, "/tmp/#{unit_name}")
78
+ comm.sudo(["mv /tmp/#{unit_name} /etc/systemd/network/",
79
+ "chown root:root /etc/systemd/network/#{unit_name}",
80
+ "chmod a+r /etc/systemd/network/#{unit_name}"].join("\n"))
84
81
  end
82
+ comm.sudo("systemctl restart systemd-networkd")
83
+ comm.wait_for_ready(30)
85
84
  end
86
85
 
87
86
  def self.find_network_file(comm, iface)
@@ -4,6 +4,6 @@
4
4
  module VagrantPlugins
5
5
  # Set version for vagrant-guests-clearlinux gem.
6
6
  module GuestClearLinux
7
- VERSION = '1.0.10'
7
+ VERSION = '1.0.11'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-guests-clearlinux
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - António Meireles