~ibmcharmers/charms/trusty/ibm-mobilefirst-server/trunk

« back to all changes in this revision

Viewing changes to hooks/relations/http/provides.py

  • Committer: Suchitra Venugopal
  • Date: 2017-03-03 10:32:15 UTC
  • Revision ID: suchvenu@in.ibm.com-20170303103215-26ihfwfx9vucorr2
Review comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    def broken(self):
16
16
        self.remove_state('{relation_name}.available')
17
17
 
18
 
    def configure(self, port):
 
18
    def configure(self, port, private_address=None, hostname=None):
 
19
        if not hostname:
 
20
            hostname = hookenv.unit_get('private-address')
 
21
        if not private_address:
 
22
            private_address = hookenv.unit_get('private-address')
19
23
        relation_info = {
20
 
            'hostname': hookenv.unit_get('private-address'),
 
24
            'hostname': hostname,
 
25
            'private-address': private_address,
21
26
            'port': port,
22
27
        }
23
28
        self.set_remote(**relation_info)