Browse code

Add support for redis to Zaqar's lib

A new redis driver has landed in Zaqar. This patch adds support for that
driver to Zaqar's lib.

Change-Id: I97629a303c55ee098e3bfbc534bfb05ccab94649

Flavio Percoco authored on 2014/09/05 23:03:01
Showing 3 changed files
... ...
@@ -1,3 +1,5 @@
1 1
 python-pymongo
2 2
 mongodb-server
3 3
 pkg-config
4
+redis-server # NOPRIME
5
+python-redis # NOPRIME
4 6
\ No newline at end of file
... ...
@@ -1,3 +1,5 @@
1 1
 selinux-policy-targeted
2 2
 mongodb-server
3 3
 pymongo
4
+redis # NOPRIME
5
+python-redis # NOPRIME
... ...
@@ -125,11 +125,27 @@ function configure_zaqar {
125 125
         iniset $ZAQAR_CONF  drivers storage mongodb
126 126
         iniset $ZAQAR_CONF 'drivers:storage:mongodb' uri mongodb://localhost:27017/zaqar
127 127
         configure_mongodb
128
+    elif [ "$ZAQAR_BACKEND" = 'redis' ] ; then
129
+        iniset $ZAQAR_CONF  drivers storage redis
130
+        iniset $ZAQAR_CONF 'drivers:storage:redis' uri redis://localhost:6379
131
+        configure_redis
128 132
     fi
129 133
 
130 134
     cleanup_zaqar
131 135
 }
132 136
 
137
+function configure_redis {
138
+    if is_ubuntu; then
139
+        install_package redis-server
140
+    elif is_fedora; then
141
+        install_package redis
142
+    else
143
+        exit_distro_not_supported "redis installation"
144
+    fi
145
+
146
+    install_package python-redis
147
+}
148
+
133 149
 function configure_mongodb {
134 150
     # Set nssize to 2GB. This increases the number of namespaces supported
135 151
     # # per database.