Revision a6e6fe48 snf-cyclades-app/synnefo/logic/management/commands/floating-ip-create.py
b/snf-cyclades-app/synnefo/logic/management/commands/floating-ip-create.py | ||
---|---|---|
1 |
# Copyright 2012 GRNET S.A. All rights reserved. |
|
1 |
# Copyright 2012-2014 GRNET S.A. All rights reserved.
|
|
2 | 2 |
# |
3 | 3 |
# Redistribution and use in source and binary forms, with or |
4 | 4 |
# without modification, are permitted provided that the following |
... | ... | |
71 | 71 |
raise CommandError("'owner' is required for floating IP creation") |
72 | 72 |
|
73 | 73 |
if network_id is not None: |
74 |
network = util.get_network(network_id, owner, for_update=True, |
|
75 |
non_deleted=True) |
|
74 |
network = util.get_resource("network", network_id, for_update=True) |
|
75 |
if network.deleted: |
|
76 |
raise CommandError("Network '%s' is deleted" % network.id) |
|
76 | 77 |
if not network.floating_ip_pool: |
77 | 78 |
raise CommandError("Network '%s' is not a floating IP pool." |
78 | 79 |
% network) |
Also available in: Unified diff