Description of problem: In 6.2.9, a few options added to hammer repository synchronize sub-cmd: --skip-metadata-check SKIP_METADATA_CHECK --validate-contents VALIDATE_CONTENTS These options are visible only after running "hammer -r". thanks Justin for pointing this. However, I can see such options directly after upgrade to 6.2.9 on rhel7 as well as on fresh install of 6.2.9 on rhel6 (without running hammer -r) Ideally, user should be able to see such options directly after upgrade. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Post upgrade 6.2.9 on rhel6 a few newly added cmd options only available after reloading of Apipie cache Expected results: user should be able to see newly added cmd options directly after upgrade, w/o running hammer -r explicitly. Additional info:
on rhel6, sat6.2.9, before running hammer -r: =============================================== Usage: hammer repository synchronize [OPTIONS] Options: --async Do not wait for the task --id ID repository ID --incremental INCREMENTAL perform an incremental import One of true/false, yes/no, 1/0. --name NAME Repository name to search by --organization ORGANIZATION_NAME Organization name to search by --organization-id ORGANIZATION_ID organization ID --organization-label ORGANIZATION_LABEL Organization label to search by --product PRODUCT_NAME Product name to search by --product-id PRODUCT_ID product numeric identifier --source-url SOURCE_URL temporarily override feed URL for sync -h, --help print help after running hammer -r: ======================== Usage: hammer repository synchronize [OPTIONS] Options: --async Do not wait for the task --id ID repository ID --incremental INCREMENTAL perform an incremental import One of true/false, yes/no, 1/0. --name NAME Repository name to search by --organization ORGANIZATION_NAME Organization name to search by --organization-id ORGANIZATION_ID organization ID --organization-label ORGANIZATION_LABEL Organization label to search by --product PRODUCT_NAME Product name to search by --product-id PRODUCT_ID product numeric identifier --skip-metadata-check SKIP_METADATA_CHECK Force sync even if no upstream changes are detected. Only used with yum repositories. One of true/false, yes/no, 1/0. --source-url SOURCE_URL temporarily override feed URL for sync --validate-contents VALIDATE_CONTENTS Force a sync and validate the checksums of all content. Only used with yum repositories. One of true/false, yes/no, 1/0. -h, --help print help
I was able to reproduce this scenario. However the behavior is expected and I didn't found any deviations from the expected behavior. Hammer is using description of the API to generate options for its commands. The description is cached on the hammer client. The description has a checksum and the actual checksum is sent in server response headers for Hammer to compare. The problem is that Hammer knows the description changed just *after* the server call. So immediately after the upgrade Hammer needs to perform one server call to see the checksum changed and refresh it. I'll explain how the cache expiration works here: * hammer has the 6.2.8 cache stored in e.g. /.cache/apipie_bindings/https___localhost_/v2/91ac4f4181da276b56e543c3a19148b9.en.json. The cache contains description of all the API params. * during the upgrade the API is updated and the Satellite's internal cache rebuilt with foreman-rake apipie:cache and a new checksum is generated * hammer repository synchronize --help uses the old cache and has no reason to contact the server * after first actual call to the Satellite server hammer gets the new cache checksum and refresh the old cache * following --help will use the updated cache to generate the options There are two ways how to avoid using the outdated cache: 1/ in /etc/hammer/cli.modules.d/foreman.yml set foreamen: refresh_cache:true to let hammer perform cache check request to the server before each hammer invocation. The cache is refreshed when found outdated. This works also for --help. The price is extra call to Satellite and slower hammer loading 2/ hammer -r option to force cache refresh
This looks like a duplicate, reported just one day before. *** This bug has been marked as a duplicate of bug 1447403 ***