Class: Chef::Util::DSC::LocalConfigurationManager

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/util/dsc/lcm_output_parser.rb,
lib/chef/util/dsc/local_configuration_manager.rb

Defined Under Namespace

Modules: Parser

Instance Method Summary collapse

Constructor Details

#initialize(node, configuration_path) ⇒ LocalConfigurationManager

Returns a new instance of LocalConfigurationManager.



24
25
26
27
28
# File 'lib/chef/util/dsc/local_configuration_manager.rb', line 24

def initialize(node, configuration_path)
  @node = node
  @configuration_path = configuration_path
  clear_execution_time
end

Instance Method Details

#last_operation_execution_time_secondsObject



40
41
42
43
44
# File 'lib/chef/util/dsc/local_configuration_manager.rb', line 40

def last_operation_execution_time_seconds
  if @operation_start_time && @operation_end_time
    @operation_end_time - @operation_start_time
  end
end

#set_configuration(configuration_document, shellout_flags) ⇒ Object



36
37
38
# File 'lib/chef/util/dsc/local_configuration_manager.rb', line 36

def set_configuration(configuration_document, shellout_flags)
  run_configuration_cmdlet(configuration_document, true, shellout_flags)
end

#test_configuration(configuration_document, shellout_flags) ⇒ Object



30
31
32
33
34
# File 'lib/chef/util/dsc/local_configuration_manager.rb', line 30

def test_configuration(configuration_document, shellout_flags)
  status = run_configuration_cmdlet(configuration_document, false, shellout_flags)
  log_dsc_exception(status.stderr) unless status.succeeded?
  configuration_update_required?(status.return_value)
end