You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be awesome if ConsumptionManagementClient could be used as a context manager just like ComputeClientManagement.
Currently, this does not work as ConsumptionManagementClient only inherits from object and has no __enter__/__exit__ methods, unlike ComputeClientManagement that does inherit from msrest.service_client.SDKClient:
consumption_client = ConsumptionManagementClient(**parameters)
with consumption_client as client:
response = client.price_sheet.get(expand="meterDetails", raw=True)
A dirty work-around that works:
consumption_client = ConsumptionManagementClient(**parameters)
with consumption_client._client:
response = consumption_client.price_sheet.get(expand="meterDetails", raw=True)
Hi,
it would be awesome if
ConsumptionManagementClient
could be used as a context manager just likeComputeClientManagement
.Currently, this does not work as
ConsumptionManagementClient
only inherits fromobject
and has no__enter__
/__exit__
methods, unlikeComputeClientManagement
that does inherit frommsrest.service_client.SDKClient
:A dirty work-around that works:
Related: #132 (comment)
The text was updated successfully, but these errors were encountered: