Bug 2041346 - [RHOSP 16.1] set the log priority to log.info in "ensure_device_is_ready" function in ip_lib.py
Summary: [RHOSP 16.1] set the log priority to log.info in "ensure_device_is_ready" fun...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-neutron
Version: 16.1 (Train)
Hardware: x86_64
OS: Linux
high
low
Target Milestone: z9
: 16.1 (Train on RHEL 8.2)
Assignee: Slawek Kaplonski
QA Contact: Eran Kuris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-17 07:08 UTC by Punit Kundal
Modified: 2022-12-07 20:29 UTC (History)
4 users (show)

Fixed In Version: openstack-neutron-15.2.1-1.20220124083747.40d217c.el8ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-07 20:28:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-12148 0 None None None 2022-01-17 07:18:30 UTC
Red Hat Product Errata RHSA-2022:8870 0 None None None 2022-12-07 20:29:44 UTC

Description Punit Kundal 2022-01-17 07:08:28 UTC
Description of problem:

It is noticed that when creating a subnet with dhcp enabled; the "ensure_device_is_ready" function logs with error priority:

+++
def ensure_device_is_ready(device_name, namespace=None):
    dev = IPDevice(device_name, namespace=namespace)
    try:
        # Ensure the device has a MAC address and is up, even if it is already
        # up.
        if not dev.link.exists or not dev.link.address:
            LOG.error("Device %s cannot be used as it has no MAC "
                      "address", device_name)
            return False
        dev.link.set_up()
    except RuntimeError:
        return False
    return True
+++

this appears to be called from the below:

+++
   1612     def setup(self, network):
   1613         """Create and initialize a device for network's DHCP on this host."""
   1614         try:
   1615             port = self.setup_dhcp_port(network)
   1616         except Exception:
   1617             with excutils.save_and_reraise_exception():
   1618                 # clear everything out so we don't leave dangling interfaces
   1619                 # if setup never succeeds in the future.
   1620                 self._cleanup_stale_devices(network, dhcp_port=None)
   1621         self._update_dhcp_port(network, port)
....
   1640         if ip_lib.ensure_device_is_ready(interface_name,
   1641                                          namespace=network.namespace):
   1642             LOG.debug('Reusing existing device: %s.', interface_name)
   1643             # force mtu on the port for in case it was changed for the network
   1644             mtu = getattr(network, 'mtu', 0)
   1645             if mtu:
   1646                 self.driver.set_mtu(interface_name, mtu,
   1647                                     namespace=network.namespace)
   1648         else:
   1649             try:
   1650                 self.plug(network, port, interface_name)
+++

this should rather be logged with either log.info or log.debug instead

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 16 errata-xmlrpc 2022-12-07 20:28:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Red Hat OpenStack Platform 16.1.9 (openstack-neutron) security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8870


Note You need to log in before you can comment on or make changes to this bug.