bin/omf_ec in omf_ec-6.0.8.pre.4 vs bin/omf_ec in omf_ec-6.0.8.pre.5
- old
+ new
@@ -51,12 +51,22 @@
flag [:log_config]
desc "Add some colours to logging"
switch [:colour]
+desc "EC config file"
+arg_name "file"
+flag [:c, :config]
+
+$config_file = ".config/omf_ec.yml"
+ARGV.each_index {|a|
+ if ARGV[a]=="-c" or ARGV[a]=="--config"
+ $config_file = ARGV[a+1] if not ARGV[a+1].nil?
+ end
+}
# the path given here is relative to the user's home directory
-config_file(".config/omf_ec.yml")
+config_file($config_file)
desc "Execute an experiment script"
arg_name "path_to_script_file [-- --experiment_property value]"
command :exec do |c|
c.desc "Experiment name"
@@ -182,21 +192,21 @@
desc "Return the status of the nodes"
command :stat do |c|
c.desc "use this testbed configuration in OMF 5 EC config file"
c.arg_name "AGGREGATE"
- c.flag [:c, :config], :default_value => "default"
+ c.flag [:C], :default_value => "default"
c.desc "comma-separated list of nodes to image"
c.arg_name "TOPOLOGY"
c.flag [:t, :topology], :default_value => "system:topo:all"
c.desc "print a summary of the node status for the testbed"
c.switch [:s, :summary]
c.action do |global_options, options, args|
- @cmd = "omf-5.4 stat -c #{options[:c]} -t #{options[:t]} "
+ @cmd = "omf-5.4 stat -c #{options[:C]} -t #{options[:t]} "
@cmd += "-s" if options[:s]
load_exp(@testbed_exp_path, global_options, options)
end
end
@@ -279,9 +289,14 @@
Logging.logger.root.add_appenders(
Logging.appenders.file(
"#{File.expand_path(global_options[:log_file_dir])}/#{OmfEc.experiment.id}.log",
:layout => Logging.layouts.pattern(:date_pattern => '%F %T %z',
:pattern => '[%d] %-5l %c: %m\n')))
+ end
+
+ if OmfEc.experiment.oml_uri
+ require 'oml4r/logging/oml4r_appender'
+ Logging.logger.root.add_appenders(Logging.appenders.oml4r('oml4r', :appName => 'omf_ec_log', :domain => "#{OmfEc.experiment.id}", :collect => "#{OmfEc.experiment.oml_uri}"))
end
OmfCommon.load_logging_config(global_options[:log_config])
end