Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-30380

'hammer repository upload-content' command cannot rename a file once uploaded and upload it as a new file.

XMLWordPrintable

    • 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.

      1. hammer product create --description "test-file" --name "test-product" --organization-id 1
      2. hammer repository create --content-type "file" --name "test-repo" --organization-id 1 --product "test-product"
      3. 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:

       

              Unassigned Unassigned
              rhn-support-mshimura Miwa Shimura
              Grant Gainey
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: