From b58e374758c01f6f7581e73cffcc384527fe06ea 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 ea3005a05..f03851f3a 100644 --- a/xCAT-server/lib/xcat/plugins/windows.pm +++ b/xCAT-server/lib/xcat/plugins/windows.pm @@ -654,13 +654,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]}); } } }