[fuel-pythonclient] Client uses singletone for APIClient

Bug #1454347 reported by Timur Nurlygayanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Alexander Saprykin
Mitaka
Fix Committed
High
Roman Prykhodchenko

Bug Description

Having connection to Fuel node as singletone, there is impossible to create connections to more than one Fuel node in python runtime, so we can not create scenarios for benchmarking more than one Fuel node simultaneusly

Links:
https://github.com/stackforge/python-fuelclient/blob/af6c9c3799b9ec107bcdc6dbf035cafc034526ce/fuelclient/client.py#L194
https://github.com/stackforge/python-fuelclient/blob/af6c9c3799b9ec107bcdc6dbf035cafc034526ce/fuelclient/objects/base.py#L32

Changed in fuel:
importance: Undecided → Medium
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: none → 7.0
status: New → Confirmed
assignee: nobody → Fuel Python Team (fuel-python)
tags: added: module-client
Revision history for this message
Vladimir Sharshov (vsharshov) wrote :

Does not affect deployment. Tech debt. Moving to 8.0

tags: added: tech-debt
Changed in fuel:
status: Confirmed → Won't Fix
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
milestone: 7.0 → 8.0
status: Won't Fix → Confirmed
no longer affects: fuel/8.0.x
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Revision history for this message
Maciej Kwiek (maciej-iai) wrote :

I am not sure if this is a bug. If you want to use client.py as a library - you should be able to create several instances of Client class.

If you want to use CLI - you get one connection per CLI invocation.

Please specify what do you mean by "create scenarios for benchmarking more than one Fuel node simultaneusly". Do you want to be able to specify which master node you want to connect to with CLI arguments?

Changed in fuel:
status: Confirmed → Incomplete
Revision history for this message
Łukasz Oleś (loles) wrote :

Maciek,

everything is in the linked code. In the current implementation singleton is used everywhere.

Changed in fuel:
status: Incomplete → Confirmed
Changed in fuel:
milestone: 8.0 → 9.0
Revision history for this message
Roman Prykhodchenko (romcheg) wrote :

Raising to High since it blocks QA team from switching to python-fuelclient.

Dmitry Pyzhov (dpyzhov)
no longer affects: fuel/newton
Changed in fuel:
assignee: Roman Prykhodchenko (romcheg) → Alexander Saprykin (cutwater)
Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to python-fuelclient (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/310768

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

Reviewed: https://review.openstack.org/310197
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=05055066c190a38c25877b9d590f71678660233a
Submitter: Jenkins
Branch: master

commit 05055066c190a38c25877b9d590f71678660233a
Author: Alexander Saprykin <email address hidden>
Date: Tue Apr 26 11:49:47 2016 +0200

    Remove APIClient singleton from fuelclient library

    Fuelclient connection configuration was hardcoded
    and it was impossible to create clients for
    multiple fuel servers.

    User should be able to use multiple connections.
    This patches introduces fuelclient.connect()
    function which returns conneciton object that
    can be used as a parameter to fuelclient.get_client()
    function.

    Closes-Bug: #1454347
    Change-Id: I81f630a2bd8464e9cbeac0543c3a7125d97c1152

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-fuelclient (master)

Reviewed: https://review.openstack.org/310768
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=c9402da0eae17d0f8b4116e19b9d5613a121bafe
Submitter: Jenkins
Branch: master

commit c9402da0eae17d0f8b4116e19b9d5613a121bafe
Author: Alexander Saprykin <email address hidden>
Date: Thu Apr 28 14:49:26 2016 +0200

    Make better names for Client and APIClient classes

    Rename Client and APIClient classes, so new names
    better represent their purpose.

    * Rename "Client" to "APIClient"
    * Rename "APIClient" to "DefaultAPIClient"

    Change-Id: Ifa208b27ba4039e3a71830a567c9199a6ed8b7b5
    Related-Bug: #1454347

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/354177

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-fuelclient (stable/mitaka)

Reviewed: https://review.openstack.org/354177
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=fd6e2dc601a77cfcb9422ab87ade49065d108cc3
Submitter: Jenkins
Branch: stable/mitaka

commit fd6e2dc601a77cfcb9422ab87ade49065d108cc3
Author: Alexander Saprykin <email address hidden>
Date: Tue Apr 26 11:49:47 2016 +0200

    Remove APIClient singleton from fuelclient library

    Fuelclient connection configuration was hardcoded
    and it was impossible to create clients for
    multiple fuel servers.

    User should be able to use multiple connections.
    This patches introduces fuelclient.connect()
    function which returns conneciton object that
    can be used as a parameter to fuelclient.get_client()
    function.

    Closes-Bug: #1454347
    Change-Id: I81f630a2bd8464e9cbeac0543c3a7125d97c1152

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

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