Created
October 25, 2017 19:49
-
-
Save jamesbeedy/b3ee89d9c266fb374db41e4642505a0e to your computer and use it in GitHub Desktop.
http_interface_endpoints_network_get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from charmhelpers.core.hookenv import network_get | |
from charms.reactive import set_flag, clear_flag | |
from charms.reactive import Endpoint | |
class HttpProvides(Endpoint): | |
def configure(self, port, interface_name): | |
""" | |
Configure the HTTP relation by providing a port and interface_name. | |
""" | |
for relation in self.relations: | |
relation.send['host'] = network_get(interface_name)['ingress-addresses'][0] | |
relation.send['port'] = port |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment