'hammer repository upload-content' command cannot rename a file once uploaded and upload it as a new file.
Issue
'hammer repository upload-content' command cannot rename a file once uploaded and upload it as a new file.
Additionally, even after deleting a file, it is generated with the original file name.
- Upload the original file
[root@satellite6 ~]# vi custom/file
[root@satellite6 ~]# md5sum custom/file
87c0a0816ee34adc6ce9793e5a5d96ed custom/file
[root@satellite6 ~]# hammer repository upload-content --path ./custom/file --product "test-product" --name "test-repo" --organization-id 1
[..........................................................................................................................................................................................................................................................] [100%]
Successfully uploaded file file
[root@satellite6 ~]# hammer file list --product "test-product" --repository "test-repo" --organization-id 1
---|----------|---------
ID | NAME | PATH
---|----------|---------
6 | file | file
1 | test-txt | test-txt
---|----------|---------
- Upload the copied fileAA
[root@satellite6 ~]# cp custom/file custom/fileAA
[root@satellite6 ~]# md5sum custom/fileAA
87c0a0816ee34adc6ce9793e5a5d96ed custom/fileAA
[root@satellite6 ~]# hammer repository upload-content --path ./custom/fileAA --product "test-product" --name "test-repo" --organization-id 1
[..........................................................................................................................................................................................................................................................] [100%]
Successfully uploaded file fileAA
[root@satellite6 ~]# hammer file list --product "test-product" --repository "test-repo" --organization-id 1
---|----------|---------
ID | NAME | PATH
---|----------|---------
6 | file | file
1 | test-txt | test-txt
---|----------|--------- *** fileAA is not uploaded ***
- Delete the original file and upload fileAA
[root@satellite6 ~]# hammer repository remove-content --product "test-product" --name "test-repo" --ids 6 --content-type file --organization-id 1
Repository content removed.
[root@satellite6 ~]# hammer file list --product "test-product" --repository "test-repo" --organization-id 1
---|------|-----
ID | NAME | PATH
---|------|-----
[root@satellite6 ~]# hammer repository upload-content --path ./custom/fileAA --product "test-product" --name "test-repo" --organization-id 1
[..........................................................................................................................................................................................................................................................] [100%]
Successfully uploaded file fileAA
[root@satellite6 ~]# hammer file list --product "test-product" --repository "test-repo" --organization-id 1
---|------|-----
ID | NAME | PATH
---|------|-----
6 | file | file
---|------|----- *** "file" was generated instead of fileAA ***
Environment
Satellite 6.15
Satellite 6.16
Satellite 6.17
Satellite 6.18
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.