From ade053489e6cf2dcfaf8771f197758b5e441891a Mon Sep 17 00:00:00 2001 From: Hong Ooi Date: Sun, 12 May 2019 05:30:08 +1000 Subject: [PATCH] rm config from az_rm args --- R/az_login.R | 4 ++-- R/az_rm.R | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/R/az_login.R b/R/az_login.R index b63d8f0..64ad1eb 100644 --- a/R/az_login.R +++ b/R/az_login.R @@ -70,8 +70,8 @@ create_azure_login <- function(tenant="common", app=.az_cli_app_id, conf <- jsonlite::fromJSON(config_file) call <- as.list(match.call())[-1] call$config_file <- NULL - call <- modifyList(call, conf) - return(do.call(create_azure_login, lapply(call, eval))) + call <- lapply(modifyList(call, conf), function(x) eval.parent(x)) + return(do.call(create_azure_login, call)) } tenant <- normalize_tenant(tenant) diff --git a/R/az_rm.R b/R/az_rm.R index ec35ee7..5036c0d 100644 --- a/R/az_rm.R +++ b/R/az_rm.R @@ -24,7 +24,6 @@ #' - `host`: your ARM host. Defaults to `https://management.azure.com/`. Change this if you are using a government or private cloud. #' - `aad_host`: Azure Active Directory host for authentication. Defaults to `https://login.microsoftonline.com/`. Change this if you are using a government or private cloud. #' - `...`: Further arguments to pass to `get_azure_token`. -#' - `config_file`: Optionally, a JSON file containing any of the arguments listed above. Arguments supplied in this file take priority over those supplied on the command line. You can also use the output from the Azure CLI `az ad sp create-for-rbac` command. #' - `token`: Optionally, an OAuth 2.0 token, of class [AzureToken]. This allows you to reuse the authentication details for an existing session. If supplied, all other arguments will be ignored. #' #' @seealso @@ -65,17 +64,8 @@ public=list( initialize=function(tenant="common", app=.az_cli_app_id, password=NULL, username=NULL, certificate=NULL, auth_type=NULL, host="https://management.azure.com/", aad_host="https://login.microsoftonline.com/", - config_file=NULL, token=NULL, ...) + token=NULL, ...) { - if(!is.null(config_file)) - { - conf <- jsonlite::fromJSON(config_file) - call <- as.list(match.call())[-1] - call$config_file <- NULL - call <- modifyList(call, conf) - return(do.call(self$initialize, lapply(call, eval))) - } - if(is_azure_token(token)) { self$host <- if(token$version == 1)