~pjdc/charms/trusty/wsgi-app/add-nagios-context

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Tristram Oaten
  • Date: 2014-11-12 14:52:14 UTC
  • Revision ID: tristram@oaten.name-20141112145214-vsqd3knw10nh72wv
defensively code for if hostname isn't provided by ansible

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
 
268
268
    log('Function: webservice_relation')
269
269
    http_protocol = relation_get('http_protocol') or 'http'
270
 
    hostname = relation_get('hostname')
271
270
    address = relation_get('private-address')
 
271
    hostname = relation_get('hostname') or address
272
272
 
273
273
    # If hostname is IP address or FQDN, use it
274
274
    # otherwise use private_address