Project

General

Profile

Bug #26232

Override Values API - request fails if the matcher attribute name has space or dot(.) character

Added by Ori Rabin 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Smart Variables
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

From BZ:

Steps:

1. Attempt to update the override value by PUTing on satellite with overrides matcher instead of its id. e.g:
  1. curl -u admin:changeme -X PUT -d '{"value":"overridened3"}' --header "Content-Type:application/json" "https://<server_url>/api/v2/puppetclasses/1/smart_class_parameters
    /3/override_values/os=rhel7.6"

Observation and Logs:

PUT request fails if the matcher attribute name has space or dot(.) character.

  1. curl -X PUT -d '{"value":"overridened3"}' --header "Content-Type:application/json" "https://<server_url>/api/v2/puppetclasses/1/smart_class_parameters/3/override_values/os=rhel7.6"

{
"error": {"message":"Resource override_value not found by id 'os=rhel7'"
}

  1. curl X PUT -d '{"value":"overridened3"}' --header "Content-Type:application/json" "https://<server_url>/api/v2/puppetclasses/1/smart_class_parameters/3/override_values/os=rhel 7"
    <!DOCTYPE HTML PUBLIC "
    //IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>400 Bad Request</title>
    </head><body>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    </p>
    </body></html>

Related issues

Related to Foreman - Feature #22090: API Support for easier use of Smart-Class Param OverridesClosed

Associated revisions

Revision 38b5f738 (diff)
Added by Ori Rabin 4 months ago

Fixes #26232 - Adding id contraints on override_values routes (#6538)

To allow dots and spaces when the id is the matcher

History

#1 Updated by Ori Rabin 4 months ago

  • Related to Feature #22090: API Support for easier use of Smart-Class Param Overrides added

#2 Updated by The Foreman Bot 4 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6538 added

#3 Updated by Marek Hulán 4 months ago

  • Fixed in Releases 1.22.0 added

#4 Updated by Ori Rabin 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF