Description of problem: Hammer : Uploading content to repository allows to upload text file whereas it should allow only rpms to upload Version-Release number of selected component (if applicable): # rpm -qa | grep foreman ruby193-rubygem-foreman-tasks-0.6.9-1.1.el6sat.noarch foreman-compute-1.6.0.44-1.el6sat.noarch ruby193-rubygem-foreman_hooks-0.3.5-2.el6sat.noarch foreman-postgresql-1.6.0.44-1.el6sat.noarch foreman-1.6.0.44-1.el6sat.noarch foreman-vmware-1.6.0.44-1.el6sat.noarch ruby193-rubygem-foreman-redhat_access-0.0.4-1.el6sat.noarch rubygem-hammer_cli_foreman-0.1.1-16.el6sat.noarch cloud-qe-10.idmqe.lab.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch foreman-selinux-1.6.0.14-1.el6sat.noarch foreman-gce-1.6.0.44-1.el6sat.noarch ruby193-rubygem-foreman_bootdisk-2.0.6-1.1.el6sat.noarch cloud-qe-10.idmqe.lab.eng.bos.redhat.com-foreman-client-1.0-1.noarch foreman-ovirt-1.6.0.44-1.el6sat.noarch ruby193-rubygem-foreman_discovery-1.3.0-2.el6sat.noarch foreman-proxy-1.6.0.30-1.el6sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch foreman-libvirt-1.6.0.44-1.el6sat.noarch How reproducible: everytime Steps to Reproduce: # hammer -v -u admin -p *** --output csv organization create --name='Rewuql' Message,Id,Name Organization created,295,Rewuql # hammer -v -u admin -p *** --output csv product create --description='rpczaqPvmgXHRuFsPKBb' --label='WTvTStfTpEbnbnRFjcqD' --organization-id='295' --name='pPGECyrDRMbYRUywnLFq' Message,Id,Name Product created,1258,pPGECyrDRMbYRUywnLFq # hammer -v -u admin -p *** product info --id='1258' --organization-id='295' ID: 1258 Name: pPGECyrDRMbYRUywnLFq Label: WTvTStfTpEbnbnRFjcqD Description: rpczaqPvmgXHRuFsPKBb Sync State: not_synced Sync Plan ID: GPG: GPG Key ID: GPG Key: Organization: Rewuql Readonly: false Deletable: Content: # hammer -v -u admin -p ***** --output csv repository create --product-id='1258' --name='JWlmECsxUDxBBFn' --publish-via-http='true' --url='http://inecas.fedorapeople.org/fakerepos/zoo3/' --content-type='yum' Message,Id,Name Repository created,91,JWlmECsxUDxBBFn # hammer -v -u admin -p *** --output csv repository upload-content --path='/tmp/LgrwMkSUAVmCKMl' --product-id='1258' --name='JWlmECsxUDxBBFn' --organization='Rewuql' Message Successfully uploaded file 'LgrwMkSUAVmCKMl'. Actual results: the file is text file . still it gets uploaded Expected results: it should allow to upload normal text files Additional info:
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.
Excpected result it should not allow to upload normal text files
I think this applies to the UI as well.
Created a pulp bug to deal with the problem: https://pulp.plan.io/issues/1747 Going to look into adding a workaround in Katello as I am not sure this fix will be added to pulp 2.8.
It sounds like this might be a regression so maybe this'll be fixed in 2.8?
Confirmed as fixed: $ hammer repository upload-content --id 2 --path test.txt Failed to upload file 'test.txt' to repository. Please check the file and try again.
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.
The Pulp upstream bug priority is at High. Updating the external tracker on this bug.
The pulp change fixes the issue. However, we need two upstream changes to deal with this fix in pulp: foreman-tasks https://github.com/theforeman/foreman-tasks/pull/199 katello https://github.com/Katello/katello/pull/6298
Build: Satellite 6.3 Snap 6 Verified hammer -u admin -p changeme --output csv repository upload-content --path='/tmp/apple' --product-id='23' --name='JWlmECsxUDxBBFn' --organization='Rewuql' Message Failed to upload file 'apple' to repository. Please check the file and try again.
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