landrush 1.1.0.beta.2 → 1.1.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/landrush/action/setup.rb +1 -1
- data/lib/landrush/cap/host/darwin/configure_visibility_on_host.rb +3 -2
- data/lib/landrush/cap/host/linux/configure_visibility_on_host.rb +7 -6
- data/lib/landrush/cap/host/windows/configure_visibility_on_host.rb +3 -3
- data/lib/landrush/util/retry.rb +2 -2
- data/lib/landrush/version.rb +1 -1
- data/test/landrush/cap/host/darwin/configure_visibility_on_host_test.rb +2 -3
- data/test/landrush/cap/host/linux/configure_visibility_on_host_test.rb +1 -1
- data/test/landrush/util/rety_test.rb +3 -11
- data/test/test_helper.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d77ecf53a2c01d7b970262ad962f581b5f3b44c4
|
4
|
+
data.tar.gz: ea67610f89e99e4a7b39610a2f154eb932ce25e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66834fc6e32258479ac9121bd7cee33ed7f177b6ffd2300866523f0263391991c048db3e136eb087a96f922915ffb6688793d0b87f148a8a58458a6c752977a7
|
7
|
+
data.tar.gz: 091535496355c49f29dc937c3e3617cf5b955ac7046217df7c4a1aabb36e560f704e55894e77b0bf2c26d99aa25c4dd6aa13b6996a1a7f23346a499ee15631a1
|
@@ -100,7 +100,7 @@ module Landrush
|
|
100
100
|
# machine.config.vm.networks is an array of two elements. The first containing the type as symbol, the second is a
|
101
101
|
# hash containing other config data which varies between types
|
102
102
|
def static_private_network_ip
|
103
|
-
# select all
|
103
|
+
# select all statically defined private network ip
|
104
104
|
private_networks = machine.config.vm.networks.select {|network| :private_network == network[0] && !network[1][:ip].nil?}
|
105
105
|
.map {|network| network[1][:ip]}
|
106
106
|
if machine.config.landrush.host_ip_address.nil?
|
@@ -5,8 +5,9 @@ module Landrush
|
|
5
5
|
class << self
|
6
6
|
attr_writer :sudo, :config_dir
|
7
7
|
|
8
|
-
def configure_visibility_on_host(env,
|
8
|
+
def configure_visibility_on_host(env, _ip, tld)
|
9
9
|
@env = env
|
10
|
+
@tld = tld
|
10
11
|
if contents_match?
|
11
12
|
info 'Host DNS resolver config looks good.'
|
12
13
|
else
|
@@ -38,7 +39,7 @@ module Landrush
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def config_file
|
41
|
-
config_dir.join(@
|
42
|
+
config_dir.join(@tld)
|
42
43
|
end
|
43
44
|
|
44
45
|
def contents_match?
|
@@ -4,12 +4,13 @@ module Landrush
|
|
4
4
|
class ConfigureVisibilityOnHost
|
5
5
|
class << self
|
6
6
|
def configure_visibility_on_host(env, ip, tld)
|
7
|
-
env
|
8
|
-
env
|
9
|
-
env
|
10
|
-
rescue Vagrant::Errors::CapabilityNotFound
|
11
|
-
env
|
12
|
-
|
7
|
+
env.host.capability(:install_dnsmasq) unless env.host.capability(:dnsmasq_installed)
|
8
|
+
env.host.capability(:create_dnsmasq_config, ip, tld)
|
9
|
+
env.host.capability(:restart_dnsmasq)
|
10
|
+
rescue Vagrant::Errors::CapabilityNotFound => e
|
11
|
+
env.ui.info("Your host was detected as '#{e.extra_data[:cap]}' for which the host capability " \
|
12
|
+
"'#{e.extra_data[:cap]}' is not available.")
|
13
|
+
env.ui.info('Check the documentation for the manual instructions to configure the visibility on the host.')
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -31,14 +31,14 @@ module Landrush
|
|
31
31
|
|
32
32
|
unless wired_autoconfig_service_running?
|
33
33
|
info('starting \'Wired AutoConfig\' service')
|
34
|
-
if
|
34
|
+
if admin_mode?
|
35
35
|
`net start dot3svc`
|
36
36
|
else
|
37
37
|
require 'win32ole'
|
38
38
|
shell = WIN32OLE.new('Shell.Application')
|
39
39
|
shell.ShellExecute('net', 'start dot3svc', nil, 'runas', 1)
|
40
40
|
end
|
41
|
-
service_has_started =
|
41
|
+
service_has_started = Landrush::Util::Retry.retry(tries: 5, sleep: 1) do
|
42
42
|
wired_autoconfig_service_running?
|
43
43
|
end
|
44
44
|
unless service_has_started
|
@@ -144,7 +144,7 @@ module Landrush
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def info(msg)
|
147
|
-
@env
|
147
|
+
@env.ui.info("[landrush] #{msg}") unless @env.nil?
|
148
148
|
end
|
149
149
|
|
150
150
|
def wired_autoconfig_service_running?
|
data/lib/landrush/util/retry.rb
CHANGED
data/lib/landrush/version.rb
CHANGED
@@ -23,7 +23,7 @@ module Landrush
|
|
23
23
|
# also disable 'sudo'
|
24
24
|
ConfigureVisibilityOnHost.stubs(:sudo).returns('')
|
25
25
|
|
26
|
-
ConfigureVisibilityOnHost.configure_visibility_on_host(env)
|
26
|
+
ConfigureVisibilityOnHost.configure_visibility_on_host(env, '42.42.42.42', 'vagrant.test')
|
27
27
|
|
28
28
|
Dir["#{dir}/*"].empty?.must_equal false
|
29
29
|
File.exist?(File.join(dir, 'vagrant.test')).must_equal true
|
@@ -41,8 +41,7 @@ module Landrush
|
|
41
41
|
# also disable 'sudo'
|
42
42
|
ConfigureVisibilityOnHost.stubs(:sudo).returns('')
|
43
43
|
|
44
|
-
env.
|
45
|
-
ConfigureVisibilityOnHost.configure_visibility_on_host(env)
|
44
|
+
ConfigureVisibilityOnHost.configure_visibility_on_host(env, '42.42.42.42', 'foo.bar')
|
46
45
|
|
47
46
|
Dir["#{dir}/*"].empty?.must_equal false
|
48
47
|
File.exist?(File.join(dir, 'foo.bar')).must_equal true
|
@@ -22,7 +22,7 @@ module Landrush
|
|
22
22
|
skip('Only supported on Linux') unless Vagrant::Util::Platform.linux?
|
23
23
|
File.exist?(TEST_CONFIG).must_equal false
|
24
24
|
|
25
|
-
Landrush::Cap::Linux::ConfigureVisibilityOnHost.configure_visibility_on_host(
|
25
|
+
Landrush::Cap::Linux::ConfigureVisibilityOnHost.configure_visibility_on_host(Vagrant::Environment.new, TEST_IP, TEST_TLD)
|
26
26
|
|
27
27
|
File.exist?(TEST_CONFIG).must_equal true
|
28
28
|
Pathname(TEST_CONFIG).read.must_equal CONFIG
|
@@ -1,20 +1,12 @@
|
|
1
1
|
require_relative '../../test_helper'
|
2
2
|
|
3
|
-
class DummyClass
|
4
|
-
include Landrush::Util::Retry
|
5
|
-
end
|
6
|
-
|
7
3
|
module Landrush
|
8
4
|
module Util
|
9
5
|
describe Retry do
|
10
|
-
before do
|
11
|
-
@dummy = DummyClass.new
|
12
|
-
end
|
13
|
-
|
14
6
|
describe 'retry' do
|
15
7
|
it 'retries the provided block up to the specified count' do
|
16
8
|
retries = 0
|
17
|
-
result =
|
9
|
+
result = Retry.retry(tries: 2) do
|
18
10
|
retries += 1
|
19
11
|
false
|
20
12
|
end
|
@@ -24,7 +16,7 @@ module Landrush
|
|
24
16
|
|
25
17
|
it 'does not retry if \'true\' is returned' do
|
26
18
|
retries = 0
|
27
|
-
result =
|
19
|
+
result = Retry.retry(tries: 2) do
|
28
20
|
retries += 1
|
29
21
|
true
|
30
22
|
end
|
@@ -35,7 +27,7 @@ module Landrush
|
|
35
27
|
it 'does sleep between executions if requested' do
|
36
28
|
retries = 0
|
37
29
|
t1 = Time.now
|
38
|
-
result =
|
30
|
+
result = Retry.retry(tries: 1, sleep: 1) do
|
39
31
|
retries += 1
|
40
32
|
false
|
41
33
|
end
|
data/test/test_helper.rb
CHANGED
@@ -31,8 +31,7 @@ end
|
|
31
31
|
def fake_environment(options = {enabled: true})
|
32
32
|
# For the home_path we want the base Vagrant directory
|
33
33
|
vagrant_test_home = Pathname(Landrush::Server.working_dir).parent.parent
|
34
|
-
|
35
|
-
{machine: fake_machine(options), host: env.host, ui: FakeUI.new, home_path: vagrant_test_home}
|
34
|
+
{machine: fake_machine(options), ui: FakeUI.new, home_path: vagrant_test_home}
|
36
35
|
end
|
37
36
|
|
38
37
|
class FakeUI
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: landrush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.0.beta.
|
4
|
+
version: 1.1.0.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Hinze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubydns
|