def authenticate(self):
        """
        Authenticate against the HP Cloud Identity Service.  This is the first
        step in any hpcloud.com session, although this method is automatically
        called when accessing higher-level methods/attributes.

        **Examples of Credentials Configuration**

        - Bare minimum for authentication using HP API keys:

          .. code-block:: yaml

            deployer_credentials:
              hpcloud:
                auth_url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
                tenant_name: farley.mowat-tenant1
                access_key_id: MZOFIE9S83FOS248FIE3
                secret_access_key: EU859vjksor73gkY378f9gkslbkrabcxwfyW2loo

        - With multiple *compute* availability zones activated, the region must
          also be specified (due to current limitations in the OpenStack client
          libraries):

          .. code-block:: yaml

            deployer_credentials:
              hpcloud:
                auth_url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
                tenant_name: farley.mowat-tenant1
                access_key_id: MZOFIE9S83FOS248FIE3
                secret_access_key: EU859vjksor73gkY378f9gkslbkrabcxwfyW2loo
                region_name: az-1.region-a.geo-1

        - Using ``username`` and ``password`` is also allowed, but
          discouraged:

          .. code-block:: yaml

            deployer_credentials:
              hpcloud:
                auth_url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
                tenant_name: farley.mowat-tenant1
                username: farley.mowat
                password: NeverCryW0lf

        When both API keys and ``username+password`` are specified, the API
        keys are used.

        """
        log.info("Authenticating to HP Cloud...")
        creds = self.creds
        access_key_id = creds.get('access_key_id', '')
        secret_access_key = creds.get('secret_access_key', '')
        # prefer api key + secret key, but fallback to username + password
        if access_key_id and secret_access_key:
            self.nova_client.client.os_access_key_id = access_key_id
            self.nova_client.client.os_secret_key = secret_access_key
        self.nova_client.authenticate()
def authenticate ( self ) : log . info ( "Authenticating to HP Cloud..." ) creds = self . creds access_key_id = creds . get ( 'access_key_id' , '' ) secret_access_key = creds . get ( 'secret_access_key' , '' ) if access_key_id and secret_access_key : self . nova_client . client . os_access_key_id = access_key_id self . nova_client . client . os_secret_key = secret_access_key self . nova_client . authenticate ( )
Authenticate against the HP Cloud Identity Service.  This is the first
        step in any hpcloud.com session, although this method is automatically
        called when accessing higher-level methods/attributes.

        **Examples of Credentials Configuration**

        - Bare minimum for authentication using HP API keys:

          .. code-block:: yaml

            deployer_credentials:
              hpcloud:
                auth_url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
                tenant_name: farley.mowat-tenant1
                access_key_id: MZOFIE9S83FOS248FIE3
                secret_access_key: EU859vjksor73gkY378f9gkslbkrabcxwfyW2loo

        - With multiple *compute* availability zones activated, the region must
          also be specified (due to current limitations in the OpenStack client
          libraries):

          .. code-block:: yaml

            deployer_credentials:
              hpcloud:
                auth_url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
                tenant_name: farley.mowat-tenant1
                access_key_id: MZOFIE9S83FOS248FIE3
                secret_access_key: EU859vjksor73gkY378f9gkslbkrabcxwfyW2loo
                region_name: az-1.region-a.geo-1

        - Using ``username`` and ``password`` is also allowed, but
          discouraged:

          .. code-block:: yaml

            deployer_credentials:
              hpcloud:
                auth_url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
                tenant_name: farley.mowat-tenant1
                username: farley.mowat
                password: NeverCryW0lf

        When both API keys and ``username+password`` are specified, the API
        keys are used.