cucumber-chef 2.1.0.rc.10 → 2.1.0.rc.11
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/cc-server +1 -1
- data/lib/cucumber/chef/client.rb +0 -2
- data/lib/cucumber/chef/helpers/utility.rb +15 -16
- data/lib/cucumber/chef/utility.rb +6 -9
- data/lib/cucumber/chef/version.rb +1 -1
- metadata +2 -2
data/bin/cc-server
CHANGED
@@ -35,7 +35,7 @@ class FrontObject
|
|
35
35
|
def initialize
|
36
36
|
logger.info { "DRB=#{DRb.config.inspect}" }
|
37
37
|
|
38
|
-
if ENV['PURGE']
|
38
|
+
if ENV['PURGE'] == 'YES'
|
39
39
|
Cucumber::Chef.logger.warn { "PURGING CONTAINERS! Container attributes will be reset!" }
|
40
40
|
load_containers
|
41
41
|
containers.each do |name, value|
|
data/lib/cucumber/chef/client.rb
CHANGED
@@ -34,29 +34,28 @@ module Cucumber::Chef::Helpers::Utility
|
|
34
34
|
168..168,
|
35
35
|
0..254,
|
36
36
|
1..254 ]
|
37
|
-
ip =
|
37
|
+
ip = Array.new
|
38
38
|
for x in 1..4 do
|
39
|
-
ip
|
40
|
-
ip += "." if x != 4
|
39
|
+
ip << octets[x-1].to_a[rand(octets[x-1].count)].to_s
|
41
40
|
end
|
42
|
-
ip
|
41
|
+
ip.join(".")
|
43
42
|
end
|
44
43
|
|
45
44
|
################################################################################
|
46
45
|
|
47
46
|
def generate_mac
|
48
|
-
digits = [ %w(
|
49
|
-
%w(
|
50
|
-
%w(
|
51
|
-
%w(
|
52
|
-
%w(
|
53
|
-
%w(
|
54
|
-
%w(
|
55
|
-
%w(
|
56
|
-
%w(
|
57
|
-
%w(
|
58
|
-
%w(
|
59
|
-
%w(
|
47
|
+
digits = [ %w(0),
|
48
|
+
%w(0),
|
49
|
+
%w(0),
|
50
|
+
%w(0),
|
51
|
+
%w(5),
|
52
|
+
%w(e),
|
53
|
+
%w(0 1 2 3 4 5 6 7 8 9 a b c d e f),
|
54
|
+
%w(0 1 2 3 4 5 6 7 8 9 a b c d e f),
|
55
|
+
%w(5 6 7 8 9 a b c d e f),
|
56
|
+
%w(3 4 5 6 7 8 9 a b c d e f),
|
57
|
+
%w(0 1 2 3 4 5 6 7 8 9 a b c d e f),
|
58
|
+
%w(0 1 2 3 4 5 6 7 8 9 a b c d e f) ]
|
60
59
|
mac = ""
|
61
60
|
for x in 1..12 do
|
62
61
|
mac += digits[x-1][rand(digits[x-1].count)]
|
@@ -105,7 +105,7 @@ module Cucumber
|
|
105
105
|
################################################################################
|
106
106
|
|
107
107
|
def home_dir
|
108
|
-
home_dir = File.join(Cucumber::Chef.locate_parent(".chef"), ".cucumber-chef")
|
108
|
+
home_dir = (ENV['CUCUMBER_CHEF_HOME'] || File.join(Cucumber::Chef.locate_parent(".chef"), ".cucumber-chef"))
|
109
109
|
FileUtils.mkdir_p(File.dirname(home_dir))
|
110
110
|
home_dir
|
111
111
|
end
|
@@ -244,20 +244,17 @@ module Cucumber
|
|
244
244
|
################################################################################
|
245
245
|
|
246
246
|
def load_chef_config
|
247
|
-
if (
|
248
|
-
|
249
|
-
|
250
|
-
::Chef::Config.from_file(Cucumber::Chef.knife_rb)
|
247
|
+
if File.exists?(Cucumber::Chef.knife_rb)
|
248
|
+
logger.info { "load_chef_config(#{Cucumber::Chef.knife_rb})" }
|
249
|
+
::Chef::Config.from_file(Cucumber::Chef.knife_rb)
|
251
250
|
|
251
|
+
if (test_lab = (Cucumber::Chef::TestLab.new rescue nil)) && test_lab.alive?
|
252
252
|
chef_server_url = "http://#{test_lab.ip}:4000"
|
253
253
|
logger.info { "chef_server_url(#{chef_server_url})" }
|
254
254
|
::Chef::Config[:chef_server_url] = chef_server_url
|
255
|
-
else
|
256
|
-
logger.warn { "We found the test lab; but the knife config '#{Cucumber::Chef.knife_rb}' was missing!" }
|
257
255
|
end
|
258
256
|
else
|
259
|
-
logger.
|
260
|
-
::Chef::Config.from_file(Cucumber::Chef.knife_rb)
|
257
|
+
logger.warn { "knife config '#{Cucumber::Chef.knife_rb}' was missing!" }
|
261
258
|
end
|
262
259
|
end
|
263
260
|
|
@@ -24,7 +24,7 @@ module Cucumber
|
|
24
24
|
|
25
25
|
################################################################################
|
26
26
|
|
27
|
-
VERSION = "2.1.0.rc.
|
27
|
+
VERSION = "2.1.0.rc.11" unless const_defined?(:VERSION)
|
28
28
|
|
29
29
|
################################################################################
|
30
30
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.rc.
|
4
|
+
version: 2.1.0.rc.11
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-02-
|
13
|
+
date: 2013-02-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: chef
|