Make 'users' hash of 'bootstrap' stanza optional (#334)

fix by @sm97
This commit is contained in:
Kirill Pushkin
2016-10-07 10:57:53 +02:00
committed by Alexander Kukushkin
parent 48a6af6994
commit 6c9a870f09
+1 -1
View File
@@ -1006,7 +1006,7 @@ $$""".format(name, ' '.join(options)), name, password, password)
def bootstrap(self, config):
""" Initialize a new node from scratch and start it. """
if self._initialize(config) and self.start() and self.run_bootstrap_post_init(config):
for name, value in config['users'].items():
for name, value in (config.get('users') or {}).items():
if name not in (self._superuser.get('username'), self._replication['username']):
self.create_or_update_role(name, value['password'], value.get('options', []))
self.create_or_update_role(self._replication['username'], self._replication['password'], ['REPLICATION'])