vagrant-guests-clearlinux 1.1.3 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b9d8c743e3f93bfb55681f1e0ec2a6f310b9ff1b272b45b6ea6f61ad2bf288a
4
- data.tar.gz: 4999fa0b253f5ef51dadcab9ae46b817aefd40989ce2acf33534d52de98887a8
3
+ metadata.gz: e5faae4f77c23af96be0409500baccac750bbeb6190ffe4bc35fbe5e167d2916
4
+ data.tar.gz: ff619c6fc79786ae0128699c045168dae3bfc5333ca8fd411a559a2a3303b672
5
5
  SHA512:
6
- metadata.gz: 1d95b74340a5f14029d16dcbe70a09ecef94d40abb04dcac0ca409c0c956600d6f689c81a5d34bf390e681710a837e2ba9e7bd01f9f77d4788faaf9f413c2bdd
7
- data.tar.gz: 14213d4c582e24ce1c822747789d524c2c1af2115e9bcf26c1048a120ad57aca1152be12bf358329aa838a6ea3586e6d0c8ec2f450a396b02af060406b3790db
6
+ metadata.gz: 3d9c8be0da64353edf8bbeded78a6e1e0047c936cbed953066b284dc23e8550dcfc6d85c1ecd0a4f96b47fefccb859657313707d850073f63fec839d218070b1
7
+ data.tar.gz: a986025f005f51b2554c2599d91b0200fc92eb0ae762ce7d0a87ad41d2d2aea5d8b17f49106e76b7f674c6106244b470e3705f92fc8f6d01cbf61280431dce63
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'vagrant-guests-clearlinux/plugin'
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  module VagrantPlugins
@@ -9,13 +8,13 @@ module VagrantPlugins
9
8
  machine.communicate.tap do |comm|
10
9
  unless comm.test("hostnamectl --static | grep '#{name}'")
11
10
  comm.sudo([
12
- "rm /etc/machine-id",
13
- "systemd-machine-id-setup",
11
+ 'rm /etc/machine-id',
12
+ 'systemd-machine-id-setup',
14
13
  "hostnamectl set-hostname --static '#{name}'",
15
14
  "hostnamectl set-hostname --transient '#{name}'",
16
- "hostnamectl set-hostname --set-chassis vm",
17
- "systemctl restart systemd-networkd.service"
18
- ].join("\n"))
15
+ 'hostnamectl set-hostname --set-chassis vm',
16
+ 'systemctl restart systemd-networkd.service'
17
+ ].join("\n"))
19
18
  end
20
19
  end
21
20
  end
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'tempfile'
@@ -30,7 +29,7 @@ module VagrantPlugins
30
29
  class ConfigureNetworks
31
30
  include Vagrant::Util
32
31
  extend Vagrant::Util::GuestInspection::Linux
33
- NETWORKD_DIRECTORY = "/etc/systemd/network".freeze
32
+ NETWORKD_DIRECTORY = '/etc/systemd/network'.freeze
34
33
  @@logger = Log4r::Logger.new('vagrant::guest::clearlinux::configure_networks')
35
34
 
36
35
  def self.configure_networks(machine, networks)
@@ -43,16 +42,16 @@ module VagrantPlugins
43
42
  @@logger.warn("Could not find match rule for network #{network.inspect}")
44
43
  next
45
44
  end
46
- unit_name = format('50-vagrant-%s.network', device)
45
+ unit_name = format('50-vagrant-%<device>s.network', device: device)
47
46
 
48
47
  if network[:type] == :static
49
- leased = "no"
48
+ leased = 'no'
50
49
  cidr = IPAddr.new(network[:netmask]).to_cidr
51
50
  body = "Address=#{network[:ip]}/#{cidr}"
52
51
  body += "\nGateway=#{network[:gateway]}" if network[:gateway]
53
52
  elsif network[:type] == :dhcp
54
- leased = "yes"
55
- body = ""
53
+ leased = 'yes'
54
+ body = ''
56
55
  end
57
56
 
58
57
  unit_file = format(VAGRANT_NETWORK, device, leased, body)
@@ -62,12 +61,14 @@ module VagrantPlugins
62
61
  temp.close
63
62
 
64
63
  comm.upload(temp.path, "/tmp/#{unit_name}")
