return backend status in sliceplus object
diff --git a/planetstack/core/xoslib/objects/plus.py b/planetstack/core/xoslib/objects/plus.py
new file mode 100644
index 0000000..f183f33
--- /dev/null
+++ b/planetstack/core/xoslib/objects/plus.py
@@ -0,0 +1,22 @@
+""" PlusObjectMixin
+
+ Implements fields that are common to all OpenCloud objects. For example,
+ stuff related to backend icons.
+"""
+
+class PlusObjectMixin:
+ def getBackendIcon(self):
+ if (self.enacted is not None) and self.enacted >= self.updated:
+ return "/static/admin/img/icon_success.gif"
+ else:
+ if self.backend_status == "Provisioning in progress" or self.backend_status=="":
+ return "/static/admin/img/icon_clock.gif"
+ else:
+ return "/static/admin/img/icon_error.gif"
+
+ def getBackendHtml(self):
+ if (self.enacted is not None) and self.enacted >= self.updated:
+ return '<img src="%s">' % self.getBackendIcon()
+ else:
+ return '<div title="%s"><img src="%s"></div>' % (self.backend_status, self.getBackendIcon())
+