diff --git a/xCAT-server/lib/xcat/plugins/windows.pm b/xCAT-server/lib/xcat/plugins/windows.pm index 776a89464..7592b9854 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -648,13 +648,18 @@ sub mkinstall # generate the winpe path configuration file for proxydhcp daemon if ($dowinpecfg) { - open (FILE, ">/var/lib/xcat/proxydhcp.cfg"); - print FILE $winpepathcfg; - close (FILE); - - if (open (PDPID, "; - kill 10, $pdpid; + unless (-d "/var/lib/xcat/") { + mkpath "/var/lib/xcat/"; + } + if (open (FILE, ">/var/lib/xcat/proxydhcp.cfg")) { + print FILE $winpepathcfg; + close (FILE); + if (open (PDPID, "; + kill 10, $pdpid; + } + } else { + $callback->({error=>["Cannot open /var/lib/xcat/proxydhcp.cfg for update."],errorcode=>[1]}); } } }