Project

General

Profile

Bug #26926

hammer cli wipes host parameters when build is toggled (UI or API does not)

Added by Will Foster about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Hosts
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Hello,

We're noticing that on Foreman 1.19.1 using hammer cli to toggle build status will wipe previously made host parameters. Doing the same thing via the UI does not do this.

We make heavy use of host params in our automation so this is painful for us. I couldn't find anything around this so filing this here. It seems that the behavior should work the same in both UI and hammer cli (host params should not be touched if build status toggled).

Below I've made some videos displaying this behavior

(host params left intact via marking host for build with UI)

https://www.youtube.com/watch?v=Q2C4NehcC1U

(using hammer cli and marking for build wipes host params)

https://www.youtube.com/watch?v=xkMWgmUcUzo&feature=youtu.be

26926_hammer_cli_debug.txt 26926_hammer_cli_debug.txt 14.5 KB hammer cli debug Will Foster, 05/31/2019 03:29 PM
26926_hammer_api_curl_build.txt 26926_hammer_api_curl_build.txt 4.97 KB output by toggling build status via curl/API Will Foster, 05/31/2019 03:52 PM

Related issues

Is duplicate of Hammer CLI - Bug #20725: 'hammer host update' removes existing host parametersClosed

History

#1 Updated by Will Foster about 3 years ago

hammer cli debug output attached.

We are also testing that using a direct API call against apiv2 has this behavior or not (as we call the build flag this way in other places).

#2 Updated by Will Foster about 3 years ago

Will Foster wrote:

hammer cli debug output attached.

We are also testing that using a direct API call against apiv2 has this behavior or not (as we call the build flag this way in other places).

From the hammer debug we have the host parameter broken_state: true for this host however it seems to pickup host params as "parameters" => [],

#3 Updated by Will Foster about 3 years ago

Further testing, toggling the build status via the Foreman APIv2 / curl it retains the host params.


curl -vvv -X PUT -s -k -u admin:XXXXXXXXXXXX -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "host" : { "build" : "true" } }' https://`hostname`/api/v2/hosts/480

#4 Updated by Will Foster about 3 years ago

  • Subject changed from hammer cli wipes host parameters when build is toggled (UI does not) to hammer cli wipes host parameters when build is toggled (UI or API does not)

#5 Updated by Martin Bacovsky about 3 years ago

  • Is duplicate of Bug #20725: 'hammer host update' removes existing host parameters added

#6 Updated by Martin Bacovsky about 3 years ago

  • Status changed from New to Closed
  • Category set to Hosts
  • Project changed from Foreman to Hammer CLI
  • Found in Releases hammer-cli-foreman-0.14.0 added
  • Found in Releases deleted (1.19.1)
  • Fixed in Releases hammer-cli-foreman-0.15.0 added

Thanks for the detailed report! It helped to see this is duplicate of the original bug fixed in Foreman 1.20 an later.
It is unlikely to get backported to 1.19 so I'm closing the issue as duplicate.

Also available in: Atom PDF