Changeset 10692 in genesis


Ignore:
Timestamp:
May 6, 2012, 8:44:45 PM (13 years ago)
Author:
rick
Message:

_only_ directories with a wleiden.yaml are valid node items.

Location:
tools
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10682 r10692  
    161161
    162162
    163 def get_proxylist():
    164   """Get all available proxies proxyX sorting based on X number"""
    165   proxylist = sorted([os.path.basename(x) for x in glob.glob("%s/proxy*" % NODE_DIR)],
    166                 key=lambda name: int(''.join([c for c in name if c in string.digits])),
    167                 cmp=lambda x,y: x - y) + sorted([os.path.basename(x) for x in glob.glob("%s/Proxy*" % NODE_DIR)])
    168   return proxylist
    169 
    170 def get_hybridlist():
    171   """Get all available hybrid nodes/proxies"""
    172   hybridlist = sorted([os.path.basename(x) for x in glob.glob("%s/Hybrid*" % NODE_DIR)])
    173   return hybridlist
    174 
    175163
    176164def valid_addr(addr):
     
    178166  return str(addr).startswith('172.')
    179167
    180 
    181 def get_nodelist():
    182   """ Get all available nodes - sorted """
    183   nodelist = sorted([os.path.basename(x) for x in glob.glob("%s/CNode*" % NODE_DIR)])
    184   return nodelist
     168def get_system_list(prefix):
     169  return sorted([os.path.basename(os.path.dirname(x)) for x in glob.glob("%s/%s*/wleiden.yaml" % (NODE_DIR, prefix))])
     170
     171get_hybridlist = lambda: get_system_list("Hybrid")
     172get_nodelist = lambda: get_system_list("CNode")
     173get_proxylist = lambda: get_system_list("Proxy")
    185174
    186175def get_hostlist():
Note: See TracChangeset for help on using the changeset viewer.