65
- comm.sudo([ "mkdir -p #{NETWORKD_DIRECTORY}",
64
+ comm.sudo([
65
+ "mkdir -p #{NETWORKD_DIRECTORY}",
66
66
  "rm -f #{NETWORKD_DIRECTORY}/#{unit_name}",
67
67
  "mv /tmp/#{unit_name} #{NETWORKD_DIRECTORY}",
68
68
  "chown root:root #{NETWORKD_DIRECTORY}/#{unit_name}",
69
69
  "chmod a+r #{NETWORKD_DIRECTORY}/#{unit_name}",
70
- "systemctl restart systemd-networkd"].join("\n"))
70
+ 'systemctl restart systemd-networkd'
71
+ ].join(' && '))
71
72
  comm.wait_for_ready(30)
72
73
  end
73
74
  end
@@ -3,16 +3,19 @@ module VagrantPlugins
3
3
  module Cap
4
4
  class NFS
5
5
  def self.nfs_client_installed(machine)
6
- machine.communicate.test("test -x /usr/bin/mount.nfs")
6
+ machine.communicate.test('test -x /usr/bin/mount.nfs')
7
7
  end
8
8
 
9
9
  def self.nfs_client_install(machine)
10
10
  comm = machine.communicate
11
11
  comm.sudo([
12
- "swupd bundle-add storage-utils",
13
- "systemctl enable rpcbind",
14
- "systemctl start rpcbind"
15
- ].join("\n"))
12
+ 'swupd bundle-add nfs-utils',
13
+ 'systemctl enable rpcbind --now'
14
+ ].join(' && '))
15
+ end
16
+
17
+ def self.nfs_pre(machine)
18
+ machine.communicate.sudo('systemctl start rpcbind')
16
19
  end
17
20
  end
18
21
  end
@@ -3,12 +3,12 @@ module VagrantPlugins
3
3
  module Cap
4
4
  class RSync
5
5
  def self.rsync_installed(machine)
6
- machine.communicate.test("test -f /usr/bin/rsync")
6
+ machine.communicate.test('test -f /usr/bin/rsync')
7
7
  end
8
8
 
9
9
  def self.rsync_install(machine)
10
10
  # until it is available as a pundle...
11
- machine.communicate.sudo("swupd bundle-add network-basic")
11
+ machine.communicate.sudo('swupd bundle-add network-basic')
12
12
  end
13
13
  end
14
14
  end
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'vagrant'
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'vagrant'
@@ -61,13 +60,18 @@ module VagrantPlugins
61
60
  Cap::NFS
62
61
  end
63
62
 
63
+ guest_capability('clearlinux', 'nfs_pre') do
64
+ require_relative 'cap/nfs_client'
65
+ Cap::NFS
66
+ end
67
+
64
68
  guest_capability(:clearlinux, :rsync_install) do
65
- require_relative "cap/rsync"
69
+ require_relative 'cap/rsync'
66
70
  Cap::RSync
67
71
  end
68
72
 
69
73
  guest_capability(:clearlinux, :rsync_installed) do
70
- require_relative "cap/rsync"
74
+ require_relative 'cap/rsync'
71
75
  Cap::RSync
72
76
  end
73
77
  end
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2019 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'vagrant'
@@ -6,9 +5,8 @@ require 'tzinfo'
6
5
 
7
6
  module VagrantPlugins
8
7
  module GuestClearLinux
9
-
10
8
  class BundlesConfig < Vagrant.plugin('2', :config)
11
- attr_accessor :bundles
9
+ attr_reader :bundles
12
10
 
13
11
  def initialize
14
12
  super
@@ -18,12 +16,13 @@ module VagrantPlugins
18
16
  def finalize!
19
17
  @bundles = [] if @bundles == UNSET_VALUE
20
18
  end
19
+
21
20
  def bundles=(bundles)
22
- if bundles.kind_of?(Array)
23
- @bundles = bundles.join(" ")
24
- else
25
- @bundles = bundles
26
- end
21
+ @bundles = if bundles.is_a?(Array)
22
+ bundles.join(' ')
23
+ else
24
+ bundles
25
+ end
27
26
  end
28
27
  end
29
28
 
