Alan Pevec
2009-Apr-08 10:02 UTC
[Ovirt-devel] [PATCH node] always use absolute path for persistent files
Signed-off-by: Alan Pevec <apevec at redhat.com> --- scripts/ovirt-functions | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 4024efa..a3991c0 100755 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -408,11 +408,12 @@ ovirt_store_config() { rc=0 if grep -q " /config ext3" /proc/mounts; then printf "storing to /config :\n" - for f in "$@"; do + for p in "$@"; do + f=$(readlink -f $p) printf "$f" # skip if file does not exist or is empty - if [ ! -s $f ]; then - printf " Skipping, file does not exist or is empty\n" + if [ ! -s "$f" ]; then + printf " Skipping, file '%s' does not exist or is empty\n" $p continue fi # skip if already bind-mounted -- 1.6.0.6
Darryl L. Pierce
2009-Apr-08 12:23 UTC
[Ovirt-devel] [PATCH node] always use absolute path for persistent files
On Wed, Apr 08, 2009 at 12:02:20PM +0200, Alan Pevec wrote:> Signed-off-by: Alan Pevec <apevec at redhat.com> > --- > scripts/ovirt-functions | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 4024efa..a3991c0 100755 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -408,11 +408,12 @@ ovirt_store_config() { > rc=0 > if grep -q " /config ext3" /proc/mounts; then > printf "storing to /config :\n" > - for f in "$@"; do > + for p in "$@"; do > + f=$(readlink -f $p) > printf "$f" > # skip if file does not exist or is empty > - if [ ! -s $f ]; then > - printf " Skipping, file does not exist or is empty\n" > + if [ ! -s "$f" ]; then > + printf " Skipping, file '%s' does not exist or is empty\n" $p > continue > fi > # skip if already bind-mountedACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ Is fearr Gaeilge bhriste n? B?arla cliste. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090408/787ccd29/attachment.sig>