Jim Meyering
2008-Apr-11 07:10 UTC
[Ovirt-devel] [PATCH] Error out early if tftpboot exists.
Ian Main <imain at redhat.com> wrote:>> This simple patch just adds a warning if tftpboot already exists before doing all the work to create a pxe boot image. I hadn't noticed the error a few times as it gets lost in the noise after all the other output it generates.Hi Ian, Good idea! If you put that code in the definition of the create_iso function, users of ovirt-cd.sh, ovirt-flash.sh, and ovirt-flash-static.sh scripts will benefit, too.> diff --git a/ovirt-host-creator/ovirt-pxe.sh b/ovirt-host-creator/ovirt-pxe.sh > index 8db83bf..022eec9 100755 > --- a/ovirt-host-creator/ovirt-pxe.sh > +++ b/ovirt-host-creator/ovirt-pxe.sh > @@ -28,6 +28,12 @@ else > exit 1 > fi > > +if [ -e tftpboot ]; then > + echo "tftboot/ directory already exists! Cowardly not overwriting." > + echo "Please rename or delete old version prior to running this script." > + exit 1 > +fi > + > ISO=`create_iso $ISO` || exit 1 > > /usr/bin/livecd-iso-to-pxeboot $ISO
Alan Pevec
2008-Apr-11 07:36 UTC
[Ovirt-devel] [PATCH] Error out early if tftpboot exists.
Jim Meyering wrote:> If you put that code in the definition of the create_iso function, > users of ovirt-cd.sh, ovirt-flash.sh, and ovirt-flash-static.sh scripts > will benefit, too.But only ovirt-pxe.sh cares about tftpboot/ right? Otherwise we're fine since iso filename includes timestamp.>> diff --git a/ovirt-host-creator/ovirt-pxe.sh b/ovirt-host-creator/ovirt-pxe.sh >> index 8db83bf..022eec9 100755 >> --- a/ovirt-host-creator/ovirt-pxe.sh >> +++ b/ovirt-host-creator/ovirt-pxe.sh >> @@ -28,6 +28,12 @@ else >> exit 1 >> fi >> >> +if [ -e tftpboot ]; then >> + echo "tftboot/ directory already exists! Cowardly not overwriting."^^^ p missing>> + echo "Please rename or delete old version prior to running this script." >> + exit 1 >> +fi >> +