Bug 2226805

Summary: [RFE] Use --fields instead of awk in the bash script example of "5.7. Synchronizing All Repositories in an Organization" section
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: RepositoriesAssignee: Malhar Jivrajani <mjivraja>
Status: CLOSED CURRENTRELEASE QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.14.0CC: iballou, mjivraja
Target Milestone: 6.14.0Keywords: Documentation
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-08 04:27:30 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 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