Exemplo n.º 1
0
 def get_client(self):
     MANTA_URL = os.environ['MANTA_URL']
     MANTA_KEY_ID = os.environ['MANTA_KEY_ID']
     MANTA_TLS_INSECURE = bool(os.environ.get('MANTA_TLS_INSECURE', False))
     if not self._client:
         signer = manta.CLISigner(key_id=MANTA_KEY_ID)
         self._client = manta.MantaClient(
             url=MANTA_URL,
             account=self.account,
             signer=signer,
             # Uncomment this for verbose client output for test run.
             #verbose=True,
             disable_ssl_certificate_validation=MANTA_TLS_INSECURE)
     return self._client
def get_client(verbose=False):
    MANTA_USER = os.environ['MANTA_USER']
    MANTA_URL = os.environ['MANTA_URL']
    MANTA_TLS_INSECURE = bool(os.environ.get('MANTA_TLS_INSECURE', False))
    MANTA_NO_AUTH = os.environ.get('MANTA_NO_AUTH', 'false') == 'true'
    if MANTA_NO_AUTH:
        signer = None
    else:
        MANTA_KEY_ID = os.environ['MANTA_KEY_ID']
        signer = manta.CLISigner(key_id=MANTA_KEY_ID)
    client = manta.MantaClient(url=MANTA_URL,
        account=MANTA_USER,
        signer=signer,
        verbose=verbose,
        disable_ssl_certificate_validation=MANTA_TLS_INSECURE)
    return client