[auto/python] - Fix a bug in printing stack. (#8032)

This commit is contained in:
Komal 2021-09-22 16:49:03 -07:00 committed by GitHub
parent aa79322b46
commit 212ac89366
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,6 @@
### Improvements
### Bug Fixes
- [automation/python] Fix a bug in printing `Stack` if no program is provided.
[#8032](https://github.com/pulumi/pulumi/pull/8032)

View file

@ -101,7 +101,8 @@ class LocalWorkspace(Workspace):
self.save_stack_settings(key, stack_settings[key])
def __repr__(self):
return f"{self.__class__.__name__}(work_dir={self.work_dir!r}, program={self.program.__name__}, " \
return f"{self.__class__.__name__}(work_dir={self.work_dir!r}, " \
f"program={self.program.__name__ if self.program else None}, " \
f"pulumi_home={self.pulumi_home!r}, env_vars={self.env_vars!r}, " \
f"secrets_provider={self.secrets_provider})"

View file

@ -327,6 +327,7 @@ class TestLocalWorkspace(unittest.TestCase):
stack_name = stack_namer(project_name)
work_dir = test_path("data", project_name)
stack = create_stack(stack_name, work_dir=work_dir)
self.assertIsNone(print(stack))
config: ConfigMap = {
"bar": ConfigValue(value="abc"),