Brian O'Connor

Fixing bug in withdraw request when current intent is null

Also, demoting some log levels

Change-Id: I4c7e85bc2bc06e08fe62819d4f66ec8111050a07
...@@ -325,7 +325,7 @@ public class IntentManager ...@@ -325,7 +325,7 @@ public class IntentManager
325 return merge(plans).build(new FlowRuleOperationsContext() { // TODO move this out 325 return merge(plans).build(new FlowRuleOperationsContext() { // TODO move this out
326 @Override 326 @Override
327 public void onSuccess(FlowRuleOperations ops) { 327 public void onSuccess(FlowRuleOperations ops) {
328 - log.info("Completed installing: {}", pending.key()); 328 + log.debug("Completed installing: {}", pending.key());
329 pending.setState(INSTALLED); 329 pending.setState(INSTALLED);
330 store.write(pending); 330 store.write(pending);
331 } 331 }
...@@ -358,7 +358,7 @@ public class IntentManager ...@@ -358,7 +358,7 @@ public class IntentManager
358 return merge(plans).build(new FlowRuleOperationsContext() { 358 return merge(plans).build(new FlowRuleOperationsContext() {
359 @Override 359 @Override
360 public void onSuccess(FlowRuleOperations ops) { 360 public void onSuccess(FlowRuleOperations ops) {
361 - log.info("Completed withdrawing: {}", pending.key()); 361 + log.debug("Completed withdrawing: {}", pending.key());
362 pending.setState(WITHDRAWN); 362 pending.setState(WITHDRAWN);
363 pending.setInstallables(Collections.emptyList()); 363 pending.setInstallables(Collections.emptyList());
364 store.write(pending); 364 store.write(pending);
...@@ -527,7 +527,7 @@ public class IntentManager ...@@ -527,7 +527,7 @@ public class IntentManager
527 return new InstallRequest(this, intentData, Optional.ofNullable(current)); 527 return new InstallRequest(this, intentData, Optional.ofNullable(current));
528 case WITHDRAW_REQ: 528 case WITHDRAW_REQ:
529 if (current == null || isNullOrEmpty(current.installables())) { 529 if (current == null || isNullOrEmpty(current.installables())) {
530 - return new Withdrawn(current, WITHDRAWN); 530 + return new Withdrawn(intentData, WITHDRAWN);
531 } else { 531 } else {
532 return new WithdrawRequest(this, intentData, current); 532 return new WithdrawRequest(this, intentData, current);
533 } 533 }
...@@ -641,8 +641,8 @@ public class IntentManager ...@@ -641,8 +641,8 @@ public class IntentManager
641 private class InternalBatchDelegate implements IntentBatchDelegate { 641 private class InternalBatchDelegate implements IntentBatchDelegate {
642 @Override 642 @Override
643 public void execute(Collection<IntentData> operations) { 643 public void execute(Collection<IntentData> operations) {
644 - log.info("Execute {} operation(s).", operations.size()); 644 + log.debug("Execute {} operation(s).", operations.size());
645 - log.debug("Execute operations: {}", operations); 645 + log.trace("Execute operations: {}", operations);
646 batchExecutor.execute(new IntentBatchPreprocess(operations)); 646 batchExecutor.execute(new IntentBatchPreprocess(operations));
647 // TODO ensure that only one batch is in flight at a time 647 // TODO ensure that only one batch is in flight at a time
648 } 648 }
......