Commit e382d4e1 authored by Dionysis Grigoropoulos's avatar Dionysis Grigoropoulos
Browse files

cyclades: Update argument names of snf-manage cmds

* Update various snf-manage commands to use "--user" instead of
"--owner/--userid/--user-id"
* Update server-create and server-import to use --flavor instead of
--flavor-id
* Update server-create and server-import to use --image instead of
--image-id
* Update subnet-create to use --network instead of --network-id
parent d94995d5
......@@ -36,7 +36,7 @@ class Command(SynnefoCommand):
"""
option_list = SynnefoCommand.option_list + (
make_option("--userid", dest="userid",
make_option("--user", dest="userid",
default=None,
help="Reconcile resources only for this user"),
make_option("--project",
......
......@@ -36,8 +36,8 @@ class Command(SynnefoCommand):
dest='address',
help="The address to be allocated"),
make_option(
'--owner',
dest='owner',
'--user',
dest='user',
default=None,
help='The owner of the floating IP'),
)
......@@ -49,10 +49,10 @@ class Command(SynnefoCommand):
network_id = options['network_id']
address = options['address']
owner = options['owner']
user = options['user']
if not owner:
raise CommandError("'owner' is required for floating IP creation")
if not user:
raise CommandError("'user' is required for floating IP creation")
if network_id is not None:
network = util.get_resource("network", network_id, for_update=True)
......@@ -64,7 +64,7 @@ class Command(SynnefoCommand):
else:
network = None
floating_ip = ips.create_floating_ip(userid=owner,
floating_ip = ips.create_floating_ip(userid=user,
network=network,
address=address)
......
......@@ -41,8 +41,8 @@ class Command(SynnefoCommand):
dest='name',
help="Name of the network"),
make_option(
'--owner',
dest='owner',
'--user',
dest='user',
help="The owner of the network"),
make_option(
'--subnet',
......@@ -146,7 +146,7 @@ class Command(SynnefoCommand):
link = options['link']
mac_prefix = options['mac_prefix']
tags = options['tags']
userid = options["owner"]
userid = options["user"]
allocation_pools = options["allocation_pools"]
floating_ip_pool = parse_bool(options["floating_ip_pool"])
dhcp = parse_bool(options["dhcp"])
......@@ -171,7 +171,7 @@ class Command(SynnefoCommand):
" subnet")
if not (userid or public):
raise CommandError("'owner' is required for private networks")
raise CommandError("'user' is required for private networks")
network = networks.create(userid=userid, name=name, flavor=flavor,
public=public, mode=mode,
......
......@@ -36,7 +36,7 @@ class Command(SynnefoCommand):
metavar='NAME',
help="Rename a network"),
make_option(
'--userid',
'--user',
dest='userid',
help="Change the owner of the network."),
make_option(
......
......@@ -41,7 +41,7 @@ class Command(SynnefoCommand):
default=None,
help="Name of the port."),
make_option(
"--owner",
"--user",
dest="user_id",
default=None,
help="UUID of the owner of the Port."),
......
......@@ -41,13 +41,13 @@ class Command(SynnefoCommand):
" available backends."),
make_option("--name", dest="name",
help="An arbitrary string for naming the server"),
make_option("--user-id", dest="user_id",
make_option("--user", dest="user_id",
help="Unique identifier of the owner of the server"),
make_option("--image-id", dest="image_id", default=None,
make_option("--image", dest="image_id", default=None,
help="Unique identifier of the image."
" Use snf-manage image-list to find out"
" available images."),
make_option("--flavor-id", dest="flavor_id",
make_option("--flavor", dest="flavor_id",
help="Unique identifier of the flavor"
" Use snf-manage flavor-list to find out"
" available flavors."),
......@@ -90,13 +90,13 @@ class Command(SynnefoCommand):
if not name:
raise CommandError("name is mandatory")
if not user_id:
raise CommandError("user-id is mandatory")
raise CommandError("user is mandatory")
if not password:
raise CommandError("password is mandatory")
if not flavor_id:
raise CommandError("flavor-id is mandatory")
raise CommandError("flavor is mandatory")
if not image_id and not volumes:
raise CommandError("image-id is mandatory")
raise CommandError("image is mandatory")
flavor = common.get_resource("flavor", flavor_id)
if image_id is not None:
......
......@@ -54,18 +54,18 @@ class Command(SynnefoCommand):
" hosts the VM. Use snf-manage backend-list to"
" find out available backends."),
make_option(
"--user-id",
"--user",
dest="user_id",
help="Unique identifier of the owner of the server"),
make_option(
"--image-id",
"--image",
dest="image_id",
default=None,
help="Unique identifier of the image."
" Use snf-manage image-list to find out"
" available images."),
make_option(
"--flavor-id",
"--flavor",
dest="flavor_id",
help="Unique identifier of the flavor"
" Use snf-manage flavor-list to find out"
......@@ -80,7 +80,7 @@ class Command(SynnefoCommand):
" Synnefo.")
)
REQUIRED = ("user-id", "backend-id", "image-id", "flavor-id")
REQUIRED = ("user", "backend-id", "image", "flavor")
def handle(self, *args, **options):
if len(args) < 1:
......
......@@ -39,8 +39,8 @@ class Command(SynnefoCommand):
metavar='NAME',
help="Rename server."),
make_option(
'--owner',
dest='owner',
'--user',
dest='user',
metavar='USER_UUID',
help="Change ownership of server. Value must be a user UUID"),
make_option(
......@@ -94,10 +94,10 @@ class Command(SynnefoCommand):
self.stdout.write("Set server '%s' as suspended=%s\n" %
(server, suspended))
new_owner = options.get('owner')
new_owner = options.get('user')
if new_owner is not None:
if "@" in new_owner:
raise CommandError("Invalid owner UUID.")
raise CommandError("Invalid user UUID.")
old_owner = server.userid
server.userid = new_owner
server.save()
......
......@@ -35,7 +35,7 @@ class Command(SynnefoCommand):
help = "Create a new Subnet." + HELP_MSG
option_list = SynnefoCommand.option_list + (
make_option("--network-id", dest="network_id",
make_option("--network", dest="network_id",
help="Specify the Network to attach the subnet. To get the"
" networks of a user, use snf-manage network-list"),
make_option("--cidr", dest="cidr",
......@@ -81,7 +81,7 @@ class Command(SynnefoCommand):
cidr = options["cidr"]
if not network_id:
raise CommandError("network-id is mandatory")
raise CommandError("network is mandatory")
if not cidr:
raise CommandError("cidr is mandatory")
......
......@@ -24,7 +24,7 @@ class Command(SynnefoCommand):
help = "List public images or images available to a user."
option_list = SynnefoCommand.option_list + (
make_option(
'--user-id',
'--user',
dest='userid',
default=None,
help="List all images available to that user."
......
......@@ -28,7 +28,7 @@ class Command(SynnefoCommand):
help = "Display available information about an image"
option_list = SynnefoCommand.option_list + (
make_option(
'--user-id',
'--user',
dest='userid',
default=None,
help="The UUID of the owner of the image. Required"
......
......@@ -32,7 +32,7 @@ class Command(SynnefoCommand):
"""
option_list = SynnefoCommand.option_list + (
make_option("--userid", dest="userid",
make_option("--user", dest="userid",
default=None,
help="Reconcile resources only for this user"),
make_option("--project",
......
......@@ -25,7 +25,7 @@ class Command(SynnefoCommand):
help = "List public snapshots or snapshots available to a user."
option_list = SynnefoCommand.option_list + (
make_option(
'--user-id',
'--user',
dest='userid',
default=None,
help="List all snapshots available to that user."
......
......@@ -27,7 +27,7 @@ class Command(SynnefoCommand):
help = "Display available information about a snapshot"
option_list = SynnefoCommand.option_list + (
make_option(
'--user-id',
'--user',
dest='userid',
default=None,
help="The UUID of the owner of the snapshot. Required"
......
......@@ -39,7 +39,7 @@ class Command(SynnefoCommand):
default=None,
help="Display description of the volume."),
make_option(
"--owner",
"--user",
dest="user_id",
default=None,
help="UUID of the owner of the volume."),
......
......@@ -38,7 +38,7 @@ class Command(SynnefoCommand):
"""
option_list = SynnefoCommand.option_list + (
make_option("--userid", dest="userid",
make_option("--user", dest="userid",
default=None,
help="Reconcile resources only for this user"),
make_option("--project",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment