Skip to content

Commit

Permalink
updated add-network-policy error message when only port or protocol is
Browse files Browse the repository at this point in the history
provided

[finishes #150415979]
  • Loading branch information
Nick Wei committed Sep 1, 2017
1 parent fafcb66 commit 6c0e3fd
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cf/i18n/resources/de-de.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "Falsche Verwendung: Befehlszeilenflags (außer -f) können nicht bei Push-Operationen angewendet werden, bei denen mehrere Apps von einer Manifestdatei mit einer Push-Operation übertragen werden."
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/en-us.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": ""
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/es-es.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "Uso incorrecto: Los distintivos de línea de mandatos (excepto -f) no se pueden aplicar al enviar por push varias apps desde un archivo de manifiesto."
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/fr-fr.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "Syntaxe incorrecte: Les indicateurs de ligne de commande (sauf -f) ne peuvent pas être appliqués lors de l'envoi par commande push de plusieurs applications depuis un fichier manifeste."
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/it-it.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "Utilizzo non corretto: Non è possibile applicare gli indicatori della riga di comando (eccetto -f) quando si distribuiscono più applicazioni da un file manifest."
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/ja-jp.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "誤った使用法: コマンド・ライン・フラグ (-f 以外) は、マニフェスト・ファイルから複数のアプリをプッシュするときは適用されません。"
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/ko-kr.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "올바르지 않은 사용법입니다: Manifest 파일에서 여러 앱을 푸시하는 경우 명령행 플래그(-f 제외)를 적용할 수 없습니다."
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/pt-br.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "Uso incorreto: Não é possível aplicar sinalizações da linha de comandos (exceto -f) ao enviar por push vários apps a partir de um arquivo manifest."
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/zh-hans.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "用法不正确: 从清单文件推送多个应用程序时,无法应用命令行标志(-f 除外)。"
Expand Down
4 changes: 4 additions & 0 deletions cf/i18n/resources/zh-hant.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3695,6 +3695,10 @@
"id": "Incorrect Usage: '{{.Arg1}}' and '{{.Arg2}}' must be used together.",
"translation": ""
},
{
"id": "Incorrect Usage: --protocol and --port flags must be specified together",
"translation": ""
},
{
"id": "Incorrect Usage: Command line flags (except -f) cannot be applied when pushing multiple apps from a manifest file.",
"translation": "用法不正確: 從資訊清單檔推送多個應用程式時,無法套用指令行旗標(-f 除外)。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package translatableerror

type NetworkPolicyProtocolOrPortNotProvidedError struct{}

func (NetworkPolicyProtocolOrPortNotProvidedError) DisplayUsage() {}

func (NetworkPolicyProtocolOrPortNotProvidedError) Error() string {
return "--protocol and --port flags must be specified together"
return "Incorrect Usage: --protocol and --port flags must be specified together"
}

func (e NetworkPolicyProtocolOrPortNotProvidedError) Translate(translate func(string, ...interface{}) string) string {
Expand Down
6 changes: 4 additions & 2 deletions integration/isolated/add_network_policy_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ var _ = Describe("add-network-policy command", func() {
It("returns an error", func() {
session := helpers.CF("add-network-policy", appName, "--destination-app", appName, "--port", "8080")

Eventually(session.Err).Should(Say("--protocol and --port flags must be specified together"))
Eventually(session.Err).Should(Say("Incorrect Usage: --protocol and --port flags must be specified together"))
Eventually(session).Should(Say("FAILED"))
Eventually(session).Should(Say("NAME:"))
Eventually(session).Should(Exit(1))
})
})
Expand All @@ -217,8 +218,9 @@ var _ = Describe("add-network-policy command", func() {
It("returns an error", func() {
session := helpers.CF("add-network-policy", appName, "--destination-app", appName, "--protocol", "tcp")

Eventually(session.Err).Should(Say("--protocol and --port flags must be specified together"))
Eventually(session.Err).Should(Say("Incorrect Usage: --protocol and --port flags must be specified together"))
Eventually(session).Should(Say("FAILED"))
Eventually(session).Should(Say("NAME:"))
Eventually(session).Should(Exit(1))
})
})
Expand Down

0 comments on commit 6c0e3fd

Please sign in to comment.