The Azure IoT Edge Dev Tool greatly simplifies your Azure IoT Edge development process. It has everything you need to get started and helps with your day-to-day Edge development.
The above screenshots shows the current implement of the function get_device_connection_string. But the correct implementation is as follows:
def get_device_connection_string(self, value, iothub, resource_group):
self.output.status(
f("Retrieving '{value}' connection string..."))
with output_io_cls() as io:
result = self.invoke_az_cli_outproc(["iot", "hub", "device-identity", "connection-string", "show" , "--device-id", value, "--hub-name", iothub,
"--resource-group", resource_group],
f("Could not locate the {value} device in {iothub} IoT Hub in {resource_group}."), stdout_io=io)
if result:
out_string = io.getvalue()
data = json.loads(out_string)
if "cs" in data:
return data["cs"]
else:
return data["connectionString"]
return ''"
For better readability:
Expected behavior
The function implementation should be:
Actual behavior
The current incorrect/outdated implementation is:
Steps to Reproduce
just run the cmd "iotedgedev iothub setup"
and it will fail with following error:
Environment
iotedgedev, version 2.1.0
Python 3.10.12
pip 22.0.2 (python 3.10)
OS: Linux aman-hygenco 6.2.0-32-generic #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Description
For better readability:![image](https://github.com/Azure/iotedgedev/assets/18399738/3f3bdb5d-f8f3-474a-a66a-a5bbdb5f9705)
Expected behavior
The function implementation should be:![image](https://github.com/Azure/iotedgedev/assets/18399738/5e170479-15ed-48d8-8e60-754dbf3f7559)
Actual behavior
The current incorrect/outdated implementation is:![image](https://github.com/Azure/iotedgedev/assets/18399738/aa1b9ea6-8e25-4a71-85b2-d0818c345637)
Steps to Reproduce
just run the cmd "iotedgedev iothub setup" and it will fail with following error:![image](https://github.com/Azure/iotedgedev/assets/18399738/cb3f6704-fb0b-4f6c-8890-2fb6dc717d53)
Environment
iotedgedev, version 2.1.0 Python 3.10.12 pip 22.0.2 (python 3.10) OS: Linux aman-hygenco 6.2.0-32-generic #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux