[node-patches] Change in ovirt-node[master]: add return value when persist command does not return an err...

baichm at linux.vnet.ibm.com baichm at linux.vnet.ibm.com
Wed May 15 03:15:18 UTC 2013


Changming Bai has uploaded a new change for review.

Change subject: add return value when persist command does not return an error code on failure
......................................................................

add return value when persist command does not return an error code on failure

When persist command execute failure, the return also rc=0.
There are 4 different case that "fail" persist, each of them will heave a different return.
We expect this function to return an error code for all error cases not just success,
Return rc=3/4/5/6 codes should exist for all returns which yield a text error message.

Change-Id: I458adeddeb17f63c5d003db808044ad6c8e9e097
Signed-off-by: Changming Bai <baichm at linux.vnet.ibm.com>
---
M scripts/ovirt-functions.in
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/37/14737/1

diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in
index 55a92f0..2246dd9 100644
--- a/scripts/ovirt-functions.in
+++ b/scripts/ovirt-functions.in
@@ -663,11 +663,13 @@
                 # persisting top-level folder makes trouble rhbz#611617
                 printf "Cannot persist system folder: ${filename}\n"
                 persist_it=false
+                rc=3
             elif [ -d $filename ]; then
                 if [ -d /config$filename ]; then
                     printf "Directory already persisted: ${filename}\n"
                     printf "You need to unpersist its child directories and/or files and try again.\n"
                     persist_it=false
+                    rc=4
                 fi
             elif [ -f $filename ]; then
                 if [ -f /config$filename ]; then
@@ -676,6 +678,7 @@
                     if [ "$md5root" = "$md5stored" ]; then
                         printf "File already persisted: ${filename}\n"
                         persist_it=false
+                        rc=5
                     else
                         # persistent copy needs refresh
                         umount -n $filename 2> /dev/null || :
@@ -685,6 +688,7 @@
             else
                 printf "Cannot persist: ${filename}\n"
                 persist_it=false
+                rc=6
             fi
 
             if $persist_it; then


--
To view, visit http://gerrit.ovirt.org/14737
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I458adeddeb17f63c5d003db808044ad6c8e9e097
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Changming Bai <baichm at linux.vnet.ibm.com>



More information about the node-patches mailing list