summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-23 13:54:22 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-08-23 13:54:22 -0700
commitdaa2748325c1fc05c99174e6e6894144fc895eeb (patch)
treec65da34c637b1a8df155d884be36afbf184346c4
parentd0ca8cf1055fad343ca5a69f460255b611d64a1d (diff)
downloadchef-lcg/bootstrap-without-validator.tar.gz
remove instance ref via helper methodlcg/bootstrap-without-validator
-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