Bug 1125585 - Update datasource to fab643e0d5

To pick up the new require_host_type config option:
https://github.com/jeads/datasource/pull/22

Also includes:
https://github.com/jeads/datasource/pull/17
This commit is contained in:
Ed Morley 2015-01-25 04:27:03 +00:00
Родитель a42a7d09ef
Коммит a9188108ec
4 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -27,7 +27,7 @@ httplib2==0.7.4
jsonfield==0.9.20
git+git://github.com/jeads/datasource@143ac08d11
git+git://github.com/jeads/datasource@fab643e0d5
git+git://github.com/mozilla/treeherder-client@be6cb763dc
git+git://github.com/Julian/jsonschema@1976689051

2
vendor/datasource/bases/RDBSHub.py поставляемый
Просмотреть файл

@ -359,6 +359,8 @@ class RDBSHub(BaseHub):
####
host_type = kwargs['host_type']
elif not host_type:
if self.conf.get('require_host_type', False):
raise RDBSHubExecuteError("host_type is required, but none was specified")
##No host type in proc file or in kwargs, set default
host_type = self.default_host_type

3
vendor/datasource/data_sources.json поставляемый
Просмотреть файл

@ -16,6 +16,9 @@
"user":"username",
"passwd":"passwd" },
# Optional. If set, host_type is mandatory.
"require_host_type": false,
##Not required, if set execute uses this db as a default##
"default_db": "test",

8
vendor/datasource/hubs/MySQL.py поставляемый
Просмотреть файл

@ -52,7 +52,13 @@ class MySQL(SQLHub):
self.try_to_connect(host_type, db)
if db and db != self.connection[host_type]['db']:
self.connection[host_type]['con_obj'].select_db(db)
try:
self.connection[host_type]['con_obj'].select_db(db)
except OperationalError:
##Connection is corrupt, reconnect.
##Meant to deal with OperationalError 2006
##MySQL server has gone away errors with Django 1.6
self.connect(host_type, db)
self.connection[host_type]['db'] = db
"""
Private Methods