Modify the Capsule creation opts field.
Modify the Capsule creation opts field from "spec" to "template". Since now there is already a field called "spec" in the "spec", which may induce some misunderstanding for the user. Also delete capsule_template_version check, since it is not a useful field. Part of blueprint introduce-compose Change-Id: Iea4acd24a540b86f59a28ef09be223923cf27175 Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
This commit is contained in:
parent
01436550aa
commit
1bc8042149
@ -15,7 +15,6 @@
|
|||||||
import json
|
import json
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from zunclient.i18n import _
|
|
||||||
|
|
||||||
yaml_loader = yaml.SafeLoader
|
yaml_loader = yaml.SafeLoader
|
||||||
|
|
||||||
@ -56,8 +55,5 @@ def parse(tmpl_str):
|
|||||||
else:
|
else:
|
||||||
if tpl is None:
|
if tpl is None:
|
||||||
tpl = {}
|
tpl = {}
|
||||||
# Looking for supported version keys in the loaded template
|
|
||||||
if not ('CapsuleTemplateFormatVersion' in tpl
|
|
||||||
or 'capsule_template_version' in tpl):
|
|
||||||
raise ValueError(_("Template format version not found."))
|
|
||||||
return tpl
|
return tpl
|
||||||
|
@ -17,7 +17,7 @@ from zunclient.common import utils
|
|||||||
from zunclient import exceptions
|
from zunclient import exceptions
|
||||||
|
|
||||||
|
|
||||||
CREATION_ATTRIBUTES = ['spec']
|
CREATION_ATTRIBUTES = ['template']
|
||||||
|
|
||||||
|
|
||||||
class Capsule(base.Resource):
|
class Capsule(base.Resource):
|
||||||
|
@ -36,8 +36,9 @@ def do_capsule_create(cs, args):
|
|||||||
if args.template_file:
|
if args.template_file:
|
||||||
template = template_utils.get_template_contents(
|
template = template_utils.get_template_contents(
|
||||||
args.template_file)
|
args.template_file)
|
||||||
opts['spec'] = template
|
opts['template'] = template
|
||||||
cs.capsules.create(**opts)
|
cs.capsules.create(**opts)
|
||||||
|
print("Request to create capsule has been accepted.")
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--all-tenants',
|
@utils.arg('--all-tenants',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user