Skip to content

Commit

Permalink
Fix the multipart upload issues and local command run issues (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: Aravinda VK <[email protected]>
  • Loading branch information
aravindavk authored Jan 3, 2024
1 parent 5b411e2 commit 736d123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/kadalu/binnacle/plugins/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def self.set_multipart_data(request, kwargs)

multipart_data = []
multipart.each do |key, value|
if value.start_with?('@')
if value.is_a?(String) && value.start_with?('@')
filepath = value.sub('@', '')
filedata = File.open(filepath, 'rb')
multipart_data << [key, filedata, { filename: File.basename(filepath) }]
else
multipart_data << [key, value]
multipart_data << [key, value.to_s]
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/kadalu/binnacle/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def escaped_ssh_cmd(cmd)
# If node is not local then add respective prefix
# to ssh or docker exec
def full_cmd(cmd)
return cmd if Store.get(:command_mode) == 'local'
return cmd if Store.get(:command_mode) == 'local' || Store.get(:node_name) == 'local'

if Store.get(:command_mode) == 'ssh'
"ssh #{Store.get(:ssh_user)}@#{Store.get(:node_name)} " \
Expand Down

0 comments on commit 736d123

Please sign in to comment.