зеркало из https://github.com/Azure/AzureStor.git
work around breaking change in xml2 1.2
This commit is contained in:
Родитель
501a68d105
Коммит
df5825bfc5
|
@ -67,7 +67,7 @@ print.storage_endpoint <- function(object)
|
||||||
if(!is_empty(object$sas))
|
if(!is_empty(object$sas))
|
||||||
cat("Account shared access signature: <hidden>\n")
|
cat("Account shared access signature: <hidden>\n")
|
||||||
else cat("Account shared access signature: <none supplied>\n")
|
else cat("Account shared access signature: <none supplied>\n")
|
||||||
cat(sprintf("Storage API version: %s", object$api_version))
|
cat(sprintf("Storage API version: %s\n", object$api_version))
|
||||||
invisible(object)
|
invisible(object)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ do_storage_call <- function(endpoint_url, path, options=list(), headers=list(),
|
||||||
if(is_empty(cont))
|
if(is_empty(cont))
|
||||||
NULL
|
NULL
|
||||||
else if(inherits(cont, "xml_node"))
|
else if(inherits(cont, "xml_node"))
|
||||||
xml2::as_list(cont)
|
xml_to_list(cont)
|
||||||
else cont
|
else cont
|
||||||
}
|
}
|
||||||
else response
|
else response
|
||||||
|
@ -115,7 +115,7 @@ storage_error_message <- function(response, for_httr=TRUE)
|
||||||
cont <- suppressMessages(httr::content(response))
|
cont <- suppressMessages(httr::content(response))
|
||||||
msg <- if(inherits(cont, "xml_node"))
|
msg <- if(inherits(cont, "xml_node"))
|
||||||
{
|
{
|
||||||
cont <- xml2::as_list(cont)
|
cont <- xml_to_list(cont)
|
||||||
paste0(unlist(cont), collapse="\n")
|
paste0(unlist(cont), collapse="\n")
|
||||||
}
|
}
|
||||||
else NULL
|
else NULL
|
||||||
|
@ -158,3 +158,11 @@ generate_endpoint_container <- function(url, key, sas, api_version)
|
||||||
list(endpoint=endpoint, name=name)
|
list(endpoint=endpoint, name=name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xml_to_list <- function(x)
|
||||||
|
{
|
||||||
|
# work around breaking change in xml2 1.2
|
||||||
|
if(packageVersion("xml2") < package_version("1.2"))
|
||||||
|
xml2::as_list(x)
|
||||||
|
else (xml2::as_list(x))[[1]]
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче