On 01/30/2015 08:35 AM, Aline Manera wrote:
Question: does libvirt supports delete a non-persistent network or
storage pool? Is that restriction only for guests?
For storage pools, you can't delete an active pool. Since deactivating a
transient pool removes it, you'll never be given the option of deleting
a transient pool. IOW, it's not something we need to take into account.
For networks, there is no delete. There's only destroy.
So, yes, this restriction need only be enforced for guests.
On 27/01/2015 16:39, Christy Perez wrote:
> Set the Deactivate action as a destructive one so that the GET
> will not be called for transient networks afterward.
> Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
> src/kimchi/control/networks.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> diff --git a/src/kimchi/control/networks.py
> index 7cb1572..22fc3bb 100644
> --- a/src/kimchi/control/networks.py
> +++ b/src/kimchi/control/networks.py
> @@ -20,7 +20,6 @@
> from kimchi.control.base import Collection, Resource
> from kimchi.control.utils import UrlSubNode
> @UrlSubNode('networks', True)
> class Networks(Collection):
> def __init__(self, model):
> @@ -37,7 +36,8 @@ def __init__(self, model, ident):
> self.admin_methods = ['PUT', 'POST', 'DELETE']
> self.uri_fmt = "/networks/%s"
> self.activate = self.generate_action_handler('activate')
> - self.deactivate = self.generate_action_handler('deactivate')
> + self.deactivate = self.generate_action_handler('deactivate', \
> + destructive=True)
> def data(self):