コード例 #1
0
ファイル: env.py プロジェクト: junaruga/pcs
    def __init__(
        self,
        logger,
        report_processor,
        user_login=None,
        user_groups=None,
        cib_data=None,
        corosync_conf_data=None,
        booth=None,
        pacemaker=None,
        known_hosts_getter=None,
        cluster_conf_data=None,
        request_timeout=None,
    ):
        self._logger = logger
        self._report_processor = report_processor
        self._user_login = user_login
        self._user_groups = [] if user_groups is None else user_groups
        self._cib_data = cib_data
        self._corosync_conf_data = corosync_conf_data
        self._cluster_conf_data = cluster_conf_data
        self._booth = (
            BoothEnv(report_processor, booth) if booth is not None else None
        )
        #pacemaker is currently not mocked and it provides only an access to
        #the authkey
        self._pacemaker =  PacemakerEnv()
        self._request_timeout = request_timeout
        self._is_cman_cluster = None
        # TODO tokens probably should not be inserted from outside, but we're
        # postponing dealing with them, because it's not that easy to move
        # related code currently - it's in pcsd
        self._known_hosts_getter = known_hosts_getter
        self._known_hosts = None
        self._cib_upgrade_reported = False
        self._cib_data_tmp_file = None
        self.__loaded_cib_diff_source = None
        self.__loaded_cib_diff_source_feature_set = None
        self.__loaded_cib_to_modify = None
        self._communicator_factory = NodeCommunicatorFactory(
            LibCommunicatorLogger(self.logger, self.report_processor),
            self.user_login,
            self.user_groups,
            self._request_timeout
        )

        self.__timeout_cache = {}
コード例 #2
0
    def __init__(
        self,
        logger,
        report_processor,
        user_login=None,
        user_groups=None,
        cib_data=None,
        corosync_conf_data=None,
        booth=None,
        pacemaker=None,
        auth_tokens_getter=None,
        cluster_conf_data=None,
        request_timeout=None,
    ):
        self._logger = logger
        self._report_processor = report_processor
        self._user_login = user_login
        self._user_groups = [] if user_groups is None else user_groups
        self._cib_data = cib_data
        self._corosync_conf_data = corosync_conf_data
        self._cluster_conf_data = cluster_conf_data
        self._booth = (BoothEnv(report_processor, booth)
                       if booth is not None else None)
        #pacemaker is currently not mocked and it provides only an access to
        #the authkey
        self._pacemaker = PacemakerEnv()
        self._request_timeout = request_timeout
        self._is_cman_cluster = None
        # TODO tokens probably should not be inserted from outside, but we're
        # postponing dealing with them, because it's not that easy to move
        # related code currently - it's in pcsd
        self._auth_tokens_getter = auth_tokens_getter
        self._auth_tokens = None
        self._cib_upgraded = False
        self._cib_data_tmp_file = None

        self.__timeout_cache = {}