Add Unit.public_address property
authorCynerva <cynerva@gmail.com>
Wed, 28 Jun 2017 20:58:54 +0000 (15:58 -0500)
committerTim Van Steenburgh <tvansteenburgh@gmail.com>
Wed, 28 Jun 2017 20:58:54 +0000 (16:58 -0400)
juju/unit.py

index 7a6378a..0f2a51c 100644 (file)
@@ -51,6 +51,13 @@ class Unit(model.ModelEntity):
         """
         return self.safe_data['workload-status']['message']
 
+    @property
+    def public_address(self):
+        """ Get the public address.
+
+        """
+        return self.safe_data['public-address'] or None
+
     @property
     def tag(self):
         return 'unit-%s' % self.name.replace('/', '-')