Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
bake
Commits
8bb793cb
Commit
8bb793cb
authored
Jan 18, 2021
by
Philip Carns
Browse files
add show config fn and use in daemon
parent
a52946cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/bake-server.h
View file @
8bb793cb
...
...
@@ -128,6 +128,14 @@ int bake_provider_count_storage_targets(bake_provider_t provider,
int
bake_provider_list_storage_targets
(
bake_provider_t
provider
,
bake_target_id_t
*
targets
);
/**
* Retrieves complete configuration of bake provider, encoded as json
*
* @param [in] provider bake provider
* @returns null terminated string that must be free'd by caller
*/
char
*
bake_provider_get_config
(
bake_provider_t
provider
);
#ifdef __cplusplus
}
#endif
...
...
src/bake-server-daemon.c
View file @
8bb793cb
...
...
@@ -158,6 +158,7 @@ int main(int argc, char** argv)
bake_target_id_t
tid
;
struct
bake_provider_init_info
bpargs
=
{
0
};
char
json_config
[
256
]
=
{
0
};
char
*
show_conf
=
NULL
;
if
(
opts
.
pipeline_enabled
)
{
sprintf
(
json_config
,
"{
\"
pipeline_enable
\"
: true}"
);
...
...
@@ -183,6 +184,11 @@ int main(int argc, char** argv)
printf
(
"Provider %d managing new target at multiplex id %d
\n
"
,
i
,
i
+
1
);
printf
(
"Bake provider config:
\n
"
);
printf
(
"=====================
\n
"
);
show_conf
=
bake_provider_get_config
(
provider
);
printf
(
"%s
\n
"
,
show_conf
);
free
(
show_conf
);
}
}
else
{
...
...
@@ -191,6 +197,7 @@ int main(int argc, char** argv)
bake_provider_t
provider
;
struct
bake_provider_init_info
bpargs
=
{
0
};
char
json_config
[
256
]
=
{
0
};
char
*
show_conf
=
NULL
;
if
(
opts
.
pipeline_enabled
)
{
sprintf
(
json_config
,
"{
\"
pipeline_enable
\"
: true}"
);
...
...
@@ -218,6 +225,11 @@ int main(int argc, char** argv)
printf
(
"Provider 0 managing new target at multiplex id %d
\n
"
,
1
);
}
printf
(
"Bake provider config:
\n
"
);
printf
(
"=====================
\n
"
);
show_conf
=
bake_provider_get_config
(
provider
);
printf
(
"%s
\n
"
,
show_conf
);
free
(
show_conf
);
}
/* suspend until the BAKE server gets a shutdown signal from the client */
...
...
src/bake-server.c
View file @
8bb793cb
...
...
@@ -1071,3 +1071,11 @@ static int validate_and_complete_config(struct json_object* _config,
return
(
0
);
}
char
*
bake_provider_get_config
(
bake_provider_t
provider
)
{
const
char
*
content
=
json_object_to_json_string_ext
(
provider
->
json_cfg
,
JSON_C_TO_STRING_PRETTY
|
JSON_C_TO_STRING_NOSLASHESCAPE
);
return
strdup
(
content
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment