From 87fb0fdddca057af72b5caa05b6652577dd67964 Mon Sep 17 00:00:00 2001 From: ligc Date: Wed, 15 Dec 2010 01:47:06 +0000 Subject: [PATCH] fix for bug 3136752: add internal flag --nocache to *def commands git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8401 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/perl-xCAT.spec | 3 +++ perl-xCAT/xCAT/DBobjUtils.pm | 7 +++++-- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec index 8d0b0780a..46f9bca6a 100644 --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -15,6 +15,9 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch Requires: perl-SOAP-Lite %endif +%ifarch ppc64 +Requires: perl-IO-Stty +%endif Provides: perl-xCAT = %{epoch}:%{version} diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index ef4e745c1..986bd2f11 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -54,7 +54,9 @@ sub getObjectsOfType return @objlist; } - if ($::saveObjList{$type}) + # The database may be changed between getObjectsOfType calls + # do not use cache %::saveObjList if --nocache is specified + if ($::saveObjList{$type} && !$::opt_c) { @objlist = @{$::saveObjList{$type}}; } @@ -564,7 +566,8 @@ sub getDBtable my @rows = []; # save this table info - in case this subr gets called multiple times - if (grep(/^$table$/, @::foundTableList)) + # --nocache flag specifies not to use cahe + if (grep(/^$table$/, @::foundTableList) && !$::opt_c) { # already have this diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index a6829a77e..053dbf43f 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -239,7 +239,8 @@ sub processArgs 'version|v' => \$::opt_v, 'w=s@' => \$::opt_w, 'x|xml' => \$::opt_x, - 'z|stanza' => \$::opt_z + 'z|stanza' => \$::opt_z, + 'nocache' => \$::opt_c ) ) {