Make the Python SDK's Config.name argument optional (#2624)

This makes the Python SDK's Config constructor name argument
optional, similar to what we do in the Node.js SDK. If not supplied,
the current project name is used as the default.
This commit is contained in:
Joe Duffy 2019-04-04 16:55:01 -07:00 committed by GitHub
parent f3379b1190
commit cc7a657628
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,8 @@
### Improvements
- Correctly handle the case where we would fail to detect an archive type if the filename included a dot in it. (fixes [pulumi/pulumi#2589](https://github.com/pulumi/pulumi/issues/2589))
- Make `Config`'s constructor's `name` argument optional in Python, for consistency with our Node.js SDK. If it isn't
supplied, the current project name is used as the default.
## 0.17.4 (Released March 26, 2019)

View file

@ -36,10 +36,10 @@ class Config:
The configuration bag's logical name that uniquely identifies it. The default is the name of the current project.
"""
def __init__(self, name: str) -> None:
def __init__(self, name: Optional[str] = None) -> None:
"""
:param str name: The configuration bag's logical name that uniquely identifies it. The default is the name of
the current project.
:param str name: The configuration bag's logical name that uniquely identifies it. If not provided, the name
of the current project is used.
"""
if not name:
name = get_project()