You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by om...@apache.org on 2019/08/08 20:58:45 UTC
[incubator-dlab] branch DLAB-terraform updated: fix output file
processor
This is an automated email from the ASF dual-hosted git repository.
omartushevskyi pushed a commit to branch DLAB-terraform
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-terraform by this push:
new aae1b68 fix output file processor
new eab75a6 Merge pull request #234 from bohdana-kuzmenko/DLAB-terraform
aae1b68 is described below
commit aae1b6857684628e17fc70d1a2858ce3eb6e6b3b
Author: bogdana <bo...@gmail.com>
AuthorDate: Thu Aug 8 23:57:27 2019 +0300
fix output file processor
---
infrastructure-provisioning/terraform/bin/dlab.py | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/infrastructure-provisioning/terraform/bin/dlab.py b/infrastructure-provisioning/terraform/bin/dlab.py
index 4eecc79..cc14fc9 100644
--- a/infrastructure-provisioning/terraform/bin/dlab.py
+++ b/infrastructure-provisioning/terraform/bin/dlab.py
@@ -46,7 +46,7 @@ class LocalStorageOutputProcessor(TerraformOutputBase):
with open(self.output_path, 'r') as fp:
output = fp.read()
if len(output):
- existed_data = json.loads(fp.read())
+ existed_data = json.loads(output)
existed_data.update(obj)
with open(self.output_path, 'w') as fp:
@@ -64,7 +64,8 @@ class LocalStorageOutputProcessor(TerraformOutputBase):
output = self.extract()
updated = {key: value for key, value in output.items()
if key not in keys}
- self.write(updated)
+ with open(self.output_path, 'w') as fp:
+ json.dump(updated, fp)
def get_args_string(cli_args):
@@ -664,17 +665,7 @@ class AWSK8sSourceBuilder(AbstractDeployBuilder):
def destroy(self):
logging.info('ssn-k8s destroy')
output_processor = LocalStorageOutputProcessor()
- ip = (output_processor.extract()
- .get('ssn_k8s_masters_ip_addresses', ['test'])[0])
- endpoint_output_keys = []
- try:
- with Console.ssh(ip, self.user_name, self.pkey_path) as conn:
- with conn.cd('terraform/ssn-helm-charts/main'):
- output = ' '.join(conn.run('terraform output -json')
- .stdout.split())
- endpoint_output_keys.extend(list(json.loads(output).keys()))
- except Exception:
- logging.info('could not connect to remote')
+ endpoint_output_keys = ['keycloak_client_secret']
endpoint_output_keys.extend(
json.loads(TerraformProvider().output('-json')).keys())
output_processor.remove_keys(endpoint_output_keys)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org