Revision 28917152 src/mad/ruby/OpenNebulaDriver.rb

View differences:

src/mad/ruby/OpenNebulaDriver.rb
67 67
        :failure => "FAILURE"
68 68
    }
69 69

  
70
    def initialize(concurrency=10, threaded=true, retries=0,
71
                directory='subsystem', local_actions={})
72
        super(concurrency, threaded)
70
    # Initialize OpenNebulaDriver object
71
    #
72
    # @param [String] directory path inside the remotes directory where the
73
    #   scripts are located
74
    # @param [Hash] options named options to change the object's behaviour
75
    # @option options [Number] :concurrency (10) max number of threads
76
    # @option options [Boolean] :threaded (true) enables or disables threads
77
    # @option options [Number] :retries (0) number of retries to copy scripts
78
    #   to the remote host
79
    # @option options [Hash] :local_actions ({}) hash with the actions
80
    #   executed locally and the name of the script if it differs from the
81
    #   default one. This hash can be constructed using {parse_actions_list}
82
    def initialize(directory, options={})
83
        @options={
84
            :concurrency => 10,
85
            :threaded => true,
86
            :retries => 0,
87
            :local_actions => {}
88
        }.merge!(options)
89
        
90
        super(@options[:concurrency], @options[:threaded])
73 91

  
74
        @retries = retries
92
        @retries = @options[:retries]
75 93
        @send_mutex=Mutex.new
76
        @local_actions=local_actions
94
        @local_actions=@options[:local_actions]
77 95

  
78 96
        # set default values
79 97
        @config = read_configuration
80 98
        @remote_scripts_base_path=@config['SCRIPTS_REMOTE_DIR']
81
        if ONE_LOCATION == nil
99
        if ENV['ONE_LOCATION'] == nil
82 100
            @local_scripts_base_path = "/var/lib/one/remotes"
83 101
        else
84 102
            @local_scripts_base_path = "#{ENV['ONE_LOCATION']}/var/remotes"

Also available in: Unified diff