Exemple #1
0
    def __init__(self, root="/", config_file=None):
        defaults = copy.deepcopy(os.environ)
        defaults["HOSTNAME"] = gcmu.public_name()
        if "SHORT_HOSTNAME" not in defaults:
            defaults["SHORT_HOSTNAME"] = defaults["HOSTNAME"].split(".")[0]
        if "USER" in defaults:
            del defaults["USER"]
        if "GLOBUS_USER" not in defaults:
            defaults["GLOBUS_USER"] = ""
        if "GLOBUS_PASSWORD" not in defaults:
            defaults["GLOBUS_PASSWORD"] = ""

        configparser.ConfigParser.__init__(self, defaults)
        self.root = root
        self.cilogon_dn_prefix = CILOGON_DN_PREFIX
        self.cilogon_org_name = None
        if config_file is None:
            config_file = os.path.join("/", ConfigFile.DEFAULT_CONFIG_FILE)
        config_fp = open(config_file, "r")
        try:
            if self.readfp(config_fp) == []:
                raise configparser.ParsingError(config_file)
        finally:
            config_fp.close()
        self.validate(config_file)
        self.validate_cilogon_identity_provider()
Exemple #2
0
 def get_endpoint_name(self):
     name = None
     if self.has_option(ConfigFile.ENDPOINT_SECTION,
                        ConfigFile.NAME_OPTION):
         name = self.get(ConfigFile.ENDPOINT_SECTION,
                         ConfigFile.NAME_OPTION)
         if name == '':
             name = None
     if name is None:
         name = gcmu.public_name().split(".")[0]
     elif "#" in name:
         name = name[name.find("#") + 1:]
     return name
 def get_endpoint_name(self):
     name = None
     if self.has_option(
             ConfigFile.ENDPOINT_SECTION,
             ConfigFile.NAME_OPTION):
         name = self.get(
             ConfigFile.ENDPOINT_SECTION,
             ConfigFile.NAME_OPTION)
         if name == '':
             name = None
     if name is None:
         name = gcmu.public_name().split(".")[0]
     elif "#" in name:
         name = name[name.find("#")+1:]
     return name
    def __init__(self, root="/", config_file=None):
        defaults = copy.deepcopy(os.environ)
        defaults["HOSTNAME"] = gcmu.public_name()
        if "SHORT_HOSTNAME" not in defaults:
            defaults["SHORT_HOSTNAME"] = defaults["HOSTNAME"].split(".")[0]
        if "USER" in defaults:
            del defaults["USER"]
        if "GLOBUSONLINE_USER" not in defaults:
            defaults["GLOBUSONLINE_USER"] = ""
        if "GLOBUSONLINE_PASSWORD" not in defaults:
            defaults["GLOBUSONLINE_PASSWORD"] = ""

        ConfigParser.ConfigParser.__init__(self, defaults)
        self.root = root
        if config_file is None:
            config_file = os.path.join("/", ConfigFile.DEFAULT_CONFIG_FILE)
        config_fp = open(config_file, "r")
        try:
            if self.readfp(config_fp) == []:
                raise ParsingError()
        finally:
            config_fp.close()
Exemple #5
0
    def __init__(self, root="/", config_file=None):
        defaults = copy.deepcopy(os.environ)
        defaults["HOSTNAME"] = gcmu.public_name()
        if "SHORT_HOSTNAME" not in defaults:
            defaults["SHORT_HOSTNAME"] = defaults["HOSTNAME"].split(".")[0]
        if "USER" in defaults:
            del defaults["USER"]
        if "GLOBUSONLINE_USER" not in defaults:
            defaults["GLOBUSONLINE_USER"] = ""
        if "GLOBUSONLINE_PASSWORD" not in defaults:
            defaults["GLOBUSONLINE_PASSWORD"] = ""

        ConfigParser.ConfigParser.__init__(self, defaults)
        self.root = root
        if config_file is None:
            config_file = os.path.join("/", ConfigFile.DEFAULT_CONFIG_FILE)
        config_fp = open(config_file, "r")
        try:
            if self.readfp(config_fp) == []:
                raise ParsingError()
        finally:
            config_fp.close()