summaryrefslogtreecommitdiff
path: root/docker/context/config.py
diff options
context:
space:
mode:
authorMilas Bowman <milas.bowman@docker.com>2022-07-29 15:56:01 -0400
committerMilas Bowman <milas.bowman@docker.com>2022-07-29 15:56:01 -0400
commitc6c2bbdcda6ebfc6afae55fd696fb83bcd8ebdf5 (patch)
treef5123e74d200bb0f22b9a8b193e7e52514850bd1 /docker/context/config.py
parentbf1a3518f92eb845d1e39c8c18d9ee137f896c32 (diff)
parent73421027be04c97fc6f50da0647ba47388ed60e5 (diff)
downloaddocker-py-c6c2bbdcda6ebfc6afae55fd696fb83bcd8ebdf5.tar.gz
Merge remote-tracking branch 'upstream/main' into HEAD
Diffstat (limited to 'docker/context/config.py')
-rw-r--r--docker/context/config.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/docker/context/config.py b/docker/context/config.py
index baf54f7..d761aef 100644
--- a/docker/context/config.py
+++ b/docker/context/config.py
@@ -15,7 +15,7 @@ def get_current_context_name():
docker_cfg_path = find_config_file()
if docker_cfg_path:
try:
- with open(docker_cfg_path, "r") as f:
+ with open(docker_cfg_path) as f:
name = json.load(f).get("currentContext", "default")
except Exception:
return "default"
@@ -29,7 +29,7 @@ def write_context_name_to_docker_config(name=None):
config = {}
if docker_cfg_path:
try:
- with open(docker_cfg_path, "r") as f:
+ with open(docker_cfg_path) as f:
config = json.load(f)
except Exception as e:
return e