From 6b544227ab0421537434b064c39c03bb4b7a7ec9 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 25 Jun 2015 16:00:33 -0600 Subject: [PATCH] Only warn about digital ocean deprecation if digital ocean is configured --- salt/cloud/clouds/digital_ocean.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/salt/cloud/clouds/digital_ocean.py b/salt/cloud/clouds/digital_ocean.py index 156b852307..8569dbf089 100644 --- a/salt/cloud/clouds/digital_ocean.py +++ b/salt/cloud/clouds/digital_ocean.py @@ -81,19 +81,22 @@ def get_configured_provider(): ''' Return the first configured instance. ''' - warn_until( - 'Beryllium', - 'The digital_ocean driver is deprecated and will be removed in Salt Beryllium. ' - 'Please convert your digital ocean provider configs to use the digital_ocean_v2 ' - 'driver.' - ) - - return config.is_provider_configured( + configuration = config.is_provider_configured( __opts__, __active_provider_name__ or 'digital_ocean', ('api_key',) ) + if configuration: + warn_until( + 'Beryllium', + 'The digital_ocean driver is deprecated and will be removed in Salt Beryllium. ' + 'Please convert your digital ocean provider configs to use the digital_ocean_v2 ' + 'driver.' + ) + + return configuration + def avail_locations(call=None): '''