diff --git a/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml b/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml index c3d4b0fc..919737b8 100644 --- a/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml +++ b/meta/io.murano/Classes/resources/ExistingNeutronNetwork.yaml @@ -59,6 +59,13 @@ Workflow: $.name = $this.internalNetworkName or $.id = $this.internalNetworkName).first().id + - If: $._internalNetworkId = $.internalNetworkName + Then: + $._internalNetworkName: $._getNetworks().where( + $.id = $this._internalNetworkId).first().name + Else: + $._internalNetworkName: $.internalNetworkName + - If: $.internalSubnetworkName = null Then: $.internalSubnetworkName: $._getSubnetworks().where( @@ -145,7 +152,8 @@ Workflow: netRef => $._internalNetworkId, subnetRef => $._internalSubnetworkId, floatingIpResourceName => $fipName, - floatingIpNetRef => $floatingIpNetRef + floatingIpNetRef => $floatingIpNetRef, + netName => $._internalNetworkName ) describe: diff --git a/meta/io.murano/Classes/resources/NeutronNetwork.yaml b/meta/io.murano/Classes/resources/NeutronNetwork.yaml index cf6429f4..0b36672e 100644 --- a/meta/io.murano/Classes/resources/NeutronNetwork.yaml +++ b/meta/io.murano/Classes/resources/NeutronNetwork.yaml @@ -150,7 +150,8 @@ Methods: netRef => $netRef, subnetRef => $subnetRef, floatingIpResourceName => $fipName, - floatingIpNetRef => $extNetId + floatingIpNetRef => $extNetId, + netName => $._getHeatName() ) # (sjmc7) This is a workaround for https://bugs.launchpad.net/heat/+bug/1299259 @@ -163,19 +164,8 @@ Methods: - $._getRouterInterfaceName() - $result.template: $result.template.mergeWith($template) - - $addressOutputName: format('adresses-{0}-in-{1}', $instance.name, $this.name) - - $ipsOutputTemplate: - outputs: - $addressOutputName: - description: format('Addresses for {0} in {1}', $instance.name, $this.name) - value: - get_attr: [$instance.name, 'addresses', $._getHeatName()] - - $result.template: $result.template.mergeWith($ipsOutputTemplate) - - $result.instanceOutputs: $result.instanceOutputs.append($addressOutputName) - - Return: $result - describe: Body: - $.deploy() @@ -209,14 +199,6 @@ Methods: - $region.stack.push() - $.openstackId: null - getInstanceIpList: - Arguments: - - instance: - Contract: $.class(Instance).notNull() - Body: - - Return: $.getRegion().stack.output().get(format('adresses-{0}-in-{1}', $instance.name, $this.name)).select($["addr"]).distinct() - - _getRouterInterfaceName: Body: Return: format('ri-{0}', id($)) diff --git a/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml b/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml index ba50ff93..c3ffd973 100644 --- a/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml +++ b/meta/io.murano/Classes/resources/NeutronNetworkBase.yaml @@ -49,10 +49,14 @@ Methods: Contract: $.string() - floatingIpNetRef: Contract: $ + - netName: + Contract: $.string().notNull() Body: - $netExplorer: $._getNetExplorer() - $securityGroupsEnabled: $netExplorer.listNeutronExtensions().alias.contains('security-group') - $portName: format('port-{0}-{1}', id($), $instance.name) + + - $addressesOutputName: format('addresses-{0}-{1}', $instance.name, id($this)) - $patchTemplate: resources: $portName: @@ -60,6 +64,11 @@ Methods: properties: network: $netRef replacement_policy: AUTO + outputs: + $addressesOutputName: + description: format('Addresses for {0} in {1}', $instance.name, $netName) + value: + get_attr: [$instance.name, 'addresses', $netName] - If: $subnetRef Then: @@ -82,7 +91,7 @@ Methods: - $patchTemplate: $patchTemplate.mergeWith($template) - $instanceResources: [$portName] - - $instanceOutputs: [] + - $instanceOutputs: [$addressesOutputName] - For: sip In: $sharedIps @@ -123,7 +132,6 @@ Methods: instanceResources: $instanceResources instanceOutputs: $instanceOutputs - generateSecurityGroupManager: Body: - $region: $.getRegion() @@ -135,3 +143,11 @@ Methods: Else: - $._environment.reporter.report($this, "Warning! Security groups are disabled!") - Return: new(sys:DummySecurityGroupManager, $region) + + getInstanceIpList: + Arguments: + - instance: + Contract: $.class(Instance).notNull() + Body: + - Return: $.getRegion().stack.output()[ + format('addresses-{0}-{1}', $instance.name, id($this))].addr.distinct()