From 9bd4097aae8bab7cc09fd32b485e5dffe8558038 Mon Sep 17 00:00:00 2001 From: Tamar Ben-Shachar Date: Tue, 8 Mar 2016 14:44:02 -0800 Subject: [PATCH] don't print {pre|post}InstallNotes if only installing cli subcommand --- cli/dcoscli/package/main.py | 4 ++-- cli/tests/integrations/test_package.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/dcoscli/package/main.py b/cli/dcoscli/package/main.py index 544e77b..02b3248 100644 --- a/cli/dcoscli/package/main.py +++ b/cli/dcoscli/package/main.py @@ -359,7 +359,7 @@ def _install(package_name, package_version, options_path, app_id, cli, app, pkg_json = pkg.package_json() pre_install_notes = pkg_json.get('preInstallNotes') - if pre_install_notes: + if app and pre_install_notes: emitter.publish(pre_install_notes) if not _confirm('Continue installing?', yes): emitter.publish('Exiting installation.') @@ -402,7 +402,7 @@ def _install(package_name, package_version, options_path, app_id, cli, app, commands)) post_install_notes = pkg_json.get('postInstallNotes') - if post_install_notes: + if app and post_install_notes: emitter.publish(post_install_notes) return 0 diff --git a/cli/tests/integrations/test_package.py b/cli/tests/integrations/test_package.py index 8d6e079..3436545 100644 --- a/cli/tests/integrations/test_package.py +++ b/cli/tests/integrations/test_package.py @@ -648,11 +648,9 @@ def test_list_cli(): _list_remove_nulls(stdout=stdout) _uninstall_helloworld() - stdout = (b"A sample pre-installation message\n" - b"Installing CLI subcommand for package [helloworld] " + + stdout = (b"Installing CLI subcommand for package [helloworld] " + b"version [0.1.0]\n" - b"New command available: dcos helloworld\n" - b"A sample post-installation message\n") + b"New command available: dcos helloworld\n") _install_helloworld(args=['--cli', '--yes'], stdout=stdout) stdout = b"""\