detect resource creation failure

This commit is contained in:
Hong Ooi 2019-07-03 21:09:31 +10:00
Родитель 483fe1b5cf
Коммит 50dd46b06a
2 изменённых файлов: 6 добавлений и 3 удалений

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

@ -1,5 +1,6 @@
# AzureRMR 2.1.2.9000
- Fix a bug where failure to create a resource would not be detected.
- Make setting tags more robust (some resources return a null tags field when no tags are present, rather than an empty object).
# AzureRMR 2.1.2

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

@ -358,10 +358,12 @@ private=list(
# some resources return from creation before they can be retrieved, let http 404's through
res <- private$res_op(http_status_handler="pass")
http_stat <- httr::status_code(res)
state <- httr::content(res)$properties$provisioningState
success <- httr::status_code(res) < 300 &&
httr::content(res)$properties$provisioningState %in% c("Succeeded", "Error", "Failed")
if(success)
success <- http_stat < 300 && state == "Succeeded"
failure <- http_stat < 300 && state %in% c("Error", "Failed")
if(success || failure)
break
}
if(success)