Skip to content

Conversation

@avery-blanchard
Copy link
Contributor

This fixes #390 and reduces the number of times the configuration file is loaded during startup. To achieve this, the opened Ini object is passed around rather than being opened with each call to config_get or config_get_env.
@lkatalin

@lkatalin
Copy link
Contributor

Sorry I forgot to mention the DCO @avery-blanchard ! You can update your commit(s) to have your sign off with git commit --amend -s (this will change the latest commit to have it).

Avery Blanchard added 2 commits June 29, 2022 16:29
Signed-off-by: Avery Blanchard <ablancha@redhat.com>
Signed-off-by: Avery Blanchard <ablancha@redhat.com>
@lkatalin
Copy link
Contributor

/packit retest-failed

src/common.rs Outdated
/// Returns revocation ip from keylime.conf if env var not present
fn revocation_ip_get() -> Result<String> {
config_get_env("general", "receive_revocation_ip", "REVOCATION_IP")
fn revocation_ip_get(conf_name: &str, conf: &Ini) -> Result<String> {
Copy link
Contributor

Choose a reason for hiding this comment

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

These couple of functions (revocation_ip_get and revocation_port_get) are not used anywhere. We could use them in KeylimeConfig::build or perhaps just remove the functions.

@lkatalin
Copy link
Contributor

lkatalin commented Jul 1, 2022

Thanks @avery-blanchard ! Pretty much LGTM.

One nit: In your last commit (removing the two extra functions), you're also including some changes to make &String into &str. Just for clarity I would either amend your commit message to describe that as well, or alternatively edit your earlier commit to already include this change so that it doesn't show up in the later commit.

…ange String to &str.

Signed-off-by: Avery Blanchard <ablancha@redhat.com>
@lkatalin lkatalin merged commit 9c27905 into keylime:master Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config file is loaded many times at startup

5 participants