mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Improving ynh_lxc_snapshot_exists
This commit is contained in:
parent
8f91c6e28c
commit
f35d08db03
1 changed files with 11 additions and 1 deletions
12
lib/ynh_lxd
12
lib/ynh_lxd
|
@ -369,7 +369,17 @@ ynh_lxc_snapshot_exists () {
|
|||
# If the container exists
|
||||
if ynh_lxc_exists --name=$name
|
||||
then
|
||||
lxc list --format json | jq -e --arg name $name --arg snapname $snapname '.[] | select(.name==$name) | .snapshots[] | select(.name==$snapname)' >/dev/null
|
||||
if lxc list --format json | jq -e --arg name $name --arg snapname $snapname '.[] | select(.name==$name) | .snapshots' >/dev/null
|
||||
then
|
||||
if lxc list --format json | jq -e --arg name $name --arg snapname $snapname '.[] | select(.name==$name) | .snapshots[] | select(.name==$snapname)' >/dev/null
|
||||
then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue