lib/testlab/container/status.rb in testlab-1.2.0 vs lib/testlab/container/status.rb in testlab-1.2.1

- old
+ new

@@ -51,11 +51,11 @@ "#{interface.network_id}:#{interface.name}:#{interface.ip}/#{interface.cidr}" end.join(', ') { :id => self.id, - :clone => self.lxc_clone.exists?, + :mode => self.mode, :fqdn => self.fqdn, :state => self.state, :distro => self.distro, :release => self.release, :interfaces => interfaces, @@ -69,9 +69,21 @@ # What state the container is in. # # @return [Symbol] A symbol indicating the state of the container. def state self.lxc.state + end + + # Container Mode + # + # What mode the container is in. + # @return [Symbol] A symbol indicating the mode of the container. + def mode + if self.lxc_clone.exists? + :ephemeral + else + :persistent + end end end end