mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-13 12:58:17 +03:00
feature #2097: Re-add disk_type function
This commit is contained in:
parent
33534d08f8
commit
5a65047227
@ -76,3 +76,22 @@ function make_relative {
|
|||||||
|
|
||||||
echo $dots${src#$common/}
|
echo $dots${src#$common/}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Return DISK_TYPE
|
||||||
|
function disk_type
|
||||||
|
{
|
||||||
|
# Let's check if it is a CDROM
|
||||||
|
DISK_ID=$(echo "$DST_PATH" | $AWK -F. '{print $NF}')
|
||||||
|
XPATH="${ONE_LOCAL_VAR}/remotes/datastore/xpath.rb --stdin"
|
||||||
|
|
||||||
|
unset i XPATH_ELEMENTS
|
||||||
|
|
||||||
|
while IFS= read -r -d '' element; do
|
||||||
|
XPATH_ELEMENTS[i++]="$element"
|
||||||
|
done < <(onevm show -x $VMID| $XPATH \
|
||||||
|
/VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/TYPE )
|
||||||
|
|
||||||
|
DISK_TYPE="${XPATH_ELEMENTS[0]}"
|
||||||
|
|
||||||
|
echo $DISK_TYPE
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user