auto/terraform: straight up return a string for logs
This commit is contained in:
parent
3e4862e142
commit
f96bbcf49d
1 changed files with 2 additions and 6 deletions
|
@ -29,7 +29,7 @@ class TerraformAutomation(BaseAutomation):
|
||||||
def tf_apply(self, *,
|
def tf_apply(self, *,
|
||||||
refresh: bool = True,
|
refresh: bool = True,
|
||||||
parallelism: Optional[int] = None,
|
parallelism: Optional[int] = None,
|
||||||
lock_timeout: int = 15) -> Tuple[int, List[Dict[str, Any]]]:
|
lock_timeout: int = 15) -> Tuple[int, str]:
|
||||||
if not parallelism:
|
if not parallelism:
|
||||||
parallelism = self.parallelism
|
parallelism = self.parallelism
|
||||||
tf = subprocess.run(
|
tf = subprocess.run(
|
||||||
|
@ -43,11 +43,7 @@ class TerraformAutomation(BaseAutomation):
|
||||||
],
|
],
|
||||||
cwd=self.working_directory(),
|
cwd=self.working_directory(),
|
||||||
stdout=subprocess.PIPE)
|
stdout=subprocess.PIPE)
|
||||||
logs = []
|
return tf.returncode, tf.stdout.decode('utf-8')
|
||||||
for line in tf.stdout.decode('utf-8').split('\n'):
|
|
||||||
if line.strip():
|
|
||||||
logs.append(json.loads(line))
|
|
||||||
return tf.returncode, str(logs)
|
|
||||||
|
|
||||||
def tf_generate(self):
|
def tf_generate(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue