Add resourceGroup argument when polling for script actions #58

This commit is contained in:
Andrie de Vries 2017-06-06 12:12:27 -04:00
Родитель 37d1e9e883
Коммит c72b18926c
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -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")
}

Просмотреть файл

@ -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),