コード例 #1
0
 def run_playbook(self, o, fields):
     if self.is_no_container(o):
         # There is no machine to SSH to, so use the synchronizer's
         # run_template method directly.
         run_template("sync_onosapp_nocontainer.yaml", fields)
     else:
         super(SyncONOSApp, self).run_playbook(o, fields)
コード例 #2
0
ファイル: sync_onosapp.py プロジェクト: jermowery/xos
 def run_playbook(self, o, fields):
     if self.is_no_container(o):
         # There is no machine to SSH to, so use the synchronizer's
         # run_template method directly.
         run_template("sync_onosapp_nocontainer.yaml", fields)
     else:
         super(SyncONOSApp, self).run_playbook(o, fields)
コード例 #3
0
ファイル: sync_xos.py プロジェクト: ndsc-sdn/xos
    def sync_record(self, xos):
        logger.info("Sync'ing XOS %s" % xos)

        if not xos.docker_project_name:
            raise Exception("xos.docker_project_name is not set")

        if not xos.db_container_name:
            raise Exception("xos.db_container_name is not set")

        if (not xos.enable_build):
            raise DeferredException("XOS build is currently disabled")

        # We've seen the XOS object get synced before the ServiceController object
        # is synced. This results in the XOS UI container getting built with files
        # from that controller missing. So let's try to defer.
        #
        # It could be argued that we should continue to defer if the ServiceController
        # is in error state, but it is important that a single broken service does
        # not takedown the entirety of XOS.

        for scr in xos.service_controllers.all():
            if (scr.backend_status is not None) and (scr.backend_status.startswith("0")):
                raise DeferredException("Detected unsynced service controller. Deferring.")

        self.create_docker_compose()

        dockerfiles = [self.create_ui_dockerfile()]
        tenant_fields = {"dockerfiles": dockerfiles,
                         "build_dir": self.build_dir,
                         "docker_project_name": xos.docker_project_name,
                         "ansible_tag": xos.__class__.__name__ + "_" + str(xos.id)}

        path="XOS"
        res = run_template(self.playbook, tenant_fields, path=path)
コード例 #4
0
    def sync_record(self, sc):
        logger.info("Sync'ing ServiceController %s" % sc)

        if sc.xos and (not sc.xos.enable_build):
            raise DeferredException("XOS build is currently disabled")

        unready = self.check_controller_unready(sc)
        if unready:
            raise Exception("Controller %s has unready resources: %s" %
                            (str(sc), ",".join([str(x) for x in unready])))

        dockerfile = self.create_synchronizer_dockerfile(sc)
        if dockerfile:
            dockerfiles = [dockerfile]
        else:
            dockerfiles = []

        tenant_fields = {
            "dockerfiles": dockerfiles,
            "build_dir": self.build_dir,
            "ansible_tag": sc.__class__.__name__ + "_" + str(sc.id)
        }

        path = "servicecontroller"
        res = run_template(self.playbook, tenant_fields, path=path)
コード例 #5
0
    def sync_record(self, sc):
        logger.info("Sync'ing ServiceController %s" % sc)

        if sc.xos and (not sc.xos.enable_build):
            raise DeferredException("XOS build is currently disabled")

        unready = self.check_controller_unready(sc)
        if unready:
            raise Exception("Controller %s has unready resources: %s" % (str(sc), ",".join([str(x) for x in unready])))

        dockerfiles = [self.create_synchronizer_dockerfile(sc)]
        tenant_fields = {"dockerfiles": dockerfiles,
                         "build_dir": self.build_dir,
                         "ansible_tag": sc.__class__.__name__ + "_" + str(sc.id)}

        path="servicecontroller"
        res = run_template(self.playbook, tenant_fields, path=path)
コード例 #6
0
ファイル: sync_xos.py プロジェクト: terminiter/xos
    def sync_record(self, xos):
        logger.info("Sync'ing XOS %s" % xos)

        if (not xos.enable_build):
            raise DeferredException("XOS build is currently disabled")

        self.create_docker_compose()

        dockerfiles = [self.create_ui_dockerfile()]
        tenant_fields = {
            "dockerfiles": dockerfiles,
            "build_dir": self.build_dir,
            "docker_project_name": xos.docker_project_name,
            "ansible_tag": xos.__class__.__name__ + "_" + str(xos.id)
        }

        path = "XOS"
        res = run_template(self.playbook, tenant_fields, path=path)
コード例 #7
0
ファイル: sync_xos.py プロジェクト: Chunhai/xos-1
    def sync_record(self, xos):
        logger.info("Sync'ing XOS %s" % xos)

        if not xos.docker_project_name:
            raise Exception("xos.docker_project_name is not set")

        if not xos.db_container_name:
            raise Exception("xos.db_container_name is not set")

        if (not xos.enable_build):
            raise DeferredException("XOS build is currently disabled")

        self.create_docker_compose()

        dockerfiles = [self.create_ui_dockerfile()]
        tenant_fields = {"dockerfiles": dockerfiles,
                         "build_dir": self.build_dir,
                         "docker_project_name": xos.docker_project_name,
                         "ansible_tag": xos.__class__.__name__ + "_" + str(xos.id)}

        path="XOS"
        res = run_template(self.playbook, tenant_fields, path=path)
コード例 #8
0
ファイル: sync_xos.py プロジェクト: shamoya/xos
    def sync_record(self, xos):
        logger.info("Sync'ing XOS %s" % xos)

        if not xos.docker_project_name:
            raise Exception("xos.docker_project_name is not set")

        if not xos.db_container_name:
            raise Exception("xos.db_container_name is not set")

        if (not xos.enable_build):
            raise DeferredException("XOS build is currently disabled")

        # We've seen the XOS object get synced before the ServiceController object
        # is synced. This results in the XOS UI container getting built with files
        # from that controller missing. So let's try to defer.
        #
        # It could be argued that we should continue to defer if the ServiceController
        # is in error state, but it is important that a single broken service does
        # not takedown the entirety of XOS.

        for scr in xos.loadable_modules.all():
            if (scr.backend_status
                    is not None) and (scr.backend_status.startswith("0")):
                raise DeferredException(
                    "Detected unsynced loadable module. Deferring.")

        self.create_docker_compose()

        dockerfiles = [self.create_ui_dockerfile()]
        tenant_fields = {
            "dockerfiles": dockerfiles,
            "build_dir": self.build_dir,
            "docker_project_name": xos.docker_project_name,
            "ansible_tag": xos.__class__.__name__ + "_" + str(xos.id)
        }

        path = "XOS"
        res = run_template(self.playbook, tenant_fields, path=path)