Пример #1
0
def scan( host=get_hostname(), db=None, pyro_timeout=None, verbose=False, silent=False ):
    #print 'SCANNING PORTS'
    # scan all cylc Pyro ports for cylc suites

    gcfg = get_global_cfg(verbose=verbose)
    pyro_base_port = gcfg.cfg['pyro']['base port']
    pyro_port_range = gcfg.cfg['pyro']['maximum number of ports']

    # In non-verbose mode print nothing (scan is used by cylc db viewer).

    # load my suite passphrases 
    reg = localdb(db)
    reg_suites = reg.get_list()
    my_passphrases = {}
    for item in reg_suites:
        rg = item[0]
        di = item[1]
        try:
            pp = passphrase( rg, user, host ).get( suitedir=di )
        except Exception, x:
            #print >> sys.stderr, x
            # no passphrase defined for this suite
            pass
        else:
            my_passphrases[ rg ] = pp
Пример #2
0
    def __init__( self, suite, suitedir, base_port, max_n_ports, user=user ):

        self.suite = suite
        self.owner = user

        # SINGLE THREADED PYRO
        Pyro.config.PYRO_MULTITHREADED = 1
        # USE DNS NAMES INSTEAD OF FIXED IP ADDRESSES FROM /etc/hosts
        # (see the Userguide "Networking Issues" section).
        Pyro.config.PYRO_DNS_URI = True

        # base (lowest allowed) Pyro socket number
        Pyro.config.PYRO_PORT = base_port
        # max number of sockets starting at base
        Pyro.config.PYRO_PORT_RANGE = max_n_ports

        Pyro.core.initServer()
        self.daemon = Pyro.core.Daemon()
        self.daemon.setAllowedIdentifications( [passphrase(suite,user,get_hostname()).get(suitedir=suitedir)] )
Пример #3
0
    def __init__(self, suite, suitedir, base_port, max_n_ports, user=user):

        self.suite = suite
        self.owner = user

        # SINGLE THREADED PYRO
        Pyro.config.PYRO_MULTITHREADED = 1
        # USE DNS NAMES INSTEAD OF FIXED IP ADDRESSES FROM /etc/hosts
        # (see the Userguide "Networking Issues" section).
        Pyro.config.PYRO_DNS_URI = True

        # base (lowest allowed) Pyro socket number
        Pyro.config.PYRO_PORT = base_port
        # max number of sockets starting at base
        Pyro.config.PYRO_PORT_RANGE = max_n_ports

        Pyro.core.initServer()
        self.daemon = Pyro.core.Daemon()
        self.daemon.setAllowedIdentifications(
            [passphrase(suite, user, get_hostname()).get(suitedir=suitedir)])
Пример #4
0
def scan(host=hostname, db=None, pyro_timeout=None, verbose=False):
    # print 'SCANNING PORTS'
    # scan all cylc Pyro ports for cylc suites

    # In non-verbose mode print nothing (scan is used by gcylc).

    # load my suite passphrases
    reg = localdb(db)
    reg.load_from_file()
    reg_suites = reg.get_list()
    my_passphrases = {}
    for item in reg_suites:
        rg = item[0]
        di = item[1]
        try:
            pp = passphrase(rg, user, host).get(suitedir=di)
        except Exception, x:
            # print >> sys.stderr, x
            # no passphrase defined for this suite
            pass
        else:
            my_passphrases[rg] = pp