Skip to content
Permalink
Browse files

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.
  • Loading branch information...
webframp committed May 31, 2017
1 parent 1536456 commit 4f82f84319d89adbab3d8ce11f31027b7df8fe5c
Showing with 4 additions and 8 deletions.
  1. +2 −4 resources/agent.rb
  2. +2 −4 resources/agent_autoregister_file.rb
@@ -29,9 +29,7 @@
property :vnc, kind_of: [TrueClass, FalseClass], required: false, default: node['gocd']['agent']['vnc']['enabled']
property :autoregister_key, kind_of: String, required: false, default: nil
property :autoregister_hostname, kind_of: String, required: false, default: nil
property :environments, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoreigster_environments
property :autoregister_environments, kind_of: [String, Array], required: false, default: nil
property :resources, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoregister_resources
property :autoregister_resources, kind_of: [String, Array], required: false, default: nil
property :workspace, kind_of: String, required: false, default: nil
property :elastic_agent_id, kind_of: [String, nil], required: false, default: nil
@@ -121,8 +119,8 @@
group new_resource.group
autoregister_key new_resource.autoregister_key
autoregister_hostname new_resource.autoregister_hostname
autoregister_environments new_resource.autoregister_environments || new_resource.environments
autoregister_resources new_resource.autoregister_resources || new_resource.resources
autoregister_environments new_resource.autoregister_environments
autoregister_resources new_resource.autoregister_resources
elastic_agent_id new_resource.elastic_agent_id
elastic_agent_plugin_id new_resource.elastic_agent_plugin_id
not_if { ::File.exist? proof_of_registration }
@@ -24,9 +24,7 @@
property :group, kind_of: String, required: false, default: 'go'
property :autoregister_key, kind_of: String, required: true, default: nil
property :autoregister_hostname, kind_of: String, required: false, default: nil
property :environments, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoreigster_environments
property :autoregister_environments, kind_of: [String, Array], required: false, default: nil
property :resources, kind_of: [String, Array], required: false, default: nil # deprecated in favour of autoreigster_resources
property :autoregister_resources, kind_of: [String, Array], required: false, default: nil
property :elastic_agent_id, kind_of: [String, nil], required: false, default: nil
property :elastic_agent_plugin_id, kind_of: [String, nil], required: false, default: nil
@@ -35,8 +33,8 @@
autoregister_values = agent_properties
autoregister_values[:key] = new_resource.autoregister_key || autoregister_values[:key]
autoregister_values[:hostname] = new_resource.autoregister_hostname || autoregister_values[:hostname]
autoregister_values[:autoregister_environments] = new_resource.autoregister_environments || new_resource.environments || autoregister_values[:environments]
autoregister_values[:autoregister_resources] = new_resource.autoregister_resources || new_resource.resources || autoregister_values[:resources]
autoregister_values[:autoregister_environments] = new_resource.autoregister_environments || autoregister_values[:environments]
autoregister_values[:autoregister_resources] = new_resource.autoregister_resources || autoregister_values[:resources]
autoregister_values[:elastic_agent_id] = new_resource.elastic_agent_id || autoregister_values[:elastic_agent_id]
autoregister_values[:elastic_agent_plugin_id] = new_resource.elastic_agent_plugin_id || autoregister_values[:elastic_agent_plugin_id]

0 comments on commit 4f82f84

Please sign in to comment.
You can’t perform that action at this time.