Skip to content

Commit

Permalink
Issues 147
Browse files Browse the repository at this point in the history
For a full description please read here
eclipse-bluechi#147.
For each of the node types [hirte, agent] hirte
will get the default config from the default
files located in /usr/shar/hirte/{hirte|agent}
into the hashmap and only after that it will
get the custome config that the usr changed

Signed-off-by: Artiom Divak <adivak@redhat.com>
  • Loading branch information
ArtiomDivak committed Mar 6, 2023
1 parent dd4933f commit 343169d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ install_data(
'agent/agent.conf',
install_dir : get_option('sysconfdir') / 'hirte'
)

install_data(
'agent/hirte-default.conf',
install_dir : '/usr/share/hirte/agent'
)

install_data(
'hirte/hirte-default.conf',
install_dir : '/usr/share/hirte/hirte'
)


2 changes: 1 addition & 1 deletion src/agent/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ bool agent_parse_config(Agent *agent, const char *configfile) {

result = cfg_load_complete_configuration(
agent->config,
NULL, // TODO: https://github.com/containers/hirte/issues/147
CFG_USR_DEF_AGENT_CONF,
CFG_ETC_HIRTE_AGENT_CONF,
NULL); // TODO: https://github.com/containers/hirte/issues/148
if (result != 0) {
Expand Down
2 changes: 2 additions & 0 deletions src/libhirte/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ typedef struct config config;

/* Standard configuration file locations
*/
#define CFG_USR_DEF_AGENT_CONF "/usr/share/hirte/config/agent/hirte-default.conf"
#define CFG_USR_DEF_HIRTE_CONF "/usr/share/hirte/config/hirte/hirte-default.conf"
#define CFG_ETC_HIRTE_CONF "/etc/hirte/hirte.conf"
#define CFG_ETC_HIRTE_AGENT_CONF "/etc/hirte/agent.conf"

Expand Down
2 changes: 1 addition & 1 deletion src/manager/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ bool manager_parse_config(Manager *manager, const char *configfile) {

result = cfg_load_complete_configuration(
manager->config,
NULL, // TODO: https://github.com/containers/hirte/issues/147
CFG_USR_DEF_HIRTE_CONF,
CFG_ETC_HIRTE_CONF,
NULL); // TODO: https://github.com/containers/hirte/issues/148
if (result != 0) {
Expand Down

0 comments on commit 343169d

Please sign in to comment.