From c72b18926cebb8cfeefc0794544945bd402b1eaa Mon Sep 17 00:00:00 2001 From: Andrie de Vries Date: Tue, 6 Jun 2017 12:12:27 -0400 Subject: [PATCH] Add resourceGroup argument when polling for script actions #58 --- R/AzureHDI.R | 7 +++++-- R/pollStatus.R | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/R/AzureHDI.R b/R/AzureHDI.R index 135a610..0d81d41 100644 --- a/R/AzureHDI.R +++ b/R/AzureHDI.R @@ -457,8 +457,11 @@ azureRunScriptAction <- function(azureActiveContext, scriptname, scriptURL, stopWithAzureError(r) azureActiveContext$clustername <- clustername + azureActiveContext$resourceGroup <- resourceGroup + + message("Accepted") - if (wait) pollStatusScriptAction(azureActiveContext, scriptname = scriptname) + if (wait) pollStatusScriptAction(azureActiveContext, scriptname = scriptname, resourceGroup = resourceGroup) return(TRUE) } @@ -497,7 +500,7 @@ azureScriptActionHistory <- function(azureActiveContext, resourceGroup, r <- GET(URL, azureApiHeaders(azToken), verbosity) stopWithAzureError(r) - rc <- content(r)$value + rc <- content(r, bigint_as_char = TRUE)$value if (length(rc) == 0) { message("No script action history found") } diff --git a/R/pollStatus.R b/R/pollStatus.R index b83390c..94691a8 100644 --- a/R/pollStatus.R +++ b/R/pollStatus.R @@ -126,7 +126,7 @@ pollStatusHDI <- function(azureActiveContext, clustername) { } -pollStatusScriptAction <- function(azureActiveContext, scriptname) { +pollStatusScriptAction <- function(azureActiveContext, scriptname, resourceGroup) { message("Script action request submitted: ", Sys.time()) message("Key: A - accepted, (.) - in progress, S - succeeded, E - error, F - failed") @@ -134,7 +134,8 @@ pollStatusScriptAction <- function(azureActiveContext, scriptname) { waiting <- TRUE while (iteration < 500 && waiting) { - status <- azureScriptActionHistory(azureActiveContext) + status <- azureScriptActionHistory(azureActiveContext, + resourceGroup = resourceGroup) idx <- which(sapply(status, "[[", "name") == scriptname)[1] summary <- status[[idx]]$status rc <- switch(tolower(summary),