Commit 644e18ef authored by Sebastien Gougeaud's avatar Sebastien Gougeaud Committed by Thomas Leibovici
Browse files

cli: remove target file if get request fails



When an error occured during a get request, the empty created file
which was supposed to get the retrieved data was not removed.
It now is.

Change-Id: I393063e4ee68873ce31730c19953d82549e435fa
Signed-off-by: default avatarSebastien Gougeaud <sebastien.gougeaud@cea.fr>
Reviewed-on: https://gerrit.ccc.ocre.cea.fr/gerrit/6701


Reviewed-by: Linter
Reviewed-by: default avatarQuentin Bouget <quentin.bouget@cea.fr>
Tested-by: default avatarJenkins s8open_nr <s8open_nr@ccc.ocre.cea.fr>
Reviewed-by: default avatarThomas Leibovici <thomas.leibovici@cea.fr>
parent 54a29ae5
......@@ -290,6 +290,8 @@ class Client(object):
rc = self._store.phobos_xfer(LIBPHOBOS.phobos_get,
self.get_session, compl_cb)
if rc:
for desc in self.get_session:
os.remove(desc[1])
raise IOError(rc, "Cannot retrieve objects")
if self.put_session:
......
......@@ -202,7 +202,6 @@ function get_tape_simple
# when selecting one
# $LOG_VALG $phobos get $id /tmp/out &&
# error "Should not be able to get objects without unlocked device"
# rm /tmp/out
# resources are available
$LOG_VALG $phobos drive unlock ${DRIVE_ARRAY[0]}
......@@ -214,7 +213,6 @@ function get_tape_simple
$LOG_VALG $phobos tape lock ${TAPE_ARRAY[0]}
$LOG_VALG $phobos get $id /tmp/out &&
error "Should not be able to get objects without unlocked medium"
rm /tmp/out
return 0
}
......@@ -232,7 +230,6 @@ function get_dir_simple
$LOG_VALG $phobos dir lock ${DIR_ARRAY[0]}
$LOG_VALG $phobos get $id /tmp/out &&
error "Should not be able to get objects without unlocked medium"
rm /tmp/out
return 0
}
......@@ -251,7 +248,6 @@ function get_tape_raid
# $LOG_VALG $phobos drive lock ${DRIVE_ARRAY[1]}
# $LOG_VALG $phobos get $id /tmp/out &&
# error "Should not be able to get objects without unlocked devices"
# rm /tmp/out
# resources are available
$LOG_VALG $phobos drive unlock ${DRIVE_ARRAY[@]}
......@@ -268,7 +264,6 @@ function get_tape_raid
$LOG_VALG $phobos tape lock ${TAPE_ARRAY[1]}
$LOG_VALG $phobos get $id /tmp/out &&
error "Should not be able to get objects without unlocked media"
rm /tmp/out
return 0
}
......@@ -291,7 +286,6 @@ function get_dir_raid
$LOG_VALG $phobos dir lock ${DIR_ARRAY[1]}
$LOG_VALG $phobos get $id /tmp/out &&
error "Should not be able to get objects without unlocked medium"
rm /tmp/out
return 0
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment