[katello-devel] Agent Reporting Enabled Repositories

Jeff Ortel jortel at redhat.com
Wed Jan 18 19:18:22 UTC 2012


I'm working on the pulp and katello agent parts of a solution for getting enabled 
repositories (as configured by rhsm) bound to consumers in pulp.  This is fairly straight 
forward and I think will go something like this:

1. katello agent detects change in pulp.repo

2. sends list of enabled repos to the server.

3. katello query pulp consumer and performs a bind/unbind as needed.

Eg: (read like pseudo code)

# fetch consumer
consumer = pulp.getConsumer(id)       # pulp REST
already_bound = consumer['repoids']
# newly disabled
for repoid in already_bound:
     if repoid not in reported:
         pulp.unbind(id, repoid)       # pulp REST
  # newly enabled
for repoid in reported:
     if repoid not in already_bound:
     	pulp.bind(id, repoid)         # pulp REST

This does mean a bind/unbind per newly enabled or disabled repo.  But, this approach 
leverages pulp's existing API and I really don't expect repos to be enabled/disabled in 
large quantities.  Though, I understand this may raise concern.  Also, the pulp v2 
RepoAssociation stuff will support bulk operations.

I assume the katello REST call will be something like this?

url: /bla/bla/consumer/<id>/repos/enabled
payload:
  [<repoid>,...]

Please let me know when the API is designed.

Comments?

Thanks,

Jeff




More information about the katello-devel mailing list