Project

General

Profile

Actions

Bug #27730

closed

foreman-maintain version lock fails if system is not register.

Added by Martin Bacovsky over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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.

https://github.com/theforeman/foreman_maintain/blob/d06d75eaf895e7cca004496bcfed5e266188eacd/lib/foreman_maintain/package_manager/yum.rb#L15

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.

  1. 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.

Actions #1

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
Actions #2

Updated by Martin Bacovsky over 4 years ago

  • Assignee changed from Anurag Patel to Martin Bacovsky
Actions #3

Updated by Martin Bacovsky over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF