Esempio n. 1
0
    def run(self):
        node_id = self.get_option("id")
        node_name = self.get_option("name")

        node = get_node(node_name, node_id)

        org_name = self.get_option('org')
        env_name = self.get_option('env_name')
        env = get_environment(org_name, env_name)
        self.process(node, env)
Esempio n. 2
0
    def run(self):
        node_id = self.get_option("id")
        node_name = self.get_option("name")

        org_name = self.get_option('org')
        env_name = self.get_option('env_name')
        env_id = None
        message = _("Syncing node, please wait... ")
        if env_name is not None:
            env = get_environment(org_name, env_name)
            env_id = env['id']
            message = _("Syncing environment %s to node, please wait...") % env['name']

        node_id = get_node(node_name, node_id)['id']
        sync_tasks = self.api.sync(node_id, env_id)
        task = AsyncTask(sync_tasks)
        run_spinner_in_bg(wait_for_async_task, [task], message=message)
        print _("Sync Complete")
Esempio n. 3
0
    def run(self):
        node_id = self.get_option("id")
        node_name = self.get_option("name")

        org_name = self.get_option('org')
        env_name = self.get_option('env_name')
        env_id = None
        message = _("Syncing node, please wait... ")
        if env_name is not None:
            env = get_environment(org_name, env_name)
            env_id = env['id']
            message = _("Syncing environment %s to node, please wait...") % env['name']

        node_id = get_node(node_name, node_id)['id']
        sync_tasks = self.api.sync(node_id, env_id)
        task = AsyncTask(sync_tasks)
        run_spinner_in_bg(wait_for_async_task, [task], message=message)

        return evaluate_task_status(task,
            ok =     _("Sync of environment [ %s ] completed successfully.") % env_name,
            failed = _("Sync of environment [ %s ] failed") % env_name,
            error_formatter = format_node_sync_errors
        )