----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51108/#review151433 -----------------------------------------------------------
src/cli_new/bin/config.py (line 52) <https://reviews.apache.org/r/51108/#comment219767> Period at the end. src/cli_new/bin/config.py (lines 78 - 82) <https://reviews.apache.org/r/51108/#comment219768> Given all this repeated load/validation code, you may consider doing something more dynamic: ``` for config_key in CONFIG_DATA.keys(): config_key_upper = config_key.upper() if config_key_upper in globals(): if not isinstance(CONFIG_DATA[config_key], type(globals()[config_key_upper])): raise CLIException("some error") globals()[config_key_upper] = CONFIG_DATA[config_key] else: # Log that we're ignoring this key. # Or bail out. ``` This replaces existing global config variables as long as the loaded JSON has the same type. - Joseph Wu On Aug. 15, 2016, 6:44 p.m., Haris Choudhary wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51108/ > ----------------------------------------------------------- > > (Updated Aug. 15, 2016, 6:44 p.m.) > > > Review request for mesos, Joseph Wu and Kevin Klues. > > > Bugs: mesos-5676 > https://issues.apache.org/jira/browse/mesos-5676 > > > Repository: mesos > > > Description > ------- > > These parameters will be used by future plugins in the CLI. We can either > edit them directly from the config file or discover them through environment > variables. The environment variables override any edits made to the config > file. > > Also added the ability to format command flags in the base plugin class. This > allows > us to not import the config file within individual plugins to do so. > The Key-Value pairs for formatting will be introduced with with future > plugins. > > > Diffs > ----- > > src/cli_new/bin/config.py PRE-CREATION > src/cli_new/lib/mesos/plugins/base.py PRE-CREATION > > Diff: https://reviews.apache.org/r/51108/diff/ > > > Testing > ------- > > > Thanks, > > Haris Choudhary > >
