@@ -284,22 +284,32 @@ def ips_share(self, linode, *ips):
284284
285285 def ip_addresses_share (self , ips , linode ):
286286 """
287- Configure shared IPs. P sharing allows IP address reassignment
287+ Configure shared IPs. IP sharing allows IP address reassignment
288288 (also referred to as IP failover) from one Linode to another if the
289289 primary Linode becomes unresponsive. This means that requests to the primary Linode’s
290290 IP address can be automatically rerouted to secondary Linodes at the configured shared IP addresses.
291291
292+ API Documentation: https://www.linode.com/docs/api/networking/#ip-addresses-share
293+
292294 :param linode: The id of the Instance or the Instance to share the IPAddresses with.
293295 This Instance will be able to bring up the given addresses.
294296 :type: linode: int or Instance
295- :param ips: Any number of IPAddresses to share to the Instance.
297+ :param ips: Any number of IPAddresses to share to the Instance. Enter an empty array to
298+ remove all shared IP addresses.
296299 :type ips: str or IPAddress
297300 """
298301
302+ shared_ips = []
303+ for ip in ips :
304+ if isinstance (ip , str ):
305+ shared_ips .append (ip )
306+ elif isinstance (ip , IPAddress ):
307+ shared_ips .append (ip .address )
308+ else :
309+ shared_ips .append (str (ip )) # and hope that works
310+
299311 params = {
300- "ips" : ips
301- if not isinstance (ips [0 ], IPAddress )
302- else [ip .address for ip in ips ],
312+ "ips" : shared_ips ,
303313 "linode_id" : linode
304314 if not isinstance (linode , Instance )
305315 else linode .id ,
0 commit comments