Comment 6 for bug 1708376

Revision history for this message
Fan Zhang (fanzhang) wrote :

My solution is that rebuild admin client inside trove.guestagent.datastore.experimental.redis.service.RedisApp#apply_overrides, since using configuration group to enable redis authentication may call this method(actually, I'm not sure). Here is my solution:
```
...
REBUILT_NEEDED_CONFIGS = [u'requirepass', ]
...
    def apply_overrides(self, client, overrides):
        for prop_name, prop_args in overrides.items():
            args_string = self._join_lists(
                self._value_converter.to_strings(prop_args), ' ')
            client.config_set(prop_name, args_string)
            if prop_name in REBUILT_NEEDED_CONFIGS:
                self._rebuild_admin_client()
                client = self.admin
```

In my implementation of redis root-enable, I have to rebuild admin client to get CONFIG SET rename, also it can solve this problem I think. I am going to organize my code and then commit some patch sets for this bp[1]. Specs about this bp is here [2]. That would be great if you could help review this bp and spec.

[1]https://blueprints.launchpad.net/trove/+spec/root-enable-in-redis
[2]https://review.openstack.org/#/c/514940/