rbd_map_image() echoes the id of the image and is used in command
substitution:
id=$(rbd_map_image "${image}")
Output from rbd map isn't consumed and clobbers the return.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
local image="$1"
local id
- sudo rbd map "${image}" --user "${CEPH_ID}" ${SECRET_ARGS}
+ sudo rbd map "${image}" --user "${CEPH_ID}" ${SECRET_ARGS} \
+ > /dev/null 2>&1
id=$(rbd_image_id "${image}")
echo "${id}"
[ $# -eq 1 ] || exit 99
local id="$1"
- sudo rbd unmap "/dev/rbd${id}" > /dev/null 2>&1
+ sudo rbd unmap "/dev/rbd${id}"
}
function rbd_destroy_image() {