Bug 1133515
Summary: | [RFE] Hammer repository upload-content doesn't support globs | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Pavel StudenÃk <pstudeni> |
Component: | Hammer - Content | Assignee: | David Davis <daviddavis> |
Status: | CLOSED ERRATA | QA Contact: | Adam Ruzicka <aruzicka> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.0.4 | CC: | ahumbe, aruzicka, bbuckingham, daviddavis, dsulliva, mmccune, mvanderw, pwayper, sthirugn |
Target Milestone: | Unspecified | Keywords: | FutureFeature, Triaged |
Target Release: | Unused | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://projects.theforeman.org/issues/16521 | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-02-21 12:28:04 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
Pavel StudenÃk
2014-08-25 10:57:49 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release. Ideally, as with most other commands that deal with files, this command should take all file or path arguments that remain after command line processing and put them in the files to list. So it should be possible to do: hammer repository upload-content --name unix_engineering --organization NOMURA --product Unix_Engineering nmr-sunjdk1601964-1.6.0_19_64-1.x86_64.rpm nmr-sunjdk1601764-1.6.0_17_64-1.x86_64.rpm nmr-netbackup-7.1-redhat-1.0-0.x86_64.rpm nmr-sunjdk16019-1.6.0_19-1.i386.rpm nmr-sunjdk16017-1.6.0_17-1.i386.rpm nmr-autosys-linux-4.5-2.i386.rpm as one command and have hammer import all the listed RPMs. Hope this helps, Paul Currently, hammer upload-content only supports a filename or a directory. The latter can be used to upload multiple packages (as Dave Sullivan indicates). What you're asking for is for hammer to support glob patterns or lists of files. It's doable but it's more of an RFE than a bug. Moving to 6.3. Workaround is to use a directory or to pipe it to hammer: for i in packages/test-regular-0-0.1-*; do hammer upload-content --id 5 --path $i; done Moving 6.2 bugs out to sat-backlog. I'm adding glob support. To list files you can just do the following: hammer repository upload-content --name unix_engineering --organization NOMURA --product Unix_Engineering --path {nmr-sunjdk1601964-1.6.0_19_64-1.x86_64.rpm,nmr-sunjdk1601764-1.6.0_17_64-1.x86_64.rpm} Or also if this is being scripted you can issue a separate hammer command for each file. Pavel/Paul, If you'd still like a way to list all the files without using a glob, I'd recommend that we open a new RFE and request that an option be added (e.g. '--files') to the command. Let me know your thoughts. Upstream bug component is Hammer - Content Just a note on testing this. You must escape the glob with single or double quotes otherwise the shell will automatically expand the glob which won't work. I looked into supporting expanded globs but there's a technical limitation in clamp which hammer-cli uses. I don't see why just collecting all the files on the command line and adding them in one go is a problem. Is it? Processing globs inside a script, when you've got a perfectly good shell to expand them exactly as the user expects, is a waste of time and leads to mismatches in glob semantics. I think it would be better to just take a list of files. Hope this helps, Paul Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16521 has been resolved. Verified. Version Tested: Satellite-6.3 Snap 12 Package versions: satellite-6.3.0-16.0.beta.el7sat.noarch katello-3.4.4-2.el7sat.noarch tfm-rubygem-hammer_cli_katello-0.10.0-1.el7sat.noarch Created a product and a repository, uploaded some files into the repository using globs. # h repository upload-content --name Dotfiles --product Stuff --path '.{zsh,bash}rc' --organization-id 1 Successfully uploaded file '.zshrc'. Successfully uploaded file '.bashrc'. # h repository upload-content --name Dotfiles --product Stuff --path 'thing-*' --organization-id 1 Successfully uploaded file 'thing-1'. Successfully uploaded file 'thing-2'. Successfully uploaded file 'thing-3'. Successfully uploaded file 'thing-4'. Successfully uploaded file 'thing-5'. Successfully uploaded file 'thing-6'. Successfully uploaded file 'thing-7'. Successfully uploaded file 'thing-8'. Successfully uploaded file 'thing-9'. Successfully uploaded file 'thing-10'. Successfully uploaded file 'thing-11'. Successfully uploaded file 'thing-12'. Successfully uploaded file 'thing-13'. Successfully uploaded file 'thing-14'. Successfully uploaded file 'thing-15'. h repository upload-content --name Dotfiles --product Stuff --path 'thing-[1-3]' --organization-id 1 Successfully uploaded file 'thing-1'. Successfully uploaded file 'thing-2'. Successfully uploaded file 'thing-3'. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:0336 |