nvgoldin / mirrorchecker

0 stars 0 forks source link

Refactor mirrorlist request/reply to allow arbitrary parameters #5

Open nvgoldin opened 8 years ago

nvgoldin commented 8 years ago

Currently the yaml configuration file has:

    yum_mirror_request: 'yum/mirrorlist-ovirt-{version}-{dist}'
    yum_suffix: 'ovirt-@VERSION@/rpm/@DIST@/'

This is redundant and confusing. Could be changed to:

 mirror_request: 'yum/mirrorlist-ovirt-{version}-{dist}'
 mirror_reply: 'ovirt-{version}/rpm/-{dist}'

So:

  1. it will use the same parameters in reply/response.
  2. it will allow arbitrary parameters handling(and remove the hardcoded dist/version)
nvgoldin commented 8 years ago

Further, this should be designed to allow passing multiply request/reply couples, and automatically creating the appropriate web handlers.

http_handlers:
    - request: 'yum/mirrorlist-ovirt-{version}-{dist}'
      reply: 'ovirt-{version}/rpm/{dist}'
    - request: 'yum/epel-{distro}'
      reply: 'epel-{distro}'
....

This will work in 'first-matched first-served'(to avoid duplicates).