Bug 2226805 - [RFE] Use --fields instead of awk in the bash script example of "5.7. Synchronizing All Repositories in an Organization" section
Summary: [RFE] Use --fields instead of awk in the bash script example of "5.7. Synchro...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.14.0
Hardware: All
OS: All
unspecified
low
Target Milestone: 6.14.0
Assignee: Malhar Jivrajani
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-26 15:17 UTC by Sayan Das
Modified: 2023-08-17 11:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-08 04:27:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SAT-19188 0 None None None 2023-07-26 15:17:49 UTC

Description Sayan Das 2023-07-26 15:17:26 UTC
Document URL: 

Managing Content Guide for Satellite 6.14.0 

Section Number and Name: 

5.7. Synchronizing All Repositories in an Organization

Describe the issue: 

Script we have:

ORG="My_Organization"

for i in $(hammer --no-headers --csv repository list --organization $ORG | awk -F, {'print $1'})
do
  hammer repository synchronize --id ${i} --organization $ORG --async
done


We should not need to rely on `awk -F, {'print $1'}` to get the IDs, We can simply use "--fields Id"


Suggestions for improvement: 

Suggested script:

ORG="My_Organization"

for i in $(hammer --no-headers --csv repository list --organization $ORG --fields Id)
do
  hammer repository synchronize --id ${i} --organization $ORG --async
done


Additional information: 

NA


Note You need to log in before you can comment on or make changes to this bug.