From bb4a917c6aff4eedc535ca128c7e2471e86b0495 Mon Sep 17 00:00:00 2001 From: anuchan Date: Thu, 16 Jun 2016 13:09:47 -0700 Subject: [PATCH] Fixing the bug of trying to create created resources during update, adding better way to name gen resource names --- .../src/main/java/com/microsoft/azure/TaskGroupBase.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java index d0dc430edc3a6..1a43baebf0004 100644 --- a/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java +++ b/azure-client-runtime/src/main/java/com/microsoft/azure/TaskGroupBase.java @@ -50,10 +50,15 @@ public void execute() throws Exception { while (nextNode != null) { if (dag.isRootNode(nextNode)) { executeRootTask(nextNode.data()); + dag.reportedCompleted(nextNode); } else { - nextNode.data().execute(); + // TaskGroupBase::execute will be called both in update and create + // scenarios, so run the task only if it not not executed already. + if (nextNode.data().result() == null) { + nextNode.data().execute(); + dag.reportedCompleted(nextNode); + } } - dag.reportedCompleted(nextNode); nextNode = dag.getNext(); } }