← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1659342] [NEW] TypeError in message logging

 

Public bug reported:

In openstack_dashboard/api/neutron.py [1], There is a wrongly rewritten
message logging, which trows TypeError instead of logging. This code was
merged a long time ago [2].

The lines are the following: 
        LOG.debug("router_static_route_list(): router_id=%s, "
                  "router=%s", (router_id, router))

Which I think wanted to be the following:
        LOG.debug("router_static_route_list(): router_id=%s, "
                  "router=%s" % (router_id, router))

But since there is a guideline to delay the string interpolation and leave it to the logger, it should be something like this (or add names, that would be more elegant): 
        LOG.debug("router_static_route_list(): router_id=%s, "
                  "router=%s", router_id, router)

[1]: https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/neutron.py#L1079
[2]: https://review.openstack.org/#/c/135890/

** Affects: horizon
     Importance: Undecided
     Assignee: Gábor Antal (gabor.antal)
         Status: New

** Changed in: horizon
     Assignee: (unassigned) => Gábor Antal (gabor.antal)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1659342

Title:
  TypeError in message logging

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  In openstack_dashboard/api/neutron.py [1], There is a wrongly
  rewritten message logging, which trows TypeError instead of logging.
  This code was merged a long time ago [2].

  The lines are the following: 
          LOG.debug("router_static_route_list(): router_id=%s, "
                    "router=%s", (router_id, router))

  Which I think wanted to be the following:
          LOG.debug("router_static_route_list(): router_id=%s, "
                    "router=%s" % (router_id, router))

  But since there is a guideline to delay the string interpolation and leave it to the logger, it should be something like this (or add names, that would be more elegant): 
          LOG.debug("router_static_route_list(): router_id=%s, "
                    "router=%s", router_id, router)

  [1]: https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/neutron.py#L1079
  [2]: https://review.openstack.org/#/c/135890/

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1659342/+subscriptions


Follow ups