Commit d6e9345e authored by Arie Peterson's avatar Arie Peterson 🐚
Browse files

Use lsblk instead of blkid in driver

parent b30f3f6e
......@@ -85,7 +85,7 @@ ghostAction() {
attach) ;&
detach) ;;
*)
output "{\"status\": \"Unsupported action\"}"
output "Unsupported action"
exit 0
esac
local url="${server}/api/v2/disks/$diskImage/actions"
......@@ -152,7 +152,7 @@ domount() {
device="/dev/xvd${diskLetter}1"
debug "device: $device"
# Use the `blkid` program to scan the device for an existing filesystem.
existingFileSystem=$(blkid "$device")
existingFileSystem=$(lsblk -n -o FSTYPE "$device")
debug "blkid: $existingFileSystem"
if [[ -z "$existingFileSystem" ]]
then
......@@ -167,7 +167,7 @@ domount() {
# Mount the virtual block device at the given mount point.
mount "$device" "$mountPath" >/dev/null 2>&1
output "{\"status\":\"Success\"}"
output "Success"
exit 0
}
......@@ -181,7 +181,7 @@ unmount() {
# enough information to do so. Instead, we do a just-in-time detach when
# the disk is attached later on.
output "{\"status\":\"Success\"}"
output "Success"
exit 0
}
......@@ -191,7 +191,7 @@ op=$1
if [[ "$op" = "init" ]]
then
debug "init $@"
output "{\"status\":\"Success\",\"capabilities\":{\"attach\":false}}"
echo "{\"status\":\"Success\",\"capabilities\":{\"attach\":false}}" >&1
exit 0
fi
......@@ -206,6 +206,6 @@ case "$op" in
;;
*)
debug "not supported: $op $*"
output "{\"status\":\"Not supported\"}"
echo "{\"status\":\"Not supported\"}" >&1
exit 0
esac
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