Browse Source

Parse roles from manifest.yaml

Changes extracted from 7fe40246f70ea1830b021f304bd8aa1ff810cc54:

Sync state to debug client->server async connection
Sajin Sasy 1 year ago
parent
commit
6ea810f8ec
2 changed files with 3 additions and 1 deletions
  1. 2 0
      App/appconfig.cpp
  2. 1 1
      App/mkconfig.py

+ 2 - 0
App/appconfig.cpp

@@ -111,6 +111,8 @@ bool config_parse(Config &config, const std::string configstr,
                             sizeof(nc.pubkey));
                     } else if (!nentry.first.compare("weight")) {
                         nc.weight = nentry.second.get_value<std::uint8_t>();
+                    } else if (!nentry.first.compare("roles")) {
+                        nc.roles = nentry.second.get_value<std::uint8_t>();
                     } else if (!nentry.first.compare("listen")) {
                         ret &= split_host_port(nc.listenhost, nc.listenport,
                             nentry.second.get_value<std::string>());

+ 1 - 1
App/mkconfig.py

@@ -47,7 +47,7 @@ def create_json(manifestfile, pubkeysfile, nodelist, params_override):
         nodeconf['pubkey'] = pubkeys[node]
         nodeconf['listen'] = m['listen']
         # Optional fields
-        for f in ['clisten', 'weight']:
+        for f in ['clisten', 'weight', 'roles']:
             if f in m:
                 nodeconf[f] = m[f]
         config['nodes'].append(nodeconf)