Skip to content

Commit

Permalink
Upgrade vagrant config to Ubuntu 18.04 and fix mongo 3 incompatibility (
Browse files Browse the repository at this point in the history
fixes cpfair#491)
  • Loading branch information
mduggan committed Oct 21, 2019
1 parent 7f83112 commit 211513b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "bento/ubuntu-14.04"
config.vm.box = "bento/ubuntu-18.04"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
Expand Down
20 changes: 8 additions & 12 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
#!/usr/bin/env bash

# Install system requirements

# mongodb multipolygon geojson support needs at least mongodb 2.6. trusty has 2.4 by default
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list


sudo apt-get update
sudo apt-get install -y python3-pip libxml2-dev libxslt-dev zlib1g-dev git redis-server rabbitmq-server mongodb-org=2.6.9
sudo apt-get install -y python3-pip libxml2-dev libxslt-dev zlib1g-dev git redis-server rabbitmq-server mongodb-server

# Fix pip
# upgrade pip
pip3 install --upgrade pip

# Fix the default python and pip instance
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3 1
update-alternatives --force --install /usr/bin/pip3 pip3 /usr/local/bin/pip3 1

# Install app requirements
pip install --upgrade -r /vagrant/requirements.txt

# Fix the default python instance
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2

# Put in a default local_settings.py (if one doesn't exist)
if [ ! -f /vagrant/tapiriik/local_settings.py ]; then
cp /vagrant/tapiriik/local_settings.py.example /vagrant/tapiriik/local_settings.py
Expand Down
5 changes: 4 additions & 1 deletion tapiriik/services/Dropbox/dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def cache_writeback():
cachedb.dropbox_cache.save(cache)
else:
insert_result = cachedb.dropbox_cache.insert(cache)
cache["_id"] = insert_result.inserted_id
if hasattr(insert_result, 'inserted_id'):
cache["_id"] = insert_result.inserted_id
else:
cache["_id"] = insert_result


activities = []
Expand Down

0 comments on commit 211513b

Please sign in to comment.