1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

M #-: do not add home if path is S3 (#259)

(cherry picked from commit f13f3365fce49a63a96dd2b143a48c39b8ed347e)
This commit is contained in:
Alejandro Huertas Herrero 2020-09-29 10:36:29 +02:00 committed by Tino Vazquez
parent 5d12f5de9e
commit 742d7109f3
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE

View File

@ -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