Project

General

Profile

Bug #10236

Wrong error message when one attempts to create second primary/provision interface via API

Added by Tomáš Strachota over 6 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Attempt to create second primary or provision interface via API fails correctly but returns wrong messages:

Primary host already has provision interface
Provision host already has provision interface

422 Unprocessable Entity
{
    "error" => {
                   "id" => 15,
               "errors" => {
              "interfaces.primary" => [
                [0] "host already has primary interface" 
            ],
                 "interfaces.name" => [
                [0] "has already been taken" 
            ],
            "interfaces.provision" => [
                [0] "host already has provision interface" 
            ],
                  "interfaces.mac" => [
                [0] "can't be blank" 
            ]
        },
        "full_messages" => [
            [0] "Primary host already has primary interface",
            [1] "Name has already been taken",
            [2] "Provision host already has provision interface",
            [3] "Mac can't be blank" 
        ]
    }
}

As the returned hash demonstrates, it is probably caused by wrong Rails' synthesis into full messages.

Associated revisions

Revision 416a52e8 (diff)
Added by yifat makias 4 months ago

Fixes #10236 - Fix wrong error message when creating scond primary/provision interface

History

#1 Updated by Marek Hulán about 2 years ago

  • Bugzilla link set to 1720664

#2 Updated by Leos Stejskal 5 months ago

  • Triaged changed from No to Yes

#3 Updated by The Foreman Bot 4 months ago

  • Assignee set to yifat makias
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8592 added

#4 Updated by The Foreman Bot 4 months ago

  • Fixed in Releases 3.0.0 added

#5 Updated by The Foreman Bot 4 months ago

  • Fixed in Releases deleted (3.0.0)

#6 Updated by yifat makias 4 months ago

  • Status changed from Ready For Testing to Closed

#7 Updated by Tomer Brisker 4 months ago

  • Fixed in Releases 3.0.0 added

Also available in: Atom PDF