1 #include "libaktualizr/config.h"
2 #include "utilities/config_utils.h"
4 void StorageConfig::updateFromPropertyTree(
const boost::property_tree::ptree& pt) {
5 CopyFromConfig(type,
"type", pt);
6 CopyFromConfig(path,
"path", pt);
7 CopyFromConfig(sqldb_path,
"sqldb_path", pt);
8 CopyFromConfig(uptane_metadata_path,
"uptane_metadata_path", pt);
9 CopyFromConfig(uptane_private_key_path,
"uptane_private_key_path", pt);
10 CopyFromConfig(uptane_public_key_path,
"uptane_public_key_path", pt);
11 CopyFromConfig(tls_cacert_path,
"tls_cacert_path", pt);
12 CopyFromConfig(tls_pkey_path,
"tls_pkey_path", pt);
13 CopyFromConfig(tls_clientcert_path,
"tls_clientcert_path", pt);
16 void StorageConfig::writeToStream(std::ostream& out_stream)
const {
17 writeOption(out_stream, type,
"type");
18 writeOption(out_stream, path,
"path");
19 writeOption(out_stream, sqldb_path.get(
""),
"sqldb_path");
20 writeOption(out_stream, uptane_metadata_path.get(
""),
"uptane_metadata_path");
21 writeOption(out_stream, uptane_private_key_path.get(
""),
"uptane_private_key_path");
22 writeOption(out_stream, uptane_public_key_path.get(
""),
"uptane_public_key_path");
23 writeOption(out_stream, tls_cacert_path.get(
""),
"tls_cacert_path");
24 writeOption(out_stream, tls_pkey_path.get(
""),
"tls_pkey_path");
25 writeOption(out_stream, tls_clientcert_path.get(
""),
"tls_clientcert_path");
28 void ImportConfig::updateFromPropertyTree(
const boost::property_tree::ptree& pt) {
29 CopyFromConfig(base_path,
"base_path", pt);
30 CopyFromConfig(uptane_private_key_path,
"uptane_private_key_path", pt);
31 CopyFromConfig(uptane_public_key_path,
"uptane_public_key_path", pt);
32 CopyFromConfig(tls_cacert_path,
"tls_cacert_path", pt);
33 CopyFromConfig(tls_pkey_path,
"tls_pkey_path", pt);
34 CopyFromConfig(tls_clientcert_path,
"tls_clientcert_path", pt);
37 void ImportConfig::writeToStream(std::ostream& out_stream)
const {
38 writeOption(out_stream, base_path,
"base_path");
39 writeOption(out_stream, uptane_private_key_path.get(
""),
"uptane_private_key_path");
40 writeOption(out_stream, uptane_public_key_path.get(
""),
"uptane_public_key_path");
41 writeOption(out_stream, tls_cacert_path.get(
""),
"tls_cacert_path");
42 writeOption(out_stream, tls_pkey_path.get(
""),
"tls_pkey_path");
43 writeOption(out_stream, tls_clientcert_path.get(
""),
"tls_clientcert_path");