コード例 #1
0
ファイル: dockersvc.py プロジェクト: gsomlo/core
    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
コード例 #2
0
    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
コード例 #3
0
ファイル: sample.py プロジェクト: troglobit/core
def load_services():
    # this line is required to add the above class to the list of available services
    ServiceManager.add(MyService)
コード例 #4
0
ファイル: adtnPlus.py プロジェクト: SeNDA-UAB/aDTNPlus
def load_services():
    # this line is required to add the above class to the list of available
    # services
    ServiceManager.add(MyService)