Skip to content

Commit 32cb334

Browse files
author
Jan Sternagel
committed
Addressed PR #1016
1 parent 67806db commit 32cb334

File tree

17 files changed

+17
-153
lines changed

17 files changed

+17
-153
lines changed

internal/cmd/beta/kms/key/create/create.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
129129
Protection: flags.FlagToStringPointer(p, cmd, protectionFlag),
130130
}
131131

132-
if p.IsVerbosityDebug() {
133-
modelStr, err := print.BuildDebugStrFromInputModel(model)
134-
if err != nil {
135-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
136-
} else {
137-
p.Debug(print.ErrorLevel, "parsed input values: %s", modelStr)
138-
}
139-
}
140-
132+
p.DebugInputModel(model)
141133
return &model, nil
142134
}
143135

internal/cmd/beta/kms/key/delete/delete.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
107107
KeyId: keyId,
108108
}
109109

110-
if p.IsVerbosityDebug() {
111-
modelStr, err := print.BuildDebugStrFromInputModel(model)
112-
if err != nil {
113-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
114-
} else {
115-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
116-
}
117-
}
118-
110+
p.DebugInputModel(model)
119111
return &model, nil
120112
}
121113

internal/cmd/beta/kms/key/importKey/importKey.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
121121
WrappingKeyId: flags.FlagToStringPointer(p, cmd, wrappingKeyIdFlag),
122122
}
123123

124-
if p.IsVerbosityDebug() {
125-
modelStr, err := print.BuildDebugStrFromInputModel(model)
126-
if err != nil {
127-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
128-
} else {
129-
p.Debug(print.ErrorLevel, "parsed input values: %s", modelStr)
130-
}
131-
}
132-
124+
p.DebugInputModel(model)
133125
return &model, nil
134126
}
135127

internal/cmd/beta/kms/key/list/list.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
8282
KeyRingId: flags.FlagToStringValue(p, cmd, keyRingIdFlag),
8383
}
8484

85-
if p.IsVerbosityDebug() {
86-
modelStr, err := print.BuildDebugStrFromInputModel(model)
87-
if err != nil {
88-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
89-
} else {
90-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
91-
}
92-
}
93-
85+
p.DebugInputModel(model)
9486
return &model, nil
9587
}
9688

internal/cmd/beta/kms/key/restore/restore.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
106106
KeyId: keyId,
107107
}
108108

109-
if p.IsVerbosityDebug() {
110-
modelStr, err := print.BuildDebugStrFromInputModel(model)
111-
if err != nil {
112-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
113-
} else {
114-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
115-
}
116-
}
117-
109+
p.DebugInputModel(model)
118110
return &model, nil
119111
}
120112

internal/cmd/beta/kms/key/rotate/rotate.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
100100
KeyId: keyId,
101101
}
102102

103-
if p.IsVerbosityDebug() {
104-
modelStr, err := print.BuildDebugStrFromInputModel(model)
105-
if err != nil {
106-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
107-
} else {
108-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
109-
}
110-
}
111-
103+
p.DebugInputModel(model)
112104
return &model, nil
113105
}
114106

internal/cmd/beta/kms/keyring/create/create.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
128128
Description: flags.FlagToStringValue(p, cmd, descriptionFlag),
129129
}
130130

131-
if p.IsVerbosityDebug() {
132-
modelStr, err := print.BuildDebugStrFromInputModel(model)
133-
if err != nil {
134-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
135-
} else {
136-
p.Debug(print.ErrorLevel, "parsed input values: %s", modelStr)
137-
}
138-
}
139-
131+
p.DebugInputModel(model)
140132
return &model, nil
141133
}
142134

internal/cmd/beta/kms/keyring/delete/delete.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
9595
KeyRingId: keyRingId,
9696
}
9797

98-
if p.IsVerbosityDebug() {
99-
modelStr, err := print.BuildDebugStrFromInputModel(model)
100-
if err != nil {
101-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
102-
} else {
103-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
104-
}
105-
}
106-
98+
p.DebugInputModel(model)
10799
return &model, nil
108100
}
109101

internal/cmd/beta/kms/keyring/list/list.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
7474
GlobalFlagModel: globalFlags,
7575
}
7676

77-
if p.IsVerbosityDebug() {
78-
modelStr, err := print.BuildDebugStrFromInputModel(model)
79-
if err != nil {
80-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
81-
} else {
82-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
83-
}
84-
}
85-
77+
p.DebugInputModel(model)
8678
return &model, nil
8779
}
8880

internal/cmd/beta/kms/version/destroy/destroy.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
103103
VersionNumber: versionNumber,
104104
}
105105

106-
if p.IsVerbosityDebug() {
107-
modelStr, err := print.BuildDebugStrFromInputModel(model)
108-
if err != nil {
109-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
110-
} else {
111-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
112-
}
113-
}
114-
106+
p.DebugInputModel(model)
115107
return &model, nil
116108
}
117109

0 commit comments

Comments
 (0)