summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-28 19:09:10 +0000
committerGerrit Code Review <review@openstack.org>2017-03-28 19:09:10 +0000
commit038affd0af0ea40e414d4f655109849c2323a2ce (patch)
treedc2158815f4ee766fdb259e0ae83ea30765a1f01
parent46df6dda54f4ad62b0a71951a6091620ac6d004f (diff)
parent19b4eb074f84a2fe1142e2882695691d53ce655e (diff)
Merge "ExistingNeutronNetwork didn't return IPs for the instance" into stable/newtonnewton-eol
-rw-r--r--meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml10
-rw-r--r--meta/io.murano/Classes/resources/NeutronNetwork.yaml22
-rw-r--r--meta/io.murano/Classes/resources/NeutronNetworkBase.yaml20
3 files changed, 29 insertions, 23 deletions
diff --git a/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml b/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml
index 682415e..d4b9004 100644
--- a/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml
+++ b/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml
@@ -59,6 +59,13 @@ Workflow:
59 $.name = $this.internalNetworkName or 59 $.name = $this.internalNetworkName or
60 $.id = $this.internalNetworkName).first().id 60 $.id = $this.internalNetworkName).first().id
61 61
62 - If: $._internalNetworkId = $.internalNetworkName
63 Then:
64 $._internalNetworkName: $._getNetworks().where(
65 $.id = $this._internalNetworkId).first().name
66 Else:
67 $._internalNetworkName: $.internalNetworkName
68
62 - If: $.internalSubnetworkName = null 69 - If: $.internalSubnetworkName = null
63 Then: 70 Then:
64 $.internalSubnetworkName: $._getSubnetworks().where( 71 $.internalSubnetworkName: $._getSubnetworks().where(
@@ -137,7 +144,8 @@ Workflow:
137 netRef => $._internalNetworkId, 144 netRef => $._internalNetworkId,
138 subnetRef => $._internalSubnetworkId, 145 subnetRef => $._internalSubnetworkId,
139 floatingIpResourceName => $fipName, 146 floatingIpResourceName => $fipName,
140 floatingIpNetRef => $floatingIpNetRef 147 floatingIpNetRef => $floatingIpNetRef,
148 netName => $._internalNetworkName
141 ) 149 )
142 150
143 describe: 151 describe:
diff --git a/meta/io.murano/Classes/resources/NeutronNetwork.yaml b/meta/io.murano/Classes/resources/NeutronNetwork.yaml
index cf6429f..0b36672 100644
--- a/meta/io.murano/Classes/resources/NeutronNetwork.yaml
+++ b/meta/io.murano/Classes/resources/NeutronNetwork.yaml
@@ -150,7 +150,8 @@ Methods:
150 netRef => $netRef, 150 netRef => $netRef,
151 subnetRef => $subnetRef, 151 subnetRef => $subnetRef,
152 floatingIpResourceName => $fipName, 152 floatingIpResourceName => $fipName,
153 floatingIpNetRef => $extNetId 153 floatingIpNetRef => $extNetId,
154 netName => $._getHeatName()
154 ) 155 )
155 156
156 # (sjmc7) This is a workaround for https://bugs.launchpad.net/heat/+bug/1299259 157 # (sjmc7) This is a workaround for https://bugs.launchpad.net/heat/+bug/1299259
@@ -163,19 +164,8 @@ Methods:
163 - $._getRouterInterfaceName() 164 - $._getRouterInterfaceName()
164 - $result.template: $result.template.mergeWith($template) 165 - $result.template: $result.template.mergeWith($template)
165 166
166 - $addressOutputName: format('adresses-{0}-in-{1}', $instance.name, $this.name)
167 - $ipsOutputTemplate:
168 outputs:
169 $addressOutputName:
170 description: format('Addresses for {0} in {1}', $instance.name, $this.name)
171 value:
172 get_attr: [$instance.name, 'addresses', $._getHeatName()]
173 - $result.template: $result.template.mergeWith($ipsOutputTemplate)
174 - $result.instanceOutputs: $result.instanceOutputs.append($addressOutputName)
175
176 - Return: $result 167 - Return: $result
177 168
178
179 describe: 169 describe:
180 Body: 170 Body:
181 - $.deploy() 171 - $.deploy()
@@ -209,14 +199,6 @@ Methods:
209 - $region.stack.push() 199 - $region.stack.push()
210 - $.openstackId: null 200 - $.openstackId: null
211 201
212 getInstanceIpList:
213 Arguments:
214 - instance:
215 Contract: $.class(Instance).notNull()
216 Body:
217 - Return: $.getRegion().stack.output().get(format('adresses-{0}-in-{1}', $instance.name, $this.name)).select($["addr"]).distinct()
218
219
220 _getRouterInterfaceName: 202 _getRouterInterfaceName:
221 Body: 203 Body:
222 Return: format('ri-{0}', id($)) 204 Return: format('ri-{0}', id($))
diff --git a/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml b/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml
index 3ab11c5..c2829a3 100644
--- a/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml
+++ b/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml
@@ -49,10 +49,14 @@ Methods:
49 Contract: $.string() 49 Contract: $.string()
50 - floatingIpNetRef: 50 - floatingIpNetRef:
51 Contract: $ 51 Contract: $
52 - netName:
53 Contract: $.string().notNull()
52 Body: 54 Body:
53 - $netExplorer: $._getNetExplorer() 55 - $netExplorer: $._getNetExplorer()
54 - $securityGroupsEnabled: $netExplorer.listNeutronExtensions().alias.contains('security-group') 56 - $securityGroupsEnabled: $netExplorer.listNeutronExtensions().alias.contains('security-group')
55 - $portName: format('port-{0}-{1}', id($), $instance.name) 57 - $portName: format('port-{0}-{1}', id($), $instance.name)
58
59 - $addressesOutputName: format('addresses-{0}-{1}', $instance.name, id($this))
56 - $patchTemplate: 60 - $patchTemplate:
57 resources: 61 resources:
58 $portName: 62 $portName:
@@ -62,6 +66,11 @@ Methods:
62 fixed_ips: 66 fixed_ips:
63 - subnet: $subnetRef 67 - subnet: $subnetRef
64 replacement_policy: AUTO 68 replacement_policy: AUTO
69 outputs:
70 $addressesOutputName:
71 description: format('Addresses for {0} in {1}', $instance.name, $netName)
72 value:
73 get_attr: [$instance.name, 'addresses', $netName]
65 74
66 - If: bool($securityGroupName) and $securityGroupsEnabled 75 - If: bool($securityGroupName) and $securityGroupsEnabled
67 Then: 76 Then:
@@ -74,7 +83,7 @@ Methods:
74 - $patchTemplate: $patchTemplate.mergeWith($template) 83 - $patchTemplate: $patchTemplate.mergeWith($template)
75 84
76 - $instanceResources: [$portName] 85 - $instanceResources: [$portName]
77 - $instanceOutputs: [] 86 - $instanceOutputs: [$addressesOutputName]
78 87
79 - For: sip 88 - For: sip
80 In: $sharedIps 89 In: $sharedIps
@@ -115,7 +124,6 @@ Methods:
115 instanceResources: $instanceResources 124 instanceResources: $instanceResources
116 instanceOutputs: $instanceOutputs 125 instanceOutputs: $instanceOutputs
117 126
118
119 generateSecurityGroupManager: 127 generateSecurityGroupManager:
120 Body: 128 Body:
121 - $region: $.getRegion() 129 - $region: $.getRegion()
@@ -127,3 +135,11 @@ Methods:
127 Else: 135 Else:
128 - $._environment.reporter.report($this, "Warning! Security groups are disabled!") 136 - $._environment.reporter.report($this, "Warning! Security groups are disabled!")
129 - Return: new(sys:DummySecurityGroupManager, $region) 137 - Return: new(sys:DummySecurityGroupManager, $region)
138
139 getInstanceIpList:
140 Arguments:
141 - instance:
142 Contract: $.class(Instance).notNull()
143 Body:
144 - Return: $.getRegion().stack.output()[
145 format('addresses-{0}-{1}', $instance.name, id($this))].addr.distinct()