|
@@ -46,14 +46,12 @@ public class StandardSyncAccountService implements SyncAccountService { |
|
|
log.warn("sync: thisNetwork was null, sync_account is impossible"); |
|
|
log.warn("sync: thisNetwork was null, sync_account is impossible"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!account.admin()) { |
|
|
|
|
|
log.info("sync: not syncing non-admin account"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!account.sync()) { |
|
|
if (!account.sync()) { |
|
|
log.info("sync: account sync disabled for account: "+account.getName()); |
|
|
log.info("sync: account sync disabled for account: "+account.getName()); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
final AnsibleInstallType installType = thisNetwork.getInstallType(); |
|
|
final AnsibleInstallType installType = thisNetwork.getInstallType(); |
|
|
if (installType == AnsibleInstallType.sage) { |
|
|
if (installType == AnsibleInstallType.sage) { |
|
|
// changing account on sage, notify all bubbles launched by user that have syncAccount == true |
|
|
// changing account on sage, notify all bubbles launched by user that have syncAccount == true |
|
@@ -62,7 +60,7 @@ public class StandardSyncAccountService implements SyncAccountService { |
|
|
if (network.getState() != BubbleNetworkState.running) continue; |
|
|
if (network.getState() != BubbleNetworkState.running) continue; |
|
|
if (!network.syncAccount()) continue; |
|
|
if (!network.syncAccount()) continue; |
|
|
for (BubbleNode node : nodeDAO.findByNetwork(network.getUuid())) { |
|
|
for (BubbleNode node : nodeDAO.findByNetwork(network.getUuid())) { |
|
|
if (node.getUuid().equals(configuration.getThisNode().getUuid())) { |
|
|
|
|
|
|
|
|
if (node.getUuid().equals(thisNetwork.getUuid())) { |
|
|
log.info("sync: not notifying self"); |
|
|
log.info("sync: not notifying self"); |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
@@ -72,10 +70,16 @@ public class StandardSyncAccountService implements SyncAccountService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else if (installType == AnsibleInstallType.node) { |
|
|
} else if (installType == AnsibleInstallType.node) { |
|
|
|
|
|
if (account.getUuid().equals(thisNetwork.getAccount())) { |
|
|
|
|
|
log.info("sync: not syncing non-owner account from node to sage"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (!thisNetwork.syncAccount()) { |
|
|
if (!thisNetwork.syncAccount()) { |
|
|
log.info("sync: disabled for node, not sending sync_account notification"); |
|
|
log.info("sync: disabled for node, not sending sync_account notification"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// changing account on node, notify sage, which will then notify all bubbles launched by user that have |
|
|
// changing account on node, notify sage, which will then notify all bubbles launched by user that have |
|
|
// syncAccount == true |
|
|
// syncAccount == true |
|
|
log.info("sync: sending sync_account notification from node to sage: "+configuration.getSageNode()); |
|
|
log.info("sync: sending sync_account notification from node to sage: "+configuration.getSageNode()); |
|
|