Revision b14725eb snf-cyclades-app/synnefo/api/networks.py
b/snf-cyclades-app/synnefo/api/networks.py | ||
---|---|---|
48 | 48 |
NetworkInUse, OverLimit) |
49 | 49 |
from synnefo.db.models import Network, Pool |
50 | 50 |
from synnefo.logic import backend |
51 |
from synnefo.settings import MAX_CIDR_BLOCK |
|
52 | 51 |
|
53 | 52 |
|
54 | 53 |
log = getLogger('synnefo.api') |
... | ... | |
179 | 178 |
raise OverLimit('Network count limit exceeded for your account.') |
180 | 179 |
|
181 | 180 |
cidr_block = int(subnet.split('/')[1]) |
182 |
if cidr_block <= MAX_CIDR_BLOCK: |
|
183 |
raise OverLimit("Network size is to big. Please specify a network" |
|
184 |
" smaller than /" + str(MAX_CIDR_BLOCK) + '.') |
|
181 |
if not util.validate_network_size(cidr_block): |
|
182 |
raise OverLimit("Unsupported network size.") |
|
185 | 183 |
|
186 | 184 |
try: |
187 | 185 |
link = util.network_link_from_type(typ) |
Also available in: Unified diff