~jjo/charms/precise/apache2/support-apache24-config-setup

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: David Britton
  • Date: 2014-01-10 21:08:24 UTC
  • mto: This revision was merged to the branch mainline in revision 50.
  • Revision ID: dpb@canonical.com-20140110210824-dlg9aommgzc0pt74
config_changed hooks failed without servername set due to programming error

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
    result = orig_config_get(scope)
147
147
    if scope == "servername" and len(result) == 0:
148
148
        result = unit_get("public-address")
149
 
    elif type(result) is dict and "servername" not in result.keys():
 
149
    elif type(result) is dict and result.get("servername", "") == "":
150
150
        result["servername"] = unit_get("public-address")
151
151
    return result
152
152