From: <li...@us...> - 2011-03-02 06:36:30
|
Revision: 8959 http://xcat.svn.sourceforge.net/xcat/?rev=8959&view=rev Author: ligc Date: 2011-03-02 06:36:24 +0000 (Wed, 02 Mar 2011) Log Message: ----------- fix for bug 3196468: initialize global variables Modified Paths: -------------- xcat-core/trunk/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm Modified: xcat-core/trunk/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm =================================================================== --- xcat-core/trunk/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm 2011-03-02 06:04:15 UTC (rev 8958) +++ xcat-core/trunk/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm 2011-03-02 06:36:24 UTC (rev 8959) @@ -133,6 +133,7 @@ my $ret; my $msg; + &initialize_variables(); # globals used by all subroutines. $::command = $::request->{command}->[0]; $::args = $::request->{arg}; @@ -262,19 +263,7 @@ # Initialize some global arrays in case this is being called twice in the same process. # Currently only doing this when --nocache is specified, but i think it should be done all of the time. if ($::opt_c) { - %::CLIATTRS = (); - %::FILEATTRS = (); - %::FINALATTRS = (); - %::objfilehash = (); - %::WhereHash = (); - @::AttrList = (); - @::clobjtypes = (); - @::fileobjtypes = (); - @::clobjnames = (); - @::fileobjnames = (); - @::objfilelist = (); - @::allobjnames = (); - @::noderange = (); + &initialize_variables(); } # opt_x not yet supported @@ -3438,5 +3427,38 @@ return 0; } +#---------------------------------------------------------------------------- + +=head3 initialize_variables + Initialize the global variables + + Arguments: + Returns: + Globals: + + Error: + + Example: + + Comments: +=cut + +#----------------------------------------------------------------------------- +sub initialize_variables +{ + %::CLIATTRS = (); + %::FILEATTRS = (); + %::FINALATTRS = (); + %::objfilehash = (); + %::WhereHash = (); + @::AttrList = (); + @::clobjtypes = (); + @::fileobjtypes = (); + @::clobjnames = (); + @::fileobjnames = (); + @::objfilelist = (); + @::allobjnames = (); + @::noderange = (); +} 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |