Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
8d988bfd
Commit
8d988bfd
authored
Nov 25, 2013
by
Dionysis Grigoropoulos
Committed by
Christos Stavrakakis
Nov 25, 2013
Browse files
cyclades: Verbal fixes on some snf-manage commands
parent
09bc0fab
Changes
5
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/management/commands/floating-ip-remove.py
View file @
8d988bfd
...
...
@@ -41,16 +41,18 @@ from synnefo.logic import ips
class
Command
(
RemoveCommand
):
args
=
"<Floating-IP ID or Floating-IP IDs>"
help
=
"Release a floating IP"
@
common
.
convert_api_faults
@
transaction
.
commit_on_success
def
handle
(
self
,
*
args
,
**
options
):
if
not
args
:
raise
CommandError
(
"Please provide a floating-ip
address
"
)
raise
CommandError
(
"Please provide a floating-ip
ID
"
)
force
=
options
[
'force'
]
self
.
confirm_deletion
(
force
,
"floating ip(s)"
,
args
)
message
=
"floating IPs"
if
len
(
args
)
>
1
else
"floating IP"
self
.
confirm_deletion
(
force
,
message
,
args
)
for
floating_ip_id
in
args
:
self
.
stdout
.
write
(
"
\n
"
)
...
...
snf-cyclades-app/synnefo/api/management/commands/network-remove.py
View file @
8d988bfd
...
...
@@ -37,6 +37,7 @@ from synnefo.management.common import get_network, convert_api_faults
class
Command
(
RemoveCommand
):
can_import_settings
=
True
args
=
"<Network ID or Network IDs>"
help
=
"Remove a network from the Database, and Ganeti"
@
convert_api_faults
...
...
@@ -45,7 +46,8 @@ class Command(RemoveCommand):
raise
CommandError
(
"Please provide a network ID"
)
force
=
options
[
'force'
]
self
.
confirm_deletion
(
force
,
"network(s)"
,
args
)
message
=
"networks"
if
len
(
args
)
>
1
else
"network"
self
.
confirm_deletion
(
force
,
message
,
args
)
for
network_id
in
args
:
self
.
stdout
.
write
(
"
\n
"
)
...
...
snf-cyclades-app/synnefo/api/management/commands/port-remove.py
View file @
8d988bfd
...
...
@@ -38,6 +38,7 @@ from snf_django.management.commands import RemoveCommand
class
Command
(
RemoveCommand
):
can_import_settings
=
True
args
=
"<Port ID or Port IDs>"
help
=
"Remove a port from the Database and from the VMs attached to"
option_list
=
RemoveCommand
.
option_list
+
(
make_option
(
...
...
@@ -55,7 +56,8 @@ class Command(RemoveCommand):
raise
CommandError
(
"Please provide a port ID"
)
force
=
options
[
'force'
]
self
.
confirm_deletion
(
force
,
"port(s)"
,
args
)
message
=
"ports"
if
len
(
args
)
>
1
else
"port"
self
.
confirm_deletion
(
force
,
message
,
args
)
for
port_id
in
args
:
self
.
stdout
.
write
(
"
\n
"
)
...
...
snf-cyclades-app/synnefo/api/management/commands/server-remove.py
View file @
8d988bfd
...
...
@@ -43,7 +43,7 @@ from snf_django.lib.api import faults
class
Command
(
RemoveCommand
):
args
=
"<server ID>"
args
=
"<server ID
or server IDs
>"
help
=
"Remove a server by deleting the instance from the Ganeti backend."
option_list
=
RemoveCommand
.
option_list
+
(
...
...
@@ -62,7 +62,8 @@ class Command(RemoveCommand):
raise
CommandError
(
"Please provide a server ID"
)
force
=
options
[
'force'
]
self
.
confirm_deletion
(
force
,
"server(s)"
,
args
)
message
=
"servers"
if
len
(
args
)
>
1
else
"server"
self
.
confirm_deletion
(
force
,
message
,
args
)
for
server_id
in
args
:
self
.
stdout
.
write
(
"
\n
"
)
...
...
snf-django-lib/snf_django/management/commands/__init__.py
View file @
8d988bfd
...
...
@@ -355,4 +355,5 @@ class RemoveCommand(BaseCommand):
if
answer
!=
1
:
raise
CommandError
(
"Aborting deletion"
)
except
ValueError
:
raise
CommandError
(
"Invalid Y/N value, aborting"
)
raise
CommandError
(
"Unaccepted input value. Please choose yes/no"
" (y/n)."
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment