Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use YumBase instead of YumBaseCli to get pkg updates #495

Merged
merged 1 commit into from
May 14, 2022

Conversation

bocekm
Copy link
Member

@bocekm bocekm commented May 13, 2022

Using YumBaseCli caused doubling of every log message on the output.

The reason is that instantiating of the YumBaseCli class includes calling logging.basicConfig() which sets up handlers on the root logger.

The YumBaseCli logging handlers interfered with the convert2rhel logging as we use propage=True to be able to use caplog in our unit tests:
#179

It is possible to use the YumBase class, which does not affect logging, to get the same data - list of packages having updates available.

@bocekm bocekm requested review from abadger and r0x0d May 13, 2022 14:42
@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #495 (0f5c08c) into main (68bf0ac) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #495      +/-   ##
==========================================
+ Coverage   82.10%   82.11%   +0.01%     
==========================================
  Files          16       16              
  Lines        2235     2231       -4     
  Branches      379      378       -1     
==========================================
- Hits         1835     1832       -3     
  Misses        333      333              
+ Partials       67       66       -1     
Impacted Files Coverage Δ
convert2rhel/pkghandler.py 91.62% <100.00%> (+0.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68bf0ac...0f5c08c. Read the comment docs.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented May 13, 2022

This pull request introduces 1 alert when merging 29e8058 into 68bf0ac - view on LGTM.com

new alerts:

  • 1 for Unused import

abadger
abadger previously approved these changes May 13, 2022
Copy link
Member

@r0x0d r0x0d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, we fix the pylint errors message and make the tests look cleaner without that import dependency.

convert2rhel/unit_tests/pkghandler_test.py Outdated Show resolved Hide resolved
convert2rhel/unit_tests/pkghandler_test.py Outdated Show resolved Hide resolved
@bocekm bocekm force-pushed the do_not_use_yumbasecli_to_fix_logging branch from 29e8058 to 905dc2c Compare May 13, 2022 15:12
@lgtm-com
Copy link
Contributor

lgtm-com bot commented May 13, 2022

This pull request introduces 1 alert when merging 905dc2c into 68bf0ac - view on LGTM.com

new alerts:

  • 1 for Unused import

YumBaseCli was causing the logging of convert2rhel to be broken - after
instantiating YumBaseCli every log message was duplicate on the output.

The reason is that initialization of the YumBaseCli class instance includes
calling logging.basicConfig() which sets up handlers on the root logger.

It is possible to use the YumBase class, which does not affect
logging, to get the same data - list of packages having updates
available.

The YumBaseCli logging handlers interfered with the convert2rhel logging as
we use propage=True to be able to use caplog in our unit tests:
oamg#179
@bocekm bocekm force-pushed the do_not_use_yumbasecli_to_fix_logging branch from 905dc2c to 0f5c08c Compare May 13, 2022 15:23
@lgtm-com
Copy link
Contributor

lgtm-com bot commented May 13, 2022

This pull request introduces 1 alert when merging 0f5c08c into 68bf0ac - view on LGTM.com

new alerts:

  • 1 for Unused import

@bocekm bocekm merged commit 134d8c5 into oamg:main May 14, 2022
@Venefilyn Venefilyn mentioned this pull request Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants