ironicclient expects endpoint to be defined by default

Bug #1498608 reported by Julia Kreger on 2015-09-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Julia Kreger

Bug Description

For programatic use of the python-ironicclient api, when keystone sessions are being used, an endpoint may not be defined by the invocation as it is included in the keystone session data.

Example using os_ironic ansible modules with current shade master branch code:

Traceback (most recent call last):
  File "/home/jkreger/.ansible/tmp/ansible-tmp-1442940371.78-69826534691607/os_ironic", line 2066, in <module>
  File "/home/jkreger/.ansible/tmp/ansible-tmp-1442940371.78-69826534691607/os_ironic", line 243, in main
    server = cloud.get_machine(node_id)
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 3365, in get_machine
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 103, in submitTask
    return task.wait()
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 70, in wait
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 75, in run
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 461, in main
    return client.ironic_client.node.get(**self.args)
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 3312, in ironic_client
  File "/usr/local/lib/python2.7/dist-packages/shade/", line 325, in _get_client
    client = client_class(**constructor_args)
  File "/usr/local/lib/python2.7/dist-packages/ironicclient/", line 116, in Client
    return client_class(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ironicclient/v1/", line 51, in __init__
    self.http_client = http._construct_http_client(*args, **kwargs)
TypeError: _construct_http_client() takes at least 1 argument (3 given)

This is because endpoint is an explicitly required argument to the _construct_http_client method by having no default value. Setting the default to None in the method results in the session data being used as-expected.

Changed in ironic:
assignee: nobody → Julia Kreger (juliaashleykreger)
status: New → In Progress

I have proposed to remedy this issue.

Dmitry Tantsur (divius) on 2015-10-05
affects: ironic → python-ironicclient
Changed in python-ironicclient:
status: In Progress → Fix Committed
importance: Undecided → Medium
Changed in python-ironicclient:
milestone: none → 0.10.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers