STATUS_OFFLINE = 'offline'
STATUS_ERROR = 'error'
STATUS_UNUSED = 'unused'
+ STATUS_UNKNOWN = 'unknown'
class Node(object):
'''
return Role.ODL in self.roles
+ def is_onos(self):
+ '''
+ Returns if the node is an ONOS
+ '''
+ return Role.ONOS in self.roles
+
def get_ovs_info(self):
'''
Returns the ovs version installed
'''
if self.is_active():
- cmd = "ovs-vsctl --version|head -1| sed 's/^.*) //'"
- return self.run_cmd(cmd)
+ cmd = "ovs-vsctl --version 2>/dev/null|head -1| sed 's/^.*) //'"
+ return self.run_cmd(cmd) or None
return None
def get_system_info(self):
'''
- Returns the ovs version installed
+ Returns system information
'''
cmd = 'grep MemTotal /proc/meminfo'
memory = self.run_cmd(cmd).partition('MemTotal:')[-1].strip().encode()
pod=os.getenv('NODE_NAME', 'Unknown'),
openstack_version=self.get_openstack_version(),
sdn_controller=self.get_sdn_version(),
- nodes=self.get_nodes())
+ nodes=self.nodes)