1
0
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:
Alejandro Huertas Herrero 2020-09-29 10:36:29 +02:00 committed by GitHub
parent 146030e82a
commit f13f3365fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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