Add more doc for async deploy

- also add safe decode to params

Jira-Issue: OSTACKDEV-20
This commit is contained in:
Steve Noyes 2016-03-30 16:27:00 -04:00
parent 435a733644
commit aef4fe7acd
2 changed files with 35 additions and 4 deletions

View File

@ -30,7 +30,32 @@ class AsyncApi(object):
"""Deploy.
Deploy containers to hosts.
:param hostnames: hosts to deploy to. If empty, then deploy to all.
:type hostnames: list of strings
:param groupnames: names of groups
:type groupnames: list of strings
:param servicenames: names of services
:type servicenames: list of strings
:param serial_flag: if true, deploy will be done one host at a time
:type serial_flag: boolean
:param verbose_level: the higher the number, the more verbose
:type verbose_level: integer
:return: Job object
:rtype: Job
"""
check_arg(hostnames, u._('Host names'), list,
empty_ok=True, none_ok=True)
check_arg(groupnames, u._('Group names'), list,
empty_ok=True, none_ok=True)
check_arg(servicenames, u._('Service names'), list,
empty_ok=True, none_ok=True)
check_arg(serial_flag, u._('Serial flag'), bool)
check_arg(verbose_level, u._('Verbose level'), int)
hostnames = safe_decode(hostnames)
groupnames = safe_decode(groupnames)
servicenames = safe_decode(servicenames)
ansible_job = actions.deploy(hostnames, groupnames, servicenames,
serial_flag, verbose_level)
return Job(ansible_job)
@ -40,6 +65,8 @@ class AsyncApi(object):
:param verbose_level: the higher the number, the more verbose
:type verbose_level: integer
:return: Job object
:rtype: Job
Upgrade containers to new version specified by the property
"openstack_release."
@ -63,6 +90,9 @@ class AsyncApi(object):
:type verbose_level: integer
:param include_data: if true, destroy data containers too.
:type include_data: boolean
:return: Job object
:rtype: Job
"""
check_arg(hostnames, u._('Host names'), list)
check_arg(destroy_type, u._('Destroy type'), str)
@ -91,6 +121,8 @@ class AsyncApi(object):
:type hostnames: list
:param verbose_level: the higher the number, the more verbose
:type verbose_level: integer
:return: Job object
:rtype: Job
"""
check_arg(hostnames, u._('Host names'), list)
check_arg(verbose_level, u._('Verbose level'), int)

View File

@ -18,7 +18,6 @@ import kollacli.i18n as u
from kollacli.api.client import ClientApi
from kollacli.commands.exceptions import CommandError
from kollacli.common.utils import convert_to_unicode
from cliff.command import Command
@ -52,13 +51,13 @@ class Deploy(Command):
try:
if parsed_args.hosts:
host_list = parsed_args.hosts.strip()
hosts = convert_to_unicode(host_list).split(',')
hosts = host_list.split(',')
if parsed_args.groups:
group_list = parsed_args.groups.strip()
groups = convert_to_unicode(group_list).split(',')
groups = group_list.split(',')
if parsed_args.services:
service_list = parsed_args.services.strip()
services = convert_to_unicode(service_list).split(',')
services = service_list.split(',')
if parsed_args.serial:
serial_flag = True