Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upload snowball objects with staging file #1286

Conversation

emrocha
Copy link
Contributor

@emrocha emrocha commented Jun 26, 2023

There is a bug in upload_snowball_objects when it is called with "staging_filename" parameter. The variable "length" passed to fput_object is not defined in this case.

@@ -1891,6 +1891,32 @@ def test_upload_snowball_objects(log_entry):
_CLIENT.remove_object(bucket_name, "my-object3")
_CLIENT.remove_bucket(bucket_name)

# run with staging file option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have def _test_upload_snowball_objects(log_entry, staging_filename): and use the method to have two tests named test_upload_snowball_objects() and test_upload_snowball_objects_staging_file to avoid code duplication.

mod_time=datetime.now(),
),
],
staging_filename="staging.tar"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use random filename here like f"{uuid4()}.tar"

_test_upload_snowball_objects(log_entry)


def test_upload_snowball_objects_with_staging(log_entry):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add in-line comment # pylint: disable=invalid-name to ignore this pylint error.

@harshavardhana harshavardhana merged commit 7346685 into minio:master Aug 17, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants