Skip to content

Commit

Permalink
Stylistic change to OpenStack profile
Browse files Browse the repository at this point in the history
  • Loading branch information
tliron committed Mar 4, 2019
1 parent ba9b2e2 commit b136aa6
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 43 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ checksum:
release:

#disable: true
prerelease: true

github:
owner: tliron
Expand Down
20 changes: 10 additions & 10 deletions assets/tosca/profiles/openstack/1.0/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ data_types:
derived_from:
string

openstack.Nova.Flavor:
openstack.nova.Flavor:
derived_from:
string

openstack.Nova.Keypair:
openstack.nova.Keypair:
derived_from:
string

openstack.Nova.Server.Network:
openstack.nova.Server.Network:
derived_from: Root
properties:
allocate_network:
Expand Down Expand Up @@ -80,7 +80,7 @@ data_types:
Dict, which has expand properties for port. Used only if port property is not specified
for creating port.
type: map
entry_schema: openstack.Nova.Server.Port
entry_schema: openstack.nova.Server.Port
subnet:
description: >-
Subnet in which to allocate the IP address for port. Used for creating port, based on
Expand All @@ -91,7 +91,7 @@ data_types:
Port tag. Heat ignores any update on this property as nova does not support it.
type: string

openstack.Nova.Server.Port:
openstack.nova.Server.Port:
derived_from: Root
properties:
admin_state_up:
Expand All @@ -103,7 +103,7 @@ data_types:
description: >-
Additional MAC/IP address pairs allowed to pass through the port.
type: list
entry_schema: openstack.Nova.Server.AddressPair
entry_schema: openstack.nova.Server.AddressPair
binding.vnic_type:
description: >-
The vnic type to be bound on the neutron port. To support SR-IOV PCI passthrough
Expand Down Expand Up @@ -135,7 +135,7 @@ data_types:
type: map
entry_schema: string # TODO

openstack.Nova.Server.AddressPair:
openstack.nova.Server.AddressPair:
derived_from: Root
properties:
ip_address:
Expand All @@ -147,7 +147,7 @@ data_types:
MAC address to allow through this port.
type: openstack.MacAddress

openstack.Nova.Server.SwiftData:
openstack.nova.Server.SwiftData:
derived_from: Root
properties:
container:
Expand All @@ -163,7 +163,7 @@ data_types:
constraints:
- min_length: 1

openstack.Nova.Server.BlockDevice:
openstack.nova.Server.BlockDevice:
derived_from: Root
properties:
delete_on_termination:
Expand All @@ -189,7 +189,7 @@ data_types:
infer the size.
type: scalar-unit.size

openstack.Nova.Server.BlockDevice2:
openstack.nova.Server.BlockDevice2:
derived_from: Root
properties:
boot_index:
Expand Down
8 changes: 4 additions & 4 deletions assets/tosca/profiles/openstack/1.0/js/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function writeTopology() {

for (var vertexId in clout.vertexes) {
var vertex = clout.vertexes[vertexId];
if (!tosca.isNodeTemplate(vertex, 'openstack.Nova.Server'))
if (!tosca.isNodeTemplate(vertex, 'openstack.nova.Server'))
continue;
var nodeTemplate = vertex.properties;

Expand All @@ -47,10 +47,10 @@ function writePlaybookInstall() {
name: 'Configure OpenStack',
os_client_config: null,
}, {
name: 'Import topology.yaml',
name: 'Import topology.' + puccini.format,
include_vars: {
name: 'topology',
file: 'topology.yaml'
file: 'topology.' + puccini.format
}
}, {
include_role: {
Expand Down Expand Up @@ -161,7 +161,7 @@ function writeCfg() {
puccini.write('\
[defaults]\n\
ansible_managed=Modified by Ansible on %Y-%m-%d %H:%M:%S %Z\n\
inventory=./inventory.yaml\n\
inventory=./inventory.' + puccini.format +'\n\
transport=ssh\n\
command_warnings=false\n\
\n\
Expand Down
14 changes: 7 additions & 7 deletions assets/tosca/profiles/openstack/1.0/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/rocky/template_guide/openstack.html#OS::Nova::Server
openstack.Nova.Server:
openstack.nova.Server:
metadata:
heat_name: OS::Nova::Server
properties:
Expand All @@ -26,13 +26,13 @@ node_types:
description: >-
Block device mappings for this server.
type: list
entry_schema: openstack.Nova.Server.BlockDevice
entry_schema: openstack.nova.Server.BlockDevice
required: false
block_device_mapping_v2:
description: >-
Block device mappings v2 for this server.
type: list
entry_schema: openstack.Nova.Server.BlockDevice2
entry_schema: openstack.nova.Server.BlockDevice2
required: false
config_drive:
description: >-
Expand All @@ -48,7 +48,7 @@ node_types:
is set to POLL_TEMP_URL, a container will be automatically created from the resource name,
and the object name will be a generated uuid.
type: map
entry_schema: openstack.Nova.Server.SwiftData
entry_schema: openstack.nova.Server.SwiftData
required: false
diskConfig:
description: >-
Expand All @@ -60,7 +60,7 @@ node_types:
flavor:
description: >-
The ID or name of the flavor to boot onto.
type: openstack.Nova.Flavor
type: openstack.nova.Flavor
flavor_update_policy:
description: >-
Policy on how to apply a flavor update; either by requesting a server resize or by
Expand All @@ -87,7 +87,7 @@ node_types:
key_name:
description: >-
Name of keypair to inject into the server.
type: openstack.Nova.Keypair
type: openstack.nova.Keypair
required: false
metadata:
description: >-
Expand All @@ -107,7 +107,7 @@ node_types:
An ordered list of nics to be added to this server, with information about connected
networks, fixed ips, port etc.
type: list
entry_schema: openstack.Nova.Server.Network
entry_schema: openstack.nova.Server.Network
required: false
personality:
description: >-
Expand Down
2 changes: 1 addition & 1 deletion examples/openstack/hello-world.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ topology_template:
node_templates:

my_instance:
type: openstack.Nova.Server
type: openstack.nova.Server
properties:
key_name: { get_input: key_name }
image: { get_input: image_id }
Expand Down
1 change: 1 addition & 0 deletions tosca/grammars/hot/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewTemplate(context *tosca.Context) *Template {
self.Context.ImportScript("tosca.visualize", "internal:/tosca/simple/1.1/js/visualize.js")
self.Context.ImportScript("tosca.utils", "internal:/tosca/simple/1.1/js/utils.js")
self.Context.ImportScript("tosca.helpers", "internal:/tosca/simple/1.1/js/helpers.js")
self.Context.ImportScript("openstack.generate", "internal:/tosca/openstack/1.0/js/generate.js")

self.NewPseudoParameter("OS::stack_name", "stack_name")
self.NewPseudoParameter("OS::stack_id", "stack_id")
Expand Down
20 changes: 10 additions & 10 deletions tosca/profiles/openstack/v1_0/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ data_types:
derived_from:
string
openstack.Nova.Flavor:
openstack.nova.Flavor:
derived_from:
string
openstack.Nova.Keypair:
openstack.nova.Keypair:
derived_from:
string
openstack.Nova.Server.Network:
openstack.nova.Server.Network:
derived_from: Root
properties:
allocate_network:
Expand Down Expand Up @@ -86,7 +86,7 @@ data_types:
Dict, which has expand properties for port. Used only if port property is not specified
for creating port.
type: map
entry_schema: openstack.Nova.Server.Port
entry_schema: openstack.nova.Server.Port
subnet:
description: >-
Subnet in which to allocate the IP address for port. Used for creating port, based on
Expand All @@ -97,7 +97,7 @@ data_types:
Port tag. Heat ignores any update on this property as nova does not support it.
type: string
openstack.Nova.Server.Port:
openstack.nova.Server.Port:
derived_from: Root
properties:
admin_state_up:
Expand All @@ -109,7 +109,7 @@ data_types:
description: >-
Additional MAC/IP address pairs allowed to pass through the port.
type: list
entry_schema: openstack.Nova.Server.AddressPair
entry_schema: openstack.nova.Server.AddressPair
binding.vnic_type:
description: >-
The vnic type to be bound on the neutron port. To support SR-IOV PCI passthrough
Expand Down Expand Up @@ -141,7 +141,7 @@ data_types:
type: map
entry_schema: string # TODO
openstack.Nova.Server.AddressPair:
openstack.nova.Server.AddressPair:
derived_from: Root
properties:
ip_address:
Expand All @@ -153,7 +153,7 @@ data_types:
MAC address to allow through this port.
type: openstack.MacAddress
openstack.Nova.Server.SwiftData:
openstack.nova.Server.SwiftData:
derived_from: Root
properties:
container:
Expand All @@ -169,7 +169,7 @@ data_types:
constraints:
- min_length: 1
openstack.Nova.Server.BlockDevice:
openstack.nova.Server.BlockDevice:
derived_from: Root
properties:
delete_on_termination:
Expand All @@ -195,7 +195,7 @@ data_types:
infer the size.
type: scalar-unit.size
openstack.Nova.Server.BlockDevice2:
openstack.nova.Server.BlockDevice2:
derived_from: Root
properties:
boot_index:
Expand Down
8 changes: 4 additions & 4 deletions tosca/profiles/openstack/v1_0/js-generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function writeTopology() {
for (var vertexId in clout.vertexes) {
var vertex = clout.vertexes[vertexId];
if (!tosca.isNodeTemplate(vertex, 'openstack.Nova.Server'))
if (!tosca.isNodeTemplate(vertex, 'openstack.nova.Server'))
continue;
var nodeTemplate = vertex.properties;
Expand All @@ -53,10 +53,10 @@ function writePlaybookInstall() {
name: 'Configure OpenStack',
os_client_config: null,
}, {
name: 'Import topology.yaml',
name: 'Import topology.' + puccini.format,
include_vars: {
name: 'topology',
file: 'topology.yaml'
file: 'topology.' + puccini.format
}
}, {
include_role: {
Expand Down Expand Up @@ -167,7 +167,7 @@ function writeCfg() {
puccini.write('\
[defaults]\n\
ansible_managed=Modified by Ansible on %Y-%m-%d %H:%M:%S %Z\n\
inventory=./inventory.yaml\n\
inventory=./inventory.' + puccini.format +'\n\
transport=ssh\n\
command_warnings=false\n\
\n\
Expand Down
14 changes: 7 additions & 7 deletions tosca/profiles/openstack/v1_0/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ imports:
node_types:
# https://docs.openstack.org/heat/rocky/template_guide/openstack.html#OS::Nova::Server
openstack.Nova.Server:
openstack.nova.Server:
metadata:
heat_name: OS::Nova::Server
properties:
Expand All @@ -32,13 +32,13 @@ node_types:
description: >-
Block device mappings for this server.
type: list
entry_schema: openstack.Nova.Server.BlockDevice
entry_schema: openstack.nova.Server.BlockDevice
required: false
block_device_mapping_v2:
description: >-
Block device mappings v2 for this server.
type: list
entry_schema: openstack.Nova.Server.BlockDevice2
entry_schema: openstack.nova.Server.BlockDevice2
required: false
config_drive:
description: >-
Expand All @@ -54,7 +54,7 @@ node_types:
is set to POLL_TEMP_URL, a container will be automatically created from the resource name,
and the object name will be a generated uuid.
type: map
entry_schema: openstack.Nova.Server.SwiftData
entry_schema: openstack.nova.Server.SwiftData
required: false
diskConfig:
description: >-
Expand All @@ -66,7 +66,7 @@ node_types:
flavor:
description: >-
The ID or name of the flavor to boot onto.
type: openstack.Nova.Flavor
type: openstack.nova.Flavor
flavor_update_policy:
description: >-
Policy on how to apply a flavor update; either by requesting a server resize or by
Expand All @@ -93,7 +93,7 @@ node_types:
key_name:
description: >-
Name of keypair to inject into the server.
type: openstack.Nova.Keypair
type: openstack.nova.Keypair
required: false
metadata:
description: >-
Expand All @@ -113,7 +113,7 @@ node_types:
An ordered list of nics to be added to this server, with information about connected
networks, fixed ips, port etc.
type: list
entry_schema: openstack.Nova.Server.Network
entry_schema: openstack.nova.Server.Network
required: false
personality:
description: >-
Expand Down

0 comments on commit b136aa6

Please sign in to comment.