Skip to content

Commit

Permalink
Override python version _before_ parsing the configs and rendering te…
Browse files Browse the repository at this point in the history
…mplate strings
  • Loading branch information
jhunkeler committed Mar 8, 2024
1 parent 655f0ca commit f295d56
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ int main(int argc, char *argv[], char *arge[]) {
memset(omc_sysconfdir_tmp, 0, sizeof(omc_sysconfdir_tmp));
}

// Override Python version from command-line, if any
if (strlen(python_override_version)) {
guard_free(ctx.meta.python)
ctx.meta.python = strdup(python_override_version);
guard_free(ctx.meta.python_compact);
ctx.meta.python_compact = to_short_version(ctx.meta.python);
}

if (config_input) {
msg(OMC_MSG_L2, "Reading OMC global configuration: %s\n", config_input);
cfg = ini_open(config_input);
Expand All @@ -291,14 +299,6 @@ int main(int argc, char *argv[], char *arge[]) {
exit(1);
}

// Override Python version from command-line, if any
if (strlen(python_override_version)) {
guard_free(ctx.meta.python)
ctx.meta.python = strdup(python_override_version);
guard_free(ctx.meta.python_compact);
ctx.meta.python_compact = to_short_version(ctx.meta.python);
}

if (delivery_init(&ctx, ini, cfg)) {
msg(OMC_MSG_ERROR | OMC_MSG_L1, "Failed to initialize delivery context\n");
exit(1);
Expand Down

0 comments on commit f295d56

Please sign in to comment.