mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-18 12:52:37 +00:00
Address unspecified-encoding.
This commit is contained in:
parent
057b04b90b
commit
92a810c6d6
@ -410,7 +410,6 @@ disable=raw-checker-failed,
|
|||||||
unexpected-keyword-arg,
|
unexpected-keyword-arg,
|
||||||
unnecessary-dunder-call,
|
unnecessary-dunder-call,
|
||||||
unnecessary-pass,
|
unnecessary-pass,
|
||||||
unspecified-encoding,
|
|
||||||
unsupported-assignment-operation, # TODO: needs better typing info
|
unsupported-assignment-operation, # TODO: needs better typing info
|
||||||
unused-argument,
|
unused-argument,
|
||||||
unused-variable,
|
unused-variable,
|
||||||
|
|||||||
@ -166,7 +166,7 @@ class AuthConfig(dict):
|
|||||||
if not config_file:
|
if not config_file:
|
||||||
return cls({}, credstore_env)
|
return cls({}, credstore_env)
|
||||||
try:
|
try:
|
||||||
with open(config_file) as f:
|
with open(config_file, "rt", encoding="utf-8") as f:
|
||||||
config_dict = json.load(f)
|
config_dict = json.load(f)
|
||||||
except (IOError, KeyError, ValueError) as e:
|
except (IOError, KeyError, ValueError) as e:
|
||||||
# Likely missing new Docker config file or it is in an
|
# Likely missing new Docker config file or it is in an
|
||||||
@ -351,7 +351,7 @@ def _load_legacy_config(config_file):
|
|||||||
log.debug("Attempting to parse legacy auth file format")
|
log.debug("Attempting to parse legacy auth file format")
|
||||||
try:
|
try:
|
||||||
data = []
|
data = []
|
||||||
with open(config_file) as f:
|
with open(config_file, "rt", encoding="utf-8") as f:
|
||||||
for line in f.readlines():
|
for line in f.readlines():
|
||||||
data.append(line.strip().split(" = ")[1])
|
data.append(line.strip().split(" = ")[1])
|
||||||
if len(data) < 2:
|
if len(data) < 2:
|
||||||
|
|||||||
@ -151,7 +151,7 @@ class ContextAPI(object):
|
|||||||
if filename == METAFILE:
|
if filename == METAFILE:
|
||||||
filepath = os.path.join(dirname, filename)
|
filepath = os.path.join(dirname, filename)
|
||||||
try:
|
try:
|
||||||
with open(filepath, "r") as f:
|
with open(filepath, "rt", encoding="utf-8") as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
name = data["Name"]
|
name = data["Name"]
|
||||||
if name == "default":
|
if name == "default":
|
||||||
|
|||||||
@ -32,7 +32,7 @@ def get_current_context_name_with_source():
|
|||||||
docker_cfg_path = find_config_file()
|
docker_cfg_path = find_config_file()
|
||||||
if docker_cfg_path:
|
if docker_cfg_path:
|
||||||
try:
|
try:
|
||||||
with open(docker_cfg_path) as f:
|
with open(docker_cfg_path, "rt", encoding="utf-8") as f:
|
||||||
return (
|
return (
|
||||||
json.load(f).get("currentContext", "default"),
|
json.load(f).get("currentContext", "default"),
|
||||||
f"configuration file {docker_cfg_path}",
|
f"configuration file {docker_cfg_path}",
|
||||||
@ -53,7 +53,7 @@ def write_context_name_to_docker_config(name=None):
|
|||||||
config = {}
|
config = {}
|
||||||
if docker_cfg_path:
|
if docker_cfg_path:
|
||||||
try:
|
try:
|
||||||
with open(docker_cfg_path) as f:
|
with open(docker_cfg_path, "rt", encoding="utf-8") as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return e
|
return e
|
||||||
@ -67,7 +67,7 @@ def write_context_name_to_docker_config(name=None):
|
|||||||
if not docker_cfg_path:
|
if not docker_cfg_path:
|
||||||
docker_cfg_path = get_default_config_file()
|
docker_cfg_path = get_default_config_file()
|
||||||
try:
|
try:
|
||||||
with open(docker_cfg_path, "w") as f:
|
with open(docker_cfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f, indent=4)
|
json.dump(config, f, indent=4)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return e
|
return e
|
||||||
|
|||||||
@ -133,7 +133,7 @@ class Context(object):
|
|||||||
|
|
||||||
metadata = {}
|
metadata = {}
|
||||||
try:
|
try:
|
||||||
with open(meta_file) as f:
|
with open(meta_file, "rt", encoding="utf-8") as f:
|
||||||
metadata = json.load(f)
|
metadata = json.load(f)
|
||||||
except (OSError, KeyError, ValueError) as e:
|
except (OSError, KeyError, ValueError) as e:
|
||||||
# unknown format
|
# unknown format
|
||||||
@ -189,7 +189,7 @@ class Context(object):
|
|||||||
meta_dir = get_meta_dir(self.name)
|
meta_dir = get_meta_dir(self.name)
|
||||||
if not os.path.isdir(meta_dir):
|
if not os.path.isdir(meta_dir):
|
||||||
os.makedirs(meta_dir)
|
os.makedirs(meta_dir)
|
||||||
with open(get_meta_file(self.name), "w") as f:
|
with open(get_meta_file(self.name), "wt", encoding="utf-8") as f:
|
||||||
f.write(json.dumps(self.Metadata))
|
f.write(json.dumps(self.Metadata))
|
||||||
|
|
||||||
tls_dir = get_tls_dir(self.name)
|
tls_dir = get_tls_dir(self.name)
|
||||||
|
|||||||
@ -222,7 +222,7 @@ class SSHHTTPAdapter(BaseHTTPAdapter):
|
|||||||
ssh_config_file = os.path.expanduser("~/.ssh/config")
|
ssh_config_file = os.path.expanduser("~/.ssh/config")
|
||||||
if os.path.exists(ssh_config_file):
|
if os.path.exists(ssh_config_file):
|
||||||
conf = paramiko.SSHConfig()
|
conf = paramiko.SSHConfig()
|
||||||
with open(ssh_config_file) as f:
|
with open(ssh_config_file, "rt", encoding="utf-8") as f:
|
||||||
conf.parse(f)
|
conf.parse(f)
|
||||||
host_config = conf.lookup(base_url.hostname)
|
host_config = conf.lookup(base_url.hostname)
|
||||||
if "proxycommand" in host_config:
|
if "proxycommand" in host_config:
|
||||||
|
|||||||
@ -271,7 +271,7 @@ def process_dockerfile(dockerfile, path):
|
|||||||
0
|
0
|
||||||
] or os.path.relpath(abs_dockerfile, path).startswith(".."):
|
] or os.path.relpath(abs_dockerfile, path).startswith(".."):
|
||||||
# Dockerfile not in context - read data to insert into tar later
|
# Dockerfile not in context - read data to insert into tar later
|
||||||
with open(abs_dockerfile) as df:
|
with open(abs_dockerfile, "rt", encoding="utf-8") as df:
|
||||||
return (f".dockerfile.{random.getrandbits(160):x}", df.read())
|
return (f".dockerfile.{random.getrandbits(160):x}", df.read())
|
||||||
|
|
||||||
# Dockerfile is inside the context - return path relative to context root
|
# Dockerfile is inside the context - return path relative to context root
|
||||||
|
|||||||
@ -80,7 +80,7 @@ def load_general_config(config_path=None):
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(config_file) as f:
|
with open(config_file, "rt", encoding="utf-8") as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
except (IOError, ValueError) as e:
|
except (IOError, ValueError) as e:
|
||||||
# In the case of a legacy `.dockercfg` file, we will not
|
# In the case of a legacy `.dockercfg` file, we will not
|
||||||
|
|||||||
@ -452,7 +452,7 @@ def parse_env_file(env_file):
|
|||||||
"""
|
"""
|
||||||
environment = {}
|
environment = {}
|
||||||
|
|
||||||
with open(env_file, "r") as f:
|
with open(env_file, "rt", encoding="utf-8") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
|
|
||||||
if line[0] == "#":
|
if line[0] == "#":
|
||||||
|
|||||||
@ -111,7 +111,7 @@ def log_debug(msg, pretty_print=False):
|
|||||||
|
|
||||||
If ``pretty_print=True``, the message will be pretty-printed as JSON.
|
If ``pretty_print=True``, the message will be pretty-printed as JSON.
|
||||||
"""
|
"""
|
||||||
with open("docker.log", "a") as log_file:
|
with open("docker.log", "at", encoding="utf-8") as log_file:
|
||||||
if pretty_print:
|
if pretty_print:
|
||||||
log_file.write(
|
log_file.write(
|
||||||
json.dumps(msg, sort_keys=True, indent=4, separators=(",", ": "))
|
json.dumps(msg, sort_keys=True, indent=4, separators=(",", ": "))
|
||||||
|
|||||||
@ -891,7 +891,7 @@ class ImageManager(DockerBaseClass):
|
|||||||
dockerignore = os.path.join(self.build_path, ".dockerignore")
|
dockerignore = os.path.join(self.build_path, ".dockerignore")
|
||||||
exclude = None
|
exclude = None
|
||||||
if os.path.exists(dockerignore):
|
if os.path.exists(dockerignore):
|
||||||
with open(dockerignore) as f:
|
with open(dockerignore, "rt", encoding="utf-8") as f:
|
||||||
exclude = list(
|
exclude = list(
|
||||||
filter(
|
filter(
|
||||||
lambda x: x != "" and x[0] != "#",
|
lambda x: x != "" and x[0] != "#",
|
||||||
|
|||||||
@ -161,7 +161,7 @@ class DockerFileStore(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Attempt to read the existing config.
|
# Attempt to read the existing config.
|
||||||
with open(self._config_path, "r") as f:
|
with open(self._config_path, "rt", encoding="utf-8") as f:
|
||||||
config = json.load(f)
|
config = json.load(f)
|
||||||
except (ValueError, IOError):
|
except (ValueError, IOError):
|
||||||
# No config found or an invalid config found so we'll ignore it.
|
# No config found or an invalid config found so we'll ignore it.
|
||||||
|
|||||||
@ -300,7 +300,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
self.addCleanup(shutil.rmtree, folder)
|
self.addCleanup(shutil.rmtree, folder)
|
||||||
cfg_path = os.path.join(folder, ".dockercfg")
|
cfg_path = os.path.join(folder, ".dockercfg")
|
||||||
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
||||||
with open(cfg_path, "w") as f:
|
with open(cfg_path, "wt", encoding="utf-8") as f:
|
||||||
f.write(f"auth = {auth_}\n")
|
f.write(f"auth = {auth_}\n")
|
||||||
f.write("email = sakuya@scarlet.net")
|
f.write("email = sakuya@scarlet.net")
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
cfg_path = os.path.join(folder, ".dockercfg")
|
cfg_path = os.path.join(folder, ".dockercfg")
|
||||||
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
||||||
email = "sakuya@scarlet.net"
|
email = "sakuya@scarlet.net"
|
||||||
with open(cfg_path, "w") as f:
|
with open(cfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump({auth.INDEX_URL: {"auth": auth_, "email": email}}, f)
|
json.dump({auth.INDEX_URL: {"auth": auth_, "email": email}}, f)
|
||||||
cfg = auth.load_config(cfg_path)
|
cfg = auth.load_config(cfg_path)
|
||||||
assert auth.resolve_authconfig(cfg) is not None
|
assert auth.resolve_authconfig(cfg) is not None
|
||||||
@ -336,7 +336,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
cfg_path = os.path.join(folder, "config.json")
|
cfg_path = os.path.join(folder, "config.json")
|
||||||
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
||||||
email = "sakuya@scarlet.net"
|
email = "sakuya@scarlet.net"
|
||||||
with open(cfg_path, "w") as f:
|
with open(cfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump({"auths": {auth.INDEX_URL: {"auth": auth_, "email": email}}}, f)
|
json.dump({"auths": {auth.INDEX_URL: {"auth": auth_, "email": email}}}, f)
|
||||||
cfg = auth.load_config(cfg_path)
|
cfg = auth.load_config(cfg_path)
|
||||||
assert auth.resolve_authconfig(cfg) is not None
|
assert auth.resolve_authconfig(cfg) is not None
|
||||||
@ -355,7 +355,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
||||||
config = {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
config = {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
||||||
|
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
cfg = auth.load_config(dockercfg_path).auths
|
cfg = auth.load_config(dockercfg_path).auths
|
||||||
@ -376,7 +376,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
auth_ = base64.b64encode(b"sakuya:izayoi").decode("ascii")
|
||||||
config = {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
config = {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
||||||
|
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
||||||
@ -400,7 +400,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
"auths": {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
"auths": {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
||||||
@ -423,7 +423,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
"auths": {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
"auths": {registry: {"auth": f"{auth_}", "email": "sakuya@scarlet.net"}}
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
||||||
@ -440,7 +440,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
self.addCleanup(shutil.rmtree, folder)
|
self.addCleanup(shutil.rmtree, folder)
|
||||||
dockercfg_path = os.path.join(folder, "config.json")
|
dockercfg_path = os.path.join(folder, "config.json")
|
||||||
config = {"detachKeys": "ctrl-q, ctrl-u, ctrl-i"}
|
config = {"detachKeys": "ctrl-q, ctrl-u, ctrl-i"}
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
cfg = auth.load_config(dockercfg_path)
|
cfg = auth.load_config(dockercfg_path)
|
||||||
@ -451,7 +451,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
self.addCleanup(shutil.rmtree, folder)
|
self.addCleanup(shutil.rmtree, folder)
|
||||||
dockercfg_path = os.path.join(folder, "config.json")
|
dockercfg_path = os.path.join(folder, "config.json")
|
||||||
config = {"auths": {"scarlet.net": {"sakuya": "izayoi"}}}
|
config = {"auths": {"scarlet.net": {"sakuya": "izayoi"}}}
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
cfg = auth.load_config(dockercfg_path)
|
cfg = auth.load_config(dockercfg_path)
|
||||||
@ -465,7 +465,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
dockercfg_path = os.path.join(folder, "config.json")
|
dockercfg_path = os.path.join(folder, "config.json")
|
||||||
auth_entry = encode_auth({"username": "sakuya"}).decode("ascii")
|
auth_entry = encode_auth({"username": "sakuya"}).decode("ascii")
|
||||||
config = {"auths": {registry: {"auth": auth_entry, "identitytoken": token}}}
|
config = {"auths": {registry: {"auth": auth_entry, "identitytoken": token}}}
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config, f)
|
json.dump(config, f)
|
||||||
|
|
||||||
cfg = auth.load_config(dockercfg_path)
|
cfg = auth.load_config(dockercfg_path)
|
||||||
|
|||||||
@ -37,7 +37,7 @@ def make_tree(dirs, files):
|
|||||||
os.makedirs(os.path.join(base, path))
|
os.makedirs(os.path.join(base, path))
|
||||||
|
|
||||||
for path in files:
|
for path in files:
|
||||||
with open(os.path.join(base, path), "w") as f:
|
with open(os.path.join(base, path), "wt", encoding="utf-8") as f:
|
||||||
f.write("content")
|
f.write("content")
|
||||||
|
|
||||||
return base
|
return base
|
||||||
@ -440,7 +440,7 @@ class TarTest(unittest.TestCase):
|
|||||||
base = tempfile.mkdtemp()
|
base = tempfile.mkdtemp()
|
||||||
full_path = os.path.join(base, "foo")
|
full_path = os.path.join(base, "foo")
|
||||||
self.addCleanup(shutil.rmtree, base)
|
self.addCleanup(shutil.rmtree, base)
|
||||||
with open(full_path, "w") as f:
|
with open(full_path, "wt", encoding="utf-8") as f:
|
||||||
f.write("content")
|
f.write("content")
|
||||||
os.chmod(full_path, 0o222)
|
os.chmod(full_path, 0o222)
|
||||||
with pytest.raises(IOError) as ei:
|
with pytest.raises(IOError) as ei:
|
||||||
@ -452,7 +452,7 @@ class TarTest(unittest.TestCase):
|
|||||||
def test_tar_with_file_symlinks(self):
|
def test_tar_with_file_symlinks(self):
|
||||||
base = tempfile.mkdtemp()
|
base = tempfile.mkdtemp()
|
||||||
self.addCleanup(shutil.rmtree, base)
|
self.addCleanup(shutil.rmtree, base)
|
||||||
with open(os.path.join(base, "foo"), "w") as f:
|
with open(os.path.join(base, "foo"), "wt", encoding="utf-8") as f:
|
||||||
f.write("content")
|
f.write("content")
|
||||||
os.makedirs(os.path.join(base, "bar"))
|
os.makedirs(os.path.join(base, "bar"))
|
||||||
os.symlink("../foo", os.path.join(base, "bar/foo"))
|
os.symlink("../foo", os.path.join(base, "bar/foo"))
|
||||||
@ -500,7 +500,7 @@ class TarTest(unittest.TestCase):
|
|||||||
base = tempfile.mkdtemp()
|
base = tempfile.mkdtemp()
|
||||||
filename = os.path.join(base, "th.txt")
|
filename = os.path.join(base, "th.txt")
|
||||||
self.addCleanup(shutil.rmtree, base)
|
self.addCleanup(shutil.rmtree, base)
|
||||||
with open(filename, "w") as f:
|
with open(filename, "wt", encoding="utf-8") as f:
|
||||||
f.write("Invisible Full Moon")
|
f.write("Invisible Full Moon")
|
||||||
os.utime(filename, (12345, -3600.0))
|
os.utime(filename, (12345, -3600.0))
|
||||||
with tar(base) as archive:
|
with tar(base) as archive:
|
||||||
|
|||||||
@ -96,7 +96,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
"HttpHeaders": {"Name": "Spike", "Surname": "Spiegel"},
|
"HttpHeaders": {"Name": "Spike", "Surname": "Spiegel"},
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config_data, f)
|
json.dump(config_data, f)
|
||||||
|
|
||||||
cfg = config.load_general_config(dockercfg_path)
|
cfg = config.load_general_config(dockercfg_path)
|
||||||
@ -108,7 +108,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
self.addCleanup(shutil.rmtree, folder)
|
self.addCleanup(shutil.rmtree, folder)
|
||||||
dockercfg_path = os.path.join(folder, "config.json")
|
dockercfg_path = os.path.join(folder, "config.json")
|
||||||
config_data = {"detachKeys": "ctrl-q, ctrl-u, ctrl-i"}
|
config_data = {"detachKeys": "ctrl-q, ctrl-u, ctrl-i"}
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config_data, f)
|
json.dump(config_data, f)
|
||||||
|
|
||||||
cfg = config.load_general_config(dockercfg_path)
|
cfg = config.load_general_config(dockercfg_path)
|
||||||
@ -119,7 +119,7 @@ class LoadConfigTest(unittest.TestCase):
|
|||||||
self.addCleanup(shutil.rmtree, folder)
|
self.addCleanup(shutil.rmtree, folder)
|
||||||
dockercfg_path = os.path.join(folder, "config.json")
|
dockercfg_path = os.path.join(folder, "config.json")
|
||||||
config_data = {"detachKeys": "ctrl-q, ctrl-u, ctrl-i"}
|
config_data = {"detachKeys": "ctrl-q, ctrl-u, ctrl-i"}
|
||||||
with open(dockercfg_path, "w") as f:
|
with open(dockercfg_path, "wt", encoding="utf-8") as f:
|
||||||
json.dump(config_data, f)
|
json.dump(config_data, f)
|
||||||
|
|
||||||
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
with mock.patch.dict(os.environ, {"DOCKER_CONFIG": folder}):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user