Пример #1
0
    def __init__(self):
        self.state_change_wait_time = CONF.state_change_wait_time

        self.mongod_configuration_manager = ConfigurationManager(
            system.MONGOD_CONFIG_FILE,
            system.MONGO_USER,
            system.MONGO_USER,
            SafeYamlCodec(default_flow_style=False),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(
                system.MONGOD_CONFIG_OVERRIDES_DIR))

        self.mongos_configuration_manager = ConfigurationManager(
            system.MONGOS_CONFIG_FILE,
            system.MONGO_USER,
            system.MONGO_USER,
            SafeYamlCodec(default_flow_style=False),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(
                system.MONGOS_CONFIG_OVERRIDES_DIR))

        self.configuration_manager = self.mongod_configuration_manager
        self.is_query_router = False
        self.is_cluster_member = False
        self.status = MongoDBAppStatus()
Пример #2
0
    def __init__(self, state_change_wait_time=None):
        """
        Sets default status and state_change_wait_time
        """
        if state_change_wait_time:
            self.state_change_wait_time = state_change_wait_time
        else:
            self.state_change_wait_time = CONF.state_change_wait_time

        revision_dir = guestagent_utils.build_file_path(
            os.path.dirname(system.REDIS_CONFIG),
            ConfigurationManager.DEFAULT_STRATEGY_OVERRIDES_SUB_DIR)
        config_value_mappings = {'yes': True, 'no': False, "''": None}
        self._value_converter = StringConverter(config_value_mappings)
        self.configuration_manager = ConfigurationManager(
            system.REDIS_CONFIG,
            system.REDIS_OWNER,
            system.REDIS_OWNER,
            PropertiesCodec(unpack_singletons=False,
                            string_mappings=config_value_mappings),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(revision_dir))

        self.admin = self._build_admin_client()
        self.status = RedisAppStatus(self.admin)
Пример #3
0
    def __init__(self, *args, **kwargs):
        super(PgSqlConfig, self).__init__(*args, **kwargs)

        revision_dir = guestagent_utils.build_file_path(
            os.path.dirname(self.pgsql_config),
            ConfigurationManager.DEFAULT_STRATEGY_OVERRIDES_SUB_DIR)
        self._configuration_manager = ConfigurationManager(
            self.pgsql_config, self.PGSQL_OWNER, self.PGSQL_OWNER,
            PropertiesCodec(
                delimiter='=',
                string_mappings={'on': True, 'off': False, "''": None}),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(revision_dir))
Пример #4
0
    def __init__(self):
        self.state_change_wait_time = CONF.state_change_wait_time

        revision_dir = self._init_overrides_dir()
        self.configuration_manager = ConfigurationManager(
            CONFIG_FILE, system.MONGO_USER, system.MONGO_USER,
            SafeYamlCodec(default_flow_style=False),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(revision_dir))

        self.is_query_router = False
        self.is_cluster_member = False
        self.status = MongoDBAppStatus()
Пример #5
0
 def __init__(self):
     self._configuration_manager = ConfigurationManager(
         self.PGSQL_CONFIG,
         self.PGSQL_OWNER,
         self.PGSQL_OWNER,
         PropertiesCodec(delimiter='=',
                         string_mappings={
                             'on': True,
                             'off': False,
                             "''": None
                         }),
         requires_root=True,
         override_strategy=OneFileOverrideStrategy(
             self._init_overrides_dir()))
Пример #6
0
    def __init__(self):
        """By default login with root no password for initial setup."""
        self.state_change_wait_time = CONF.state_change_wait_time
        self.status = CassandraAppStatus(self.get_current_superuser())

        revision_dir = guestagent_utils.build_file_path(
            os.path.dirname(self.cassandra_conf),
            ConfigurationManager.DEFAULT_STRATEGY_OVERRIDES_SUB_DIR)
        self.configuration_manager = ConfigurationManager(
            self.cassandra_conf,
            self.cassandra_owner,
            self.cassandra_owner,
            SafeYamlCodec(default_flow_style=False),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(revision_dir))
Пример #7
0
    def __init__(self):
        self.state_change_wait_time = CONF.state_change_wait_time

        revision_dir = guestagent_utils.build_file_path(
            os.path.dirname(CONFIG_FILE),
            ConfigurationManager.DEFAULT_STRATEGY_OVERRIDES_SUB_DIR)
        self.configuration_manager = ConfigurationManager(
            CONFIG_FILE,
            system.MONGO_USER,
            system.MONGO_USER,
            SafeYamlCodec(default_flow_style=False),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(revision_dir))

        self.is_query_router = False
        self.is_cluster_member = False
        self.status = MongoDBAppStatus()
Пример #8
0
    def __init__(self):
        super(PgSqlApp, self).__init__()

        self._current_admin_user = None
        self.status = PgSqlAppStatus(self.pgsql_extra_bin_dir)

        revision_dir = guestagent_utils.build_file_path(
            os.path.dirname(self.pgsql_config),
            ConfigurationManager.DEFAULT_STRATEGY_OVERRIDES_SUB_DIR)
        self.configuration_manager = ConfigurationManager(
            self.pgsql_config,
            self.pgsql_owner,
            self.pgsql_owner,
            PropertiesCodec(delimiter='=',
                            string_mappings={
                                'on': True,
                                'off': False,
                                "''": None
                            }),
            requires_root=True,
            override_strategy=OneFileOverrideStrategy(revision_dir))
Пример #9
0
 def test_get_value(self):
     revision_dir = self._create_temp_dir()
     self._assert_get_value(ImportOverrideStrategy(revision_dir, 'ext'))
     self._assert_get_value(OneFileOverrideStrategy(revision_dir))