Bug 253506 - Excessive "my" declaration in GenerateConfig.pm
Excessive "my" declaration in GenerateConfig.pm
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Monitoring (Show other bugs)
500
All Linux
low Severity low
: ---
: ---
Assigned To: Miroslav Suchý
Preethi Thomas
: EasyFix
Depends On:
Blocks: 463877
  Show dependency treegraph
 
Reported: 2007-08-20 06:41 EDT by Miroslav Suchý
Modified: 2009-09-10 14:48 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 14:48:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Miroslav Suchý 2007-08-20 06:41:54 EDT
Description of problem:
In satellite in file
/usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm is excessive
my declaration and becouse of use strict, it fail. Because it is wrapped by eval
it fail sailently.
See attached patch for fix.

Version-Release number of selected component (if applicable):
5.0.0

How reproducible:
always

Steps to Reproduce:
1. perl -wc /usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm
  
Actual results:
"my" variable $satClusterId masks earlier declaration in same scope at
/usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm line 57.
/usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm syntax OK

Expected results:
/usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm syntax OK

Additional info:

--- /tmp/GenerateConfig.pm.orig 2007-08-20 11:59:01.000000000 +0200
+++ /usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm
2007-08-20 11:59:50.000000000 +0200
@@ -54,7 +54,7 @@
         CFDBRecord->ReleaseAllInstances;

         # Generate the satellite configuration
-        my $satClusterId = $satCluster->get_RECID;
+        $satClusterId = $satCluster->get_RECID;
         eval {
             ProbeRecord->LoadForSatellite($satClusterId); # Loads
CommandParamRecord as well
         };
Comment 1 Miroslav Suchý 2009-01-13 07:50:15 EST
Commited as 7138fb790eecbe6de2dd10570e56528437c52e2e
Comment 2 Miroslav Suchý 2009-01-28 05:25:18 EST
Mass moving to ON_QA.
Comment 3 Preethi Thomas 2009-02-09 10:05:39 EST
Miroslav,
Could you please put in steps to verify this one

on my satellite I followed the steps in the description,

[root@fjs-0-07 ~]# perl -wc /usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm
Can't open perl script "/usr/lib/perl5/site_perl/5.8.5/NOCpulse/SatConfig/GenerateConfig.pm": No such file or directory
[root@fjs-0-07 ~]# 
[root@fjs-0-07 ~]# ls /usr/lib/perl5/site_perl/5.8.5/NOCpulse
ls: /usr/lib/perl5/site_perl/5.8.5/NOCpulse: No such file or directory
[root@fjs-0-07 ~]# 
[root@fjs-0-07 ~]# 
[root@fjs-0-07 ~]# ls /usr/lib/perl5/site_perl/5.8.5/
i386-linux-thread-multi
Comment 4 Miroslav Suchý 2009-02-09 11:08:45 EST
The path may change due to perl. Try to do:
  pmpath NOCpulse::SatConfig::GenerateConfig
or 
  locate NOCpulse/SatConfig/GenerateConfig.pm
In REHL 5.3 it will be probably 
  /usr/lib/perl5/site_perl/5.8.8/NOCpulse/SatConfig/GenerateConfig.pm
Comment 5 Preethi Thomas 2009-02-09 14:59:15 EST
verified
[root@fjs-0-07 ~]# locate NOCpulse/SatConfig/GenerateConfig.pm/usr/lib/perl5/vendor_perl/5.8.8/NOCpulse/SatConfig/GenerateConfig.pm
[root@fjs-0-07 ~]# 
[root@fjs-0-07 ~]# 
[root@fjs-0-07 ~]# 
[root@fjs-0-07 ~]# perl -wc /usr/lib/perl5/vendor_perl/5.8.8/NOCpulse/SatConfig/GenerateConfig.pm
/usr/lib/perl5/vendor_perl/5.8.8/NOCpulse/SatConfig/GenerateConfig.pm syntax OK
[root@fjs-0-07 ~]#
Comment 6 Jan Pazdziora 2009-08-31 09:22:23 EDT
[root@xen5 ~]# perl -wc /usr/lib/perl5/vendor_perl/5.8.8/NOCpulse/SatConfig/GenerateConfig.pm
/usr/lib/perl5/vendor_perl/5.8.8/NOCpulse/SatConfig/GenerateConfig.pm syntax OK
[root@xen5 ~]# head -2 /var/log/rhn/rhn-installation.log
Installation log of Red Hat Network Satellite 5.3.0
(Satellite-5.3.0-RHEL5-re20090730.0)
[root@xen5 ~]# 

Stage validated -> RELEASE_PENDING.
Comment 7 Brandon Perkins 2009-09-10 14:48:02 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

Note You need to log in before you can comment on or make changes to this bug.