Revision b7e79bf3 snf-cyclades-app/synnefo/logic/subnets.py
b/snf-cyclades-app/synnefo/logic/subnets.py | ||
---|---|---|
148 | 148 |
return sub |
149 | 149 |
|
150 | 150 |
|
151 |
def get_subnet(sub_id, prefetch_related=False):
|
|
151 |
def get_subnet(sub_id): |
|
152 | 152 |
"""Show info of a specific subnet""" |
153 | 153 |
log.debug('get_subnet %s', sub_id) |
154 | 154 |
try: |
155 | 155 |
subnets = Subnet.objects |
156 |
if prefetch_related: |
|
157 |
subnets = subnets.select_related("network") |
|
158 |
subnets = subnets.prefetch_related("ip_pools") |
|
159 | 156 |
return subnets.get(id=sub_id) |
160 | 157 |
except Subnet.DoesNotExist: |
161 | 158 |
raise api.faults.ItemNotFound("Subnet not found") |
Also available in: Unified diff