def on_load(cls): logger.debug("loading custom docker services") if "Client" in globals(): client = Client(version="1.10") images = client.images() del client else: images = [] for image in images: if u"<none>" in image["RepoTags"][0]: continue for repo in image["RepoTags"]: if u":core" not in repo: continue dockerid = repo.encode("ascii", "ignore").split(":")[0] sub_class = type("SubClass", (DockerService,), {"_name": dockerid, "_image": dockerid}) ServiceManager.add(sub_class) del images
def on_load(cls): logging.debug("loading custom docker services") if "Client" in globals(): client = Client(version="1.10") images = client.images() del client else: images = [] for image in images: if u"<none>" in image["RepoTags"][0]: continue for repo in image["RepoTags"]: if u":core" not in repo: continue dockerid = repo.encode("ascii", "ignore").split(":")[0] sub_class = type("SubClass", (DockerService,), {"_name": dockerid, "_image": dockerid}) ServiceManager.add(sub_class) del images
def load_services(): # this line is required to add the above class to the list of available services ServiceManager.add(MyService)
def load_services(): # this line is required to add the above class to the list of available # services ServiceManager.add(MyService)