Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-23335

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

XMLWordPrintable

    • Moderate
    • No

      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

            ofedoren@redhat.com Oleh Fedorenko
            rcavalca Rafael Cavalcanti
            Lukas Hellebrandt Lukas Hellebrandt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: