From a3ade8608b5e546b198e38c88543564f80a9eace Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 10 Jan 2014 09:15:50 -0500 Subject: [PATCH] fix the issue that proxydhcp configuration file cannot be updated --- xCAT-server/lib/xcat/plugins/windows.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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]}); } } }