First steps to supporting different templates

This commit is contained in:
Omar Zevallos 2019-01-04 10:21:33 -05:00
Родитель a8f65f561c
Коммит 74c367d327
2 изменённых файлов: 14 добавлений и 9 удалений

Просмотреть файл

@ -77,18 +77,20 @@ class AvereTemplateDeploy:
self._debug('> Deleting resource group: ' + self.resource_group)
return self.rm_client.resource_groups.delete(self.resource_group)
def deploy(self):
def deploy(self, add_secrets_params=True):
"""Deploys the Avere vFXT template."""
self._debug('> Deploying template')
deploy_secrets = {
'adminPassword': os.environ['AVERE_ADMIN_PW'],
'controllerPassword': os.environ['AVERE_CONTROLLER_PW'],
'servicePrincipalAppId': os.environ['AZURE_CLIENT_ID'],
'servicePrincipalPassword': os.environ['AZURE_CLIENT_SECRET'],
'servicePrincipalTenant': os.environ['AZURE_TENANT_ID']
}
params = {**deploy_secrets, **self.deploy_params}
params = {**self.deploy_params}
if add_secrets_params:
deploy_secrets = {
'adminPassword': os.environ['AVERE_ADMIN_PW'],
'controllerPassword': os.environ['AVERE_CONTROLLER_PW'],
'servicePrincipalAppId': os.environ['AZURE_CLIENT_ID'],
'servicePrincipalPassword': os.environ['AZURE_CLIENT_SECRET'],
'servicePrincipalTenant': os.environ['AZURE_TENANT_ID']
}
params = {**deploy_secrets, **params}
return self.rm_client.deployments.create_or_update(
resource_group_name=self.resource_group,

Просмотреть файл

@ -4,6 +4,7 @@
Driver for testing template-based deployment of the Avere vFXT product.
"""
import json
from time import time
import pytest
@ -48,6 +49,8 @@ def wait_for_op(op, timeout_sec=60):
result = op.result()
if result:
print('>> operation result: {}'.format(result))
print('>> result.properties: {}'.format(json.dumps(result.properties, indent=4)))
return result
if __name__ == '__main__':