How to upload a compressed file (.gz) to the swift object storage using Python swift client?

Discussion in 'Python' started by Hanginium65, Jul 25, 2024.

  1. Hanginium65

    Hanginium65 New Member

    Joined:
    Jul 22, 2024
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Occupation:
    Junior DevOps Engineer
    Location:
    Johannesburg, Gauteng
    I wrote the Python code to upload the .gz file from my local machine to the OpenStack object storage.

    The file gets uploaded successfully. However, when I tried to compress the file after downloading it from the object storage using the Swift commands (I cannot ssh to the object storage instance apart from using Swift commands), I got some errors instead and was not able to decompress the file.

    How can I fix this bug in the code to ensure the file gets uploaded in the same format and size to the object storage as the file on my local machine?

    I have attached a file with the error I encountered.

    Any assistance will be appreciated.

    Yours sincerely
     

    Attached Files:

  2. Hanginium65

    Hanginium65 New Member

    Joined:
    Jul 22, 2024
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Occupation:
    Junior DevOps Engineer
    Location:
    Johannesburg, Gauteng
    I have attached also the link to Python Swiftclient documentation (
    python-swiftclient-link.txt) and the Python script I wrote.
     

    Attached Files:

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice