Project

General

Profile

Actions

Bug #16631

closed

Validators do not use default values in hammer

Added by Martin Bacovsky about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

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

Description of problem:

When creating the content view filter using hammer, it does not read the default organization and location from the defaults.yml file.

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

How reproducible:
100%

Steps to Reproduce:

1.Set default organization and location by creating defaults.yml and copy it in /root/.hammer
~~
hammer> organization list
---|------|--------------------------------------|------------
ID | NAME | LABEL | DESCRIPTION
---|------|--------------------------------------|------------
1 | org1 | 1e9d14ee-f38d-46cb-a7b7-63f4d39a20b6 |
---|------|--------------------------------------|------------
hammer> location list
---|-----
ID | NAME
---|-----
2 | loc1
---|-----
hammer>

[root@sat62 hammer_cli]# cat /root/.hammer/defaults.yml
---
:defaults:
:organization_id:
:value: '1'
:location_id:
:value: '2'
~~

2. login to hammer shell
3. Try hammer commands which use organization and location:

Other hammer commands working as below:

~~~
  1. hammer> repository list
    ---|-----------------------------------------------------------|---------------------------------|--------------|---------------------------------------------------------------------------------
    ID | NAME | PRODUCT | CONTENT TYPE | URL
    ---|-----------------------------------------------------------|---------------------------------|--------------|---------------------------------------------------------------------------------
    2 | Red Hat Satellite Tools 6.2 for RHEL 7 Server RPMs x86_64 | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6....
    1 | Red Hat Enterprise Linux 7 Server RPMs x86_64 7.2 | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7.2/x86_64/os
    3 | Red Hat Enterprise Linux 7 Server Kickstart x86_64 7.2 | Red Hat Enterprise Linux Server | yum | https://cdn.redhat.com/content/dist/rhel/server/7/7.2/x86_64/kickstart
    ---|-----------------------------------------------------------|---------------------------------|--------------|---------------------------------------------------------------------------------

hammer> content-view list
----------------|---------------------------|---------------------------|-----------|---------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------
1 | Default Organization View | Default_Organization_View | |
2 | cv_rhel7 | cv_rhel7 | | 1, 2, 3
----------------|---------------------------|---------------------------|-----------|---------------
~~~

Actual results:

But when we try to create content view filter, it fails with organization id.

~~~
hammer> content-view filter create --name "July" --type erratum --inclusion true --content-view cv_rhel7
Could not create the filter:
Error: At least one of options --organization-id, --organization, --organization-label is required

See: ' content-view filter create --help'
~~~

Expected results:
It should work using the default value like other hammer commands.

Additional info:
N/A

Actions #1

Updated by Martin Bacovsky about 8 years ago

  • Subject changed from content view filter does not use 'Default' organization and location in hammer to Validators do not use default values in hammer
  • Category set to Hammer core
  • Status changed from New to Assigned
  • Assignee set to Martin Bacovsky
  • Target version set to 127
Actions #2

Updated by The Foreman Bot about 8 years ago

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

Updated by Ivan Necas about 8 years ago

  • Target version changed from 127 to 1.5.1
Actions #4

Updated by Martin Bacovsky about 8 years ago

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

Updated by Tomáš Strachota over 7 years ago

  • Translation missing: en.field_release set to 235
Actions #6

Updated by Ivan Necas over 7 years ago

  • Target version changed from 1.5.1 to 1.12.2
Actions

Also available in: Atom PDF