jamie-lxc 0.0.1.alpha1 → 0.0.1.alpha2
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.
- data/jamie-lxc.gemspec +1 -1
- data/lib/jamie/driver/lxc.rb +4 -2
- data/test/lxc_driver_tests.rb +3 -3
- metadata +1 -1
data/jamie-lxc.gemspec
CHANGED
data/lib/jamie/driver/lxc.rb
CHANGED
@@ -24,7 +24,9 @@ module Jamie
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def perform_destroy(instance, state)
|
27
|
-
|
27
|
+
if state["container_id"]
|
28
|
+
destroy_container(state)
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
protected
|
@@ -44,7 +46,7 @@ module Jamie
|
|
44
46
|
|
45
47
|
def container_ip(state)
|
46
48
|
if ::File.exists?(config["dhcp_lease_file"])
|
47
|
-
|
49
|
+
20.times do
|
48
50
|
leases = ::File.readlines(config["dhcp_lease_file"]).map{ |line| line.split(" ") }
|
49
51
|
leases.each do |lease|
|
50
52
|
if lease.include?(state["container_id"])
|
data/test/lxc_driver_tests.rb
CHANGED
@@ -9,10 +9,10 @@ describe Jamie::Driver::Lxc do
|
|
9
9
|
suite = Jamie::Suite.new("name" => "test", "run_list" => Array.new)
|
10
10
|
config = {
|
11
11
|
"jamie_root" => File.dirname(__FILE__),
|
12
|
-
"base_container" => "
|
12
|
+
"base_container" => "ubuntu-1204"
|
13
13
|
}
|
14
|
-
driver = Jamie::Driver::
|
15
|
-
platform = Jamie::Platform.new("name" => "ubuntu-
|
14
|
+
driver = Jamie::Driver::Lxc.new(config)
|
15
|
+
platform = Jamie::Platform.new("name" => "ubuntu-1204", "driver" => driver)
|
16
16
|
@instance = Jamie::Instance.new(suite, platform)
|
17
17
|
end
|
18
18
|
|