Exemplo n.º 1
0
def to_full_bdii_url(url, port='2170'):
    """Given url return <url:hostname>:<url:port>.

    @return: <url:hostname>:<url:port>.
    """
    hp = samutils.parse_uri(url)
    if not hp[1]:
        hp[1] = port
    return '%s:%s' % (hp[0], hp[1])
Exemplo n.º 2
0
def to_full_bdii_url(url, port='2170'):
    """Given url return <url:hostname>:<url:port>.

    @return: <url:hostname>:<url:port>.
    """
    hp = samutils.parse_uri(url)
    if not hp[1]:
        hp[1] = port
    return '%s:%s' % (hp[0], hp[1])
Exemplo n.º 3
0
    def parse_args(self, opts):

        for o,v in opts:
            if o in ('--srmv'):
                if v in self.svcVers:
                    self.svcVer = str(v)
                else:
                    errstr = '--srmv must be one of '+\
                        ', '.join([x for x in self.svcVers])+'. '+v+' given.'
                    raise getopt.GetoptError(errstr)
            elif o in ('--ldap-uri'):
                [host, port] = samutils.parse_uri(v)
                if port == None or port == '':
                    port = '2170'
                self._ldap_url = 'ldap://'+host+':'+port
                os.environ['LCG_GFAL_INFOSYS'] = host+':'+port
            elif o in ('--ldap-timeout'):
                self._timeouts['ldap_timelimit'] = int(v)
            elif o in ('--se-timeout'):
                self._timeouts['srm_connect'] = int(v)