lib/forj/process/ForjProcess.rb in forj-1.0.4 vs lib/forj/process/ForjProcess.rb in forj-1.0.5

- old
+ new

@@ -487,10 +487,18 @@ # Add init additionnal git clone steps. h_meta['repos'] = hParams[:repos] if hParams[:repos] # Add init bootstrap additionnal steps h_meta['bootstrap'] = hParams[:bootstrap] if hParams[:bootstrap] + + if hParams[:extra_metadata] + hParams[:extra_metadata].split(/,/).each do |kv| + k, v = kv.split(/=/) + h_meta[k] = v + end + end + h_meta end def build_metadata(sObjectType, hParams) entr = load_encoded_key @@ -642,10 +650,11 @@ class ForjCoreProcess # Function which compare directories from maestro templates to infra. def infra_is_original?(infra_dir, maestro_dir) dest_cloud_init = File.join(infra_dir, 'cloud-init') template = File.join(maestro_dir, 'templates', 'infra') + return false unless File.exist?(template) s_md5_list = File.join(infra_dir, '.maestro_original.yaml') b_result = true h_result = {} if File.exist?(s_md5_list) begin @@ -1281,13 +1290,7 @@ s_opts += format(' -i %s', options[:keys]) if options[:keys] command = format('ssh %s %s@%s', s_opts, user, public_ip) PrcLib.debug("Running '%s'", command) system(command) - end - - def ssh_user(image_name) - return 'fedora' if image_name =~ /fedora/i - return 'centos' if image_name =~ /centos/i - 'ubuntu' end end