@@ -40,19 +39,15 @@ module VagrantPlugins
40
39
  @timezone = '' if @timezone == UNSET_VALUE
41
40
  end
42
41
 
43
- def validate(machine)
42
+ def validate(_machine)
44
43
  errors = _detected_errors
45
44
 
46
45
  TZInfo::Timezone.get(timezone)
47
- { "vm.provision.set_timezone:" => errors }
46
+ { 'vm.provision.set_timezone:' => errors }
48
47
  rescue TZInfo::InvalidTimezoneIdentifier
49
- errors << "Invalid (user provided) timezone: '#{timezone}', Aborting!"
48
+ errors << "Invalid (user provided) timezone: '#{timezone}', Aborting!"
50
49
 
51
- { "vm.provision.set_timezone:" => errors }
52
- end
53
-
54
- def timezone=(timezone)
55
- @timezone = timezone
50
+ { 'vm.provision.set_timezone:' => errors }
56
51
  end
57
52
  end
58
53
 
@@ -60,7 +55,7 @@ module VagrantPlugins
60
55
  def provision
61
56
  @machine.ui.detail("setting (user provided) timezone to '#{@config.timezone}'")
62
57
  @machine.communicate.sudo("timedatectl set-timezone #{@config.timezone}") do |type, data|
63
- if [:stderr, :stdout].include?(type)
58
+ if %i[stderr stdout].include?(type)
64
59
  color = type == :stdout ? :green : :red
65
60
 
66
61
  options = {}
@@ -76,7 +71,7 @@ module VagrantPlugins
76
71
  def provision
77
72
  @machine.ui.detail("installing the following bundle(s): '#{@config.bundles}'")
78
73
  @machine.communicate.sudo("swupd bundle-add #{@config.bundles}") do |type, data|
79
- if [:stderr, :stdout].include?(type)
74
+ if %i[stderr stdout].include?(type)
80
75
  color = type == :stdout ? :green : :red
81
76
 
82
77
  options = {}
@@ -89,11 +84,10 @@ module VagrantPlugins
89
84
  end
90
85
 
91
86
  class BundleRemoveProvisioner < Vagrant.plugin('2', :provisioner)
92
-
93
87
  def provision
94
88
  @machine.ui.detail("removing the following bundle(s): '#{@config.bundles}'")
95
89
  @machine.communicate.sudo("swupd bundle-remove #{@config.bundles}") do |type, data|
96
- if [:stderr, :stdout].include?(type)
90
+ if %i[stderr stdout].include?(type)
97
91
  color = type == :stdout ? :green : :red
98
92
 
99
93
  options = {}
@@ -104,6 +98,5 @@ module VagrantPlugins
104
98
  end
105
99
  end
106
100
  end
107
-
108
101
  end
109
102
  end
@@ -1,9 +1,8 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  module VagrantPlugins
5
4
  # Set version for vagrant-guests-clearlinux gem.
6
5
  module GuestClearLinux
7
- VERSION = '1.1.3'
6
+ VERSION = '1.2.2'.freeze
8
7
  end
9
8
  end
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'vagrant-guests-ClearLinux/cap/configure_networks'
@@ -21,9 +20,9 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
21
20
  # config.vm.network :private_network, type: "dhcp"
22
21
  {
23
22
  :type => :dhcp,
24
- :adapter_ip => "172.28.128.1",
25
- :ip => "172.28.128.1",
26
- :netmask => "255.255.255.0",
23
+ :adapter_ip => '172.28.128.1',
24
+ :ip => '172.28.128.1',
25
+ :netmask => '255.255.255.0',
27
26
  :auto_config => true,
28
27
  :interface => 2
29
28
  },
@@ -36,10 +35,10 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
36
35
  },
37
36
  # config.vm.network :public_network, bridge: "en0: Wi-Fi (AirPort)", ip: "192.168.1.201"
