| Summary: | Calling ironicclient API fails with stack trace | ||
|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Chris Dearborn <christopher_dearborn> |
| Component: | python-ironicclient | Assignee: | RHOS Maint <rhos-maint> |
| Status: | CLOSED NOTABUG | QA Contact: | Raviv Bar-Tal <rbartal> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 10.0 (Newton) | CC: | apevec, arkady_kanevsky, cdevine, christopher_dearborn, dcain, John_walsh, kasmith, kurt_hey, lhh, mburns, morazi, randy_perryman, rhel-osp-director-maint, smerrow, sreichar |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-23 15:51:22 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | |||
| Bug Blocks: | 1335596, 1356451 | ||
I tried changing the code to use ironic_client.node.list(), and it blows up with the same error, so it looks like the ironic client api is just plain broken. Stack trace is below. [stack@director network-validation]$ ./validate_networks.py WARNING:ironicclient.common.http:The following arguments are ignored when using the session to construct a client: auth_ref, token Traceback (most recent call last): File "./validate_networks.py", line 322, in <module> network_validation.build_node_list() File "./validate_networks.py", line 151, in build_node_list for ironic_server in ironic.node.list(): File "/usr/lib/python2.7/site-packages/ironicclient/v1/node.py", line 132, in list return self._list(self._path(path), "nodes") File "/usr/lib/python2.7/site-packages/ironicclient/common/base.py", line 154, in _list resp, body = self.api.json_request('GET', url) File "/usr/lib/python2.7/site-packages/ironicclient/common/http.py", line 553, in json_request resp = self._http_request(url, method, **kwargs) File "/usr/lib/python2.7/site-packages/ironicclient/common/http.py", line 190, in wrapper return func(self, url, method, **kwargs) File "/usr/lib/python2.7/site-packages/ironicclient/common/http.py", line 525, in _http_request resp = self.session.request(url, method, AttributeError: 'str' object has no attribute 'request' |
Description of problem: We have network validation code that calls into ironicclient, node.get_by_instance_uuid(). This has worked in the past, but is now failing with the following stack trace: Traceback (most recent call last): File "./validate_networks.py", line 314, in <module> network_validation.build_node_list() File "./validate_networks.py", line 155, in build_node_list nova_server.id) File "/usr/lib/python2.7/site-packages/ironicclient/v1/node.py", line 202, in get_by_instance_uuid nodes = self._list(self._path(path), 'nodes') File "/usr/lib/python2.7/site-packages/ironicclient/common/base.py", line 154, in _list resp, body = self.api.json_request('GET', url) File "/usr/lib/python2.7/site-packages/ironicclient/common/http.py", line 560, in json_request resp = self._http_request(url, method, **kwargs) File "/usr/lib/python2.7/site-packages/ironicclient/common/http.py", line 190, in wrapper return func(self, url, method, **kwargs) File "/usr/lib/python2.7/site-packages/ironicclient/common/http.py", line 532, in _http_request resp = self.session.request(url, method, AttributeError: 'str' object has no attribute 'request' Printing self.session immediately before the session.request call yields: ### self.session: ba6f13201dec7d0ad6d86c73ddad34d71139bcd8 Version-Release number of selected component (if applicable): python-ironicclient-1.7.0-1.el7ost.noarch How reproducible: Call ironic_client.node.get_by_instance_uuid(<uuid) Steps to Reproduce: 1. See above. Actual results: Call blows up with stack trace because expected session object and got a string. Expected results: Call should succeed. Additional info: