Created
November 29, 2017 19:09
-
-
Save jamesbeedy/d920318e081fc083de980869b085e303 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class HttpProvides(Endpoint): | |
@when('endpoint.{endpoint_name}.joined') | |
def joined(self): | |
set_flag(self.expand_name('{endpoint_name}.available')) | |
@when_not('endpoint.{endpoint_name}.joined') | |
def broken(self): | |
clear_flag(self.expand_name('{endpoint_name}.available')) | |
def configure(self, host, port, services=None): | |
ctxt = {'host': host, 'port': port} | |
if services: | |
ctxt['services'] = services | |
for relation in self.relations: | |
relation.to_publish_raw.update(ctxt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment