mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Run pyupgrade
against changed files from merge forward
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
b85da8d8b0
commit
023bd39eb5
3 changed files with 13 additions and 13 deletions
|
@ -63,7 +63,7 @@ def host_docker_network_ip_address(network):
|
|||
try:
|
||||
assert ret["result"]
|
||||
except AssertionError:
|
||||
pytest.skip("Failed to create docker network: {}".format(ret))
|
||||
pytest.skip(f"Failed to create docker network: {ret}")
|
||||
yield network_gateway
|
||||
finally:
|
||||
sminion.states.docker_network.absent(network_name)
|
||||
|
@ -147,5 +147,5 @@ def file_add_delete_sls(testfile_path, state_tree):
|
|||
""".format(
|
||||
path=testfile_path
|
||||
)
|
||||
with pytest.helpers.temp_file("{}.sls".format(sls_name), sls_contents, state_tree):
|
||||
with pytest.helpers.temp_file(f"{sls_name}.sls", sls_contents, state_tree):
|
||||
yield sls_name
|
||||
|
|
|
@ -20,7 +20,7 @@ class MySQLImage:
|
|||
container_id = attr.ib()
|
||||
|
||||
def __str__(self):
|
||||
return "{}:{}".format(self.name, self.tag)
|
||||
return f"{self.name}:{self.tag}"
|
||||
|
||||
|
||||
@attr.s(kw_only=True, slots=True)
|
||||
|
@ -67,7 +67,7 @@ def get_test_versions():
|
|||
MySQLImage(
|
||||
name=name,
|
||||
tag=version,
|
||||
container_id=random_string("mysql-{}-".format(version)),
|
||||
container_id=random_string(f"mysql-{version}-"),
|
||||
)
|
||||
)
|
||||
name = "mariadb"
|
||||
|
@ -76,7 +76,7 @@ def get_test_versions():
|
|||
MySQLImage(
|
||||
name=name,
|
||||
tag=version,
|
||||
container_id=random_string("mariadb-{}-".format(version)),
|
||||
container_id=random_string(f"mariadb-{version}-"),
|
||||
)
|
||||
)
|
||||
name = "percona"
|
||||
|
@ -85,14 +85,14 @@ def get_test_versions():
|
|||
MySQLImage(
|
||||
name=name,
|
||||
tag=version,
|
||||
container_id=random_string("percona-{}-".format(version)),
|
||||
container_id=random_string(f"percona-{version}-"),
|
||||
)
|
||||
)
|
||||
return test_versions
|
||||
|
||||
|
||||
def get_test_version_id(value):
|
||||
return "container={}".format(value)
|
||||
return f"container={value}"
|
||||
|
||||
|
||||
@pytest.fixture(scope="module", params=get_test_versions(), ids=get_test_version_id)
|
||||
|
@ -125,8 +125,8 @@ def check_container_started(timeout_at, container, combo):
|
|||
return False
|
||||
ret = container.run(
|
||||
"mysql",
|
||||
"--user={}".format(combo.mysql_user),
|
||||
"--password={}".format(combo.mysql_passwd),
|
||||
f"--user={combo.mysql_user}",
|
||||
f"--password={combo.mysql_passwd}",
|
||||
"-e",
|
||||
"SELECT 1",
|
||||
)
|
||||
|
|
|
@ -29,10 +29,10 @@ class SaltVirtMinionContainerFactory(SaltMinion):
|
|||
tls_uri = attr.ib(init=False)
|
||||
|
||||
def __attrs_post_init__(self):
|
||||
self.uri = "localhost:{}".format(self.sshd_port)
|
||||
self.ssh_uri = "qemu+ssh://{}/system".format(self.uri)
|
||||
self.tcp_uri = "qemu+tcp://localhost:{}/system".format(self.libvirt_tcp_port)
|
||||
self.tls_uri = "qemu+tls://127.0.0.1:{}/system".format(self.libvirt_tls_port)
|
||||
self.uri = f"localhost:{self.sshd_port}"
|
||||
self.ssh_uri = f"qemu+ssh://{self.uri}/system"
|
||||
self.tcp_uri = f"qemu+tcp://localhost:{self.libvirt_tcp_port}/system"
|
||||
self.tls_uri = f"qemu+tls://127.0.0.1:{self.libvirt_tls_port}/system"
|
||||
|
||||
if "environment" not in self.container_run_kwargs:
|
||||
self.container_run_kwargs["environment"] = {}
|
||||
|
|
Loading…
Add table
Reference in a new issue