Bug 253506 - Excessive "my" declaration in GenerateConfig.pm
Summary: Excessive "my" declaration in GenerateConfig.pm
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Monitoring
Version: 500
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Preethi Thomas
Keywords: EasyFix
Depends On:
Blocks: 463877
TreeView+ depends on / blocked
Reported: 2007-08-20 10:41 UTC by Miroslav Suchý
Modified: 2009-09-10 18:48 UTC (History)
2 users (show)

Clone Of:
Last Closed: 2009-09-10 18:48:02 UTC

Attachments (Terms of Use)

Description Miroslav Suchý 2007-08-20 10:41:54 UTC
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):

How reproducible:

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 @@

         # 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 12:50:15 UTC
Commited as 7138fb790eecbe6de2dd10570e56528437c52e2e

Comment 2 Miroslav Suchý 2009-01-28 10:25:18 UTC
Mass moving to ON_QA.

Comment 3 Preethi Thomas 2009-02-09 15:05:39 UTC
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/

Comment 4 Miroslav Suchý 2009-02-09 16:08:45 UTC
The path may change due to perl. Try to do:
  pmpath NOCpulse::SatConfig::GenerateConfig
  locate NOCpulse/SatConfig/GenerateConfig.pm
In REHL 5.3 it will be probably 

Comment 5 Preethi Thomas 2009-02-09 19:59:15 UTC
[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 13:22:23 UTC
[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
[root@xen5 ~]# 

Stage validated -> RELEASE_PENDING.

Comment 7 Brandon Perkins 2009-09-10 18:48:02 UTC
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.


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