lib/testlab/container/actions.rb in testlab-0.9.1 vs lib/testlab/container/actions.rb in testlab-1.0.0

- old
+ new

@@ -17,10 +17,12 @@ please_wait(:ui => @ui, :message => format_object_action(self, 'Create', :green)) do configure self.lxc.create(*create_args) + + do_provisioner_callbacks(self, :create, @ui) end true end @@ -36,10 +38,12 @@ (self.lxc.state == :not_created) and return false please_wait(:ui => @ui, :message => format_object_action(self, 'Destroy', :red)) do self.lxc.destroy(%(-f)) self.lxc_clone.destroy(%(-f)) + + do_provisioner_callbacks(self, :destroy, @ui) end true end @@ -63,14 +67,16 @@ self.lxc.start(%(--daemon)) (self.lxc.state != :running) and raise ContainerError, "The container failed to online!" self.users.each do |user| - user.setup + user.provision end self.ssh.exec(%(sudo hostname #{self.fqdn})) + + do_provisioner_callbacks(self, :up, @ui) end true end @@ -87,9 +93,11 @@ please_wait(:ui => @ui, :message => format_object_action(self, 'Down', :red)) do self.lxc.stop (self.lxc.state == :running) and raise ContainerError, "The container failed to offline!" + + do_provisioner_callbacks(self, :down, @ui) end true end