Skip to content

Commit

Permalink
node.normal should be used to update attributes. Silent copy for wind…
Browse files Browse the repository at this point in the history
…ows. Fix typo in commandline params setup (#12)
  • Loading branch information
ivadim authored Jun 15, 2017
1 parent b81aa3b commit 3ed572d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def valid_vsts_url?(url)
end

def save_vars(resource, node)
VARS_TO_SAVE.each { |var| node.default['vsts_agent']['agents'][resource.agent_name][var] = resource.send(var) if resource.respond_to?(var.to_sym) }
VARS_TO_SAVE.each { |var| node.normal['vsts_agent']['agents'][resource.agent_name][var] = resource.send(var) if resource.respond_to?(var.to_sym) }
node.save
end

Expand Down Expand Up @@ -87,7 +87,7 @@ def agent_attribute?(agent_name, node)
end

def remove_current_state(resource, node)
node.default['vsts_agent']['agents'][resource.agent_name] = {}
node.normal['vsts_agent']['agents'][resource.agent_name] = {}
node.save
end

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
source_url 'https://github.com/Microsoft/vsts-agent-cookbook' if respond_to?(:source_url)
issues_url 'https://github.com/Microsoft/vsts-agent-cookbook/issues' if respond_to?(:issues_url)
chef_version '>= 12.4' if respond_to?(:chef_version)
version '1.3.0'
version '1.3.1'

%w(ubuntu debian mac_os_x mac_os_x_server windows).each do |operating_system|
supports operating_system
Expand Down
4 changes: 2 additions & 2 deletions providers/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def load_current_resource

execute "Move #{new_resource.agent_name} agent from intermidiate folder" do
command "cp -r #{unpack_dir}/#{archive_name}/* #{new_resource.install_dir}" unless windows?
command "xcopy #{unpack_dir}\\#{archive_name}\\* #{win_friendly_path(new_resource.install_dir)} /s /e" if windows?
command "xcopy #{unpack_dir}\\#{archive_name}\\* #{win_friendly_path(new_resource.install_dir)} /s /e /q" if windows?
action :run
end

Expand All @@ -90,7 +90,7 @@ def load_current_resource
args[:windowslogonaccount] = new_resource.windowslogonaccount
end
if windows? && new_resource.windowslogonpassword
args[:windowslogonaccount] = new_resource.windowslogonpassword
args[:windowslogonpassword] = new_resource.windowslogonpassword
end
end

Expand Down

0 comments on commit 3ed572d

Please sign in to comment.