client.logger.warning wrongly used in migrations.py

Bug #1688507 reported by NidhiMittalHada
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Undecided
NidhiMittalHada

Bug Description

In file https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/migrations.py

on this line https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/migrations.py#L44

code is written as

        if cell_name:
            self.client.logger.warning(_("Argument 'cell_name' is "
                                         "deprecated since Pike, and will "
                                         "be removed in a future release."))

where in client does not have any handler named as logger.

This below error comes if this code reaches:
No handlers could be found for logger "novaclient.v2.client""

This code is never tested as no test case is written to confirm if this warning is ever called.

Changed in python-novaclient:
assignee: nobody → NidhiMittalHada (nidhimittal19)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/463508
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=9a272014167390217351dd5a60f50f518f4ae600
Submitter: Jenkins
Branch: master

commit 9a272014167390217351dd5a60f50f518f4ae600
Author: nidhimittalhada <email address hidden>
Date: Tue May 9 15:20:49 2017 +0530

    client.logger.warning wrongly used in migrations

    client.logger.warning if reached, will give
    this error "No handlers could be found for
    logger "novaclient.v2.client"".

    Fixed by using warnings.warn() and corrected
    root cause by adding appropriate handlers.

    Change-Id: I60c8a023cff92f8b6f37a4a14b6193c3efaa19a8
    Closes-Bug: #1688507

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 9.0.0

This issue was fixed in the openstack/python-novaclient 9.0.0 release.

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

Other bug subscribers

Remote bug watches

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