async def get_non_whitelisted_option_widgets(self): options = await app.juju.charmstore.config(self.application.charm) svc_opts_whitelist = utils.get_options_whitelist( self.application.name) hidden = [n for n in options['Options'].keys() if n not in svc_opts_whitelist] return self._get_option_widgets(hidden, options['Options'])
def get_non_whitelisted_option_widgets(self): service_id = self.application.csid.as_str_without_rev() options = self.metadata_controller.get_options(service_id) svc_opts_whitelist = utils.get_options_whitelist( self.application.service_name) hidden = [n for n in options.keys() if n not in svc_opts_whitelist] return self._get_option_widgets(hidden, options)
def get_whitelisted_option_widgets(self): service_id = self.application.csid.as_str_without_rev() options = self.metadata_controller.get_options(service_id) svc_opts_whitelist = utils.get_options_whitelist( self.application.service_name) hidden = [n for n in options.keys() if n not in svc_opts_whitelist] log.info("Hiding options not in the whitelist: {}".format(hidden)) return self._get_option_widgets(svc_opts_whitelist, options)
async def get_whitelisted_option_widgets(self): options = await app.juju.charmstore.config(self.application.charm) svc_opts_whitelist = utils.get_options_whitelist( self.application.name) hidden = [n for n in options['Options'].keys() if n not in svc_opts_whitelist] app.log.info("Hiding options not in the whitelist: {}".format(hidden)) return self._get_option_widgets(svc_opts_whitelist, options['Options'])
def build_widget(self): ws = [] max_app_name_len = max( [len(a.service_name) for a in self.applications]) for application in self.applications: ws.append(Text("")) wl = get_options_whitelist(application.service_name) hide_config = application.subordinate and len(wl) == 0 ws.append( ApplicationWidget(application, max_app_name_len, self.deploy_one, self._config_cb, self._arch_cb, hide_config=hide_config)) return ws
def build_widgets(self): ws = [Text("{} Applications in {}:".format(len(self.applications), app.config['spell']))] max_app_name_len = max([len(a.service_name) for a in self.applications]) for a in self.applications: ws.append(Text("")) wl = get_options_whitelist(a.service_name) hide_config = a.subordinate and len(wl) == 0 ws.append(ApplicationWidget(a, max_app_name_len, self.controller, self.do_deploy, hide_config=hide_config)) self.description_w = Text("App description") self.pile = Pile(ws) return Padding.center_90(Filler(self.pile, valign="top"))
def get_option_widgets(self): ws = [] service_id = self.application.csid.as_str_without_rev() options = self.metadata_controller.get_options(service_id) svc_opts_whitelist = utils.get_options_whitelist( self.application.service_name) hidden = [n for n in options.keys() if n not in svc_opts_whitelist] log.info("Hiding options not in the whitelist: {}".format(hidden)) for opname in svc_opts_whitelist: opdict = options[opname] cv = self.application.options.get(opname, None) ow = OptionWidget(opname, opdict['Type'], opdict['Description'], opdict['Default'], current_value=cv, value_changed_callback=self.handle_edit) ws.append(ow) return ws
def build_widgets(self): ws = [ Text("{} Applications in {}:".format(len(self.applications), app.config['spell'])) ] max_app_name_len = max( [len(a.service_name) for a in self.applications]) for a in self.applications: ws.append(Text("")) wl = get_options_whitelist(a.service_name) hide_config = a.subordinate and len(wl) == 0 ws.append( ApplicationWidget(a, max_app_name_len, self.controller, self.do_deploy, hide_config=hide_config)) self.description_w = Text("App description") self.pile = Pile(ws) return Padding.center_90(Filler(self.pile, valign="top"))