Project

General

Profile

Actions

Bug #10236

closed

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

Added by Tomáš Strachota about 9 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
Yes
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.

Actions #1

Updated by Marek Hulán over 4 years ago

  • Bugzilla link set to 1720664
Actions #2

Updated by Leos Stejskal almost 3 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by The Foreman Bot almost 3 years ago

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

Updated by The Foreman Bot almost 3 years ago

  • Fixed in Releases 3.0.0 added
Actions #5

Updated by The Foreman Bot almost 3 years ago

  • Fixed in Releases deleted (3.0.0)
Actions #6

Updated by yifat makias almost 3 years ago

  • Status changed from Ready For Testing to Closed
Actions #7

Updated by Tomer Brisker almost 3 years ago

  • Fixed in Releases 3.0.0 added
Actions

Also available in: Atom PDF