From 6c9a870f099173ddc342ba2b26494b51152ba40e Mon Sep 17 00:00:00 2001 From: Kirill Pushkin Date: Fri, 7 Oct 2016 12:57:53 +0400 Subject: [PATCH] Make 'users' hash of 'bootstrap' stanza optional (#334) fix by @sm97 --- patroni/postgresql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patroni/postgresql.py b/patroni/postgresql.py index 814fb6ca..332a99d3 100644 --- a/patroni/postgresql.py +++ b/patroni/postgresql.py @@ -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'])