Permalink
Browse files

db name, host, port were overriden by defaults

  • Loading branch information...
1 parent d2449ed commit b1ba8867210f04ba88947e19a748118eb34f0b6f @marcinn committed Mar 15, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 liquimigrate/management/commands/liquibase.py
View
17 liquimigrate/management/commands/liquibase.py
@@ -136,12 +136,17 @@ def handle(self, *args, **options):
def _get_url_for_db(tag, dbsettings):
pattern = "jdbc:%(tag)s://%(host)s:%(port)s/%(name)s"
- options = {
- 'name': dbsettings.get('NAME', ''),
- 'host': dbsettings.get('HOST', ''),
- 'port': dbsettings.get('PORT', ''),
- }
- options.update(DB_DEFAULTS.get(tag))
+ options = dict(DB_DEFAULTS.get(tag))
+ settings_map = {
+ 'NAME': 'name',
+ 'HOST': 'host',
+ 'PORT': 'port',
+ }
+ for key in settings_map:
+ value = dbsettings.get(key)
+ if value:
+ options[settings_map[key]] = value
+
return pattern % options

0 comments on commit b1ba886

Please sign in to comment.