summaryrefslogtreecommitdiffstats
path: root/client/shared
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2018-03-28 11:20:36 +0000
committeririna <irinagomez@us.es>2018-03-28 11:20:36 +0000
commit305c2563a96d76587329a463132d95a3b11c45fe (patch)
treeaec813a4bc2603ca3ebaacebe6af82ec99bb61b5 /client/shared
parent6bb748bfd6df24cf0fd7b2b6fe03f889e3ba336e (diff)
Se corrigen erratas por usar el código de error de ogGetPath
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5688 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared')
-rwxr-xr-xclient/shared/scripts/createDiffImage3
-rwxr-xr-xclient/shared/scripts/deployImage3
-rwxr-xr-xclient/shared/scripts/restoreBaseImage3
-rwxr-xr-xclient/shared/scripts/restoreDiffImage3
-rwxr-xr-xclient/shared/scripts/updateCache6
5 files changed, 12 insertions, 6 deletions
diff --git a/client/shared/scripts/createDiffImage b/client/shared/scripts/createDiffImage
index d5f897be..79ee9726 100755
--- a/client/shared/scripts/createDiffImage
+++ b/client/shared/scripts/createDiffImage
@@ -76,7 +76,8 @@ ogIsImageLocked "$3" "$5.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED
ogIsLocked "$1" "$2" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $2"; echo $?)
# Comprobar si la imagen completa existe.
-IMGFILE="$(ogGetPath "$3" "$4.$IMGEXT")" || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$3 $4.$IMGEXT"; echo $?)
+IMGFILE="$(ogGetPath "$3" "$4.$IMGEXT")"
+[ -n "$IMGFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$3 $4.$IMGEXT"; echo $?)
# Comprobar que la imagen completa es sincronizable
ogIsSyncImage "$3" "$4" "img" || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$3 $4"; echo $?)
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
index 51847110..824da2af 100755
--- a/client/shared/scripts/deployImage
+++ b/client/shared/scripts/deployImage
@@ -97,7 +97,8 @@ else
fi
#Informacioin previa de la imagen
-IMGOS=$(ogGetImageInfo `ogGetPath $MODE $IMGNAME.img`) || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2"; echo $?)
+IMGOS=$(ogGetImageInfo `ogGetPath $MODE $IMGNAME.img`)
+[ -n "$IMGOS" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "$REPO $2"; echo $?)
IMGSIZE=$(ls -s `ogGetPath $MODE $IMGNAME.img`| cut -f1 -d" ")
ogEcho log session "[1] REPO=$REPO IMG-FILE=$IMGNAME.img SIZE=$IMGSIZE (KB) METADATA=$IMGOS"
diff --git a/client/shared/scripts/restoreBaseImage b/client/shared/scripts/restoreBaseImage
index 2d7e46de..0b291518 100755
--- a/client/shared/scripts/restoreBaseImage
+++ b/client/shared/scripts/restoreBaseImage
@@ -58,7 +58,8 @@ fi
[ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg
# Procesar parámetros de entrada
-REPOFILE="$(ogGetPath "REPO" "$2.$IMGEXT")" || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO, $2.$IMGEXT"; echo $?)
+REPOFILE="$(ogGetPath "REPO" "$2.$IMGEXT")"
+[ -n "$REPOFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO, $2.$IMGEXT"; echo $?)
# Comprobar que es sincronizable (con REPO)
ogIsSyncImage REPO "$2" $IMGEXT || exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "$1 $2"; echo $?)
diff --git a/client/shared/scripts/restoreDiffImage b/client/shared/scripts/restoreDiffImage
index bf333bd8..7d16ef90 100755
--- a/client/shared/scripts/restoreDiffImage
+++ b/client/shared/scripts/restoreDiffImage
@@ -59,7 +59,8 @@ ogEcho log session "[1] $MSG_SCRIPTS_START $0 $*"
# Procesar parámetros de entrada
DIFFTYPE="diff"
DIFFEXT="img.diff"
-REPODIFFFILE="$(ogGetPath "REPO" "$3.$DIFFEXT")" || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO $3.$DIFFEXT";echo $?)
+REPODIFFFILE="$(ogGetPath "REPO" "$3.$DIFFEXT")"
+[ -n "$REPODIFFFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO $3.$DIFFEXT";echo $?)
# Comprobamos si la imagen o la particion estan bloqueada:
ogIsImageLocked "$1" "$3.$DIFFEXT" && exit $(ogRaiseError session $OG_ERR_LOCKED "$1 $3.$DIFFEXT";echo $?)
diff --git a/client/shared/scripts/updateCache b/client/shared/scripts/updateCache
index 7c3f4534..0632365f 100755
--- a/client/shared/scripts/updateCache
+++ b/client/shared/scripts/updateCache
@@ -85,7 +85,8 @@ if ! $(ogFindCache >/dev/null); then
fi
# comprobar si la imagen existe (.img, .img.diff o directorio)
-REPOFILE=$(ogGetPath "REPO" "/$2") || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO /$2"; echo $?)
+REPOFILE=$(ogGetPath "REPO" "/$2")
+[ -n "$REPOFILE" ] || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO /$2"; echo $?)
ogEcho log session "$MSG_SCRIPTS_UPDATECACHE_DOUPDATE"
# Distingo si es monolitica o sincronizable
@@ -93,7 +94,8 @@ file "$REPOFILE" | grep -i -e " BTRFS Filesystem " -e " ext4 filesystem " -e " d
if [ $? == 0 ]; then
IMGSYNC=TRUE
# Para imagen sincronizada, si hay imagen en cache siempre protocolo = rsync.
- CACHEFILE="$(ogGetPath "CACHE" "/$2")" && PROTOCOLO="RSYNC"
+ CACHEFILE="$(ogGetPath "CACHE" "/$2")"
+ [ -n "$CACHEFILE" ] && PROTOCOLO="RSYNC"
# Si es sincronizada tipo directorio siempre protocolo = rsync.
[ -d $REPOFILE ] && PROTOCOLO="RSYNC" && IMGTYPE="dir"