Project

General

Profile

Actions

Bug #23394

closed

Unable to set effective user for job templates via hammer cli

Added by Manuel Bonk over 6 years ago. Updated over 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

Also available in: Atom PDF