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

Inherits:
Object
  • Object
show all
Includes:
Mixin::PowershellExec
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.



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

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

Instance Method Details

#last_operation_execution_time_secondsObject



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

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) ⇒ Object



38
39
40
# File 'lib/chef/util/dsc/local_configuration_manager.rb', line 38

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

#test_configuration(configuration_document) ⇒ Object



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

def test_configuration(configuration_document)
  status = run_configuration_cmdlet(configuration_document, false)
  log_dsc_exception(status.errors.join("\n")) if status.error?
  configuration_update_required?(status.result)
end