Merge "Modify the Capsule creation opts field."

This commit is contained in:
Zuul
2018-01-12 08:38:46 +00:00
committed by Gerrit Code Review
3 changed files with 4 additions and 7 deletions

View File

@@ -15,7 +15,6 @@
import json
import yaml
from zunclient.i18n import _
yaml_loader = yaml.SafeLoader
@@ -56,8 +55,5 @@ def parse(tmpl_str):
else:
if tpl is None:
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

View File

@@ -17,7 +17,7 @@ from zunclient.common import utils
from zunclient import exceptions
CREATION_ATTRIBUTES = ['spec']
CREATION_ATTRIBUTES = ['template']
class Capsule(base.Resource):

View File

@@ -36,8 +36,9 @@ def do_capsule_create(cs, args):
if args.template_file:
template = template_utils.get_template_contents(
args.template_file)
opts['spec'] = template
opts['template'] = template
cs.capsules.create(**opts)
print("Request to create capsule has been accepted.")
@utils.arg('--all-projects',