Permalink
Browse files

[KARAF-1465] Fix cluster:group-set command for remote node

git-svn-id: https://svn.apache.org/repos/asf/karaf/cellar/trunk@1338586 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent afa7b8a commit c266fcda7e778981d589de45051fd01c985c0f94 @jbonofre jbonofre committed May 15, 2012
@@ -49,9 +49,8 @@ public ManageGroupResult execute(ManageGroupCommand command) {
purgeGroups();
joinGroup(Configurations.DEFAULT_GROUP_NAME);
} else if (ManageGroupAction.SET.equals(action)) {
- if (command.getSourceGroup() != null) {
- quitGroup(command.getSourceGroup().getName());
- }
+ Group localGroup = groupManager.listLocalGroups().iterator().next();
+ quitGroup(localGroup.getName());
joinGroup(targetGroupName);
}
@@ -81,7 +80,6 @@ public void addGroupListToResult(ManageGroupResult result) {
* @param targetGroupName
*/
public void joinGroup(String targetGroupName) {
- LOGGER.info("CELLAR GROUP: Joining group {}.",targetGroupName);
Node node = clusterManager.getNode();
Map<String, Group> groups = groupManager.listGroups();
if (groups != null && !groups.isEmpty()) {
@@ -102,7 +100,6 @@ public void joinGroup(String targetGroupName) {
* @param targetGroupName
*/
public void quitGroup(String targetGroupName) {
- LOGGER.info("CELLAR GROUP: Quiting group {}.",targetGroupName);
Node node = clusterManager.getNode();
Map<String, Group> groups = groupManager.listGroups();
if (groups != null && !groups.isEmpty()) {
@@ -118,7 +115,6 @@ public void quitGroup(String targetGroupName) {
* Removes {@link Node} from ALL {@link Group}s.
*/
public void purgeGroups() {
- LOGGER.info("CELLAR GROUP: Purging all groups from node.");
Node node = clusterManager.getNode();
Set<String> groupNames = groupManager.listGroupNames(node);
if (groupNames != null && !groupNames.isEmpty()) {
@@ -37,8 +37,7 @@ protected Object doExecute() throws Exception {
return null;
}
- Group localGroup = groupManager.listLocalGroups().iterator().next();
- return doExecute(ManageGroupAction.SET, groupName, localGroup, nodes,false);
+ return doExecute(ManageGroupAction.SET, groupName, null, nodes, false);
}
}

0 comments on commit c266fcd

Please sign in to comment.