def handle_install_extras(self): """DC/OS package install extra options handler.""" install_sect = self._ext_conf.get(EXTCFG_SECTION.INSTALL, {}) if not isinstance(install_sect, dict): raise extm_exc.InstExtrasManagerConfigError( f'Invalid configuration container structure:' f' {EXTCFG_SECTION.INSTALL}: {install_sect}') exec_ext_cmd_opt = install_sect.get(EXTCFG_OPTION.EXEC_EXT_CMD, []) if not isinstance(exec_ext_cmd_opt, list): raise extm_exc.InstExtrasManagerConfigError( f'Invalid configuration container structure:' f' {EXTCFG_OPTION.EXEC_EXT_CMD}: {exec_ext_cmd_opt}') # Handle the 'execute external commands' option self._exec_external_commands(*exec_ext_cmd_opt)
def __init__(self, ext_conf): """Constructor. :param ext_conf: dict, package installation extras config """ if not isinstance(ext_conf, dict): raise extm_exc.InstExtrasManagerConfigError( f'Invalid configuration container structure: {ext_conf}') self.ext_conf = ext_conf