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 about 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

Also available in: Atom PDF