summaryrefslogtreecommitdiff
path: root/lib/chef/api_client/registration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/api_client/registration.rb')
-rw-r--r--lib/chef/api_client/registration.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb
index d2596c321b..5ec0ce82a8 100644
--- a/lib/chef/api_client/registration.rb
+++ b/lib/chef/api_client/registration.rb
@@ -56,7 +56,7 @@ class Chef
assert_destination_writable!
retries = Config[:client_registration_retries] || 5
begin
- @update ? create_or_update : create
+ should_update? ? create_or_update : create
rescue Net::HTTPFatalError => e
# HTTPFatalError implies 5xx.
raise if retries <= 0
@@ -158,6 +158,12 @@ class Chef
base_flags |= File::NOFOLLOW if defined?(File::NOFOLLOW)
base_flags
end
+
+ private
+
+ def should_update?
+ !!@update
+ end
end
end
end