Skip to content
This repository was archived by the owner on Feb 18, 2020. It is now read-only.

Commit 4f82f84

Browse files
committed
Fix for CHEF-11 remove conflicting resource properties
Environment and resources have already been replaced in the resource logic with autoregister_environments and autoregister_resources. Removed fallback usage.
1 parent 1536456 commit 4f82f84

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

resources/agent.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
property :vnc, kind_of: [TrueClass, FalseClass], required: false, default: node['gocd']['agent']['vnc']['enabled']
3030
property :autoregister_key, kind_of: String, required: false, default: nil
3131
property :autoregister_hostname, kind_of: String, required: false, default: nil
32-
property :environments, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoreigster_environments
3332
property :autoregister_environments, kind_of: [String, Array], required: false, default: nil
34-
property :resources, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoregister_resources
3533
property :autoregister_resources, kind_of: [String, Array], required: false, default: nil
3634
property :workspace, kind_of: String, required: false, default: nil
3735
property :elastic_agent_id, kind_of: [String, nil], required: false, default: nil
@@ -121,8 +119,8 @@
121119
group new_resource.group
122120
autoregister_key new_resource.autoregister_key
123121
autoregister_hostname new_resource.autoregister_hostname
124-
autoregister_environments new_resource.autoregister_environments || new_resource.environments
125-
autoregister_resources new_resource.autoregister_resources || new_resource.resources
122+
autoregister_environments new_resource.autoregister_environments
123+
autoregister_resources new_resource.autoregister_resources
126124
elastic_agent_id new_resource.elastic_agent_id
127125
elastic_agent_plugin_id new_resource.elastic_agent_plugin_id
128126
not_if { ::File.exist? proof_of_registration }

resources/agent_autoregister_file.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
property :group, kind_of: String, required: false, default: 'go'
2525
property :autoregister_key, kind_of: String, required: true, default: nil
2626
property :autoregister_hostname, kind_of: String, required: false, default: nil
27-
property :environments, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoreigster_environments
2827
property :autoregister_environments, kind_of: [String, Array], required: false, default: nil
29-
property :resources, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoreigster_resources
3028
property :autoregister_resources, kind_of: [String, Array], required: false, default: nil
3129
property :elastic_agent_id, kind_of: [String, nil], required: false, default: nil
3230
property :elastic_agent_plugin_id, kind_of: [String, nil], required: false, default: nil
@@ -35,8 +33,8 @@
3533
autoregister_values = agent_properties
3634
autoregister_values[:key] = new_resource.autoregister_key || autoregister_values[:key]
3735
autoregister_values[:hostname] = new_resource.autoregister_hostname || autoregister_values[:hostname]
38-
autoregister_values[:autoregister_environments] = new_resource.autoregister_environments || new_resource.environments || autoregister_values[:environments]
39-
autoregister_values[:autoregister_resources] = new_resource.autoregister_resources || new_resource.resources || autoregister_values[:resources]
36+
autoregister_values[:autoregister_environments] = new_resource.autoregister_environments || autoregister_values[:environments]
37+
autoregister_values[:autoregister_resources] = new_resource.autoregister_resources || autoregister_values[:resources]
4038
autoregister_values[:elastic_agent_id] = new_resource.elastic_agent_id || autoregister_values[:elastic_agent_id]
4139
autoregister_values[:elastic_agent_plugin_id] = new_resource.elastic_agent_plugin_id || autoregister_values[:elastic_agent_plugin_id]
4240

0 commit comments

Comments
 (0)