From 35c6c72f2ebcddd71e613ade1ead7f32143f28cc Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Mon, 29 Sep 2014 14:11:10 -0500 Subject: [PATCH] Add Instance.role property. --- awx/main/models/ha.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awx/main/models/ha.py b/awx/main/models/ha.py index 40a7aed12c..a277124cd4 100644 --- a/awx/main/models/ha.py +++ b/awx/main/models/ha.py @@ -16,3 +16,9 @@ class Instance(models.Model): class Meta: app_label = 'main' + @property + def role(self): + """Return the role of this instance, as a string.""" + if self.primary: + return 'primary' + return 'secondary'