Fix superset cli for python3 (#1760)

* Fix superset cli for python3

dict.iteritems() has been removed since dict.items() returns an
iterable in python3. Shouldn't be a big deal for python2 to load
all the data into a list.

Fix #1756

* bin/superset: avoid some work when reading config

We don't need to unpack and then pack again a dictionary.
This commit is contained in:
Riccardo Magliocchetti 2016-12-04 16:40:56 +01:00 committed by Maxime Beauchemin
parent c4e943a24f
commit abd0974897

View File

@ -23,9 +23,9 @@ class GunicornSupersetApplication(gunicorn.app.base.BaseApplication):
super(GunicornSupersetApplication, self).__init__()
def load_config(self):
config = dict([(key, value) for key, value in self.options.iteritems()
if key in self.cfg.settings and value is not None])
for key, value in config.iteritems():
config = [(key, value) for key, value in self.options.items()
if key in self.cfg.settings and value is not None]
for key, value in config:
self.cfg.set(key.lower(), value)
def load(self):