Revision d27b16cc
b/snf-cyclades-app/synnefo/api/management/commands/floating-ip-remove.py | ||
---|---|---|
41 | 41 |
|
42 | 42 |
|
43 | 43 |
class Command(RemoveCommand): |
44 |
args = "<Floating-IP ID or Floating-IP IDs>" |
|
44 | 45 |
help = "Release a floating IP" |
45 | 46 |
|
46 | 47 |
@common.convert_api_faults |
47 | 48 |
@transaction.commit_on_success |
48 | 49 |
def handle(self, *args, **options): |
49 | 50 |
if not args: |
50 |
raise CommandError("Please provide a floating-ip address")
|
|
51 |
raise CommandError("Please provide a floating-ip ID")
|
|
51 | 52 |
|
52 | 53 |
force = options['force'] |
53 |
self.confirm_deletion(force, "floating ip(s)", args) |
|
54 |
message = "floating IPs" if len(args) > 1 else "floating IP" |
|
55 |
self.confirm_deletion(force, message, args) |
|
54 | 56 |
|
55 | 57 |
for floating_ip_id in args: |
56 | 58 |
self.stdout.write("\n") |
b/snf-cyclades-app/synnefo/api/management/commands/network-remove.py | ||
---|---|---|
37 | 37 |
|
38 | 38 |
class Command(RemoveCommand): |
39 | 39 |
can_import_settings = True |
40 |
args = "<Network ID or Network IDs>" |
|
40 | 41 |
help = "Remove a network from the Database, and Ganeti" |
41 | 42 |
|
42 | 43 |
@convert_api_faults |
... | ... | |
45 | 46 |
raise CommandError("Please provide a network ID") |
46 | 47 |
|
47 | 48 |
force = options['force'] |
48 |
self.confirm_deletion(force, "network(s)", args) |
|
49 |
message = "networks" if len(args) > 1 else "network" |
|
50 |
self.confirm_deletion(force, message, args) |
|
49 | 51 |
|
50 | 52 |
for network_id in args: |
51 | 53 |
self.stdout.write("\n") |
b/snf-cyclades-app/synnefo/api/management/commands/port-remove.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
class Command(RemoveCommand): |
40 | 40 |
can_import_settings = True |
41 |
args = "<Port ID or Port IDs>" |
|
41 | 42 |
help = "Remove a port from the Database and from the VMs attached to" |
42 | 43 |
option_list = RemoveCommand.option_list + ( |
43 | 44 |
make_option( |
... | ... | |
55 | 56 |
raise CommandError("Please provide a port ID") |
56 | 57 |
|
57 | 58 |
force = options['force'] |
58 |
self.confirm_deletion(force, "port(s)", args) |
|
59 |
message = "ports" if len(args) > 1 else "port" |
|
60 |
self.confirm_deletion(force, message, args) |
|
59 | 61 |
|
60 | 62 |
for port_id in args: |
61 | 63 |
self.stdout.write("\n") |
b/snf-cyclades-app/synnefo/api/management/commands/server-remove.py | ||
---|---|---|
43 | 43 |
|
44 | 44 |
|
45 | 45 |
class Command(RemoveCommand): |
46 |
args = "<server ID>" |
|
46 |
args = "<server ID or server IDs>"
|
|
47 | 47 |
help = "Remove a server by deleting the instance from the Ganeti backend." |
48 | 48 |
|
49 | 49 |
option_list = RemoveCommand.option_list + ( |
... | ... | |
62 | 62 |
raise CommandError("Please provide a server ID") |
63 | 63 |
|
64 | 64 |
force = options['force'] |
65 |
self.confirm_deletion(force, "server(s)", args) |
|
65 |
message = "servers" if len(args) > 1 else "server" |
|
66 |
self.confirm_deletion(force, message, args) |
|
66 | 67 |
|
67 | 68 |
for server_id in args: |
68 | 69 |
self.stdout.write("\n") |
b/snf-django-lib/snf_django/management/commands/__init__.py | ||
---|---|---|
355 | 355 |
if answer != 1: |
356 | 356 |
raise CommandError("Aborting deletion") |
357 | 357 |
except ValueError: |
358 |
raise CommandError("Invalid Y/N value, aborting") |
|
358 |
raise CommandError("Unaccepted input value. Please choose yes/no" |
|
359 |
" (y/n).") |
Also available in: Unified diff