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

vtysh_config: do not warn about non-existing configuration file #14969

Closed
wants to merge 1 commit into from

Conversation

nivelus
Copy link

@nivelus nivelus commented Dec 8, 2023

We not always check return status, so it is not fatal to have missing file. And when it is fatal, we check status and print another message.

We not always check return status, so it is not fatal to have missing file.
And when it is fatal, we check status and print another message.
@ton31337
Copy link
Member

ton31337 commented Dec 8, 2023

And when it is fatal, we check status and print another message.

Which one?

@nivelus
Copy link
Author

nivelus commented Dec 9, 2023

"[%d|%s] Configuration file[%s] processing failure: %d\n",
-- code is a bit different from what I have (Debian 12).

@ton31337
Copy link
Member

ton31337 commented Dec 9, 2023

But processing failure: does not give the real reason why it's failed... Then we need to pass it logging there (vtysh_apply_config()) too?

@nivelus
Copy link
Author

nivelus commented Dec 10, 2023

How about returning tuple (FRR error code and errno if needed or 0 otherwise) from vtysh_read_config, and translating errno to text in vtysh_apply_config functions? Or we can map errno to FRR error code, but I think it will create unneeded mess. vtysh_read_config is static, and used only here, so it's cheap to change return value.

@ton31337
Copy link
Member

What if doing the reverse? Moving this kind of code:

		if (do_fork)
			fprintf(stderr,
				"[%d|%s] Configuration file[%s] processing failure: %d\n",
				getpid(), my_client, frr_config, ret);
		else
			fprintf(stderr,
				"Configuration file[%s] processing failure: %d\n",
				frr_config, ret);

to vtysh_read_config()?

Copy link

This PR is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this PR closed.

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.

2 participants