Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #27213 - Expose description to update filter api call #8193

Merged
merged 1 commit into from Jul 5, 2019
Merged

Fixes #27213 - Expose description to update filter api call #8193

merged 1 commit into from Jul 5, 2019

Conversation

chris1984
Copy link
Member

Screenshot of it being updated in the UI:

https://nimb.ws/RX7tKb

Update with hammer and new api cache. Adding a pr to hammer to expose the description in list but not required for this.

[vagrant@centos7-katello-devel katello]$ hammer -d content-view filter update --id 1 --description pizza

[ INFO 2019-07-02T17:27:27 HammerCLIKatello::Filter::UpdateCommand] Called with options: {"option_id"=>1, "option_description"=>"pizza"}
[ INFO 2019-07-02T17:27:27 API] Server: https://centos7-katello-devel.area51.example.com
[ INFO 2019-07-02T17:27:27 API] PUT /katello/api/content_view_filters/1
[DEBUG 2019-07-02T17:27:27 API] Params: {
    "description" => "pizza"
}
[DEBUG 2019-07-02T17:27:27 API] Headers: {}
[DEBUG 2019-07-02T17:27:27 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2019-07-02T17:27:28 API] Cache expired. (57d51c2c52f2196de21c4156e27dade4160a6f2d -> 815e172ce92b238c8435c0cc491ec4d19044ead8)
[DEBUG 2019-07-02T17:27:28 API] Response: {
            "inclusion" => false,
    "original_packages" => false,
                   "id" => 1,
                 "name" => "nofox",
          "description" => "pizza",
}
Filter updated.

----------|-------|-------------|------|----------
FILTER ID | NAME  | DESCRIPTION | TYPE | INCLUSION
----------|-------|-------------|------|----------
1         | nofox | pizza       | rpm  |          
----------|-------|-------------|------|----------

@theforeman-bot
Copy link

Issues: #27213

@jjeffers
Copy link
Member

jjeffers commented Jul 3, 2019

Are there any tests planned for this change?

@chris1984
Copy link
Member Author

@jjeffers added a test 🎆

Copy link
Member

@jjeffers jjeffers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this PR by installing the hammer-cli, hammer-cli-foreman, and hammer-cli-katello via the gem installation method, as the changes rely on a very recent change to the hammer-cli-katello.

hammer (0.18.pre.develop)
 * hammer_cli_foreman (0.18.pre.develop)
 * hammer_cli_katello (0.19.pre.master)

I created a content-view/yum repo filter with a description of "Mushroom Pizza". I then ran the following command:

hammer -d content-view filter update --id 1 --description 'Meat Lover Pizza'

The command line output suggested the API call succeeded.

[DEBUG 2019-07-05T13:45:59 API] Response: {
            "inclusion" => false,
    "original_packages" => false,
                   "id" => 1,
                 "name" => "test27213",
          "description" => "Meat Lover Pizza",
           "created_at" => "2019-07-03 12:28:00 UTC",
           "updated_at" => "2019-07-05 13:45:59 UTC",

Checking in the UI I also saw the description was also updated.

@jjeffers jjeffers merged commit e3e0f95 into Katello:master Jul 5, 2019
@chris1984 chris1984 deleted the update-filter branch July 8, 2019 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants