Component
Python SDK
Task Description
In version 2.0 of the SDK we should remove the InfrahubCheck.init() method:
|
@classmethod |
|
async def init(cls, client: Optional[InfrahubClient] = None, *args: Any, **kwargs: Any) -> InfrahubCheck: |
|
"""Async init method, If an existing InfrahubClient client hasn't been provided, one will be created automatically.""" |
|
warnings.warn( |
|
"InfrahubCheck.init has been deprecated and will be removed in the version in Infrahub SDK 2.0.0", |
|
DeprecationWarning, |
|
stacklevel=1, |
|
) |
|
if not client: |
|
client_module = importlib.import_module("infrahub_sdk.client") |
|
client_class = getattr(client_module, _client_class) |
|
client = client_class() |
|
kwargs["client"] = client |
|
return cls(*args, **kwargs) |
Component
Python SDK
Task Description
In version 2.0 of the SDK we should remove the InfrahubCheck.init() method:
infrahub-sdk-python/infrahub_sdk/checks.py
Lines 84 to 97 in edb5991