From b81f77a1fd554ec3ba877eaa8e15911ac0f77e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Wed, 19 Feb 2014 13:47:40 +0100 Subject: [PATCH] simplify dns_ip_address code 'ips' would be False when it is None or empty Closes-Bug: #1287086 Change-Id: I70d831865af16bfeee969b7927edd6ccc7d2aa11 --- trove/instance/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/trove/instance/models.py b/trove/instance/models.py index 92a19e7528..ea5fc093f6 100644 --- a/trove/instance/models.py +++ b/trove/instance/models.py @@ -162,9 +162,8 @@ class SimpleInstance(object): def dns_ip_address(self): """Returns the IP address to be used with DNS.""" ips = self.get_visible_ip_addresses() - if ips is None or len(ips) < 1: - return None - return ips[0] + if ips: + return ips[0] @property def flavor_id(self):