зеркало из https://github.com/Azure/AzureRMR.git
some resources don't have provisioning state
This commit is contained in:
Родитель
0841472b2a
Коммит
5ec33a31ea
|
@ -357,17 +357,22 @@ private=list(
|
||||||
for(i in 1:1000) # some resources can take a long time to provision (AKS, Kusto)
|
for(i in 1:1000) # some resources can take a long time to provision (AKS, Kusto)
|
||||||
{
|
{
|
||||||
message(".", appendLF=FALSE)
|
message(".", appendLF=FALSE)
|
||||||
Sys.sleep(5)
|
|
||||||
|
|
||||||
# some resources return from creation before they can be retrieved, let http 404's through
|
# some resources return from creation before they can be retrieved, let http 404's through
|
||||||
res <- private$res_op(http_status_handler="pass")
|
res <- private$res_op(http_status_handler="pass")
|
||||||
http_stat <- httr::status_code(res)
|
http_stat <- httr::status_code(res)
|
||||||
state <- httr::content(res)$properties$provisioningState
|
state <- httr::content(res)$properties$provisioningState
|
||||||
|
|
||||||
|
# some resources don't have provisioning state (eg Microsoft.Compute/sshPublicKey)
|
||||||
|
if(is.null(state))
|
||||||
|
state <- "Succeeded"
|
||||||
|
|
||||||
success <- http_stat < 300 && state == "Succeeded"
|
success <- http_stat < 300 && state == "Succeeded"
|
||||||
failure <- http_stat >= 300 || state %in% c("Error", "Failed")
|
failure <- http_stat >= 300 || state %in% c("Error", "Failed")
|
||||||
if(success || failure)
|
if(success || failure)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Sys.sleep(5)
|
||||||
}
|
}
|
||||||
if(success)
|
if(success)
|
||||||
message("\nDeployment successful")
|
message("\nDeployment successful")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче