thin-edge.io icon indicating copy to clipboard operation
thin-edge.io copied to clipboard

Directory for custom fragments /etc/tedge/device does not exist

Open mbay-ODW opened this issue 1 year ago • 6 comments

Describe the bug To add custom fragments to a device it is mentioned that /etc/tedge/device/inventory.json should be populated. However currently neither the file inventory.json nor the directory /etc/tedge/device/ does exist. Since the /etc/tedge directory is created during the installation process it would be a better user experience to create the directory or event better the file directly.

mbay-ODW avatar Aug 25 '22 05:08 mbay-ODW

Thanks @mbay-ODW . We will change our implementation to create /etc/tedge/device/ by tedge_mapper --init c8y.

rina23q avatar Sep 06 '22 10:09 rina23q

The inventory.json is always parsed from the standard path( /etc/tedge/device/inventory.json), when the config directory is created in the custom path (using --config-dir) then it will not work.

PradeepKiruvale avatar Sep 08 '22 13:09 PradeepKiruvale

Resolved #1425

PradeepKiruvale avatar Sep 12 '22 09:09 PradeepKiruvale

Steps to test:

Install thin-edge from here https://github.com/thin-edge/thin-edge.io/actions/runs/3035966989

Test 1:

sudo tedge --init sudo -u tedge -- tedge_mapper --init c8y Check if there is a /etc/tedge/device directory

Test 2: sudo tedge --init --config-dir /tmp/test sudo -u tedge -- tedge_mapper --config-dir /tmp/test --init c8y Check if there is a /tmp/test/device directory

PradeepKiruvale avatar Sep 13 '22 14:09 PradeepKiruvale

@PradeepKiruvale Both tests are failing or wrongly explained

gligorisaev avatar Sep 15 '22 15:09 gligorisaev

Tested. The Directory existance check will be integrated in some of the automated tests

gligorisaev avatar Sep 16 '22 06:09 gligorisaev

@mbay-ODW Now on the installation of the mapper, the directory {CONFIG_DIR}/device (CONFIG_DIR by default is /etc/tedge) will be created by tedge_mapper --init c8y. Can we close the issue?

rina23q avatar Sep 29 '22 09:09 rina23q

Yes @rina23q, will close. Thanks!

mbay-ODW avatar Sep 29 '22 12:09 mbay-ODW