mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
M #-: do not add home if path is S3 (#259)
This commit is contained in:
parent
146030e82a
commit
f13f3365fc
@ -20,6 +20,10 @@ require 'one_helper/onevm_helper'
|
||||
# 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',
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user