lib/testlab/network/status.rb in testlab-0.2.1 vs lib/testlab/network/status.rb in testlab-0.3.0

- old
+ new

@@ -3,11 +3,11 @@ module Status # Network status def status - interface = "#{bridge}:#{ip}" + interface = "#{bridge}:#{self.address}" { :id => self.id, :node_id => self.node.id, :state => self.state, :interface => interface, @@ -15,22 +15,30 @@ :network => self.network, :netmask => self.netmask } end + def ip + TestLab::Utility.ip(self.address) + end + + def cidr + TestLab::Utility.cidr(self.address) + end + # Returns the network mask def netmask - TestLab::Utility.netmask(self.ip) + TestLab::Utility.netmask(self.address) end # Returns the network address def network - TestLab::Utility.network(self.ip) + TestLab::Utility.network(self.address) end # Returns the broadcast address def broadcast - TestLab::Utility.broadcast(self.ip) + TestLab::Utility.broadcast(self.address) end # Network Bridge State def state output = self.node.ssh.exec(%(sudo ifconfig #{self.bridge} | grep 'MTU'), :silence => true, :ignore_exit_status => true).output.strip