@@ -58,6 +58,7 @@ def __init__(self, client, ordering_manager=None):
5858 else :
5959 self .ordering_manager = ordering_manager
6060
61+ @retry (exceptions .SoftLayerAPIError , logger = LOGGER )
6162 def list_instances (self , hourly = True , monthly = True , tags = None , cpus = None ,
6263 memory = None , hostname = None , domain = None ,
6364 local_disk = None , datacenter = None , nic_speed = None ,
@@ -161,6 +162,7 @@ def list_instances(self, hourly=True, monthly=True, tags=None, cpus=None,
161162 func = getattr (self .account , call )
162163 return func (** kwargs )
163164
165+ @retry (exceptions .SoftLayerAPIError , logger = LOGGER )
164166 def get_instance (self , instance_id , ** kwargs ):
165167 """Get details about a virtual server instance.
166168
@@ -235,6 +237,7 @@ def get_instance(self, instance_id, **kwargs):
235237
236238 return self .guest .getObject (id = instance_id , ** kwargs )
237239
240+ @retry (exceptions .SoftLayerAPIError , logger = LOGGER )
238241 def get_create_options (self ):
239242 """Retrieves the available options for creating a VS.
240243
@@ -411,6 +414,7 @@ def _generate_create_dict(
411414
412415 return data
413416
417+ @retry (exceptions .SoftLayerAPIError , logger = LOGGER )
414418 def wait_for_transaction (self , instance_id , limit , delay = 10 ):
415419 """Waits on a VS transaction for the specified amount of time.
416420
@@ -482,6 +486,7 @@ def wait_for_ready(self, instance_id, limit, delay=10, pending=False):
482486 return False
483487 LOGGER .info ('Auto retry in %s seconds' , str (min (delay , until - now )))
484488 time .sleep (min (delay , until - now ))
489+ return False
485490
486491 def verify_create_instance (self , ** kwargs ):
487492 """Verifies an instance creation command.
@@ -670,7 +675,7 @@ def _get_ids_from_hostname(self, hostname):
670675 results = self .list_instances (hostname = hostname , mask = "id" )
671676 return [result ['id' ] for result in results ]
672677
673- def _get_ids_from_ip (self , ip_address ):
678+ def _get_ids_from_ip (self , ip_address ): # pylint: disable=inconsistent-return-statements
674679 """List VS ids which match the given ip address."""
675680 try :
676681 # Does it look like an ip address?
@@ -893,8 +898,8 @@ def _get_upgrade_prices(self, instance_id, include_downgrade_options=True):
893898 mask = "mask[%s]" % ',' .join (mask )
894899 return self .guest .getUpgradeItemPrices (include_downgrade_options , id = instance_id , mask = mask )
895900
896- def _get_price_id_for_upgrade_option ( self , upgrade_prices , option , value ,
897- public = True ):
901+ # pylint: disable=inconsistent-return-statements
902+ def _get_price_id_for_upgrade_option ( self , upgrade_prices , option , value , public = True ):
898903 """Find the price id for the option and value to upgrade. This
899904
900905 :param list upgrade_prices: Contains all the prices related to a VS upgrade
@@ -934,8 +939,8 @@ def _get_price_id_for_upgrade_option(self, upgrade_prices, option, value,
934939 else :
935940 return price .get ('id' )
936941
937- def _get_price_id_for_upgrade ( self , package_items , option , value ,
938- public = True ):
942+ # pylint: disable=inconsistent-return-statements
943+ def _get_price_id_for_upgrade ( self , package_items , option , value , public = True ):
939944 """Find the price id for the option and value to upgrade.
940945
941946 Deprecated in favor of _get_price_id_for_upgrade_option()
0 commit comments