def template_stack(name=None, profile=None):
 h_client = _auth(profile)
 if (not name):
  return {'result': False, 'comment': 'Parameter name missing or None'}
 try:
  get_template = h_client.stacks.template(name)
 except exc.HTTPNotFound:
  return {'result': False, 'comment': 'No stack with {0}'.format(name)}
 except exc.BadRequest:
  return {'result': False, 'comment': 'Bad request fot stack {0}'.format(name)}
 if ('heat_template_version' in get_template):
  template = yaml.dump(get_template, Dumper=YamlDumper)
 else:
  template = jsonutils.dumps(get_template, indent=2, ensure_ascii=False)
 checksum = __salt__['hashutil.digest'](template)
 ret = {'template': template, 'result': True, 'checksum': checksum}
 return ret

def template_stack ( name = None , profile = None ) : h_client = _auth ( profile ) if ( not name ) : return { 'result' : False , 'comment' : 'Parameter name missing or None' } try : get_template = h_client . stacks . template ( name ) except exc . HTTPNotFound : return { 'result' : False , 'comment' : 'No stack with {0}' . format ( name ) } except exc . BadRequest : return { 'result' : False , 'comment' : 'Bad request fot stack {0}' . format ( name ) } if ( 'heat_template_version' in get_template ) : template = yaml . dump ( get_template , Dumper = YamlDumper ) else : template = jsonutils . dumps ( get_template , indent = 2 , ensure_ascii = False ) checksum = __salt__ [ 'hashutil.digest' ] ( template ) ret = { 'template' : template , 'result' : True , 'checksum' : checksum } return ret
return template a specific stack name name of the stack profile profile to use cli example: .