Multi-region support for WindowsInstance

During implementation of multi-regions many of the
objects that used to be in Environment were moved
to the CloudRegion. Instance/LinuxMuranoInstance
classes were updated for the change, but WindowsInstance
was forgotten. This commit brings similar change to the
WindowsInstance class.

Change-Id: Iabbf7ec1fc0ef0dffc09eaefdece54d7f0d98058
Closes-Bug: #1643971
This commit is contained in:
Stan Lagun 2016-11-22 22:12:45 -08:00
parent c47623f8bb
commit 3f53c5ea07
1 changed files with 6 additions and 6 deletions

View File

@ -25,20 +25,20 @@ Methods:
- groupName: - groupName:
Contract: $.string().notNull() Contract: $.string().notNull()
Body: Body:
- $environment: $.find(std:Environment).require() - $region: $.getRegion()
- $rules: - $rules:
- ToPort: 3389 - ToPort: 3389
IpProtocol: tcp IpProtocol: tcp
FromPort: 3389 FromPort: 3389
External: true External: true
- $environment.securityGroupManager.addGroupIngress( - $region.securityGroupManager.addGroupIngress(
rules => $rules, groupName => $groupName) rules => $rules, groupName => $groupName)
prepareUserData: prepareUserData:
Body: Body:
- $region: $.getRegion()
- $rabbitMqParams: $region.getConfig().agentRabbitMq
- $resources: new(sys:Resources) - $resources: new(sys:Resources)
- $environment: $.find(std:Environment).require()
- $rabbitMqParams: $environment.regionConfigs.get($environment.region).agentRabbitMq
- $configFile: $resources.string('Agent-v1.template') - $configFile: $resources.string('Agent-v1.template')
- $initScript: $resources.string('windows-init.ps1') - $initScript: $resources.string('windows-init.ps1')
- $configReplacements: - $configReplacements:
@ -49,12 +49,12 @@ Methods:
"%RABBITMQ_VHOST%": $rabbitMqParams.virtual_host "%RABBITMQ_VHOST%": $rabbitMqParams.virtual_host
"%RABBITMQ_SSL%": str($rabbitMqParams.ssl).toLower() "%RABBITMQ_SSL%": str($rabbitMqParams.ssl).toLower()
"%RABBITMQ_INPUT_QUEUE%": $.agent.queueName() "%RABBITMQ_INPUT_QUEUE%": $.agent.queueName()
"%RESULT_QUEUE%": $environment.agentListener.queueName() "%RESULT_QUEUE%": $region.agentListener.queueName()
- $scriptReplacements: - $scriptReplacements:
"%AGENT_CONFIG_BASE64%": base64encode($configFile.replace($configReplacements)) "%AGENT_CONFIG_BASE64%": base64encode($configFile.replace($configReplacements))
"%INTERNAL_HOSTNAME%": $.name "%INTERNAL_HOSTNAME%": $.name
"%MURANO_SERVER_ADDRESS%": coalesce(config(file_server), $rabbitMqParams.host) "%MURANO_SERVER_ADDRESS%": coalesce(config(file_server), $rabbitMqParams.host)
"%CA_ROOT_CERT_BASE64%": "" "%CA_ROOT_CERT_BASE64%": ""
- Return: - Return:
data: $initScript.replace($scriptReplacements) data: $initScript.replace($scriptReplacements)
format: HEAT_CFNTOOLS format: HEAT_CFNTOOLS