示例#1
0
    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)
示例#2
0
文件: extm.py 项目: jeffwhite530/dcos
    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