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 send_args for EvmDatabaseOps.restore #18144

Conversation

NickLaMuro
Copy link
Member

The send_args that are to be passed to MiqFileStorage.download didn't account for the changes between .upload and .download, which downloading expects a nil for the first argument when in block form.

To account for that, we prepend the nil value if we are doing a .restore, which is the only time we are doing a download from a file storage.

Links

@NickLaMuro NickLaMuro force-pushed the fix_miq_file_storage_send_args_for_download branch from 5d14f07 to 0867879 Compare November 2, 2018 16:47
@NickLaMuro
Copy link
Member Author

@miq-bot assign @carbonin

# are doing a `MiqFileStorage.download`, and the interface for that
# method is to pass a `nil` for the block form since we are streaming the
# data from the command that we are writting as part of the block.
send_args.insert(0, nil) if action == :restore
Copy link
Member

Choose a reason for hiding this comment

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

Maybe #unshift(nil) rather than inserting before the 0th element here?

The `send_args` that are to be passed to `MiqFileStorage.download`
didn't account for the changes between `.upload` and `.download`, which
downloading expects a `nil` for the first argument when in block form
(who writes this crap*...).

To account for that, we prepend the `nil` value if we are doing a
`.restore`, which is the only time we are doing a download from a file
storage.

Partially addresses issues in the following tickets:

  - https://bugzilla.redhat.com/show_bug.cgi?id=1633573
  - https://bugzilla.redhat.com/show_bug.cgi?id=1513520

* Hint:  It was me...
@NickLaMuro NickLaMuro force-pushed the fix_miq_file_storage_send_args_for_download branch from 0867879 to 60fed56 Compare November 5, 2018 21:37
@miq-bot
Copy link
Member

miq-bot commented Nov 5, 2018

Checked commit NickLaMuro@60fed56 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 1 offense detected

lib/evm_database_ops.rb

@carbonin carbonin merged commit 1775555 into ManageIQ:master Nov 5, 2018
@carbonin carbonin added this to the Sprint 98 Ending Nov 5, 2018 milestone Nov 5, 2018
simaishi pushed a commit that referenced this pull request Nov 5, 2018
@simaishi
Copy link
Contributor

simaishi commented Nov 5, 2018

Hammer backport details:

$ git log -1
commit 92dd1890250e22e705503601ae2f5397faf3b842
Author: Nick Carboni <[email protected]>
Date:   Mon Nov 5 17:25:17 2018 -0500

    Merge pull request #18144 from NickLaMuro/fix_miq_file_storage_send_args_for_download
    
    Fix send_args for EvmDatabaseOps.restore
    
    (cherry picked from commit 1775555cfe823ffd5c3c3c50137761c43cf49827)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1633573
    https://bugzilla.redhat.com/show_bug.cgi?id=1513520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants