From a4baacb2f9705746b89362c0825b855d38f04004 Mon Sep 17 00:00:00 2001 From: Paymaun Date: Mon, 24 May 2021 17:05:08 -0700 Subject: [PATCH] Use enum value instead of literal str. (#349) --- azext_iot/_factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azext_iot/_factory.py b/azext_iot/_factory.py index d7bd2d6f6..aee601e82 100644 --- a/azext_iot/_factory.py +++ b/azext_iot/_factory.py @@ -10,7 +10,7 @@ from azext_iot.common.sas_token_auth import SasTokenAuthentication from azext_iot.iothub.providers.aad_oauth import IoTHubOAuth -from azext_iot.common.shared import SdkType +from azext_iot.common.shared import SdkType, AuthenticationTypeDataplane from azext_iot.constants import USER_AGENT, IOTHUB_RESOURCE_ID from msrestazure.azure_exceptions import CloudError @@ -102,7 +102,7 @@ def _get_iothub_service_sdk(self): if self.auth_override: credentials = self.auth_override - elif self.target["policy"] == "login": + elif self.target["policy"] == AuthenticationTypeDataplane.login.value: credentials = IoTHubOAuth( cmd=self.target["cmd"], resource_id=IOTHUB_RESOURCE_ID