-
Notifications
You must be signed in to change notification settings - Fork 72
tedge cert create-csr output-path flag fails when given a relative address #3547
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingtheme:certificatesTheme: Device certificate topicsTheme: Device certificate topicstheme:cliTheme: cli related topicsTheme: cli related topics
Milestone
Description
Describe the bug
When creating a local CSR via tedge cert create-csr c8y and giving an explicit output path, the command fails
when a relative path is given.
$ tedge cert create-csr c8y --device-id example --output-path ./local.csr
Error: failed to Generate a Certificate Signing Request.
Caused by:
Invalid device.cert_path path: Relative path: "./local.csr" is not permitted. Provide an absolute path instead.However the command creates the CSR if the full path is given, however enforcing the user to provide the full path when calling a CLI command is unexpected.
$ tedge cert create-csr c8y --output-path "$(pwd)/local.csr"To Reproduce
It can be reproduced by running:
$ tedge cert create-csr c8y --device-id example --output-path ./local.csrExpected behavior
Relative paths should be supported when provided via the --output-path flag. The flag output should be expanded to the full path after parsing the command.
So it is expected that the following produce a local.csr file in the current working directory.
$ tedge cert create-csr c8y --device-id example --output-path ./local.csrScreenshots
Environment (please complete the following information):
- OS [incl. version]:
macOS - Hardware [incl. revision]:
aarch64 - System-Architecture [e.g. result of "uname -a"]:
Darwin example.local 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:35:29 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6000 arm64 - thin-edge.io version [e.g. 0.1.0]:
tedge 1.4.3~428+g42bf3a1
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtheme:certificatesTheme: Device certificate topicsTheme: Device certificate topicstheme:cliTheme: cli related topicsTheme: cli related topics