def _fetch_app_role_token(vault_url, role_id, secret_id):
        """Get a Vault token, using the RoleID and SecretID"""
        url = _url_joiner(vault_url, 'v1/auth/approle/login')
        resp = requests.post(url, data={'role_id': role_id, 'secret_id': secret_id})
        resp.raise_for_status()
        data = resp.json()
        if data.get('errors'):
            raise VaultException(u'Error fetching Vault token: {}'.format(data['errors']))
        return data['auth']['client_token']
def _fetch_app_role_token ( vault_url , role_id , secret_id ) : url = _url_joiner ( vault_url , 'v1/auth/approle/login' ) resp = requests . post ( url , data = { 'role_id' : role_id , 'secret_id' : secret_id } ) resp . raise_for_status ( ) data = resp . json ( ) if data . get ( 'errors' ) : raise VaultException ( u'Error fetching Vault token: {}' . format ( data [ 'errors' ] ) ) return data [ 'auth' ] [ 'client_token' ]
Get a Vault token, using the RoleID and SecretID