slapos/recipe/redis/promise: Don't create connection pool explicitly
authorKirill Smelkov <kirr@nexedi.com>
Wed, 4 Nov 2015 08:15:07 +0000 (11:15 +0300)
committerKirill Smelkov <kirr@nexedi.com>
Wed, 4 Nov 2015 10:52:51 +0000 (13:52 +0300)
commit442866bc7de03349b24409faefa3f982595bbaf2
tree2d86be4f0b865e8dea29540e3e4b6e8cd1f4736d
parent9b3cfff42ef91557a21980469da495f304dc2743
slapos/recipe/redis/promise: Don't create connection pool explicitly

Because redis.Redis(...) ctor creates connection pool on initialization
and we can rely on it.

Another reason: Redis ctor (in form of StrictRedis.__init__()) has logic
how to process arguments and does selecting - either it is TCP (`host` and
`port` args), or UNIX socket (`unix_socket_path` arg):

    https://lab.nexedi.com/nexedi/slapos/blob/95dbb5b2/slapos/recipe/redis/MyRedis2410.py#L560

Since we are going to introduce unix socket support to redis recipe in
the next patch, and don't want to duplicate StrictRedis.__init__() logic
in promise code, let's refactor promise to delegate argument processing
logic to Redis.

/reviewed-by @kazuhiko  (on !27)
/cc @alain.takoudjou
slapos/recipe/redis/promise.py