diff options
| -rw-r--r-- | bitbake/lib/toaster/toastermain/settings.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 7c559bc7a1..b6bdcd8e3e 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
| @@ -64,6 +64,7 @@ if 'sqlite' in DATABASES['default']['ENGINE']: | |||
| 64 | 64 | ||
| 65 | if 'DATABASE_URL' in os.environ: | 65 | if 'DATABASE_URL' in os.environ: |
| 66 | dburl = os.environ['DATABASE_URL'] | 66 | dburl = os.environ['DATABASE_URL'] |
| 67 | |||
| 67 | if dburl.startswith('sqlite3://'): | 68 | if dburl.startswith('sqlite3://'): |
| 68 | result = re.match('sqlite3://(.*)', dburl) | 69 | result = re.match('sqlite3://(.*)', dburl) |
| 69 | if result is None: | 70 | if result is None: |
| @@ -78,7 +79,7 @@ if 'DATABASE_URL' in os.environ: | |||
| 78 | } | 79 | } |
| 79 | elif dburl.startswith('mysql://'): | 80 | elif dburl.startswith('mysql://'): |
| 80 | # URL must be in this form: mysql://user:pass@host:port/name | 81 | # URL must be in this form: mysql://user:pass@host:port/name |
| 81 | result = re.match(r"mysql://([^:]*):([^@]*)@([^:]*):(\d+)/([^/]*)", dburl) | 82 | result = re.match(r"mysql://([^:]*):([^@]*)@([^:]*):(\d*)/([^/]*)", dburl) |
| 82 | if result is None: | 83 | if result is None: |
| 83 | raise Exception("ERROR: Could not read mysql database url: %s" % dburl) | 84 | raise Exception("ERROR: Could not read mysql database url: %s" % dburl) |
| 84 | DATABASES['default'] = { | 85 | DATABASES['default'] = { |
