From fcc3a342f93da56ddcd0695db23d7a94cccac04c Mon Sep 17 00:00:00 2001 From: wanddynosios <67467325+wanddynosios@users.noreply.github.com> Date: Fri, 9 Sep 2022 12:57:18 +0200 Subject: [PATCH] adjust according to style guide --- command/v7/enable_ssh_command.go | 8 ++++++-- command/v7/enable_ssh_command_test.go | 4 ++-- integration/v7/isolated/enable_ssh_command_test.go | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/command/v7/enable_ssh_command.go b/command/v7/enable_ssh_command.go index 20cc1fd93a..8c671cdf28 100644 --- a/command/v7/enable_ssh_command.go +++ b/command/v7/enable_ssh_command.go @@ -42,8 +42,7 @@ func (cmd *EnableSSHCommand) Execute(args []string) error { cmd.UI.DisplayWarnings(getAppFeatureWarnings) if appFeature.Enabled { - cmd.UI.DisplayTextWithFlavor("ssh support for app '{{.AppName}}' is already enabled.\n"+ - "TIP: An app restart may be required for the change to take effect.", map[string]interface{}{ + cmd.UI.DisplayTextWithFlavor("ssh support for app '{{.AppName}}' is already enabled.", map[string]interface{}{ "AppName": cmd.RequiredArgs.AppName, }) } @@ -70,5 +69,10 @@ func (cmd *EnableSSHCommand) Execute(args []string) error { cmd.UI.DisplayText("TIP: An app restart is required for the change to take effect.") } + if appFeature.Enabled { + cmd.UI.DisplayText("TIP: An app restart may be required for the change to take effect.") + } + return nil } + diff --git a/command/v7/enable_ssh_command_test.go b/command/v7/enable_ssh_command_test.go index 5611b024e9..a3e9196731 100644 --- a/command/v7/enable_ssh_command_test.go +++ b/command/v7/enable_ssh_command_test.go @@ -159,9 +159,9 @@ var _ = Describe("enable-ssh Command", func() { }) It("shows the app ssh is already enabled", func() { - Expect(testUI.Out).To(Say("ssh support for app 'some-app' is already enabled.\n" + - "TIP: An app restart may be required for the change to take effect.")) + Expect(testUI.Out).To(Say("ssh support for app 'some-app' is already enabled.")) Expect(testUI.Out).To(Say("OK")) + Expect(testUI.Out).To(Say("TIP: An app restart may be required for the change to take effect.")) }) }) diff --git a/integration/v7/isolated/enable_ssh_command_test.go b/integration/v7/isolated/enable_ssh_command_test.go index 4904b1059e..0d78a744e9 100644 --- a/integration/v7/isolated/enable_ssh_command_test.go +++ b/integration/v7/isolated/enable_ssh_command_test.go @@ -124,9 +124,9 @@ var _ = Describe("enable-ssh command", func() { Eventually(session).Should(Say(`Enabling ssh support for app %s as %s\.\.\.`, appName, userName)) - Eventually(session).Should(Say("ssh support for app '%s' is already enabled.\n"+ - "An app restart may be required for the change to take effect.", appName)) + Eventually(session).Should(Say("ssh support for app '%s' is already enabled.", appName)) Eventually(session).Should(Say("OK")) + Eventually(session).Should(Say("An app restart may be required for the change to take effect.")) session = helpers.CF("curl", fmt.Sprintf("v3/apps/%s/ssh_enabled", helpers.AppGUID(appName))) Eventually(session).Should(Exit(0))