From 9ddfd08f243c04c070dfc5507edad73675340903 Mon Sep 17 00:00:00 2001 From: yinqing Date: Wed, 7 Aug 2013 11:32:13 +0800 Subject: [PATCH] #221180 There is no mechanism to prevent error message printed in kitimagepostdelete when disassociated kit with the image profile --- .../xcat/kits/kit_template/plugins/sample/imageprofile.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm index cb9324870..3f0059526 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm +++ b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm @@ -171,6 +171,12 @@ sub process_request { # Do the check my $imageprofile = parse_str_arg($request->{arg}->[0]); + if (! exists($request->{kitdata})) + { + $rsp->{data}->[0] = "Skipped running \"$command\" plugin command for \"$PLUGIN_KITNAME\" kit."; + xCAT::MsgUtils->message("I", $rsp, $callback); + return; + } my $kitdata = $request->{kitdata}; if (! defined($kitdata) && !($command eq "kitimagepostdelete")) { $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imageprofile]);