diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-08-23 13:54:22 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-08-23 13:54:22 -0700 |
commit | daa2748325c1fc05c99174e6e6894144fc895eeb (patch) | |
tree | c65da34c637b1a8df155d884be36afbf184346c4 | |
parent | d0ca8cf1055fad343ca5a69f460255b611d64a1d (diff) | |
download | chef-lcg/bootstrap-without-validator.tar.gz |
remove instance ref via helper methodlcg/bootstrap-without-validator
-rw-r--r-- | lib/chef/api_client/registration.rb | 8 |
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 |