コード例 #1
0
def check_creds(cred_req):
    """
    """
    try:
        credential_store[cred_req]
    except KeyError:
        credential_store.create(cred_req)
コード例 #2
0
ファイル: GaudiExecRTHandlers.py プロジェクト: Erni1619/ganga
def check_creds(cred_req):
    """
    """
    try:
        credential_store[cred_req]
    except KeyError:
        credential_store.create(cred_req)
コード例 #3
0
ファイル: mark.py プロジェクト: ganga-devs/ganga
 def __call__(self, function):
     """
     This call is called at the detection step of the tests for py.test.
     It wil fail if the credential_requirement is not present in the store and can't be auto-detected
     Args:
         function (method, class): This is the test method or class we want to skip if the conditions aren't met
     """
     load_config_files()
     from Ganga.GPIDev.Credentials.CredentialStore import credential_store
     try:
         credential_store[self._cred_req]
         return function
     except GangaKeyError:
         try:
             credential_store.create(self._cred_req)
             return function
         except CredentialsError:
             return pytest.mark.skip(self.reason)(function)
     finally:
         clear_config()
コード例 #4
0
ファイル: __init__.py プロジェクト: Erni1619/ganga
    def renew(cls):
        """
        This method is similar to calling::

            credential_store.create(DiracProxy())

        or::

            credential_store[DiracProxy()].renew()

        as appropriate.
        """

        from Ganga.GPI import credential_store, DiracProxy
        try:
            cred = credential_store[DiracProxy()]
            if not cred.is_valid():
                cred.create()
        except KeyError:
            credential_store.create(DiracProxy())
コード例 #5
0
ファイル: __init__.py プロジェクト: will-cern/ganga
    def renew(cls):
        """
        This method is similar to calling::

            credential_store.create(DiracProxy())

        or::

            credential_store[DiracProxy()].renew()

        as appropriate.
        """

        from Ganga.GPI import credential_store, DiracProxy
        try:
            cred = credential_store[DiracProxy()]
            if not cred.is_valid():
                cred.create()
        except KeyError:
            credential_store.create(DiracProxy())
コード例 #6
0
ファイル: mark.py プロジェクト: wireshark10/ganga
 def __call__(self, function):
     """
     This call is called at the detection step of the tests for py.test.
     It wil fail if the credential_requirement is not present in the store and can't be auto-detected
     Args:
         function (method, class): This is the test method or class we want to skip if the conditions aren't met
     """
     load_config_files()
     from Ganga.GPIDev.Credentials.CredentialStore import credential_store
     try:
         credential_store[self._cred_req]
         return function
     except KeyError:
         try:
             credential_store.create(self._cred_req)
             return function
         except CredentialsError:
             return pytest.mark.skip(self.reason)(function)
     finally:
         clear_config()