From 2911e9cb3acf7c7129943efc4458a1c26154a170 Mon Sep 17 00:00:00 2001 From: linggao Date: Mon, 19 Sep 2011 21:05:28 +0000 Subject: [PATCH] make sure osimage.provmethod=statelite when calling liteimg command, defect 3409362 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.6@10561 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/statelite.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index 2ff16d761..9849060ed 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -114,13 +114,19 @@ sub process_request { return; } # get the os, arch, and profile from the image name table. - (my $ref) = $osimagetab->getAttribs({imagename => $imagename}, 'rootfstype', 'osvers', 'osarch', 'profile'); + (my $ref) = $osimagetab->getAttribs({imagename => $imagename}, 'rootfstype', 'osvers', 'osarch', 'profile','provmethod'); if (!$ref) { $callback->({error=>["Cannot find image \'$imagename\' from the osimage table."],errorcode=>[1]}); return; } - $rootfstype = $ref->{'rootfstype'}; + my $provmethod=$ref->{'provmethod'}; + if ($provmethod !~ /statelite/) { + $callback->({error=>["Please make sure that osimage.provmethod is set to statelite before calling this command."],errorcode=>[1]}); + return; + } + + $rootfstype = $ref->{'rootfstype'}; $osver=$ref->{'osvers'}; $arch=$ref->{'osarch'}; $profile=$ref->{'profile'};