diff --git a/cli/dcoscli/package/main.py b/cli/dcoscli/package/main.py index 6f3b0e1..84a6a68 100644 --- a/cli/dcoscli/package/main.py +++ b/cli/dcoscli/package/main.py @@ -386,7 +386,7 @@ def _list(endpoints, app_id, package_name): # if the user is asking a specific id then only show that id pkg_info['apps'] = [ app for app in pkg_info['apps'] - if app['appId'] == app_id + if app == app_id ] results.append(pkg_info) @@ -421,7 +421,7 @@ def _matches_app_id(app_id, pkg_info): :rtype: bool """ - return app_id is None or {'appId': app_id} in pkg_info.get('apps') + return app_id is None or app_id in pkg_info.get('apps') def _search(query): diff --git a/cli/tests/integrations/test_package.py b/cli/tests/integrations/test_package.py index 7b20da2..fb55ee6 100644 --- a/cli/tests/integrations/test_package.py +++ b/cli/tests/integrations/test_package.py @@ -25,7 +25,8 @@ def _chronos_description(app_ids): """ result = [ - {"description": "A fault tolerant job scheduler for Mesos which " + {"apps": app_ids, + "description": "A fault tolerant job scheduler for Mesos which " "handles dependencies and ISO8601 based schedules.", "framework": True, "images": { @@ -67,8 +68,6 @@ version-1.x.zip", "version": "2.3.4" }] - result[0]['apps'] = [{'appId': app_id} for app_id in app_ids] - return (json.dumps(result, sort_keys=True, indent=2).replace(' \n', '\n') + '\n').encode('utf-8') @@ -509,9 +508,7 @@ def test_uninstall_cli(): stdout = b"""[ { "apps": [ - { - "appId": "/helloworld" - } + "/helloworld" ], "description": "Example DCOS application package", "maintainer": "support@mesosphere.io", @@ -602,9 +599,7 @@ def test_list_installed_cli(): [ { "apps": [ - { - "appId": "/helloworld" - } + "/helloworld" ], "command": { "name": "helloworld" diff --git a/dcos/package.py b/dcos/package.py index 3712f59..2927091 100644 --- a/dcos/package.py +++ b/dcos/package.py @@ -311,7 +311,7 @@ class InstalledPackage(object): ret['command'] = {'name': self.subcommand.name} if self.apps: - ret['apps'] = [{'appId': app['appId']} for app in self.apps] + ret['apps'] = [app['appId'] for app in self.apps] if self.subcommand: package_json = self.subcommand.package_json() @@ -330,9 +330,7 @@ def installed_packages(init_client, endpoints): """Returns all installed packages in the format: [{ - 'apps': [{ - 'appId': - }], + 'apps': [], 'command': { 'name': }