heat resource-metadata not working

Bug #1349467 reported by Nicholas Randon
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-heatclient
Fix Released
Medium
Thomas Herve

Bug Description

if you run heat resource-metadata <NAME or ID> <RESOURCE>

you get the following error:
request() got an unexpected keyword argument 'follow_redirects'

For example on on tripleo:
heat resource-metadata overcloud overcloud
request() got an unexpected keyword argument 'follow_redirects'

running debug you get the following trace:

Traceback (most recent call last):
  File "/usr/local/bin/heat", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/shell.py", line 635, in main
    HeatShell().main(args)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/shell.py", line 591, in main
    args.func(client, args)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/v1/shell.py", line 653, in do_resource_metadata
    metadata = hc.resources.metadata(**fields)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/v1/resources.py", line 68, in metadata
    stack_id = self._resolve_stack_id(stack_id)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 180, in _resolve_stack_id
    follow_redirects=False)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/common/http.py", line 239, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/heatclient/common/http.py", line 320, in _http_request
    return self.session.request(url, method, raise_exc=False, **kwargs)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/keystoneclient/utils.py", line 324, in inner
    return func(*args, **kwargs)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/keystoneclient/session.py", line 260, in request
    resp = self._send_request(url, method, redirect, **kwargs)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/keystoneclient/session.py", line 285, in _send_request
    resp = self.session.request(method, url, **kwargs)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/keystoneclient/session.py", line 46, in request
    return requests.request(*args, **kwargs)
  File "/opt/stack/venvs/python-heatclient/local/lib/python2.7/site-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
TypeError: request() got an unexpected keyword argument 'follow_redirects'

Revision history for this message
Thomas Herve (therve) wrote :

It seems to work for me. Can you give your version of heatclient and the requests library? Thanks.

affects: heat → python-heatclient
Changed in python-heatclient:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Nicholas Randon (nicholas-randon) wrote :

heat --version = 0.2.10.6
pip freeze
Cheetah==2.4.4
FormEncode==1.2.6
MySQL-python==1.2.3
Paste==1.7.5.1
PyYAML==3.11
Routes==2.0
SQLAlchemy==0.9.6
Tempita==0.5.2
WebOb==1.4
apt-xapian-index==0.46
argparse==1.2.1
boto==2.27.0
chardet==2.2.1
cloud-init==0.7.6
configobj==4.7.2
ecdsa==0.11
euca2ools==3.0.1
eventlet==0.13.0
greenlet==0.4.0
httplib2==0.9
iso8601==0.1.10
jsonpatch==1.3
jsonpointer==1.0
lxml==3.3.5
netaddr==0.7.10
numpy==1.8.1
oauth==1.0.1
paramiko==1.14.0
prettytable==0.7.2
pycrypto==2.6.1
pydns==2.3.6
pyserial==2.6
python-apt==0.9.3.7
python-debian==0.1.22
repoze.lru==0.6
requestbuilder==0.1.0
requests==2.3.0
six==1.7.2
urllib3==1.8.2
virtualenv==1.11.6
wsgiref==0.1.2

Revision history for this message
Thomas Herve (therve) wrote :

Ah got it, it was introduced recently.

Changed in python-heatclient:
status: Incomplete → Confirmed
Revision history for this message
Thomas Herve (therve) wrote :

The problem has been introduced by https://review.openstack.org/#/c/92728/. All the resource operations fail now.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-heatclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/110063

Changed in python-heatclient:
assignee: nobody → Thomas Herve (therve)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-heatclient (master)

Reviewed: https://review.openstack.org/110063
Committed: https://git.openstack.org/cgit/openstack/python-heatclient/commit/?id=42c509677046826d6990edf9adeb3dca1ea4c1f0
Submitter: Jenkins
Branch: master

commit 42c509677046826d6990edf9adeb3dca1ea4c1f0
Author: Thomas Herve <email address hidden>
Date: Mon Jul 28 18:47:14 2014 +0200

    Revert "Add keystone v3 auth support"

    This reverts commit a98c1f3617604c4871263ff9cc986b27f302ef46.
    The new usage of session doesn't work with resources or events.

    Conflicts:
     heatclient/tests/test_shell.py
    Closes-Bug: #1349467

    Change-Id: Ib5b0db81454abe647aca6461dd7bd5f197267fb8

Changed in python-heatclient:
status: In Progress → Fix Committed
Revision history for this message
David J Hu (david-j-hu) wrote :

Hi All,

We also found the same issue during testing, and I have a fix for the follow_redirect issue. As I try to submit the patch to fix the issue 15 min ago, I found that my original keystone v3 auth support got reverted. Any suggestions on how to proceed?

https://bugs.launchpad.net/python-heatclient/+bug/1348297

David

Revision history for this message
Thomas Herve (therve) wrote :

David: there should have been a bug to track keystone v3 auth support. I suggest opening one, and repropose your patch with the fix.

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

David, we like to do quick reverts for obvious regressions, so feel free to re-propose the v3 auth change with your fix

Revision history for this message
David J Hu (david-j-hu) wrote :

Thanks Thomas and Steve for the suggestion. Will re-propose the v3 auth change with the fix.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-heatclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/110750

David J Hu (david-j-hu)
Changed in python-heatclient:
assignee: Thomas Herve (therve) → David J Hu (david-j-hu)
Thomas Herve (therve)
Changed in python-heatclient:
assignee: David J Hu (david-j-hu) → Thomas Herve (therve)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-heatclient (master)

Reviewed: https://review.openstack.org/110750
Committed: https://git.openstack.org/cgit/openstack/python-heatclient/commit/?id=9154f6dff873d7fa0563783eff6b07537bdbbee8
Submitter: Jenkins
Branch: master

commit 9154f6dff873d7fa0563783eff6b07537bdbbee8
Author: David Hu <email address hidden>
Date: Wed Jul 30 11:17:10 2014 -0700

    Re-add keystone v3 auth with fixes

    The first part of the commit is to re-propose the v3 auth changes.
    https://review.openstack.org/#/c/92728/

    The second part of the commit is to address the unexpected keyword
    argument 'follow_redirect' and missing endpoint issue in certain
    code path such as 'heat event-list' or 'heat resource-metadata'.
    With the fix, follow_redirect argument is consumed by
    SessionClient. Heat endpoint is now passed from Heatclient
    shell to SessionClient.

    Unit tests were added and updated to cover the issue.

    Change-Id: I0cdf837c924afe9cbd8826bdca5dd611c183efeb
    Closes-Bug: #1349467
    Closes-Bug: #1348297

Changed in python-heatclient:
milestone: none → v0.2.11
Changed in python-heatclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.