summaryrefslogtreecommitdiff
path: root/lib/chef/property.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/property.rb')
-rw-r--r--lib/chef/property.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/property.rb b/lib/chef/property.rb
index 336331b59f..a29286c21b 100644
--- a/lib/chef/property.rb
+++ b/lib/chef/property.rb
@@ -1,7 +1,7 @@
#
# Author:: John Keiser <jkeiser@chef.io>
# Copyright:: Copyright 2015-2016, John Keiser
-# Copyright:: Copyright 2015-2020, Chef Software, Inc.
+# Copyright:: Copyright 2015-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -141,6 +141,10 @@ class Chef
raise ArgumentError, "A property cannot be both a name_property/name_attribute and have a default value. Use one or the other on property #{self}"
end
+ if options[:name_property]
+ options[:desired_state] = false unless options.key?(:desired_state)
+ end
+
# Recursively freeze the default if it isn't a lazy value.
unless default.is_a?(DelayedEvaluator)
visitor = lambda do |obj|