Bug #27730
closedforeman-maintain version lock fails if system is not register.
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1741909
Description of problem:
Foreman-maintain uses repoquery command to get the repository name from where foreman-installer package is installed.
But this returns nil when the system is not subscribed or /etc/yum.repos.d/redhat.repo and fails with the below error.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lock versions of Foreman-related packages:
- Locking packages [FAIL]
undefined method `[]' for nil:NilClass
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version-Release number of selected component (if applicable):
satellite 6.6
How reproducible:
Unregister the system and then run the below command.
- foreman-maintain packages lock --assumeyes
Actual results:
- Locking packages [FAIL]
undefined method `[]' for nil:NilClass
Expected results:
There should be an error message stating that the system is not registered or subscribe.
Updated by The Foreman Bot over 4 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_maintain/pull/278 added
Updated by Martin Bacovsky over 4 years ago
- Assignee changed from Anurag Patel to Martin Bacovsky
Updated by Martin Bacovsky over 4 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_maintain|5bc038672ece5d614c1ce336f434a527a30a5641.