File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def _connect_to_mqtt(self) -> None:
115
115
self ._mqtt .loop ()
116
116
117
117
self ._logger .info (
118
- f " - device_registration :: connect :: on_connect must be fired. Connected ?"
118
+ " - device_registration :: connect :: on_connect must be fired. Connected ?"
119
119
f"{ self ._mqtt .is_connected ()} "
120
120
)
121
121
@@ -149,7 +149,7 @@ def _start_registration(self) -> None:
149
149
def _wait_for_operation (self ) -> None :
150
150
message = json .dumps ({"operationId" : self ._operation_id })
151
151
self ._mqtt .publish (
152
- f "$dps/registrations/GET/iotdps-get-operationstatus/?$rid="
152
+ "$dps/registrations/GET/iotdps-get-operationstatus/?$rid="
153
153
f"{ self ._device_id } &operationId={ self ._operation_id } " ,
154
154
message ,
155
155
)
@@ -180,7 +180,7 @@ def register_device(self, expiry: int) -> str:
180
180
181
181
username = (
182
182
f"{ self ._id_scope } /registrations/{ self ._device_id } /api-version="
183
- f"{ constants .DPS_API_VERSION } "
183
+ + f"{ constants .DPS_API_VERSION } "
184
184
)
185
185
186
186
# pylint: disable=C0103
@@ -191,7 +191,7 @@ def register_device(self, expiry: int) -> str:
191
191
sig_encoded = quote (sig_no_encode , "~()*!.'" )
192
192
auth_string = (
193
193
f"SharedAccessSignature sr={ sr } &sig={ sig_encoded } &se={ expiry } "
194
- f "&skn=registration"
194
+ "&skn=registration"
195
195
)
196
196
197
197
MQTT .set_socket (self ._socket , self ._iface )
Original file line number Diff line number Diff line change @@ -121,10 +121,12 @@ def _gen_sas_token(self) -> str:
121
121
def _create_mqtt_client (self ) -> None :
122
122
MQTT .set_socket (self ._socket , self ._iface )
123
123
124
+ log_text = (
125
+ f"- iot_mqtt :: _on_connect :: username = { self ._username } , password = "
126
+ + f"{ self ._passwd } "
127
+ )
124
128
self ._logger .debug (
125
- str .replace (
126
- f"- iot_mqtt :: _on_connect :: username = { self ._username } , password ="
127
- f"{ self ._passwd } " ,
129
+ log_text .replace (
128
130
"%" ,
129
131
"%%" ,
130
132
)
You can’t perform that action at this time.
0 commit comments