Sha256: 43130adce60fc738bab1fb684aaf650b5ec28e3b090021b33064a84e8001cc13

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

# Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
#
# THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
# AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
# reproduction, modification, or disclosure of this program is
# strictly prohibited. Any use of this program by an authorized
# licensee is strictly subject to the terms and conditions,
# including confidentiality obligations, set forth in the applicable
# License Agreement between RightScale.com, Inc. and
# the licensee

module RightConf

  class ExecuteConfigurator

    include Configurator

    register :execute

    description 'Run arbitraty shell commands'

    settings :command_line     => 'Command line to run',
             :message          => 'Progress message to display if any while command is running',
             :abort_on_failure => 'Message to display when aborting configuration if command fails. ' +
                                  'Do not abort if not set'

    validate_has_settings :command_line

    # Run command line
    #
    # === Return
    # true:: Always return true
    def run
      report_check message if message
      args = command_line.split(' ')
      args += [ { :abort_on_failure => abort_on_failure } ] if abort_on_failure
      Command.execute(*args)
      report_success if message
      true
    end

  end
end



Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rconf-0.7.8 lib/rconf/configurators/execute_configurator.rb