code: def set_credential_file(self, credential_file, region=None,
              tenant_id=None, authenticate=False):
          
          self._creds_file = credential_file
          cfg = ConfigParser.SafeConfigParser()
          try:
              if not cfg.read(credential_file):
                  # If the specified file does not exist, the parser returns an
                  # empty list.
                  raise exc.FileNotFound("The specified credential file '%s' "
                          "does not exist" % credential_file)
          except ConfigParser.MissingSectionHeaderError as e:
              # The file exists, but doesn't have the correct format.
              raise exc.InvalidCredentialFile(e)
          try:
              self._read_credential_file(cfg)
          except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) as e:
              raise exc.InvalidCredentialFile(e)
          if region:
              self.region = region
          if authenticate:
              self.authenticate()
docs: Reads in the credentials from the supplied file. It should be
          a standard config file in the format:
  
          [keystone]
          username = myusername
          password = top_secret
          tenant_id = my_id