Bug 855883

Summary: rhn_check fails with traceback when more instances of rhn_check are running
Product: [Community] Spacewalk Reporter: Milan Zázrivec <mzazrivec>
Component: ClientsAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.8CC: ahumbe, jhutar, jmikulka, mminar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 830776 Environment:
Last Closed: 2012-11-01 16:20:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 830776    
Bug Blocks: 871344    

Description Milan Zázrivec 2012-09-10 14:08:26 UTC
+++ This bug was initially created as a clone of Bug #830776 +++

Description of problem:
I scheduled kickstart (in WebUI, Satellite 5.4.1) to be picked up after some specified time in expectation that osad running on the host machine would pick up the action at that time. But I ran rhn_check approximately at the same moment and rhn_check failed with traceback (in /var/log/up2date).

Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 374, in <module>
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 84, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhn_check", line 63, in main
    CheckCli.__check_instance_lock()
  File "/usr/sbin/rhn_check", line 369, in __check_instance_lock
    sys.stderr.write(rhncli.utf8_encode(_("Attempting to run more than one instance of rhn_check. Exiting.\n")))
<type 'exceptions.NameError'>: global name '_' is not defined

Version-Release number of selected component (if applicable):
RHEL Server 6.3 x86_64
rhn-client-tools-1.0.0-87.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. in WebUI - schedule kickstart no sooner than some time
2. run rhn_check manually at the same time
3. check logs
  
Actual results:
traceback is shown + logged in /var/log/up2date

Expected results:
localized error message should be shown ("Attempting to run more than one instance of rhn_check. Exiting.")

Additional info:
Simplest fix is to add these lines to /usr/sbin/rhn_check:

import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext

Comment 1 Milan Zázrivec 2012-09-10 14:10:53 UTC
spacewalk.git master: a34f5f29e3c5076b0bbea3618b9ccc12a491192a

Comment 2 Jan Pazdziora (Red Hat) 2012-10-30 19:24:53 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 3 Jan Pazdziora (Red Hat) 2012-11-01 16:20:16 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18