Skip to content

Commit

Permalink
M #-: do not add home if path is S3 (#259)
Browse files Browse the repository at this point in the history
(cherry picked from commit f13f336)
  • Loading branch information
Alejandro Huertas Herrero authored and rsmontero committed Apr 13, 2021
1 parent 6004a2b commit 0946f15
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 0946f15

Please sign in to comment.