-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
6.15.0
-
False
-
Moderate
-
sat-artemis
-
None
-
None
-
None
-
To Do
Description of problem:
'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.
How reproducible:
100%
Is this issue a regression from an earlier version:
Steps to Reproduce:
1. create custom repository.
- hammer product create --description "test-file" --name "test-product" --organization-id 1
- hammer repository create --content-type "file" --name "test-repo" --organization-id 1 --product "test-product"
- hammer repository list --product "test-product" --organization-id 1
--|---------|------------|------------|-------------------------------------------|---
ID | NAME | PRODUCT | CONTENT TYPE | CONTENT LABEL | URL
--|---------|------------|------------|-------------------------------------------|---
68 | test-repo | test-product | file | Default_Organization_test-product_test-repo |
--|---------|------------|------------|-------------------------------------------|---
2. 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
--|--------|--------
3. 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 ***
4. 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 ***
Actual behavior:
'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.
Expected behavior:
[Describe what should be happening instead]
Allow new renamed files to be uploaded.
If you upload from WEBUI, it will work as expected.
Business Impact / Additional info:
- is blocked by
-
SAT-30658 Allow force reuploading of existing files
-
- New
-