Skip to content

Commit d19379d

Browse files
committed
move project label retrieval
1 parent 815287a commit d19379d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

internal/cmd/key-pair/list/list.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,6 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
7171
return err
7272
}
7373

74-
projectLabel, err := projectname.GetProjectName(ctx, params.Printer, params.CliVersion, cmd)
75-
if err != nil {
76-
params.Printer.Debug(print.ErrorLevel, "get project name: %v", err)
77-
projectLabel = model.ProjectId
78-
}
79-
8074
// Call API
8175
req := buildRequest(ctx, model, apiClient)
8276
resp, err := req.Execute()
@@ -86,6 +80,12 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
8680

8781
items := resp.GetItems()
8882

83+
projectLabel, err := projectname.GetProjectName(ctx, params.Printer, params.CliVersion, cmd)
84+
if err != nil {
85+
params.Printer.Debug(print.ErrorLevel, "get project name: %v", err)
86+
projectLabel = model.ProjectId
87+
}
88+
8989
// Truncate output
9090
if model.Limit != nil && len(items) > int(*model.Limit) {
9191
items = items[:*model.Limit]

0 commit comments

Comments
 (0)