コード例 #1
0
ファイル: main.py プロジェクト: jeffwhite530/dcos-core-cli
    def list(self, json_, quiet_=False):
        """
        :param json_: output json if True
        :type json_: bool
        :returns: process return code
        :rtype: int
        """

        client = self._create_marathon_client()
        apps = client.get_apps()

        if quiet_:
            for app in apps:
                emitter.publish(app.get('id'))
        elif json_:
            emitter.publish(apps)
        else:
            deployments = client.get_deployments()
            queued_apps = client.get_queued_apps()
            _enhance_row_with_overdue_information(apps, queued_apps)
            table = tables.app_table(apps, deployments)
            output = six.text_type(table)
            if output:
                emitter.publish(output)

        return 0
コード例 #2
0
def _list(json_):
    """
    :param json_: output json if True
    :type json_: bool
    :returns: process return code
    :rtype: int
    """

    client = marathon.create_client()
    apps = client.get_apps()

    if json_:
        emitter.publish(apps)
    else:
        deployments = client.get_deployments()
        table = tables.app_table(apps, deployments)
        output = six.text_type(table)
        if output:
            emitter.publish(output)

    return 0
コード例 #3
0
ファイル: main.py プロジェクト: surdy/dcos-cli
    def list(self, json_):
        """
        :param json_: output json if True
        :type json_: bool
        :returns: process return code
        :rtype: int
        """

        client = self._create_marathon_client()
        apps = client.get_apps()

        if json_:
            emitter.publish(apps)
        else:
            deployments = client.get_deployments()
            queued_apps = client.get_queued_apps()
            _enhance_row_with_overdue_information(apps, queued_apps)
            table = tables.app_table(apps, deployments)
            output = six.text_type(table)
            if output:
                emitter.publish(output)

        return 0
コード例 #4
0
ファイル: test_tables.py プロジェクト: sschneid/dcos-cli
def test_app_table():
    apps = [app_fixture()]
    deployments = []
    table = tables.app_table(apps, deployments)
    with open('tests/unit/data/app.txt') as f:
        assert str(table) == f.read()
コード例 #5
0
ファイル: test_tables.py プロジェクト: zen-dog/dcos-cli
def test_app_table():
    apps = [app_fixture()]
    deployments = []
    table = tables.app_table(apps, deployments)
    with open('tests/unit/data/app.txt') as f:
        assert str(table) == f.read()