38
37
  {
39
- :type=>:static,
40
- :bridge => "en0: Wi-Fi (AirPort)",
41
- :ip => "192.168.1.201",
42
- :netmask => "255.255.255.0",
38
+ :type => :static,
39
+ :bridge => 'en0: Wi-Fi (AirPort)',
40
+ :ip => '192.168.1.201',
41
+ :netmask => '255.255.255.0',
43
42
  :use_dhcp_assigned_default_route => false,
44
43
  :auto_config => true,
45
44
  :interface => 4
@@ -50,7 +49,7 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
50
49
 
51
50
  before do
52
51
  communicate.stub(:sudo).with("ifconfig -a | grep -E '^enp|^eth' | cut -f1 -d' '")
53
- .and_yield(nil, interfaces)
52
+ .and_yield(nil, interfaces)
54
53
  end
55
54
 
56
55
  it 'should configure networks' do
@@ -58,65 +57,65 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
58
57
 
59
58
  # enp0s8
60
59
  communicate.should_receive(:sudo).with("grep enp0s8 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
61
- communicate.should_receive(:sudo).with("rm -f /etc/systemd/network/50-vagrant-enp0s8.network")
60
+ communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp0s8.network')
62
61
  communicate.should_receive(:upload) do |src, dst|
63
- contents = (File.readlines src).join("")
62
+ contents = (File.readlines src).join('')
64
63
  contents.should eq "[Match]\nName=enp0s8\n\n[Network]\nAddress=192.168.10.10/24\n"
65
- dst.should eq "/tmp/50-vagrant-enp0s8.network"
64
+ dst.should eq '/tmp/50-vagrant-enp0s8.network'
66
65
  end
67
66
  communicate.should_receive(:sudo)
68
- .with("mv /tmp/50-vagrant-enp0s8.network /etc/systemd/network/")
67
+ .with('mv /tmp/50-vagrant-enp0s8.network /etc/systemd/network/')
69
68
  communicate.should_receive(:sudo)
70
- .with("chown root:root /etc/systemd/network/50-vagrant-enp0s8.network")
69
+ .with('chown root:root /etc/systemd/network/50-vagrant-enp0s8.network')
71
70
  communicate.should_receive(:sudo)
72
- .with("chmod a+r /etc/systemd/network/50-vagrant-enp0s8.network")
71
+ .with('chmod a+r /etc/systemd/network/50-vagrant-enp0s8.network')
73
72
 
74
73
  # eth2
75
74
  communicate.should_receive(:sudo).with("grep eth2 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
76
- communicate.should_receive(:sudo).with("rm -f /etc/systemd/network/50-vagrant-eth2.network")
75
+ communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-eth2.network')
77
76
  communicate.should_receive(:upload) do |src, dst|
78
- contents = (File.readlines src).join("")
77
+ contents = (File.readlines src).join('')
79
78
  contents.should eq "[Match]\nName=eth2\n\n[Network]\nDHCP=yes\n"
80
- dst.should eq "/tmp/50-vagrant-eth2.network"
79
+ dst.should eq '/tmp/50-vagrant-eth2.network'
81
80
  end
82
81
  communicate.should_receive(:sudo)
83
- .with("mv /tmp/50-vagrant-eth2.network /etc/systemd/network/")
82
+ .with('mv /tmp/50-vagrant-eth2.network /etc/systemd/network/')
84
83
  communicate.should_receive(:sudo)
85
- .with("chown root:root /etc/systemd/network/50-vagrant-eth2.network")
84
+ .with('chown root:root /etc/systemd/network/50-vagrant-eth2.network')
86
85
  communicate.should_receive(:sudo)
87
- .with("chmod a+r /etc/systemd/network/50-vagrant-eth2.network")
86
+ .with('chmod a+r /etc/systemd/network/50-vagrant-eth2.network')
88
87
 
89
88
  # enp1s5
90
89
  communicate.should_receive(:sudo).with("grep enp1s5 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
91
- communicate.should_receive(:sudo).with("rm -f /etc/systemd/network/50-vagrant-enp1s5.network")
90
+ communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp1s5.network')
92
91
  communicate.should_receive(:upload) do |src, dst|
93
- contents = (File.readlines src).join("")
92
+ contents = (File.readlines src).join('')
94
93
  contents.should eq "[Match]\nName=enp1s5\n\n[Network]\nDHCP=yes\n"
95
- dst.should eq "/tmp/50-vagrant-enp1s5.network"
94
+ dst.should eq '/tmp/50-vagrant-enp1s5.network'
96
95
  end
97
96
  communicate.should_receive(:sudo)
98
- .with("mv /tmp/50-vagrant-enp1s5.network /etc/systemd/network/")
97
+ .with('mv /tmp/50-vagrant-enp1s5.network /etc/systemd/network/')
99
98
  communicate.should_receive(:sudo)
100
- .with("chown root:root /etc/systemd/network/50-vagrant-enp1s5.network")
99
+ .with('chown root:root /etc/systemd/network/50-vagrant-enp1s5.network')
101
100
  communicate.should_receive(:sudo)
102
- .with("chmod a+r /etc/systemd/network/50-vagrant-enp1s5.network")
101
+ .with('chmod a+r /etc/systemd/network/50-vagrant-enp1s5.network')
103
102
 
104
103
  # enp1s6
105
104
  communicate.should_receive(:sudo).with("grep enp1s6 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
106
- communicate.should_receive(:sudo).with("rm -f /etc/systemd/network/50-vagrant-enp1s6.network")
105
+ communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp1s6.network')
107
106
  communicate.should_receive(:upload) do |src, dst|
108
- contents = (File.readlines src).join("")
107
+ contents = (File.readlines src).join('')
109
108
  contents.should eq "[Match]\nName=enp1s6\n\n[Network]\nAddress=192.168.1.201/24\n"
110
- dst.should eq "/tmp/50-vagrant-enp1s6.network"
109
+ dst.should eq '/tmp/50-vagrant-enp1s6.network'
111
110
  end
112
111
  communicate.should_receive(:sudo)
113
- .with("mv /tmp/50-vagrant-enp1s6.network /etc/systemd/network/")
112
+ .with('mv /tmp/50-vagrant-enp1s6.network /etc/systemd/network/')
114
113
  communicate.should_receive(:sudo)
115
- .with("chown root:root /etc/systemd/network/50-vagrant-enp1s6.network")
114
+ .with('chown root:root /etc/systemd/network/50-vagrant-enp1s6.network')
116
115
  communicate.should_receive(:sudo)
117
- .with("chmod a+r /etc/systemd/network/50-vagrant-enp1s6.network")
116
+ .with('chmod a+r /etc/systemd/network/50-vagrant-enp1s6.network')
118
117
 
119
- communicate.should_receive(:sudo).with("systemctl restart systemd-networkd.service")
118
+ communicate.should_receive(:sudo).with('systemctl restart systemd-networkd.service')
120
119
 
121
120
  described_class.configure_networks(machine, networks)
122
121
  end
@@ -136,9 +135,9 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
136
135
  # config.vm.network :private_network, type: "dhcp"
137
136
  {
138
137
  :type => :dhcp,
139
- :adapter_ip => "172.28.128.1",
140
- :ip => "172.28.128.1",
141
- :netmask => "255.255.255.0",
138
+ :adapter_ip => '172.28.128.1',
139
+ :ip => '172.28.128.1',
140
+ :netmask => '255.255.255.0',
142
141
  :auto_config => true,
143
142
  :interface => 2
144
143
  }
@@ -148,36 +147,36 @@ describe VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks do
148
147
 
149
148
  before do
150
149
  communicate.stub(:sudo).with("ifconfig -a | grep -E '^enp|^eth' | cut -f1 -d' '")
151
- .and_yield(nil, interfaces)
152
- @@logger = Log4r::Logger.new("vagrant::guest::clearlinux::configure_networks")
150
+ .and_yield(nil, interfaces)
151
+ @@logger = Log4r::Logger.new('vagrant::guest::clearlinux::configure_networks')
153
152
  end
154
153
 
155
154
  it 'should configure networks without enp0s9' do
156
155
  communicate.should_receive(:sudo).with("ifconfig -a | grep -E '^enp|^eth' | cut -f1 -d' '")
157
156
  communicate.should_receive(:sudo).with("grep enp0s8 /etc/systemd/network/* | awk -F: '{print $1}' | head -n1")
158
- communicate.should_receive(:sudo).with("rm -f /etc/systemd/network/50-vagrant-enp0s8.network")
157
+ communicate.should_receive(:sudo).with('rm -f /etc/systemd/network/50-vagrant-enp0s8.network')
159
158
 
160
159
  # enp0s8
161
160
  communicate.should_receive(:upload) do |src, dst|
162
- contents = (File.readlines src).join("")
161
+ contents = (File.readlines src).join('')
163
162
  contents.should eq "[Match]\nName=enp0s8\n\n[Network]\nAddress=192.168.10.10/24\n"
164
- dst.should eq "/tmp/50-vagrant-enp0s8.network"
163
+ dst.should eq '/tmp/50-vagrant-enp0s8.network'
165
164
  end
166
165
  communicate.should_receive(:sudo)
167
- .with("mv /tmp/50-vagrant-enp0s8.network /etc/systemd/network/")
166
+ .with('mv /tmp/50-vagrant-enp0s8.network /etc/systemd/network/')
168
167
  communicate.should_receive(:sudo)
169
- .with("chown root:root /etc/systemd/network/50-vagrant-enp0s8.network")
168
+ .with('chown root:root /etc/systemd/network/50-vagrant-enp0s8.network')
170
169
  communicate.should_receive(:sudo)
171
- .with("chmod a+r /etc/systemd/network/50-vagrant-enp0s8.network")
170
+ .with('chmod a+r /etc/systemd/network/50-vagrant-enp0s8.network')
172
171
 
173
172
  # eth2
174
173
  @@logger.should_receive(:warn).with(
175
- "Could not find match rule for network " +
176
- "{:type=>:dhcp, :adapter_ip=>\"172.28.128.1\", :ip=>\"172.28.128.1\", " +
177
- ":netmask=>\"255.255.255.0\", :auto_config=>true, :interface=>2}"
174
+ 'Could not find match rule for network ' \
175
+ '{:type=>:dhcp, :adapter_ip=>"172.28.128.1", :ip=>"172.28.128.1", ' \
176
+ ':netmask=>"255.255.255.0", :auto_config=>true, :interface=>2}'
178
177
  )
179
178
 
180
- communicate.should_receive(:sudo).with("systemctl restart systemd-networkd.service")
179
+ communicate.should_receive(:sudo).with('systemctl restart systemd-networkd.service')
181
180
 
182
181
  described_class.configure_networks(machine, networks)
183
182
  end
@@ -1,5 +1,4 @@
1
- # encoding: UTF-8
2
- # CCopyright (c) 2018 António Meireles. All Rights Reserved.
1
+ # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'spec_helper'
5
4
  require 'vagrant-guests-clearlinux/guest'
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'spec_helper'
@@ -12,8 +11,8 @@ describe VagrantPlugins::GuestClearLinux::Plugin do
12
11
  end
13
12
 
14
13
  {
15
- :change_host_name => VagrantPlugins::GuestClearLinux::Cap::ChangeHostName,
16
- :configure_networks => VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks
14
+ :change_host_name => VagrantPlugins::GuestClearLinux::Cap::ChangeHostName,
15
+ :configure_networks => VagrantPlugins::GuestClearLinux::Cap::ConfigureNetworks
17
16
  }.each do |cap, cls|
18
17
  it "should be capable of #{cap} with ClearLinux" do
19
18
  expect(described_class.components.guest_capabilities[:clearlinux][cap]).to eq(cls)
@@ -1,18 +1,17 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018 António Meireles. All Rights Reserved.
3
2
 
4
3
  require 'coveralls'
5
4
  Coveralls.wear!
6
5
 
7
6
  shared_context 'machine' do
8
- let(:communicate) {
7
+ let(:communicate) do
9
8
  double('communicate')
10
- }
11
- let(:machine) {
9
+ end
10
+ let(:machine) do
12
11
  v = double('machine')
13
12
  v.tap { |m| m.stub(:communicate).and_return(communicate) }
14
- }
15
- let(:guest) {
13
+ end
14
+ let(:guest) do
16
15
  described_class.new
17
- }
16
+ end
18
17
  end
@@ -1,6 +1,5 @@
1
- # encoding: UTF-8
2
1
  # Copyright (c) 2018-2019 António Meireles. All Rights Reserved.
3
- $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path('lib', __dir__)
4
3
  require 'vagrant-guests-clearlinux/version'
5
4
 
6
5
  Gem::Specification.new do |s|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-guests-clearlinux
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - António Meireles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2019-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.0.2
176
+ rubygems_version: 3.0.3
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Clear Linux Guest Plugin for Vagrant