1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-23 18:57:23 +01:00

fix boto 2 conflict on Google Compute Engine instances

GCE installs some Python-2-only boto plugin that conflicts with boto running under Python 3. It gives a SyntaxError in /usr/share/google/boto/boto_plugins/compute_auth.py (https://github.com/GoogleCloudPlatform/compute-image-packages).

Disabling boto's default configuration file prior to importing boto so that GCE's plugin is not loaded.

See https://discourse.mailinabox.email/t/500-internal-server-error-for-admin/942.
This commit is contained in:
Joshua Tauberer
2015-11-26 14:47:49 +00:00
parent 161d096139
commit cf33be4596
4 changed files with 12 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ import os, os.path, shutil, glob, re, datetime
import dateutil.parser, dateutil.relativedelta, dateutil.tz
import rtyaml
from utils import exclusive_process, load_environment, shell, wait_for_service
from utils import exclusive_process, load_environment, shell, wait_for_service, fix_boto
def backup_status(env):
# Root folder
@@ -326,6 +326,7 @@ def list_target_files(config):
elif p.scheme == "s3":
# match to a Region
fix_boto() # must call prior to importing boto
import boto.s3
from boto.exception import BotoServerError
for region in boto.s3.regions():