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 #37232 - Added extra info for CV & repos #931

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

parthaa
Copy link
Contributor

@parthaa parthaa commented Mar 7, 2024

Added new attributes for repository info and content-view info commands

for repository info it adds attributes to Publish settings

  • Restrict to architecture
  • Restrict to OS Versions
$ hammer repository info --id=1


Id:                      1
Name:                    katello
Label:                   katello
......
Publish Settings:        
    Restrict to architecture: x86_64
    Restrict to OS Version:   rhel-7
....

For content view info it shows information along

  • CVV Id
  • CVV Name / CV name (if the cv has not been published or has any versions)
  • Whether its the latest version
  • Whether its been published
  • Whether component is set to Always update to the latest
$ hammer content-view info --id=6
Id:                     6
Name:                   composite
....

Components:             
 1) Id:                          9
    Name:                        foo 1.0
    Latest version:              yes
    Not yet published:           no
    Always update to the latest: yes
 2) Id:                          
    Name:                        unpublished-cv
    Latest version:              yes
    Not yet published:           yes
    Always update to the latest: yes
 3) Id:                          10
    Name:                        view 7.0
    Latest version:              yes
    Not yet published:           no
    Always update to the latest: no

@chris1984 chris1984 self-assigned this Mar 7, 2024
@parthaa parthaa force-pushed the restrict-to-arch branch from ab4c18b to 847c90a Compare March 8, 2024 14:05
@parthaa parthaa force-pushed the restrict-to-arch branch from 847c90a to 44681bb Compare March 8, 2024 14:06
setup_sync_state(data)
setup_booleans(data)
setup_mirroring_policy(data)
setup_content_counts(data) if data["content_counts"]
data
end

def setup_arch_and_os(data)
arch = data["arch"]
data["restrict_to_arch"] = arch == 'noarch' ? _('No restriction') : arch
Copy link
Member

Choose a reason for hiding this comment

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

This is cool, didn't know you could assign a variable and do a ternary operator on the same line. Learned something new today 🤯

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

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

ACK, works well.

[vagrant@hammer hammer-cli-katello]$ hammer repository info --id=1
Id:                      1
Name:                    Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8
Label:                   Red_Hat_Enterprise_Linux_8_for_x86_64_-_AppStream_RPMs_8
Description:
Organization:            Default Organization
Red Hat Repository:      yes
Content Type:            yum
Content Label:           rhel-8-for-x86_64-appstream-rpms
Mirroring Policy:        Complete Mirroring
Url:                     https://cdn.redhat.com/content/dist/rhel8/8/x86_64/appstream/os
Publish Via HTTP:        no
Published At:            https://devel.croberts.io/pulp/content/Default_Organization/Library/content/dist/rhel8/8/x86_64/appstream/os/
Relative Path:           Default_Organization/Library/content/dist/rhel8/8/x86_64/appstream/os
Download Policy:         on_demand
Ignorable Content Units:
Publish Settings:
    Restrict to architecture: x86_64
    Restrict to OS Version:   rhel-8
	
[vagrant@hammer hammer-cli-katello]$ hammer content-view info --id=5
Id:                           5
Name:                         Bigger bag of junk
Label:                        Bigger_bag_of_junk
Composite:                    yes
Description:
Content Host Count:           0
Solve Dependencies:           no
Organization:                 Default Organization
Yum Repositories:
 1) Id:    23
    Name:  Modules
    Label: Modules
 2) Id:    24
    Name:  Animals
    Label: Animals
File Repositories:
 1) Id:    22
    Name:  File
    Label: File
Container Image Repositories:
 1) Id:    25
    Name:  Docker
    Label: Docker
OSTree Repositories:
 1) Id:    21
    Name:  OSTree
    Label: OSTree
Ansible Repositories:
 1) Id:    27
    Name:  Ansible
    Label: Ansible
File Repositories:
 1) Id:    22
    Name:  File
    Label: File
Debian Repositories:
 1) Id:    26
    Name:  Debian
    Label: Debian
Python Repositories:
 1) Id:    20
    Name:  Python
    Label: Python
Lifecycle Environments:
 1) Id:   1
    Name: Library
Versions:
 1) Id:        5
    Version:   1.0
    Published: 2024/03/08 14:40:40
Components:
 1) Id:                          4
    Name:                        Bag of junk 1.0
    Latest version:              yes
    Not yet published:           no
    Always update to the latest: yes

@parthaa parthaa merged commit e1b107b into Katello:master Mar 8, 2024
7 checks passed
@parthaa parthaa deleted the restrict-to-arch branch March 8, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants