Project

General

Profile

Actions

Bug #23394

closed

Unable to set effective user for job templates via hammer cli

Added by Manuel Bonk almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Difficulty:
Triaged:
No
Found in Releases:

Description

I try to modify the current_user and overridable flags of a non-default job template via hammer.


# hammer -d job-template update --name "my_template" --file template-test --current-user true --overridable false --provider-type SSH --job-category Miscellaneous
[DEBUG 2018-04-25 15:39:40 API] Params: {
    "job_template" => {
                 "name" => "my_template",
         "job_category" => "Miscellaneous",
             "template" => "reboot",
        "provider_type" => "SSH",
                  "ssh" => {
            "effective_user" => {
                 "overridable" => false,
                "current_user" => true
            }
        }
    }
}

[DEBUG 2018-04-25 15:39:40 API] Headers: {}
[DEBUG 2018-04-25 15:39:40 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2018-04-25 15:39:40 API] Response: {
         "audit_comment" => nil,
    "description_format" => "",
            "created_at" => "2018-04-25 13:31:34 UTC",
            "updated_at" => "2018-04-25 13:39:30 UTC",
              "template" => "reboot",
                "locked" => false,
                    "id" => 127,
                  "name" => "my_template",
          "job_category" => "Miscellaneous",
         "provider_type" => "SSH",
               "snippet" => false,
       "template_inputs" => [],
        "effective_user" => {
               "value" => "testuser",
        "current_user" => false,
         "overridable" => true
    },
             "locations" => [],
         "organizations" => []
}

I've noticed that before calling super in https://github.com/theforeman/foreman_remote_execution/blob/bd6e83fee879b8960986ed107514b960a5309c81/app/controllers/api/v2/job_templates_controller.rb#L124 the effective_user parameter is present, but afterwards its gone.

I'm using following versions:
  • hammer (0.11.0)
  • hammer_cli_foreman (0.11.0)
  • hammer_cli_foreman_bootdisk (0.1.3)
  • hammer_cli_foreman_docker (unknown version)
  • hammer_cli_foreman_remote_execution (unknown version)
  • hammer_cli_foreman_tasks (unknown version)
  • hammer_cli_import (0.11.3)
  • hammer_cli_katello (0.11.5)
Actions #1

Updated by Ido Kanner almost 6 years ago

  • Assignee set to Ido Kanner
Actions #2

Updated by Ido Kanner almost 6 years ago

  • Category deleted (CLI)

The bug itself is on the API, working on fixing it at the moment.

Actions #3

Updated by The Foreman Bot almost 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/361 added
Actions #4

Updated by Ido Kanner almost 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by Ivan Necas almost 6 years ago

  • Triaged set to No
  • Fixed in Releases foreman_remote_execution 1.5.4 (Foreman 1.18) added
Actions

Also available in: Atom PDF