Project

General

Profile

Actions

Bug #32392

closed

hammer content-view list --organization <ORG NAME> seems to show always the result for ORG with ID 1

Added by Oleh Fedorenko over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Other commands
Target version:
-
Difficulty:
Triaged:
Yes
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1920224

Description of problem:
hammer content-view list --organization <ORG NAME> always shows the CV's related to ORG with ID=1

---
From hammer -d:
[ INFO 2021-01-25T14:56:19 HammerCLIKatello::ContentView::ListCommand] Called with options: {"option_organization_name"=>"Import", "option_organization_id"=>"1"}
[ INFO 2021-01-25T14:56:19 API] Server: https://recife.rguerra.lab
[ INFO 2021-01-25T14:56:19 API] GET /katello/api/organizations/1/content_views

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. List all orgs:
---
hammer organization list
---|----------|----------|-------------|---------
ID | TITLE | NAME | DESCRIPTION | LABEL
---|----------|----------|-------------|---------
1 | ACME | ACME | | ACME
5 | Export | Export | | Export
6 | Import | Import | | Import
8 | new_one | new_one | | new_one
4 | NO_Repos | NO_Repos | | NO_Repos
---|----------|----------|-------------|---------
---

2. Run 'hammer content-view list --organization <Org Name>' using an ORG NAME with ID other than 1.
---
hammer content-view list --organization Export
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
10 | CAP68 | CAP68 | false | 2020/12/11 01:35:43 | 91, 10, 89, 2, 90, 7
6 | CCV-1 | CCV-1 | true | 2020/09/24 13:58:41 |
4 | CV-Ansible | CV-Ansible | false | 2020/09/16 16:11:18 | 6
3 | CV-CAP67 | CV-CAP67 | false | 2020/10/08 14:49:51 | 6, 13, 10, 1, 2, 4, 7, 8, 48
9 | CV-HPC-76 | CV-HPC-76 | false | 2020/10/14 18:07:05 | 76, 74, 75
12 | cv-puppet | cv-puppet | false | 2020/12/21 17:48:33 |
13 | cv-sattools-rhel6 | cv-sattools-rhel6 | false | 2020/12/22 18:34:06 | 3
1 | Default Organization View | Default_Organization_View | false | 2020/09/14 20:04:58 |
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------

3. Run 'hammer content-view list --organization <Org Name>' using an ORG NAME with ID = 1.
---
hammer content-view list --organization ACME
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
10 | CAP68 | CAP68 | false | 2020/12/11 01:35:43 | 91, 10, 89, 2, 90, 7
6 | CCV-1 | CCV-1 | true | 2020/09/24 13:58:41 |
4 | CV-Ansible | CV-Ansible | false | 2020/09/16 16:11:18 | 6
3 | CV-CAP67 | CV-CAP67 | false | 2020/10/08 14:49:51 | 6, 13, 10, 1, 2, 4, 7, 8, 48
9 | CV-HPC-76 | CV-HPC-76 | false | 2020/10/14 18:07:05 | 76, 74, 75
12 | cv-puppet | cv-puppet | false | 2020/12/21 17:48:33 |
13 | cv-sattools-rhel6 | cv-sattools-rhel6 | false | 2020/12/22 18:34:06 | 3
1 | Default Organization View | Default_Organization_View | false | 2020/09/14 20:04:58 |
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
---

Actual results:
Hammer returns the output related to ORG with ID=1.
---
hammer content-view list --organization ACME
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
10 | CAP68 | CAP68 | false | 2020/12/11 01:35:43 | 91, 10, 89, 2, 90, 7
6 | CCV-1 | CCV-1 | true | 2020/09/24 13:58:41 |
4 | CV-Ansible | CV-Ansible | false | 2020/09/16 16:11:18 | 6
3 | CV-CAP67 | CV-CAP67 | false | 2020/10/08 14:49:51 | 6, 13, 10, 1, 2, 4, 7, 8, 48
9 | CV-HPC-76 | CV-HPC-76 | false | 2020/10/14 18:07:05 | 76, 74, 75
12 | cv-puppet | cv-puppet | false | 2020/12/21 17:48:33 |
13 | cv-sattools-rhel6 | cv-sattools-rhel6 | false | 2020/12/22 18:34:06 | 3
1 | Default Organization View | Default_Organization_View | false | 2020/09/14 20:04:58 |
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------

Expected results:
Shows the output related to the ORG NAME.

Additional info:

Passing the ORG ID to the command instead of the ORG NAME, hammer shows the expected result:
---
hammer content-view list --organization-id 1
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------
10 | CAP68 | CAP68 | false | 2020/12/11 01:35:43 | 91, 10, 89, 2, 90, 7
6 | CCV-1 | CCV-1 | true | 2020/09/24 13:58:41 |
4 | CV-Ansible | CV-Ansible | false | 2020/09/16 16:11:18 | 6
3 | CV-CAP67 | CV-CAP67 | false | 2020/10/08 14:49:51 | 6, 13, 10, 1, 2, 4, 7, 8, 48
9 | CV-HPC-76 | CV-HPC-76 | false | 2020/10/14 18:07:05 | 76, 74, 75
12 | cv-puppet | cv-puppet | false | 2020/12/21 17:48:33 |
13 | cv-sattools-rhel6 | cv-sattools-rhel6 | false | 2020/12/22 18:34:06 | 3
1 | Default Organization View | Default_Organization_View | false | 2020/09/14 20:04:58 |
----------------|---------------------------|---------------------------|-----------|---------------------|-----------------------------

hammer content-view  list --organization-id 5
----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------
14 | cv_test | cv_test | false | 2021/01/24 18:30:18 | 61, 60
7 | Default Organization View | 197e3103-eafd-467b-8137-35c9927aa088 | false | 2020/09/28 21:39:56 |
----------------|---------------------------|--------------------------------------|-----------|---------------------|---------------

By passing the ORG ID, it does the right API call:
---
GET /katello/api/organizations/5/content_views
---


Related issues 1 (0 open1 closed)

Related to Hammer CLI - Bug #33711: Provided id options don't override defaultsClosedOleh FedorenkoActions
Actions #1

Updated by Oleh Fedorenko over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Oleh Fedorenko
  • Triaged changed from No to Yes
Actions #2

Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/570 added
Actions #3

Updated by The Foreman Bot over 3 years ago

  • Fixed in Releases hammer-cli-foreman-3.0.0 added
Actions #4

Updated by The Foreman Bot over 3 years ago

  • Fixed in Releases deleted (hammer-cli-foreman-3.0.0)
Actions #5

Updated by Oleh Fedorenko over 3 years ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by Tomer Brisker over 3 years ago

  • Fixed in Releases hammer-cli-foreman-3.0.0 added
Actions #7

Updated by Oleh Fedorenko about 3 years ago

  • Related to Bug #33711: Provided id options don't override defaults added
Actions

Also available in: Atom PDF