From 5f8d3943462ed322f50e34d72515bd9cab5ae6c8 Mon Sep 17 00:00:00 2001 From: yinqing Date: Wed, 7 Aug 2013 11:30:21 +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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 212aa60e6..cd287a7dd 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)) { $kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imageprofile]); @@ -742,4 +748,4 @@ sub parse_list_arg { } -1; \ No newline at end of file +1;