def list_all_nodes( self ): """ Heckle Glossary Function Produces a basic list of all the nodes Note: This is specific to Breadboard. For real installation, this would need to read from config file. """ regex = re.compile("bb\d{1,2}") all_nodes_list = [] for node in heckle_list_node( self.session ): if regex.match(node['name']): all_nodes_list.append(node['name']) all_nodes_list.sort() return all_nodes_list
def get_node_properties( self, node_name ): """ Heckle Glossary Function gets all the properties of one node """ #hwlist = heckle_list_hardware(session, name=node_name) #Use if it worked... #return hwlist['properties'] # logger.debug("HICCUP: get_node_properties &&&&&&&&&&&&") props = [] self.session.expire_all() hwlist = heckle_list_hardware( self.session ) for element in hwlist: if node_name in element['nodes']: props = element['properties'] continue props.update(heckle_list_node(self.session, name=node_name)[0]) return props
def get_node_properties( self, node_name ): """ Heckle Glossary Function gets all the properties of one node """ #hwlist = list_hardware(session, name=node_name) #Use if it worked... #return hwlist['properties'] logstr = "HICCUP:get_node_properties:" # LOGGER.debug("HICCUP:get_node_properties &&&&&&&&&&&&") self.session.expire_all() if node_name in self.node_list: properties = heckle_list_node( session=self.session, name=node_name )[0] properties.update( heckle_list_hardware( session=self.session, name=properties['hardware'] )[0] ) properties['mac'] = properties['mac'].replace('-',':') properties['mac'] = ( properties['mac'].upper() ) return properties else: raise Exception( logstr + "No node %s recognized" % node_name )