Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Ignore failure when reading /etc/nmstate folder #2283

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

cathay4t
Copy link
Member

When /etc/nmstate not exists or other failure when reading it, we should
ignore it and exist 0.

Integration test case included.

@@ -15,13 +15,23 @@ pub(crate) fn ncl_service(
.value_of(crate::CONFIG_FOLDER_KEY)
.unwrap_or(crate::DEFAULT_SERVICE_FOLDER);

let config_files = get_config_files(folder)?;
let config_files = match get_config_files(folder) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider using https://crates.io/crates/liboverdrop

When /etc/nmstate not exists or other failure when reading it, we should
ignore it and exist 0.

Integration test case included.

Signed-off-by: Gris Ge <[email protected]>
@cathay4t cathay4t merged commit 2c03f3c into nmstate:base Mar 22, 2023
@cathay4t cathay4t deleted the fix_cli_srv branch March 22, 2023 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants