rhsm_repository: refactor parsing of "subscription-manager repos" output (#6837)

Simplify a bit (and possibly speed it up a little) the parsing of the
output of `subscription-manager repos --list`:
- simplify skipping the lines that are not interesting: check the first
  character only, as it is enough to determine whether it contains
  repository data or not
- check the start of each line manually, rather than with regexp: a
  simple slice + lstrip() gives the same result
This commit is contained in:
Pino Toscano 2023-07-15 12:57:54 +02:00 committed by GitHub
parent 3a6955cbd7
commit e0324cdc90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 29 deletions

View file

@ -0,0 +1,8 @@
minor_changes:
- |
rhsm_repository - the interaction with ``subscription-manager`` was
refactored by grouping things together, removing unused bits, and hardening
the way it is run; also, the parsing of ``subscription-manager repos --list``
was improved and made slightly faster; no behaviour change is expected
(https://github.com/ansible-collections/community.general/pull/6783,
https://github.com/ansible-collections/community.general/pull/6837).

View file

@ -1,6 +0,0 @@
minor_changes:
- |
rhsm_repository - the interaction with ``subscription-manager`` was
refactored by grouping things together, removing unused bits, and hardening
the way it is run; no behaviour change is expected
(https://github.com/ansible-collections/community.general/pull/6783).