Commit d2aec456 authored by Dionysis Grigoropoulos's avatar Dionysis Grigoropoulos Committed by Christos Stavrakakis
Browse files

cyclades: Better handling of deleted subnets

* Fix a bug where snf-manage subnet-list printed deleted subnets too
* Fix a query, that also returned deleted subnets
parent 9e45f92f
......@@ -69,6 +69,7 @@ class Command(ListCommand):
object_class = Subnet
astakos_auth_url = ASTAKOS_AUTH_URL
astakos_token = ASTAKOS_TOKEN
deleted_field = "deleted"
FIELDS = {
"id": ("id", "ID of the subnet"),
......
......@@ -61,9 +61,9 @@ def list_subnets(user_id):
"""List all subnets of a user"""
log.debug('list_subnets %s', user_id)
user_subnets = Subnet.objects.filter((Q(network__userid=user_id) &
Q(network__public=False)) |
Q(network__public=True))
query = (((Q(network__userid=user_id) & Q(network__public=False)) |
Q(network__public=True)) & Q(deleted=False))
user_subnets = Subnet.objects.filter(query)
return user_subnets
......
Markdown is supported
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