mongodb packages are missing on some platforms, so we switch to a
manual install. Also gate the mongo call in cleanup
Change-Id: I1755e461c66be30da3db2a0994f908503c4c38ea
| ... | ... |
@@ -106,7 +106,9 @@ create_ceilometer_accounts() {
|
| 106 | 106 |
# cleanup_ceilometer() - Remove residual data files, anything left over from previous |
| 107 | 107 |
# runs that a clean run would need to clean up |
| 108 | 108 |
function cleanup_ceilometer {
|
| 109 |
- mongo ceilometer --eval "db.dropDatabase();" |
|
| 109 |
+ if [ "$CEILOMETER_BACKEND" != 'mysql' ] && [ "$CEILOMETER_BACKEND" != 'postgresql' ] ; then |
|
| 110 |
+ mongo ceilometer --eval "db.dropDatabase();" |
|
| 111 |
+ fi |
|
| 110 | 112 |
} |
| 111 | 113 |
|
| 112 | 114 |
# configure_ceilometerclient() - Set config files, create data dirs, etc |
| ... | ... |
@@ -164,14 +166,27 @@ function configure_ceilometer {
|
| 164 | 164 |
} |
| 165 | 165 |
|
| 166 | 166 |
function configure_mongodb {
|
| 167 |
+ # server package is the same on all |
|
| 168 |
+ local packages=mongodb-server |
|
| 169 |
+ |
|
| 170 |
+ if is_fedora; then |
|
| 171 |
+ # mongodb client + python bindings |
|
| 172 |
+ packages="${packages} mongodb pymongo"
|
|
| 173 |
+ else |
|
| 174 |
+ packages="${packages} python-pymongo"
|
|
| 175 |
+ fi |
|
| 176 |
+ |
|
| 177 |
+ install_package ${packages}
|
|
| 178 |
+ |
|
| 167 | 179 |
if is_fedora; then |
| 168 |
- # install mongodb client |
|
| 169 |
- install_package mongodb |
|
| 170 | 180 |
# ensure smallfiles selected to minimize freespace requirements |
| 171 | 181 |
sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod |
| 172 | 182 |
|
| 173 | 183 |
restart_service mongod |
| 174 | 184 |
fi |
| 185 |
+ |
|
| 186 |
+ # give mongodb time to start-up |
|
| 187 |
+ sleep 5 |
|
| 175 | 188 |
} |
| 176 | 189 |
|
| 177 | 190 |
# init_ceilometer() - Initialize etc. |