Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade vagrant config to Ubuntu 18.04 and fix mongo 3 incompatibility #519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only incompatibility I found with the latest version of things - although I only connected dropbox and runkeeper, but syncing between them worked.

cache["_id"] = insert_result.inserted_id
else:
cache["_id"] = insert_result


activities = []
Expand Down