Skip to content

Commit

Permalink
HOT: update for OpenStack Wallaby
Browse files Browse the repository at this point in the history
  • Loading branch information
tliron committed Apr 20, 2021
1 parent 89642fa commit 5db6eb2
Show file tree
Hide file tree
Showing 65 changed files with 70 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Puccini can parse all versions of TOSCA:
Additionally, Puccini can parse the following TOSCA-like dialects:

* [Cloudify DSL 1.3](https://docs.cloudify.co/5.0.5/developer/blueprints/)
* [OpenStack Heat HOT 2018-08-31](https://docs.openstack.org/heat/stein/template_guide/hot_guide.html)
* [OpenStack Heat HOT 2021-04-16](https://docs.openstack.org/heat/wallaby/template_guide/hot_guide.html)

TOSCA is a complex object-oriented language. We put considerable effort into adhering to every
aspect of the grammar, especially in regards to value type checking and type inheritance contracts,
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/and.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#and]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#and]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/contains.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#contains]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#contains]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/digest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#digest]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#digest]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/equals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#equals]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#equals]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/filter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#filter]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#filter]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/get_attr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_attr]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_attr]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/get_file.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_file]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_file]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/get_param.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_param]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_param]

clout.exec('tosca.lib.utils');

Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/get_resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_resource]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_resource]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/if.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#if]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#if]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/list_concat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#list-concat]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#list-concat]

function evaluate() {
return 'TODO';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#list_concat_unique]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#list_concat_unique]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/list_join.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#list_join]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#list_join]

function evaluate() {
var length = arguments.length;
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/make_url.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#make_url]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#make_url]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/map_merge.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#map_merge]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#map_merge]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/map_replace.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#map_replace]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#map_replace]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/not.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#not]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#not]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/or.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#or]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#or]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/repeat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#repeat]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#repeat]

function evaluate() {
return 'TODO';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#resource_facade]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#resource_facade]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/str_replace.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#str_replace]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#str_replace]

function evaluate() {
return 'TODO';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#str_replace_strict]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#str_replace_strict]

function evaluate() {
return 'TODO';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#str_replace_vstrict]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#str_replace_vstrict]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/str_split.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#str_split]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#str_split]

function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion assets/tosca/profiles/hot/1.0/js/functions/yaql.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#yaql]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#yaql]

function evaluate() {
return 'TODO';
Expand Down
4 changes: 2 additions & 2 deletions examples/hot/hello-world.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
heat_template_version: 2018-08-31
heat_template_version: 2021-04-16

# See: https://docs.openstack.org/heat/stein/template_guide/hot_guide.html
# See: https://docs.openstack.org/heat/wallaby/template_guide/hot_guide.html

description: >-
Hello World stack
Expand Down
2 changes: 1 addition & 1 deletion examples/openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For [OpenStack](https://www.openstack.org/) Puccini can generate
Custom operation artifacts, if included, are deployed to the virtual machines and executed.

Effectively, the combination of TOSCA + Ansible provides an equivalent set of features to
[Heat](https://docs.openstack.org/heat/stein/)/[Mistral](https://docs.openstack.org/mistral/stein/).
[Heat](https://docs.openstack.org/heat/wallaby/)/[Mistral](https://docs.openstack.org/mistral/wallaby/).
However, Ansible is a general-purpose orchestrator that can do a lot more than Heat. The generated
playbooks comprise roles that can be imported and used in other playbooks, allowing for custom
orchestration integrations.
Expand Down
2 changes: 1 addition & 1 deletion examples/openstack/profile/nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ imports:

node_types:

# https://docs.openstack.org/heat/stein/template_guide/openstack.html#OS::Nova::Server
# https://docs.openstack.org/heat/wallaby/template_guide/openstack.html#OS::Nova::Server
nova.Server:
metadata:
heat_name: OS::Nova::Server
Expand Down
3 changes: 2 additions & 1 deletion examples/tosca/substitution-mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ topology_template:
admin_host: [ admin, host ]
db_host: [ db, host ]
properties:
# Properties are mapped to inputs, *not* node template properties
# Properties are mapped to inputs
# (You can also map properties to note template properties, though this use is deprecated in TOSCA 1.3)
# The data types must be compatible
redundancy: [ scale ]
attributes:
Expand Down
3 changes: 3 additions & 0 deletions tosca/grammars/hot/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ var Grammar = tosca.NewGrammar()
var DefaultScriptletNamespace = tosca.NewScriptletNamespace()

func init() {
// https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html
Grammar.RegisterVersion("heat_template_version", "wallaby", "")
Grammar.RegisterVersion("heat_template_version", "train", "") // not mentioned in spec, but probably supported
Grammar.RegisterVersion("heat_template_version", "stein", "") // not mentioned in spec, but probably supported
Grammar.RegisterVersion("heat_template_version", "rocky", "")
Grammar.RegisterVersion("heat_template_version", "queens", "")
Grammar.RegisterVersion("heat_template_version", "pike", "")
Grammar.RegisterVersion("heat_template_version", "newton", "")
Grammar.RegisterVersion("heat_template_version", "ocata", "")
Grammar.RegisterVersion("heat_template_version", "2021-04-16", "") // wallaby
Grammar.RegisterVersion("heat_template_version", "2018-08-31", "") // train, stein, rocky
Grammar.RegisterVersion("heat_template_version", "2018-03-02", "") // queens
Grammar.RegisterVersion("heat_template_version", "2017-09-01", "") // pike
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/condition-definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
//
// ConditionDefinition
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#conditions-section]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#conditions-section]
//

type ConditionDefinition struct {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/constraint.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var ConstraintNativeArgumentIndexes = map[string][]uint{}
//
// Constraint
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#parameter-constraints]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#parameter-constraints]
//

type Constraint struct {
Expand Down
4 changes: 2 additions & 2 deletions tosca/grammars/hot/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
//
// Built-in functions
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#intrinsic-functions]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#intrinsic-functions]
//

var FunctionScriptlets = map[string]string{
Expand Down Expand Up @@ -71,7 +71,7 @@ func ToFunctionCall(context *tosca.Context) bool {
}

// The "list_join" function has a nested argument structure that we need to flatten
// https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#list-join
// https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#list-join
if name == "list_join" {
newArguments := ard.List{originalArguments[0]}
for _, argument := range originalArguments[1:] {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
//
// Output
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#outputs-section]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#outputs-section]
//

type Output struct {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/parameter-group.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
//
// ParameterGroup
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#parameter-groups-section]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#parameter-groups-section]
//

type ParameterGroup struct {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
//
// Parameter
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#parameters-section]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#parameters-section]
//

type Parameter struct {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func GetDeletionPolicy(policy string) (string, bool) {
//
// Resource
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#resources-section]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#resources-section]
//

type Resource struct {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
//
// Template
//
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#template-structure]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#template-structure]
//

type Template struct {
Expand Down
2 changes: 1 addition & 1 deletion tosca/grammars/hot/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (self *Value) CoerceParameterType(type_ string) {
//
// Resource types
//
// [https://docs.openstack.org/heat/stein/template_guide/openstack.html]
// [https://docs.openstack.org/heat/wallaby/template_guide/openstack.html]
//

var ResourceTypes = map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-and.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/and.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#and]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#and]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-contains.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/contains.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#contains]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#contains]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-digest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/digest.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#digest]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#digest]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-equals.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/equals.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#equals]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#equals]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/filter.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#filter]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#filter]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-get_attr.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/get_attr.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_attr]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_attr]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-get_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/get_file.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_file]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_file]
function evaluate() {
return 'TODO';
Expand Down
2 changes: 1 addition & 1 deletion tosca/profiles/hot/v1_0/js-functions-get_param.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package v1_0
func init() {
Profile["/hot/1.0/js/functions/get_param.js"] = `
// [https://docs.openstack.org/heat/stein/template_guide/hot_spec.html#get_param]
// [https://docs.openstack.org/heat/wallaby/template_guide/hot_spec.html#get_param]
clout.exec('tosca.lib.utils');
Expand Down
Loading

0 comments on commit 5db6eb2

Please sign in to comment.