diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js
index 46d29670ac..6fd080aba6 100644
--- a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js
+++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js
@@ -200,6 +200,10 @@ define(function(require) {
function _roleHTML(role_index) {
var that = this;
+
+ if (!OpenNebulaAction.cache("VM")) {
+ Sunstone.runAction("VM.list");
+ }
that.cache = OpenNebulaAction.cache("VM");
var role = this.element.TEMPLATE.BODY.roles[role_index];
@@ -219,14 +223,7 @@ define(function(require) {
info.push("");
}
- if (that.element.TEMPLATE.BODY.ready_status_gate) {
- if (vm_info.VM.USER_TEMPLATE.READY == "YES") {
- info.push('');
-
- } else {
- info.push('');
- }
- } else {
+ if (!that.element.TEMPLATE.BODY.ready_status_gate) {
info.push("");
}
@@ -239,6 +236,12 @@ define(function(require) {
if (that.cache && that.cache.data && Array.isArray(that.cache.data)) {
$.each(that.cache.data, function(_, data){
if (data.VM && data.VM.ID === id) {
+ if (that.element.TEMPLATE.BODY.ready_status_gate) {
+ (vm_info.VM.USER_TEMPLATE.READY == "YES")
+ ? info.push('')
+ : info.push('')
+ }
+
ips = OpenNebulaVM.ipsStr(data.VM);
if (OpenNebulaVM.isVNCSupported(data.VM)) {