Skip to content

Commit

Permalink
M #-: do not add home if path is S3 (OpenNebula#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Huertas Herrero authored and atodorov-storpool committed Oct 16, 2020
1 parent 166d08a commit 88c18b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cli/one_helper/oneimage_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
# CLI helper for oneimage command
class OneImageHelper < OpenNebulaHelper::OneHelper

# This list contains prefixes that should skip adding user home to the path
# This must have the same content as the case $FROM in downloader.sh
PREFIXES = %w[http https ssh s3 rbd vcenter lxd docker]

TEMPLATE_OPTIONS=[
{
:name => 'name',
Expand Down Expand Up @@ -82,7 +86,7 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
:description => 'Path of the image file',
:format => String,
:proc => lambda do |o, _options|
next [0, o] if o.match(%r{^(https?|docker)://})
next [0, o] if o.match(%r{^(#{PREFIXES.join('|')})://})

if o[0, 1]=='/'
path=o
Expand Down

0 comments on commit 88c18b1

Please sign in to comment.