testlab 1.22.2 → 1.22.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Mzk5ZWY5MjMxZTcyOWMwZTViNTA2ODQ0ZmFhYzc3YzBiYjk2MDQ3ZA==
4
+ YTMyYmRlNjI2NmQ1ZmMwZmE4MGJmN2VkYzI5NzA0NGQwNzY4OWY4NA==
5
5
  data.tar.gz: !binary |-
6
- ZWI2MmFiNzI2YzVmMDNkOTE5ZGI4ZDY3YmI4NDhhZmYzODFjZDBjMw==
6
+ Mjk5ZGJlMTQ2ZWRlOWRhM2I0MzgwNGIyNThiYmE4MDMyMDdiNzkyNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGI5NGM3NzFiZDNmNTFjNjg2MzZiYmFjODRhMjc3MDYzM2JmNDQ5Y2M2NGMx
10
- MzkyNTg0MGMyNjI1MTg2MDdlMmIzNDFmYjIzYWU1MmM0NjRhMmNjNjJkMDYy
11
- MWExODQ1ZTFhNzg4YWEwMWY4OTNmNTM4YzZmYjM2M2E2MTJkYTY=
9
+ ZGU3MGUzZjZlMjU4YmY1MTEwZjViMWJlNDI2MzAzMWM2OWU4MjM4N2UyYzIw
10
+ YmMyYjAzN2I5YzhhNWZhNTE4YjA0NWY1ZDlmMDQ2YjYyZmQwNmIyYTU2MGNk
11
+ ZmI3OGY1YjdiYTk4YTM1MDhmNGNkZGE5OWMwMjlmZmRlODAwNjQ=
12
12
  data.tar.gz: !binary |-
13
- NmJjMDYwNjRmMTM5N2FlZDZjNGM2NDg3N2U2OTU4MmI4MTY2Y2MzZjg3YjM3
14
- MDM3YWViN2UwMGE2YzMzZjczZjgxMTkzOWZjNjkzMDI2YzZlNzcwYmJiMjMx
15
- NWQ0MGQxMzI5ZWM1NzkxZTJhOWNmNzI5OTQzMWNhYmJiMmYwNzg=
13
+ OTA0Y2I4YTkyNjNhMzdmMzk0NGU5NmFlYTQyYTBjZGJkZTJiMzM4NjNlZWI0
14
+ Yzg1YzdjN2UwMDBhYjdkN2IxMzlhMTM1MmEwODg4YzE1YTg0NDRiMTc1ZTFm
15
+ NWFjN2E0YzI5MWE1ZDhhNGUzMmZiZTgwNDllNDU0MjIwMWNiN2E=
@@ -6,7 +6,6 @@ env:
6
6
  - secure: H4MqaotOXE5aboHmv+udPK8sPKpzpgBaKBj3ZOqfqgmkea4sbyIMptAXvMrdWlaJGhfjxhmjwN7UfpYYxv4zN2a+16uQR1waRSt5ugxGY05riRp1vF8silogj8iSaM6TiDmytdyAbPOg+gFsDJNT50Sa29tDkiOA5L2VFAgkwjU=
7
7
  - secure: QR7/0AU/pC64kfH9tsd5nANsX/S2QMKT2LVGcFfZhdRyisT597s4LzVj6snBrfh+Qd0mqkZZmkVHRNmi5BdO3qVeA/0R8LOm3WD5gFaBNEbCV7B3j2iX6a386nKYd+9LbLO57cfnVePFRsWmPF3pefhNDnQbWLKjUxT2rj3j/RQ=
8
8
  rvm:
9
- - ree
10
9
  - 1.9.2
11
10
  - 1.9.3
12
11
  - 2.0.0
@@ -21,7 +21,7 @@ class TestLab
21
21
 
22
22
  # HostsFile: Container Provision
23
23
  def on_container_callback(container)
24
- remove_hosts
24
+ remove_hosts(container)
25
25
  add_hosts(container)
26
26
 
27
27
  true
@@ -39,9 +39,7 @@ class TestLab
39
39
  def add_hosts(container)
40
40
  script = <<-EOF
41
41
  cat <<EOI | #{sudo} tee -a /etc/hosts
42
- #{def_tag}
43
42
  #{hosts_blob(container)}
44
- #{end_tag}
45
43
  EOI
46
44
  EOF
47
45
 
@@ -52,23 +50,27 @@ EOI
52
50
  command = %(/bin/bash -x #{tempfile.path})
53
51
 
54
52
  @command.exec(command)
53
+ container.bootstrap(script)
55
54
  end
56
55
 
57
- def remove_hosts
56
+ def remove_hosts(container)
58
57
  @command.exec(sed_hostsfile)
58
+ container.exec(sed_hostsfile('linux'))
59
59
  end
60
60
 
61
61
  def hosts_blob(container)
62
62
  blob = Array.new
63
+ blob << def_tag
63
64
  container.node.containers.each do |con|
64
65
  blob << "#{con.primary_interface.ip}\t#{con.id} #{con.fqdn}"
65
66
  end
67
+ blob << end_tag
66
68
 
67
69
  blob.join("\n")
68
70
  end
69
71
 
70
- def sed_hostsfile
71
- case RUBY_PLATFORM
72
+ def sed_hostsfile(platform=RUBY_PLATFORM)
73
+ case platform
72
74
  when /darwin/ then
73
75
  %(#{sudo} sed -i '' '/#{def_tag}/,/#{end_tag}/d' /etc/hosts)
74
76
  when /linux/ then
@@ -1,6 +1,6 @@
1
1
  class TestLab
2
2
  unless const_defined?(:VERSION)
3
3
  # TestLab Gem Version
4
- VERSION = "1.22.2"
4
+ VERSION = "1.22.3"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.22.2
4
+ version: 1.22.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Patten
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-18 00:00:00.000000000 Z
11
+ date: 2014-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -390,7 +390,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
390
390
  version: '0'
391
391
  requirements: []
392
392
  rubyforge_project:
393
- rubygems_version: 2.2.2
393
+ rubygems_version: 2.2.1
394
394
  signing_key:
395
395
  specification_version: 4
396
396
  summary: A toolkit for building virtual computer labs