lib/testlab/container/lxc.rb in testlab-0.4.10 vs lib/testlab/container/lxc.rb in testlab-0.4.11
- old
+ new
@@ -58,30 +58,39 @@
#
# @return [Boolean] Returns true if successful.
def to_static
if self.lxc_clone.exists?
self.lxc.stop
+ self.lxc.destroy(%(-f))
+
self.lxc_clone.stop
- self.lxc_clone.clone(%(-o #{self.lxc_clone.name}), %(-n #{self.lxc.name}))
- build_lxc_config(self.lxc.config)
+ self.lxc_clone.clone(%W(-o #{self.lxc_clone.name} -n #{self.lxc.name}))
self.lxc_clone.destroy(%(-f))
+
+ build_lxc_config(self.lxc.config)
end
true
end
# Convert to Ephemeral Container
#
- # If the current container is operating as a static ocntainer, this will
+ # If the current container is operating as a static container, this will
# convert it to a ephemeral container, otherwise no changes will occur.
#
# @return [Boolean] Returns true if successful.
def to_ephemeral
if (self.lxc.exists? && !self.lxc_clone.exists?)
+ self.lxc_clone.stop
+ self.lxc_clone.destroy(%(-f))
+
self.lxc.stop
- self.lxc.clone(%(-o #{self.lxc.name}), %(-n #{self.lxc_clone.name}))
- build_lxc_config(self.lxc_clone.config)
+ self.lxc.clone(%W(-o #{self.lxc.name} -n #{self.lxc_clone.name}))
self.lxc.destroy(%(-f))
+
+ build_lxc_config(self.lxc_clone.config)
+ else
+ self.lxc.stop
end
true
end