Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem: Run the below python code from libnmstate import netapplier from libnmstate import netinfo from libnmstate.schema import Interface import logging import sys import yaml def logger_level(logger, verbose=False, debug=False): log_level = logging.DEBUG if debug: log_level = logging.DEBUG elif verbose: log_level = logging.INFO logger.setLevel(log_level) def configure_logger(log_file=False, verbose=False, debug=False): LOG_FORMAT = ('%(asctime)s.%(msecs)03d %(levelname)s ' '%(name)s.%(funcName)s %(message)s') DATE_FORMAT = '%Y-%m-%d %H:%M:%S' logger = logging.getLogger("os_net_config") logger.handlers.clear() logger_level(logger, verbose, debug) logger.propagate = True formatter = logging.Formatter(fmt=LOG_FORMAT, datefmt=DATE_FORMAT) if log_file: file_handler = logging.handlers.RotatingFileHandler( _LOG_FILE, maxBytes=10485760, backupCount=7 ) file_handler.setFormatter(formatter) logger.addHandler(file_handler) stream_handler = logging.StreamHandler(sys.stdout) stream_handler.setFormatter(formatter) logger.addHandler(stream_handler) return logger logger = configure_logger() logger.debug("---------PRE_NETINFO LOG-----------------") ifaces = netinfo.show_running_config()[Interface.KEY] ifaces_dmp = yaml.dump(ifaces, default_flow_style = False, allow_unicode = True, encoding = None) logger.debug("-------POST_NETINFO_LOG------------------") logger.debug("Running info: \n %s" % ifaces_dmp) Its found that after invoking netinfo.show_running_config(), the logs are duplicated. Version-Release number of selected component (if applicable): nmstatectl 2.2.6 Actual results: [root@dell-r640-oss-14 ~]# python nmstate_test.py 2023-02-14 16:53:59.240 DEBUG os_net_config.<module> ---------PRE_NETINFO LOG----------------- 2023-02-14 16:53:59.360 DEBUG os_net_config.<module> -------POST_NETINFO_LOG------------------ DEBUG:os_net_config:-------POST_NETINFO_LOG------------------ 2023-02-14 16:53:59.360 DEBUG os_net_config.<module> Running info: ..... Expected results: 2023-02-14 16:53:59.240 DEBUG os_net_config.<module> ---------PRE_NETINFO LOG----------------- 2023-02-14 16:53:59.360 DEBUG os_net_config.<module> -------POST_NETINFO_LOG------------------ 2023-02-14 16:53:59.360 DEBUG os_net_config.<module> Running info: ....