Bug 1255560

Summary: assigning a repo to content-view using 'content-view update' option is not possible by --name
Product: Red Hat Satellite Reporter: Anand Vaddarapu <avaddara>
Component: HammerAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.0CC: bbuckingham, cwelton
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-18 20:17:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Anand Vaddarapu 2015-08-21 00:17:46 UTC
Description of problem:

In satellite 6.1

-----------------------

 hammer content-view update --help
Usage:
    hammer content-view update [OPTIONS]

Options:
 --component-ids COMPONENT_IDS           List of component content view version ids for composite views
                                         Comma separated list of values.
 --description DESCRIPTION               Description for the content view
 --id ID                                 Content view identifier
 --name NAME                             Content view name
 --new-name NEW_NAME                     New name for the content view
 --organization ORGANIZATION_NAME        Organization name to search by
 --organization-id ORGANIZATION_ID       organization ID
 --organization-label ORGANIZATION_LABEL Organization label to search by
 --repositories REPOSITORY_NAMES         Comma separated list of values.   <----- repo_name 
 --repository-ids REPOSITORY_IDS         repository ID
                                         Comma separated list of values.
 -h, --help                              print help

1. Creating content view 'Foo'
hammer> content-view create --organization Brisbane --name Foo
Content view created

2. Checking repo list.
hammer> repository list --organization Brisbane
---|-------------------------------------------------------|---------------------------------|--------------|-----------------------------------------------------------------------
ID | NAME                                                  | PRODUCT                         | CONTENT TYPE | URL                                                                   
---|-------------------------------------------------------|---------------------------------|--------------|-----------------------------------------------------------------------
10 | JBoss Enterprise Application Platform                 | jboss channels                  | yum          |                                                                       
3  | motd-repo                                             | motd                            | puppet       | https://yum.puppetlabs.com/?_ga=1.37220005.488448745.1437627233       
2  | puppet-repo                                           | puppet                          | puppet       |                                                                       
4  | Red Hat Enterprise Linux 6 Server RPMs x86_64 6.6     | Red Hat Enterprise Linux Server | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6.6/x86_64/os       
8  | Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server | Red Hat Enterprise Linux Server | yum          | https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/os   
1  | Red Hat Virt V2V Tool for RHEL 7 RPMs x86_64 7.1      | Red Hat Enterprise Linux Server | yum          | https://cdn.redhat.com/content/dist/rhel/server/7/7.1/x86_64/v2vwin/os
---|-------------------------------------------------------|---------------------------------|--------------|-----------------------------------------------------------------------

3. Assign repo to the content-view by name
hammer> content-view add-repository --organization Brisbane --name Foo --repository "Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server" 
The repository has been associated 

It works.

> content-view list --organization Brisbane
----------------|---------------------------|---------------------------|-----------|---------------
CONTENT VIEW ID | NAME                      | LABEL                     | COMPOSITE | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------
1               | Default Organization View | Default_Organization_View |           |               
5               | Foo                       | Foo                       |           | 8             
4               | RHEL Repo                 | RHEL_Repo                 |           | 4, 8          
3               | v2v                       | v2v                       |           | 1             
----------------|---------------------------|---------------------------|-----------|---------------

I don't think "content-view update" option works. This is more looks like a bug.

hammer> content-view update --organization Brisbane --name Foo --repositories "Red Hat Enterprise Linux 6 Server RPMs x86_64 6.6"
Could not update the content view:
  Error: Could not find repository, please set one of options --repositories, --repository-ids.

hammer> content-view update --organization Brisbane --name Foo --repositories "Red Hat Virt V2V Tool for RHEL 7 RPMs x86_64 7.1"
Could not update the content view:
  Error: Could not find repository, please set one of options --repositories, --repository-ids.

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


Actual results:
Could not update the content view:
  Error: Could not find repository, please set one of options --repositories, --repository-ids.

Expected results:
The repository has been associated

Additional info:

Comment 1 Brad Buckingham 2015-11-18 20:17:33 UTC
This issue was also raised as part of bug 1254977.  That bug was created in the context of 'content-view create'; however, 1254977#4 also raised the issue with 'content-view update'.  In order to ensure that both issues are fixed at the same time, I am going to close this one as a duplicate.

*** This bug has been marked as a duplicate of bug 1254977 ***