From c6991e22ce6837b636be168817a7c2b23aaed811 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Wed, 21 Feb 2024 12:18:00 -0700 Subject: [PATCH 01/34] Fix update winrepo script on 3006.x --- .github/workflows/release-update-winrepo.yml | 3 +++ .github/workflows/scripts/update_winrepo.py | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-update-winrepo.yml b/.github/workflows/release-update-winrepo.yml index 2c5630034b8..4282709d72b 100644 --- a/.github/workflows/release-update-winrepo.yml +++ b/.github/workflows/release-update-winrepo.yml @@ -41,9 +41,12 @@ jobs: - name: Add Version to Minion Definition File working-directory: salt run: | + pwd + ls -al ../winrepo/salt-minion.sls python .github/workflows/scripts/update_winrepo.py \ --file ../winrepo/salt-minion.sls \ --version ${{ inputs.salt-version || github.ref_name }} + grep ${{ inputs.salt-version || github.ref_name }} ../winrepo/salt-minion.sls - name: Commit Changes working-directory: winrepo diff --git a/.github/workflows/scripts/update_winrepo.py b/.github/workflows/scripts/update_winrepo.py index b12d6558a4d..ab2c92d44db 100644 --- a/.github/workflows/scripts/update_winrepo.py +++ b/.github/workflows/scripts/update_winrepo.py @@ -1,8 +1,10 @@ import argparse import os +print("Update winrepo script") + # Where are we -print(os.getcwd()) +print(f"Current working directory: {os.getcwd()}") arg_parser = argparse.ArgumentParser() arg_parser.add_argument("-f", "--file", help="the winrepo file to edit") @@ -12,10 +14,15 @@ args = arg_parser.parse_args() file = args.file version = args.version +print("Args:") +print(f"- file: {file}") +print(f"- version: {version}") + if version.startswith("v"): version = version[1:] with open(file) as f: + print(f"Opening file: {file}") current_contents = f.readlines() new_contents = [] @@ -23,9 +30,13 @@ new_contents = [] added = False for line in current_contents: new_contents.append(line) - if "for version in [" in line and not added: - new_contents.append(f" '{version}',\n") + if "load_yaml as versions_relenv" in line and not added: + print(f"Adding version: {version}") + new_contents.append(f"- {version}\n") added = True with open(file, "w") as f: + print(f"Writing file: {file}") f.writelines(new_contents) + +print("Update winrepo script complete") From 2f14cd2816656fbd1310b8ce882280ef96969e85 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 21 Feb 2024 17:57:36 -0600 Subject: [PATCH 02/34] Fix file.directory clobbering backupname path with test=True --- salt/states/file.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/salt/states/file.py b/salt/states/file.py index c78c5c24ab5..e36db6f2468 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -3897,13 +3897,25 @@ def directory( if not force: return _error( ret, - "File exists where the backup target {} should go".format( - backupname - ), + f"File exists where the backup target {backupname} should go", ) + if __opts__["test"]: + ret["changes"][ + "forced" + ] = f"Existing file at backup path {backupname} would be removed" else: __salt__["file.remove"](backupname) - os.rename(name, backupname) + + if __opts__["test"]: + ret["changes"]["backup"] = f"{name} would be renamed to {backupname}" + ret["changes"][name] = {"directory": "new"} + ret[ + "comment" + ] = f"{name} would be backed up and replaced with a new directory" + ret["result"] = None + return ret + else: + os.rename(name, backupname) elif force: # Remove whatever is in the way if os.path.isfile(name): From 21ebbf155d97ccab59573044faf76a9eb2553478 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 21 Feb 2024 18:57:41 -0600 Subject: [PATCH 03/34] Add test case --- .../functional/states/file/test_directory.py | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/tests/pytests/functional/states/file/test_directory.py b/tests/pytests/functional/states/file/test_directory.py index 82a3f7f154c..904a7d43b97 100644 --- a/tests/pytests/functional/states/file/test_directory.py +++ b/tests/pytests/functional/states/file/test_directory.py @@ -436,3 +436,55 @@ def test_issue_12209_follow_symlinks( assert one_group_check == state_file_account.group.name two_group_check = modules.file.get_group(str(twodir), follow_symlinks=False) assert two_group_check == state_file_account.group.name + + +@pytest.mark.parametrize("backupname_isfile", [False, True]) +def test_directory_backupname_force_test_mode_noclobber( + file, tmp_path, backupname_isfile +): + """ + Ensure that file.directory does not make changes when backupname is used + alongside force=True and test=True. + + See https://github.com/saltstack/salt/issues/66049 + """ + source_dir = tmp_path / "source_directory" + dest_dir = tmp_path / "dest_directory" + backupname = tmp_path / "backup_dir" + source_dir.mkdir() + dest_dir.symlink_to(source_dir.resolve()) + + if backupname_isfile: + backupname.touch() + assert backupname.is_file() + + ret = file.directory( + name=str(dest_dir), + allow_symlink=False, + force=True, + backupname=str(backupname), + test=True, + ) + + # Confirm None result + assert ret.result is None + try: + # Confirm dest_dir not modified + assert dest_dir.readlink() == source_dir + except OSError: + pytest.fail(f"{dest_dir} was modified") + + # Confirm that comment and changes match what we expect + assert ( + ret.comment + == f"{dest_dir} would be backed up and replaced with a new directory" + ) + assert ret.changes[str(dest_dir)] == {"directory": "new"} + assert ret.changes["backup"] == f"{dest_dir} would be renamed to {backupname}" + + if backupname_isfile: + assert ret.changes["forced"] == ( + f"Existing file at backup path {backupname} would be removed" + ) + else: + assert "forced" not in ret.changes From 7386c6ec87ccc0af76e751078a91acfd8b488948 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Wed, 21 Feb 2024 19:04:49 -0600 Subject: [PATCH 04/34] Add changelog entry --- changelog/66049.fixed.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog/66049.fixed.md diff --git a/changelog/66049.fixed.md b/changelog/66049.fixed.md new file mode 100644 index 00000000000..baff6e063d3 --- /dev/null +++ b/changelog/66049.fixed.md @@ -0,0 +1,2 @@ +Fixed an issue with file.directory state where paths would be modified in test +mode if backupname is used. From f3f54a6eb19921cc8eeb0aea3346b06304df57a6 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 21 Feb 2024 05:51:02 +0000 Subject: [PATCH 05/34] Switch to python-tools-scripts >= 0.20.0 --- .pre-commit-config.yaml | 4 ++-- requirements/static/ci/py3.10/tools.txt | 15 ++++++++++++--- requirements/static/ci/py3.11/tools.txt | 12 +++++++++++- requirements/static/ci/py3.12/tools.txt | 12 +++++++++++- requirements/static/ci/py3.9/tools.txt | 15 ++++++++++++--- requirements/static/ci/tools.in | 2 +- tools/__init__.py | 13 ++++++------- tools/changelog.py | 9 +++++---- tools/docs.py | 9 +++++---- tools/pkg/__init__.py | 23 ++++++++++++++--------- tools/precommit/changelog.py | 9 +++++---- 11 files changed, 84 insertions(+), 39 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 555b1cec34c..b402fd7e93c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: )$ - repo: https://github.com/saltstack/python-tools-scripts - rev: "0.18.6" + rev: "0.20.0" hooks: - id: tools alias: check-changelog-entries @@ -1762,7 +1762,7 @@ repos: - types-attrs - types-pyyaml - types-requests - - python-tools-scripts>=0.18.6 + - python-tools-scripts>=0.20.0 - repo: https://github.com/saltstack/mirrors-nox rev: v2021.6.12 diff --git a/requirements/static/ci/py3.10/tools.txt b/requirements/static/ci/py3.10/tools.txt index d3b6eb23735..dcda605b103 100644 --- a/requirements/static/ci/py3.10/tools.txt +++ b/requirements/static/ci/py3.10/tools.txt @@ -4,6 +4,8 @@ # # pip-compile --no-emit-index-url --output-file=requirements/static/ci/py3.10/tools.txt requirements/static/ci/tools.in # +annotated-types==0.6.0 + # via pydantic attrs==20.3.0 # via # -r requirements/static/ci/tools.in @@ -34,11 +36,15 @@ mdurl==0.1.2 # via markdown-it-py packaging==22.0 # via -r requirements/static/ci/tools.in +pydantic-core==2.16.2 + # via pydantic +pydantic==2.6.1 + # via python-tools-scripts pygments==2.13.0 # via rich python-dateutil==2.8.1 # via botocore -python-tools-scripts==0.18.6 +python-tools-scripts==0.20.0 # via -r requirements/static/ci/tools.in pyyaml==6.0.1 # via -r requirements/static/ci/tools.in @@ -50,8 +56,11 @@ s3transfer==0.6.1 # via boto3 six==1.16.0 # via python-dateutil -typing-extensions==4.2.0 - # via python-tools-scripts +typing-extensions==4.9.0 + # via + # pydantic + # pydantic-core + # python-tools-scripts urllib3==1.26.18 # via # botocore diff --git a/requirements/static/ci/py3.11/tools.txt b/requirements/static/ci/py3.11/tools.txt index adcf0b938b8..b980e3455dc 100644 --- a/requirements/static/ci/py3.11/tools.txt +++ b/requirements/static/ci/py3.11/tools.txt @@ -4,6 +4,8 @@ # # pip-compile --no-emit-index-url --output-file=requirements/static/ci/py3.11/tools.txt requirements/static/ci/tools.in # +annotated-types==0.6.0 + # via pydantic attrs==22.1.0 # via # -r requirements/static/ci/tools.in @@ -32,11 +34,15 @@ markupsafe==2.1.2 # via jinja2 packaging==22.0 # via -r requirements/static/ci/tools.in +pydantic-core==2.16.2 + # via pydantic +pydantic==2.6.1 + # via python-tools-scripts pygments==2.13.0 # via rich python-dateutil==2.8.1 # via botocore -python-tools-scripts==0.18.6 +python-tools-scripts==0.20.0 # via -r requirements/static/ci/tools.in pyyaml==6.0.1 # via -r requirements/static/ci/tools.in @@ -48,6 +54,10 @@ s3transfer==0.5.2 # via boto3 six==1.16.0 # via python-dateutil +typing-extensions==4.9.0 + # via + # pydantic + # pydantic-core urllib3==1.26.18 # via # botocore diff --git a/requirements/static/ci/py3.12/tools.txt b/requirements/static/ci/py3.12/tools.txt index f6e9cfcccb0..0617439a8e7 100644 --- a/requirements/static/ci/py3.12/tools.txt +++ b/requirements/static/ci/py3.12/tools.txt @@ -4,6 +4,8 @@ # # pip-compile --no-emit-index-url --output-file=requirements/static/ci/py3.12/tools.txt requirements/static/ci/tools.in # +annotated-types==0.6.0 + # via pydantic attrs==22.1.0 # via # -r requirements/static/ci/tools.in @@ -32,11 +34,15 @@ markupsafe==2.1.2 # via jinja2 packaging==22.0 # via -r requirements/static/ci/tools.in +pydantic-core==2.16.2 + # via pydantic +pydantic==2.6.1 + # via python-tools-scripts pygments==2.13.0 # via rich python-dateutil==2.8.1 # via botocore -python-tools-scripts==0.18.6 +python-tools-scripts==0.20.0 # via -r requirements/static/ci/tools.in pyyaml==6.0.1 # via -r requirements/static/ci/tools.in @@ -48,6 +54,10 @@ s3transfer==0.5.2 # via boto3 six==1.16.0 # via python-dateutil +typing-extensions==4.9.0 + # via + # pydantic + # pydantic-core urllib3==1.26.18 # via # botocore diff --git a/requirements/static/ci/py3.9/tools.txt b/requirements/static/ci/py3.9/tools.txt index 1f3d04a05e1..ca4ff2baff0 100644 --- a/requirements/static/ci/py3.9/tools.txt +++ b/requirements/static/ci/py3.9/tools.txt @@ -4,6 +4,8 @@ # # pip-compile --no-emit-index-url --output-file=requirements/static/ci/py3.9/tools.txt requirements/static/ci/tools.in # +annotated-types==0.6.0 + # via pydantic attrs==20.3.0 # via # -r requirements/static/ci/tools.in @@ -34,11 +36,15 @@ mdurl==0.1.2 # via markdown-it-py packaging==22.0 # via -r requirements/static/ci/tools.in +pydantic-core==2.16.2 + # via pydantic +pydantic==2.6.1 + # via python-tools-scripts pygments==2.13.0 # via rich python-dateutil==2.8.1 # via botocore -python-tools-scripts==0.18.6 +python-tools-scripts==0.20.0 # via -r requirements/static/ci/tools.in pyyaml==6.0.1 # via -r requirements/static/ci/tools.in @@ -50,8 +56,11 @@ s3transfer==0.6.1 # via boto3 six==1.16.0 # via python-dateutil -typing-extensions==4.2.0 - # via python-tools-scripts +typing-extensions==4.9.0 + # via + # pydantic + # pydantic-core + # python-tools-scripts urllib3==1.26.18 # via # botocore diff --git a/requirements/static/ci/tools.in b/requirements/static/ci/tools.in index 7bc0163df05..5d0da3fde92 100644 --- a/requirements/static/ci/tools.in +++ b/requirements/static/ci/tools.in @@ -1,5 +1,5 @@ attrs -python-tools-scripts >= 0.18.6 +python-tools-scripts >= 0.20.0 boto3 pyyaml jinja2 diff --git a/tools/__init__.py b/tools/__init__.py index 1d46e63b2d5..f5131d0e7f9 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -3,8 +3,7 @@ import pathlib import sys import ptscripts -from ptscripts.parser import DefaultRequirementsConfig -from ptscripts.virtualenv import VirtualEnvConfig +from ptscripts.models import DefaultPipConfig, VirtualEnvPipConfig REPO_ROOT = pathlib.Path(__file__).resolve().parent.parent REQUIREMENTS_FILES_PATH = REPO_ROOT / "requirements" @@ -12,16 +11,16 @@ STATIC_REQUIREMENTS_PATH = REQUIREMENTS_FILES_PATH / "static" CI_REQUIREMENTS_FILES_PATH = ( STATIC_REQUIREMENTS_PATH / "ci" / "py{}.{}".format(*sys.version_info) ) -DEFAULT_REQS_CONFIG = DefaultRequirementsConfig( - pip_args=[ +DEFAULT_REQS_CONFIG = DefaultPipConfig( + install_args=[ f"--constraint={REQUIREMENTS_FILES_PATH / 'constraints.txt'}", ], requirements_files=[ CI_REQUIREMENTS_FILES_PATH / "tools.txt", ], ) -RELEASE_VENV_CONFIG = VirtualEnvConfig( - pip_args=[ +RELEASE_VENV_CONFIG = VirtualEnvPipConfig( + install_args=[ f"--constraint={REQUIREMENTS_FILES_PATH / 'constraints.txt'}", ], requirements_files=[ @@ -29,7 +28,7 @@ RELEASE_VENV_CONFIG = VirtualEnvConfig( ], add_as_extra_site_packages=True, ) -ptscripts.set_default_requirements_config(DEFAULT_REQS_CONFIG) +ptscripts.set_default_config(DEFAULT_REQS_CONFIG) ptscripts.register_tools_module("tools.changelog") ptscripts.register_tools_module("tools.ci") ptscripts.register_tools_module("tools.docs") diff --git a/tools/changelog.py b/tools/changelog.py index 12bbba22d3c..8e9e3ff3e73 100644 --- a/tools/changelog.py +++ b/tools/changelog.py @@ -13,6 +13,7 @@ import textwrap from jinja2 import Environment, FileSystemLoader from ptscripts import Context, command_group +from ptscripts.models import VirtualEnvPipConfig from tools.utils import REPO_ROOT, Version @@ -23,16 +24,16 @@ changelog = command_group( name="changelog", help="Changelog tools", description=__doc__, - venv_config={ - "requirements_files": [ + venv_config=VirtualEnvPipConfig( + requirements_files=[ REPO_ROOT / "requirements" / "static" / "ci" / "py{}.{}".format(*sys.version_info) - / "changelog.txt" + / "changelog.txt", ], - }, + ), ) diff --git a/tools/docs.py b/tools/docs.py index 83868d1af7e..b36e676d974 100644 --- a/tools/docs.py +++ b/tools/docs.py @@ -11,6 +11,7 @@ import shutil import sys from ptscripts import Context, command_group +from ptscripts.models import VirtualEnvPipConfig import tools.utils @@ -21,16 +22,16 @@ docs = command_group( name="docs", help="Manpages tools", description=__doc__, - venv_config={ - "requirements_files": [ + venv_config=VirtualEnvPipConfig( + requirements_files=[ tools.utils.REPO_ROOT / "requirements" / "static" / "ci" / "py{}.{}".format(*sys.version_info) - / "docs.txt" + / "docs.txt", ], - }, + ), ) diff --git a/tools/pkg/__init__.py b/tools/pkg/__init__.py index 2d843893640..7eb7b0ba66c 100644 --- a/tools/pkg/__init__.py +++ b/tools/pkg/__init__.py @@ -18,6 +18,7 @@ import tempfile import yaml from ptscripts import Context, command_group +from ptscripts.models import VirtualEnvPipConfig import tools.utils @@ -137,7 +138,11 @@ def set_salt_version( ctx.info(f"Validating and normalizing the salt version {salt_version!r}...") with ctx.virtualenv( name="set-salt-version", - requirements_files=[tools.utils.REPO_ROOT / "requirements" / "base.txt"], + config=VirtualEnvPipConfig( + requirements_files=[ + tools.utils.REPO_ROOT / "requirements" / "base.txt", + ] + ), ) as venv: code = f""" import sys @@ -363,11 +368,11 @@ def generate_hashes(ctx: Context, files: list[pathlib.Path]): @pkg.command( name="source-tarball", - venv_config={ - "requirements_files": [ + venv_config=VirtualEnvPipConfig( + requirements_files=[ tools.utils.REPO_ROOT / "requirements" / "build.txt", - ] - }, + ], + ), ) def source_tarball(ctx: Context): shutil.rmtree("dist/", ignore_errors=True) @@ -411,11 +416,11 @@ def source_tarball(ctx: Context): @pkg.command( name="pypi-upload", - venv_config={ - "requirements_files": [ + venv_config=VirtualEnvPipConfig( + requirements_files=[ tools.utils.REPO_ROOT / "requirements" / "build.txt", - ] - }, + ], + ), arguments={ "files": { "help": "Files to upload to PyPi", diff --git a/tools/precommit/changelog.py b/tools/precommit/changelog.py index 5e108af5f11..99e3afbf116 100644 --- a/tools/precommit/changelog.py +++ b/tools/precommit/changelog.py @@ -10,6 +10,7 @@ import re import sys from ptscripts import Context, command_group +from ptscripts.models import VirtualEnvPipConfig import tools.utils @@ -33,16 +34,16 @@ changelog = command_group( name="changelog", help="Changelog tools", description=__doc__, - venv_config={ - "requirements_files": [ + venv_config=VirtualEnvPipConfig( + requirements_files=[ tools.utils.REPO_ROOT / "requirements" / "static" / "ci" / "py{}.{}".format(*sys.version_info) - / "changelog.txt" + / "changelog.txt", ], - }, + ), parent="pre-commit", ) From b9be2dec1b33a654da7cb73e39a5b35ff78fef57 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 25 Feb 2024 10:37:08 +0000 Subject: [PATCH 06/34] Update and remove obsolete pylint plugins --- .github/workflows/lint-action.yml | 2 +- .pre-commit-config.yaml | 21 +- .pylintrc | 1005 +++++++++-------- noxfile.py | 97 +- requirements/static/ci/lint.in | 4 +- requirements/static/ci/py3.10/lint.txt | 28 +- requirements/static/ci/py3.11/lint.txt | 20 +- requirements/static/ci/py3.12/lint.txt | 20 +- requirements/static/ci/py3.7/lint.txt | 796 ------------- requirements/static/ci/py3.8/lint.txt | 29 +- requirements/static/ci/py3.9/lint.txt | 29 +- salt/_logging/impl.py | 2 +- salt/auth/pki.py | 9 +- salt/channel/client.py | 2 +- salt/channel/server.py | 2 +- salt/cli/batch.py | 5 +- salt/cli/cp.py | 16 +- salt/client/__init__.py | 3 +- salt/client/ssh/__init__.py | 12 +- salt/client/ssh/ssh_py_shim.py | 11 +- salt/client/ssh/wrapper/grains.py | 25 +- salt/client/ssh/wrapper/pillar.py | 4 +- salt/cloud/cli.py | 22 +- salt/cloud/clouds/aliyun.py | 2 +- salt/cloud/clouds/clc.py | 2 +- salt/cloud/clouds/digitalocean.py | 12 +- salt/cloud/clouds/ec2.py | 8 +- salt/cloud/clouds/joyent.py | 4 +- salt/cloud/clouds/linode.py | 12 +- salt/cloud/clouds/proxmox.py | 13 +- salt/cloud/clouds/qingcloud.py | 4 +- salt/cloud/clouds/vmware.py | 2 +- salt/config/schemas/common.py | 2 +- salt/engines/slack.py | 2 - salt/engines/slack_bolt_engine.py | 2 - salt/ext/backports_abc.py | 2 +- salt/ext/ipaddress.py | 3 +- salt/ext/tornado/platform/auto.pyi | 2 +- salt/fileserver/s3fs.py | 8 +- salt/grains/core.py | 2 +- salt/loader/lazy.py | 2 +- salt/master.py | 4 +- salt/modules/aptpkg.py | 13 +- salt/modules/archive.py | 14 +- salt/modules/boto3_route53.py | 2 +- salt/modules/boto3_sns.py | 2 +- salt/modules/btrfs.py | 5 +- salt/modules/consul.py | 2 +- salt/modules/cp.py | 10 +- salt/modules/cryptdev.py | 5 +- salt/modules/csf.py | 2 +- salt/modules/datadog_api.py | 4 +- salt/modules/dig.py | 2 +- salt/modules/disk.py | 2 +- salt/modules/dockermod.py | 24 +- salt/modules/ebuildpkg.py | 10 +- salt/modules/file.py | 4 +- salt/modules/freebsdjail.py | 12 +- salt/modules/git.py | 8 +- salt/modules/glassfish.py | 3 + salt/modules/grains.py | 29 +- salt/modules/heat.py | 10 +- salt/modules/inspectlib/fsdb.py | 18 +- salt/modules/inspectlib/query.py | 16 +- salt/modules/iptables.py | 73 +- salt/modules/iwtools.py | 2 +- salt/modules/k8s.py | 2 +- salt/modules/kubernetesmod.py | 2 +- salt/modules/ldap3.py | 4 +- salt/modules/mac_softwareupdate.py | 2 +- salt/modules/mine.py | 15 +- salt/modules/mount.py | 15 +- salt/modules/mysql.py | 8 +- salt/modules/network.py | 2 +- salt/modules/openscap.py | 21 +- salt/modules/opkg.py | 5 +- salt/modules/opsgenie.py | 2 + salt/modules/oracle.py | 9 +- salt/modules/pagerduty_util.py | 2 + salt/modules/pkg_resource.py | 8 +- salt/modules/portage_config.py | 2 +- salt/modules/postgres.py | 7 +- salt/modules/quota.py | 2 +- salt/modules/rabbitmq.py | 14 +- salt/modules/rpm_lowpkg.py | 5 +- salt/modules/saltcheck.py | 2 +- salt/modules/selinux.py | 2 +- salt/modules/sensehat.py | 1 + salt/modules/serverdensity_device.py | 4 + salt/modules/smartos_imgadm.py | 17 +- salt/modules/smartos_vmadm.py | 10 +- salt/modules/solaris_shadow.py | 2 +- salt/modules/splunk_search.py | 2 +- salt/modules/status.py | 9 +- salt/modules/statuspage.py | 2 +- salt/modules/swarm.py | 2 +- salt/modules/sysrc.py | 4 +- salt/modules/systemd_service.py | 3 - salt/modules/telegram.py | 2 +- salt/modules/telemetry.py | 19 +- salt/modules/tomcat.py | 15 +- salt/modules/uptime.py | 12 +- salt/modules/vbox_guest.py | 20 +- salt/modules/virt.py | 149 ++- salt/modules/win_iis.py | 4 +- salt/modules/win_lgpo.py | 6 +- salt/modules/win_lgpo_reg.py | 26 +- salt/modules/win_pkg.py | 10 +- salt/modules/win_pki.py | 2 +- salt/modules/win_shortcut.py | 4 +- salt/modules/win_status.py | 7 +- salt/modules/win_task.py | 50 +- salt/modules/x509_v2.py | 2 +- salt/modules/xapi_virt.py | 30 +- salt/modules/xfs.py | 17 +- salt/modules/yumpkg.py | 6 +- salt/modules/zcbuildout.py | 12 +- salt/netapi/rest_cherrypy/__init__.py | 2 +- salt/netapi/rest_cherrypy/app.py | 8 +- salt/netapi/rest_tornado/saltnado.py | 8 +- salt/output/pony.py | 4 +- salt/pillar/__init__.py | 6 +- salt/pillar/foreman.py | 1 + salt/pillar/pepa.py | 12 +- salt/pillar/vault.py | 2 +- salt/pillar/vmware_pillar.py | 2 +- salt/platform/win.py | 5 +- salt/proxy/dummy.py | 18 +- salt/proxy/philips_hue.py | 10 +- salt/renderers/genshi.py | 4 +- salt/renderers/stateconf.py | 2 +- salt/returners/etcd_return.py | 6 +- salt/returners/influxdb_return.py | 2 +- salt/returners/local_cache.py | 4 +- salt/returners/mysql.py | 6 +- salt/returners/pgjsonb.py | 10 +- salt/returners/splunk.py | 1 + salt/roster/cache.py | 14 +- salt/runners/asam.py | 2 +- salt/runners/launchd.py | 10 +- salt/runners/pkg.py | 2 +- salt/runners/state.py | 4 +- salt/runners/vault.py | 8 +- salt/scripts.py | 6 +- salt/serializers/msgpack.py | 105 +- salt/serializers/yaml.py | 2 +- salt/state.py | 54 +- salt/states/archive.py | 12 +- salt/states/boto3_route53.py | 3 +- salt/states/docker_container.py | 12 +- salt/states/docker_image.py | 4 +- salt/states/docker_network.py | 31 +- salt/states/environ.py | 1 + salt/states/file.py | 10 +- salt/states/git.py | 183 ++- salt/states/gpg.py | 2 +- salt/states/grafana_dashboard.py | 1 + salt/states/grains.py | 4 +- salt/states/ldap.py | 1 + salt/states/netsnmp.py | 4 +- salt/states/pip_state.py | 22 +- salt/states/pkg.py | 2 +- salt/states/probes.py | 10 +- salt/states/saltmod.py | 4 +- salt/states/win_iis.py | 2 +- salt/utils/ansible.py | 8 +- salt/utils/args.py | 20 +- salt/utils/atomicfile.py | 8 +- salt/utils/aws.py | 14 +- salt/utils/cache.py | 4 +- salt/utils/cloud.py | 6 +- salt/utils/compat.py | 4 +- salt/utils/configparser.py | 12 +- salt/utils/data.py | 9 +- salt/utils/dns.py | 56 +- salt/utils/dockermod/__init__.py | 6 +- salt/utils/dockermod/translate/container.py | 20 +- salt/utils/dockermod/translate/helpers.py | 2 +- salt/utils/files.py | 11 +- salt/utils/fsutils.py | 10 +- salt/utils/functools.py | 4 +- salt/utils/gitfs.py | 117 +- salt/utils/iam.py | 1 + salt/utils/jinja.py | 4 - salt/utils/msazure.py | 12 +- salt/utils/nacl.py | 6 +- salt/utils/napalm.py | 9 +- salt/utils/nb_popen.py | 6 +- salt/utils/network.py | 35 +- salt/utils/odict.py | 303 +---- salt/utils/openstack/nova.py | 2 +- salt/utils/oset.py | 4 +- salt/utils/parsers.py | 2 +- salt/utils/path.py | 8 +- salt/utils/pkg/__init__.py | 4 +- salt/utils/pkg/win.py | 4 +- salt/utils/preseed.py | 2 +- salt/utils/process.py | 4 +- salt/utils/psutil_compat.py | 102 +- salt/utils/reactor.py | 2 + salt/utils/ssdp.py | 5 +- salt/utils/templates.py | 32 +- salt/utils/vault.py | 28 +- salt/utils/verify.py | 7 +- salt/utils/versions.py | 5 +- salt/utils/vt.py | 3 +- salt/utils/win_network.py | 1 + salt/utils/win_runas.py | 3 +- salt/version.py | 6 +- setup.py | 18 +- tests/buildpackage.py | 8 +- tests/committer_parser.py | 2 +- tests/conftest.py | 4 +- tests/eventlisten.py | 4 +- .../cloud/clouds/test_oneandone.py | 12 +- tests/integration/cloud/clouds/test_vmware.py | 2 +- tests/integration/modules/test_cp.py | 4 +- tests/integration/modules/test_ssh.py | 2 +- .../netapi/rest_tornado/test_app.py | 2 +- tests/minionswarm.py | 2 +- tests/modparser.py | 15 +- tests/pytests/functional/cache/test_etcd.py | 4 +- tests/pytests/functional/modules/test_data.py | 4 +- .../pytests/functional/modules/test_system.py | 2 +- .../functional/states/file/test_append.py | 14 +- .../functional/states/file/test_replace.py | 20 +- .../functional/states/pkgrepo/test_debian.py | 4 +- .../states/test_docker_container.py | 16 +- .../functional/states/test_docker_network.py | 17 +- tests/pytests/functional/states/test_pkg.py | 2 +- .../functional/states/test_ssh_auth.py | 2 +- tests/pytests/functional/test_crypt.py | 7 +- .../integration/_logging/test_jid_logging.py | 2 +- tests/pytests/integration/cli/test_batch.py | 4 +- tests/pytests/integration/cli/test_salt.py | 2 +- .../integration/cli/test_syndic_eauth.py | 2 +- .../modules/state/test_state_test.py | 2 +- tests/pytests/integration/sdb/test_etcd_db.py | 4 +- .../integration/ssh/test_pre_flight.py | 7 +- .../pytests/pkg/download/test_pkg_download.py | 8 +- .../pkg/integration/test_pip_upgrade.py | 4 +- .../pytests/pkg/integration/test_salt_user.py | 2 +- tests/pytests/scenarios/blackout/conftest.py | 2 +- .../pytests/unit/beacons/test_salt_monitor.py | 2 - tests/pytests/unit/cli/test_daemons.py | 4 +- tests/pytests/unit/client/ssh/test_ssh.py | 8 +- .../pytests/unit/cloud/clouds/test_proxmox.py | 1 + .../daemons/masterapi/test_remote_funcs.py | 6 +- tests/pytests/unit/fileserver/test_roots.py | 4 +- .../unit/modules/dockermod/test_module.py | 68 +- .../unit/modules/file/test_file_line.py | 2 +- .../unit/modules/file/test_file_lsattr.py | 12 +- .../unit/modules/file/test_file_module.py | 14 +- .../pytests/unit/modules/state/test_state.py | 12 +- tests/pytests/unit/modules/test_cp.py | 13 +- tests/pytests/unit/modules/test_devinfo.py | 10 +- tests/pytests/unit/modules/test_glassfish.py | 3 + tests/pytests/unit/modules/test_gpg.py | 8 +- tests/pytests/unit/modules/test_hg.py | 17 +- tests/pytests/unit/modules/test_mount.py | 2 - .../pytests/unit/modules/test_salt_version.py | 3 +- .../unit/modules/test_solaris_shadow.py | 2 +- .../pytests/unit/modules/test_win_powercfg.py | 2 +- tests/pytests/unit/modules/test_zabbix.py | 5 - tests/pytests/unit/modules/virt/conftest.py | 2 +- .../modules/win_lgpo/test_admx_policies.py | 2 +- .../pytests/unit/pillar/test_consul_pillar.py | 24 +- tests/pytests/unit/proxy/test_napalm.py | 2 +- tests/pytests/unit/runners/test_asam.py | 4 + .../unit/runners/vault/test_app_role_auth.py | 9 +- .../unit/runners/vault/test_token_auth.py | 13 +- .../unit/serializers/test_serializers.py | 8 +- .../pytests/unit/state/test_state_compiler.py | 54 +- tests/pytests/unit/states/test_host.py | 6 +- tests/pytests/unit/transport/test_zeromq.py | 6 +- tests/pytests/unit/utils/test_cloud.py | 9 +- tests/pytests/unit/utils/test_data.py | 13 +- tests/pytests/unit/utils/test_vault.py | 6 + tests/pytests/unit/utils/test_vt.py | 2 +- tests/pytests/unit/wheel/test_file_roots.py | 2 +- tests/salt-tcpdump.py | 6 +- tests/saltsh.py | 10 +- tests/support/copyartifacts.py | 13 +- ...ate-names-file-from-failed-test-reports.py | 4 +- tests/support/pkg.py | 7 +- tests/support/pytest/etcd.py | 4 +- tests/support/pytest/helpers.py | 16 +- tests/support/unit.py | 4 +- tests/support/win_installer.py | 9 +- tests/unit/ext/test_ipaddress.py | 8 +- tests/unit/modules/test_elasticsearch.py | 16 +- tests/unit/modules/test_sysmod.py | 8 +- tests/unit/modules/test_zcbuildout.py | 20 +- tests/unit/states/test_loop.py | 16 +- tests/unit/test_pillar.py | 6 +- tests/unit/test_zypp_plugins.py | 2 +- tests/unit/utils/test_configparser.py | 4 +- tests/unit/utils/test_context.py | 2 +- tests/unit/utils/test_dns.py | 4 +- tests/unit/utils/test_systemd.py | 2 - tests/unit/utils/test_thin.py | 13 +- tests/wheeltest.py | 4 +- tools/changelog.py | 16 +- tools/ci.py | 14 +- tools/pkg/__init__.py | 11 +- tools/pkg/build.py | 4 +- tools/pkg/repo/__init__.py | 8 +- tools/pkg/repo/create.py | 12 +- tools/pkg/repo/publish.py | 18 +- tools/precommit/workflows.py | 4 +- tools/release.py | 14 +- tools/testsuite/__init__.py | 8 +- tools/testsuite/download.py | 4 +- tools/vm.py | 51 +- 314 files changed, 2209 insertions(+), 3342 deletions(-) delete mode 100644 requirements/static/ci/py3.7/lint.txt diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index 6f177667129..9dc4be360e3 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -23,7 +23,7 @@ jobs: if: ${{ contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) || fromJSON(inputs.changed-files)['salt'] || fromJSON(inputs.changed-files)['lint'] }} container: - image: ghcr.io/saltstack/salt-ci-containers/python:3.8 + image: ghcr.io/saltstack/salt-ci-containers/python:3.9 steps: - name: Install System Deps diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b402fd7e93c..2b170f88ef3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1370,23 +1370,6 @@ repos: # <---- Doc CI Requirements ---------------------------------------------------------------------------------------- # ----- Lint CI Requirements --------------------------------------------------------------------------------------> - - id: pip-tools-compile - alias: compile-ci-lint-3.7-requirements - name: Lint CI Py3.7 Requirements - files: ^requirements/((base|zeromq)\.txt|static/(pkg/linux\.in|ci/(linux\.in|common\.in|lint\.in|py3\.7/linux\.txt)))$ - pass_filenames: false - args: - - -v - - --build-isolation - - --py-version=3.7 - - --platform=linux - - --include=requirements/base.txt - - --include=requirements/zeromq.txt - - --include=requirements/static/pkg/linux.in - - --include=requirements/static/ci/linux.in - - --include=requirements/static/ci/common.in - - --no-emit-index-url - - requirements/static/ci/lint.in - id: pip-tools-compile alias: compile-ci-lint-3.8-requirements @@ -1762,7 +1745,7 @@ repos: - types-attrs - types-pyyaml - types-requests - - python-tools-scripts>=0.20.0 + - python-tools-scripts==0.20.0 - repo: https://github.com/saltstack/mirrors-nox rev: v2021.6.12 @@ -1770,7 +1753,7 @@ repos: - id: nox alias: lint-salt name: Lint Salt - files: ^((setup|noxfile)|(salt|tasks|tools)/.*)\.py$ + files: ^((setup|noxfile)|(salt|tools)/.*)\.py$ exclude: > (?x)^( templates/.*| diff --git a/.pylintrc b/.pylintrc index 04fa981c375..d9e7af58eae 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,25 +1,77 @@ -[MASTER] +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) extension-pkg-whitelist= -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS, - ext, +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns=salt.ext.* +# Specify a score threshold under which the program will exit with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. +ignore-paths= + +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# Emacs file locks +ignore-patterns=^\.# + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). #init-hook= # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the -# number of processors available to use. +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. jobs=1 # Control the amount of potential inferred values when inferring a single @@ -29,12 +81,8 @@ limit-inference-results=100 # List of plugins (as comma separated values of python module names) to load, # usually to register additional checkers. -load-plugins=saltpylint.pep8, - saltpylint.strings, - saltpylint.fileperms, - saltpylint.py3modernize, +load-plugins=saltpylint.fileperms, saltpylint.smartup, - saltpylint.minpyver, saltpylint.blacklist, saltpylint.thirdparty, saltpylint.dunder_del @@ -42,8 +90,18 @@ load-plugins=saltpylint.pep8, # Pickle collected data for later comparisons. persistent=no -# Specify a configuration file. -#rcfile= +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.9 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots= # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. @@ -53,125 +111,215 @@ suggestion-mode=yes # active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -disable=R, - locally-disabled, - file-ignored, - unexpected-special-method-signature, - import-error, - no-member, - unsubscriptable-object, - un-indexed-curly-braces-error, - whitespace-before-colon, - indentation-is-not-a-multiple-of-four-comment, - blacklisted-name, - invalid-name, - missing-docstring, - empty-docstring, - misplaced-comparison-constant, - unidiomatic-typecheck, - wrong-import-order, - ungrouped-imports, - wrong-import-position, - bad-mcs-method-argument, - bad-mcs-classmethod-argument, - line-too-long, - too-many-lines, - bad-continuation, - exec-used, - attribute-defined-outside-init, - protected-access, - reimported, - fixme, - global-statement, - unused-variable, - unused-argument, - redefined-outer-name, - redefined-builtin, - undefined-loop-variable, - logging-format-interpolation, - invalid-format-index, - line-too-long, - unexpected-indentation-comment, - continuation-line-indentation-is-not-a-multiple-of-four, - continuation-line-missing-indentation-or-outdented, - closing-bracket-does-not-match-indentation-of-opening-brackets-line, - closing-bracket-does-not-match-visual-indentation, - continuation-line-does-not-distinguish-itself-from-next-logical-line, - continuation-line-over-indented-for-hanging-indent, - continuation-line-over-indented-for-visual-indent, - continuation-line-under-indented-for-visual-indent, - visually-indented-line-with-same-indent-as-next-logical-line, - unaligned-for-hanging-indent, - block-comment-should-start-with-cardinal-space, - too-many-leading-hastag-for-block-comment, - module-level-import-not-at-top-of-file, - do-not-assign-a-lambda-expression-use-a-def, - 3rd-party-local-module-not-gated, - pep8-reserved-keywords, - import-outside-toplevel, - deprecated-method, - repr-flag-used-in-string, - keyword-arg-before-vararg, - incompatible-py3-code - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member, - literal-comparison +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= -[REPORTS] +[BASIC] -# Python expression which should return a score less than or equal to 10. You -# have access to the variables 'error', 'warning', 'refactor', and 'convention' -# which contain the number of messages in each category, as well as 'statement' -# which is the total number of statements analyzed. This score is used by the -# global evaluation report (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +# Naming style matching correct argument names. +argument-naming-style=snake_case -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details. -msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. -# mypackage.mymodule.MyReporterClass. -output-format=parseable +# Naming style matching correct attribute names. +attr-naming-style=snake_case -# Tells whether to display a full report or only the messages. -reports=no +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +#attr-rgx= -# Activate the evaluation score. -score=yes +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=exc, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +#typealias-rgx= + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= -[REFACTORING] +[CLASSES] -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=sys.exit +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + asyncSetUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=35 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=48 + +# Maximum number of locals for function / method body. +max-locals=40 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=100 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception [FORMAT] @@ -195,13 +343,6 @@ max-line-length=120 # Maximum number of lines in a module. max-module-lines=3000 -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma, - dict-separator - # Allow the body of a class to be on the same line as the declaration if body # contains single statement. single-line-class-stmt=no @@ -211,141 +352,296 @@ single-line-class-stmt=no single-line-if-stmt=no +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=R, + deprecated-pragma, + file-ignored, + locally-disabled, + suppressed-message, + use-implicit-booleaness-not-comparison-to-string, + use-implicit-booleaness-not-comparison-to-zero, + use-implicit-booleaness-not-comparison, + use-symbolic-message-instead, + useless-suppression, + 3rd-party-local-module-not-gated, + attribute-defined-outside-init, + bad-continuation, + bad-mcs-classmethod-argument, + bad-mcs-method-argument, + blacklisted-name, + deprecated-method, + empty-docstring, + exec-used, + file-ignored, + fixme, + global-statement, + import-error, + import-outside-toplevel, + invalid-format-index, + invalid-name, + keyword-arg-before-vararg, + line-too-long, + locally-disabled, + logging-format-interpolation, + missing-docstring, + no-member, + protected-access, + raw-checker-failed, + redefined-builtin, + redefined-outer-name, + reimported, + too-many-lines, + undefined-loop-variable, + unexpected-special-method-signature, + ungrouped-imports, + unidiomatic-typecheck, + unsubscriptable-object, + unused-argument, + unused-variable, + wrong-import-order, + wrong-import-position, + consider-using-f-string, + raise-missing-from, + broad-exception-raised, + consider-using-dict-items + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + [MISCELLANEOUS] # List of note tags to take in consideration, separated by a comma. notes=FIXME, - FIX, XXX, TODO +# Regular expression of note tags to take in consideration. +notes-rgx= -[BASIC] -# Naming style matching correct argument names. -argument-naming-style=snake_case +[REFACTORING] -# Regular expression matching correct argument names. Overrides argument- -# naming-style. -argument-rgx=[a-z_][a-z0-9_]{2,30}$ +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 -# Naming style matching correct attribute names. -attr-naming-style=snake_case +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error -# Regular expression matching correct attribute names. Overrides attr-naming- -# style. -attr-rgx=[a-z_][a-z0-9_]{2,30}$ -# Bad variable names which should always be refused, separated by a comma. -bad-names=foo, - bar, - baz, - toto, - tutu, - tata +[REPORTS] -# Naming style matching correct class attribute names. -class-attribute-naming-style=any +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style. -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +msg-template= -# Naming style matching correct class names. -class-naming-style=PascalCase +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +output-format=parseable -# Regular expression matching correct class names. Overrides class-naming- -# style. -class-rgx=[A-Z_][a-zA-Z0-9]+$ +# Tells whether to display a full report or only the messages. +reports=no -# Naming style matching correct constant names. -const-naming-style=UPPER_CASE +# Activate the evaluation score. +score=yes -# Regular expression matching correct constant names. Overrides const-naming- -# style. -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 +[SIMILARITIES] -# Naming style matching correct function names. -function-naming-style=snake_case +# Comments are removed from the similarity computation +ignore-comments=yes -# Regular expression matching correct function names. Overrides function- -# naming-style. -function-rgx=[a-z_][a-z0-9_]{2,30}$ +# Docstrings are removed from the similarity computation +ignore-docstrings=yes -# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k, - ex, - Run, - _, - log +# Imports are removed from the similarity computation +ignore-imports=yes -# Include a hint for the correct naming format with invalid-name. -include-naming-hint=yes +# Signatures are removed from the similarity computation +ignore-signatures=yes -# Naming style matching correct inline iteration names. -inlinevar-naming-style=any +# Minimum lines number of a similarity. +min-similarity-lines=4 -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style. -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ -# Naming style matching correct method names. -method-naming-style=snake_case +[SPELLING] -# Regular expression matching correct method names. Overrides method-naming- -# style. -method-rgx=[a-z_][a-z0-9_]{2,30}$ +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 -# Naming style matching correct module names. -module-naming-style=snake_case +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. +spelling-dict= -# Regular expression matching correct module names. Overrides module-naming- -# style. -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= +# List of comma separated words that should not be checked. +spelling-ignore-words= -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=__.*__ +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -# These decorators are taken in consideration only for invalid-name. -property-classes=abc.abstractproperty - -# Naming style matching correct variable names. -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style. -variable-rgx=[a-z_][a-z0-9_]{2,30}$ +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no [STRING] -# This flag controls whether the implicit-str-concat-in-sequence should -# generate a warning on implicit string concatenation in sequences defined over -# several lines. +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. check-str-concat-over-line-jumps=no -# Enforce string formatting over string substitution -enforce-string-formatting-over-substitution=yes -# Force string substitution usage on strings to always be an error. -string-substitutions-usage-is-an-error=yes +[TYPECHECK] -# Force un-indexed curly braces on a 'string.format()' call to always be an -# error. -un-indexed-curly-braces-always-error=no +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= [VARIABLES] @@ -379,6 +675,9 @@ additional-builtins=__opts__, # Tells whether unused global variables should be treated as a violation. allow-global-unused-variables=yes +# List of names allowed to shadow builtins +allowed-redefined-builtins= + # List of strings which can identify a callback function by name. A callback # name must start or end with one of those strings. callbacks=cb_, @@ -386,128 +685,17 @@ callbacks=cb_, # A regular expression matching the name of dummy variables (i.e. expected to # not be used). -dummy-variables-rgx=_|dummy +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ -# Argument names that match this expression will be ignored. Default to name -# with leading underscore. -ignored-argument-names=_.* +# Argument names that match this expression will be ignored. +ignored-argument-names=_.*|^ignored_|^unused_ # Tells whether we should check for unused import in __init__ files. init-import=no # List of qualified module names which can have objects that can redefine # builtins. -redefining-builtins-modules=six.moves, - salt.ext.six.moves, - past.builtins, - future.builtins, - builtins, - io - - -[LOGGING] - -# Format style used to check logging format string. `old` means using % -# formatting, `new` is for `{}` formatting,and `fstr` is for f-strings. -logging-format-style=old - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules= - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes. -max-spelling-suggestions=4 - -# Spelling dictionary name. Available dictionaries: none. To make it work, -# install the python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains the private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to the private dictionary (see the -# --spelling-private-dict-file option) instead of raising a message. -spelling-store-unknown-words=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members=REQUEST, - acl_users, - aq_parent - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# Tells whether to warn about missing members when the owner of the attribute -# is inferred to be None. -ignore-none=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=SQLObject - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules=salt.ext.six.moves, - six.moves, - _MovedItems, - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - -# List of decorators that change the signature of a decorated function. -signature-mutators= - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=no - -# Minimum lines number of a similarity. -min-similarity-lines=4 +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io [FILEPERMS] @@ -518,135 +706,6 @@ fileperms-default=0644 # File paths to ignore file permission. Glob patterns allowed. fileperms-ignore-paths=setup.py,noxfile.py,tests/runtests.py,tests/jenkins*.py,tests/saltsh.py,tests/buildpackage.py,tests/unit/files/rosters/ansible/roster.py - -[MODERNIZE] - -# Fix up doctests only -modernize-doctests-only=no - -# Each FIX specifies a transformation; "default" includes default fixes. -modernize-fix= - -# Use 'from __future__ import unicode_literals' (only useful for Python 2.6+). -modernize-future-unicode=no - -# Exclude fixes that depend on the six package. -modernize-no-six=no - -# Comma separated list of fixer names not to fix. -modernize-nofix= - -# Modify the grammar so that print() is a function. -modernize-print-function=yes - -# Wrap unicode literals in six.u(). -modernize-six-unicode=no - - -[MININUM-PYTHON-VERSION] - -# The desired minimum python version to enforce. Default: 2.6 -minimum-python-version=2.7 - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# Maximum number of arguments for function / method. -max-args=35 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in an if statement (see R0916). -max-bool-expr=5 - -# Maximum number of branch for function / method body. -max-branches=48 - -# Maximum number of locals for function / method body. -max-locals=40 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body. -max-returns=6 - -# Maximum number of statements in function / method body. -max-statements=100 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[IMPORTS] - -# List of modules that can be imported at any level, not just the top level -# one. -allow-any-import-level= - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=yes - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=yes - -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules=regsub, - TERMIOS, - Bastion, - rexec - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled). -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled). -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled). -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - -# Couples of modules and preferred modules, separated by a comma. -preferred-modules= - - [BLACKLISTED-FUNCTIONS] # List of blacklisted functions and suggested replacements @@ -700,11 +759,5 @@ allowed-3rd-party-modules=msgpack, looseversion, pytestskipmarkers, cryptography, + aiohttp, pytest_timeout - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception diff --git a/noxfile.py b/noxfile.py index 2ed8e4d0a00..1a78e4628ae 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1300,7 +1300,7 @@ def decompress_dependencies(session): # Let's try to fix shebang's try: fpath = pathlib.Path(path) - contents = fpath.read_text().splitlines() + contents = fpath.read_text(encoding="utf-8").splitlines() if ( contents[0].startswith("#!") and contents[0].endswith("python") @@ -1310,7 +1310,9 @@ def decompress_dependencies(session): "Fixing broken shebang in %r", str(fpath.relative_to(REPO_ROOT)), ) - fpath.write_text("\n".join([fixed_shebang] + contents[1:])) + fpath.write_text( + "\n".join([fixed_shebang] + contents[1:]), encoding="utf-8" + ) except UnicodeDecodeError: pass @@ -1467,48 +1469,26 @@ class Tee: return self._first.fileno() -def _lint( - session, rcfile, flags, paths, tee_output=True, upgrade_setuptools_and_pip=True -): +def _lint(session, rcfile, flags, paths, upgrade_setuptools_and_pip=True): if _upgrade_pip_setuptools_and_wheel(session, upgrade=upgrade_setuptools_and_pip): - requirements_file = os.path.join( + base_requirements_file = os.path.join( + "requirements", "static", "ci", _get_pydir(session), "linux.txt" + ) + lint_requirements_file = os.path.join( "requirements", "static", "ci", _get_pydir(session), "lint.txt" ) - install_command = ["--progress-bar=off", "-r", requirements_file] + install_command = [ + "--progress-bar=off", + "-r", + base_requirements_file, + "-r", + lint_requirements_file, + ] session.install(*install_command, silent=PIP_INSTALL_SILENT) - if tee_output: - session.run("pylint", "--version") - pylint_report_path = os.environ.get("PYLINT_REPORT") - cmd_args = ["pylint", "--rcfile={}".format(rcfile)] + list(flags) + list(paths) - cmd_kwargs = {"env": {"PYTHONUNBUFFERED": "1"}} - - if tee_output: - stdout = tempfile.TemporaryFile(mode="w+b") - cmd_kwargs["stdout"] = Tee(stdout, sys.__stdout__) - - lint_failed = False - try: - session.run(*cmd_args, **cmd_kwargs) - except CommandFailed: - lint_failed = True - raise - finally: - if tee_output: - stdout.seek(0) - contents = stdout.read() - if contents: - contents = contents.decode("utf-8") - sys.stdout.write(contents) - sys.stdout.flush() - if pylint_report_path: - # Write report - with open(pylint_report_path, "w") as wfh: - wfh.write(contents) - session.log("Report file written to %r", pylint_report_path) - stdout.close() + session.run(*cmd_args, **cmd_kwargs) def _lint_pre_commit(session, rcfile, flags, paths): @@ -1527,26 +1507,17 @@ def _lint_pre_commit(session, rcfile, flags, paths): from nox.virtualenv import VirtualEnv # Let's patch nox to make it run inside the pre-commit virtualenv - try: - session._runner.venv = VirtualEnv( # pylint: disable=unexpected-keyword-arg - os.environ["VIRTUAL_ENV"], - interpreter=session._runner.func.python, - reuse_existing=True, - venv=True, - ) - except TypeError: - # This is still nox-py2 - session._runner.venv = VirtualEnv( - os.environ["VIRTUAL_ENV"], - interpreter=session._runner.func.python, - reuse_existing=True, - ) + session._runner.venv = VirtualEnv( + os.environ["VIRTUAL_ENV"], + interpreter=session._runner.func.python, + reuse_existing=True, + venv=True, + ) _lint( session, rcfile, flags, paths, - tee_output=False, upgrade_setuptools_and_pip=False, ) @@ -1554,7 +1525,7 @@ def _lint_pre_commit(session, rcfile, flags, paths): @nox.session(python="3") def lint(session): """ - Run PyLint against Salt and it's test suite. Set PYLINT_REPORT to a path to capture output. + Run PyLint against Salt and it's test suite. """ session.notify("lint-salt-{}".format(session.python)) session.notify("lint-tests-{}".format(session.python)) @@ -1563,21 +1534,21 @@ def lint(session): @nox.session(python="3", name="lint-salt") def lint_salt(session): """ - Run PyLint against Salt. Set PYLINT_REPORT to a path to capture output. + Run PyLint against Salt. """ flags = ["--disable=I"] if session.posargs: paths = session.posargs else: # TBD replace paths entries when implement pyproject.toml - paths = ["setup.py", "noxfile.py", "salt/"] + paths = ["setup.py", "noxfile.py", "salt/", "tools/"] _lint(session, ".pylintrc", flags, paths) @nox.session(python="3", name="lint-tests") def lint_tests(session): """ - Run PyLint against Salt and it's test suite. Set PYLINT_REPORT to a path to capture output. + Run PyLint against Salt and it's test suite. """ flags = ["--disable=I"] if session.posargs: @@ -1590,20 +1561,20 @@ def lint_tests(session): @nox.session(python=False, name="lint-salt-pre-commit") def lint_salt_pre_commit(session): """ - Run PyLint against Salt. Set PYLINT_REPORT to a path to capture output. + Run PyLint against Salt. """ flags = ["--disable=I"] if session.posargs: paths = session.posargs else: - paths = ["setup.py", "noxfile.py", "salt/"] + paths = ["setup.py", "noxfile.py", "salt/", "tools/"] _lint_pre_commit(session, ".pylintrc", flags, paths) @nox.session(python=False, name="lint-tests-pre-commit") def lint_tests_pre_commit(session): """ - Run PyLint against Salt and it's test suite. Set PYLINT_REPORT to a path to capture output. + Run PyLint against Salt and it's test suite. """ flags = ["--disable=I"] if session.posargs: @@ -1960,8 +1931,8 @@ def ci_test_onedir_pkgs(session): + cmd_args[:] + [ "--no-install", - f"--junitxml=artifacts/xml-unittests-output/test-results-install.xml", - f"--log-file=artifacts/logs/runtests-install.log", + "--junitxml=artifacts/xml-unittests-output/test-results-install.xml", + "--log-file=artifacts/logs/runtests-install.log", ] + session.posargs ) @@ -1978,8 +1949,8 @@ def ci_test_onedir_pkgs(session): + cmd_args[:] + [ "--no-install", - f"--junitxml=artifacts/xml-unittests-output/test-results-install-rerun.xml", - f"--log-file=artifacts/logs/runtests-install-rerun.log", + "--junitxml=artifacts/xml-unittests-output/test-results-install-rerun.xml", + "--log-file=artifacts/logs/runtests-install-rerun.log", "--lf", ] + session.posargs diff --git a/requirements/static/ci/lint.in b/requirements/static/ci/lint.in index 86ed3a61c28..977c91fcd47 100644 --- a/requirements/static/ci/lint.in +++ b/requirements/static/ci/lint.in @@ -2,6 +2,6 @@ --constraint=./py{py_version}/{platform}.txt docker -pylint==2.4.4 -SaltPyLint>=2023.3.8 +pylint~=3.1.0 +SaltPyLint>=2024.2.2 toml diff --git a/requirements/static/ci/py3.10/lint.txt b/requirements/static/ci/py3.10/lint.txt index fbcaa9b1269..3841c2aad37 100644 --- a/requirements/static/ci/py3.10/lint.txt +++ b/requirements/static/ci/py3.10/lint.txt @@ -33,7 +33,7 @@ asn1crypto==1.3.0 # -c requirements/static/ci/py3.10/linux.txt # certvalidator # oscrypto -astroid==2.3.3 +astroid==3.1.0 # via pylint async-timeout==4.0.2 # via @@ -145,6 +145,8 @@ cryptography==42.0.3 # paramiko # pyopenssl # vcert +dill==0.3.8 + # via pylint distlib==0.3.2 # via # -c requirements/static/ci/py3.10/linux.txt @@ -285,8 +287,6 @@ kubernetes==3.0.0 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in -lazy-object-proxy==1.4.3 - # via astroid libnacl==1.7.1 ; sys_platform != "win32" and sys_platform != "darwin" # via # -c requirements/static/ci/py3.10/linux.txt @@ -320,8 +320,6 @@ mercurial==6.0.1 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/linux.in -modernize==0.5 - # via saltpylint more-itertools==5.0.0 # via # -c requirements/static/ci/../pkg/py3.10/linux.txt @@ -385,6 +383,7 @@ pathtools==0.1.2 platformdirs==2.2.0 # via # -c requirements/static/ci/py3.10/linux.txt + # pylint # virtualenv portend==2.4 # via @@ -405,8 +404,6 @@ pyasn1==0.4.8 # -c requirements/static/ci/py3.10/linux.txt # pyasn1-modules # rsa -pycodestyle==2.5.0 - # via saltpylint pycparser==2.21 ; python_version >= "3.9" # via # -c requirements/static/ci/../pkg/py3.10/linux.txt @@ -435,7 +432,7 @@ pyjwt==2.4.0 # via # -c requirements/static/ci/py3.10/linux.txt # twilio -pylint==2.4.4 +pylint==3.1.0 # via # -r requirements/static/ci/lint.in # saltpylint @@ -571,7 +568,7 @@ s3transfer==0.5.2 # via # -c requirements/static/ci/py3.10/linux.txt # boto3 -saltpylint==2023.8.3 +saltpylint==2024.2.5 # via -r requirements/static/ci/lint.in scp==0.13.2 # via @@ -591,7 +588,6 @@ six==1.16.0 # -c requirements/static/ci/../pkg/py3.10/linux.txt # -c requirements/static/ci/py3.10/linux.txt # apscheduler - # astroid # cassandra-driver # cheroot # etcd3-py @@ -646,6 +642,12 @@ toml==0.10.2 # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via + # -c requirements/static/ci/py3.10/linux.txt + # pylint +tomlkit==0.12.3 + # via pylint tornado==6.1 # via # -c requirements/static/ci/py3.10/linux.txt @@ -658,6 +660,10 @@ twilio==7.9.2 # via # -c requirements/static/ci/py3.10/linux.txt # -r requirements/static/ci/linux.in +typing-extensions==4.8.0 + # via + # -c requirements/static/ci/py3.10/linux.txt + # astroid tzlocal==3.0 # via # -c requirements/static/ci/py3.10/linux.txt @@ -696,8 +702,6 @@ werkzeug==3.0.1 # via # -c requirements/static/ci/py3.10/linux.txt # moto -wrapt==1.11.1 - # via astroid xmltodict==0.12.0 # via # -c requirements/static/ci/py3.10/linux.txt diff --git a/requirements/static/ci/py3.11/lint.txt b/requirements/static/ci/py3.11/lint.txt index e1b74f92032..19dbac9d26f 100644 --- a/requirements/static/ci/py3.11/lint.txt +++ b/requirements/static/ci/py3.11/lint.txt @@ -33,7 +33,7 @@ asn1crypto==1.3.0 # -c requirements/static/ci/py3.11/linux.txt # certvalidator # oscrypto -astroid==2.3.3 +astroid==3.1.0 # via pylint attrs==23.1.0 # via @@ -141,6 +141,8 @@ cryptography==42.0.3 # paramiko # pyopenssl # vcert +dill==0.3.8 + # via pylint distlib==0.3.2 # via # -c requirements/static/ci/py3.11/linux.txt @@ -276,8 +278,6 @@ kubernetes==3.0.0 # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in -lazy-object-proxy==1.4.3 - # via astroid libnacl==1.7.1 ; sys_platform != "win32" and sys_platform != "darwin" # via # -c requirements/static/ci/py3.11/linux.txt @@ -306,8 +306,6 @@ mercurial==6.0.1 # via # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/linux.in -modernize==0.5 - # via saltpylint more-itertools==5.0.0 # via # -c requirements/static/ci/../pkg/py3.11/linux.txt @@ -360,6 +358,7 @@ pathtools==0.1.2 platformdirs==2.2.0 # via # -c requirements/static/ci/py3.11/linux.txt + # pylint # virtualenv portend==2.4 # via @@ -380,8 +379,6 @@ pyasn1==0.4.8 # -c requirements/static/ci/py3.11/linux.txt # pyasn1-modules # rsa -pycodestyle==2.5.0 - # via saltpylint pycparser==2.21 ; python_version >= "3.9" # via # -c requirements/static/ci/../pkg/py3.11/linux.txt @@ -410,7 +407,7 @@ pyjwt==2.4.0 # via # -c requirements/static/ci/py3.11/linux.txt # twilio -pylint==2.4.4 +pylint==3.1.0 # via # -r requirements/static/ci/lint.in # saltpylint @@ -536,7 +533,7 @@ s3transfer==0.5.2 # via # -c requirements/static/ci/py3.11/linux.txt # boto3 -saltpylint==2023.8.3 +saltpylint==2024.2.5 # via -r requirements/static/ci/lint.in semantic-version==2.9.0 # via @@ -552,7 +549,6 @@ six==1.16.0 # -c requirements/static/ci/../pkg/py3.11/linux.txt # -c requirements/static/ci/py3.11/linux.txt # apscheduler - # astroid # cassandra-driver # cheroot # etcd3-py @@ -604,6 +600,8 @@ toml==0.10.2 # -c requirements/static/ci/py3.11/linux.txt # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomlkit==0.12.3 + # via pylint tornado==6.1 # via # -c requirements/static/ci/py3.11/linux.txt @@ -650,8 +648,6 @@ werkzeug==3.0.1 # via # -c requirements/static/ci/py3.11/linux.txt # moto -wrapt==1.11.1 - # via astroid xmltodict==0.12.0 # via # -c requirements/static/ci/py3.11/linux.txt diff --git a/requirements/static/ci/py3.12/lint.txt b/requirements/static/ci/py3.12/lint.txt index 777079138cc..0f9d5f8f2b3 100644 --- a/requirements/static/ci/py3.12/lint.txt +++ b/requirements/static/ci/py3.12/lint.txt @@ -33,7 +33,7 @@ asn1crypto==1.3.0 # -c requirements/static/ci/py3.12/linux.txt # certvalidator # oscrypto -astroid==2.3.3 +astroid==3.1.0 # via pylint attrs==23.1.0 # via @@ -141,6 +141,8 @@ cryptography==42.0.3 # paramiko # pyopenssl # vcert +dill==0.3.8 + # via pylint distlib==0.3.2 # via # -c requirements/static/ci/py3.12/linux.txt @@ -276,8 +278,6 @@ kubernetes==3.0.0 # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in -lazy-object-proxy==1.4.3 - # via astroid libnacl==1.7.1 ; sys_platform != "win32" and sys_platform != "darwin" # via # -c requirements/static/ci/py3.12/linux.txt @@ -306,8 +306,6 @@ mercurial==6.0.1 # via # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/linux.in -modernize==0.5 - # via saltpylint more-itertools==5.0.0 # via # -c requirements/static/ci/../pkg/py3.12/linux.txt @@ -360,6 +358,7 @@ pathtools==0.1.2 platformdirs==2.2.0 # via # -c requirements/static/ci/py3.12/linux.txt + # pylint # virtualenv portend==2.4 # via @@ -380,8 +379,6 @@ pyasn1==0.4.8 # -c requirements/static/ci/py3.12/linux.txt # pyasn1-modules # rsa -pycodestyle==2.5.0 - # via saltpylint pycparser==2.21 ; python_version >= "3.9" # via # -c requirements/static/ci/../pkg/py3.12/linux.txt @@ -410,7 +407,7 @@ pyjwt==2.4.0 # via # -c requirements/static/ci/py3.12/linux.txt # twilio -pylint==2.4.4 +pylint==3.1.0 # via # -r requirements/static/ci/lint.in # saltpylint @@ -536,7 +533,7 @@ s3transfer==0.5.2 # via # -c requirements/static/ci/py3.12/linux.txt # boto3 -saltpylint==2023.8.3 +saltpylint==2024.2.5 # via -r requirements/static/ci/lint.in semantic-version==2.9.0 # via @@ -552,7 +549,6 @@ six==1.16.0 # -c requirements/static/ci/../pkg/py3.12/linux.txt # -c requirements/static/ci/py3.12/linux.txt # apscheduler - # astroid # cassandra-driver # cheroot # etcd3-py @@ -604,6 +600,8 @@ toml==0.10.2 # -c requirements/static/ci/py3.12/linux.txt # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomlkit==0.12.3 + # via pylint tornado==6.1 # via # -c requirements/static/ci/py3.12/linux.txt @@ -650,8 +648,6 @@ werkzeug==3.0.1 # via # -c requirements/static/ci/py3.12/linux.txt # moto -wrapt==1.11.1 - # via astroid xmltodict==0.12.0 # via # -c requirements/static/ci/py3.12/linux.txt diff --git a/requirements/static/ci/py3.7/lint.txt b/requirements/static/ci/py3.7/lint.txt deleted file mode 100644 index bc9fea72e56..00000000000 --- a/requirements/static/ci/py3.7/lint.txt +++ /dev/null @@ -1,796 +0,0 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --no-emit-index-url --output-file=requirements/static/ci/py3.7/lint.txt requirements/base.txt requirements/static/ci/common.in requirements/static/ci/lint.in requirements/static/ci/linux.in requirements/static/pkg/linux.in requirements/zeromq.txt -# -aiohttp==3.8.6 - # via - # -c requirements/static/ci/py3.7/linux.txt - # etcd3-py -aiosignal==1.2.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp -apache-libcloud==2.5.0 ; sys_platform != "win32" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -apscheduler==3.6.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # python-telegram-bot -asn1crypto==1.3.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # certvalidator - # oscrypto -astroid==2.3.3 - # via pylint -async-timeout==4.0.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp -asynctest==0.13.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp -attrs==23.1.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp - # jsonschema -backports.entry-points-selectable==1.1.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # virtualenv -backports.zoneinfo==0.2.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # tzlocal -bcrypt==4.1.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # paramiko -boto3==1.21.46 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # moto -boto==2.49.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -botocore==1.24.46 - # via - # -c requirements/static/ci/py3.7/linux.txt - # boto3 - # moto - # s3transfer -cached-property==1.5.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # pygit2 -cachetools==4.2.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # google-auth - # python-telegram-bot -cassandra-driver==3.23.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -certifi==2023.07.22 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # kubernetes - # python-telegram-bot - # requests -certvalidator==0.11.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # vcert -cffi==1.14.6 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # cryptography - # napalm - # pygit2 - # pynacl -charset-normalizer==3.2.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp - # requests -cheetah3==3.2.6.post2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -cheroot==8.5.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cherrypy -cherrypy==18.6.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # -r requirements/static/pkg/linux.in -ciscoconfparse==1.5.19 - # via - # -c requirements/static/ci/py3.7/linux.txt - # napalm -click==7.1.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # geomet -clustershell==1.8.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -colorama==0.4.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # ciscoconfparse -contextvars==2.4 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt -croniter==0.3.29 ; sys_platform != "win32" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -cryptography==42.0.3 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in - # etcd3-py - # moto - # paramiko - # pyopenssl - # vcert -distlib==0.3.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # virtualenv -distro==1.5.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt -dnspython==1.16.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # ciscoconfparse - # python-etcd -docker==6.1.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/lint.in -etcd3-py==0.1.6 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -filelock==3.0.12 - # via - # -c requirements/static/ci/py3.7/linux.txt - # virtualenv -frozenlist==1.3.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp - # aiosignal -future==0.18.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # napalm - # textfsm -genshi==0.7.5 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -geomet==0.1.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # cassandra-driver -gitdb==4.0.7 - # via - # -c requirements/static/ci/py3.7/linux.txt - # gitpython -gitpython==3.1.41 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -google-auth==2.1.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # kubernetes -hglib==2.6.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -idna==3.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # etcd3-py - # requests - # yarl -immutables==0.15 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # contextvars -importlib-metadata==4.6.4 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in - # attrs - # backports.entry-points-selectable - # jsonschema - # mako - # moto - # virtualenv -ipaddress==1.0.22 - # via - # -c requirements/static/ci/py3.7/linux.txt - # kubernetes -isort==4.3.21 - # via pylint -jaraco.classes==3.2.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # jaraco.collections -jaraco.collections==3.4.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cherrypy -jaraco.functools==2.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cheroot - # jaraco.text - # tempora -jaraco.text==3.5.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # jaraco.collections -jinja2==3.1.3 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt - # junos-eznc - # moto - # napalm -jmespath==1.0.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt - # -r requirements/static/ci/common.in - # boto3 - # botocore -jsonschema==3.2.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -junos-eznc==2.4.0 ; sys_platform != "win32" and python_version <= "3.10" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # napalm -jxmlease==1.0.1 ; sys_platform != "win32" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -kazoo==2.6.1 ; sys_platform != "win32" and sys_platform != "darwin" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -keyring==5.7.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -kubernetes==3.0.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -lazy-object-proxy==1.4.3 - # via astroid -libnacl==1.7.1 ; sys_platform != "win32" and sys_platform != "darwin" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -looseversion==1.0.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt -lxml==4.9.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc - # napalm - # ncclient -mako==1.2.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -markupsafe==2.1.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt - # jinja2 - # mako - # moto - # werkzeug -mccabe==0.6.1 - # via pylint -mercurial==6.0.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -modernize==0.5 - # via saltpylint -more-itertools==5.0.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cheroot - # cherrypy - # jaraco.classes - # jaraco.functools -moto==3.0.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -msgpack==1.0.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt -multidict==6.0.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp - # yarl -napalm==3.1.0 ; sys_platform != "win32" and python_version < "3.10" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -ncclient==0.6.4 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc -netaddr==0.7.19 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc - # napalm - # pyeapi -netmiko==3.2.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # napalm -ntc-templates==1.4.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc -oscrypto==1.2.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # certvalidator -packaging==22.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt - # docker -paramiko==3.4.0 ; sys_platform != "win32" and sys_platform != "darwin" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # junos-eznc - # napalm - # ncclient - # netmiko - # scp -passlib==1.7.4 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # ciscoconfparse -pathspec==0.9.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # yamllint -pathtools==0.1.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # watchdog -platformdirs==2.2.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # virtualenv -portend==2.4 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cherrypy -psutil==5.8.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt -pyasn1-modules==0.2.4 - # via - # -c requirements/static/ci/py3.7/linux.txt - # google-auth -pyasn1==0.4.8 - # via - # -c requirements/static/ci/py3.7/linux.txt - # pyasn1-modules - # rsa -pycodestyle==2.5.0 - # via saltpylint -pycparser==2.17 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cffi -pycryptodomex==3.19.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/crypto.txt -pyeapi==0.8.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # napalm -pygit2==1.10.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -pyiface==0.0.11 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -pyinotify==0.9.6 ; sys_platform != "win32" and sys_platform != "darwin" and platform_system != "openbsd" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -pyjwt==2.4.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # twilio -pylint==2.4.4 - # via - # -r requirements/static/ci/lint.in - # saltpylint -pymysql==1.0.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -pynacl==1.5.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # paramiko -pyopenssl==24.0.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in - # etcd3-py -pyparsing==3.0.9 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc -pyrsistent==0.17.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # jsonschema -pyserial==3.4 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc - # netmiko -python-consul==1.1.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -python-dateutil==2.8.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in - # botocore - # croniter - # kubernetes - # moto - # vcert -python-etcd==0.4.5 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -python-gnupg==0.4.8 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in -python-telegram-bot==13.7 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -pytz==2022.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # apscheduler - # moto - # python-telegram-bot - # tempora - # twilio -pyvmomi==6.7.1.2018.12 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -pyyaml==6.0.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt - # clustershell - # junos-eznc - # kubernetes - # napalm - # yamllint - # yamlordereddictloader -pyzmq==23.2.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/zeromq.txt -redis-py-cluster==2.1.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -redis==3.5.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # redis-py-cluster -requests==2.31.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/base.txt - # -r requirements/static/ci/common.in - # apache-libcloud - # docker - # etcd3-py - # kubernetes - # moto - # napalm - # python-consul - # pyvmomi - # responses - # twilio - # vcert -responses==0.10.6 - # via - # -c requirements/static/ci/py3.7/linux.txt - # moto -rfc3987==1.3.8 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -rpm-vercmp==0.1.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in -rsa==4.7.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # google-auth -s3transfer==0.5.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # boto3 -saltpylint==2023.8.3 - # via -r requirements/static/ci/lint.in -scp==0.13.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc - # napalm - # netmiko -semantic-version==2.9.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # etcd3-py -setproctitle==1.3.2 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in -six==1.16.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # apscheduler - # astroid - # cassandra-driver - # cheroot - # etcd3-py - # genshi - # geomet - # jsonschema - # junos-eznc - # kazoo - # kubernetes - # more-itertools - # ncclient - # python-consul - # python-dateutil - # pyvmomi - # responses - # textfsm - # transitions - # vcert - # virtualenv - # websocket-client -slack-bolt==1.15.5 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -slack-sdk==3.19.5 - # via - # -c requirements/static/ci/py3.7/linux.txt - # slack-bolt -smmap==4.0.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # gitdb -sqlparse==0.4.4 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -strict-rfc3339==0.7 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -tempora==4.1.1 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # portend -terminal==0.4.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # ntc-templates -textfsm==1.1.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # napalm - # netmiko - # ntc-templates -timelib==0.2.5 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/pkg/linux.in -toml==0.10.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in - # -r requirements/static/ci/lint.in -tornado==6.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # python-telegram-bot -transitions==0.8.9 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc -twilio==7.9.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -typed-ast==1.4.1 - # via astroid -typing-extensions==3.10.0.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp - # async-timeout - # gitpython - # importlib-metadata - # yarl -tzlocal==3.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # apscheduler -urllib3==1.26.18 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # botocore - # docker - # kubernetes - # python-etcd - # requests -vcert==0.7.4 ; sys_platform != "win32" - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -virtualenv==20.7.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -watchdog==0.10.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -websocket-client==0.40.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # docker - # kubernetes -wempy==0.2.1 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/common.in -werkzeug==2.2.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # moto -wrapt==1.11.1 - # via astroid -xmltodict==0.12.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # moto -yamllint==1.26.3 - # via - # -c requirements/static/ci/py3.7/linux.txt - # -r requirements/static/ci/linux.in -yamlordereddictloader==0.4.0 - # via - # -c requirements/static/ci/py3.7/linux.txt - # junos-eznc -yarl==1.7.2 - # via - # -c requirements/static/ci/py3.7/linux.txt - # aiohttp -zc.lockfile==1.4 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # cherrypy -zipp==3.5.0 - # via - # -c requirements/static/ci/../pkg/py3.7/linux.txt - # -c requirements/static/ci/py3.7/linux.txt - # importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/static/ci/py3.8/lint.txt b/requirements/static/ci/py3.8/lint.txt index f230eca7800..114395d2fbe 100644 --- a/requirements/static/ci/py3.8/lint.txt +++ b/requirements/static/ci/py3.8/lint.txt @@ -25,7 +25,7 @@ asn1crypto==1.3.0 # -c requirements/static/ci/py3.8/linux.txt # certvalidator # oscrypto -astroid==2.3.3 +astroid==3.1.0 # via pylint async-timeout==4.0.2 # via @@ -149,6 +149,8 @@ cryptography==42.0.3 # paramiko # pyopenssl # vcert +dill==0.3.8 + # via pylint distlib==0.3.2 # via # -c requirements/static/ci/py3.8/linux.txt @@ -296,8 +298,6 @@ kubernetes==3.0.0 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in -lazy-object-proxy==1.4.3 - # via astroid libnacl==1.7.1 ; sys_platform != "win32" and sys_platform != "darwin" # via # -c requirements/static/ci/py3.8/linux.txt @@ -332,8 +332,6 @@ mercurial==6.0.1 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/linux.in -modernize==0.5 - # via saltpylint more-itertools==5.0.0 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt @@ -413,6 +411,7 @@ pathtools==0.1.2 platformdirs==2.2.0 # via # -c requirements/static/ci/py3.8/linux.txt + # pylint # virtualenv portend==2.4 # via @@ -433,8 +432,6 @@ pyasn1==0.4.8 # -c requirements/static/ci/py3.8/linux.txt # pyasn1-modules # rsa -pycodestyle==2.5.0 - # via saltpylint pycparser==2.17 # via # -c requirements/static/ci/../pkg/py3.8/linux.txt @@ -465,7 +462,7 @@ pyjwt==2.4.0 # via # -c requirements/static/ci/py3.8/linux.txt # twilio -pylint==2.4.4 +pylint==3.1.0 # via # -r requirements/static/ci/lint.in # saltpylint @@ -599,7 +596,7 @@ s3transfer==0.5.2 # via # -c requirements/static/ci/py3.8/linux.txt # boto3 -saltpylint==2023.8.3 +saltpylint==2024.2.5 # via -r requirements/static/ci/lint.in scp==0.13.2 # via @@ -621,7 +618,6 @@ six==1.16.0 # -c requirements/static/ci/../pkg/py3.8/linux.txt # -c requirements/static/ci/py3.8/linux.txt # apscheduler - # astroid # cassandra-driver # cheroot # etcd3-py @@ -687,6 +683,12 @@ toml==0.10.2 # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via + # -c requirements/static/ci/py3.8/linux.txt + # pylint +tomlkit==0.12.3 + # via pylint tornado==6.1 # via # -c requirements/static/ci/py3.8/linux.txt @@ -699,6 +701,11 @@ twilio==7.9.2 # via # -c requirements/static/ci/py3.8/linux.txt # -r requirements/static/ci/linux.in +typing-extensions==4.8.0 + # via + # -c requirements/static/ci/py3.8/linux.txt + # astroid + # pylint tzlocal==3.0 # via # -c requirements/static/ci/py3.8/linux.txt @@ -737,8 +744,6 @@ werkzeug==3.0.1 # via # -c requirements/static/ci/py3.8/linux.txt # moto -wrapt==1.11.1 - # via astroid xmltodict==0.12.0 # via # -c requirements/static/ci/py3.8/linux.txt diff --git a/requirements/static/ci/py3.9/lint.txt b/requirements/static/ci/py3.9/lint.txt index eac557ef05f..5c47a8a493e 100644 --- a/requirements/static/ci/py3.9/lint.txt +++ b/requirements/static/ci/py3.9/lint.txt @@ -25,7 +25,7 @@ asn1crypto==1.3.0 # -c requirements/static/ci/py3.9/linux.txt # certvalidator # oscrypto -astroid==2.3.3 +astroid==3.1.0 # via pylint async-timeout==4.0.2 # via @@ -145,6 +145,8 @@ cryptography==42.0.3 # paramiko # pyopenssl # vcert +dill==0.3.8 + # via pylint distlib==0.3.2 # via # -c requirements/static/ci/py3.9/linux.txt @@ -292,8 +294,6 @@ kubernetes==3.0.0 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in -lazy-object-proxy==1.4.3 - # via astroid libnacl==1.7.1 ; sys_platform != "win32" and sys_platform != "darwin" # via # -c requirements/static/ci/py3.9/linux.txt @@ -328,8 +328,6 @@ mercurial==6.0.1 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/linux.in -modernize==0.5 - # via saltpylint more-itertools==5.0.0 # via # -c requirements/static/ci/../pkg/py3.9/linux.txt @@ -409,6 +407,7 @@ pathtools==0.1.2 platformdirs==2.2.0 # via # -c requirements/static/ci/py3.9/linux.txt + # pylint # virtualenv portend==2.4 # via @@ -429,8 +428,6 @@ pyasn1==0.4.8 # -c requirements/static/ci/py3.9/linux.txt # pyasn1-modules # rsa -pycodestyle==2.5.0 - # via saltpylint pycparser==2.21 ; python_version >= "3.9" # via # -c requirements/static/ci/../pkg/py3.9/linux.txt @@ -463,7 +460,7 @@ pyjwt==2.4.0 # via # -c requirements/static/ci/py3.9/linux.txt # twilio -pylint==2.4.4 +pylint==3.1.0 # via # -r requirements/static/ci/lint.in # saltpylint @@ -597,7 +594,7 @@ s3transfer==0.5.2 # via # -c requirements/static/ci/py3.9/linux.txt # boto3 -saltpylint==2023.8.3 +saltpylint==2024.2.5 # via -r requirements/static/ci/lint.in scp==0.13.2 # via @@ -619,7 +616,6 @@ six==1.16.0 # -c requirements/static/ci/../pkg/py3.9/linux.txt # -c requirements/static/ci/py3.9/linux.txt # apscheduler - # astroid # cassandra-driver # cheroot # etcd3-py @@ -685,6 +681,12 @@ toml==0.10.2 # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/common.in # -r requirements/static/ci/lint.in +tomli==2.0.1 + # via + # -c requirements/static/ci/py3.9/linux.txt + # pylint +tomlkit==0.12.3 + # via pylint tornado==6.1 # via # -c requirements/static/ci/py3.9/linux.txt @@ -697,6 +699,11 @@ twilio==7.9.2 # via # -c requirements/static/ci/py3.9/linux.txt # -r requirements/static/ci/linux.in +typing-extensions==4.8.0 + # via + # -c requirements/static/ci/py3.9/linux.txt + # astroid + # pylint tzlocal==3.0 # via # -c requirements/static/ci/py3.9/linux.txt @@ -735,8 +742,6 @@ werkzeug==3.0.1 # via # -c requirements/static/ci/py3.9/linux.txt # moto -wrapt==1.11.1 - # via astroid xmltodict==0.12.0 # via # -c requirements/static/ci/py3.9/linux.txt diff --git a/salt/_logging/impl.py b/salt/_logging/impl.py index 2bcc27a0761..9ffa5320301 100644 --- a/salt/_logging/impl.py +++ b/salt/_logging/impl.py @@ -169,7 +169,7 @@ class SaltLoggingClass(LOGGING_LOGGER_CLASS, metaclass=LoggingMixinMeta): logging.getLogger(__name__) """ - instance = super().__new__(cls) + instance = super().__new__(cls) # pylint: disable=no-value-for-parameter try: max_logger_length = len( diff --git a/salt/auth/pki.py b/salt/auth/pki.py index f33e3ccf00c..1c9d6f205a2 100644 --- a/salt/auth/pki.py +++ b/salt/auth/pki.py @@ -84,11 +84,10 @@ def auth(username, password, **kwargs): if cert.verify(cacert.get_pubkey()): log.info("Successfully authenticated certificate: %s", pem) return True - else: - log.info("Failed to authenticate certificate: %s", pem) - return False + log.info("Failed to authenticate certificate: %s", pem) + return False - c = OpenSSL.crypto + c = OpenSSL.crypto # pylint: disable=used-before-assignment cert = c.load_certificate(c.FILETYPE_PEM, pem) with salt.utils.files.fopen(cacert_file) as f: @@ -101,7 +100,7 @@ def auth(username, password, **kwargs): cert_asn1 = c.dump_certificate(c.FILETYPE_ASN1, cert) # Decode the certificate - der = asn1.DerSequence() + der = asn1.DerSequence() # pylint: disable=used-before-assignment der.decode(cert_asn1) # The certificate has three parts: diff --git a/salt/channel/client.py b/salt/channel/client.py index 499041d0c73..8d43406728e 100644 --- a/salt/channel/client.py +++ b/salt/channel/client.py @@ -225,7 +225,7 @@ class AsyncReqChannel: if HAS_M2: aes = key.private_decrypt(ret["key"], RSA.pkcs1_oaep_padding) else: - cipher = PKCS1_OAEP.new(key) + cipher = PKCS1_OAEP.new(key) # pylint: disable=used-before-assignment aes = cipher.decrypt(ret["key"]) # Decrypt using the public key. diff --git a/salt/channel/server.py b/salt/channel/server.py index 4d7cd23fc29..e4eabd40076 100644 --- a/salt/channel/server.py +++ b/salt/channel/server.py @@ -206,7 +206,7 @@ class ReqServerChannel: if HAS_M2: pret["key"] = pub.public_encrypt(key, RSA.pkcs1_oaep_padding) else: - cipher = PKCS1_OAEP.new(pub) + cipher = PKCS1_OAEP.new(pub) # pylint: disable=used-before-assignment pret["key"] = cipher.encrypt(key) if ret is False: ret = {} diff --git a/salt/cli/batch.py b/salt/cli/batch.py index 8e1547c61d4..ca1f464a8d4 100644 --- a/salt/cli/batch.py +++ b/salt/cli/batch.py @@ -90,7 +90,10 @@ class Batch: """ Return the active number of minions to maintain """ - partition = lambda x: float(x) / 100.0 * len(self.minions) + + def partition(x): + return float(x) / 100.0 * len(self.minions) + try: if isinstance(self.opts["batch"], str) and "%" in self.opts["batch"]: res = partition(float(self.opts["batch"].strip("%"))) diff --git a/salt/cli/cp.py b/salt/cli/cp.py index 457be4b044e..42ebfd9d515 100644 --- a/salt/cli/cp.py +++ b/salt/cli/cp.py @@ -68,7 +68,7 @@ class SaltCP: except OSError as exc: if exc.errno == errno.ENOENT: # Path does not exist - sys.stderr.write("{} does not exist\n".format(path)) + sys.stderr.write(f"{path} does not exist\n") sys.exit(42) elif exc.errno in (errno.EINVAL, errno.ENOTDIR): # Path is a file (EINVAL on Windows, ENOTDIR otherwise) @@ -97,7 +97,7 @@ class SaltCP: Take a path and return the contents of the file as a string """ if not os.path.isfile(fn_): - err = "The referenced file, {} is not available.".format(fn_) + err = f"The referenced file, {fn_} is not available." sys.stderr.write(err + "\n") sys.exit(42) with salt.utils.files.fopen(fn_, "r") as fp_: @@ -211,12 +211,10 @@ class SaltCP: log.debug( "Copying %s to %starget '%s' as %s%s", fn_, - "{} ".format(selected_target_option) - if selected_target_option - else "", + f"{selected_target_option} " if selected_target_option else "", tgt, remote_path, - " (chunk #{})".format(index) if append else "", + f" (chunk #{index})" if append else "", ) args = [ tgt, @@ -261,11 +259,7 @@ class SaltCP: log.debug( "Creating empty dir %s on %starget '%s'", dirname, - "{} ".format( - selected_target_option - ) # pylint: disable=str-format-in-logging - if selected_target_option - else "", + f"{selected_target_option} " if selected_target_option else "", tgt, ) args = [tgt, "cp.recv_chunked", [remote_path, None], timeout] diff --git a/salt/client/__init__.py b/salt/client/__init__.py index ebfbea48e7a..cfda90d5782 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -8,7 +8,6 @@ The data structure needs to be: 'key': ''} """ - import logging # The components here are simple, and they need to be and stay simple, we @@ -1296,7 +1295,7 @@ class LocalClient: except KeyError as exc: # This is a safe pass. We're just using the try/except to # avoid having to deep-check for keys. - missing_key = exc.__str__().strip("'\"") + missing_key = str(exc).strip("'\"") if missing_key == "retcode": log.debug("retcode missing from client return") else: diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index e24c0b45344..a5f681569d1 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -559,7 +559,7 @@ class SSH(MultiprocessingStateMixin): try: retcode = int(retcode) except (TypeError, ValueError): - log.warning(f"Got an invalid retcode for host '{host}': '{retcode}'") + log.warning("Got an invalid retcode for host '%s': '%s'", host, retcode) retcode = 1 # This job is done, yield try: @@ -573,7 +573,9 @@ class SSH(MultiprocessingStateMixin): retcode = int(remote_retcode) except (TypeError, ValueError): log.warning( - f"Host '{host}' reported an invalid retcode: '{remote_retcode}'" + "Host '%s' reported an invalid retcode: '%s'", + host, + remote_retcode, ) retcode = max(retcode, 1) except (KeyError, TypeError): @@ -599,7 +601,7 @@ class SSH(MultiprocessingStateMixin): """ que = multiprocessing.Queue() running = {} - target_iter = self.targets.__iter__() + target_iter = iter(self.targets) returned = set() rets = set() init = False @@ -829,7 +831,7 @@ class SSH(MultiprocessingStateMixin): for ret, retcode in self.handle_ssh(): host = next(iter(ret)) if not isinstance(retcode, int): - log.warning(f"Host '{host}' returned an invalid retcode: {retcode}") + log.warning("Host '%s' returned an invalid retcode: %s", host, retcode) retcode = 1 final_exit = max(final_exit, retcode) @@ -1784,7 +1786,7 @@ def ssh_version(): ["ssh", "-V"], stdout=subprocess.PIPE, stderr=subprocess.PIPE ).communicate() try: - version_parts = ret[1].split(b",")[0].split(b"_")[1] + version_parts = ret[1].split(b",", maxsplit=1)[0].split(b"_")[1] parts = [] for part in version_parts: try: diff --git a/salt/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py index 9b8f9e0f658..f0b697d0ac4 100644 --- a/salt/client/ssh/ssh_py_shim.py +++ b/salt/client/ssh/ssh_py_shim.py @@ -41,7 +41,6 @@ ARGS = None # The below line is where OPTIONS can be redefined with internal options # (rather than cli arguments) when the shim is bundled by # client.ssh.Single._cmd_str() -# pylint: disable=block-comment-should-start-with-cardinal-space #%%OPTS @@ -230,7 +229,9 @@ def get_executable(): Find executable which matches supported python version in the thin """ pymap = {} - with open(os.path.join(OPTIONS.saltdir, "supported-versions")) as _fp: + with open( + os.path.join(OPTIONS.saltdir, "supported-versions"), encoding="utf-8" + ) as _fp: for line in _fp.readlines(): ns, v_maj, v_min = line.strip().split(":") pymap[ns] = (int(v_maj), int(v_min)) @@ -314,7 +315,7 @@ def main(argv): # pylint: disable=W0613 ) ) need_deployment() - with open(code_checksum_path, "r") as vpo: + with open(code_checksum_path, "r", encoding="utf-8") as vpo: cur_code_cs = vpo.readline().strip() if cur_code_cs != OPTIONS.code_checksum: sys.stderr.write( @@ -330,7 +331,7 @@ def main(argv): # pylint: disable=W0613 sys.stderr.write('ERROR: thin is missing "{0}"\n'.format(salt_call_path)) need_deployment() - with open(os.path.join(OPTIONS.saltdir, "minion"), "w") as config: + with open(os.path.join(OPTIONS.saltdir, "minion"), "w", encoding="utf-8") as config: config.write(OPTIONS.config + "\n") if OPTIONS.ext_mods: ext_path = os.path.join(OPTIONS.saltdir, EXT_ARCHIVE) @@ -340,7 +341,7 @@ def main(argv): # pylint: disable=W0613 version_path = os.path.join(OPTIONS.saltdir, "ext_version") if not os.path.exists(version_path) or not os.path.isfile(version_path): need_ext() - with open(version_path, "r") as vpo: + with open(version_path, "r", encoding="utf-8") as vpo: cur_version = vpo.readline().strip() if cur_version != OPTIONS.ext_mods: need_ext() diff --git a/salt/client/ssh/wrapper/grains.py b/salt/client/ssh/wrapper/grains.py index bbacdb4ea4f..92446f4018e 100644 --- a/salt/client/ssh/wrapper/grains.py +++ b/salt/client/ssh/wrapper/grains.py @@ -23,21 +23,28 @@ def _serial_sanitizer(instr): return "{}{}".format(instr[:index], "X" * (length - index)) -_FQDN_SANITIZER = lambda x: "MINION.DOMAINNAME" -_HOSTNAME_SANITIZER = lambda x: "MINION" -_DOMAINNAME_SANITIZER = lambda x: "DOMAINNAME" +def _fqdn_sanitizer(x): + return "MINION.DOMAINNAME" + + +def _hostname_sanitizer(x): + return "MINION" + + +def _domainname_sanitizer(x): + return "DOMAINNAME" # A dictionary of grain -> function mappings for sanitizing grain output. This # is used when the 'sanitize' flag is given. _SANITIZERS = { "serialnumber": _serial_sanitizer, - "domain": _DOMAINNAME_SANITIZER, - "fqdn": _FQDN_SANITIZER, - "id": _FQDN_SANITIZER, - "host": _HOSTNAME_SANITIZER, - "localhost": _HOSTNAME_SANITIZER, - "nodename": _HOSTNAME_SANITIZER, + "domain": _domainname_sanitizer, + "fqdn": _fqdn_sanitizer, + "id": _fqdn_sanitizer, + "host": _hostname_sanitizer, + "localhost": _hostname_sanitizer, + "nodename": _hostname_sanitizer, } diff --git a/salt/client/ssh/wrapper/pillar.py b/salt/client/ssh/wrapper/pillar.py index bc1b625d5cb..f085771614c 100644 --- a/salt/client/ssh/wrapper/pillar.py +++ b/salt/client/ssh/wrapper/pillar.py @@ -12,7 +12,9 @@ try: from collections.abc import Mapping except ImportError: # We still allow Py2 import because this could be executed in a machine with Py2. - from collections import Mapping # pylint: disable=no-name-in-module + from collections import ( # pylint: disable=no-name-in-module,deprecated-class + Mapping, + ) def get(key, default="", merge=False, delimiter=DEFAULT_TARGET_DELIM): diff --git a/salt/cloud/cli.py b/salt/cloud/cli.py index f458e975c63..c633dce3b77 100644 --- a/salt/cloud/cli.py +++ b/salt/cloud/cli.py @@ -174,11 +174,11 @@ class SaltCloud(salt.utils.parsers.SaltCloudParser): msg = "The following virtual machines are set to be destroyed:\n" names = set() for alias, drivers in matching.items(): - msg += " {}:\n".format(alias) + msg += f" {alias}:\n" for driver, vms in drivers.items(): - msg += " {}:\n".format(driver) + msg += f" {driver}:\n" for name in vms: - msg += " {}\n".format(name) + msg += f" {name}\n" names.add(name) try: if self.print_confirm(msg): @@ -212,7 +212,7 @@ class SaltCloud(salt.utils.parsers.SaltCloudParser): key, value = name.split("=", 1) kwargs[key] = value else: - msg += " {}\n".format(name) + msg += f" {name}\n" machines.append(name) names = machines @@ -255,7 +255,7 @@ class SaltCloud(salt.utils.parsers.SaltCloudParser): elif self.options.set_password: username = self.credential_username - provider_name = "salt.cloud.provider.{}".format(self.credential_provider) + provider_name = f"salt.cloud.provider.{self.credential_provider}" # TODO: check if provider is configured # set the password salt.utils.cloud.store_password_in_keyring(provider_name, username) @@ -275,7 +275,7 @@ class SaltCloud(salt.utils.parsers.SaltCloudParser): # display profile errors msg += "Found the following errors:\n" for profile_name, error in dmap["errors"].items(): - msg += " {}: {}\n".format(profile_name, error) + msg += f" {profile_name}: {error}\n" sys.stderr.write(msg) sys.stderr.flush() @@ -283,17 +283,17 @@ class SaltCloud(salt.utils.parsers.SaltCloudParser): if "existing" in dmap: msg += "The following virtual machines already exist:\n" for name in dmap["existing"]: - msg += " {}\n".format(name) + msg += f" {name}\n" if dmap["create"]: msg += "The following virtual machines are set to be created:\n" for name in dmap["create"]: - msg += " {}\n".format(name) + msg += f" {name}\n" if "destroy" in dmap: msg += "The following virtual machines are set to be destroyed:\n" for name in dmap["destroy"]: - msg += " {}\n".format(name) + msg += f" {name}\n" if not dmap["create"] and not dmap.get("destroy", None): if not dmap.get("existing", None): @@ -382,19 +382,17 @@ class SaltCloud(salt.utils.parsers.SaltCloudParser): # This is a salt cloud system exit if exc.exit_code > 0: # the exit code is bigger than 0, it's an error - msg = "Error: {}".format(msg) + msg = f"Error: {msg}" self.exit(exc.exit_code, msg.format(exc).rstrip() + "\n") # It's not a system exit but it's an error we can # handle self.error(msg.format(exc)) # This is a generic exception, log it, include traceback if # debug logging is enabled and exit. - # pylint: disable=str-format-in-logging log.error( msg.format(exc), # Show the traceback if the debug logging level is # enabled exc_info_on_loglevel=logging.DEBUG, ) - # pylint: enable=str-format-in-logging self.exit(salt.defaults.exitcodes.EX_GENERIC) diff --git a/salt/cloud/clouds/aliyun.py b/salt/cloud/clouds/aliyun.py index 9b1b318885b..572f0cfde96 100644 --- a/salt/cloud/clouds/aliyun.py +++ b/salt/cloud/clouds/aliyun.py @@ -798,7 +798,7 @@ def query(params=None): signature = _compute_signature(parameters, access_key_secret) parameters["Signature"] = signature - request = requests.get(path, params=parameters, verify=True) + request = requests.get(path, params=parameters, verify=True, timeout=120) if request.status_code != 200: raise SaltCloudSystemExit( "An error occurred while querying aliyun ECS. HTTP Code: {} " diff --git a/salt/cloud/clouds/clc.py b/salt/cloud/clouds/clc.py index c111c49a481..88ed72b1295 100644 --- a/salt/cloud/clouds/clc.py +++ b/salt/cloud/clouds/clc.py @@ -308,7 +308,7 @@ def get_build_status(req_id, nodename): counter = 0 req_id = str(req_id) while counter < 10: - queue = clc.v1.Blueprint.GetStatus(request_id=(req_id)) + queue = clc.v1.Blueprint.GetStatus(request_id=req_id) if queue["PercentComplete"] == 100: server_name = queue["Servers"][0] creds = get_creds() diff --git a/salt/cloud/clouds/digitalocean.py b/salt/cloud/clouds/digitalocean.py index 8c3cf54f05f..7f843f22ab1 100644 --- a/salt/cloud/clouds/digitalocean.py +++ b/salt/cloud/clouds/digitalocean.py @@ -474,9 +474,14 @@ def create(vm_): dns_hostname, dns_domain, ) - __add_dns_addr__ = lambda t, d: post_dns_record( - dns_domain=dns_domain, name=dns_hostname, record_type=t, record_data=d - ) + + def __add_dns_addr__(t, d): + return post_dns_record( + dns_domain=dns_domain, + name=dns_hostname, + record_type=t, + record_data=d, + ) log.debug("create_dns_record: %s", __add_dns_addr__) else: @@ -639,6 +644,7 @@ def query( "Authorization": "Bearer " + personal_access_token, "Content-Type": "application/json", }, + timeout=120, ) if request.status_code > 299: raise SaltCloudSystemExit( diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index 3c8ea286bce..571b0c04674 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -403,7 +403,7 @@ def query( log.trace("EC2 Request Parameters: %s", params_with_headers) try: result = requests.get( - requesturl, headers=headers, params=params_with_headers + requesturl, headers=headers, params=params_with_headers, timeout=120 ) log.debug( "EC2 Response Status Code: %s", @@ -1198,9 +1198,9 @@ def get_imageid(vm_): "Filter.0.Value.0": image, } # Query AWS, sort by 'creationDate' and get the last imageId - _t = lambda x: datetime.datetime.strptime( - x["creationDate"], "%Y-%m-%dT%H:%M:%S.%fZ" - ) + def _t(x): + return datetime.datetime.strptime(x["creationDate"], "%Y-%m-%dT%H:%M:%S.%fZ") + image_id = sorted( aws.query( params, diff --git a/salt/cloud/clouds/joyent.py b/salt/cloud/clouds/joyent.py index 58b853b3f00..cd68508f43a 100644 --- a/salt/cloud/clouds/joyent.py +++ b/salt/cloud/clouds/joyent.py @@ -1168,8 +1168,8 @@ def query(action=None, command=None, args=None, method="GET", location=None, dat digest = md.final() signed = rsa_key.sign(digest, algo="sha256") else: - rsa_ = PKCS1_v1_5.new(rsa_key) - hash_ = SHA256.new() + rsa_ = PKCS1_v1_5.new(rsa_key) # pylint: disable=used-before-assignment + hash_ = SHA256.new() # pylint: disable=used-before-assignment hash_.update(timestamp.encode(__salt_system_encoding__)) signed = rsa_.sign(hash_) signed = base64.b64encode(signed) diff --git a/salt/cloud/clouds/linode.py b/salt/cloud/clouds/linode.py index 72c985f148e..99850b3936a 100644 --- a/salt/cloud/clouds/linode.py +++ b/salt/cloud/clouds/linode.py @@ -530,7 +530,9 @@ class LinodeAPIv4(LinodeAPI): attempt = 0 while True: try: - result = requests.request(method, url, json=data, headers=headers) + result = requests.request( + method, url, json=data, headers=headers, timeout=120 + ) log.debug("Linode API response status code: %d", result.status_code) log.trace("Linode API response body: %s", result.text) @@ -1092,7 +1094,9 @@ class LinodeAPIv4(LinodeAPI): "entity.type": entity, } last_event = None - condition = lambda event: self._check_event_status(event, status) + + def condition(event): + return self._check_event_status(event, status) while True: if last_event is not None: @@ -1965,8 +1969,8 @@ class LinodeAPIv3(LinodeAPI): for key, val in ips.items(): if key == linode_id: - this_node["private_ips"] = val["private_ips"] - this_node["public_ips"] = val["public_ips"] + this_node["private_ips"] = val[1] + this_node["public_ips"] = val[0] if full: this_node["extra"] = node diff --git a/salt/cloud/clouds/proxmox.py b/salt/cloud/clouds/proxmox.py index e293ad4067f..61340f0928f 100644 --- a/salt/cloud/clouds/proxmox.py +++ b/salt/cloud/clouds/proxmox.py @@ -137,7 +137,9 @@ def _authenticate(): connect_data = {"username": username, "password": passwd} full_url = "https://{}:{}/api2/json/access/ticket".format(url, port) - response = requests.post(full_url, verify=verify_ssl, data=connect_data) + response = requests.post( + full_url, verify=verify_ssl, data=connect_data, timeout=120 + ) response.raise_for_status() returned_data = response.json() @@ -171,6 +173,7 @@ def query(conn_type, option, post_data=None): data=post_data, cookies=ticket, headers=httpheaders, + timeout=120, ) elif conn_type == "put": httpheaders["CSRFPreventionToken"] = csrf @@ -180,6 +183,7 @@ def query(conn_type, option, post_data=None): data=post_data, cookies=ticket, headers=httpheaders, + timeout=120, ) elif conn_type == "delete": httpheaders["CSRFPreventionToken"] = csrf @@ -189,9 +193,12 @@ def query(conn_type, option, post_data=None): data=post_data, cookies=ticket, headers=httpheaders, + timeout=120, ) elif conn_type == "get": - response = requests.get(full_url, verify=verify_ssl, cookies=ticket) + response = requests.get( + full_url, verify=verify_ssl, cookies=ticket, timeout=120 + ) try: response.raise_for_status() @@ -862,7 +869,7 @@ def _import_api(): """ global api full_url = "https://{}:{}/pve-docs/api-viewer/apidoc.js".format(url, port) - returned_data = requests.get(full_url, verify=verify_ssl) + returned_data = requests.get(full_url, verify=verify_ssl, timeout=120) re_filter = re.compile(" (?:pveapi|apiSchema) = (.*)^;", re.DOTALL | re.MULTILINE) api_json = re_filter.findall(returned_data.text)[0] diff --git a/salt/cloud/clouds/qingcloud.py b/salt/cloud/clouds/qingcloud.py index b684f6bc9d8..fd2f179b758 100644 --- a/salt/cloud/clouds/qingcloud.py +++ b/salt/cloud/clouds/qingcloud.py @@ -179,7 +179,7 @@ def query(params=None): # print('parameters:') # pprint.pprint(real_parameters) - request = requests.get(path, params=real_parameters, verify=verify_ssl) + request = requests.get(path, params=real_parameters, verify=verify_ssl, timeout=120) # print('url:') # print(request.url) @@ -439,7 +439,7 @@ def _get_size(vm_): if not vm_size: raise SaltCloudNotFound("No size specified for this instance.") - if vm_size in sizes.keys(): + if vm_size in sizes: return vm_size raise SaltCloudNotFound( diff --git a/salt/cloud/clouds/vmware.py b/salt/cloud/clouds/vmware.py index 68fa1c821ab..72dcac96c20 100644 --- a/salt/cloud/clouds/vmware.py +++ b/salt/cloud/clouds/vmware.py @@ -1628,7 +1628,7 @@ def _get_snapshots(snapshot_list, current_snapshot=None, parent_snapshot_path="" snapshots[snapshot_path] = { "name": snapshot.name, "description": snapshot.description, - "created": str(snapshot.createTime).split(".")[0], + "created": str(snapshot.createTime).split(".", maxsplit=1)[0], "state": snapshot.state, "path": snapshot_path, } diff --git a/salt/config/schemas/common.py b/salt/config/schemas/common.py index f8d164abfed..9105ed39266 100644 --- a/salt/config/schemas/common.py +++ b/salt/config/schemas/common.py @@ -47,7 +47,7 @@ class MinionDefaultInclude(DefaultIncludeConfig): class MasterDefaultInclude(DefaultIncludeConfig): __target__ = "master" - __confd_directory = "master.d" + __confd_directory = "master.d" # pylint: disable=unused-private-member class IncludeConfig(Schema): diff --git a/salt/engines/slack.py b/salt/engines/slack.py index 969a6bcd1f2..b6c868c0dbb 100644 --- a/salt/engines/slack.py +++ b/salt/engines/slack.py @@ -890,8 +890,6 @@ class SlackClient: if cmd in runner_functions: runner = salt.runner.RunnerClient(__opts__) log.debug("Command %s will run via runner_functions", cmd) - # pylint is tripping - # pylint: disable=missing-whitespace-after-comma job_id_dict = runner.asynchronous(cmd, {"arg": args, "kwarg": kwargs}) job_id = job_id_dict["jid"] diff --git a/salt/engines/slack_bolt_engine.py b/salt/engines/slack_bolt_engine.py index 75eb0909e48..ca4f1791371 100644 --- a/salt/engines/slack_bolt_engine.py +++ b/salt/engines/slack_bolt_engine.py @@ -995,8 +995,6 @@ class SlackClient: if cmd in runner_functions: runner = salt.runner.RunnerClient(__opts__) log.debug("Command %s will run via runner_functions", cmd) - # pylint is tripping - # pylint: disable=missing-whitespace-after-comma job_id_dict = runner.asynchronous(cmd, {"arg": args, "kwarg": kwargs}) job_id = job_id_dict["jid"] diff --git a/salt/ext/backports_abc.py b/salt/ext/backports_abc.py index da4cb329832..64669416f3e 100644 --- a/salt/ext/backports_abc.py +++ b/salt/ext/backports_abc.py @@ -87,7 +87,7 @@ def mk_gen(): return True return NotImplemented - generator = type((lambda: (yield))()) + generator = type((lambda: (yield))()) # pylint: disable=unnecessary-direct-lambda-call Generator.register(generator) return Generator diff --git a/salt/ext/ipaddress.py b/salt/ext/ipaddress.py index 9ce8ba83d88..f1ee6bcaf38 100644 --- a/salt/ext/ipaddress.py +++ b/salt/ext/ipaddress.py @@ -2162,8 +2162,7 @@ class IPv6Interface(IPv6Address): return x def __str__(self): - return '%s/%d' % (super().__str__(), - self._prefixlen) + return '%s/%d' % (super(), self._prefixlen) def __eq__(self, other): address_equal = IPv6Address.__eq__(self, other) diff --git a/salt/ext/tornado/platform/auto.pyi b/salt/ext/tornado/platform/auto.pyi index a1c97228a43..03eb7d1bf20 100644 --- a/salt/ext/tornado/platform/auto.pyi +++ b/salt/ext/tornado/platform/auto.pyi @@ -1,4 +1,4 @@ # auto.py is full of patterns mypy doesn't like, so for type checking # purposes we replace it with interface.py. -from .interface import * +from .interface import * # pylint: disable=unused-wildcard-import,wildcard-import diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index d013ea3b193..f946eb2019b 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -726,7 +726,7 @@ def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): if cached_md5 == file_md5: return else: - log.info(f"found different hash for file {path}, updating...") + log.info("found different hash for file %s, updating...", path) else: cached_file_stat = os.stat(cached_file_path) cached_file_size = cached_file_stat.st_size @@ -762,6 +762,7 @@ def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): https_enable=https_enable, ) if ret is not None: + s3_file_mtime = s3_file_size = None for header_name, header_value in ret["headers"].items(): name = header_name.strip() value = header_value.strip() @@ -771,9 +772,8 @@ def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): ) elif str(name).lower() == "content-length": s3_file_size = int(value) - if ( - cached_file_size == s3_file_size - and cached_file_mtime > s3_file_mtime + if (s3_file_size and cached_file_size == s3_file_size) and ( + s3_file_mtime and cached_file_mtime > s3_file_mtime ): log.info( "%s - %s : %s skipped download since cached file size " diff --git a/salt/grains/core.py b/salt/grains/core.py index df53ccddd45..2edbcde420b 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -2910,8 +2910,8 @@ def ip_fqdn(): if not ret["ipv" + ipv_num]: ret[key] = [] else: + start_time = datetime.datetime.utcnow() try: - start_time = datetime.datetime.utcnow() info = socket.getaddrinfo(_fqdn, None, socket_type) ret[key] = list({item[4][0] for item in info}) except (OSError, UnicodeError): diff --git a/salt/loader/lazy.py b/salt/loader/lazy.py index 8198b4f62e9..5ad3c6c6d0b 100644 --- a/salt/loader/lazy.py +++ b/salt/loader/lazy.py @@ -15,7 +15,7 @@ import time import traceback import types from collections.abc import MutableMapping -from zipimport import zipimporter +from zipimport import zipimporter # pylint: disable=no-name-in-module import salt.config import salt.defaults.events diff --git a/salt/master.py b/salt/master.py index e91ab24e2bb..2dbf519d1dd 100644 --- a/salt/master.py +++ b/salt/master.py @@ -769,7 +769,9 @@ class Master(SMaster): mod = ".".join(proc.split(".")[:-1]) cls = proc.split(".")[-1] _tmp = __import__(mod, globals(), locals(), [cls], -1) - cls = _tmp.__getattribute__(cls) + cls = _tmp.__getattribute__( # pylint: disable=unnecessary-dunder-call + cls + ) name = "ExtProcess({})".format(cls.__qualname__) self.process_manager.add_process(cls, args=(self.opts,), name=name) except Exception: # pylint: disable=broad-except diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index 58a6fa85f68..d143cdcee07 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -239,7 +239,7 @@ if not HAS_APT: opts = _get_opts(self.line) self.architectures.extend(opts["arch"]["value"]) self.signedby = opts["signedby"]["value"] - for opt in opts.keys(): + for opt in opts: opt = opts[opt]["full"] if opt: try: @@ -1609,9 +1609,11 @@ def _get_upgradable(dist_upgrade=True, **kwargs): # rexp parses lines that look like the following: # Conf libxfont1 (1:1.4.5-1 Debian:testing [i386]) - rexp = re.compile("(?m)^Conf " "([^ ]+) " r"\(([^ ]+)") # Package name # Version + rexp = re.compile(r"(?m)^Conf ([^ ]+) \(([^ ]+)") # Package name # Version keys = ["name", "version"] - _get = lambda l, k: l[keys.index(k)] + + def _get(line, k): + return line[keys.index(k)] upgrades = rexp.findall(out) @@ -1685,7 +1687,10 @@ def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): salt '*' pkg.version_cmp '0.2.4-0ubuntu1' '0.2.4.1-0ubuntu1' """ - normalize = lambda x: str(x).split(":", 1)[-1] if ignore_epoch else str(x) + + def normalize(x): + return str(x).split(":", 1)[-1] if ignore_epoch else str(x) + # both apt_pkg.version_compare and _cmd_quote need string arguments. pkg1 = normalize(pkg1) pkg2 = normalize(pkg2) diff --git a/salt/modules/archive.py b/salt/modules/archive.py index 3f91cd9cefe..e7be041bc66 100644 --- a/salt/modules/archive.py +++ b/salt/modules/archive.py @@ -380,7 +380,7 @@ def list_( dirs, files, links = func(name, cached, *args) except OSError as exc: raise CommandExecutionError( - "Failed to list contents of {}: {}".format(name, exc.__str__()) + "Failed to list contents of {}: {}".format(name, exc) ) except CommandExecutionError as exc: raise @@ -395,9 +395,7 @@ def list_( log.debug("Cleaned cached archive %s", cached) except OSError as exc: if exc.errno != errno.ENOENT: - log.warning( - "Failed to clean cached archive %s: %s", cached, exc.__str__() - ) + log.warning("Failed to clean cached archive %s: %s", cached, exc) if strip_components: for item in (dirs, files, links): @@ -796,8 +794,8 @@ def zip_(zip_file, sources, template=None, cwd=None, runas=None, zip64=False): os.setegid(uinfo["gid"]) os.seteuid(uinfo["uid"]) + exc = None try: - exc = None archived_files = [] with contextlib.closing( zipfile.ZipFile(zip_file, "w", zipfile.ZIP_DEFLATED, zip64) @@ -1203,7 +1201,7 @@ def is_encrypted(name, clean=False, saltenv="base", source_hash=None, use_etag=F "{} is not a ZIP file".format(name), info=archive_info ) except Exception as exc: # pylint: disable=broad-except - raise CommandExecutionError(exc.__str__(), info=archive_info) + raise CommandExecutionError(exc, info=archive_info) else: ret = False @@ -1213,9 +1211,7 @@ def is_encrypted(name, clean=False, saltenv="base", source_hash=None, use_etag=F log.debug("Cleaned cached archive %s", cached) except OSError as exc: if exc.errno != errno.ENOENT: - log.warning( - "Failed to clean cached archive %s: %s", cached, exc.__str__() - ) + log.warning("Failed to clean cached archive %s: %s", cached, exc) return ret diff --git a/salt/modules/boto3_route53.py b/salt/modules/boto3_route53.py index 32c971356c2..88a9b1b2cfc 100644 --- a/salt/modules/boto3_route53.py +++ b/salt/modules/boto3_route53.py @@ -946,7 +946,7 @@ def _aws_decode(x): if "\\" in x: return x.decode("unicode_escape") - if type(x) == bytes: + if isinstance(x, bytes): return x.decode("idna") return x diff --git a/salt/modules/boto3_sns.py b/salt/modules/boto3_sns.py index 65ab6283f51..46026693b54 100644 --- a/salt/modules/boto3_sns.py +++ b/salt/modules/boto3_sns.py @@ -137,7 +137,7 @@ def topic_exists(name, region=None, key=None, keyid=None, profile=None): salt myminion boto3_sns.topic_exists mytopic region=us-east-1 """ topics = list_topics(region=region, key=key, keyid=keyid, profile=profile) - return name in list(topics.values() + topics.keys()) + return name in list(topics.values()) + list(topics) def create_topic(Name, region=None, key=None, keyid=None, profile=None): diff --git a/salt/modules/btrfs.py b/salt/modules/btrfs.py index 4b02eb21afa..6adf421009b 100644 --- a/salt/modules/btrfs.py +++ b/salt/modules/btrfs.py @@ -223,7 +223,10 @@ def _usage_specific(raw): """ Parse usage/specific. """ - get_key = lambda val: dict([tuple(val.split(":"))]) + + def get_key(val): + return dict([tuple(val.split(":"))]) + raw = raw.split("\n") section, size, used = raw[0].split(" ") section = section.replace(",", "_").replace(":", "").lower() diff --git a/salt/modules/consul.py b/salt/modules/consul.py index 205cfb202bd..dfcf84c0ab8 100644 --- a/salt/modules/consul.py +++ b/salt/modules/consul.py @@ -75,7 +75,7 @@ def _query( data = None else: if data is not None: - if type(data) != str: + if not isinstance(data, str): data = salt.utils.json.dumps(data) else: data = salt.utils.json.dumps({}) diff --git a/salt/modules/cp.py b/salt/modules/cp.py index 64666aefa5d..07554808386 100644 --- a/salt/modules/cp.py +++ b/salt/modules/cp.py @@ -115,7 +115,7 @@ def recv_chunked(dest, chunk, append=False, compressed=True, mode=None): if os.path.isfile(dest): return "Path exists and is a file" else: - return _error(exc.__str__()) + return _error(str(exc)) return True chunk = base64.b64decode(chunk) @@ -126,12 +126,12 @@ def recv_chunked(dest, chunk, append=False, compressed=True, mode=None): except OSError as exc: if exc.errno != errno.ENOENT: # Parent dir does not exist, we need to create it - return _error(exc.__str__()) + return _error(str(exc)) try: os.makedirs(os.path.dirname(dest)) except OSError as makedirs_exc: # Failed to make directory - return _error(makedirs_exc.__str__()) + return _error(str(makedirs_exc)) fh_ = salt.utils.files.fopen(dest, open_mode) # pylint: disable=W8470 try: @@ -139,7 +139,7 @@ def recv_chunked(dest, chunk, append=False, compressed=True, mode=None): fh_.write(salt.utils.gzip_util.uncompress(chunk) if compressed else chunk) except OSError as exc: # Write failed - return _error(exc.__str__()) + return _error(str(exc)) else: # Write successful if not append and mode is not None: @@ -149,7 +149,7 @@ def recv_chunked(dest, chunk, append=False, compressed=True, mode=None): try: os.chmod(dest, mode) except OSError: - return _error(exc.__str__()) + return _error(str(exc)) return True finally: try: diff --git a/salt/modules/cryptdev.py b/salt/modules/cryptdev.py index 40c28d17f10..ec195245ccb 100644 --- a/salt/modules/cryptdev.py +++ b/salt/modules/cryptdev.py @@ -263,7 +263,10 @@ def set_crypttab( criteria = entry.pick(match_on) except KeyError: - filterFn = lambda key: key not in _crypttab_entry.crypttab_keys + + def filterFn(key): + return key not in _crypttab_entry.crypttab_keys + invalid_keys = filter(filterFn, match_on) msg = 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) diff --git a/salt/modules/csf.py b/salt/modules/csf.py index 1ab12cab941..63b3cb01ba6 100644 --- a/salt/modules/csf.py +++ b/salt/modules/csf.py @@ -29,7 +29,7 @@ def _temp_exists(method, ip): """ _type = method.replace("temp", "").upper() cmd = ( - "csf -t | awk -v code=1 -v type=_type -v ip=ip '$1==type && $2==ip {{code=0}}" + "csf -t | awk -v code=1 -v type={_type} -v ip={ip} '$1==type && $2==ip {{code=0}}" " END {{exit code}}'".format(_type=_type, ip=ip) ) exists = __salt__["cmd.run_all"](cmd) diff --git a/salt/modules/datadog_api.py b/salt/modules/datadog_api.py index 57ce01953f6..7a18f903b45 100644 --- a/salt/modules/datadog_api.py +++ b/salt/modules/datadog_api.py @@ -157,7 +157,9 @@ def cancel_downtime(api_key=None, app_key=None, scope=None, id=None): elif scope: params = {"api_key": api_key, "application_key": app_key, "scope": scope} response = requests.post( - "https://app.datadoghq.com/api/v1/downtime/cancel/by_scope", params=params + "https://app.datadoghq.com/api/v1/downtime/cancel/by_scope", + params=params, + timeout=120, ) if response.status_code == 200: ret["result"] = True diff --git a/salt/modules/dig.py b/salt/modules/dig.py index ea0463075d4..a78e4875ded 100644 --- a/salt/modules/dig.py +++ b/salt/modules/dig.py @@ -314,7 +314,7 @@ def MX(domain, resolve=False, nameserver=None): stdout = [x.split() for x in cmd["stdout"].split("\n")] if resolve: - return [(lambda x: [x[0], A(x[1], nameserver)[0]])(x) for x in stdout] + return [[x[0], A(x[1], nameserver)[0]] for x in stdout] return stdout diff --git a/salt/modules/disk.py b/salt/modules/disk.py index fb78906b18f..c7e5f905c07 100644 --- a/salt/modules/disk.py +++ b/salt/modules/disk.py @@ -49,7 +49,7 @@ def _parse_numbers(text): "Z": "10E21", "Y": "10E24", } - if text[-1] in postPrefixes.keys(): + if text[-1] in postPrefixes: v = decimal.Decimal(text[:-1]) v = v * decimal.Decimal(postPrefixes[text[-1]]) return v diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py index f9ffd2dda9e..49036f0f756 100644 --- a/salt/modules/dockermod.py +++ b/salt/modules/dockermod.py @@ -399,7 +399,6 @@ def _get_client(timeout=NOTSET, **kwargs): docker_machine_tls["ClientKeyPath"], ), ca_cert=docker_machine_tls["CaCertPath"], - assert_hostname=False, verify=True, ) except Exception as exc: # pylint: disable=broad-except @@ -690,9 +689,9 @@ def _client_wrapper(attr, *args, **kwargs): raise except docker.errors.DockerException as exc: # More general docker exception (catches InvalidVersion, etc.) - raise CommandExecutionError(exc.__str__()) + raise CommandExecutionError(str(exc)) except Exception as exc: # pylint: disable=broad-except - err = exc.__str__() + err = str(exc) else: return ret @@ -1333,7 +1332,10 @@ def compare_networks(first, second, ignore="Name,Id,Created,Containers"): if bool(subval1) is bool(subval2) is False: continue elif subkey == "Config": - kvsort = lambda x: (list(x.keys()), list(x.values())) + + def kvsort(x): + return (list(x.keys()), list(x.values())) + config1 = sorted(val1["Config"], key=kvsort) config2 = sorted(val2.get("Config", []), key=kvsort) if config1 != config2: @@ -3312,7 +3314,7 @@ def create( except CommandExecutionError as exc: raise CommandExecutionError( "Failed to start container after creation", - info={"response": response, "error": exc.__str__()}, + info={"response": response, "error": str(exc)}, ) else: response["Started"] = True @@ -3502,7 +3504,7 @@ def run_container( f"Failed to auto_remove container: {rm_exc}" ) # Raise original exception with additional info - raise CommandExecutionError(exc.__str__(), info=exc_info) + raise CommandExecutionError(str(exc), info=exc_info) # Start the container output = [] @@ -3554,7 +3556,7 @@ def run_container( # it to other_errors as a fallback. exc_info.setdefault("other_errors", []).append(exc.info) # Re-raise with all of the available additional info - raise CommandExecutionError(exc.__str__(), info=exc_info) + raise CommandExecutionError(str(exc), info=exc_info) return ret @@ -4286,7 +4288,7 @@ def dangling(prune=False, force=False): try: ret.setdefault(image, {})["Removed"] = rmi(image, force=force) except Exception as exc: # pylint: disable=broad-except - err = exc.__str__() + err = str(exc) log.error(err) ret.setdefault(image, {})["Comment"] = err ret[image]["Removed"] = False @@ -4606,7 +4608,7 @@ def pull( except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( f"Unable to interpret API event: '{event}'", - info={"Error": exc.__str__()}, + info={"Error": str(exc)}, ) try: event_type = next(iter(event)) @@ -4700,7 +4702,7 @@ def push( except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( f"Unable to interpret API event: '{event}'", - info={"Error": exc.__str__()}, + info={"Error": str(exc)}, ) try: event_type = next(iter(event)) @@ -5496,7 +5498,7 @@ def disconnect_all_containers_from_network(network_id): disconnect_container_from_network(cname, network_id) ret.append(cname) except CommandExecutionError as exc: - msg = exc.__str__() + msg = str(exc) if "404" not in msg: # If 404 was in the error, then the container no longer exists, # so to avoid a race condition we won't consider 404 errors to diff --git a/salt/modules/ebuildpkg.py b/salt/modules/ebuildpkg.py index 0e8fd851066..1b268fa7476 100644 --- a/salt/modules/ebuildpkg.py +++ b/salt/modules/ebuildpkg.py @@ -148,9 +148,9 @@ def _process_emerge_err(stdout, stderr): if slot_conflicts: ret["slot conflicts"] = slot_conflicts - blocked = re.compile( - r"(?m)^\[blocks .+\] " r"([^ ]+/[^ ]+-[0-9]+[^ ]+)" r".*$" - ).findall(stdout) + blocked = re.compile(r"(?m)^\[blocks .+\] ([^ ]+/[^ ]+-[0-9]+[^ ]+).*$").findall( + stdout + ) unsatisfied = re.compile(r"Error: The above package list contains").findall(stderr) @@ -331,7 +331,9 @@ def _get_upgradable(backtrack=3): r".*$" ) keys = ["name", "version"] - _get = lambda l, k: l[keys.index(k)] + + def _get(line, k): + return line[keys.index(k)] upgrades = rexp.findall(out) diff --git a/salt/modules/file.py b/salt/modules/file.py index 69d7992f5ab..d65d3e9a15f 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -4027,7 +4027,7 @@ def readlink(path, canonicalize=False): except OSError as exc: if exc.errno == errno.EINVAL: raise CommandExecutionError("Not a symbolic link: {}".format(path)) - raise CommandExecutionError(exc.__str__()) + raise CommandExecutionError(str(exc)) def readdir(path): @@ -5927,7 +5927,7 @@ def get_diff( continue paths.append(cached_path) except MinionError as exc: - errors.append(salt.utils.stringutils.to_unicode(exc.__str__())) + errors.append(salt.utils.stringutils.to_unicode(str(exc))) continue if errors: diff --git a/salt/modules/freebsdjail.py b/salt/modules/freebsdjail.py index fc3c3ce04f3..1c2343195c7 100644 --- a/salt/modules/freebsdjail.py +++ b/salt/modules/freebsdjail.py @@ -38,7 +38,7 @@ def start(jail=""): salt '*' jail.start [] """ - cmd = "service jail onestart {}".format(jail) + cmd = f"service jail onestart {jail}" return not __salt__["cmd.retcode"](cmd) @@ -52,7 +52,7 @@ def stop(jail=""): salt '*' jail.stop [] """ - cmd = "service jail onestop {}".format(jail) + cmd = f"service jail onestop {jail}" return not __salt__["cmd.retcode"](cmd) @@ -66,7 +66,7 @@ def restart(jail=""): salt '*' jail.restart [] """ - cmd = "service jail onerestart {}".format(jail) + cmd = f"service jail onerestart {jail}" return not __salt__["cmd.retcode"](cmd) @@ -126,9 +126,7 @@ def show_config(jail): """ ret = {} if subprocess.call(["jls", "-nq", "-j", jail]) == 0: - jls = subprocess.check_output( - ["jls", "-nq", "-j", jail] - ) # pylint: disable=minimum-python-version + jls = subprocess.check_output(["jls", "-nq", "-j", jail]) jailopts = salt.utils.args.shlex_split(salt.utils.stringutils.to_unicode(jls)) for jailopt in jailopts: if "=" not in jailopt: @@ -145,7 +143,7 @@ def show_config(jail): line = salt.utils.stringutils.to_unicode(line) if not line.strip(): continue - if not line.startswith("jail_{}_".format(jail)): + if not line.startswith(f"jail_{jail}_"): continue key, value = line.split("=") ret[key.split("_", 2)[2]] = value.split('"')[1] diff --git a/salt/modules/git.py b/salt/modules/git.py index 62dd7028994..4af2e548de7 100644 --- a/salt/modules/git.py +++ b/salt/modules/git.py @@ -1067,7 +1067,7 @@ def clone( url, https_user, https_pass, https_only=True ) except ValueError as exc: - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) command = ["git"] + _format_git_opts(git_opts) command.append("clone") @@ -3044,7 +3044,7 @@ def ls_remote( remote, https_user, https_pass, https_only=True ) except ValueError as exc: - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) command = ["git"] + _format_git_opts(git_opts) command.append("ls-remote") command.extend(_format_opts(opts)) @@ -4051,7 +4051,7 @@ def remote_refs( ) ) except ValueError as exc: - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) if filter_: command.append(filter_) output = _git_run( @@ -4185,7 +4185,7 @@ def remote_set( url, https_user, https_pass, https_only=True ) except ValueError as exc: - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) command = ["git", "remote", "add", remote, url] _git_run( command, diff --git a/salt/modules/glassfish.py b/salt/modules/glassfish.py index 637264e7331..558db0809e5 100644 --- a/salt/modules/glassfish.py +++ b/salt/modules/glassfish.py @@ -126,6 +126,7 @@ def _api_get(path, server=None): auth=_get_auth(server["user"], server["password"]), headers=_get_headers(), verify=True, + timeout=120, ) return _api_response(response) @@ -141,6 +142,7 @@ def _api_post(path, data, server=None): headers=_get_headers(), data=salt.utils.json.dumps(data), verify=True, + timeout=120, ) return _api_response(response) @@ -156,6 +158,7 @@ def _api_delete(path, data, server=None): headers=_get_headers(), params=data, verify=True, + timeout=120, ) return _api_response(response) diff --git a/salt/modules/grains.py b/salt/modules/grains.py index 9c474a94a64..a7040e00b32 100644 --- a/salt/modules/grains.py +++ b/salt/modules/grains.py @@ -40,7 +40,9 @@ __outputter__ = { } # http://stackoverflow.com/a/12414913/127816 -_infinitedict = lambda: collections.defaultdict(_infinitedict) +def _infinitedict(): + return collections.defaultdict(_infinitedict) + _non_existent_key = "NonExistentValueMagicNumberSpK3hnufdHfeBUXCfqVK" @@ -54,21 +56,28 @@ def _serial_sanitizer(instr): return "{}{}".format(instr[:index], "X" * (length - index)) -_FQDN_SANITIZER = lambda x: "MINION.DOMAINNAME" -_HOSTNAME_SANITIZER = lambda x: "MINION" -_DOMAINNAME_SANITIZER = lambda x: "DOMAINNAME" +def _fqdn_sanitizer(x): + return "MINION.DOMAINNAME" + + +def _hostname_sanitizer(x): + return "MINION" + + +def _domainname_sanitizer(x): + return "DOMAINNAME" # A dictionary of grain -> function mappings for sanitizing grain output. This # is used when the 'sanitize' flag is given. _SANITIZERS = { "serialnumber": _serial_sanitizer, - "domain": _DOMAINNAME_SANITIZER, - "fqdn": _FQDN_SANITIZER, - "id": _FQDN_SANITIZER, - "host": _HOSTNAME_SANITIZER, - "localhost": _HOSTNAME_SANITIZER, - "nodename": _HOSTNAME_SANITIZER, + "domain": _domainname_sanitizer, + "fqdn": _fqdn_sanitizer, + "id": _fqdn_sanitizer, + "host": _hostname_sanitizer, + "localhost": _hostname_sanitizer, + "nodename": _hostname_sanitizer, } diff --git a/salt/modules/heat.py b/salt/modules/heat.py index 40540fe7cf0..c4ea3a5e9e1 100644 --- a/salt/modules/heat.py +++ b/salt/modules/heat.py @@ -241,9 +241,15 @@ def _poll_for_events( """ if action: stop_status = ("{}_FAILED".format(action), "{}_COMPLETE".format(action)) - stop_check = lambda a: a in stop_status + + def stop_check(a): + return a in stop_status + else: - stop_check = lambda a: a.endswith("_COMPLETE") or a.endswith("_FAILED") + + def stop_check(a): + return a.endswith("_COMPLETE") or a.endswith("_FAILED") + timeout_sec = timeout * 60 no_event_polls = 0 msg_template = "\n Stack %(name)s %(status)s \n" diff --git a/salt/modules/inspectlib/fsdb.py b/salt/modules/inspectlib/fsdb.py index b834b8f6783..787be0c0252 100644 --- a/salt/modules/inspectlib/fsdb.py +++ b/salt/modules/inspectlib/fsdb.py @@ -16,15 +16,12 @@ """ :codeauthor: Bo Maryniuk """ - - import csv import datetime import gzip import os import re import shutil -import sys from salt.utils.odict import OrderedDict @@ -182,12 +179,15 @@ class CsvDB: :param obj: :return: """ - get_type = lambda item: str(type(item)).split("'")[1] + + def get_type(item): + return str(type(item)).split("'")[1] + if not os.path.exists(os.path.join(self.db_path, obj._TABLE)): with gzip.open(os.path.join(self.db_path, obj._TABLE), "wt") as table_file: csv.writer(table_file).writerow( [ - "{col}:{type}".format(col=elm[0], type=get_type(elm[1])) + f"{elm[0]}:{get_type(elm[1])}" for elm in tuple(obj.__dict__.items()) ] ) @@ -270,7 +270,7 @@ class CsvDB: def _validate_object(self, obj): descr = self._tables.get(obj._TABLE) if descr is None: - raise Exception("Table {} not found.".format(obj._TABLE)) + raise Exception(f"Table {obj._TABLE} not found.") return obj._serialize(self._tables[obj._TABLE]) def __criteria(self, obj, matches=None, mt=None, lt=None, eq=None): @@ -333,14 +333,10 @@ class CsvDB: return objects def _to_type(self, data, type): - if type == "int": + if type in ("int", "long"): data = int(data) elif type == "float": data = float(data) - elif type == "long": - # pylint: disable=undefined-variable,incompatible-py3-code - data = sys.version_info[0] == 2 and long(data) or int(data) - # pylint: enable=undefined-variable,incompatible-py3-code else: data = str(data) return data diff --git a/salt/modules/inspectlib/query.py b/salt/modules/inspectlib/query.py index 54494d6a104..4ba5417a185 100644 --- a/salt/modules/inspectlib/query.py +++ b/salt/modules/inspectlib/query.py @@ -480,11 +480,13 @@ class Query(EnvLoader): raise InspectorQueryException( 'Unknown "{}" value for parameter "time"'.format(timeformat) ) - tfmt = ( - lambda param: timeformat == "tz" - and time.strftime("%b %d %Y %H:%M:%S", time.gmtime(param)) - or int(param) - ) + + def tfmt(param): + return ( + timeformat == "tz" + and time.strftime("%b %d %Y %H:%M:%S", time.gmtime(param)) + or int(param) + ) size_fmt = kwargs.get("size") if size_fmt is not None and size_fmt.lower() not in ["b", "kb", "mb", "gb"]: @@ -525,9 +527,9 @@ class Query(EnvLoader): pld_files.append(pld_data.path) else: pld_files[pld_data.path] = { - "uid": self._id_resolv(pld_data.uid, named=(owners == "id")), + "uid": self._id_resolv(pld_data.uid, named=owners == "id"), "gid": self._id_resolv( - pld_data.gid, named=(owners == "id"), uid=False + pld_data.gid, named=owners == "id", uid=False ), "size": _size_format(pld_data.p_size, fmt=size_fmt), "mode": oct(pld_data.mode), diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py index 0b1177f1f54..986005b1f71 100644 --- a/salt/modules/iptables.py +++ b/salt/modules/iptables.py @@ -25,11 +25,11 @@ master config. The configuration is read using :py:func:`config.get - "-A FORWARD" """ +import argparse import logging import os import re import string -import sys import uuid import salt.utils.args @@ -73,7 +73,7 @@ def _has_option(option, family="ipv4"): _has_option('--wait') _has_option('--check', family='ipv6') """ - cmd = "{} --help".format(_iptables_cmd(family)) + cmd = f"{_iptables_cmd(family)} --help" if option in __salt__["cmd.run_stdout"](cmd, output_loglevel="quiet"): return True return False @@ -192,7 +192,7 @@ def version(family="ipv4"): IPv6: salt '*' iptables.version family=ipv6 """ - cmd = "{} --version".format(_iptables_cmd(family)) + cmd = f"{_iptables_cmd(family)} --version" out = __salt__["cmd.run_stdout"](cmd).split() return out[1] @@ -204,7 +204,7 @@ def build_rule( position="", full=None, family="ipv4", - **kwargs + **kwargs, ): """ Build a well-formatted iptables rule based on kwargs. A `table` and `chain` @@ -316,7 +316,7 @@ def build_rule( if not isinstance(match_value, list): match_value = match_value.split(",") for match in match_value: - rule.append("-m {}".format(match)) + rule.append(f"-m {match}") if "name_" in kwargs and match.strip() in ("pknock", "quota2", "recent"): rule.append("--name {}".format(kwargs["name_"])) del kwargs["name_"] @@ -335,7 +335,7 @@ def build_rule( if match_set.startswith("!") or match_set.startswith("not"): negative_match_set = "! " match_set = re.sub(bang_not_pat, "", match_set) - rule.append("-m set {}--match-set {}".format(negative_match_set, match_set)) + rule.append(f"-m set {negative_match_set}--match-set {match_set}") del kwargs["match-set"] if "connstate" in kwargs: @@ -382,7 +382,7 @@ def build_rule( else: dports = mp_value - rule.append("--{} {}".format(multiport_arg, dports)) + rule.append(f"--{multiport_arg} {dports}") del kwargs[multiport_arg] if "comment" in kwargs: @@ -526,11 +526,11 @@ def build_rule( if after_jump_argument in kwargs: value = kwargs[after_jump_argument] if value in (None, ""): # options without arguments - after_jump.append("--{}".format(after_jump_argument)) + after_jump.append(f"--{after_jump_argument}") elif any(ws_char in str(value) for ws_char in string.whitespace): - after_jump.append('--{} "{}"'.format(after_jump_argument, value)) + after_jump.append(f'--{after_jump_argument} "{value}"') else: - after_jump.append("--{} {}".format(after_jump_argument, value)) + after_jump.append(f"--{after_jump_argument} {value}") del kwargs[after_jump_argument] for key in kwargs: @@ -539,8 +539,8 @@ def build_rule( # the value in the kwargs, thus we need to fetch it after that has run value = kwargs[key] flag = "-" if len(key) == 1 else "--" - value = "" if value in (None, "") else " {}".format(value) - rule.append("{}{}{}{}".format(negation, flag, key, value)) + value = "" if value in (None, "") else f" {value}" + rule.append(f"{negation}{flag}{key}{value}") rule += after_jump @@ -704,7 +704,7 @@ def save(filename=None, family="ipv4"): parent_dir = os.path.dirname(filename) if not os.path.isdir(parent_dir): os.makedirs(parent_dir) - cmd = "{}-save".format(_iptables_cmd(family)) + cmd = f"{_iptables_cmd(family)}-save" ipt = __salt__["cmd.run_stdout"](cmd) # regex out the output if configured with filters @@ -743,26 +743,24 @@ def check(table="filter", chain=None, rule=None, family="ipv4"): ipt_cmd = _iptables_cmd(family) if _has_option("--check", family): - cmd = "{} -t {} -C {} {}".format(ipt_cmd, table, chain, rule) + cmd = f"{ipt_cmd} -t {table} -C {chain} {rule}" __salt__["cmd.run_stderr"](cmd, output_loglevel="quiet") return not __context__["retcode"] else: _chain_name = hex(uuid.getnode()) # Create temporary table - __salt__["cmd.run"]("{} -t {} -N {}".format(ipt_cmd, table, _chain_name)) - __salt__["cmd.run"]( - "{} -t {} -A {} {}".format(ipt_cmd, table, _chain_name, rule) - ) + __salt__["cmd.run"](f"{ipt_cmd} -t {table} -N {_chain_name}") + __salt__["cmd.run"](f"{ipt_cmd} -t {table} -A {_chain_name} {rule}") - out = __salt__["cmd.run_stdout"]("{}-save".format(ipt_cmd)) + out = __salt__["cmd.run_stdout"](f"{ipt_cmd}-save") # Clean up temporary table - __salt__["cmd.run"]("{} -t {} -F {}".format(ipt_cmd, table, _chain_name)) - __salt__["cmd.run"]("{} -t {} -X {}".format(ipt_cmd, table, _chain_name)) + __salt__["cmd.run"](f"{ipt_cmd} -t {table} -F {_chain_name}") + __salt__["cmd.run"](f"{ipt_cmd} -t {table} -X {_chain_name}") for i in out.splitlines(): - if i.startswith("-A {}".format(_chain_name)): + if i.startswith(f"-A {_chain_name}"): if i.replace(_chain_name, chain) in out.splitlines(): return True @@ -792,8 +790,8 @@ def check_chain(table="filter", chain=None, family="ipv4"): if not chain: return "Error: Chain needs to be specified" - cmd = "{}-save -t {}".format(_iptables_cmd(family), table) - out = __salt__["cmd.run_stdout"](cmd).find(":{} ".format(chain)) + cmd = f"{_iptables_cmd(family)}-save -t {table}" + out = __salt__["cmd.run_stdout"](cmd).find(f":{chain} ") if out != -1: out = True @@ -823,7 +821,7 @@ def new_chain(table="filter", chain=None, family="ipv4"): return "Error: Chain needs to be specified" wait = "--wait" if _has_option("--wait", family) else "" - cmd = "{} {} -t {} -N {}".format(_iptables_cmd(family), wait, table, chain) + cmd = f"{_iptables_cmd(family)} {wait} -t {table} -N {chain}" out = __salt__["cmd.run_stderr"](cmd) if not out: @@ -851,7 +849,7 @@ def delete_chain(table="filter", chain=None, family="ipv4"): return "Error: Chain needs to be specified" wait = "--wait" if _has_option("--wait", family) else "" - cmd = "{} {} -t {} -X {}".format(_iptables_cmd(family), wait, table, chain) + cmd = f"{_iptables_cmd(family)} {wait} -t {table} -X {chain}" out = __salt__["cmd.run_stderr"](cmd) if not out: @@ -889,7 +887,7 @@ def append(table="filter", chain=None, rule=None, family="ipv4"): returnCheck = check(table, chain, rule, family) if isinstance(returnCheck, bool) and returnCheck: return False - cmd = "{} {} -t {} -A {} {}".format(_iptables_cmd(family), wait, table, chain, rule) + cmd = f"{_iptables_cmd(family)} {wait} -t {table} -A {chain} {rule}" out = __salt__["cmd.run_stderr"](cmd) return not out @@ -977,7 +975,7 @@ def delete(table, chain=None, position=None, rule=None, family="ipv4"): rule = position wait = "--wait" if _has_option("--wait", family) else "" - cmd = "{} {} -t {} -D {} {}".format(_iptables_cmd(family), wait, table, chain, rule) + cmd = f"{_iptables_cmd(family)} {wait} -t {table} -D {chain} {rule}" out = __salt__["cmd.run_stderr"](cmd) return out @@ -998,7 +996,7 @@ def flush(table="filter", chain="", family="ipv4"): """ wait = "--wait" if _has_option("--wait", family) else "" - cmd = "{} {} -t {} -F {}".format(_iptables_cmd(family), wait, table, chain) + cmd = f"{_iptables_cmd(family)} {wait} -t {table} -F {chain}" out = __salt__["cmd.run_stderr"](cmd) return out @@ -1016,7 +1014,7 @@ def _parse_conf(conf_file=None, in_mem=False, family="ipv4"): with salt.utils.files.fopen(conf_file, "r") as ifile: rules = ifile.read() elif in_mem: - cmd = "{}-save".format(_iptables_cmd(family)) + cmd = f"{_iptables_cmd(family)}-save" rules = __salt__["cmd.run_stdout"](cmd) else: raise SaltException("A file was not found to parse") @@ -1057,7 +1055,7 @@ def _parse_conf(conf_file=None, in_mem=False, family="ipv4"): and args[index + 1] != "!" and not args[index + 1].startswith("-") ): - args[index] += " {}".format(args.pop(index + 1)) + args[index] += f" {args.pop(index + 1)}" index += 1 if args[-1].startswith("-"): args.append("") @@ -1082,17 +1080,8 @@ def _parser(): iptables(8) and iptables-extensions(8) man pages. They will not all be used by all parts of the module; use them intelligently and appropriately. """ - add_arg = None - if sys.version.startswith("2.6"): - import optparse - - parser = optparse.OptionParser() - add_arg = parser.add_option - else: - import argparse # pylint: disable=minimum-python-version - - parser = argparse.ArgumentParser() - add_arg = parser.add_argument + parser = argparse.ArgumentParser() + add_arg = parser.add_argument # COMMANDS add_arg("-A", "--append", dest="append", action="append") diff --git a/salt/modules/iwtools.py b/salt/modules/iwtools.py index aec30a8390c..353fea5ea28 100644 --- a/salt/modules/iwtools.py +++ b/salt/modules/iwtools.py @@ -112,7 +112,7 @@ def _valid_iface(iface): Validate the specified interface """ ifaces = list_interfaces() - if iface in ifaces.keys(): + if iface in ifaces: return True return False diff --git a/salt/modules/k8s.py b/salt/modules/k8s.py index 3368a1d547b..c62d1c79ebc 100644 --- a/salt/modules/k8s.py +++ b/salt/modules/k8s.py @@ -581,7 +581,7 @@ def _source_encode(source, saltenv): try: source_url = urllib.parse.urlparse(source) except TypeError: - return "", {}, "Invalid format for source parameter" + return "", {} protos = ("salt", "http", "https", "ftp", "swift", "s3", "file") diff --git a/salt/modules/kubernetesmod.py b/salt/modules/kubernetesmod.py index 4755d4cf212..d66120925d5 100644 --- a/salt/modules/kubernetesmod.py +++ b/salt/modules/kubernetesmod.py @@ -154,7 +154,7 @@ def _setup_conn_old(**kwargs): or kubernetes.client.configuration.password != password ): # Recreates API connection if settings are changed - kubernetes.client.configuration.__init__() + kubernetes.client.configuration.__init__() # pylint: disable=unnecessary-dunder-call kubernetes.client.configuration.host = host kubernetes.client.configuration.user = username diff --git a/salt/modules/ldap3.py b/salt/modules/ldap3.py index a065b306b6d..2313b024bb9 100644 --- a/salt/modules/ldap3.py +++ b/salt/modules/ldap3.py @@ -32,7 +32,9 @@ log = logging.getLogger(__name__) def __virtual__(): """Only load this module if the Python ldap module is present""" - return bool(len(available_backends)) + if available_backends: + return True + return False class LDAPError(Exception): diff --git a/salt/modules/mac_softwareupdate.py b/salt/modules/mac_softwareupdate.py index 0b5df536210..3cb894e258c 100644 --- a/salt/modules/mac_softwareupdate.py +++ b/salt/modules/mac_softwareupdate.py @@ -176,7 +176,7 @@ def list_ignored(): # "Safari6.1.2MountainLion-6.1.2", # or: # Safari6.1.2MountainLion-6.1.2 - rexp = re.compile('(?m)^ ["]?' r'([^,|\s].*[^"|\n|,])[,|"]?') + rexp = re.compile(r'(?m)^ ["]?([^,|\s].*[^"|\n|,])[,|"]?') return rexp.findall(out) diff --git a/salt/modules/mine.py b/salt/modules/mine.py index f8d55464019..f25e894740f 100644 --- a/salt/modules/mine.py +++ b/salt/modules/mine.py @@ -186,7 +186,7 @@ def update(clear=False, mine_functions=None): res = salt.utils.functools.call_function( __salt__[function_name or function_alias], *function_args, - **function_kwargs + **function_kwargs, ) except Exception: # pylint: disable=broad-except trace = traceback.format_exc() @@ -309,17 +309,8 @@ def get(tgt, fun, tgt_type="glob", exclude_minion=False): # Load from local minion's cache if __opts__["file_client"] == "local": ret = {} - is_target = { - "glob": __salt__["match.glob"], - "pcre": __salt__["match.pcre"], - "list": __salt__["match.list"], - "grain": __salt__["match.grain"], - "grain_pcre": __salt__["match.grain_pcre"], - "ipcidr": __salt__["match.ipcidr"], - "compound": __salt__["match.compound"], - "pillar": __salt__["match.pillar"], - "pillar_pcre": __salt__["match.pillar_pcre"], - }[tgt_type](tgt) + + is_target = __salt__[f"match.{tgt_type}"](tgt) if not is_target: return ret diff --git a/salt/modules/mount.py b/salt/modules/mount.py index 869c6f2016d..aedc8dc79f2 100644 --- a/salt/modules/mount.py +++ b/salt/modules/mount.py @@ -866,7 +866,10 @@ def set_fstab( criteria = entry.pick(match_on) except KeyError: - filterFn = lambda key: key not in _fstab_entry.fstab_keys + + def filterFn(key): + return key not in _fstab_entry.fstab_keys + invalid_keys = filter(filterFn, match_on) msg = 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) @@ -996,7 +999,10 @@ def set_vfstab( criteria = entry.pick(match_on) except KeyError: - filterFn = lambda key: key not in _vfstab_entry.vfstab_keys + + def filterFn(key): + return key not in _vfstab_entry.vfstab_keys + invalid_keys = filter(filterFn, match_on) msg = 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) @@ -1878,7 +1884,10 @@ def set_filesystems( criteria = entry_ip.pick(match_on) except KeyError: - filterFn = lambda key: key not in _FileSystemsEntry.compatibility_keys + + def filterFn(key): + return key not in _FileSystemsEntry.compatibility_keys + invalid_keys = filter(filterFn, match_on) raise CommandExecutionError( 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py index c9c6ad69fe7..4d8f5e07e8b 100644 --- a/salt/modules/mysql.py +++ b/salt/modules/mysql.py @@ -2394,7 +2394,7 @@ def __grant_generate( if dbc != "*": # _ and % are authorized on GRANT queries and should get escaped # on the db name, but only if not requesting a table level grant - dbc = quote_identifier(dbc, for_grants=(table == "*")) + dbc = quote_identifier(dbc, for_grants=table == "*") if table != "*": table = quote_identifier(table) # identifiers cannot be used as values, and same thing for grants @@ -2663,7 +2663,7 @@ def grant_revoke( if dbc != "*": # _ and % are authorized on GRANT queries and should get escaped # on the db name, but only if not requesting a table level grant - s_database = quote_identifier(dbc, for_grants=(table == "*")) + s_database = quote_identifier(dbc, for_grants=table == "*") if dbc == "*": # add revoke for *.* # before the modification query send to mysql will looks like @@ -2764,11 +2764,13 @@ def __do_query_into_hash(conn, sql_str): rtn_results = [] + cursor = None try: cursor = conn.cursor() except MySQLdb.MySQLError: log.error("%s: Can't get cursor for SQL->%s", mod, sql_str) - cursor.close() + if cursor: + cursor.close() log.debug("%s-->", mod) return rtn_results diff --git a/salt/modules/network.py b/salt/modules/network.py index 524b1b74faf..c72230f3335 100644 --- a/salt/modules/network.py +++ b/salt/modules/network.py @@ -2015,7 +2015,7 @@ def iphexval(ip): salt '*' network.iphexval 10.0.0.1 """ a = ip.split(".") - hexval = ["%02X" % int(x) for x in a] # pylint: disable=E1321 + hexval = ["%02X" % int(x) for x in a] return "".join(hexval) diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 762796cce47..3f3ff6dffd8 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -2,24 +2,12 @@ Module for OpenSCAP Management """ - - +import argparse import shlex import shutil import tempfile from subprocess import PIPE, Popen -ArgumentParser = object - -try: - import argparse # pylint: disable=minimum-python-version - - ArgumentParser = argparse.ArgumentParser - HAS_ARGPARSE = True -except ImportError: # python 2.6 - HAS_ARGPARSE = False - - _XCCDF_MAP = { "eval": { "parser_arguments": [(("--profile",), {"required": True})], @@ -32,15 +20,10 @@ _XCCDF_MAP = { } -def __virtual__(): - return HAS_ARGPARSE, "argparse module is required." - - -class _ArgumentParser(ArgumentParser): +class _ArgumentParser(argparse.ArgumentParser): def __init__(self, action=None, *args, **kwargs): super().__init__(*args, prog="oscap", **kwargs) self.add_argument("action", choices=["eval"]) - add_arg = None for params, kwparams in _XCCDF_MAP["eval"]["parser_arguments"]: self.add_argument(*params, **kwparams) diff --git a/salt/modules/opkg.py b/salt/modules/opkg.py index 98882c85e96..72e7bcbb411 100644 --- a/salt/modules/opkg.py +++ b/salt/modules/opkg.py @@ -1222,7 +1222,10 @@ def version_cmp( salt '*' pkg.version_cmp '0.2.4-0' '0.2.4.1-0' """ - normalize = lambda x: str(x).split(":", 1)[-1] if ignore_epoch else str(x) + + def normalize(x): + return str(x).split(":", 1)[-1] if ignore_epoch else str(x) + pkg1 = normalize(pkg1) pkg2 = normalize(pkg2) diff --git a/salt/modules/opsgenie.py b/salt/modules/opsgenie.py index 18539b80654..7ed014042a0 100644 --- a/salt/modules/opsgenie.py +++ b/salt/modules/opsgenie.py @@ -99,6 +99,7 @@ def post_data( "Content-Type": "application/json", "Authorization": "GenieKey " + api_key, }, + timeout=120, ) else: response = requests.post( @@ -108,6 +109,7 @@ def post_data( "Content-Type": "application/json", "Authorization": "GenieKey " + api_key, }, + timeout=120, ) return response.status_code, response.text diff --git a/salt/modules/oracle.py b/salt/modules/oracle.py index bc80943d480..bb79063533f 100644 --- a/salt/modules/oracle.py +++ b/salt/modules/oracle.py @@ -180,9 +180,12 @@ def version(*dbs): salt '*' oracle.version my_db """ pillar_dbs = __salt__["pillar.get"]("oracle:dbs") - get_version = lambda x: [ - r[0] for r in run_query(x, "select banner from v$version order by banner") - ] + + def get_version(x): + return [ + r[0] for r in run_query(x, "select banner from v$version order by banner") + ] + result = {} if dbs: log.debug("get db versions for: %s", dbs) diff --git a/salt/modules/pagerduty_util.py b/salt/modules/pagerduty_util.py index 642e2ce2a5a..10114b3e4bb 100644 --- a/salt/modules/pagerduty_util.py +++ b/salt/modules/pagerduty_util.py @@ -174,6 +174,7 @@ def _query( params=params, data=salt.utils.json.dumps(data), verify=verify_ssl, + timeout=120, ) if result.text is None or result.text == "": @@ -196,6 +197,7 @@ def _query( params=params, data=data, # Already serialized above, don't do it again verify=verify_ssl, + timeout=120, ).json() offset = next_page_results["offset"] limit = next_page_results["limit"] diff --git a/salt/modules/pkg_resource.py b/salt/modules/pkg_resource.py index a6fa5eecd3f..578e53da30d 100644 --- a/salt/modules/pkg_resource.py +++ b/salt/modules/pkg_resource.py @@ -26,7 +26,9 @@ def _repack_pkgs(pkgs, normalize=True): if normalize and "pkg.normalize_name" in __salt__: _normalize_name = __salt__["pkg.normalize_name"] else: - _normalize_name = lambda pkgname: pkgname + + def _normalize_name(pkgname): + return pkgname repacked_pkgs = { _normalize_name(str(x)): str(y) if y is not None else y @@ -71,7 +73,9 @@ def pack_sources(sources, normalize=True): if normalize and "pkg.normalize_name" in __salt__: _normalize_name = __salt__["pkg.normalize_name"] else: - _normalize_name = lambda pkgname: pkgname + + def _normalize_name(pkgname): + return pkgname if isinstance(sources, str): try: diff --git a/salt/modules/portage_config.py b/salt/modules/portage_config.py index 9cf937f9406..15c0ad983da 100644 --- a/salt/modules/portage_config.py +++ b/salt/modules/portage_config.py @@ -88,7 +88,7 @@ def _get_config_file(conf, atom): # parts.repo will be empty if there is no repo part relative_path = parts.repo or "gentoo" elif str(parts.cp).endswith("/*"): - relative_path = str(parts.cp).split("/")[0] + "_" + relative_path = str(parts.cp).split("/", maxsplit=1)[0] + "_" else: relative_path = os.path.join( *[x for x in os.path.split(parts.cp) if x != "*"] diff --git a/salt/modules/postgres.py b/salt/modules/postgres.py index f73959a92ed..d9664ac840a 100644 --- a/salt/modules/postgres.py +++ b/salt/modules/postgres.py @@ -35,10 +35,6 @@ To prevent Postgres commands from running arbitrarily long, a timeout (in second postgres.bins_dir: '/usr/pgsql-9.5/bin/' """ -# This pylint error is popping up where there are no colons? -# pylint: disable=E8203 - - import base64 import datetime import hashlib @@ -1007,7 +1003,8 @@ def user_list( return False # will return empty string if return_password = False - _x = lambda s: s if return_password else "" + def _x(s): + return s if return_password else "" query = "".join( [ diff --git a/salt/modules/quota.py b/salt/modules/quota.py index 931ae63d0ab..eb99d67a4f6 100644 --- a/salt/modules/quota.py +++ b/salt/modules/quota.py @@ -105,7 +105,7 @@ def set_(device, **kwargs): "file-hard-limit": 0, } - current = None + current = ret = None cmd = "setquota" if "user" in kwargs: cmd += " -u {} ".format(kwargs["user"]) diff --git a/salt/modules/rabbitmq.py b/salt/modules/rabbitmq.py index e0a9304bd54..a11fc4a3ede 100644 --- a/salt/modules/rabbitmq.py +++ b/salt/modules/rabbitmq.py @@ -165,7 +165,9 @@ def _output_to_dict(cmdoutput, values_mapper=None): ret = {} if values_mapper is None: - values_mapper = lambda string: string.split("\t") + + def values_mapper(string): + return string.split("\t") # remove first and last line: Listing ... - ...done data_rows = _strip_listing_to_done(cmdoutput.splitlines()) @@ -237,11 +239,11 @@ def list_users(runas=None): ) # func to get tags from string such as "[admin, monitoring]" - func = ( - lambda string: [x.strip() for x in string[1:-1].split(",")] - if "," in string - else [x for x in string[1:-1].split(" ")] - ) + def func(string): + if "," in string: + return [x.strip() for x in string[1:-1].split(",")] + return [x for x in string[1:-1].split(" ")] + return _output_to_dict(res, func) diff --git a/salt/modules/rpm_lowpkg.py b/salt/modules/rpm_lowpkg.py index 4cd137c258f..7bf45780f0c 100644 --- a/salt/modules/rpm_lowpkg.py +++ b/salt/modules/rpm_lowpkg.py @@ -710,7 +710,10 @@ def version_cmp(ver1, ver2, ignore_epoch=False): salt '*' pkg.version_cmp '0.2-001' '0.2.0.1-002' """ - normalize = lambda x: str(x).split(":", 1)[-1] if ignore_epoch else str(x) + + def normalize(x): + return str(x).split(":", 1)[-1] if ignore_epoch else str(x) + ver1 = normalize(ver1) ver2 = normalize(ver2) diff --git a/salt/modules/saltcheck.py b/salt/modules/saltcheck.py index 79113bb71c4..99672a3c133 100644 --- a/salt/modules/saltcheck.py +++ b/salt/modules/saltcheck.py @@ -476,7 +476,7 @@ def run_state_tests(state, saltenv=None, check_all=False, only_fails=False): # Check for situations to disable parallization if parallel: - if type(num_proc) == float: + if isinstance(num_proc, float): num_proc = int(num_proc) if multiprocessing.cpu_count() < 2: diff --git a/salt/modules/selinux.py b/salt/modules/selinux.py index c12db3d9e19..552ec282ff2 100644 --- a/salt/modules/selinux.py +++ b/salt/modules/selinux.py @@ -375,7 +375,7 @@ def _validate_filetype(filetype): Checks if the given filetype is a valid SELinux filetype specification. Throws an SaltInvocationError if it isn't. """ - if filetype not in _SELINUX_FILETYPES.keys(): + if filetype not in _SELINUX_FILETYPES: raise SaltInvocationError("Invalid filetype given: {}".format(filetype)) return True diff --git a/salt/modules/sensehat.py b/salt/modules/sensehat.py index 71c5630703c..d5ba0b5f1f1 100644 --- a/salt/modules/sensehat.py +++ b/salt/modules/sensehat.py @@ -39,6 +39,7 @@ def __virtual__(): """ if has_sense_hat: try: + global _sensehat _sensehat = SenseHat() except OSError: return ( diff --git a/salt/modules/serverdensity_device.py b/salt/modules/serverdensity_device.py index 27a4c0b0a32..f55815fb07a 100644 --- a/salt/modules/serverdensity_device.py +++ b/salt/modules/serverdensity_device.py @@ -89,6 +89,7 @@ def create(name, **params): "https://api.serverdensity.io/inventory/devices/", params={"token": get_sd_auth("api_token")}, data=params, + timeout=120, ) log.debug("Server Density API Response: %s", api_response) log.debug("Server Density API Response content: %s", api_response.content) @@ -120,6 +121,7 @@ def delete(device_id): api_response = requests.delete( "https://api.serverdensity.io/inventory/devices/" + device_id, params={"token": get_sd_auth("api_token")}, + timeout=120, ) log.debug("Server Density API Response: %s", api_response) log.debug("Server Density API Response content: %s", api_response.content) @@ -171,6 +173,7 @@ def ls(**params): "token": get_sd_auth("api_token"), "filter": salt.utils.json.dumps(params), }, + timeout=120, ) log.debug("Server Density API Response: %s", api_response) log.debug("Server Density API Response content: %s", api_response.content) @@ -209,6 +212,7 @@ def update(device_id, **params): "https://api.serverdensity.io/inventory/devices/" + device_id, params={"token": get_sd_auth("api_token")}, data=params, + timeout=120, ) log.debug("Server Density API Response: %s", api_response) log.debug("Server Density API Response content: %s", api_response.content) diff --git a/salt/modules/smartos_imgadm.py b/salt/modules/smartos_imgadm.py index 5d5cb75e750..cfa74f055bc 100644 --- a/salt/modules/smartos_imgadm.py +++ b/salt/modules/smartos_imgadm.py @@ -37,13 +37,16 @@ def _exit_status(retcode, stderr=None): """ Translate exit status of imgadm """ - ret = { - 0: "Successful completion.", - 1: "An error occurred." if not stderr else stderr, - 2: "Usage error.", - 3: "Image not installed.", - }[retcode] - return ret + if retcode == 0: + return "Successful completion." + if retcode == 1: + if stderr: + return stderr + return "An error occurred." + if retcode == 2: + return "Usage error." + if retcode == 3: + return "Image not installed." def _parse_image_meta(image=None, detail=False): diff --git a/salt/modules/smartos_vmadm.py b/salt/modules/smartos_vmadm.py index 3ef9c3d5b6a..308d41d0294 100644 --- a/salt/modules/smartos_vmadm.py +++ b/salt/modules/smartos_vmadm.py @@ -43,10 +43,12 @@ def _exit_status(retcode): """ Translate exit status of vmadm """ - ret = {0: "Successful completion.", 1: "An error occurred.", 2: "Usage error."}[ - retcode - ] - return ret + if retcode == 0: + return "Successful completion." + if retcode == 1: + return "An error occurred." + if retcode == 2: + return "Usage error." def _create_update_from_file(mode="create", uuid=None, path=None): diff --git a/salt/modules/solaris_shadow.py b/salt/modules/solaris_shadow.py index 65d20f2e9e1..9441ecea293 100644 --- a/salt/modules/solaris_shadow.py +++ b/salt/modules/solaris_shadow.py @@ -114,7 +114,7 @@ def info(name): } try: - data = pwd.getpwnam(name) + data = pwd.getpwnam(name) # pylint: disable=used-before-assignment ret.update({"name": name}) except KeyError: return ret diff --git a/salt/modules/splunk_search.py b/salt/modules/splunk_search.py index 560874cd23e..be9a50c28e5 100644 --- a/salt/modules/splunk_search.py +++ b/salt/modules/splunk_search.py @@ -162,7 +162,7 @@ def create(name, profile="splunk", **kwargs): _req_url = "{}/servicesNS/{}/search/saved/searches/{}/acl".format( url, config.get("username"), urllib.parse.quote(name) ) - requests.post(_req_url, auth=auth, verify=True, data=data) + requests.post(_req_url, auth=auth, verify=True, data=data, timeout=120) return _get_splunk_search_props(search) diff --git a/salt/modules/status.py b/salt/modules/status.py index 4b0a3b0d400..8489256f0b5 100644 --- a/salt/modules/status.py +++ b/salt/modules/status.py @@ -186,10 +186,10 @@ def custom(): try: ret[item] = vals[item] except KeyError: - log.warning(f"val {item} not in return of {func}") + log.warning("val %s not in return of %s", item, func) ret[item] = "UNKNOWN" except KeyError: - log.warning(f"custom status {func} isn't loaded") + log.warning("custom status %s isn't loaded", func) return ret @@ -1361,7 +1361,10 @@ def netdev(): """ freebsd specific implementation of netdev """ - _dict_tree = lambda: collections.defaultdict(_dict_tree) + + def _dict_tree(): + return collections.defaultdict(_dict_tree) + ret = _dict_tree() netstat = __salt__["cmd.run"]("netstat -i -n -4 -b -d").splitlines() netstat += __salt__["cmd.run"]("netstat -i -n -6 -b -d").splitlines()[1:] diff --git a/salt/modules/statuspage.py b/salt/modules/statuspage.py index 0a38e84102b..0bfbd2798e0 100644 --- a/salt/modules/statuspage.py +++ b/salt/modules/statuspage.py @@ -110,7 +110,7 @@ def _http_request(url, method="GET", headers=None, data=None): """ Make the HTTP request and return the body as python object. """ - req = requests.request(method, url, headers=headers, data=data) + req = requests.request(method, url, headers=headers, data=data, timeout=120) ret = _default_ret() ok_status = METHOD_OK_STATUS.get(method, 200) if req.status_code != ok_status: diff --git a/salt/modules/swarm.py b/salt/modules/swarm.py index fb0d1e273e6..48d49130274 100644 --- a/salt/modules/swarm.py +++ b/salt/modules/swarm.py @@ -374,7 +374,7 @@ def node_ls(server=str): try: salt_return = {} client = docker.APIClient(base_url="unix://var/run/docker.sock") - service = client.nodes(filters=({"name": server})) + service = client.nodes(filters={"name": server}) getdata = salt.utils.json.dumps(service) dump = salt.utils.json.loads(getdata) for items in dump: diff --git a/salt/modules/sysrc.py b/salt/modules/sysrc.py index 2f7952d5959..67a2ce2faf0 100644 --- a/salt/modules/sysrc.py +++ b/salt/modules/sysrc.py @@ -93,14 +93,14 @@ def set_(name, value, **kwargs): # YES, NO, Yes, No, True, False, etc. to boolean types. However, in this case, # we will check to see if that happened and replace it with "YES" or "NO" because # those items are accepted in sysrc. - if type(value) == bool: + if isinstance(value, bool): if value: value = "YES" else: value = "NO" # This is here for the same reason, except for numbers - if type(value) == int: + if isinstance(value, int): value = str(value) cmd += " " + name + '="' + value + '"' diff --git a/salt/modules/systemd_service.py b/salt/modules/systemd_service.py index 52c17ba6074..dd27106afd0 100644 --- a/salt/modules/systemd_service.py +++ b/salt/modules/systemd_service.py @@ -55,9 +55,6 @@ VALID_UNIT_TYPES = ( # Define the module's virtual name __virtualname__ = "service" -# Disable check for string substitution -# pylint: disable=E1321 - def __virtual__(): """ diff --git a/salt/modules/telegram.py b/salt/modules/telegram.py index 79230b5e049..e0f2f969045 100644 --- a/salt/modules/telegram.py +++ b/salt/modules/telegram.py @@ -113,7 +113,7 @@ def _post_message(message, chat_id, token): parameters["text"] = message try: - response = requests.post(url, data=parameters) + response = requests.post(url, data=parameters, timeout=120) result = response.json() log.debug("Raw response of the telegram request is %s", response) diff --git a/salt/modules/telemetry.py b/salt/modules/telemetry.py index 20dcf08c185..c55c94668ca 100644 --- a/salt/modules/telemetry.py +++ b/salt/modules/telemetry.py @@ -101,7 +101,7 @@ def _retrieve_channel_id(email, profile="telemetry"): _get_telemetry_base(profile) + "/notification-channels?_type=EmailNotificationChannel" ) - response = requests.get(get_url, headers=auth) + response = requests.get(get_url, headers=auth, timeout=120) if response.status_code == 200: cache_result = {} @@ -140,7 +140,7 @@ def get_alert_config( get_url = _get_telemetry_base(profile) + "/alerts?deployment={}".format( deployment_id ) - response = requests.get(get_url, headers=auth) + response = requests.get(get_url, headers=auth, timeout=120) except requests.exceptions.RequestException as e: log.error(str(e)) return False @@ -197,7 +197,7 @@ def get_notification_channel_id(notify_channel, profile="telemetry"): "email": notify_channel, } response = requests.post( - post_url, data=salt.utils.json.dumps(data), headers=auth + post_url, data=salt.utils.json.dumps(data), headers=auth, timeout=120 ) if response.status_code == 200: log.info( @@ -236,6 +236,7 @@ def get_alarms(deployment_id, profile="telemetry"): _get_telemetry_base(profile) + "/alerts?deployment={}".format(deployment_id), headers=auth, + timeout=120, ) except requests.exceptions.RequestException as e: log.error(str(e)) @@ -293,7 +294,10 @@ def create_alarm(deployment_id, metric_name, data, api_key=None, profile="teleme try: response = requests.post( - request_uri, data=salt.utils.json.dumps(post_body), headers=auth + request_uri, + data=salt.utils.json.dumps(post_body), + headers=auth, + timeout=120, ) except requests.exceptions.RequestException as e: # TODO: May be we should retry? @@ -364,7 +368,10 @@ def update_alarm(deployment_id, metric_name, data, api_key=None, profile="teleme try: response = requests.put( - request_uri, data=salt.utils.json.dumps(post_body), headers=auth + request_uri, + data=salt.utils.json.dumps(post_body), + headers=auth, + timeout=120, ) except requests.exceptions.RequestException as e: log.error("Update failed: %s", e) @@ -429,7 +436,7 @@ def delete_alarms( delete_url = _get_telemetry_base(profile) + "/alerts/{}".format(id) try: - response = requests.delete(delete_url, headers=auth) + response = requests.delete(delete_url, headers=auth, timeout=120) if metric_name: log.debug( "updating cache and delete %s key from %s", diff --git a/salt/modules/tomcat.py b/salt/modules/tomcat.py index 46451508c50..d9f9f28e276 100644 --- a/salt/modules/tomcat.py +++ b/salt/modules/tomcat.py @@ -630,17 +630,14 @@ def passwd(passwd, user="", alg="sha1", realm=None): salt '*' tomcat.passwd secret tomcat sha1 salt '*' tomcat.passwd secret tomcat sha1 'Protected Realm' """ + # pylint: disable=no-value-for-parameter + # we call the first parameter the same as the function! + # Shouldn't it be SHA265 instead of SHA1? - digest = hasattr(hashlib, alg) and getattr(hashlib, alg) or None - if digest: + digest = getattr(hashlib, alg, None) + if digest is not None: if realm: - digest.update( - "{}:{}:{}".format( - user, - realm, - passwd, - ) - ) + digest.update(f"{user}:{realm}:{passwd}") else: digest.update(passwd) diff --git a/salt/modules/uptime.py b/salt/modules/uptime.py index 8e40717fa8a..294e91aeee4 100644 --- a/salt/modules/uptime.py +++ b/salt/modules/uptime.py @@ -49,7 +49,9 @@ def create(name, **params): application_url = _get_application_url() log.debug("[uptime] trying PUT request") params.update(url=name) - req = requests.put("{}/api/checks".format(application_url), data=params) + req = requests.put( + "{}/api/checks".format(application_url), data=params, timeout=120 + ) if not req.ok: raise CommandExecutionError("request to uptime failed : {}".format(req.reason)) log.debug("[uptime] PUT request successful") @@ -72,9 +74,11 @@ def delete(name): raise CommandExecutionError(msg) application_url = _get_application_url() log.debug("[uptime] trying DELETE request") - jcontent = requests.get("{}/api/checks".format(application_url)).json() + jcontent = requests.get("{}/api/checks".format(application_url), timeout=120).json() url_id = [x["_id"] for x in jcontent if x["url"] == name][0] - req = requests.delete("{}/api/checks/{}".format(application_url, url_id)) + req = requests.delete( + "{}/api/checks/{}".format(application_url, url_id), timeout=120 + ) if not req.ok: raise CommandExecutionError("request to uptime failed : {}".format(req.reason)) log.debug("[uptime] DELETE request successful") @@ -106,7 +110,7 @@ def checks_list(): """ application_url = _get_application_url() log.debug("[uptime] get checks") - jcontent = requests.get("{}/api/checks".format(application_url)).json() + jcontent = requests.get("{}/api/checks".format(application_url), timeout=120).json() return [x["url"] for x in jcontent] diff --git a/salt/modules/vbox_guest.py b/salt/modules/vbox_guest.py index 56c576ed211..d6dbce68602 100644 --- a/salt/modules/vbox_guest.py +++ b/salt/modules/vbox_guest.py @@ -90,19 +90,19 @@ def _return_mount_error(f): def _additions_install_program_path(mount_point): - return os.path.join( - mount_point, - { - "Linux": "VBoxLinuxAdditions.run", - "Solaris": "VBoxSolarisAdditions.pkg", - "Windows": "VBoxWindowsAdditions.exe", - }[__grains__.get("kernel", "")], - ) + kernel = __grains__.get("kernel", "") + if kernel == "Linux": + exe = "VBoxLinuxAdditions.run" + elif kernel == "Solaris": + exe = "VBoxSolarisAdditions.pkg" + elif kernel == "Windows": + exe = "VBoxWindowsAdditions.exe" + return os.path.join(mount_point, exe) def _additions_install_opensuse(**kwargs): kernel_type = re.sub(r"^(\d|\.|-)*", "", __grains__.get("kernelrelease", "")) - kernel_devel = "kernel-{}-devel".format(kernel_type) + kernel_devel = f"kernel-{kernel_type}-devel" return __states__["pkg.installed"](None, pkgs=["make", "gcc", kernel_devel]) @@ -279,7 +279,7 @@ def additions_version(): except OSError: return False if d and len(os.listdir(d)) > 0: - return re.sub(r"^{}-".format(_additions_dir_prefix), "", os.path.basename(d)) + return re.sub(rf"^{_additions_dir_prefix}-", "", os.path.basename(d)) return False diff --git a/salt/modules/virt.py b/salt/modules/virt.py index 1e671621c25..0f11dbde206 100644 --- a/salt/modules/virt.py +++ b/salt/modules/virt.py @@ -298,9 +298,7 @@ def _get_domain(conn, *vms, **kwargs): if vms: for name in vms: if name not in all_vms: - raise CommandExecutionError( - 'The VM "{name}" is not present'.format(name=name) - ) + raise CommandExecutionError(f'The VM "{name}" is not present') else: lookup_vms.append(name) else: @@ -515,7 +513,7 @@ def _get_disks(conn, dom): disk_type = elem.get("type") def _get_disk_volume_data(pool_name, volume_name): - qemu_target = "{}/{}".format(pool_name, volume_name) + qemu_target = f"{pool_name}/{volume_name}" pool = conn.storagePoolLookupByName(pool_name) extra_properties = {} try: @@ -526,12 +524,15 @@ def _get_disks(conn, dom): "disk size": vol_info[2], } + _nodes = elem.findall( # pylint: disable=cell-var-from-loop + ".//backingStore[source]" + ) backing_files = [ { "file": node.find("source").get("file"), "file format": node.find("format").get("type"), } - for node in elem.findall(".//backingStore[source]") + for node in _nodes ] if backing_files: @@ -570,7 +571,7 @@ def _get_disks(conn, dom): disks[target.get("dev")] = {"file": qemu_target, "zfs": True} continue - if qemu_target in all_volumes.keys(): + if qemu_target in all_volumes: # If the qemu_target is a known path, output a volume volume = all_volumes[qemu_target] qemu_target, extra_properties = _get_disk_volume_data( @@ -605,7 +606,7 @@ def _get_disks(conn, dom): elif disk_type == "block": qemu_target = source.get("dev", "") # If the qemu_target is a known path, output a volume - if qemu_target in all_volumes.keys(): + if qemu_target in all_volumes: volume = all_volumes[qemu_target] qemu_target, extra_properties = _get_disk_volume_data( volume["pool"], volume["name"] @@ -614,7 +615,7 @@ def _get_disks(conn, dom): qemu_target = source.get("protocol") source_name = source.get("name") if source_name: - qemu_target = "{}:{}".format(qemu_target, source_name) + qemu_target = f"{qemu_target}:{source_name}" # Reverse the magic for the rbd and gluster pools if source.get("protocol") in ["rbd", "gluster"]: @@ -622,7 +623,7 @@ def _get_disks(conn, dom): pool_i_xml = ElementTree.fromstring(pool_i.XMLDesc()) name_node = pool_i_xml.find("source/name") if name_node is not None and source_name.startswith( - "{}/".format(name_node.text) + f"{name_node.text}/" ): qemu_target = "{}{}".format( pool_i.name(), source_name[len(name_node.text) :] @@ -638,7 +639,7 @@ def _get_disks(conn, dom): qemu_target = urllib.parse.urlunparse( ( source.get("protocol"), - "{}:{}".format(hostname, port) if port else hostname, + f"{hostname}:{port}" if port else hostname, source_name, "", saxutils.unescape(source.get("query", "")), @@ -743,9 +744,7 @@ def _migrate(dom, dst_uri, **kwargs): try: bandwidth_value = int(max_bandwidth) except ValueError: - raise SaltInvocationError( - "Invalid max_bandwidth value: {}".format(max_bandwidth) - ) + raise SaltInvocationError(f"Invalid max_bandwidth value: {max_bandwidth}") dom.migrateSetMaxSpeed(bandwidth_value) max_downtime = kwargs.get("max_downtime") @@ -753,9 +752,7 @@ def _migrate(dom, dst_uri, **kwargs): try: downtime_value = int(max_downtime) except ValueError: - raise SaltInvocationError( - "Invalid max_downtime value: {}".format(max_downtime) - ) + raise SaltInvocationError(f"Invalid max_downtime value: {max_downtime}") dom.migrateSetMaxDowntime(downtime_value) if kwargs.get("offline") is True: @@ -782,7 +779,7 @@ def _migrate(dom, dst_uri, **kwargs): try: params[param_key] = int(comp_option_value) except ValueError: - raise SaltInvocationError("Invalid {} value".format(comp_option)) + raise SaltInvocationError(f"Invalid {comp_option} value") parallel_connections = kwargs.get("parallel_connections") if parallel_connections: @@ -888,7 +885,7 @@ def _disk_from_pool(conn, pool, pool_xml, volume_name): # Gluster and RBD need pool/volume name name_node = pool_xml.find("./source/name") if name_node is not None: - disk_context["volume"] = "{}/{}".format(name_node.text, volume_name) + disk_context["volume"] = f"{name_node.text}/{volume_name}" # Copy the authentication if any for RBD auth_node = pool_xml.find("./source/auth") if auth_node is not None: @@ -947,7 +944,7 @@ def _gen_xml( consoles=None, stop_on_reboot=False, host_devices=None, - **kwargs + **kwargs, ): """ Generate the XML string to define a libvirt VM @@ -1013,7 +1010,7 @@ def _gen_xml( efi_value = context["boot"].get("efi", None) if boot else None if efi_value is True: context["boot"]["os_attrib"] = "firmware='efi'" - elif efi_value is not None and type(efi_value) != bool: + elif efi_value is not None and not isinstance(efi_value, bool): raise SaltInvocationError("Invalid efi value") if os_type == "xen": @@ -1391,7 +1388,7 @@ def _zfs_image_create( ) ) - destination_fs = os.path.join(pool, "{}.{}".format(vm_name, disk_name)) + destination_fs = os.path.join(pool, f"{vm_name}.{disk_name}") log.debug("Image destination will be %s", destination_fs) existing_disk = __salt__["zfs.list"](name=pool) @@ -1423,9 +1420,7 @@ def _zfs_image_create( sparse=sparse_volume, ) - blockdevice_path = os.path.join( - "/dev/zvol", pool, "{}.{}".format(vm_name, disk_name) - ) + blockdevice_path = os.path.join("/dev/zvol", pool, f"{vm_name}.{disk_name}") log.debug("Image path will be %s", blockdevice_path) return blockdevice_path @@ -1458,7 +1453,7 @@ def _qemu_image_create(disk, create_overlay=False, saltenv="base"): qcow2 = False if salt.utils.path.which("qemu-img"): - res = __salt__["cmd.run"]('qemu-img info "{}"'.format(sfn)) + res = __salt__["cmd.run"](f'qemu-img info "{sfn}"') imageinfo = salt.utils.yaml.safe_load(res) qcow2 = imageinfo["file format"] == "qcow2" try: @@ -1477,9 +1472,7 @@ def _qemu_image_create(disk, create_overlay=False, saltenv="base"): if disk_size and qcow2: log.debug("Resize qcow2 image to %sM", disk_size) - __salt__["cmd.run"]( - 'qemu-img resize "{}" {}M'.format(img_dest, disk_size) - ) + __salt__["cmd.run"](f'qemu-img resize "{img_dest}" {disk_size}M') log.debug("Apply umask and remove exec bit") mode = (0o0777 ^ mask) & 0o0666 @@ -1487,7 +1480,7 @@ def _qemu_image_create(disk, create_overlay=False, saltenv="base"): except OSError as err: raise CommandExecutionError( - "Problem while copying image. {} - {}".format(disk_image, err) + f"Problem while copying image. {disk_image} - {err}" ) else: @@ -1514,7 +1507,7 @@ def _qemu_image_create(disk, create_overlay=False, saltenv="base"): except OSError as err: raise CommandExecutionError( - "Problem while creating volume {} - {}".format(img_dest, err) + f"Problem while creating volume {img_dest} - {err}" ) return img_dest @@ -1730,7 +1723,7 @@ def _fill_disk_filename(conn, vm_name, disk, hypervisor, pool_caps): index = min( idx for idx in range(1, max(indexes) + 2) if idx not in indexes ) - disk["filename"] = "{}{}".format(os.path.basename(device), index) + disk["filename"] = f"{os.path.basename(device)}{index}" # Is the user wanting to reuse an existing volume? if disk.get("source_file"): @@ -1965,7 +1958,7 @@ def _handle_efi_param(boot, desc): return True # check the case that loader tag might be present. This happens after the vm ran - elif type(efi_value) == bool and os_attrib == {}: + elif isinstance(efi_value, bool) and os_attrib == {}: if efi_value is True and parent_tag.find("loader") is None: parent_tag.set("firmware", "efi") return True @@ -1973,7 +1966,7 @@ def _handle_efi_param(boot, desc): parent_tag.remove(parent_tag.find("loader")) parent_tag.remove(parent_tag.find("nvram")) return True - elif type(efi_value) != bool: + elif not isinstance(efi_value, bool): raise SaltInvocationError("Invalid efi value") return False @@ -2006,7 +1999,7 @@ def init( consoles=None, stop_on_reboot=False, host_devices=None, - **kwargs + **kwargs, ): """ Initialize a new vm @@ -2912,7 +2905,7 @@ def init( consoles, stop_on_reboot, host_devices, - **kwargs + **kwargs, ) log.debug("New virtual machine definition: %s", vm_xml) conn.defineXML(vm_xml) @@ -3112,7 +3105,7 @@ def _get_disk_target(targets, disks_count, prefix): :param prefix: the prefix of the target name, i.e. "hd" """ for i in range(disks_count): - ret = "{}{}".format(prefix, string.ascii_lowercase[i]) + ret = f"{prefix}{string.ascii_lowercase[i]}" if ret not in targets: return ret return None @@ -3294,8 +3287,8 @@ def _compute_device_changes(old_xml, new_xml, to_skip): changes[dev_type] = {} if not to_skip[dev_type]: old = devices_node.findall(dev_type) - new = new_xml.findall("devices/{}".format(dev_type)) - changes[dev_type] = globals()["_diff_{}_lists".format(dev_type)](old, new) + new = new_xml.findall(f"devices/{dev_type}") + changes[dev_type] = globals()[f"_diff_{dev_type}_lists"](old, new) return changes @@ -3499,7 +3492,7 @@ def update( stop_on_reboot=False, host_devices=None, autostart=False, - **kwargs + **kwargs, ): """ Update the definition of an existing domain. @@ -3761,7 +3754,7 @@ def update( consoles=consoles, stop_on_reboot=stop_on_reboot, host_devices=host_devices, - **kwargs + **kwargs, ) ) set_autostart(name, "on" if autostart else "off") @@ -3796,7 +3789,7 @@ def update( # _handle_unit treats bytes as invalid unit for the purpose of consistency unit = unit if unit != "bytes" else "b" value = node.get("memory") or node.get("size") or node.text - return _handle_unit("{}{}".format(value, unit)) if value else None + return _handle_unit(f"{value}{unit}") if value else None def _set_vcpu(node, value): node.text = str(value) @@ -4063,32 +4056,32 @@ def update( for timer in timer_names: params_mapping += [ xmlutil.attribute( - "clock:timers:{}:track".format(timer), - "clock/timer[@name='{}']".format(timer), + f"clock:timers:{timer}:track", + f"clock/timer[@name='{timer}']", "track", ["name"], ), xmlutil.attribute( - "clock:timers:{}:tickpolicy".format(timer), - "clock/timer[@name='{}']".format(timer), + f"clock:timers:{timer}:tickpolicy", + f"clock/timer[@name='{timer}']", "tickpolicy", ["name"], ), xmlutil.int_attribute( - "clock:timers:{}:frequency".format(timer), - "clock/timer[@name='{}']".format(timer), + f"clock:timers:{timer}:frequency", + f"clock/timer[@name='{timer}']", "frequency", ["name"], ), xmlutil.attribute( - "clock:timers:{}:mode".format(timer), - "clock/timer[@name='{}']".format(timer), + f"clock:timers:{timer}:mode", + f"clock/timer[@name='{timer}']", "mode", ["name"], ), _yesno_attribute( - "clock:timers:{}:present".format(timer), - "clock/timer[@name='{}']".format(timer), + f"clock:timers:{timer}:present", + f"clock/timer[@name='{timer}']", "present", ["name"], ), @@ -4096,8 +4089,8 @@ def update( for attr in ["slew", "threshold", "limit"]: params_mapping.append( xmlutil.int_attribute( - "clock:timers:{}:{}".format(timer, attr), - "clock/timer[@name='{}']/catchup".format(timer), + f"clock:timers:{timer}:{attr}", + f"clock/timer[@name='{timer}']/catchup", attr, ) ) @@ -5490,7 +5483,7 @@ def migrate(vm_, target, **kwargs): if not urllib.parse.urlparse(target).scheme: proto = "qemu" - dst_uri = "{}://{}/system".format(proto, target) + dst_uri = f"{proto}://{target}/system" else: dst_uri = target @@ -5779,7 +5772,7 @@ def get_hypervisor(): result = [ hyper for hyper in hypervisors - if getattr(sys.modules[__name__], "_is_{}_hyper".format(hyper))() + if getattr(sys.modules[__name__], f"_is_{hyper}_hyper")() ] return result[0] if result else None @@ -5862,7 +5855,7 @@ def vm_cputime(vm_=None, **kwargs): cputime_percent = (1.0e-7 * cputime / host_cpus) / vcpus return { "cputime": int(raw[4]), - "cputime_percent": int("{:.0f}".format(cputime_percent)), + "cputime_percent": int(f"{cputime_percent:.0f}"), } info = {} @@ -6134,7 +6127,7 @@ def snapshot(domain, name=None, suffix=None, **kwargs): ) if suffix: - name = "{name}-{suffix}".format(name=name, suffix=suffix) + name = f"{name}-{suffix}" doc = ElementTree.Element("domainsnapshot") n_name = ElementTree.SubElement(doc, "name") @@ -6258,7 +6251,7 @@ def revert_snapshot(name, vm_snapshot=None, cleanup=False, **kwargs): conn.close() raise CommandExecutionError( snapshot - and 'Snapshot "{}" not found'.format(vm_snapshot) + and f'Snapshot "{vm_snapshot}" not found' or "No more previous snapshots available" ) elif snap.isCurrent(): @@ -6363,7 +6356,7 @@ def _parse_caps_cell(cell): if mem_node is not None: unit = mem_node.get("unit", "KiB") memory = mem_node.text - result["memory"] = "{} {}".format(memory, unit) + result["memory"] = f"{memory} {unit}" pages = [ { @@ -6425,7 +6418,7 @@ def _parse_caps_bank(bank): minimum = control.get("min") if minimum: - result_control["min"] = "{} {}".format(minimum, unit) + result_control["min"] = f"{minimum} {unit}" controls.append(result_control) if controls: result["controls"] = controls @@ -6848,11 +6841,9 @@ def cpu_baseline(full=False, migratable=False, out="libvirt", **kwargs): ] if not cpu_specs: - raise ValueError("Model {} not found in CPU map".format(cpu_model)) + raise ValueError(f"Model {cpu_model} not found in CPU map") elif len(cpu_specs) > 1: - raise ValueError( - "Multiple models {} found in CPU map".format(cpu_model) - ) + raise ValueError(f"Multiple models {cpu_model} found in CPU map") cpu_specs = cpu_specs[0] @@ -6892,7 +6883,7 @@ def network_define( addresses=None, physical_function=None, dns=None, - **kwargs + **kwargs, ): """ Create libvirt network. @@ -7191,7 +7182,7 @@ def network_update( physical_function=None, dns=None, test=False, - **kwargs + **kwargs, ): """ Update a virtual network if needed. @@ -7658,14 +7649,12 @@ def _parse_pools_caps(doc): } for option_kind in ["pool", "vol"]: options = {} - default_format_node = pool.find( - "{}Options/defaultFormat".format(option_kind) - ) + default_format_node = pool.find(f"{option_kind}Options/defaultFormat") if default_format_node is not None: options["default_format"] = default_format_node.get("type") options_enums = { enum.get("name"): [value.text for value in enum.findall("value")] - for enum in pool.findall("{}Options/enum".format(option_kind)) + for enum in pool.findall(f"{option_kind}Options/enum") } if options_enums: options.update(options_enums) @@ -7888,7 +7877,7 @@ def pool_define( source_format=None, transient=False, start=True, # pylint: disable=redefined-outer-name - **kwargs + **kwargs, ): """ Create libvirt pool. @@ -8076,9 +8065,9 @@ def _pool_set_secret( # Create secret if needed if not secret: - description = "Passphrase for {} pool created by Salt".format(pool_name) + description = f"Passphrase for {pool_name} pool created by Salt" if not usage: - usage = "pool_{}".format(pool_name) + usage = f"pool_{pool_name}" secret_xml = _gen_secret_xml(secret_type, usage, description) if not test: secret = conn.secretDefineXML(secret_xml) @@ -8114,7 +8103,7 @@ def pool_update( source_name=None, source_format=None, test=False, - **kwargs + **kwargs, ): """ Update a libvirt storage pool if needed. @@ -8487,7 +8476,7 @@ def pool_undefine(name, **kwargs): } secret_type = auth_types[auth_node.get("type")] secret_usage = auth_node.find("secret").get("usage") - if secret_type and "pool_{}".format(name) == secret_usage: + if secret_type and f"pool_{name}" == secret_usage: secret = conn.secretLookupByUsage(secret_type, secret_usage) secret.undefine() @@ -8809,7 +8798,7 @@ def volume_define( permissions=None, backing_store=None, nocow=False, - **kwargs + **kwargs, ): """ Create libvirt volume. @@ -8910,7 +8899,7 @@ def _volume_upload(conn, pool, volume, file, offset=0, length=0, sparse=False): inData = False eof = os.lseek(fd, 0, os.SEEK_END) if eof < cur: - raise RuntimeError("Current position in file after EOF: {}".format(cur)) + raise RuntimeError(f"Current position in file after EOF: {cur}") sectionLen = eof - cur else: if data > cur: @@ -8963,16 +8952,14 @@ def _volume_upload(conn, pool, volume, file, offset=0, length=0, sparse=False): if stream: stream.abort() if ret: - raise CommandExecutionError( - "Failed to close file: {}".format(err.strerror) - ) + raise CommandExecutionError(f"Failed to close file: {err.strerror}") if stream: try: stream.finish() except libvirt.libvirtError as err: if ret: raise CommandExecutionError( - "Failed to finish stream: {}".format(err.get_error_message()) + f"Failed to finish stream: {err.get_error_message()}" ) return ret diff --git a/salt/modules/win_iis.py b/salt/modules/win_iis.py index 42ec335bf32..3a2500d637b 100644 --- a/salt/modules/win_iis.py +++ b/salt/modules/win_iis.py @@ -1454,7 +1454,7 @@ def set_container_setting(name, container, settings): # Map to numeric to support server 2008 if ( setting == "processModel.identityType" - and settings[setting] in identityType_map2numeric.keys() + and settings[setting] in identityType_map2numeric ): value = identityType_map2numeric[settings[setting]] @@ -1488,7 +1488,7 @@ def set_container_setting(name, container, settings): # map identity type from numeric to string for comparing if ( setting == "processModel.identityType" - and settings[setting] in identityType_map2string.keys() + and settings[setting] in identityType_map2string ): settings[setting] = identityType_map2string[settings[setting]] diff --git a/salt/modules/win_lgpo.py b/salt/modules/win_lgpo.py index 324d49bcba3..1875edad440 100644 --- a/salt/modules/win_lgpo.py +++ b/salt/modules/win_lgpo.py @@ -8687,8 +8687,8 @@ def get_policy_info(policy_name, policy_class, adml_language="en-US"): } policy_class = policy_class.title() policy_data = _policy_info() - if policy_class not in policy_data.policies.keys(): - policy_classes = ", ".join(policy_data.policies.keys()) + if policy_class not in policy_data.policies: + policy_classes = ", ".join(policy_data.policies) ret["message"] = ( 'The requested policy class "{}" is invalid, ' "policy_class should be one of: {}" @@ -9712,7 +9712,7 @@ def get_policy( raise SaltInvocationError("policy_class must be defined") policy_class = policy_class.title() policy_data = _policy_info() - if policy_class not in policy_data.policies.keys(): + if policy_class not in policy_data.policies: policy_classes = ", ".join(policy_data.policies.keys()) raise CommandExecutionError( 'The requested policy class "{}" is invalid, policy_class should ' diff --git a/salt/modules/win_lgpo_reg.py b/salt/modules/win_lgpo_reg.py index e84d0dc2ffe..b3e1fef58e4 100644 --- a/salt/modules/win_lgpo_reg.py +++ b/salt/modules/win_lgpo_reg.py @@ -373,16 +373,16 @@ def set_value( if found_key: if found_name: if "**del." in found_name: - log.debug(f"LGPO_REG Mod: Found disabled name: {found_name}") + log.debug("LGPO_REG Mod: Found disabled name: %s", found_name) pol_data[found_key][v_name] = pol_data[found_key].pop(found_name) found_name = v_name - log.debug(f"LGPO_REG Mod: Updating value: {found_name}") + log.debug("LGPO_REG Mod: Updating value: %s", found_name) pol_data[found_key][found_name] = {"data": v_data, "type": v_type} else: - log.debug(f"LGPO_REG Mod: Setting new value: {found_name}") + log.debug("LGPO_REG Mod: Setting new value: %s", found_name) pol_data[found_key][v_name] = {"data": v_data, "type": v_type} else: - log.debug(f"LGPO_REG Mod: Adding new key and value: {found_name}") + log.debug("LGPO_REG Mod: Adding new key and value: %s", found_name) pol_data[key] = {v_name: {"data": v_data, "type": v_type}} success = True @@ -462,20 +462,22 @@ def disable_value(key, v_name, policy_class="machine"): if found_key: if found_name: if "**del." in found_name: - log.debug(f"LGPO_REG Mod: Already disabled: {v_name}") + log.debug("LGPO_REG Mod: Already disabled: %s", v_name) return None - log.debug(f"LGPO_REG Mod: Disabling value name: {v_name}") + log.debug("LGPO_REG Mod: Disabling value name: %s", v_name) pol_data[found_key].pop(found_name) found_name = "**del.{}".format(found_name) pol_data[found_key][found_name] = {"data": " ", "type": "REG_SZ"} else: - log.debug(f"LGPO_REG Mod: Setting new disabled value name: {v_name}") + log.debug("LGPO_REG Mod: Setting new disabled value name: %s", v_name) pol_data[found_key]["**del.{}".format(v_name)] = { "data": " ", "type": "REG_SZ", } else: - log.debug(f"LGPO_REG Mod: Adding new key and disabled value name: {found_name}") + log.debug( + "LGPO_REG Mod: Adding new key and disabled value name: %s", found_name + ) pol_data[key] = {"**del.{}".format(v_name): {"data": " ", "type": "REG_SZ"}} success = True @@ -553,16 +555,16 @@ def delete_value(key, v_name, policy_class="Machine"): if found_key: if found_name: - log.debug(f"LGPO_REG Mod: Removing value name: {found_name}") + log.debug("LGPO_REG Mod: Removing value name: %s", found_name) pol_data[found_key].pop(found_name) else: - log.debug(f"LGPO_REG Mod: Value name not found: {v_name}") + log.debug("LGPO_REG Mod: Value name not found: %s", v_name) return None if len(pol_data[found_key]) == 0: - log.debug(f"LGPO_REG Mod: Removing empty key: {found_key}") + log.debug("LGPO_REG Mod: Removing empty key: %s", found_key) pol_data.pop(found_key) else: - log.debug(f"LGPO_REG Mod: Key not found: {key}") + log.debug("LGPO_REG Mod: Key not found: %s", key) return None success = True diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index e8fdf22e419..fec5ab56a9c 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -1656,7 +1656,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # single files if cache_dir and installer.startswith("salt:"): path, _ = os.path.split(installer) - log.debug(f"PKG: Caching directory: {path}") + log.debug("PKG: Caching directory: %s", path) try: __salt__["cp.cache_dir"]( path=path, @@ -1673,7 +1673,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # Check to see if the cache_file is cached... if passed if cache_file and cache_file.startswith("salt:"): cache_file_hash = __salt__["cp.hash_file"](cache_file, saltenv) - log.debug(f"PKG: Caching file: {cache_file}") + log.debug("PKG: Caching file: %s", cache_file) try: cached_file = __salt__["cp.cache_file"]( cache_file, @@ -1703,7 +1703,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # file if the source_hash doesn't match, which only works on # files hosted on "salt://". If the http/https url supports # etag, it should also verify that information before caching - log.debug(f"PKG: Caching file: {installer}") + log.debug("PKG: Caching file: %s", installer) try: cached_pkg = __salt__["cp.cache_file"]( installer, @@ -2102,7 +2102,7 @@ def remove(name=None, pkgs=None, **kwargs): if cache_dir and uninstaller.startswith("salt:"): path, _ = os.path.split(uninstaller) - log.debug(f"PKG: Caching dir: {path}") + log.debug("PKG: Caching dir: %s", path) try: __salt__["cp.cache_dir"]( path=path, @@ -2126,7 +2126,7 @@ def remove(name=None, pkgs=None, **kwargs): # only works on files hosted on "salt://". If the http/https # url supports etag, it should also verify that information # before caching - log.debug(f"PKG: Caching file: {uninstaller}") + log.debug("PKG: Caching file: %s", uninstaller) try: cached_pkg = __salt__["cp.cache_file"]( uninstaller, diff --git a/salt/modules/win_pki.py b/salt/modules/win_pki.py index defb92e9d8b..c90af40dd1b 100644 --- a/salt/modules/win_pki.py +++ b/salt/modules/win_pki.py @@ -124,7 +124,7 @@ def get_stores(): salt '*' win_pki.get_stores """ ret = dict() - cmd = r"Get-ChildItem -Path 'Cert:\' | " r"Select-Object LocationName, StoreNames" + cmd = r"Get-ChildItem -Path 'Cert:\' | Select-Object LocationName, StoreNames" items = _cmd_run(cmd=cmd, as_json=True) diff --git a/salt/modules/win_shortcut.py b/salt/modules/win_shortcut.py index c11cc1c64d1..97048b45560 100644 --- a/salt/modules/win_shortcut.py +++ b/salt/modules/win_shortcut.py @@ -82,7 +82,9 @@ def get(path): # This will load the existing shortcut with salt.utils.winapi.Com(): - shell = win32com.client.Dispatch("WScript.Shell") + shell = win32com.client.Dispatch( # pylint: disable=used-before-assignment + "WScript.Shell" + ) shortcut = shell.CreateShortcut(path) arguments = "" diff --git a/salt/modules/win_status.py b/salt/modules/win_status.py index fad2323a43b..033af16e063 100644 --- a/salt/modules/win_status.py +++ b/salt/modules/win_status.py @@ -147,9 +147,6 @@ def __virtual__(): if not HAS_PSUTIL: return False, "win_status.py: Requires psutil" - # Namespace modules from `status.py` - global ping_master, time_ - return __virtualname__ @@ -525,9 +522,7 @@ def master(master=None, connected=True): """ remotes = set() try: - data = subprocess.check_output( - ["netstat", "-n", "-p", "TCP"] - ) # pylint: disable=minimum-python-version + data = subprocess.check_output(["netstat", "-n", "-p", "TCP"]) except subprocess.CalledProcessError: log.error("Failed netstat") raise diff --git a/salt/modules/win_task.py b/salt/modules/win_task.py index 8c9f2718dbd..2e8750ddb97 100644 --- a/salt/modules/win_task.py +++ b/salt/modules/win_task.py @@ -227,7 +227,7 @@ def _get_date_value(date): :rtype: str """ try: - return "{}".format(date) + return f"{date}" except ValueError: return "Never" @@ -245,7 +245,7 @@ def _reverse_lookup(dictionary, value): """ value_index = -1 for idx, dict_value in enumerate(dictionary.values()): - if type(dict_value) == list: + if isinstance(dict_value, list): if value in dict_value: value_index = idx break @@ -269,7 +269,7 @@ def _lookup_first(dictionary, key): :rtype: str """ value = dictionary[key] - if type(value) == list: + if isinstance(value, list): return value[0] else: return value @@ -323,11 +323,11 @@ def _save_task_definition( try: failure_code = fc[exc[5]] except KeyError: - failure_code = "Unknown Failure: {}".format(error) + failure_code = f"Unknown Failure: {error}" log.debug("Failed to modify task: %s", failure_code) - return "Failed to modify task: {}".format(failure_code) + return f"Failed to modify task: {failure_code}" def list_tasks(location="\\"): @@ -363,7 +363,7 @@ def list_tasks(location="\\"): try: task_folder = task_service.GetFolder(location) except pywintypes.com_error: - msg = "Unable to load location: {}".format(location) + msg = f"Unable to load location: {location}" log.error(msg) raise CommandExecutionError(msg) @@ -551,7 +551,7 @@ def create_task( # Check for existing task if name in list_tasks(location) and not force: # Connect to an existing task definition - return "{} already exists".format(name) + return f"{name} already exists" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -566,7 +566,7 @@ def create_task( task_definition=task_definition, user_name=user_name, password=password, - **kwargs + **kwargs, ) # Add Action @@ -642,7 +642,7 @@ def create_task_from_xml( # Check for existing task if name in list_tasks(location): # Connect to an existing task definition - return "{} already exists".format(name) + return f"{name} already exists" if not xml_text and not xml_path: raise ArgumentValueError("Must specify either xml_text or xml_path") @@ -731,7 +731,7 @@ def create_task_from_xml( try: failure_code = fc[error_code] except KeyError: - failure_code = "Unknown Failure: {}".format(error_code) + failure_code = f"Unknown Failure: {error_code}" finally: log.debug("Failed to create task: %s", failure_code) raise CommandExecutionError(failure_code) @@ -767,7 +767,7 @@ def create_folder(name, location="\\"): # Check for existing folder if name in list_folders(location): # Connect to an existing task definition - return "{} already exists".format(name) + return f"{name} already exists" # Create the task service object with salt.utils.winapi.Com(): @@ -812,7 +812,7 @@ def edit_task( force_stop=None, delete_after=None, multiple_instances=None, - **kwargs + **kwargs, ): r""" Edit the parameters of a task. Triggers and Actions cannot be edited yet. @@ -1016,7 +1016,7 @@ def edit_task( else: # Not found and create_new not set, return not found - return "{} not found".format(name) + return f"{name} not found" # General Information if save_definition: @@ -1183,7 +1183,7 @@ def delete_task(name, location="\\"): """ # Check for existing task if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1224,7 +1224,7 @@ def delete_folder(name, location="\\"): """ # Check for existing folder if name not in list_folders(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1266,7 +1266,7 @@ def run(name, location="\\"): """ # Check for existing folder if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1309,7 +1309,7 @@ def run_wait(name, location="\\"): """ # Check for existing folder if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1370,7 +1370,7 @@ def stop(name, location="\\"): """ # Check for existing folder if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1419,7 +1419,7 @@ def status(name, location="\\"): """ # Check for existing folder if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1458,7 +1458,7 @@ def info(name, location="\\"): """ # Check for existing folder if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # connect to the task scheduler with salt.utils.winapi.Com(): @@ -1714,7 +1714,7 @@ def add_action(name=None, location="\\", action_type="Execute", **kwargs): else: # Not found and create_new not set, return not found - return "{} not found".format(name) + return f"{name} not found" # Action Settings task_action = task_definition.Actions.Create(action_types[action_type]) @@ -1808,7 +1808,7 @@ def _clear_actions(name, location="\\"): # TODO: action. # Check for existing task if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # Create the task service object with salt.utils.winapi.Com(): @@ -1848,7 +1848,7 @@ def add_trigger( repeat_stop_at_duration_end=False, execution_time_limit=None, delay=None, - **kwargs + **kwargs, ): r""" Add a trigger to a Windows Scheduled task @@ -2303,7 +2303,7 @@ def add_trigger( else: # Not found and create_new not set, return not found - return "{} not found".format(name) + return f"{name} not found" # Create a New Trigger trigger = task_definition.Triggers.Create(trigger_types[trigger_type]) @@ -2481,7 +2481,7 @@ def clear_triggers(name, location="\\"): """ # Check for existing task if name not in list_tasks(location): - return "{} not found in {}".format(name, location) + return f"{name} not found in {location}" # Create the task service object with salt.utils.winapi.Com(): diff --git a/salt/modules/x509_v2.py b/salt/modules/x509_v2.py index ba26d7b6b2e..f0b9b40130e 100644 --- a/salt/modules/x509_v2.py +++ b/salt/modules/x509_v2.py @@ -1907,7 +1907,7 @@ def _query_remote(ca_server, signing_policy, kwargs, get_signing_policy_only=Fal ) result = result[next(iter(result))] if not isinstance(result, dict) or "data" not in result: - log.error(f"Received invalid return value from ca_server: {result}") + log.error("Received invalid return value from ca_server: %s", result) raise CommandExecutionError( "Received invalid return value from ca_server. See minion log for details" ) diff --git a/salt/modules/xapi_virt.py b/salt/modules/xapi_virt.py index 489a5b2ed4a..2d03d231ffb 100644 --- a/salt/modules/xapi_virt.py +++ b/salt/modules/xapi_virt.py @@ -17,6 +17,7 @@ Useful documentation: """ import contextlib +import importlib import os import sys @@ -26,15 +27,6 @@ import salt.utils.path import salt.utils.stringutils from salt.exceptions import CommandExecutionError -try: - import importlib # pylint: disable=minimum-python-version - - HAS_IMPORTLIB = True -except ImportError: - # Python < 2.7 does not have importlib - HAS_IMPORTLIB = False - - # Define the module's virtual name __virtualname__ = "virt" @@ -50,14 +42,12 @@ def _check_xenapi(): if os.path.isfile(debian_xen_version): # __salt__ is not available in __virtual__ xenversion = salt.modules.cmdmod._run_quiet(debian_xen_version) - xapipath = "/usr/lib/xen-{}/lib/python".format(xenversion) + xapipath = f"/usr/lib/xen-{xenversion}/lib/python" if os.path.isdir(xapipath): sys.path.append(xapipath) try: - if HAS_IMPORTLIB: - return importlib.import_module("xen.xm.XenAPI") - return __import__("xen.xm.XenAPI").xm.XenAPI + return importlib.import_module("xen.xm.XenAPI") except (ImportError, AttributeError): return False @@ -156,7 +146,7 @@ def _get_metrics_record(xapi, rectype, record): Internal, returns metrics record for a rectype """ metrics_id = record["metrics"] - return getattr(xapi, "{}_metrics".format(rectype)).get_record(metrics_id) + return getattr(xapi, f"{rectype}_metrics").get_record(metrics_id) def _get_val(record, keys): @@ -507,10 +497,10 @@ def vcpu_pin(vm_, vcpu, cpus): if cpus == "all": cpumap = cpu_make_map("0-63") else: - cpumap = cpu_make_map("{}".format(cpus)) + cpumap = cpu_make_map(f"{cpus}") try: - xapi.VM.add_to_VCPUs_params_live(vm_uuid, "cpumap{}".format(vcpu), cpumap) + xapi.VM.add_to_VCPUs_params_live(vm_uuid, f"cpumap{vcpu}", cpumap) return True # VM.add_to_VCPUs_params_live() implementation in xend 4.1+ has # a bug which makes the client call fail. @@ -518,7 +508,7 @@ def vcpu_pin(vm_, vcpu, cpus): # for that particular one, fallback to xm / xl instead. except Exception: # pylint: disable=broad-except return __salt__["cmd.run"]( - "{} vcpu-pin {} {} {}".format(_get_xtool(), vm_, vcpu, cpus), + f"{_get_xtool()} vcpu-pin {vm_} {vcpu} {cpus}", python_shell=False, ) @@ -641,9 +631,7 @@ def start(config_): # This function does NOT use the XenAPI. Instead, it use good old xm / xl. # On Xen Source, creating a virtual machine using XenAPI is really painful. # XCP / XS make it really easy using xapi.Async.VM.start instead. Anyone? - return __salt__["cmd.run"]( - "{} create {}".format(_get_xtool(), config_), python_shell=False - ) + return __salt__["cmd.run"](f"{_get_xtool()} create {config_}", python_shell=False) def reboot(vm_): @@ -816,7 +804,7 @@ def vm_cputime(vm_=None): cputime_percent = (1.0e-7 * cputime / host_cpus) / vcpus return { "cputime": int(cputime), - "cputime_percent": int("{:.0f}".format(cputime_percent)), + "cputime_percent": int(f"{cputime_percent:.0f}"), } info = {} diff --git a/salt/modules/xfs.py b/salt/modules/xfs.py index 04b104f9967..b506cd965e7 100644 --- a/salt/modules/xfs.py +++ b/salt/modules/xfs.py @@ -319,7 +319,10 @@ def _blkid_output(out): """ Parse blkid output. """ - flt = lambda data: [el for el in data if el.strip()] + + def flt(data): + return [el for el in data if el.strip()] + data = {} for dev_meta in flt(out.split("\n\n")): dev = {} @@ -439,11 +442,13 @@ def mkfs( salt '*' xfs.mkfs /dev/sda1 dso='su=32k,sw=6' lso='logdev=/dev/sda2,size=10000b' """ - getopts = lambda args: dict( - (args and ("=" in args) and args or None) - and [kw.split("=") for kw in args.split(",")] - or [] - ) + def getopts(args): + return dict( + (args and ("=" in args) and args or None) + and [kw.split("=") for kw in args.split(",")] + or [] + ) + cmd = ["mkfs.xfs"] if label: cmd.append("-L") diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index f794389c861..fa8e0eeffe3 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -397,7 +397,7 @@ def _get_yum_config_value(name, strict_config=True): Look for a specific config variable and return its value """ conf = _get_yum_config(strict_config) - if name in conf.keys(): + if name in conf: return conf.get(name) return None @@ -3135,7 +3135,9 @@ def mod_repo(repo, basedir=None, **kwargs): if key in filerepos[repo].copy().keys(): del filerepos[repo][key] - _bool_to_str = lambda x: "1" if x else "0" + def _bool_to_str(x): + return "1" if x else "0" + # Old file or new, write out the repos(s) filerepos[repo].update(repo_opts) content = header diff --git a/salt/modules/zcbuildout.py b/salt/modules/zcbuildout.py index 99b9202011e..3552d580890 100644 --- a/salt/modules/zcbuildout.py +++ b/salt/modules/zcbuildout.py @@ -287,7 +287,7 @@ def _Popen( directory = os.path.abspath(directory) if isinstance(command, list): command = " ".join(command) - LOG.debug("Running {}".format(command)) # pylint: disable=str-format-in-logging + LOG.debug(f"Running {command}") if not loglevel: loglevel = "debug" ret = __salt__["cmd.run_all"]( @@ -499,7 +499,7 @@ def upgrade_bootstrap( else: buildout_ver = _get_buildout_ver(directory) booturl = _get_bootstrap_url(directory) - LOG.debug("Using {}".format(booturl)) # pylint: disable=str-format-in-logging + LOG.debug(f"Using {booturl}") # try to download an up-to-date bootstrap # set defaulttimeout # and add possible content @@ -792,9 +792,7 @@ def run_buildout( cmds, outputs = [], [] if parts: for part in parts: - LOG.info( - "Installing single part: {}".format(part) - ) # pylint: disable=str-format-in-logging + LOG.info(f"Installing single part: {part}") cmd = "{} -c {} {} install {}".format(bcmd, config, " ".join(argv), part) cmds.append(cmd) outputs.append( @@ -960,9 +958,7 @@ def buildout( salt '*' buildout.buildout /srv/mybuildout """ - LOG.info( - "Running buildout in {} ({})".format(directory, config) - ) # pylint: disable=str-format-in-logging + LOG.info(f"Running buildout in {directory} ({config})") boot_ret = bootstrap( directory, config=config, diff --git a/salt/netapi/rest_cherrypy/__init__.py b/salt/netapi/rest_cherrypy/__init__.py index fbc85c9ff60..4580c6dc81b 100644 --- a/salt/netapi/rest_cherrypy/__init__.py +++ b/salt/netapi/rest_cherrypy/__init__.py @@ -28,7 +28,7 @@ cpy_min = "3.2.2" def __virtual__(): - short_name = __name__.rsplit(".")[-1] + short_name = __name__.rsplit(".", maxsplit=1)[-1] mod_opts = __opts__.get(short_name, {}) if mod_opts: diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index e65bca8f2d9..3a4571968b4 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -711,9 +711,9 @@ def salt_api_acl_tool(username, request): :param request: Cherrypy request to check against the API. :type request: cherrypy.request """ - failure_str = "[api_acl] Authentication failed for " "user %s from IP %s" + failure_str = "[api_acl] Authentication failed for user %s from IP %s" success_str = "[api_acl] Authentication successful for user %s from IP %s" - pass_str = "[api_acl] Authentication not checked for " "user %s from IP %s" + pass_str = "[api_acl] Authentication not checked for user %s from IP %s" acl = None # Salt Configuration @@ -777,7 +777,7 @@ def salt_auth_tool(): Redirect all unauthenticated requests to the login page """ # Redirect to the login page if the session hasn't been authed - if "token" not in cherrypy.session: # pylint: disable=W8601 + if "token" not in cherrypy.session: raise cherrypy.HTTPError(401) # Session is authenticated; inform caches @@ -1145,7 +1145,7 @@ for hook, tool_list in tools_config.items(): for idx, tool_config in enumerate(tool_list): tool_name, tool_fn = tool_config setattr( - cherrypy.tools, tool_name, cherrypy.Tool(hook, tool_fn, priority=(50 + idx)) + cherrypy.tools, tool_name, cherrypy.Tool(hook, tool_fn, priority=50 + idx) ) diff --git a/salt/netapi/rest_tornado/saltnado.py b/salt/netapi/rest_tornado/saltnado.py index 6d47de1446a..a0697bbc3fc 100644 --- a/salt/netapi/rest_tornado/saltnado.py +++ b/salt/netapi/rest_tornado/saltnado.py @@ -333,12 +333,12 @@ class EventListener: Get an event (asynchronous of course) return a future that will get it later """ future = Future() + _loop = salt.ext.tornado.ioloop.IOLoop.current() + assert _loop if callback is not None: def handle_future(future): - salt.ext.tornado.ioloop.IOLoop.current().add_callback( - callback, future - ) # pylint: disable=E1102 + _loop.add_callback(callback, future) # pylint: disable=not-callable future.add_done_callback(handle_future) # add this tag and future to the callbacks @@ -346,7 +346,7 @@ class EventListener: self.request_map[request].append((tag, matcher, future)) if timeout: - timeout_future = salt.ext.tornado.ioloop.IOLoop.current().call_later( + timeout_future = _loop.call_later( timeout, self._timeout_future, tag, matcher, future ) self.timeout_map[future] = timeout_future diff --git a/salt/output/pony.py b/salt/output/pony.py index 908b8b29392..f1d6d1e3d9a 100644 --- a/salt/output/pony.py +++ b/salt/output/pony.py @@ -66,6 +66,4 @@ def output(data, **kwargs): # pylint: disable=unused-argument Mane function """ high_out = __salt__["highstate"](data) - return subprocess.check_output( - ["ponysay", salt.utils.data.decode(high_out)] - ) # pylint: disable=E0598 + return subprocess.check_output(["ponysay", salt.utils.data.decode(high_out)]) diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py index 9ad3c485fdf..dde097a209a 100644 --- a/salt/pillar/__init__.py +++ b/salt/pillar/__init__.py @@ -259,8 +259,8 @@ class AsyncRemotePillar(RemotePillarMixin): load["clean_cache"] = self.clean_cache if self.ext: load["ext"] = self.ext + start = time.monotonic() try: - start = time.monotonic() ret_pillar = yield self.channel.crypted_transfer_decode_dictentry( load, dictkey="pillar", @@ -357,8 +357,8 @@ class RemotePillar(RemotePillarMixin): if self.ext: load["ext"] = self.ext + start = time.monotonic() try: - start = time.monotonic() ret_pillar = self.channel.crypted_transfer_decode_dictentry( load, dictkey="pillar", @@ -1217,7 +1217,7 @@ class Pillar: errors.append( "Failed to load ext_pillar {}: {}".format( key, - exc.__str__(), + exc, ) ) log.error( diff --git a/salt/pillar/foreman.py b/salt/pillar/foreman.py index 62ae03072f2..298aae1ef20 100644 --- a/salt/pillar/foreman.py +++ b/salt/pillar/foreman.py @@ -111,6 +111,7 @@ def ext_pillar(minion_id, pillar, key=None, only=()): # pylint: disable=W0613 headers=headers, verify=verify, cert=(certfile, keyfile), + timeout=120, ) result = resp.json() diff --git a/salt/pillar/pepa.py b/salt/pillar/pepa.py index a35ebb47a09..842a14d49a3 100644 --- a/salt/pillar/pepa.py +++ b/salt/pillar/pepa.py @@ -291,7 +291,7 @@ except ImportError: # Only used when called from a terminal log = None if __name__ == "__main__": - import argparse # pylint: disable=minimum-python-version + import argparse parser = argparse.ArgumentParser() parser.add_argument("hostname", help="Hostname") @@ -611,11 +611,11 @@ if __name__ == "__main__": log.info("Authenticate REST API") auth = {"username": username, "password": password, "eauth": "pam"} - request = requests.post(args.url + "/login", auth) + request = requests.post(args.url + "/login", auth, timeout=120) if not request.ok: raise RuntimeError( - "Failed to authenticate to SaltStack REST API: {}".format(request.text) + f"Failed to authenticate to SaltStack REST API: {request.text}" ) response = request.json() @@ -623,7 +623,9 @@ if __name__ == "__main__": log.info("Request Grains from REST API") headers = {"X-Auth-Token": token, "Accept": "application/json"} - request = requests.get(args.url + "/minions/" + args.hostname, headers=headers) + request = requests.get( + args.url + "/minions/" + args.hostname, headers=headers, timeout=120 + ) result = request.json().get("return", [{}])[0] if args.hostname not in result: @@ -651,8 +653,8 @@ if __name__ == "__main__": if __opts__["pepa_validate"]: validate(result, __opts__["ext_pillar"][loc]["pepa"]["resource"]) + orig_ignore = salt.utils.yaml.SafeOrderedDumper.ignore_aliases try: - orig_ignore = salt.utils.yaml.SafeOrderedDumper.ignore_aliases salt.utils.yaml.SafeOrderedDumper.ignore_aliases = lambda x, y: True def _print_result(result): diff --git a/salt/pillar/vault.py b/salt/pillar/vault.py index 3e7d06b6f78..6388ab923dd 100644 --- a/salt/pillar/vault.py +++ b/salt/pillar/vault.py @@ -241,5 +241,5 @@ def _get_paths(path_pattern, minion_id, pillar): except KeyError: log.warning("Could not resolve pillar path pattern %s", path_pattern) - log.debug(f"{minion_id} vault pillar paths: {paths}") + log.debug("%s vault pillar paths: %s", minion_id, paths) return paths diff --git a/salt/pillar/vmware_pillar.py b/salt/pillar/vmware_pillar.py index cb93efed0da..41fd89a771d 100644 --- a/salt/pillar/vmware_pillar.py +++ b/salt/pillar/vmware_pillar.py @@ -483,5 +483,5 @@ def _serializer(obj): if isinstance(obj, datetime.datetime): if obj.utcoffset() is not None: obj = obj - obj.utcoffset() - return obj.__str__() + return str(obj) return obj diff --git a/salt/platform/win.py b/salt/platform/win.py index 694238e4fc0..fff1010039b 100644 --- a/salt/platform/win.py +++ b/salt/platform/win.py @@ -15,6 +15,7 @@ import logging import os from ctypes import wintypes +# pylint: disable=3rd-party-module-not-gated import ntsecuritycon import psutil import win32api @@ -23,6 +24,8 @@ import win32process import win32security import win32service +# pylint: enable=3rd-party-module-not-gated + # Set up logging log = logging.getLogger(__name__) @@ -398,7 +401,7 @@ class ContiguousUnicode(ctypes.Structure): @classmethod def from_address_copy(cls, address, size=None): - x = ctypes.Structure.__new__(cls) + x = ctypes.Structure.__new__(cls) # pylint: disable=no-value-for-parameter if size is not None: ctypes.resize(x, size) ctypes.memmove(ctypes.byref(x), address, ctypes.sizeof(x)) diff --git a/salt/proxy/dummy.py b/salt/proxy/dummy.py index d470c1082a7..8656be31d93 100644 --- a/salt/proxy/dummy.py +++ b/salt/proxy/dummy.py @@ -95,7 +95,7 @@ def init(opts): __context__["dummy_proxy"] = {"id": opts["id"]} log.debug("dummy proxy init() called...") with _loaded_state(opts) as state: - state["initialized"] = True + state["initialized"] = True # pylint: disable=unsupported-assignment-operation def initialized(): @@ -113,12 +113,12 @@ def grains(): Make up some grains """ with _loaded_state(__opts__) as state: - if "grains_cache" not in state: - state["grains_cache"] = { - "dummy_grain_1": "one", - "dummy_grain_2": "two", - "dummy_grain_3": "three", - } + # pylint: disable=unsupported-assignment-operation,unsupported-membership-test + state["grains_cache"] = { + "dummy_grain_1": "one", + "dummy_grain_2": "two", + "dummy_grain_3": "three", + } return state["grains_cache"] @@ -127,7 +127,7 @@ def grains_refresh(): Refresh the grains """ with _loaded_state(__opts__) as state: - if "grains_cache" in state: + if "grains_cache" in state: # pylint: disable=unsupported-membership-test state.pop("grains_cache") return grains() @@ -262,7 +262,7 @@ def shutdown(opts): """ log.debug("dummy proxy shutdown() called...") with _loaded_state(__opts__) as state: - if "filename" in state: + if "filename" in state: # pylint: disable=unsupported-membership-test os.unlink(state["filename"]) diff --git a/salt/proxy/philips_hue.py b/salt/proxy/philips_hue.py index 9b846baf096..d3400e3f66a 100644 --- a/salt/proxy/philips_hue.py +++ b/salt/proxy/philips_hue.py @@ -117,9 +117,9 @@ def _query(lamp_id, state, action="", method="GET"): # Because salt.utils.query is that dreadful... :( err = None - url = "{}/lights{}".format( - CONFIG["uri"], lamp_id and "/{}".format(lamp_id) or "" - ) + (action and "/{}".format(action) or "") + url = "{}/lights{}".format(CONFIG["uri"], lamp_id and f"/{lamp_id}" or "") + ( + action and f"/{action}" or "" + ) conn = http.client.HTTPConnection(CONFIG["host"]) if method == "PUT": conn.request(method, url, salt.utils.json.dumps(state)) @@ -130,7 +130,7 @@ def _query(lamp_id, state, action="", method="GET"): if resp.status == http.client.OK: res = salt.utils.json.loads(resp.read()) else: - err = "HTTP error: {}, {}".format(resp.status, resp.reason) + err = f"HTTP error: {resp.status}, {resp.reason}" conn.close() if err: raise CommandExecutionError(err) @@ -175,7 +175,7 @@ def _get_devices(params): raise CommandExecutionError("Parameter ID is required.") return ( - type(params["id"]) == int + isinstance(params["id"], int) and [params["id"]] or [int(dev) for dev in params["id"].split(",")] ) diff --git a/salt/renderers/genshi.py b/salt/renderers/genshi.py index 206cce5a3fe..9a9e57b6711 100644 --- a/salt/renderers/genshi.py +++ b/salt/renderers/genshi.py @@ -4,7 +4,9 @@ Genshi Renderer for Salt try: - from genshi.template import MarkupTemplate, NewTextTemplate, OldTextTemplate + from genshi.template import MarkupTemplate # pylint: disable=no-name-in-module + from genshi.template import NewTextTemplate # pylint: disable=no-name-in-module + from genshi.template import OldTextTemplate # pylint: disable=no-name-in-module HAS_LIBS = True except ImportError: diff --git a/salt/renderers/stateconf.py b/salt/renderers/stateconf.py index 3b0348633af..c93a564f0ed 100644 --- a/salt/renderers/stateconf.py +++ b/salt/renderers/stateconf.py @@ -65,7 +65,7 @@ STATE_FUNC = STATE_NAME = "" def __init__(opts): global STATE_NAME, STATE_FUNC STATE_FUNC = __opts__["stateconf_state_func"] - STATE_NAME = STATE_FUNC.split(".")[0] + STATE_NAME = STATE_FUNC.split(".", maxsplit=1)[0] MOD_BASENAME = os.path.basename(__file__) diff --git a/salt/returners/etcd_return.py b/salt/returners/etcd_return.py index fbac0e169df..fe1d1e4cf22 100644 --- a/salt/returners/etcd_return.py +++ b/salt/returners/etcd_return.py @@ -232,7 +232,7 @@ def get_fun(fun): client, path = _get_conn(__opts__) items = client.get("/".join((path, "minions")), recurse=True) for id, jid in items.items(): - id = str(id).split("/")[-1] + id = str(id).rsplit("/", maxsplit=1)[-1] efun = salt.utils.json.loads( client.get("/".join((path, "jobs", str(jid), id, "fun"))) ) @@ -251,7 +251,7 @@ def get_jids(): items = client.get("/".join((path, "jobs")), recurse=True) for key, value in items.items(): if isinstance(value, dict): # dict means directory - jid = str(key).split("/")[-1] + jid = str(key).rsplit("/", maxsplit=1)[-1] ret.append(jid) return ret @@ -265,7 +265,7 @@ def get_minions(): client, path = _get_conn(__opts__) items = client.get("/".join((path, "minions")), recurse=True) for id, _ in items.items(): - id = str(id).split("/")[-1] + id = str(id).rsplit("/", maxsplit=1)[-1] ret.append(id) return ret diff --git a/salt/returners/influxdb_return.py b/salt/returners/influxdb_return.py index 645218242aa..ff78d2b02d4 100644 --- a/salt/returners/influxdb_return.py +++ b/salt/returners/influxdb_return.py @@ -109,7 +109,7 @@ def _get_version(host, port, user, password): # check the InfluxDB version via the HTTP API try: result = requests.get( - "http://{}:{}/ping".format(host, port), auth=(user, password) + "http://{}:{}/ping".format(host, port), auth=(user, password), timeout=120 ) if influxDBVersionHeader in result.headers: version = result.headers[influxDBVersionHeader] diff --git a/salt/returners/local_cache.py b/salt/returners/local_cache.py index 1530d94ddfc..632e11c22e9 100644 --- a/salt/returners/local_cache.py +++ b/salt/returners/local_cache.py @@ -287,6 +287,7 @@ def get_load(jid): ret = {} load_p = os.path.join(jid_dir, LOAD_P) num_tries = 5 + exc = None for index in range(1, num_tries + 1): with salt.utils.files.fopen(load_p, "rb") as rfh: try: @@ -297,7 +298,8 @@ def get_load(jid): time.sleep(0.25) else: log.critical("Failed to unpack %s", load_p) - raise exc + if exc is not None: + raise exc if ret is None: ret = {} minions_cache = [os.path.join(jid_dir, MINIONS_P)] diff --git a/salt/returners/mysql.py b/salt/returners/mysql.py index 67b44004acf..6ad64bebb36 100644 --- a/salt/returners/mysql.py +++ b/salt/returners/mysql.py @@ -148,10 +148,6 @@ import salt.utils.data import salt.utils.job import salt.utils.json -# Let's not allow PyLint complain about string substitution -# pylint: disable=W1321,E1321 - - try: # Trying to import MySQLdb import MySQLdb @@ -274,7 +270,7 @@ def _get_serv(ret=None, commit=False): pass except OperationalError as exc: raise salt.exceptions.SaltMasterError( - "MySQL returner could not connect to database: {exc}".format(exc=exc) + f"MySQL returner could not connect to database: {exc}" ) cursor = conn.cursor() diff --git a/salt/returners/pgjsonb.py b/salt/returners/pgjsonb.py index d47e9cce8d6..86fd63b7441 100644 --- a/salt/returners/pgjsonb.py +++ b/salt/returners/pgjsonb.py @@ -170,10 +170,6 @@ import salt.returners import salt.utils.data import salt.utils.job -# Let's not allow PyLint complain about string substitution -# pylint: disable=W1321,E1321 - - try: import psycopg2 import psycopg2.extras @@ -225,7 +221,7 @@ def _get_options(ret=None): } _options = salt.returners.get_returner_options( - "returner.{}".format(__virtualname__), + f"returner.{__virtualname__}", ret, attrs, __salt__=__salt__, @@ -258,11 +254,11 @@ def _get_serv(ret=None, commit=False): dbname=_options.get("db"), user=_options.get("user"), password=_options.get("pass"), - **ssl_options + **ssl_options, ) except psycopg2.OperationalError as exc: raise salt.exceptions.SaltMasterError( - "pgjsonb returner could not connect to database: {exc}".format(exc=exc) + f"pgjsonb returner could not connect to database: {exc}" ) if conn.server_version is not None and conn.server_version >= 90500: diff --git a/salt/returners/splunk.py b/salt/returners/splunk.py index df3414bcacf..5e11a550e59 100644 --- a/salt/returners/splunk.py +++ b/salt/returners/splunk.py @@ -210,6 +210,7 @@ class http_event_collector: data=salt.utils.json.dumps(data), headers=headers, verify=self.verify_ssl, + timeout=120, ) # Print debug info if flag set diff --git a/salt/roster/cache.py b/salt/roster/cache.py index a6a117d2d8e..ebae66ba2d5 100644 --- a/salt/roster/cache.py +++ b/salt/roster/cache.py @@ -199,15 +199,21 @@ def _data_lookup(ref, lookup): def _minion_lookup(minion_id, key, minion): grains, pillar, addrs, mine = minion + def _data_lookup_ref(data_id): + if data_id == "pillar": + return pillar + if data_id == "grains": + return grains + if data_id == "mine": + return mine + if key == "id": # Just paste in the minion ID return minion_id elif isinstance(key, dict): # Lookup the key in the dict for data_id, lookup in key.items(): - ref = {"pillar": pillar, "grain": grains, "mine": mine}[data_id] - - for k in _data_lookup(ref, lookup): + for k in _data_lookup(_data_lookup_ref(data_id), lookup): if k: return k @@ -220,7 +226,7 @@ def _minion_lookup(minion_id, key, minion): try: net = ipaddress.ip_network(key, strict=True) except ValueError: - log.error("%s is an invalid CIDR network", net) + log.error("%s is an invalid CIDR network", key) return None for addr in addrs[net.version]: diff --git a/salt/runners/asam.py b/salt/runners/asam.py index 81e547b784b..6014429c792 100644 --- a/salt/runners/asam.py +++ b/salt/runners/asam.py @@ -146,7 +146,7 @@ def _get_asam_configuration(driver_url=""): def _make_post_request(url, data, auth, verify=True): - r = requests.post(url, data=data, auth=auth, verify=verify) + r = requests.post(url, data=data, auth=auth, verify=verify, timeout=120) if r.status_code != requests.codes.ok: r.raise_for_status() else: diff --git a/salt/runners/launchd.py b/salt/runners/launchd.py index ce9be4e3a9c..268668a79a1 100644 --- a/salt/runners/launchd.py +++ b/salt/runners/launchd.py @@ -51,8 +51,8 @@ def write_launchd_plist(program): sys.stderr.write("Supported programs: '{}'\n".format(supported_programs)) sys.exit(-1) - return plist_sample_text.format( - program=program, - python=sys.executable, - script=os.path.join(os.path.dirname(sys.executable), program), - ) + return plist_sample_text.format( + program=program, + python=sys.executable, + script=os.path.join(os.path.dirname(sys.executable), program), + ) diff --git a/salt/runners/pkg.py b/salt/runners/pkg.py index 6a4a06e6109..5d084b45032 100644 --- a/salt/runners/pkg.py +++ b/salt/runners/pkg.py @@ -40,7 +40,7 @@ def list_upgrades(jid, style="group", outputter="nested", ext_source=None): for minion in data: results = data[minion]["return"] for pkg, pkgver in results.items(): - if pkg not in pkgs.keys(): + if pkg not in pkgs: pkgs[pkg] = {pkgver: {"hosts": []}} if pkgver not in pkgs[pkg].keys(): diff --git a/salt/runners/state.py b/salt/runners/state.py index 3baf1b86346..e0e41a659ba 100644 --- a/salt/runners/state.py +++ b/salt/runners/state.py @@ -106,7 +106,9 @@ def orchestrate( orig_user = __opts__["user"] __opts__["user"] = __user__ log.debug( - f"changed opts user from original '{orig_user}' to global user '{__user__}'" + "changed opts user from original '%s' to global user '%s'", + orig_user, + __user__, ) except NameError: log.debug("unable to find global user __user__") diff --git a/salt/runners/vault.py b/salt/runners/vault.py index f7c5ce37f10..12225aea361 100644 --- a/salt/runners/vault.py +++ b/salt/runners/vault.py @@ -84,7 +84,7 @@ def generate_token( if namespace is not None: headers = {"X-Vault-Namespace": namespace} response = requests.post( - url, headers=headers, json=payload, verify=verify + url, headers=headers, json=payload, verify=verify, timeout=120 ) if response.status_code != 200: return {"error": response.reason} @@ -117,7 +117,9 @@ def generate_token( return {"error": "No policies matched minion"} log.trace("Sending token creation request to Vault") - response = requests.post(url, headers=headers, json=payload, verify=verify) + response = requests.post( + url, headers=headers, json=payload, verify=verify, timeout=120 + ) if response.status_code != 200: return {"error": response.reason} @@ -346,7 +348,7 @@ def _selftoken_expired(): # Add Vault namespace to headers if Vault Enterprise enabled if namespace is not None: headers["X-Vault-Namespace"] = namespace - response = requests.get(url, headers=headers, verify=verify) + response = requests.get(url, headers=headers, verify=verify, timeout=120) if response.status_code != 200: return True return False diff --git a/salt/scripts.py b/salt/scripts.py index 176cab56366..3c74fb5a3ef 100644 --- a/salt/scripts.py +++ b/salt/scripts.py @@ -483,16 +483,14 @@ def salt_cloud(): """ The main function for salt-cloud """ - # Define 'salt' global so we may use it after ImportError. Otherwise, - # UnboundLocalError will be raised. - global salt # pylint: disable=W0602 - try: # Late-imports for CLI performance import salt.cloud import salt.cloud.cli except ImportError as e: # No salt cloud on Windows + import salt.defaults.exitcodes + log.error("Error importing salt cloud: %s", e) print("salt-cloud is not available in this system") sys.exit(salt.defaults.exitcodes.EX_UNAVAILABLE) diff --git a/salt/serializers/msgpack.py b/salt/serializers/msgpack.py index 93a3fddeb3a..afcf93c3a39 100644 --- a/salt/serializers/msgpack.py +++ b/salt/serializers/msgpack.py @@ -5,109 +5,42 @@ Implements MsgPack serializer. """ - -import copy import logging import salt.utils.msgpack from salt.serializers import DeserializationError, SerializationError log = logging.getLogger(__name__) -available = salt.utils.msgpack.HAS_MSGPACK -if not available: +__all__ = ["deserialize", "serialize", "available"] - def _fail(): - raise RuntimeError("msgpack is not available") - - def _serialize(obj, **options): - _fail() - - def _deserialize(stream_or_string, **options): - _fail() - -elif salt.utils.msgpack.version >= (1, 0, 0): - - def _serialize(obj, **options): - try: - return salt.utils.msgpack.dumps(obj, **options) - except Exception as error: # pylint: disable=broad-except - raise SerializationError(error) - - def _deserialize(stream_or_string, **options): - try: - options.setdefault("use_list", True) - options.setdefault("raw", False) - return salt.utils.msgpack.loads(stream_or_string, **options) - except Exception as error: # pylint: disable=broad-except - raise DeserializationError(error) - -elif salt.utils.msgpack.version >= (0, 2, 0): - - def _serialize(obj, **options): - try: - return salt.utils.msgpack.dumps(obj, **options) - except Exception as error: # pylint: disable=broad-except - raise SerializationError(error) - - def _deserialize(stream_or_string, **options): - try: - options.setdefault("use_list", True) - options.setdefault("encoding", "utf-8") - return salt.utils.msgpack.loads(stream_or_string, **options) - except Exception as error: # pylint: disable=broad-except - raise DeserializationError(error) - -else: # msgpack.version < 0.2.0 - - def _encoder(obj): - """ - Since OrderedDict is identified as a dictionary, we can't make use of - msgpack custom types, we will need to convert by hand. - - This means iterating through all elements of dictionaries, lists and - tuples. - """ - if isinstance(obj, dict): - data = [(key, _encoder(value)) for key, value in obj.items()] - return dict(data) - elif isinstance(obj, (list, tuple)): - return [_encoder(value) for value in obj] - return copy.copy(obj) - - def _decoder(obj): - return obj - - def _serialize(obj, **options): - try: - obj = _encoder(obj) - return salt.utils.msgpack.dumps(obj, **options) - except Exception as error: # pylint: disable=broad-except - raise SerializationError(error) - - def _deserialize(stream_or_string, **options): - options.setdefault("use_list", True) - try: - obj = salt.utils.msgpack.loads(stream_or_string) - return _decoder(obj) - except Exception as error: # pylint: disable=broad-except - raise DeserializationError(error) +available = True -serialize = _serialize -deserialize = _deserialize - -serialize.__doc__ = """ +def serialize(obj, **options): + """ Serialize Python data to MsgPack. :param obj: the data structure to serialize :param options: options given to lower msgpack module. -""" + """ + try: + return salt.utils.msgpack.dumps(obj, **options) + except Exception as error: # pylint: disable=broad-except + raise SerializationError(error) -deserialize.__doc__ = """ + +def deserialize(stream_or_string, **options): + """ Deserialize any string of stream like object into a Python data structure. :param stream_or_string: stream or string to deserialize. :param options: options given to lower msgpack module. -""" + """ + try: + options.setdefault("use_list", True) + options.setdefault("raw", False) + return salt.utils.msgpack.loads(stream_or_string, **options) + except Exception as error: # pylint: disable=broad-except + raise DeserializationError(error) diff --git a/salt/serializers/yaml.py b/salt/serializers/yaml.py index e8a5e85e4b5..dc1099db448 100644 --- a/salt/serializers/yaml.py +++ b/salt/serializers/yaml.py @@ -90,7 +90,7 @@ class EncryptedString(str): @staticmethod def yaml_dumper(dumper, data): - return dumper.represent_scalar(EncryptedString.yaml_tag, data.__str__()) + return dumper.represent_scalar(EncryptedString.yaml_tag, str(data)) class Loader(BaseLoader): # pylint: disable=W0232 diff --git a/salt/state.py b/salt/state.py index 2e00933c0a4..9cd31e6ab8b 100644 --- a/salt/state.py +++ b/salt/state.py @@ -126,11 +126,9 @@ STATE_INTERNAL_KEYWORDS = STATE_REQUISITE_KEYWORDS.union( ).union(STATE_RUNTIME_KEYWORDS) -def _odict_hashable(self): - return id(self) - - -OrderedDict.__hash__ = _odict_hashable +class HashableOrderedDict(OrderedDict): + def __hash__(self): + return id(self) def split_low_tag(tag): @@ -448,7 +446,7 @@ class Compiler: errors = [] if not isinstance(high, dict): errors.append("High data is not a dictionary and is invalid") - reqs = OrderedDict() + reqs = HashableOrderedDict() if not errors: for name, body in high.items(): try: @@ -1490,7 +1488,7 @@ class State: errors = [] if not isinstance(high, dict): errors.append("High data is not a dictionary and is invalid") - reqs = OrderedDict() + reqs = HashableOrderedDict() for name, body in high.items(): try: if name.startswith("__"): @@ -1570,7 +1568,7 @@ class State: # It is a list, verify that the members of the # list are all single key dicts. else: - reqs[name] = OrderedDict(state=state) + reqs[name] = HashableOrderedDict(state=state) for req in arg[argfirst]: if isinstance(req, str): req = {"id": req} @@ -1945,7 +1943,7 @@ class State: # Not a use requisite_in found = False if name not in extend: - extend[name] = OrderedDict() + extend[name] = HashableOrderedDict() if "." in _state: errors.append( "Invalid requisite in {}: {} for " @@ -2033,7 +2031,7 @@ class State: if key == "prereq_in": # Add prerequired to origin if id_ not in extend: - extend[id_] = OrderedDict() + extend[id_] = HashableOrderedDict() if state not in extend[id_]: extend[id_][state] = [] extend[id_][state].append( @@ -2046,7 +2044,7 @@ class State: ) for ext_id, _req_state in ext_ids: if ext_id not in extend: - extend[ext_id] = OrderedDict() + extend[ext_id] = HashableOrderedDict() if _req_state not in extend[ext_id]: extend[ext_id][_req_state] = [] extend[ext_id][_req_state].append( @@ -2064,7 +2062,7 @@ class State: continue ext_args = state_args(ext_id, _state, high) if ext_id not in extend: - extend[ext_id] = OrderedDict() + extend[ext_id] = HashableOrderedDict() if _req_state not in extend[ext_id]: extend[ext_id][_req_state] = [] ignore_args = req_in_all.union(ext_args) @@ -2093,7 +2091,7 @@ class State: continue loc_args = state_args(id_, state, high) if id_ not in extend: - extend[id_] = OrderedDict() + extend[id_] = HashableOrderedDict() if state not in extend[id_]: extend[id_][state] = [] ignore_args = req_in_all.union(loc_args) @@ -2113,7 +2111,7 @@ class State: continue found = False if name not in extend: - extend[name] = OrderedDict() + extend[name] = HashableOrderedDict() if _state not in extend[name]: extend[name][_state] = [] extend[name]["__env__"] = body["__env__"] @@ -2948,7 +2946,7 @@ class State: " with name [{}]".format(req_key, chunk["name"]) ) except TypeError: - # On Python 2, the above req_val, being an OrderedDict, will raise a KeyError, + # On Python 2, the above req_val, being an HashableOrderedDict, will raise a KeyError, # however on Python 3 it will raise a TypeError # This was found when running tests.unit.test_state.StateCompilerTestCase.test_render_error_on_invalid_requisite raise SaltRenderError( @@ -3070,11 +3068,13 @@ class State: self.opts.get("state_events", True) or fire_event ): if not self.opts.get("master_uri"): - ev_func = ( - lambda ret, tag, preload=None: salt.utils.event.get_master_event( + + def ev_func(ret, tag, preload=None): + with salt.utils.event.get_master_event( self.opts, self.opts["sock_dir"], listen=False - ).fire_event(ret, tag) - ) + ) as _evt: + _evt.fire_event(ret, tag) + else: ev_func = self.functions["event.fire_master"] @@ -3738,8 +3738,8 @@ class LazyAvailStates: def items(self): self._fill() ret = [] - for saltenv, states in self._avail.items(): - ret.append((saltenv, self.__getitem__(saltenv))) + for saltenv in self._avail: + ret.append((saltenv, self[saltenv])) return ret @@ -3756,7 +3756,7 @@ class BaseHighState: self.opts = self.__gen_opts(opts) self.iorder = 10000 self.avail = self.__gather_avail() - self.building_highstate = OrderedDict() + self.building_highstate = HashableOrderedDict() def __gather_avail(self): """ @@ -3990,10 +3990,10 @@ class BaseHighState: environment from the top file will be considered, and it too will be ignored if that environment was defined in the "base" top file. """ - top = DefaultOrderedDict(OrderedDict) + top = DefaultOrderedDict(HashableOrderedDict) # Check base env first as it is authoritative - base_tops = tops.pop("base", DefaultOrderedDict(OrderedDict)) + base_tops = tops.pop("base", DefaultOrderedDict(HashableOrderedDict)) for ctop in base_tops: for saltenv, targets in ctop.items(): if saltenv == "include": @@ -4046,7 +4046,7 @@ class BaseHighState: sections matching a given saltenv, which appear in a different saltenv's top file, will be ignored. """ - top = DefaultOrderedDict(OrderedDict) + top = DefaultOrderedDict(HashableOrderedDict) for cenv, ctops in tops.items(): if all([x == {} for x in ctops]): # No top file found in this env, check the default_top @@ -4127,7 +4127,7 @@ class BaseHighState: states.append(item) return match_type, states - top = DefaultOrderedDict(OrderedDict) + top = DefaultOrderedDict(HashableOrderedDict) for ctops in tops.values(): for ctop in ctops: for saltenv, targets in ctop.items(): @@ -4223,7 +4223,7 @@ class BaseHighState: Returns: {'saltenv': ['state1', 'state2', ...]} """ - matches = DefaultOrderedDict(OrderedDict) + matches = DefaultOrderedDict(HashableOrderedDict) # pylint: disable=cell-var-from-loop for saltenv, body in top.items(): if self.opts["saltenv"]: diff --git a/salt/states/archive.py b/salt/states/archive.py index f3405b6ea0a..8de42988764 100644 --- a/salt/states/archive.py +++ b/salt/states/archive.py @@ -119,7 +119,7 @@ def _update_checksum(path): log.warning( "Failed to update checksum for %s: %s", path, - exc.__str__(), + exc, exc_info=True, ) @@ -1066,7 +1066,7 @@ def extracted( ) except Exception as exc: # pylint: disable=broad-except msg = "Failed to cache {}: {}".format( - salt.utils.url.redact_http_basic_auth(source_match), exc.__str__() + salt.utils.url.redact_http_basic_auth(source_match), exc ) log.exception(msg) ret["comment"] = msg @@ -1208,7 +1208,7 @@ def extracted( else: ret["comment"] = ( "Failed to check for existence of if_missing path " - "({}): {}".format(if_missing, exc.__str__()) + "({}): {}".format(if_missing, exc) ) return ret else: @@ -1237,7 +1237,7 @@ def extracted( # that dir will raise an ENOTDIR OSError. So we # expect these and will only abort here if the # error code is something else. - ret["comment"] = exc.__str__() + ret["comment"] = str(exc) return ret if incorrect_type: @@ -1288,7 +1288,7 @@ def extracted( extraction_needed = True except OSError as exc: if exc.errno != errno.ENOENT: - errors.append(exc.__str__()) + errors.append(str(exc)) if errors: msg = ( "One or more paths existed by were the incorrect " @@ -1369,7 +1369,7 @@ def extracted( ret["changes"].setdefault("removed", []).append(full_path) except OSError as exc: if exc.errno != errno.ENOENT: - errors.append(exc.__str__()) + errors.append(str(exc)) if errors: msg = ( diff --git a/salt/states/boto3_route53.py b/salt/states/boto3_route53.py index 3edbc57a870..56f93256fbe 100644 --- a/salt/states/boto3_route53.py +++ b/salt/states/boto3_route53.py @@ -61,7 +61,6 @@ passed in as a dict, or as a string to pull from pillars or minion config: """ # keep lint from choking # pylint: disable=W0106 -# pylint: disable=E1320 import logging @@ -71,7 +70,7 @@ import salt.utils.data import salt.utils.dictupdate from salt.exceptions import SaltInvocationError -log = logging.getLogger(__name__) # pylint: disable=W1699 +log = logging.getLogger(__name__) def __virtual__(): diff --git a/salt/states/docker_container.py b/salt/states/docker_container.py index 17e11ed2ed7..da18c2c6d17 100644 --- a/salt/states/docker_container.py +++ b/salt/states/docker_container.py @@ -1686,7 +1686,7 @@ def running( if exc.info is not None: return _format_comments(ret, exc.info) else: - ret["comment"] = exc.__str__() + ret["comment"] = str(exc) return ret comments = [] @@ -1753,7 +1753,7 @@ def running( return _format_comments(ret, comments) except Exception as exc: # pylint: disable=broad-except ret["result"] = False - msg = exc.__str__() + msg = str(exc) if ( isinstance(exc, CommandExecutionError) and isinstance(exc.info, dict) @@ -1810,7 +1810,7 @@ def running( # of the network's subnet. An exception will be raised once # you try to start the container, however. ret["result"] = False - comments.append(exc.__str__()) + comments.append(str(exc)) return _format_comments(ret, comments) post_net_connect = __salt__["docker.inspect_container"](temp_container_name) @@ -1943,7 +1943,7 @@ def running( ) disconnected = True except CommandExecutionError as exc: - errors.append(exc.__str__()) + errors.append(str(exc)) if net_name in networks: try: @@ -1952,7 +1952,7 @@ def running( ) connected = True except CommandExecutionError as exc: - errors.append(exc.__str__()) + errors.append(str(exc)) if disconnected: # We succeeded in disconnecting but failed # to reconnect. This can happen if the @@ -2205,7 +2205,7 @@ def run( if exc.info is not None: return _format_comments(ret, exc.info) else: - ret["comment"] = exc.__str__() + ret["comment"] = str(exc) return ret if __opts__["test"]: diff --git a/salt/states/docker_image.py b/salt/states/docker_image.py index 10bca898c3e..6dbce1b7cac 100644 --- a/salt/states/docker_image.py +++ b/salt/states/docker_image.py @@ -247,7 +247,7 @@ def present( try: image_info = __salt__["docker.inspect_image"](full_image) except CommandExecutionError as exc: - msg = exc.__str__() + msg = str(exc) if "404" in msg: # Image not present image_info = None @@ -355,7 +355,7 @@ def present( try: __salt__["docker.inspect_image"](full_image) except CommandExecutionError as exc: - msg = exc.__str__() + msg = str(exc) if "404" not in msg: error = "Failed to inspect image '{}' after it was {}: {}".format( full_image, action, msg diff --git a/salt/states/docker_network.py b/salt/states/docker_network.py index 38e9027a1a2..94ca9696649 100644 --- a/salt/states/docker_network.py +++ b/salt/states/docker_network.py @@ -523,7 +523,7 @@ def present( try: network = __salt__["docker.inspect_network"](name) except CommandExecutionError as exc: - msg = exc.__str__() + msg = str(exc) if "404" in msg: # Network not present network = None @@ -578,7 +578,7 @@ def present( **__utils__["args.clean_kwargs"](**kwargs) ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = exc.__str__() + ret["comment"] = str(exc) return ret # Separate out the IPAM config options and build the IPAM config dict @@ -607,7 +607,7 @@ def present( *ipam_pools, **ipam_kwargs ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = exc.__str__() + ret["comment"] = str(exc) return ret # We'll turn this off if we decide below that creating the network is not @@ -662,7 +662,7 @@ def present( ) except CommandExecutionError as exc: ret["comment"] = "Failed to create temp network for comparison: {}".format( - exc.__str__() + str(exc) ) return ret else: @@ -674,9 +674,7 @@ def present( try: temp_net_info = __salt__["docker.inspect_network"](temp_net_name) except CommandExecutionError as exc: - ret["comment"] = "Failed to inspect temp network: {}".format( - exc.__str__() - ) + ret["comment"] = "Failed to inspect temp network: {}".format(str(exc)) return ret else: temp_net_info["EnableIPv6"] = bool(enable_ipv6) @@ -690,9 +688,8 @@ def present( existing_pool_count = len(network["IPAM"]["Config"]) desired_pool_count = len(temp_net_info["IPAM"]["Config"]) - is_default_pool = ( - lambda x: True if sorted(x) == ["Gateway", "Subnet"] else False - ) + def is_default_pool(x): + return True if sorted(x) == ["Gateway", "Subnet"] else False if ( desired_pool_count == 0 @@ -776,9 +773,7 @@ def present( __salt__["docker.remove_network"](temp_net_name) except CommandExecutionError as exc: ret.setdefault("warnings", []).append( - "Failed to remove temp network '{}': {}.".format( - temp_net_name, exc.__str__() - ) + "Failed to remove temp network '{}': {}.".format(temp_net_name, exc) ) if create_network: @@ -803,9 +798,7 @@ def present( **kwargs ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to create network '{}': {}".format( - name, exc.__str__() - ) + ret["comment"] = "Failed to create network '{}': {}".format(name, exc) return ret else: action = "recreated" if network is not None else "created" @@ -859,14 +852,14 @@ def present( ) except CommandExecutionError as exc: if not connect_kwargs: - errors.append(exc.__str__()) + errors.append(str(exc)) else: # We failed to reconnect with the container's old IP # configuration. Reconnect using automatic IP config. try: __salt__["docker.connect_container_to_network"](cid, name) except CommandExecutionError as exc: - errors.append(exc.__str__()) + errors.append(str(exc)) else: ret["changes"].setdefault( "reconnected" @@ -917,7 +910,7 @@ def absent(name): try: network = __salt__["docker.inspect_network"](name) except CommandExecutionError as exc: - msg = exc.__str__() + msg = str(exc) if "404" in msg: # Network not present network = None diff --git a/salt/states/environ.py b/salt/states/environ.py index fb495d1af44..c561fb899d4 100644 --- a/salt/states/environ.py +++ b/salt/states/environ.py @@ -131,6 +131,7 @@ def setenv( r" Manager\Environment" ) + # pylint: disable=cell-var-from-loop out = __utils__["reg.read_value"]( permanent_hive, permanent_key, _norm_key(key) ) diff --git a/salt/states/file.py b/salt/states/file.py index e36db6f2468..3c6b28ad163 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -567,6 +567,8 @@ def _gen_keep_files(name, require, walk_d=None): like directory or recurse has a clean. """ + walk_ret = set() + def _is_child(path, directory): """ Check whether ``path`` is child of ``directory`` @@ -1233,7 +1235,9 @@ def _shortcut_check( if os.path.isfile(name): with salt.utils.winapi.Com(): - shell = win32com.client.Dispatch("WScript.Shell") + shell = win32com.client.Dispatch( # pylint: disable=used-before-assignment + "WScript.Shell" + ) scut = shell.CreateShortcut(name) state_checks = [scut.TargetPath.lower() == target.lower()] if arguments is not None: @@ -9063,7 +9067,7 @@ def cached( name, saltenv=saltenv, source_hash=source_sum.get("hsum"), use_etag=use_etag ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = salt.utils.url.redact_http_basic_auth(exc.__str__()) + ret["comment"] = salt.utils.url.redact_http_basic_auth(str(exc)) return ret if not local_copy: @@ -9150,7 +9154,7 @@ def not_cached(name, saltenv="base"): try: os.remove(local_copy) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to delete {}: {}".format(local_copy, exc.__str__()) + ret["comment"] = "Failed to delete {}: {}".format(local_copy, exc) else: ret["result"] = True ret["changes"]["deleted"] = True diff --git a/salt/states/git.py b/salt/states/git.py index 0f3f977442e..32a597ec74d 100644 --- a/salt/states/git.py +++ b/salt/states/git.py @@ -144,7 +144,7 @@ def _strip_exc(exc): def _uptodate(ret, target, comments=None, local_changes=False): - ret["comment"] = "Repository {} is up-to-date".format(target) + ret["comment"] = f"Repository {target} is up-to-date" if local_changes: ret["comment"] += ( ", but with uncommitted changes. Set 'force_reset' to True to " @@ -177,7 +177,7 @@ def _fail(ret, msg, comments=None): def _already_cloned(ret, target, branch=None, comments=None): ret["result"] = True ret["comment"] = "Repository already exists at {}{}".format( - target, " and is checked out to branch '{}'".format(branch) if branch else "" + target, f" and is checked out to branch '{branch}'" if branch else "" ) if comments: ret["comment"] += "\n\nChanges {}made: {}".format( @@ -234,10 +234,8 @@ def _not_fast_forward( ret, "Repository would be updated {}{}, but {}. Set 'force_reset' to " "True{} to force this update{}.{}".format( - "from {} to {}".format(pre, post) - if local_changes and pre != post - else "to {}".format(post), - " (after checking out local branch '{}')".format(branch) + f"from {pre} to {post}" if local_changes and pre != post else f"to {post}", + f" (after checking out local branch '{branch}')" if _need_branch_change(branch, local_branch) else "", "this is not a fast-forward merge" @@ -276,7 +274,7 @@ def latest( refspec_branch="*", refspec_tag="*", output_encoding=None, - **kwargs + **kwargs, ): """ Make sure the repository is cloned to the given directory and is @@ -619,9 +617,7 @@ def latest( return _fail(ret, "'target' argument is required") if not rev: - return _fail( - ret, "'{}' is not a valid value for the 'rev' argument".format(rev) - ) + return _fail(ret, f"'{rev}' is not a valid value for the 'rev' argument") if force_reset not in (True, False, "remote-changes"): return _fail( @@ -635,7 +631,7 @@ def latest( if not isinstance(target, str): target = str(target) if not os.path.isabs(target): - return _fail(ret, "target '{}' is not an absolute path".format(target)) + return _fail(ret, f"target '{target}' is not an absolute path") if branch is not None and not isinstance(branch, str): branch = str(branch) if user is not None and not isinstance(user, str): @@ -656,13 +652,9 @@ def latest( ident_path = __salt__["cp.cache_file"](ident_path, __env__) except OSError as exc: log.exception("Failed to cache %s", ident_path) - return _fail( - ret, "identity '{}' does not exist.".format(ident_path) - ) + return _fail(ret, f"identity '{ident_path}' does not exist.") if not os.path.isabs(ident_path): - return _fail( - ret, "identity '{}' is not an absolute path".format(ident_path) - ) + return _fail(ret, f"identity '{ident_path}' is not an absolute path") if https_user is not None and not isinstance(https_user, str): https_user = str(https_user) if https_pass is not None and not isinstance(https_pass, str): @@ -681,7 +673,7 @@ def latest( if os.path.isfile(target): return _fail( ret, - "Target '{}' exists and is a regular file, cannot proceed".format(target), + f"Target '{target}' exists and is a regular file, cannot proceed", ) try: @@ -689,7 +681,7 @@ def latest( name, https_user, https_pass, https_only=True ) except ValueError as exc: - return _fail(ret, exc.__str__()) + return _fail(ret, str(exc)) redacted_fetch_url = salt.utils.url.redact_http_basic_auth(desired_fetch_url) @@ -731,7 +723,7 @@ def latest( output_encoding=output_encoding, ) except CommandExecutionError as exc: - return _fail(ret, "Failed to check remote refs: {}".format(_strip_exc(exc))) + return _fail(ret, f"Failed to check remote refs: {_strip_exc(exc)}") if "HEAD" in all_remote_refs: head_rev = all_remote_refs["HEAD"] @@ -825,7 +817,7 @@ def latest( # remote repo. return _fail( ret, - "No revision matching '{}' exists in the remote repository".format(rev), + f"No revision matching '{rev}' exists in the remote repository", ) git_ver = Version(__salt__["git.version"](versioninfo=False)) @@ -1067,6 +1059,7 @@ def latest( if (not revs_match and not update_head) and ( branch is None or branch == local_branch ): + # pylint: disable=used-before-assignment ret["comment"] = ( "{} is already present and local HEAD ({}) does not " "match, but update_head=False. HEAD has not been " @@ -1200,9 +1193,7 @@ def latest( output_encoding=output_encoding, ) if fetch_url is None: - comments.append( - "Remote '{}' set to {}".format(remote, redacted_fetch_url) - ) + comments.append(f"Remote '{remote}' set to {redacted_fetch_url}") ret["changes"]["new"] = name + " => " + remote else: comments.append( @@ -1217,7 +1208,7 @@ def latest( if __opts__["test"]: actions = [] if not has_remote_rev: - actions.append("Remote '{}' would be fetched".format(remote)) + actions.append(f"Remote '{remote}' would be fetched") if (not revs_match) and ( update_head or (branch is not None and branch != local_branch) ): @@ -1418,7 +1409,7 @@ def latest( else: if fetch_changes: comments.append( - "{} was fetched, resulting in updated refs".format(name) + f"{name} was fetched, resulting in updated refs" ) try: @@ -1518,7 +1509,7 @@ def latest( "as a starting point".format(branch, remote_loc) ) else: - comments.append("'{}' was checked out".format(checkout_rev)) + comments.append(f"'{checkout_rev}' was checked out") if fast_forward is False: __salt__["git.reset"]( @@ -1527,14 +1518,12 @@ def latest( user=user, password=password, output_encoding=output_encoding, - **lfs_opts + **lfs_opts, ) ret["changes"]["forced update"] = True if local_changes: comments.append("Uncommitted changes were discarded") - comments.append( - "Repository was hard-reset to {}".format(remote_loc) - ) + comments.append(f"Repository was hard-reset to {remote_loc}") elif ( fast_forward is True and local_changes and force_reset is not False ): @@ -1595,10 +1584,10 @@ def latest( user=user, password=password, output_encoding=output_encoding, - **lfs_opts + **lfs_opts, ) comments.append( - "Repository was fast-forwarded to {}".format(remote_loc) + f"Repository was fast-forwarded to {remote_loc}" ) else: return _fail( @@ -1615,11 +1604,9 @@ def latest( user=user, password=password, output_encoding=output_encoding, - **lfs_opts - ) - comments.append( - "Repository was reset to {} (fast-forward)".format(rev) + **lfs_opts, ) + comments.append(f"Repository was reset to {rev} (fast-forward)") # TODO: Figure out how to add submodule update info to # test=True return data, and changes dict. @@ -1639,7 +1626,7 @@ def latest( return _failed_submodule_update(ret, exc, comments) elif bare: if __opts__["test"]: - msg = "Bare repository at {} would be fetched".format(target) + msg = f"Bare repository at {target} would be fetched" if ret["changes"]: return _neutral_test(ret, msg) else: @@ -1724,9 +1711,7 @@ def latest( if exc.errno != errno.ENOENT: removal_errors[target_path] = exc if removal_errors: - err_strings = [ - " {}\n {}".format(k, v) for k, v in removal_errors.items() - ] + err_strings = [f" {k}\n {v}" for k, v in removal_errors.items()] return _fail( ret, "Unable to remove\n{}".format("\n".join(err_strings)), @@ -1747,9 +1732,7 @@ def latest( log.debug("Target %s is not found, 'git clone' is required", target) if __opts__["test"]: ret["changes"]["new"] = name + " => " + target - return _neutral_test( - ret, "Repository {} would be cloned to {}".format(name, target) - ) + return _neutral_test(ret, f"Repository {name} would be cloned to {target}") try: clone_opts = ["--mirror"] if mirror else ["--bare"] if bare else [] if remote != "origin": @@ -1774,7 +1757,7 @@ def latest( output_encoding=output_encoding, ) except CommandExecutionError as exc: - msg = "Clone failed: {}".format(_strip_exc(exc)) + msg = f"Clone failed: {_strip_exc(exc)}" return _fail(ret, msg, comments) ret["changes"]["new"] = name + " => " + target @@ -1799,9 +1782,7 @@ def latest( ) log.error(msg, name) # Disable check for string substitution - return _fail( - ret, msg % "Repository", comments - ) # pylint: disable=E1321 + return _fail(ret, msg % "Repository", comments) else: if remote_rev_type == "tag" and rev not in __salt__[ "git.list_tags" @@ -1813,7 +1794,7 @@ def latest( ): return _fail( ret, - "Revision '{}' does not exist in clone".format(rev), + f"Revision '{rev}' does not exist in clone", comments, ) @@ -1872,7 +1853,7 @@ def latest( password=password, output_encoding=output_encoding, ) - comments.append("Repository was reset to {}".format(remote_loc)) + comments.append(f"Repository was reset to {remote_loc}") try: upstream = __salt__["git.rev_parse"]( @@ -2110,7 +2091,7 @@ def present( else: salt.utils.files.rm_rf(name) except OSError as exc: - return _fail(ret, "Unable to remove {}: {}".format(name, exc)) + return _fail(ret, f"Unable to remove {name}: {exc}") else: ret["changes"]["forced init"] = True elif os.listdir(name): @@ -2142,9 +2123,9 @@ def present( actions = ["Initialized {}repository in {}".format("bare " if bare else "", name)] if template: - actions.append("Template directory set to {}".format(template)) + actions.append(f"Template directory set to {template}") if separate_git_dir: - actions.append("Gitdir set to {}".format(separate_git_dir)) + actions.append(f"Gitdir set to {separate_git_dir}") message = ". ".join(actions) if len(actions) > 1: message += "." @@ -2170,7 +2151,7 @@ def detached( https_user=None, https_pass=None, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2016.3.0 @@ -2261,14 +2242,10 @@ def detached( return _fail(ret, salt.utils.args.invalid_kwargs(kwargs, raise_exc=False)) if not rev: - return _fail( - ret, "'{}' is not a valid value for the 'rev' argument".format(rev) - ) + return _fail(ret, f"'{rev}' is not a valid value for the 'rev' argument") if not target: - return _fail( - ret, "'{}' is not a valid value for the 'target' argument".format(rev) - ) + return _fail(ret, f"'{rev}' is not a valid value for the 'target' argument") # Ensure that certain arguments are strings to ensure that comparisons work if not isinstance(rev, str): @@ -2277,7 +2254,7 @@ def detached( if not isinstance(target, str): target = str(target) if not os.path.isabs(target): - return _fail(ret, "Target '{}' is not an absolute path".format(target)) + return _fail(ret, f"Target '{target}' is not an absolute path") if user is not None and not isinstance(user, str): user = str(user) if remote is not None and not isinstance(remote, str): @@ -2294,13 +2271,9 @@ def detached( ident_path = __salt__["cp.cache_file"](ident_path) except OSError as exc: log.error("Failed to cache %s: %s", ident_path, exc) - return _fail( - ret, "Identity '{}' does not exist.".format(ident_path) - ) + return _fail(ret, f"Identity '{ident_path}' does not exist.") if not os.path.isabs(ident_path): - return _fail( - ret, "Identity '{}' is not an absolute path".format(ident_path) - ) + return _fail(ret, f"Identity '{ident_path}' is not an absolute path") if https_user is not None and not isinstance(https_user, str): https_user = str(https_user) if https_pass is not None and not isinstance(https_pass, str): @@ -2309,7 +2282,7 @@ def detached( if os.path.isfile(target): return _fail( ret, - "Target '{}' exists and is a regular file, cannot proceed".format(target), + f"Target '{target}' exists and is a regular file, cannot proceed", ) try: @@ -2317,7 +2290,7 @@ def detached( name, https_user, https_pass, https_only=True ) except ValueError as exc: - return _fail(ret, exc.__str__()) + return _fail(ret, str(exc)) redacted_fetch_url = salt.utils.url.redact_http_basic_auth(desired_fetch_url) @@ -2377,9 +2350,7 @@ def detached( current_fetch_url = remotes[remote]["fetch"] if __opts__["test"]: - return _neutral_test( - ret, "Remote {} would be set to {}".format(remote, name) - ) + return _neutral_test(ret, f"Remote {remote} would be set to {name}") __salt__["git.remote_set"]( target, @@ -2427,9 +2398,7 @@ def detached( if exc.errno != errno.ENOENT: removal_errors[target_path] = exc if removal_errors: - err_strings = [ - " {}\n {}".format(k, v) for k, v in removal_errors.items() - ] + err_strings = [f" {k}\n {v}" for k, v in removal_errors.items()] return _fail( ret, "Unable to remove\n{}".format("\n".join(err_strings)), @@ -2449,9 +2418,7 @@ def detached( log.debug("Target %s is not found, 'git clone' is required", target) if __opts__["test"]: - return _neutral_test( - ret, "Repository {} would be cloned to {}".format(name, target) - ) + return _neutral_test(ret, f"Repository {name} would be cloned to {target}") try: clone_opts = ["--no-checkout"] if remote != "origin": @@ -2469,7 +2436,7 @@ def detached( saltenv=__env__, output_encoding=output_encoding, ) - comments.append("{} cloned to {}".format(name, target)) + comments.append(f"{name} cloned to {target}") except Exception as exc: # pylint: disable=broad-except log.error("Unexpected exception in git.detached state", exc_info=True) @@ -2481,7 +2448,7 @@ def detached( # Repository exists and is ready for fetch/checkout refspecs = [ - "refs/heads/*:refs/remotes/{}/*".format(remote), + f"refs/heads/*:refs/remotes/{remote}/*", "+refs/tags/*:refs/tags/*", ] if hash_exists_locally or fetch_remote is False: @@ -2489,9 +2456,7 @@ def detached( else: # Fetch refs from remote if __opts__["test"]: - return _neutral_test( - ret, "Repository remote {} would be fetched".format(remote) - ) + return _neutral_test(ret, f"Repository remote {remote} would be fetched") try: fetch_changes = __salt__["git.fetch"]( target, @@ -2511,7 +2476,7 @@ def detached( else: if fetch_changes: comments.append( - "Remote {} was fetched, resulting in updated refs".format(remote) + f"Remote {remote} was fetched, resulting in updated refs" ) # get refs and checkout @@ -2522,7 +2487,7 @@ def detached( ): checkout_commit_id = rev else: - return _fail(ret, "Revision '{}' does not exist".format(rev)) + return _fail(ret, f"Revision '{rev}' does not exist") else: try: all_remote_refs = __salt__["git.remote_refs"]( @@ -2543,17 +2508,15 @@ def detached( elif "refs/tags/" + rev in all_remote_refs: checkout_commit_id = all_remote_refs["refs/tags/" + rev] else: - return _fail(ret, "Revision '{}' does not exist".format(rev)) + return _fail(ret, f"Revision '{rev}' does not exist") except CommandExecutionError as exc: - return _fail( - ret, "Failed to list refs for {}: {}".format(remote, _strip_exc(exc)) - ) + return _fail(ret, f"Failed to list refs for {remote}: {_strip_exc(exc)}") if hard_reset: if __opts__["test"]: return _neutral_test( - ret, "Hard reset to HEAD would be performed on {}".format(target) + ret, f"Hard reset to HEAD would be performed on {target}" ) __salt__["git.reset"]( target, @@ -2585,9 +2548,7 @@ def detached( password=password, output_encoding=output_encoding, ) - comments.append( - "Commit ID {} was checked out at {}".format(checkout_commit_id, target) - ) + comments.append(f"Commit ID {checkout_commit_id} was checked out at {target}") try: new_rev = __salt__["git.revision"]( @@ -2734,7 +2695,7 @@ def cloned( comment = "{} would be cloned to {}{}".format( name, target, - " with branch '{}'".format(branch) if branch is not None else "", + f" with branch '{branch}'" if branch is not None else "", ) return _neutral_test(ret, comment) clone_opts = ["--branch", branch] if branch is not None else None @@ -2751,14 +2712,14 @@ def cloned( output_encoding=output_encoding, ) except CommandExecutionError as exc: - msg = "Clone failed: {}".format(_strip_exc(exc)) + msg = f"Clone failed: {_strip_exc(exc)}" return _fail(ret, msg, comments) comments.append( "{} cloned to {}{}".format( name, target, - " with branch '{}'".format(branch) if branch is not None else "", + f" with branch '{branch}'" if branch is not None else "", ) ) _clone_changes(ret) @@ -2777,9 +2738,7 @@ def cloned( else: if __opts__["test"]: _branch_changes(ret, current_branch, branch) - return _neutral_test( - ret, "Branch would be changed to '{}'".format(branch) - ) + return _neutral_test(ret, f"Branch would be changed to '{branch}'") try: __salt__["git.rev_parse"]( target, @@ -2809,10 +2768,10 @@ def cloned( output_encoding=output_encoding, ) except CommandExecutionError as exc: - msg = "Failed to change branch to '{}': {}".format(branch, exc) + msg = f"Failed to change branch to '{branch}': {exc}" return _fail(ret, msg, comments) else: - comments.append("Branch changed to '{}'".format(branch)) + comments.append(f"Branch changed to '{branch}'") _branch_changes(ret, current_branch, branch) ret["comment"] = _format_comments(comments) ret["result"] = True @@ -2826,7 +2785,7 @@ def config_unset( user=None, password=None, output_encoding=None, - **kwargs + **kwargs, ): r""" .. versionadded:: 2015.8.0 @@ -2951,7 +2910,7 @@ def config_unset( password=password, ignore_retcode=True, output_encoding=output_encoding, - **{"global": global_} + **{"global": global_}, ) if not pre_matches: @@ -2984,7 +2943,7 @@ def config_unset( if __opts__["test"]: ret["changes"] = pre_matches return _neutral_test( - ret, "{} key(s) would have value(s) unset".format(len(pre_matches)) + ret, f"{len(pre_matches)} key(s) would have value(s) unset" ) if value_regex is None: @@ -3000,7 +2959,7 @@ def config_unset( password=password, ignore_retcode=True, output_encoding=output_encoding, - **{"global": global_} + **{"global": global_}, ) failed = [] @@ -3016,10 +2975,10 @@ def config_unset( user=user, password=password, output_encoding=output_encoding, - **{"global": global_} + **{"global": global_}, ) except CommandExecutionError as exc: - msg = "Failed to unset '{}'".format(key_name) + msg = f"Failed to unset '{key_name}'" if value_regex is not None: msg += " using value_regex '{1}'" msg += ": " + _strip_exc(exc) @@ -3041,7 +3000,7 @@ def config_unset( password=password, ignore_retcode=True, output_encoding=output_encoding, - **{"global": global_} + **{"global": global_}, ) for key_name in pre: @@ -3062,7 +3021,7 @@ def config_unset( password=password, ignore_retcode=True, output_encoding=output_encoding, - **{"global": global_} + **{"global": global_}, ) if post_matches: @@ -3081,7 +3040,7 @@ def config_set( user=None, password=None, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2014.7.0 @@ -3219,7 +3178,7 @@ def config_set( password=password, ignore_retcode=True, output_encoding=output_encoding, - **{"all": True, "global": global_} + **{"all": True, "global": global_}, ) if desired == pre: @@ -3248,7 +3207,7 @@ def config_set( user=user, password=password, output_encoding=output_encoding, - **{"global": global_} + **{"global": global_}, ) except CommandExecutionError as exc: return _fail( diff --git a/salt/states/gpg.py b/salt/states/gpg.py index 4329e6685a6..bde4b3beeda 100644 --- a/salt/states/gpg.py +++ b/salt/states/gpg.py @@ -76,7 +76,7 @@ def present( keys = [keys] for key in keys: - if key in current_keys.keys(): + if key in current_keys: if trust: if trust in _VALID_TRUST_VALUES: if current_keys[key]["trust"] != TRUST_MAP[trust]: diff --git a/salt/states/grafana_dashboard.py b/salt/states/grafana_dashboard.py index a23d0f084e3..0ba2b5f7622 100644 --- a/salt/states/grafana_dashboard.py +++ b/salt/states/grafana_dashboard.py @@ -459,6 +459,7 @@ def _update(dashboard, profile): request_url, headers={"Authorization": "Bearer {}".format(profile.get("grafana_token"))}, json=payload, + timeout=120, ) return response.json() diff --git a/salt/states/grains.py b/salt/states/grains.py index 9e6399dd57f..fadc518a254 100644 --- a/salt/states/grains.py +++ b/salt/states/grains.py @@ -296,7 +296,7 @@ def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): comments.append( "Value {1} in grain {0} is set to be deleted".format(name, val) ) - if "deleted" not in ret["changes"].keys(): + if "deleted" not in ret["changes"]: ret["changes"] = {"deleted": []} ret["changes"]["deleted"].append(val) elif val in grain: @@ -304,7 +304,7 @@ def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): comments.append( "Value {1} was deleted from grain {0}".format(name, val) ) - if "deleted" not in ret["changes"].keys(): + if "deleted" not in ret["changes"]: ret["changes"] = {"deleted": []} ret["changes"]["deleted"].append(val) ret["comment"] = "\n".join(comments) diff --git a/salt/states/ldap.py b/salt/states/ldap.py index 227182b828b..9b88c96918f 100644 --- a/salt/states/ldap.py +++ b/salt/states/ldap.py @@ -314,6 +314,7 @@ def managed(name, entries, connect_spec=None): o = old.get(dn, {}) n = new.get(dn, {}) + op = None try: # perform the operation if o: diff --git a/salt/states/netsnmp.py b/salt/states/netsnmp.py index 54dbf7887d3..a0f0d50b5f5 100644 --- a/salt/states/netsnmp.py +++ b/salt/states/netsnmp.py @@ -116,7 +116,7 @@ def _clear_community_details(community_details): _mode = community_details.get["mode"] = community_details.get("mode").lower() - if _mode in _COMMUNITY_MODE_MAP.keys(): + if _mode in _COMMUNITY_MODE_MAP: community_details["mode"] = _COMMUNITY_MODE_MAP.get(_mode) if community_details["mode"] not in ["ro", "rw"]: @@ -201,7 +201,7 @@ def _create_diff_action(diff, diff_key, key, value): DRY to build diff parts (added, removed, updated). """ - if diff_key not in diff.keys(): + if diff_key not in diff: diff[diff_key] = {} diff[diff_key][key] = value diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index 9430ea457ce..f8447ec350c 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -355,7 +355,10 @@ def _pep440_version_cmp(pkg1, pkg2, ignore_epoch=False): "The pkg_resources packages was not loaded. Please install setuptools." ) return None - normalize = lambda x: str(x).split("!", 1)[-1] if ignore_epoch else str(x) + + def normalize(x): + return str(x).split("!", 1)[-1] if ignore_epoch else str(x) + pkg1 = normalize(pkg1) pkg2 = normalize(pkg2) @@ -368,7 +371,7 @@ def _pep440_version_cmp(pkg1, pkg2, ignore_epoch=False): return 1 except Exception as exc: # pylint: disable=broad-except logger.exception( - f'Comparison of package versions "{pkg1}" and "{pkg2}" failed: {exc}' + 'Comparison of package versions "%s" and "%s" failed: %s', pkg1, pkg2, exc ) return None @@ -735,11 +738,13 @@ def installed( # prepro = lambda pkg: pkg if type(pkg) == str else \ # ' '.join((pkg.items()[0][0], pkg.items()[0][1].replace(',', ';'))) # pkgs = ','.join([prepro(pkg) for pkg in pkgs]) - prepro = ( - lambda pkg: pkg - if isinstance(pkg, str) - else " ".join((pkg.items()[0][0], pkg.items()[0][1])) - ) + def prepro(pkg): + return ( + pkg + if isinstance(pkg, str) + else " ".join((pkg.items()[0][0], pkg.items()[0][1])) + ) + pkgs = [prepro(pkg) for pkg in pkgs] ret = {"name": ";".join(pkgs), "result": None, "comment": "", "changes": {}} @@ -862,7 +867,8 @@ def installed( # If we fail, then just send False, and we'll try again in the next function call except Exception as exc: # pylint: disable=broad-except logger.exception( - f"Pre-caching of PIP packages during states.pip.installed failed by exception from pip.list: {exc}" + "Pre-caching of PIP packages during states.pip.installed failed by exception from pip.list: %s", + exc, ) pip_list = False diff --git a/salt/states/pkg.py b/salt/states/pkg.py index 08ddd83b82e..908d3711b07 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -3943,7 +3943,7 @@ def unheld(name, version=None, pkgs=None, all=False, **kwargs): (pkg_name, pkg_ver) = next(iter(pkg.items())) dpkgs.update({pkg_name: pkg_ver}) else: - dpkgs.update({pkg: None}) + dpkgs.update({pkg: None}) # pylint: disable=unhashable-member ret = {"name": name, "changes": {}, "result": True, "comment": ""} comments = [] diff --git a/salt/states/probes.py b/salt/states/probes.py index 2b5c566caf0..6adc6183f4e 100644 --- a/salt/states/probes.py +++ b/salt/states/probes.py @@ -80,7 +80,7 @@ def _expand_probes(probes, defaults): expected_probes = {} for probe_name, probe_test in probes.items(): - if probe_name not in expected_probes.keys(): + if probe_name not in expected_probes: expected_probes[probe_name] = {} probe_defaults = probe_test.pop("defaults", {}) for test_name, test_details in probe_test.items(): @@ -97,7 +97,7 @@ def _expand_probes(probes, defaults): expected_test_details.update( test_details ) # update with the actual config of the test - if test_name not in expected_probes[probe_name].keys(): + if test_name not in expected_probes[probe_name]: expected_probes[probe_name][test_name] = expected_test_details return expected_probes @@ -167,12 +167,12 @@ def _compare_probes(configured_probes, expected_probes): # new tests for common probes for test_name in new_tests_keys_set: - if probe_name not in new_probes.keys(): + if probe_name not in new_probes: new_probes[probe_name] = {} new_probes[probe_name].update({test_name: probe_tests.pop(test_name)}) # old tests for common probes for test_name in remove_tests_keys_set: - if probe_name not in remove_probes.keys(): + if probe_name not in remove_probes: remove_probes[probe_name] = {} remove_probes[probe_name].update( {test_name: configured_probe_tests.pop(test_name)} @@ -182,7 +182,7 @@ def _compare_probes(configured_probes, expected_probes): configured_test_params = configured_probe_tests.get(test_name, {}) # if test params are different, probe goes to update probes dict! if test_params != configured_test_params: - if probe_name not in update_probes.keys(): + if probe_name not in update_probes: update_probes[probe_name] = {} update_probes[probe_name].update({test_name: test_params}) diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py index 386c5811ceb..d904da011d0 100644 --- a/salt/states/saltmod.py +++ b/salt/states/saltmod.py @@ -782,7 +782,9 @@ def runner(name, **kwargs): try: kwargs["__pub_user"] = __user__ log.debug( - f"added __pub_user to kwargs using dunder user '{__user__}', kwargs '{kwargs}'" + "added __pub_user to kwargs using dunder user '%s', kwargs '%s'", + __user__, + kwargs, ) except NameError: log.warning("unable to find user for fire args event due to missing __user__") diff --git a/salt/states/win_iis.py b/salt/states/win_iis.py index 773f7e7b3ad..4d1162680bd 100644 --- a/salt/states/win_iis.py +++ b/salt/states/win_iis.py @@ -502,7 +502,7 @@ def container_setting(name, container, settings=None): # map identity type from numeric to string for comparing if ( setting == "processModel.identityType" - and settings[setting] in identityType_map2string.keys() + and settings[setting] in identityType_map2string ): settings[setting] = identityType_map2string[settings[setting]] diff --git a/salt/utils/ansible.py b/salt/utils/ansible.py index b91c931dff6..e0f35146999 100644 --- a/salt/utils/ansible.py +++ b/salt/utils/ansible.py @@ -12,7 +12,7 @@ __virtualname__ = "ansible" log = logging.getLogger(__name__) -def __virtual__(): # pylint: disable=expected-2-blank-lines-found-0 +def __virtual__(): if salt.utils.path.which("ansible-inventory"): return __virtualname__ return (False, "Install `ansible` to use inventory") @@ -24,7 +24,7 @@ def targets(inventory="/etc/ansible/hosts", yaml=False, export=False): Default: /etc/salt/roster """ if not os.path.isfile(inventory): - raise CommandExecutionError("Inventory file not found: {}".format(inventory)) + raise CommandExecutionError(f"Inventory file not found: {inventory}") if not os.path.isabs(inventory): raise CommandExecutionError("Path to inventory file must be an absolute path") @@ -44,6 +44,4 @@ def targets(inventory="/etc/ansible/hosts", yaml=False, export=False): try: return salt.utils.json.loads(salt.utils.stringutils.to_str(inv)) except ValueError: - raise CommandExecutionError( - "Error processing the inventory: {}".format(inv) - ) + raise CommandExecutionError(f"Error processing the inventory: {inv}") diff --git a/salt/utils/args.py b/salt/utils/args.py index 536aea38166..dbc6e7e4081 100644 --- a/salt/utils/args.py +++ b/salt/utils/args.py @@ -49,7 +49,7 @@ def invalid_kwargs(invalid_kwargs, raise_exc=True): """ if invalid_kwargs: if isinstance(invalid_kwargs, dict): - new_invalid = ["{}={}".format(x, y) for x, y in invalid_kwargs.items()] + new_invalid = [f"{x}={y}" for x, y in invalid_kwargs.items()] invalid_kwargs = new_invalid msg = "The following keyword arguments are not valid: {}".format( ", ".join(invalid_kwargs) @@ -236,7 +236,7 @@ def get_function_argspec(func, is_class_method=None): the argspec unless ``is_class_method`` is True. """ if not callable(func): - raise TypeError("{} is not a callable".format(func)) + raise TypeError(f"{func} is not a callable") while hasattr(func, "__wrapped__"): func = func.__wrapped__ @@ -244,7 +244,7 @@ def get_function_argspec(func, is_class_method=None): try: sig = inspect.signature(func) except TypeError: - raise TypeError("Cannot inspect argument list for '{}'".format(func)) + raise TypeError(f"Cannot inspect argument list for '{func}'") # Build a namedtuple which looks like the result of a Python 2 argspec _ArgSpec = namedtuple("ArgSpec", "args varargs keywords defaults") @@ -345,7 +345,10 @@ def split_input(val, mapper=None): Take an input value and split it into a list, returning the resulting list """ if mapper is None: - mapper = lambda x: x + + def mapper(x): + return x + if isinstance(val, list): return list(map(mapper, val)) try: @@ -466,18 +469,18 @@ def format_call( # In case this is being called for a state module "full", # Not a state module, build the name - "{}.{}".format(fun.__module__, fun.__name__), + f"{fun.__module__}.{fun.__name__}", ), ) else: msg = "{} and '{}' are invalid keyword arguments for '{}'".format( - ", ".join(["'{}'".format(e) for e in extra][:-1]), + ", ".join([f"'{e}'" for e in extra][:-1]), list(extra.keys())[-1], ret.get( # In case this is being called for a state module "full", # Not a state module, build the name - "{}.{}".format(fun.__module__, fun.__name__), + f"{fun.__module__}.{fun.__name__}", ), ) @@ -529,7 +532,8 @@ def parse_function(s): key = None word = [] elif token in "]})": - if not brackets or token != {"[": "]", "{": "}", "(": ")"}[brackets.pop()]: + _brackets = {"[": "]", "{": "}", "(": ")"} + if not brackets or token != _brackets[brackets.pop()]: break word.append(token) elif token == "=" and not brackets: diff --git a/salt/utils/atomicfile.py b/salt/utils/atomicfile.py index 574797b77e3..59f7e273715 100644 --- a/salt/utils/atomicfile.py +++ b/salt/utils/atomicfile.py @@ -14,8 +14,12 @@ import salt.utils.win_dacl CAN_RENAME_OPEN_FILE = False if os.name == "nt": # pragma: no cover - _rename = lambda src, dst: False # pylint: disable=C0103 - _rename_atomic = lambda src, dst: False # pylint: disable=C0103 + + def _rename(src, dst): + return False + + def _rename_atomic(src, dst): + return False try: import ctypes diff --git a/salt/utils/aws.py b/salt/utils/aws.py index fead9cf7ac6..1231661d970 100644 --- a/salt/utils/aws.py +++ b/salt/utils/aws.py @@ -240,7 +240,14 @@ def assumed_creds(prov_dict, role_arn, location=None): requesturl="https://sts.amazonaws.com/", ) headers["Accept"] = "application/json" - result = requests.request("GET", requesturl, headers=headers, data="", verify=True) + result = requests.request( + "GET", + requesturl, + headers=headers, + data="", + verify=True, + timeout=AWS_METADATA_TIMEOUT, + ) if result.status_code >= 400: log.info("AssumeRole response: %s", result.content) @@ -511,7 +518,10 @@ def query( log.trace("AWS Request Parameters: %s", params_with_headers) try: result = requests.get( - requesturl, headers=headers, params=params_with_headers + requesturl, + headers=headers, + params=params_with_headers, + timeout=AWS_METADATA_TIMEOUT, ) log.debug("AWS Response Status Code: %s", result.status_code) log.trace("AWS Response Text: %s", result.text) diff --git a/salt/utils/cache.py b/salt/utils/cache.py index 88e7fa24000..02c89b28bba 100644 --- a/salt/utils/cache.py +++ b/salt/utils/cache.py @@ -99,7 +99,7 @@ class CacheDisk(CacheDict): return if time.time() - self._key_cache_time[key] > self._ttl: del self._key_cache_time[key] - self._dict.__delitem__(key) + del self._dict[key] def __contains__(self, key): self._enforce_ttl_key(key) @@ -365,7 +365,7 @@ def verify_cache_version(cache_path): file.seek(0) data = "\n".join(file.readlines()) if data != salt.version.__version__: - log.warning(f"Cache version mismatch clearing: {repr(cache_path)}") + log.warning("Cache version mismatch clearing: %s", repr(cache_path)) file.truncate(0) file.write(salt.version.__version__) for item in os.listdir(cache_path): diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py index 3e026a0bb57..5a1660cfd6a 100644 --- a/salt/utils/cloud.py +++ b/salt/utils/cloud.py @@ -2120,9 +2120,7 @@ def _exec_ssh_cmd(cmd, error_msg=None, allow_failure=False, **kwargs): return proc.exitstatus except salt.utils.vt.TerminalException as err: trace = traceback.format_exc() - log.error( - error_msg.format(cmd, err, trace) - ) # pylint: disable=str-format-in-logging + log.error(error_msg.format(cmd, err, trace)) finally: proc.close(terminate=True, kill=True) # Signal an error @@ -2969,7 +2967,7 @@ def update_bootstrap(config, url=None): "Python requests library to be installed" ) } - req = requests.get(url) + req = requests.get(url, timeout=120) if req.status_code != 200: return { "error": ( diff --git a/salt/utils/compat.py b/salt/utils/compat.py index 0579a7f5e62..d9313e1b408 100644 --- a/salt/utils/compat.py +++ b/salt/utils/compat.py @@ -38,12 +38,10 @@ def deepcopy_bound(name): """ def _deepcopy_method(x, memo): - # pylint: disable=incompatible-py3-code return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class) - # pylint: enable=incompatible-py3-code + pre_dispatch = copy._deepcopy_dispatch try: - pre_dispatch = copy._deepcopy_dispatch copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method ret = copy.deepcopy(name) finally: diff --git a/salt/utils/configparser.py b/salt/utils/configparser.py index 6a3b1e689ea..10e3c889ef0 100644 --- a/salt/utils/configparser.py +++ b/salt/utils/configparser.py @@ -3,18 +3,12 @@ Custom configparser classes """ import re +from collections import OrderedDict from configparser import * # pylint: disable=no-name-in-module,wildcard-import,unused-wildcard-import import salt.utils.stringutils -try: - from collections import OrderedDict as _default_dict -except ImportError: - # fallback for setup.py which hasn't yet built _collections - _default_dict = dict - -# pylint: disable=string-substitution-usage-error class GitConfigParser(RawConfigParser): """ Custom ConfigParser which reads and writes git config files. @@ -47,7 +41,7 @@ class GitConfigParser(RawConfigParser): def __init__( self, defaults=None, - dict_type=_default_dict, + dict_type=OrderedDict, allow_no_value=True, ): """ @@ -269,7 +263,7 @@ class GitConfigParser(RawConfigParser): fp_.write(convert("[%s]\n" % self.DEFAULTSECT)) for (key, value) in self._defaults.items(): value = salt.utils.stringutils.to_unicode(value).replace("\n", "\n\t") - fp_.write(convert("{} = {}\n".format(key, value))) + fp_.write(convert(f"{key} = {value}\n")) for section in self._sections: fp_.write(convert("[%s]\n" % section)) for (key, value) in self._sections[section].items(): diff --git a/salt/utils/data.py b/salt/utils/data.py index 0235551462f..40c79e3418a 100644 --- a/salt/utils/data.py +++ b/salt/utils/data.py @@ -1049,9 +1049,14 @@ def repack_dictlist(data, strict=False, recurse=False, key_cb=None, val_cb=None) return {} if key_cb is None: - key_cb = lambda x: x + + def key_cb(x): + return x + if val_cb is None: - val_cb = lambda x, y: y + + def val_cb(x, y): + return y valid_non_dict = ((str,), (int,), float) if isinstance(data, list): diff --git a/salt/utils/dns.py b/salt/utils/dns.py index dc0d680c773..271fd79553e 100644 --- a/salt/utils/dns.py +++ b/salt/utils/dns.py @@ -123,7 +123,7 @@ def _to_port(port): assert 1 <= port <= 65535 return port except (ValueError, AssertionError): - raise ValueError("Invalid port {}".format(port)) + raise ValueError(f"Invalid port {port}") def _tree(domain, tld=False): @@ -276,24 +276,24 @@ def _lookup_dig(name, rdtype, timeout=None, servers=None, secure=None): :param servers: [] of servers to use :return: [] of records or False if error """ - cmd = "dig {} -t {} ".format(DIG_OPTIONS, rdtype) + cmd = f"dig {DIG_OPTIONS} -t {rdtype} " if servers: - cmd += "".join(["@{} ".format(srv) for srv in servers]) + cmd += "".join([f"@{srv} " for srv in servers]) if timeout is not None: if servers: timeout = int(float(timeout) / len(servers)) else: timeout = int(timeout) - cmd += "+time={} ".format(timeout) + cmd += f"+time={timeout} " if secure: cmd += "+dnssec +adflag " cmd = __salt__["cmd.run_all"]( - "{} {}".format(cmd, name), python_shell=False, output_loglevel="quiet" + f"{cmd} {name}", python_shell=False, output_loglevel="quiet" ) if "ignoring invalid type" in cmd["stderr"]: - raise ValueError("Invalid DNS type {}".format(rdtype)) + raise ValueError(f"Invalid DNS type {rdtype}") elif cmd["retcode"] != 0: log.warning( "dig returned (%s): %s", @@ -333,9 +333,9 @@ def _lookup_drill(name, rdtype, timeout=None, servers=None, secure=None): cmd = "drill " if secure: cmd += "-D -o ad " - cmd += "{} {} ".format(rdtype, name) + cmd += f"{rdtype} {name} " if servers: - cmd += "".join(["@{} ".format(srv) for srv in servers]) + cmd += "".join([f"@{srv} " for srv in servers]) cmd = __salt__["cmd.run_all"]( cmd, timeout=timeout, python_shell=False, output_loglevel="quiet" ) @@ -364,7 +364,7 @@ def _lookup_drill(name, rdtype, timeout=None, servers=None, secure=None): validated = True continue elif l_type != rdtype: - raise ValueError("Invalid DNS type {}".format(rdtype)) + raise ValueError(f"Invalid DNS type {rdtype}") res.append(_data_clean(l_rec)) @@ -385,10 +385,12 @@ def _lookup_gai(name, rdtype, timeout=None): :param timeout: ignored :return: [] of addresses or False if error """ - try: - sock_t = {"A": socket.AF_INET, "AAAA": socket.AF_INET6}[rdtype] - except KeyError: - raise ValueError("Invalid DNS type {} for gai lookup".format(rdtype)) + if rdtype == "A": + sock_t = socket.AF_INET + elif rdtype == "AAAA": + sock_t = socket.AF_INET6 + else: + raise ValueError(f"Invalid DNS type {rdtype} for gai lookup") if timeout: log.info("Ignoring timeout on gai resolver; fix resolv.conf to do that") @@ -412,18 +414,18 @@ def _lookup_host(name, rdtype, timeout=None, server=None): :param timeout: server response wait :return: [] of records or False if error """ - cmd = "host -t {} ".format(rdtype) + cmd = f"host -t {rdtype} " if timeout: - cmd += "-W {} ".format(int(timeout)) + cmd += f"-W {int(timeout)} " cmd += name if server is not None: - cmd += " {}".format(server) + cmd += f" {server}" cmd = __salt__["cmd.run_all"](cmd, python_shell=False, output_loglevel="quiet") if "invalid type" in cmd["stderr"]: - raise ValueError("Invalid DNS type {}".format(rdtype)) + raise ValueError(f"Invalid DNS type {rdtype}") elif cmd["retcode"] != 0: log.warning("host returned (%s): %s", cmd["retcode"], cmd["stderr"]) return False @@ -470,7 +472,7 @@ def _lookup_dnspython(name, rdtype, timeout=None, servers=None, secure=None): ] return res except dns.rdatatype.UnknownRdatatype: - raise ValueError("Invalid DNS type {}".format(rdtype)) + raise ValueError(f"Invalid DNS type {rdtype}") except ( dns.resolver.NXDOMAIN, dns.resolver.YXDOMAIN, @@ -489,12 +491,12 @@ def _lookup_nslookup(name, rdtype, timeout=None, server=None): :param server: server to query :return: [] of records or False if error """ - cmd = "nslookup -query={} {}".format(rdtype, name) + cmd = f"nslookup -query={rdtype} {name}" if timeout is not None: - cmd += " -timeout={}".format(int(timeout)) + cmd += f" -timeout={int(timeout)}" if server is not None: - cmd += " {}".format(server) + cmd += f" {server}" cmd = __salt__["cmd.run_all"](cmd, python_shell=False, output_loglevel="quiet") @@ -511,7 +513,7 @@ def _lookup_nslookup(name, rdtype, timeout=None, server=None): try: line = next(lookup_res) if "unknown query type" in line: - raise ValueError("Invalid DNS type {}".format(rdtype)) + raise ValueError(f"Invalid DNS type {rdtype}") while True: if name in line: @@ -581,7 +583,6 @@ def lookup( rdtype = rdtype.upper() - # pylint: disable=bad-whitespace,multiple-spaces-before-keyword query_methods = ( ("gai", _lookup_gai, not any((rdtype not in ("A", "AAAA"), servers, secure))), ("dnspython", _lookup_dnspython, HAS_DNSPYTHON), @@ -590,7 +591,6 @@ def lookup( ("host", _lookup_host, HAS_HOST and not secure), ("nslookup", _lookup_nslookup, HAS_NSLOOKUP and not secure), ) - # pylint: enable=bad-whitespace,multiple-spaces-before-keyword try: if method == "auto": @@ -895,7 +895,7 @@ def spf_rec(rdata): # It's a modifier mod, val = mech_spec.split("=", 1) if mod in mods: - raise KeyError("Modifier {} can only appear once".format(mod)) + raise KeyError(f"Modifier {mod} can only appear once") mods.add(mod) continue @@ -959,7 +959,7 @@ def srv_name(svc, proto="tcp", domain=None): if domain: domain = "." + domain - return "_{}._{}{}".format(svc, proto, domain) + return f"_{svc}._{proto}{domain}" def srv_rec(rdatas): @@ -1133,7 +1133,7 @@ def services(services_file="/etc/services"): if not curr_desc: pp_res["desc"] = comment elif comment != curr_desc: - pp_res["desc"] = "{}, {}".format(curr_desc, comment) + pp_res["desc"] = f"{curr_desc}, {comment}" res[name] = svc_res for svc, data in res.items(): @@ -1210,7 +1210,7 @@ def parse_resolv(src="/etc/resolv.conf"): ip_addr ) ip_net = ipaddress.ip_network( - "{}{}".format(ip_addr, mask), strict=False + f"{ip_addr}{mask}", strict=False ) if ip_net.version == 6: # TODO diff --git a/salt/utils/dockermod/__init__.py b/salt/utils/dockermod/__init__.py index f703ee7b1e6..00b012b8992 100644 --- a/salt/utils/dockermod/__init__.py +++ b/salt/utils/dockermod/__init__.py @@ -25,11 +25,11 @@ except ImportError: # functions so that we can get argspecs for the container config, host config, # and networking config (see the get_client_args() function). try: - import docker.types + import docker.types # pylint: disable=no-name-in-module except ImportError: pass try: - import docker.utils + import docker.utils # pylint: disable=no-name-in-module except ImportError: pass @@ -241,7 +241,7 @@ def translate_input( pass except Exception as exc: # pylint: disable=broad-except - error_message = exc.__str__() + error_message = str(exc) log.error("Error translating input: '%s'", error_message, exc_info=True) else: error_message = None diff --git a/salt/utils/dockermod/translate/container.py b/salt/utils/dockermod/translate/container.py index b155308bf74..3bc37101f76 100644 --- a/salt/utils/dockermod/translate/container.py +++ b/salt/utils/dockermod/translate/container.py @@ -378,9 +378,7 @@ def port_bindings(val, **kwargs): try: start, end = helpers.get_port_range(container_port) except ValueError as exc: - # Using __str__() to avoid deprecation warning for using - # the message attribute of the ValueError. - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) bind_vals = [ (_format_port(port_num, proto), None) for port_num in range(start, end + 1) @@ -403,9 +401,7 @@ def port_bindings(val, **kwargs): cport_start, cport_end = helpers.get_port_range(container_port) hport_start, hport_end = helpers.get_port_range(bind_parts[0]) except ValueError as exc: - # Using __str__() to avoid deprecation warning for - # using the message attribute of the ValueError. - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) if (hport_end - hport_start) != (cport_end - cport_start): # Port range is mismatched raise SaltInvocationError( @@ -427,9 +423,7 @@ def port_bindings(val, **kwargs): try: cport_start, cport_end = helpers.get_port_range(container_port) except ValueError as exc: - # Using __str__() to avoid deprecation warning for - # using the message attribute of the ValueError. - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) cport_list = list(range(cport_start, cport_end + 1)) if host_port == "": hport_list = [None] * len(cport_list) @@ -437,9 +431,7 @@ def port_bindings(val, **kwargs): try: hport_start, hport_end = helpers.get_port_range(host_port) except ValueError as exc: - # Using __str__() to avoid deprecation warning for - # using the message attribute of the ValueError. - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) hport_list = list(range(hport_start, hport_end + 1)) if (hport_end - hport_start) != (cport_end - cport_start): @@ -526,9 +518,7 @@ def ports(val, **kwargs): # pylint: disable=unused-argument try: range_start, range_end = helpers.get_port_range(item) except ValueError as exc: - # Using __str__() to avoid deprecation warning for using - # the "message" attribute of the ValueError. - raise SaltInvocationError(exc.__str__()) + raise SaltInvocationError(str(exc)) new_ports.update( [helpers.get_port_def(x, proto) for x in range(range_start, range_end + 1)] ) diff --git a/salt/utils/dockermod/translate/helpers.py b/salt/utils/dockermod/translate/helpers.py index f172d080cdc..5d81f89c99e 100644 --- a/salt/utils/dockermod/translate/helpers.py +++ b/salt/utils/dockermod/translate/helpers.py @@ -72,7 +72,7 @@ def get_port_range(port_def): if range_start > range_end: raise ValueError("start > end") except (TypeError, ValueError) as exc: - if exc.__str__() == "start > end": + if str(exc) == "start > end": msg = ( "Start of port range ({}) cannot be greater than end of " "port range ({})".format(range_start, range_end) diff --git a/salt/utils/files.py b/salt/utils/files.py index 3c57cce7132..8071a55d3a4 100644 --- a/salt/utils/files.py +++ b/salt/utils/files.py @@ -322,8 +322,8 @@ def set_umask(mask): # Don't attempt on Windows, or if no mask was passed yield else: + orig_mask = os.umask(mask) # pylint: disable=blacklisted-function try: - orig_mask = os.umask(mask) # pylint: disable=blacklisted-function yield finally: os.umask(orig_mask) # pylint: disable=blacklisted-function @@ -390,7 +390,9 @@ def fopen(*args, **kwargs): ) kwargs["buffering"] = io.DEFAULT_BUFFER_SIZE - f_handle = open(*args, **kwargs) # pylint: disable=resource-leakage + f_handle = open( # pylint: disable=resource-leakage,unspecified-encoding + *args, **kwargs + ) if is_fcntl_available(): # modify the file descriptor on systems with fcntl @@ -649,7 +651,10 @@ def is_text(fp_, blocksize=512): If more than 30% of the chars in the block are non-text, or there are NUL ('\x00') bytes in the block, assume this is a binary file. """ - int2byte = lambda x: bytes((x,)) + + def int2byte(x): + return bytes((x,)) + text_characters = b"".join(int2byte(i) for i in range(32, 127)) + b"\n\r\t\f\b" try: block = fp_.read(blocksize) diff --git a/salt/utils/fsutils.py b/salt/utils/fsutils.py index 7b0eb084f64..96d0cd16bb8 100644 --- a/salt/utils/fsutils.py +++ b/salt/utils/fsutils.py @@ -57,7 +57,10 @@ def _blkid_output(out, fs_type=None): """ Parse blkid output. """ - flt = lambda data: [el for el in data if el.strip()] + + def flt(data): + return [el for el in data if el.strip()] + data = {} for dev_meta in flt(out.split("\n\n")): dev = {} @@ -84,7 +87,10 @@ def _blkid(fs_type=None): :param fs_type: Filter only devices that are formatted by that file system. """ - flt = lambda data: [el for el in data if el.strip()] + + def flt(data): + return [el for el in data if el.strip()] + data = dict() for dev_meta in flt( os.popen("blkid -o full").read().split(os.linesep) diff --git a/salt/utils/functools.py b/salt/utils/functools.py index f1360527723..f4d4cbdb3de 100644 --- a/salt/utils/functools.py +++ b/salt/utils/functools.py @@ -119,9 +119,7 @@ def call_function(salt_function, *args, **kwargs): # function_kwargs is initialized to a dictionary of keyword arguments the function to be run accepts function_kwargs = dict( zip( - argspec.args[ - -len(argspec.defaults or []) : - ], # pylint: disable=incompatible-py3-code + argspec.args[-len(argspec.defaults or []) :], argspec.defaults or [], ) ) diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index a197921f6ef..934794bfab7 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -118,7 +118,7 @@ try: if PYGIT2_VERSION <= Version("0.26.3"): try: import pygit2.ffi - import pygit2.remote + import pygit2.remote # pylint: disable=no-name-in-module except ImportError: # If we couldn't import these, then we're using an old enough # version where ffi isn't in use and this workaround would be @@ -244,12 +244,16 @@ class GitProvider: ): self.opts = opts self.role = role + + def _val_cb(x, y): + return str(y) + self.global_saltenv = salt.utils.data.repack_dictlist( self.opts.get("{}_saltenv".format(self.role), []), strict=True, recurse=True, key_cb=str, - val_cb=lambda x, y: str(y), + val_cb=_val_cb, ) self.conf = copy.deepcopy(per_remote_defaults) # Remove the 'salt://' from the beginning of any globally-defined @@ -473,7 +477,9 @@ class GitProvider: try: self._cache_basename = self.get_checkout_target() except AttributeError: - log.critical(f"__env__ cant generate basename: {self.role} {self.id}") + log.critical( + "__env__ cant generate basename: %s %s", self.role, self.id + ) failhard(self.role) self._cache_full_basename = salt.utils.path.join( self._cache_basehash, self._cache_basename @@ -574,9 +580,9 @@ class GitProvider: """ def _getconf(self, tgt_env="base"): - strip_sep = ( - lambda x: x.rstrip(os.sep) if name in ("root", "mountpoint") else x - ) + def strip_sep(x): + return x.rstrip(os.sep) if name in ("root", "mountpoint") else x + if self.role != "gitfs": return strip_sep(getattr(self, "_" + name)) # Get saltenv-specific configuration @@ -1203,12 +1209,14 @@ class GitProvider: def fetch_request_check(self): fetch_request = salt.utils.path.join(self._salt_working_dir, "fetch_request") if os.path.isfile(fetch_request): - log.debug(f"Fetch request: {self._salt_working_dir}") + log.debug("Fetch request: %s", self._salt_working_dir) try: os.remove(fetch_request) except OSError as exc: log.error( - f"Failed to remove Fetch request: {self._salt_working_dir} {exc}", + "Failed to remove Fetch request: %s %s", + self._salt_working_dir, + exc, exc_info=True, ) self.fetch() @@ -1426,12 +1434,20 @@ class GitPython(GitProvider): tree = tree / self.root(tgt_env) except KeyError: return ret - relpath = lambda path: os.path.relpath(path, self.root(tgt_env)) + + def relpath(path): + return os.path.relpath(path, self.root(tgt_env)) + else: - relpath = lambda path: path - add_mountpoint = lambda path: salt.utils.path.join( - self.mountpoint(tgt_env), path, use_posixpath=True - ) + + def relpath(path): + return path + + def add_mountpoint(path): + return salt.utils.path.join( + self.mountpoint(tgt_env), path, use_posixpath=True + ) + for blob in tree.traverse(): if isinstance(blob, git.Tree): ret.add(add_mountpoint(relpath(blob.path))) @@ -1498,12 +1514,20 @@ class GitPython(GitProvider): tree = tree / self.root(tgt_env) except KeyError: return files, symlinks - relpath = lambda path: os.path.relpath(path, self.root(tgt_env)) + + def relpath(path): + return os.path.relpath(path, self.root(tgt_env)) + else: - relpath = lambda path: path - add_mountpoint = lambda path: salt.utils.path.join( - self.mountpoint(tgt_env), path, use_posixpath=True - ) + + def relpath(path): + return path + + def add_mountpoint(path): + return salt.utils.path.join( + self.mountpoint(tgt_env), path, use_posixpath=True + ) + for file_blob in tree.traverse(): if not isinstance(file_blob, git.Blob): continue @@ -1945,15 +1969,24 @@ class Pygit2(GitProvider): return ret if not isinstance(tree, pygit2.Tree): return ret - relpath = lambda path: os.path.relpath(path, self.root(tgt_env)) + + def relpath(path): + return os.path.relpath(path, self.root(tgt_env)) + else: - relpath = lambda path: path + + def relpath(path): + return path + blobs = [] if tree: _traverse(tree, blobs, self.root(tgt_env)) - add_mountpoint = lambda path: salt.utils.path.join( - self.mountpoint(tgt_env), path, use_posixpath=True - ) + + def add_mountpoint(path): + return salt.utils.path.join( + self.mountpoint(tgt_env), path, use_posixpath=True + ) + for blob in blobs: ret.add(add_mountpoint(relpath(blob))) if self.mountpoint(tgt_env): @@ -2086,15 +2119,24 @@ class Pygit2(GitProvider): return files, symlinks if not isinstance(tree, pygit2.Tree): return files, symlinks - relpath = lambda path: os.path.relpath(path, self.root(tgt_env)) + + def relpath(path): + return os.path.relpath(path, self.root(tgt_env)) + else: - relpath = lambda path: path + + def relpath(path): + return path + blobs = {} if tree: _traverse(tree, blobs, self.root(tgt_env)) - add_mountpoint = lambda path: salt.utils.path.join( - self.mountpoint(tgt_env), path, use_posixpath=True - ) + + def add_mountpoint(path): + return salt.utils.path.join( + self.mountpoint(tgt_env), path, use_posixpath=True + ) + for repo_path in blobs.get("files", []): files.add(add_mountpoint(relpath(repo_path))) for repo_path, link_tgt in blobs.get("symlinks", {}).items(): @@ -2181,9 +2223,12 @@ class Pygit2(GitProvider): if PYGIT2_VERSION >= Version("0.23.2"): self.remotecallbacks = pygit2.RemoteCallbacks(credentials=self.credentials) if not self.ssl_verify: - # Override the certificate_check function with a lambda that + # Override the certificate_check function with another that # just returns True, thus skipping the cert check. - self.remotecallbacks.certificate_check = lambda *args, **kwargs: True + def _certificate_check(*args, **kwargs): + return True + + self.remotecallbacks.certificate_check = _certificate_check else: self.remotecallbacks = None if not self.ssl_verify: @@ -2663,11 +2708,13 @@ class GitBase: pass except OSError as exc: # pylint: disable=broad-except log.error( - f"Failed to make fetch request: {fetch_path} {exc}", + "Failed to make fetch request: %s %s", + fetch_path, + exc, exc_info=True, ) else: - log.error(f"Failed to make fetch request: {fetch_path}") + log.error("Failed to make fetch request: %s", fetch_path) if repo.fetch(): # We can't just use the return value from repo.fetch() # because the data could still have changed if old @@ -3437,7 +3484,7 @@ class GitPillar(GitBase): "Failed to remove existing git_pillar " "mountpoint link %s: %s", lcachelink, - exc.__str__(), + exc, ) wipe_linkdir = False create_link = True @@ -3457,7 +3504,7 @@ class GitPillar(GitBase): log.error( "Failed to os.makedirs() linkdir parent %s: %s", ldirname, - exc.__str__(), + exc, ) return False @@ -3475,7 +3522,7 @@ class GitPillar(GitBase): "Failed to create symlink to %s at path %s: %s", lcachedest, lcachelink, - exc.__str__(), + exc, ) return False except GitLockError: diff --git a/salt/utils/iam.py b/salt/utils/iam.py index dea1e950145..45017df57ef 100644 --- a/salt/utils/iam.py +++ b/salt/utils/iam.py @@ -24,6 +24,7 @@ def _retry_get_url(url, num_retries=10, timeout=5): Based heavily on boto.utils.retry_url """ for i in range(0, num_retries): + exc = None try: result = requests.get(url, timeout=timeout, proxies={"http": ""}) if hasattr(result, "text"): diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index 898c8d3fc0d..f802156ddb8 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -239,9 +239,7 @@ class PrintableDict(OrderedDict): for key, value in self.items(): if isinstance(value, str): # keeps quotes around strings - # pylint: disable=repr-flag-used-in-string output.append(f"{key!r}: {value!r}") - # pylint: enable=repr-flag-used-in-string else: # let default output output.append(f"{key!r}: {value!s}") @@ -252,9 +250,7 @@ class PrintableDict(OrderedDict): for key, value in self.items(): # Raw string formatter required here because this is a repr # function. - # pylint: disable=repr-flag-used-in-string output.append(f"{key!r}: {value!r}") - # pylint: enable=repr-flag-used-in-string return "{" + ", ".join(output) + "}" diff --git a/salt/utils/msazure.py b/salt/utils/msazure.py index 28f8f33cc2f..de4419caacd 100644 --- a/salt/utils/msazure.py +++ b/salt/utils/msazure.py @@ -108,16 +108,14 @@ def put_blob(storage_conn=None, **kwargs): "x_ms_lease_id": kwargs.get("lease_id", None), } if "blob_path" in kwargs: - data = storage_conn.put_block_blob_from_path( + return storage_conn.put_block_blob_from_path( file_path=kwargs["blob_path"], **blob_kwargs ) elif "blob_content" in kwargs: - data = storage_conn.put_block_blob_from_bytes( + return storage_conn.put_block_blob_from_bytes( blob=kwargs["blob_content"], **blob_kwargs ) - return data - def get_blob(storage_conn=None, **kwargs): """ @@ -157,15 +155,13 @@ def get_blob(storage_conn=None, **kwargs): } if "local_path" in kwargs: - data = storage_conn.get_blob_to_path( + return storage_conn.get_blob_to_path( file_path=kwargs["local_path"], open_mode=kwargs.get("open_mode", "wb"), **blob_kwargs ) elif "return_content" in kwargs: - data = storage_conn.get_blob_to_bytes(**blob_kwargs) - - return data + return storage_conn.get_blob_to_bytes(**blob_kwargs) def object_to_dict(obj): diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index b04904c2e14..918eb942ca6 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -15,9 +15,9 @@ import salt.utils.win_functions REQ_ERROR = None try: - import nacl.public - import nacl.secret -except (ImportError, OSError) as e: + import nacl.public # pylint: disable=no-name-in-module + import nacl.secret # pylint: disable=no-name-in-module +except ImportError: REQ_ERROR = ( "PyNaCl import error, perhaps missing python PyNaCl package or should update." ) diff --git a/salt/utils/napalm.py b/salt/utils/napalm.py index 082be2167c9..d78422a7111 100644 --- a/salt/utils/napalm.py +++ b/salt/utils/napalm.py @@ -44,8 +44,11 @@ try: # try importing ConnectionClosedException # from napalm-base # this exception has been introduced only in version 0.24.0 + # pylint: disable=unused-import,no-name-in-module from napalm.base.exceptions import ConnectionClosedException + # pylint: enable=unused-import,no-name-in-module + HAS_CONN_CLOSED_EXC_CLASS = True except ImportError: HAS_CONN_CLOSED_EXC_CLASS = False @@ -93,10 +96,8 @@ def virtual(opts, virtualname, filename): else: return ( False, - '"{vname}"" {filename} cannot be loaded: ' - "NAPALM is not installed: ``pip install napalm``".format( - vname=virtualname, filename="({filename})".format(filename=filename) - ), + f'"{virtualname}" ({filename}) cannot be loaded: ' + "NAPALM is not installed: ``pip install napalm``", ) diff --git a/salt/utils/nb_popen.py b/salt/utils/nb_popen.py index 12cdc39e1b0..7624d609713 100644 --- a/salt/utils/nb_popen.py +++ b/salt/utils/nb_popen.py @@ -24,14 +24,12 @@ import time mswindows = sys.platform == "win32" -try: +if mswindows: import msvcrt import pywintypes from win32file import ReadFile, WriteFile from win32pipe import PeekNamedPipe -except ImportError: - import fcntl log = logging.getLogger(__name__) @@ -180,6 +178,8 @@ class NonBlockingPopen(subprocess.Popen): if conn is None: return None + import fcntl + flags = fcntl.fcntl(conn, fcntl.F_GETFL) if not conn.closed: fcntl.fcntl(conn, fcntl.F_SETFL, flags | os.O_NONBLOCK) diff --git a/salt/utils/network.py b/salt/utils/network.py index 9566f433444..13eaa4835ca 100644 --- a/salt/utils/network.py +++ b/salt/utils/network.py @@ -1722,9 +1722,7 @@ def _netlink_tool_remote_on(port, which_end): valid = False tcp_end = "dst" if which_end == "remote_port" else "src" try: - data = subprocess.check_output( - ["ss", "-ant", tcp_end, ":{}".format(port)] - ) # pylint: disable=minimum-python-version + data = subprocess.check_output(["ss", "-ant", tcp_end, f":{port}"]) except subprocess.CalledProcessError: log.error("Failed ss") raise @@ -1770,9 +1768,7 @@ def _sunos_remotes_on(port, which_end): # pragma: no cover """ remotes = set() try: - data = subprocess.check_output( - ["netstat", "-f", "inet", "-n"] - ) # pylint: disable=minimum-python-version + data = subprocess.check_output(["netstat", "-f", "inet", "-n"]) except subprocess.CalledProcessError: log.error("Failed netstat") raise @@ -1817,8 +1813,8 @@ def _freebsd_remotes_on(port, which_end): # pragma: no cover remotes = set() try: - cmd = salt.utils.args.shlex_split("sockstat -4 -c -p {}".format(port)) - data = subprocess.check_output(cmd) # pylint: disable=minimum-python-version + cmd = salt.utils.args.shlex_split(f"sockstat -4 -c -p {port}") + data = subprocess.check_output(cmd) except subprocess.CalledProcessError as ex: log.error('Failed "sockstat" with returncode = %s', ex.returncode) raise @@ -1879,8 +1875,8 @@ def _netbsd_remotes_on(port, which_end): # pragma: no cover remotes = set() try: - cmd = salt.utils.args.shlex_split("sockstat -4 -c -n -p {}".format(port)) - data = subprocess.check_output(cmd) # pylint: disable=minimum-python-version + cmd = salt.utils.args.shlex_split(f"sockstat -4 -c -n -p {port}") + data = subprocess.check_output(cmd) except subprocess.CalledProcessError as ex: log.error('Failed "sockstat" with returncode = %s', ex.returncode) raise @@ -1932,9 +1928,7 @@ def _openbsd_remotes_on(port, which_end): # pragma: no cover """ remotes = set() try: - data = subprocess.check_output( - ["netstat", "-nf", "inet"] - ) # pylint: disable=minimum-python-version + data = subprocess.check_output(["netstat", "-nf", "inet"]) except subprocess.CalledProcessError as exc: log.error('Failed "netstat" with returncode = %s', exc.returncode) raise @@ -1973,9 +1967,7 @@ def _windows_remotes_on(port, which_end): """ remotes = set() try: - data = subprocess.check_output( - ["netstat", "-n"] - ) # pylint: disable=minimum-python-version + data = subprocess.check_output(["netstat", "-n"]) except subprocess.CalledProcessError: log.error("Failed netstat") raise @@ -2024,7 +2016,7 @@ def _linux_remotes_on(port, which_end): "-iTCP:{:d}".format(port), "-n", "-P", - ] # pylint: disable=minimum-python-version + ] ) except subprocess.CalledProcessError as ex: if ex.returncode == 1: @@ -2089,9 +2081,7 @@ def _aix_remotes_on(port, which_end): # pragma: no cover """ remotes = set() try: - data = subprocess.check_output( - ["netstat", "-f", "inet", "-n"] - ) # pylint: disable=minimum-python-version + data = subprocess.check_output(["netstat", "-f", "inet", "-n"]) except subprocess.CalledProcessError: log.error("Failed netstat") raise @@ -2332,9 +2322,8 @@ def filter_by_networks(values, networks): {{ grains['ipv4'] | filter_by_networks(networks) }} """ - _filter = lambda ips, networks: [ - ip for ip in ips for net in networks if ipaddress.ip_address(ip) in net - ] + def _filter(ips, networks): + return [ip for ip in ips for net in networks if ipaddress.ip_address(ip) in net] if networks is not None: networks = [ipaddress.ip_network(network) for network in networks] diff --git a/salt/utils/odict.py b/salt/utils/odict.py index 76f313fe5be..bf9dd06e448 100644 --- a/salt/utils/odict.py +++ b/salt/utils/odict.py @@ -5,311 +5,16 @@ salt.utils.odict ~~~~~~~~~~~~~~~~ - This is a compatibility/"importability" layer for an ordered dictionary. - Tries to import from the standard library if python >= 2.7, then from the - ``ordereddict`` package available from PyPi, and, as a last resort, - provides an ``OrderedDict`` implementation based on:: - - http://code.activestate.com/recipes/576669/ - - It also implements a DefaultOrderedDict Class that serves as a + Implements a DefaultOrderedDict Class that serves as a combination of ``OrderedDict`` and ``defaultdict`` It's source was submitted here:: http://stackoverflow.com/questions/6190331/ """ - -# pragma: no cover # essentially using Python's OrderDict - - +import copy +from collections import OrderedDict from collections.abc import Callable -try: - # pylint: disable=E0611,minimum-python-version - import collections - - class OrderedDict(collections.OrderedDict): - __hash__ = None - -except (ImportError, AttributeError): - try: - import ordereddict - - class OrderedDict(ordereddict.OrderedDict): # pylint: disable=W0232 - __hash_ = None - - except ImportError: - # {{{ http://code.activestate.com/recipes/576693/ (r9) - # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. - # Passes Python2.7's test suite and incorporates all the latest updates. - - try: - from _thread import get_ident as _get_ident - except ImportError: - from _dummy_thread import get_ident as _get_ident - - # try: - # from _abcoll import KeysView, ValuesView, ItemsView - # except ImportError: - # pass - - class OrderedDict(dict): - "Dictionary that remembers insertion order" - # An inherited dict maps keys to values. - # The inherited dict provides __getitem__, __len__, __contains__, and get. - # The remaining methods are order-aware. - # Big-O running times for all methods are the same as for regular dictionaries. - - # The internal self.__map dictionary maps keys to links in a doubly linked list. - # The circular doubly linked list starts and ends with a sentinel element. - # The sentinel element never gets deleted (this simplifies the algorithm). - # Each link is stored as a list of length three: [PREV, NEXT, KEY]. - __hash_ = None - - def __init__(self, *args, **kwds): # pylint: disable=E1003 - """Initialize an ordered dictionary. Signature is the same as for - regular dictionaries, but keyword arguments are not recommended - because their insertion order is arbitrary. - - """ - super().__init__() - if len(args) > 1: - raise TypeError( - "expected at most 1 arguments, got {}".format(len(args)) - ) - try: - self.__root - except AttributeError: - self.__root = root = [] # sentinel node - root[:] = [root, root, None] - self.__map = {} - self.__update(*args, **kwds) - - def __setitem__(self, key, value, dict_setitem=dict.__setitem__): - "od.__setitem__(i, y) <==> od[i]=y" - # Setting a new item creates a new link which goes at the end of the linked - # list, and the inherited dictionary is updated with the new key/value pair. - if key not in self: - root = self.__root - last = root[0] - last[1] = root[0] = self.__map[key] = [last, root, key] - dict_setitem(self, key, value) - - def __delitem__(self, key, dict_delitem=dict.__delitem__): - "od.__delitem__(y) <==> del od[y]" - # Deleting an existing item uses self.__map to find the link which is - # then removed by updating the links in the predecessor and successor nodes. - dict_delitem(self, key) - link_prev, link_next, key = self.__map.pop(key) - link_prev[1] = link_next - link_next[0] = link_prev - - def __iter__(self): - "od.__iter__() <==> iter(od)" - root = self.__root - curr = root[1] - while curr is not root: - yield curr[2] - curr = curr[1] - - def __reversed__(self): - "od.__reversed__() <==> reversed(od)" - root = self.__root - curr = root[0] - while curr is not root: - yield curr[2] - curr = curr[0] - - def clear(self): - "od.clear() -> None. Remove all items from od." - try: - for node in self.__map.values(): - del node[:] - root = self.__root - root[:] = [root, root, None] - self.__map.clear() - except AttributeError: - pass - dict.clear(self) - - def popitem(self, last=True): - """od.popitem() -> (k, v), return and remove a (key, value) pair. - Pairs are returned in LIFO order if last is true or FIFO order if false. - - """ - if not self: - raise KeyError("dictionary is empty") - root = self.__root - if last: - link = root[0] - link_prev = link[0] - link_prev[1] = root - root[0] = link_prev - else: - link = root[1] - link_next = link[1] - root[1] = link_next - link_next[0] = root - key = link[2] - del self.__map[key] - value = dict.pop(self, key) - return key, value - - # -- the following methods do not depend on the internal structure -- - - def keys(self): - "od.keys() -> list of keys in od" - return list(self) - - def values(self): - "od.values() -> list of values in od" - return [self[key] for key in self] - - def items(self): - "od.items() -> list of (key, value) pairs in od" - return [(key, self[key]) for key in self] - - def iterkeys(self): - "od.iterkeys() -> an iterator over the keys in od" - return iter(self) - - def itervalues(self): - "od.itervalues -> an iterator over the values in od" - for k in self: - yield self[k] - - def iteritems(self): - "od.iteritems -> an iterator over the (key, value) items in od" - for k in self: - yield (k, self[k]) - - def update(*args, **kwds): # pylint: disable=E0211 - """od.update(E, **F) -> None. Update od from dict/iterable E and F. - - If E is a dict instance, does: for k in E: od[k] = E[k] - If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] - Or if E is an iterable of items, does: for k, v in E: od[k] = v - In either case, this is followed by: for k, v in F.items(): od[k] = v - - """ - if len(args) > 2: - raise TypeError( - "update() takes at most 2 positional " - "arguments ({} given)".format(len(args)) - ) - elif not args: - raise TypeError("update() takes at least 1 argument (0 given)") - self = args[0] - # Make progressively weaker assumptions about "other" - other = () - if len(args) == 2: - other = args[1] - if isinstance(other, dict): - for key in other: - self[key] = other[key] - elif hasattr(other, "keys"): - for key in other: - self[key] = other[key] - else: - for key, value in other: - self[key] = value - for key, value in kwds.items(): - self[key] = value - - __update = ( - update # let subclasses override update without breaking __init__ - ) - - __marker = object() - - def pop(self, key, default=__marker): - """od.pop(k[,d]) -> v, remove specified key and return the corresponding value. - If key is not found, d is returned if given, otherwise KeyError is raised. - - """ - if key in self: - result = self[key] - del self[key] - return result - if default is self.__marker: - raise KeyError(key) - return default - - def setdefault(self, key, default=None): - "od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od" - if key in self: - return self[key] - self[key] = default - return default - - def __repr__(self, _repr_running={}): # pylint: disable=W0102 - "od.__repr__() <==> repr(od)" - call_key = id(self), _get_ident() - if call_key in _repr_running: - return "..." - _repr_running[call_key] = 1 - try: - if not self: - return "{}()".format(self.__class__.__name__) - return "{}('{}')".format( - self.__class__.__name__, list(self.items()) - ) - finally: - del _repr_running[call_key] - - def __reduce__(self): - "Return state information for pickling" - items = [[k, self[k]] for k in self] - inst_dict = vars(self).copy() - for k in vars(OrderedDict()): - inst_dict.pop(k, None) - if inst_dict: - return (self.__class__, (items,), inst_dict) - return self.__class__, (items,) - - def copy(self): - "od.copy() -> a shallow copy of od" - return self.__class__(self) - - @classmethod - def fromkeys(cls, iterable, value=None): - """OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S - and values equal to v (which defaults to None). - - """ - d = cls() - for key in iterable: - d[key] = value - return d - - def __eq__(self, other): - """od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive - while comparison to a regular mapping is order-insensitive. - - """ - if isinstance(other, OrderedDict): - return len(self) == len(other) and self.items() == other.items() - return dict.__eq__(self, other) - - def __ne__(self, other): - return not self == other - - -# # -- the following methods are only used in Python 2.7 -- -# -# def viewkeys(self): -# "od.viewkeys() -> a set-like object providing a view on od's keys" -# return KeysView(self) -# -# def viewvalues(self): -# "od.viewvalues() -> an object providing a view on od's values" -# return ValuesView(self) -# -# def viewitems(self): -# "od.viewitems() -> a set-like object providing a view on od's items" -# return ItemsView(self) -# ## end of http://code.activestate.com/recipes/576693/ }}} - class DefaultOrderedDict(OrderedDict): """ @@ -342,7 +47,7 @@ class DefaultOrderedDict(OrderedDict): return type(self), args, None, None, self.items() def copy(self): - return self.__copy__() + return copy.copy(self) def __copy__(self): return type(self)(self.default_factory, self) diff --git a/salt/utils/openstack/nova.py b/salt/utils/openstack/nova.py index 4c3855edb31..386b585c861 100644 --- a/salt/utils/openstack/nova.py +++ b/salt/utils/openstack/nova.py @@ -197,7 +197,7 @@ class NovaServer: self.extra["password"] = password def __str__(self): - return self.__dict__ + return str(self.__dict__) def get_entry(dict_, key, value, raise_error=True): diff --git a/salt/utils/oset.py b/salt/utils/oset.py index d0bd6536e82..85cc0931328 100644 --- a/salt/utils/oset.py +++ b/salt/utils/oset.py @@ -113,7 +113,7 @@ class OrderedSet(MutableSet): def __contains__(self, key): return key in self.map - def add(self, key): # pylint: disable=arguments-differ + def add(self, key): # pylint: disable=arguments-differ,arguments-renamed """ Add `key` as an item to this OrderedSet, then return its index. @@ -168,7 +168,7 @@ class OrderedSet(MutableSet): del self.map[elem] return elem - def discard(self, key): # pylint: disable=arguments-differ + def discard(self, key): # pylint: disable=arguments-differ,arguments-renamed """ Remove an element. Do not raise an exception if absent. diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 036530820d8..385e69f6a15 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -13,7 +13,7 @@ import copy import getpass import logging -import optparse +import optparse # pylint: disable=deprecated-module import os import signal import sys diff --git a/salt/utils/path.py b/salt/utils/path.py index ed4b4a0f35a..f6aa7d5dad7 100644 --- a/salt/utils/path.py +++ b/salt/utils/path.py @@ -182,9 +182,11 @@ def which(exe=None): # The specified extension isn't valid, so we just assume it's part of the # filename and proceed to walk the pathext list else: - is_executable = lambda path, membership=res: is_executable_common( - path - ) and has_executable_ext(path, membership) + + def is_executable(path, membership=res): + return is_executable_common(path) and has_executable_ext( + path, membership + ) else: # in posix, there's no such thing as file extensions..only zuul diff --git a/salt/utils/pkg/__init__.py b/salt/utils/pkg/__init__.py index 9a11e492a04..3dfa9884bb4 100644 --- a/salt/utils/pkg/__init__.py +++ b/salt/utils/pkg/__init__.py @@ -33,7 +33,7 @@ def clear_rtag(opts): if exc.errno != errno.ENOENT: # Using __str__() here to get the fully-formatted error message # (error number, error message, path) - log.warning("Encountered error removing rtag: %s", exc.__str__()) + log.warning("Encountered error removing rtag: %s", exc) def write_rtag(opts): @@ -46,7 +46,7 @@ def write_rtag(opts): with salt.utils.files.fopen(rtag_file, "w+"): pass except OSError as exc: - log.warning("Encountered error writing rtag: %s", exc.__str__()) + log.warning("Encountered error writing rtag: %s", exc) def check_refresh(opts, refresh=None): diff --git a/salt/utils/pkg/win.py b/salt/utils/pkg/win.py index c34fa2c26b3..f988f7a99af 100644 --- a/salt/utils/pkg/win.py +++ b/salt/utils/pkg/win.py @@ -825,7 +825,7 @@ class WinSoftware: Returns: str: Package Id """ - return self.__next__() + return next(self) def get(self, pkg_id, default_value=None): """ @@ -848,7 +848,7 @@ class WinSoftware: return 1 if Version(ver1) > Version(ver2) else -1 @staticmethod - def __latest_to_oldest_version(ver1, ver2): + def __latest_to_oldest_version(ver1, ver2): # pylint: disable=unused-private-member """ Used for sorting version numbers, latest to oldest """ diff --git a/salt/utils/preseed.py b/salt/utils/preseed.py index 749b24dace4..3b1f6105950 100644 --- a/salt/utils/preseed.py +++ b/salt/utils/preseed.py @@ -25,7 +25,7 @@ def mksls(src, dst=None): continue comps = shlex.split(line) - if comps[0] not in ps_opts.keys(): + if comps[0] not in ps_opts: ps_opts[comps[0]] = {} cmds = comps[1].split("/") diff --git a/salt/utils/process.py b/salt/utils/process.py index 6c393706acd..765a2fac8d9 100644 --- a/salt/utils/process.py +++ b/salt/utils/process.py @@ -590,7 +590,7 @@ class ProcessManager: # with the tree option will not be able to find them. return - for pid in self._process_map.copy().keys(): + for pid in self._process_map.copy(): try: os.kill(pid, signal_) except OSError as exc: @@ -942,7 +942,7 @@ class Process(multiprocessing.Process): "logging_config": self.__logging_config__, } - def __decorate_run(self, run_func): + def __decorate_run(self, run_func): # pylint: disable=unused-private-member @functools.wraps(run_func) def wrapped_run_func(): # Static after fork method, always needs to happen first diff --git a/salt/utils/psutil_compat.py b/salt/utils/psutil_compat.py index e6684e5ca46..ef5d9768c10 100644 --- a/salt/utils/psutil_compat.py +++ b/salt/utils/psutil_compat.py @@ -9,104 +9,4 @@ Should be removed once support for psutil <2.0 is dropped. (eg RHEL 6) Built off of http://grodola.blogspot.com/2014/01/psutil-20-porting.html """ - -# No exception handling, as we want ImportError if psutil doesn't exist -import psutil # pylint: disable=3rd-party-module-not-gated - -if psutil.version_info >= (2, 0): - from psutil import * # pylint: disable=wildcard-import,unused-wildcard-import,3rd-party-module-not-gated -else: - # Import hack to work around bugs in old psutil's - # Psuedo "from psutil import *" - _globals = globals() - for attr in psutil.__all__: - _temp = __import__("psutil", globals(), locals(), [attr], 0) - try: - _globals[attr] = getattr(_temp, attr) - except AttributeError: - pass - - # Import functions not in __all__ - # pylint: disable=unused-import,3rd-party-module-not-gated - from psutil import disk_partitions, disk_usage - - # pylint: enable=unused-import,3rd-party-module-not-gated - # Alias new module functions - def boot_time(): - return psutil.BOOT_TIME - - def cpu_count(): - return psutil.NUM_CPUS - - # Alias renamed module functions - pids = psutil.get_pid_list - try: - users = psutil.get_users - except AttributeError: - users = lambda: (_ for _ in ()).throw( - NotImplementedError("Your psutil version is too old") - ) - - # Deprecated in 1.0.1, but not mentioned in blog post - if psutil.version_info < (1, 0, 1): - net_io_counters = psutil.network_io_counters() - - class Process(psutil.Process): # pylint: disable=no-init - # Reimplement overloaded getters/setters - # pylint: disable=arguments-differ - def cpu_affinity(self, *args, **kwargs): - if args or kwargs: - return self.set_cpu_affinity(*args, **kwargs) - else: - return self.get_cpu_affinity() - - def ionice(self, *args, **kwargs): - if args or kwargs: - return self.set_ionice(*args, **kwargs) - else: - return self.get_ionice() - - def nice(self, *args, **kwargs): - if args or kwargs: - return self.set_nice(*args, **kwargs) - else: - return self.get_nice() - - def rlimit(self, *args, **kwargs): - """ - set_rlimit and get_limit were not introduced until psutil v1.1.0 - """ - if psutil.version_info >= (1, 1, 0): - if args or kwargs: - return self.set_rlimit(*args, **kwargs) - else: - return self.get_rlimit() - else: - pass - - # pylint: enable=arguments-differ - - # Alias renamed Process functions - _PROCESS_FUNCTION_MAP = { - "children": "get_children", - "connections": "get_connections", - "cpu_percent": "get_cpu_percent", - "cpu_times": "get_cpu_times", - "io_counters": "get_io_counters", - "memory_info": "get_memory_info", - "memory_info_ex": "get_ext_memory_info", - "memory_maps": "get_memory_maps", - "memory_percent": "get_memory_percent", - "num_ctx_switches": "get_num_ctx_switches", - "num_fds": "get_num_fds", - "num_threads": "get_num_threads", - "open_files": "get_open_files", - "threads": "get_threads", - "cwd": "getcwd", - } - - for new, old in _PROCESS_FUNCTION_MAP.items(): - try: - setattr(Process, new, psutil.Process.__dict__[old]) - except KeyError: - pass +from psutil import * # pylint: disable=wildcard-import,unused-wildcard-import,3rd-party-module-not-gated diff --git a/salt/utils/reactor.py b/salt/utils/reactor.py index 19420a51cf0..3ddb363117c 100644 --- a/salt/utils/reactor.py +++ b/salt/utils/reactor.py @@ -312,6 +312,7 @@ class ReactWrap: Populate the client cache with an instance of the specified type """ reaction_type = low["state"] + # pylint: disable=unsupported-membership-test,unsupported-assignment-operation if reaction_type not in self.client_cache: log.debug("Reactor is populating %s client cache", reaction_type) if reaction_type in ("runner", "wheel"): @@ -333,6 +334,7 @@ class ReactWrap: self.client_cache[reaction_type] = self.reaction_class[reaction_type]( self.opts["conf_file"] ) + # pylint: enable=unsupported-membership-test,unsupported-assignment-operation def run(self, low): """ diff --git a/salt/utils/ssdp.py b/salt/utils/ssdp.py index 497accb522e..4c7e588284d 100644 --- a/salt/utils/ssdp.py +++ b/salt/utils/ssdp.py @@ -157,7 +157,10 @@ class SSDPFactory(SSDPBase): :return: """ tries = 0 - slp_time = lambda: 0.5 / random.randint(10, 30) + + def slp_time(): + return 0.5 / random.randint(10, 30) + slp = slp_time() while tries < attempts: try: diff --git a/salt/utils/templates.py b/salt/utils/templates.py index 554c76d51e1..872d92686af 100644 --- a/salt/utils/templates.py +++ b/salt/utils/templates.py @@ -2,6 +2,8 @@ Template render systems """ import codecs +import importlib.machinery +import importlib.util import logging import os import sys @@ -32,17 +34,6 @@ from salt.utils.decorators.jinja import JinjaFilter, JinjaGlobal, JinjaTest from salt.utils.odict import OrderedDict from salt.utils.versions import Version -if sys.version_info[:2] >= (3, 5): - import importlib.machinery # pylint: disable=no-name-in-module,import-error - import importlib.util # pylint: disable=no-name-in-module,import-error - - USE_IMPORTLIB = True -else: - import imp - - USE_IMPORTLIB = False - - log = logging.getLogger(__name__) @@ -676,18 +667,13 @@ def py(sfn, string=False, **kwargs): # pylint: disable=C0103 base_fname = os.path.basename(sfn) name = base_fname.split(".")[0] - if USE_IMPORTLIB: - # pylint: disable=no-member - loader = importlib.machinery.SourceFileLoader(name, sfn) - spec = importlib.util.spec_from_file_location(name, sfn, loader=loader) - if spec is None: - raise ImportError() - mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) - # pylint: enable=no-member - sys.modules[name] = mod - else: - mod = imp.load_source(name, sfn) + loader = importlib.machinery.SourceFileLoader(name, sfn) + spec = importlib.util.spec_from_file_location(name, sfn, loader=loader) + if spec is None: + raise ImportError() + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + sys.modules[name] = mod # File templates need these set as __var__ if "__env__" not in kwargs and "saltenv" in kwargs: diff --git a/salt/utils/vault.py b/salt/utils/vault.py index 07fcf3929b1..9e31adf5066 100644 --- a/salt/utils/vault.py +++ b/salt/utils/vault.py @@ -136,10 +136,16 @@ def get_vault_connection(): if namespace is not None: headers = {"X-Vault-Namespace": namespace} response = requests.post( - url, headers=headers, json=payload, verify=verify + url, + headers=headers, + json=payload, + verify=verify, + timeout=120, ) else: - response = requests.post(url, json=payload, verify=verify) + response = requests.post( + url, json=payload, verify=verify, timeout=120 + ) if response.status_code != 200: errmsg = "An error occurred while getting a token from approle" raise salt.exceptions.CommandExecutionError(errmsg) @@ -153,7 +159,9 @@ def get_vault_connection(): headers = {"X-Vault-Token": __opts__["vault"]["auth"]["token"]} if namespace is not None: headers["X-Vault-Namespace"] = namespace - response = requests.post(url, headers=headers, verify=verify) + response = requests.post( + url, headers=headers, verify=verify, timeout=120 + ) if response.status_code != 200: errmsg = "An error occured while unwrapping vault token" raise salt.exceptions.CommandExecutionError(errmsg) @@ -334,19 +342,21 @@ def make_request( token = connection["token"] if not token else token vault_url = connection["url"] if not vault_url else vault_url namespace = namespace or connection.get("namespace") - if "verify" in args: - args["verify"] = args["verify"] - else: + if "verify" not in args: try: args["verify"] = __opts__.get("vault").get("verify", None) except (TypeError, AttributeError): # Don't worry about setting verify if it doesn't exist pass + if "timeout" not in args: + args["timeout"] = 120 url = "{}/{}".format(vault_url, resource) headers = {"X-Vault-Token": str(token), "Content-Type": "application/json"} if namespace is not None: headers["X-Vault-Namespace"] = namespace - response = requests.request(method, url, headers=headers, **args) + response = requests.request( # pylint: disable=missing-timeout + method, url, headers=headers, **args + ) if not response.ok and response.json().get("errors", None) == ["permission denied"]: log.info("Permission denied from vault") del_cache() @@ -407,7 +417,7 @@ def _selftoken_expired(): headers = {"X-Vault-Token": __opts__["vault"]["auth"]["token"]} if namespace is not None: headers["X-Vault-Namespace"] = namespace - response = requests.get(url, headers=headers, verify=verify) + response = requests.get(url, headers=headers, verify=verify, timeout=120) if response.status_code != 200: return True return False @@ -431,7 +441,7 @@ def _wrapped_token_valid(): headers = {"X-Vault-Token": __opts__["vault"]["auth"]["token"]} if namespace is not None: headers["X-Vault-Namespace"] = namespace - response = requests.post(url, headers=headers, verify=verify) + response = requests.post(url, headers=headers, verify=verify, timeout=120) if response.status_code != 200: return False return True diff --git a/salt/utils/verify.py b/salt/utils/verify.py index ab468dd04c1..00f81f5c413 100644 --- a/salt/utils/verify.py +++ b/salt/utils/verify.py @@ -327,7 +327,7 @@ def check_user(user): try: if hasattr(os, "initgroups"): - os.initgroups(user, pwuser.pw_gid) # pylint: disable=minimum-python-version + os.initgroups(user, pwuser.pw_gid) else: os.setgroups(salt.utils.user.get_gid_list(user, include_default=False)) os.setgid(pwuser.pw_gid) @@ -418,7 +418,10 @@ def check_max_open_files(opts): # and the python binding http://timgolden.me.uk/pywin32-docs/win32file.html mof_s = mof_h = win32file._getmaxstdio() else: - mof_s, mof_h = resource.getrlimit(resource.RLIMIT_NOFILE) + + mof_s, mof_h = resource.getrlimit( # pylint: disable=used-before-assignment + resource.RLIMIT_NOFILE + ) accepted_keys_dir = os.path.join(opts.get("pki_dir"), "minions") accepted_count = len(os.listdir(accepted_keys_dir)) diff --git a/salt/utils/versions.py b/salt/utils/versions.py index 9a97fee1bd7..5c03a15b090 100644 --- a/salt/utils/versions.py +++ b/salt/utils/versions.py @@ -352,7 +352,10 @@ def version_cmp(pkg1, pkg2, ignore_epoch=False): version2, and 1 if version1 > version2. Return None if there was a problem making the comparison. """ - normalize = lambda x: str(x).split(":", 1)[-1] if ignore_epoch else str(x) + + def normalize(x): + return str(x).split(":", 1)[-1] if ignore_epoch else str(x) + pkg1 = normalize(pkg1) pkg2 = normalize(pkg2) diff --git a/salt/utils/vt.py b/salt/utils/vt.py index 42635b3be29..55b8172905b 100644 --- a/salt/utils/vt.py +++ b/salt/utils/vt.py @@ -73,6 +73,7 @@ def setwinsize(child, rows=80, cols=80): Thank you for the shortcut PEXPECT """ + # pylint: disable=used-before-assignment TIOCSWINSZ = getattr(termios, "TIOCSWINSZ", -2146929561) if TIOCSWINSZ == 2148037735: # Same bits, but with sign. @@ -396,7 +397,7 @@ class Terminal: def _spawn(self): if not isinstance(self.args, str) and self.shell is True: self.args = " ".join(self.args) - parent, child = pty.openpty() + parent, child = pty.openpty() # pylint: disable=used-before-assignment err_parent, err_child = os.pipe() child_name = os.ttyname(child) proc = subprocess.Popen( # pylint: disable=subprocess-popen-preexec-fn diff --git a/salt/utils/win_network.py b/salt/utils/win_network.py index eeae8fc091b..1e8ac4db3b8 100644 --- a/salt/utils/win_network.py +++ b/salt/utils/win_network.py @@ -330,6 +330,7 @@ def _get_ip_wins_info(i_face): def _get_network_interfaces(): + # pylint: disable=used-before-assignment return NetworkInformation.NetworkInterface.GetAllNetworkInterfaces() diff --git a/salt/utils/win_runas.py b/salt/utils/win_runas.py index 0b695aaad26..b50bc01ddb9 100644 --- a/salt/utils/win_runas.py +++ b/salt/utils/win_runas.py @@ -81,7 +81,8 @@ def create_env(user_token, inherit, timeout=1): break if env is not None: return env - raise exc + if exc is not None: + raise exc def runas(cmdLine, username, password=None, cwd=None): diff --git a/salt/version.py b/salt/version.py index ab852acca0b..8cc50f6ef05 100644 --- a/salt/version.py +++ b/salt/version.py @@ -58,7 +58,7 @@ class SaltVersionsInfo(type): _previous_release = None _next_release = None - # pylint: disable=bad-whitespace,multiple-spaces-before-operator + # pylint: disable=bad-whitespace # ----- Please refrain from fixing whitespace ----------------------------------> # The idea is to keep this readable. # ------------------------------------------------------------------------------- @@ -184,7 +184,7 @@ class SaltVersionsInfo(type): # <---- Please refrain from fixing whitespace ----------------------------------- # The idea is to keep this readable. # ------------------------------------------------------------------------------- - # pylint: enable=bad-whitespace,multiple-spaces-before-operator + # pylint: enable=bad-whitespace # fmt: on @classmethod @@ -862,7 +862,7 @@ def versions_information(include_salt_cloud=False, include_extensions=True): Report the versions of dependent software. """ py_info = [ - ("Python", sys.version.rsplit("\n")[0].strip()), + ("Python", sys.version.rsplit("\n", maxsplit=1)[0].strip()), ] salt_info = list(salt_information()) lib_info = list(dependency_information(include_salt_cloud)) diff --git a/setup.py b/setup.py index c2992548c93..f4d171f9293 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ The setup script for salt """ -# pylint: disable=file-perms,resource-leakage +# pylint: disable=file-perms,resource-leakage,deprecated-module import setuptools # isort:skip import distutils.dist import glob @@ -181,7 +181,7 @@ else: def _parse_requirements_file(requirements_file): parsed_requirements = [] - with open(requirements_file) as rfh: + with open(requirements_file, encoding="utf-8") as rfh: for line in rfh.readlines(): line = line.strip() if not line or line.startswith(("#", "-r", "--")): @@ -260,7 +260,9 @@ class GenerateSaltSyspaths(Command): exit(1) # Write the system paths file - open(self.distribution.salt_syspaths_hardcoded_path, "w").write( + open( + self.distribution.salt_syspaths_hardcoded_path, "w", encoding="utf-8" + ).write( INSTALL_SYSPATHS_TEMPLATE.format( date=DATE, root_dir=self.distribution.salt_root_dir, @@ -308,9 +310,9 @@ class WriteSaltSshPackagingFile(Command): exit(1) # pylint: disable=E0602 - open(self.distribution.salt_ssh_packaging_file, "w").write( - "Packaged for Salt-SSH\n" - ) + open( + self.distribution.salt_ssh_packaging_file, "w", encoding="utf-8" + ).write("Packaged for Salt-SSH\n") # pylint: enable=E0602 @@ -463,7 +465,7 @@ class CloudSdist(Sdist): # pylint: disable=too-many-ancestors try: import requests - req = requests.get(url) + req = requests.get(url, timeout=120) if req.status_code == 200: script_contents = req.text.encode(req.encoding) else: @@ -482,7 +484,7 @@ class CloudSdist(Sdist): # pylint: disable=too-many-ancestors "Error code: {}".format(req.getcode()) ) try: - with open(deploy_path, "w") as fp_: + with open(deploy_path, "w", encoding="utf-8") as fp_: fp_.write(script_contents) except OSError as err: log.error("Failed to write the updated script: {}".format(err)) diff --git a/tests/buildpackage.py b/tests/buildpackage.py index 108cd729a0b..26a2faa5e91 100644 --- a/tests/buildpackage.py +++ b/tests/buildpackage.py @@ -18,7 +18,7 @@ import re import shutil import subprocess import sys -from optparse import OptionGroup, OptionParser +from optparse import OptionGroup, OptionParser # pylint: disable=deprecated-module logging.QUIET = 0 logging.GARBAGE = 1 @@ -236,7 +236,7 @@ def build_centos(opts): log.info("Building CentOS RPM") log.info("Detecting major release") try: - with open("/etc/redhat-release") as fp_: + with open("/etc/redhat-release", encoding="utf-8") as fp_: redhat_release = fp_.read().strip() major_release = int(redhat_release.split()[2].split(".")[0]) except (ValueError, IndexError): @@ -322,9 +322,9 @@ def build_centos(opts): # Prepare SPEC file spec_path = os.path.join(opts.build_dir, "SPECS", "salt.spec") - with open(opts.spec_file) as spec: + with open(opts.spec_file, encoding="utf-8") as spec: spec_lines = spec.read().splitlines() - with open(spec_path, "w") as fp_: + with open(spec_path, "w", encoding="utf-8") as fp_: for line in spec_lines: if line.startswith("%global srcver "): line = "%global srcver {}".format(salt_srcver) diff --git a/tests/committer_parser.py b/tests/committer_parser.py index 8056b7fd406..25572bb3268 100644 --- a/tests/committer_parser.py +++ b/tests/committer_parser.py @@ -53,7 +53,7 @@ def parse_gitlog(filename=None): if not filename or filename == "-": fh = sys.stdin else: - fh = open(filename, "r+") + fh = open(filename, "r+", encoding="utf-8") try: commitcount = 0 diff --git a/tests/conftest.py b/tests/conftest.py index b6adab5401d..38cfa97c7f7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -34,7 +34,7 @@ from tests.support.helpers import ( PRE_PYTEST_SKIP_REASON, get_virtualenv_binary_path, ) -from tests.support.pytest.helpers import * # pylint: disable=unused-wildcard-import +from tests.support.pytest.helpers import * # pylint: disable=unused-wildcard-import,wildcard-import from tests.support.runtests import RUNTIME_VARS from tests.support.sminion import check_required_sminion_attributes, create_sminion @@ -1559,7 +1559,7 @@ def from_filenames_collection_modifyitems(config, items): ): # In this case, this path is considered to be a file containing a line separated list # of files to consider - contents = properly_slashed_path.read_text() + contents = properly_slashed_path.read_text(encoding="utf-8") for sep in ("\r\n", "\\r\\n", "\\n"): contents = contents.replace(sep, "\n") for line in contents.split("\n"): diff --git a/tests/eventlisten.py b/tests/eventlisten.py index 8ff5ada8232..4b56378a448 100644 --- a/tests/eventlisten.py +++ b/tests/eventlisten.py @@ -4,9 +4,7 @@ what the sock_dir is. This script is a generic tool to test event output """ - - -import optparse +import optparse # pylint: disable=deprecated-module import os import pprint import time diff --git a/tests/integration/cloud/clouds/test_oneandone.py b/tests/integration/cloud/clouds/test_oneandone.py index 632f2b871d3..64a2d16694d 100644 --- a/tests/integration/cloud/clouds/test_oneandone.py +++ b/tests/integration/cloud/clouds/test_oneandone.py @@ -5,15 +5,9 @@ import pytest from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest -try: - from oneandone.client import OneAndOneService # pylint: disable=unused-import - - HAS_ONEANDONE = True -except ImportError: - HAS_ONEANDONE = False +pytest.importorskip("oneandone.client", reason="salt-cloud requires >= 1and1 1.2.0") -@pytest.mark.skipif(HAS_ONEANDONE is False, reason="salt-cloud requires >= 1and1 1.2.0") class OneAndOneTest(CloudTest): """ Integration tests for the 1and1 cloud provider @@ -26,7 +20,7 @@ class OneAndOneTest(CloudTest): """ Tests the return of running the --list-images command for 1and1 """ - image_list = self.run_cloud("--list-images {}".format(self.PROVIDER_NAME)) + image_list = self.run_cloud(f"--list-images {self.PROVIDER_NAME}") self.assertIn("coreOSimage", [i.strip() for i in image_list]) def test_instance(self): @@ -35,7 +29,7 @@ class OneAndOneTest(CloudTest): """ # check if instance with salt installed returned ret_str = self.run_cloud( - "-p oneandone-test {}".format(self.instance_name), timeout=TIMEOUT + f"-p oneandone-test {self.instance_name}", timeout=TIMEOUT ) self.assertInstanceExists(ret_str) diff --git a/tests/integration/cloud/clouds/test_vmware.py b/tests/integration/cloud/clouds/test_vmware.py index 1e82566fc21..a0845cb8a6b 100644 --- a/tests/integration/cloud/clouds/test_vmware.py +++ b/tests/integration/cloud/clouds/test_vmware.py @@ -102,7 +102,7 @@ class VMWareTest(CloudTest): """ # salt-cloud -p my-instant-clone IC3 profile_name = "vmware-test-instant-clone" - self.run_cloud(f"-a remove_all_snapshots cloud-tests-template-base") + self.run_cloud("-a remove_all_snapshots cloud-tests-template-base") # create the instance log_format = "%(message)s" diff --git a/tests/integration/modules/test_cp.py b/tests/integration/modules/test_cp.py index af873bb6784..7c92978b31c 100644 --- a/tests/integration/modules/test_cp.py +++ b/tests/integration/modules/test_cp.py @@ -597,7 +597,9 @@ class CPModuleTest(ModuleCase): @pytest.mark.slow_test def test_push(self): log_to_xfer = os.path.join(RUNTIME_VARS.TMP, uuid.uuid4().hex) - open(log_to_xfer, "w").close() # pylint: disable=resource-leakage + open( # pylint: disable=resource-leakage + log_to_xfer, "w", encoding="utf-8" + ).close() try: self.run_function("cp.push", [log_to_xfer]) tgt_cache_file = os.path.join( diff --git a/tests/integration/modules/test_ssh.py b/tests/integration/modules/test_ssh.py index 55586211622..a22551649e7 100644 --- a/tests/integration/modules/test_ssh.py +++ b/tests/integration/modules/test_ssh.py @@ -21,7 +21,7 @@ def check_status(): Check the status of Github for remote operations """ try: - return requests.get("https://github.com").status_code == 200 + return requests.get("https://github.com", timeout=60).status_code == 200 except Exception: # pylint: disable=broad-except return False diff --git a/tests/integration/netapi/rest_tornado/test_app.py b/tests/integration/netapi/rest_tornado/test_app.py index 65bb4ad6463..e8a8656106a 100644 --- a/tests/integration/netapi/rest_tornado/test_app.py +++ b/tests/integration/netapi/rest_tornado/test_app.py @@ -67,7 +67,7 @@ class SaltnadoIntegrationTestsBase( def setUp(self): super().setUp() self.patched_environ = patched_environ(ASYNC_TEST_TIMEOUT="30") - self.patched_environ.__enter__() + self.patched_environ.__enter__() # pylint: disable=unnecessary-dunder-call self.addCleanup(self.patched_environ.__exit__) def tearDown(self): diff --git a/tests/minionswarm.py b/tests/minionswarm.py index cb3cb0aa38d..d34a5ea2e61 100644 --- a/tests/minionswarm.py +++ b/tests/minionswarm.py @@ -7,7 +7,7 @@ on a single system to test scale capabilities # pylint: disable=resource-leakage import hashlib -import optparse +import optparse # pylint: disable=deprecated-module import os import random import shutil diff --git a/tests/modparser.py b/tests/modparser.py index 978b3ad7836..f0de1011437 100644 --- a/tests/modparser.py +++ b/tests/modparser.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python2 - +#!/usr/bin/env python +import argparse import modulefinder import os import pprint @@ -9,13 +9,6 @@ import sys import salt.utils.json import salt.utils.yaml -try: - import argparse # pylint: disable=minimum-python-version - - HAS_ARGPARSE = True -except ImportError: - HAS_ARGPARSE = False - def parse(): """ @@ -46,7 +39,7 @@ def mod_data(opts, full): try: finder.load_file(full) except ImportError as exc: - print("ImportError - {} (Reason: {})".format(full, exc), file=sys.stderr) + print(f"ImportError - {full} (Reason: {exc})", file=sys.stderr) return ret for name, mod in finder.modules.items(): basemod = name.split(".")[0] @@ -86,8 +79,6 @@ def scan(opts): if __name__ == "__main__": - if not HAS_ARGPARSE: - print("The argparse python module is required") opts = parse() try: scand = scan(opts) diff --git a/tests/pytests/functional/cache/test_etcd.py b/tests/pytests/functional/cache/test_etcd.py index 01ec44b4f4f..e69dcba8431 100644 --- a/tests/pytests/functional/cache/test_etcd.py +++ b/tests/pytests/functional/cache/test_etcd.py @@ -21,8 +21,8 @@ pytestmark = [ scope="module", params=(EtcdVersion.v2, EtcdVersion.v3_v2_mode), ids=etcd_version_ids, -) # pylint: disable=function-redefined -def etcd_version(request): +) +def etcd_version(request): # pylint: disable=function-redefined # The only parameter is True because the salt cache does not use # salt/utils/etcd_util.py and if coded for etcd v2 if request.param and not HAS_ETCD_V2: diff --git a/tests/pytests/functional/modules/test_data.py b/tests/pytests/functional/modules/test_data.py index 87f31c230ee..96520cbacbd 100644 --- a/tests/pytests/functional/modules/test_data.py +++ b/tests/pytests/functional/modules/test_data.py @@ -139,9 +139,9 @@ def test_has_key(data_module): ret = data_module.update("foo", "bar") assert ret - ret = data_module.has_key("foo") # pylint: disable=.has_key-is-deprecated-use-in + ret = data_module.has_key("foo") assert ret - ret = data_module.has_key("bar") # pylint: disable=.has_key-is-deprecated-use-in + ret = data_module.has_key("bar") assert not ret diff --git a/tests/pytests/functional/modules/test_system.py b/tests/pytests/functional/modules/test_system.py index 2dabaaebfad..92fb1363864 100644 --- a/tests/pytests/functional/modules/test_system.py +++ b/tests/pytests/functional/modules/test_system.py @@ -128,8 +128,8 @@ def _test_hwclock_sync(system, hwclock_has_compare): raise CompareTimeout for _ in range(2): + orig_handler = signal.signal(signal.SIGALRM, _alrm_handler) try: - orig_handler = signal.signal(signal.SIGALRM, _alrm_handler) signal.alarm(3) rpipeFd, wpipeFd = os.pipe() log.debug("Comparing hwclock to sys clock") diff --git a/tests/pytests/functional/states/file/test_append.py b/tests/pytests/functional/states/file/test_append.py index 874d5d20714..fabb33d305c 100644 --- a/tests/pytests/functional/states/file/test_append.py +++ b/tests/pytests/functional/states/file/test_append.py @@ -145,13 +145,13 @@ def test_file_append_check_cmd(modules, state_tree, tmp_path): Test that check_cmd works for file.append and those states do not run. """ - sls_contents = f""" -append_in_file: - file.append: - - name: /tmp/test - - text: "appended text" - - check_cmd: - - "djasjahj" + sls_contents = """ + append_in_file: + file.append: + - name: /tmp/test + - text: "appended text" + - check_cmd: + - "djasjahj" """ with pytest.helpers.temp_file( "file-append-check-cmd.sls", sls_contents, state_tree diff --git a/tests/pytests/functional/states/file/test_replace.py b/tests/pytests/functional/states/file/test_replace.py index 22dab816804..473ea0cef54 100644 --- a/tests/pytests/functional/states/file/test_replace.py +++ b/tests/pytests/functional/states/file/test_replace.py @@ -378,20 +378,20 @@ def test_file_replace_prerequired_issues_55775(modules, state_tree, tmp_path): assert managed_file.exists() -def test_file_replace_check_cmd(modules, state_tree, tmp_path): +def test_file_replace_check_cmd(modules, state_tree): """ Test that check_cmd works for file.replace and those states do not run. """ - sls_contents = f""" -replace_in_file: - file.replace: - - name: /tmp/test - - pattern: hi - - repl: "replacement text" - - append_if_not_found: True - - check_cmd: - - "djasjahj" + sls_contents = """ + replace_in_file: + file.replace: + - name: /tmp/test + - pattern: hi + - repl: "replacement text" + - append_if_not_found: True + - check_cmd: + - "djasjahj" """ with pytest.helpers.temp_file( "file-replace-check-cmd.sls", sls_contents, state_tree diff --git a/tests/pytests/functional/states/pkgrepo/test_debian.py b/tests/pytests/functional/states/pkgrepo/test_debian.py index 5452ecac1c4..822b4773f5e 100644 --- a/tests/pytests/functional/states/pkgrepo/test_debian.py +++ b/tests/pytests/functional/states/pkgrepo/test_debian.py @@ -614,7 +614,7 @@ def test_repo_absent_existing_repo_trailing_slash_uri( with subtests.test("Remove repo with trailing slash in URI"): # Write contents to file with trailing slash in URI - repo_file.write_text(f"{repo_content}\n") + repo_file.write_text(f"{repo_content}\n", encoding="utf-8") # Perform and validate removal ret = pkgrepo.absent(name=repo_content) assert ret.result @@ -630,7 +630,7 @@ def test_repo_absent_existing_repo_trailing_slash_uri( # Create a repo file that matches the URI but contains no architecture. # This should not be identified as a match for repo_content, and thus # the result of a state should be a no-op. - repo_file.write_text(f"deb {repo_uri} stable main\n") + repo_file.write_text(f"deb {repo_uri} stable main\n", encoding="utf-8") # Since this was a no-op, the state should have succeeded, made no # changes, and left the repo file in place. ret = pkgrepo.absent(name=repo_content) diff --git a/tests/pytests/functional/states/test_docker_container.py b/tests/pytests/functional/states/test_docker_container.py index 2267399891e..1e8c1567217 100644 --- a/tests/pytests/functional/states/test_docker_container.py +++ b/tests/pytests/functional/states/test_docker_container.py @@ -55,7 +55,7 @@ class Network: return ipaddress.ip_network(self.subnet) @_rand_indexes.default - def __rand_indexes(self): + def __rand_indexes(self): # pylint: disable=unused-private-member return random.sample( range(2, self.net.num_addresses - 1), self.net.num_addresses - 3 ) @@ -70,12 +70,14 @@ class Network: @staticmethod def arg_map(arg_name): - return { - "ipv4_address": "IPv4Address", - "ipv6_address": "IPv6Address", - "links": "Links", - "aliases": "Aliases", - }[arg_name] + if arg_name == "ipv4_address": + return "IPv4Address" + if arg_name == "ipv6_address": + return "IPv6Address" + if arg_name == "links": + return "Links" + if arg_name == "aliases": + return "Aliases" @property def compressed_subnet(self): diff --git a/tests/pytests/functional/states/test_docker_network.py b/tests/pytests/functional/states/test_docker_network.py index 16a78b13a4a..e5e9a7ec448 100644 --- a/tests/pytests/functional/states/test_docker_network.py +++ b/tests/pytests/functional/states/test_docker_network.py @@ -46,13 +46,16 @@ class Network: "Indexing not supported for networks without a custom subnet" ) - def arg_map(self, arg_name): - return { - "ipv4_address": "IPv4Address", - "ipv6_address": "IPv6Address", - "links": "Links", - "aliases": "Aliases", - }[arg_name] + @staticmethod + def arg_map(arg_name): + if arg_name == "ipv4_address": + return "IPv4Address" + if arg_name == "ipv6_address": + return "IPv6Address" + if arg_name == "links": + return "Links" + if arg_name == "aliases": + return "Aliases" @property def subnet(self): diff --git a/tests/pytests/functional/states/test_pkg.py b/tests/pytests/functional/states/test_pkg.py index 9ea9aa98aa1..a67aa8bceca 100644 --- a/tests/pytests/functional/states/test_pkg.py +++ b/tests/pytests/functional/states/test_pkg.py @@ -513,7 +513,7 @@ def test_pkg_012_installed_with_wildcard_version(PKG_TARGETS, states, modules): ) expected_comment = ( - "All specified packages are already installed and are at the " "desired version" + "All specified packages are already installed and are at the desired version" ) assert ret.result is True assert ret.raw[next(iter(ret.raw))]["comment"] == expected_comment diff --git a/tests/pytests/functional/states/test_ssh_auth.py b/tests/pytests/functional/states/test_ssh_auth.py index 7ed7c7047fe..fea9a29df6c 100644 --- a/tests/pytests/functional/states/test_ssh_auth.py +++ b/tests/pytests/functional/states/test_ssh_auth.py @@ -45,7 +45,7 @@ def test_ssh_auth_config(tmp_path, system_user, state_tree): ssh_auth_state.manage( name="test", user=system_user.username, - source=f"salt://authorized", + source="salt://authorized", config=str(new_auth_file), ssh_keys=[""], ) diff --git a/tests/pytests/functional/test_crypt.py b/tests/pytests/functional/test_crypt.py index 0c8e90e82d6..b0cf862d641 100644 --- a/tests/pytests/functional/test_crypt.py +++ b/tests/pytests/functional/test_crypt.py @@ -7,6 +7,7 @@ import salt.crypt @pytest.mark.windows_whitelisted def test_generated_keys(tmp_path): - priv = salt.crypt.gen_keys(tmp_path, "aaa", 2048) - assert "\r" not in pathlib.Path(priv).read_text() - assert "\r" not in pathlib.Path(priv.replace(".pem", ".pub")).read_text() + priv = pathlib.Path(salt.crypt.gen_keys(tmp_path, "aaa", 2048)) + pub = priv.with_suffix(".pub") + assert "\r" not in priv.read_text(encoding="utf-8") + assert "\r" not in pub.read_text(encoding="utf-8") diff --git a/tests/pytests/integration/_logging/test_jid_logging.py b/tests/pytests/integration/_logging/test_jid_logging.py index 016bf89e104..96ba7697053 100644 --- a/tests/pytests/integration/_logging/test_jid_logging.py +++ b/tests/pytests/integration/_logging/test_jid_logging.py @@ -12,7 +12,7 @@ def test_jid_in_logs(caplog, salt_call_cli): """ Test JID in log_format """ - jid_formatted_str = DFLT_LOG_FMT_JID.split("%")[0] + jid_formatted_str = DFLT_LOG_FMT_JID.split("%", maxsplit=1)[0] formatter = logging.Formatter(fmt="%(jid)s %(message)s") with caplog.at_level(logging.DEBUG): previous_formatter = caplog.handler.formatter diff --git a/tests/pytests/integration/cli/test_batch.py b/tests/pytests/integration/cli/test_batch.py index 70d66d99598..45c506a2bfd 100644 --- a/tests/pytests/integration/cli/test_batch.py +++ b/tests/pytests/integration/cli/test_batch.py @@ -141,7 +141,9 @@ def test_batch_state_stopping_after_error( # Executing salt with batch: 1 and with failhard. It should stop after the first error. cmd = salt_cli.run( - "state.single" "test.fail_without_changes" "name=test_me", + "state.single", + "test.fail_without_changes", + "name=test_me", "-b 1", "--out=yaml", "--failhard", diff --git a/tests/pytests/integration/cli/test_salt.py b/tests/pytests/integration/cli/test_salt.py index 7f026845843..30752102025 100644 --- a/tests/pytests/integration/cli/test_salt.py +++ b/tests/pytests/integration/cli/test_salt.py @@ -254,7 +254,7 @@ def test_minion_65400(salt_cli, salt_minion, salt_minion_2, salt_master): Ensure correct exit status when salt CLI starts correctly. """ - state = f""" + state = """ custom_test_state: test.configurable_test_state: - name: example diff --git a/tests/pytests/integration/cli/test_syndic_eauth.py b/tests/pytests/integration/cli/test_syndic_eauth.py index a37127c3949..e1d159cdf91 100644 --- a/tests/pytests/integration/cli/test_syndic_eauth.py +++ b/tests/pytests/integration/cli/test_syndic_eauth.py @@ -523,7 +523,7 @@ def all_the_docker( except docker.errors.APIError as exc: # if the container isn't running, there's not thing we can do # at this point. - log.info(f"Docker failed removing /etc/salt: %s", exc) + log.info("Docker failed removing /etc/salt: %s", exc) @pytest.fixture( diff --git a/tests/pytests/integration/modules/state/test_state_test.py b/tests/pytests/integration/modules/state/test_state_test.py index 40049e9a6b6..9dbcadd04e6 100644 --- a/tests/pytests/integration/modules/state/test_state_test.py +++ b/tests/pytests/integration/modules/state/test_state_test.py @@ -136,7 +136,7 @@ def test_state_sls_id_test_state_test_post_run(salt_call_cli, testfile_path): true post the state already being run previously """ source = pathlib.Path(RUNTIME_VARS.BASE_FILES, "testfile") - testfile_path.write_text(source.read_text()) + testfile_path.write_text(source.read_text(encoding="utf-8"), encoding="utf-8") testfile_path.chmod(0o644) ret = salt_call_cli.run("state.sls", "sls-id-test") assert ret.returncode == 0 diff --git a/tests/pytests/integration/sdb/test_etcd_db.py b/tests/pytests/integration/sdb/test_etcd_db.py index d981b222da7..3085dafb8ce 100644 --- a/tests/pytests/integration/sdb/test_etcd_db.py +++ b/tests/pytests/integration/sdb/test_etcd_db.py @@ -28,8 +28,8 @@ def etcd_static_port(sdb_etcd_port): # pylint: disable=function-redefined scope="module", params=(EtcdVersion.v2, EtcdVersion.v3_v2_mode), ids=etcd_version_ids, -) # pylint: disable=function-redefined -def etcd_version(request): +) +def etcd_version(request): # pylint: disable=function-redefined # The only parameter is True because the salt integration # configuration for the salt-master and salt-minion defaults # to v2. diff --git a/tests/pytests/integration/ssh/test_pre_flight.py b/tests/pytests/integration/ssh/test_pre_flight.py index c2fc14094e8..7dc56f37535 100644 --- a/tests/pytests/integration/ssh/test_pre_flight.py +++ b/tests/pytests/integration/ssh/test_pre_flight.py @@ -207,7 +207,7 @@ def test_ssh_pre_flight_script(salt_ssh_cli, caplog, _create_roster, tmp_path, a try: script = pathlib.Path.home() / "hacked" tmp_preflight = pathlib.Path("/tmp", "ssh_pre_flight.sh") - tmp_preflight.write_text(f"touch {script}") + tmp_preflight.write_text(f"touch {script}", encoding="utf-8") os.chown(tmp_preflight, account.info.uid, account.info.gid) ret = salt_ssh_cli.run("test.ping") assert not script.is_file() @@ -239,7 +239,7 @@ def test_ssh_pre_flight_perms(salt_ssh_cli, caplog, _create_roster, account): try: script = pathlib.Path("/tmp", "itworked") preflight = pathlib.Path("/ssh_pre_flight.sh") - preflight.write_text(f"touch {str(script)}") + preflight.write_text(f"touch {str(script)}", encoding="utf-8") tmp_preflight = pathlib.Path("/tmp", preflight.name) _custom_roster(salt_ssh_cli.roster_file, {"ssh_pre_flight": str(preflight)}) @@ -255,7 +255,8 @@ def test_ssh_pre_flight_perms(salt_ssh_cli, caplog, _create_roster, account): fi x=$(( $x + 1 )) done - """ + """, + encoding="utf-8", ) run_script.chmod(0o0777) # pylint: disable=W1509 diff --git a/tests/pytests/pkg/download/test_pkg_download.py b/tests/pytests/pkg/download/test_pkg_download.py index a71d4b038e9..57b1e4c834e 100644 --- a/tests/pytests/pkg/download/test_pkg_download.py +++ b/tests/pytests/pkg/download/test_pkg_download.py @@ -7,7 +7,7 @@ import os import pathlib import shutil -import packaging +import packaging.version import pytest from pytestskipmarkers.utils import platform @@ -97,7 +97,7 @@ def get_salt_release(): salt_release = "3006.0rc2" if pkg_test_type == "download-pkgs": if packaging.version.parse(salt_release) < packaging.version.parse("3006.0rc1"): - log.warning(f"The salt release being tested, {salt_release!r} looks off.") + log.warning("The salt release being tested, %r looks off.", salt_release) return salt_release @@ -109,7 +109,9 @@ def get_repo_subpath_params(): latest_release = packaging.version.parse(latest_env_var) if current_release >= latest_release: log.debug( - f"Running the tests for the latest release since {str(current_release)} >= {str(latest_release)}" + "Running the tests for the latest release since %s >= %s", + current_release, + latest_release, ) params.append("latest") return params diff --git a/tests/pytests/pkg/integration/test_pip_upgrade.py b/tests/pytests/pkg/integration/test_pip_upgrade.py index 19ed1d6d336..cabc74cefef 100644 --- a/tests/pytests/pkg/integration/test_pip_upgrade.py +++ b/tests/pytests/pkg/integration/test_pip_upgrade.py @@ -49,7 +49,7 @@ def test_pip_install(install_salt, salt_call_cli): pytest.fail(f"Failed to find {dep} in the versions report output") if dep_version == installed_version: - log.warning(f"The {dep} dependency is already latest") + log.warning("The %s dependency is already latest", dep) else: found_new = True break @@ -88,7 +88,7 @@ def test_pip_install(install_salt, salt_call_cli): else: pytest.fail(f"Failed to find {dep} in the versions report output") finally: - log.info(f"Uninstalling {dep_version}") + log.info("Uninstalling %s", dep_version) assert salt_call_cli.run( "--local", "pip.uninstall", f"{dep}=={dep_version}" ) diff --git a/tests/pytests/pkg/integration/test_salt_user.py b/tests/pytests/pkg/integration/test_salt_user.py index 4538ce79adb..a7516e2b4d8 100644 --- a/tests/pytests/pkg/integration/test_salt_user.py +++ b/tests/pytests/pkg/integration/test_salt_user.py @@ -296,7 +296,7 @@ def test_paths_log_rotation( for _path in log_files_list: log_path = pathlib.Path(_path) assert log_path.exists() - with log_path.open("a") as f: + with log_path.open("a", encoding="utf-8") as f: f.write("This is a log rotation test\n") # force log rotation diff --git a/tests/pytests/scenarios/blackout/conftest.py b/tests/pytests/scenarios/blackout/conftest.py index 09cee10db66..1cef38bcc84 100644 --- a/tests/pytests/scenarios/blackout/conftest.py +++ b/tests/pytests/scenarios/blackout/conftest.py @@ -46,7 +46,7 @@ class BlackoutPillar: self.minion_1_pillar.write_text(pillar_contents) self.refresh_pillar(exiting_blackout=False) self.in_blackout = True - return self.__enter__() + return self.__enter__() # pylint: disable=unnecessary-dunder-call def exit_blackout(self): if self.in_blackout: diff --git a/tests/pytests/unit/beacons/test_salt_monitor.py b/tests/pytests/unit/beacons/test_salt_monitor.py index 1edf8be539d..e718c780e50 100644 --- a/tests/pytests/unit/beacons/test_salt_monitor.py +++ b/tests/pytests/unit/beacons/test_salt_monitor.py @@ -1,5 +1,3 @@ -# pylint: disable=E8231 -# Salt libs import pytest import salt.beacons.salt_monitor as salt_monitor diff --git a/tests/pytests/unit/cli/test_daemons.py b/tests/pytests/unit/cli/test_daemons.py index 6f339b61234..5d68c56c77b 100644 --- a/tests/pytests/unit/cli/test_daemons.py +++ b/tests/pytests/unit/cli/test_daemons.py @@ -61,9 +61,7 @@ class LoggerMock: :return: """ for data in self.messages: - log_str = ( - data["message"] % data["args"] - ) # pylint: disable=incompatible-py3-code + log_str = data["message"] % data["args"] if (data["type"] == log_type or not log_type) and log_str.find(msg) > -1: return True diff --git a/tests/pytests/unit/client/ssh/test_ssh.py b/tests/pytests/unit/client/ssh/test_ssh.py index e3baf3f5d35..7582cbbee0d 100644 --- a/tests/pytests/unit/client/ssh/test_ssh.py +++ b/tests/pytests/unit/client/ssh/test_ssh.py @@ -229,7 +229,7 @@ def test_update_targets_ip_address(opts): assert opts["tgt"] == user + host client._update_targets() assert opts["tgt"] == host - assert client.targets[host]["user"] == user.split("@")[0] + assert client.targets[host]["user"] == user.split("@", maxsplit=1)[0] def test_update_targets_dns(opts): @@ -245,7 +245,7 @@ def test_update_targets_dns(opts): assert opts["tgt"] == user + host client._update_targets() assert opts["tgt"] == host - assert client.targets[host]["user"] == user.split("@")[0] + assert client.targets[host]["user"] == user.split("@", maxsplit=1)[0] def test_update_targets_no_user(opts): @@ -282,7 +282,7 @@ def test_update_expand_target_dns(opts, roster): client._expand_target() client._update_targets() assert opts["tgt"] == host - assert client.targets[host]["user"] == user.split("@")[0] + assert client.targets[host]["user"] == user.split("@", maxsplit=1)[0] def test_parse_tgt(opts): @@ -298,7 +298,7 @@ def test_parse_tgt(opts): assert not opts.get("ssh_cli_tgt") client = ssh.SSH(opts) assert client.parse_tgt["hostname"] == host - assert client.parse_tgt["user"] == user.split("@")[0] + assert client.parse_tgt["user"] == user.split("@", maxsplit=1)[0] assert opts.get("ssh_cli_tgt") == user + host diff --git a/tests/pytests/unit/cloud/clouds/test_proxmox.py b/tests/pytests/unit/cloud/clouds/test_proxmox.py index 1d1823a8035..405db87caec 100644 --- a/tests/pytests/unit/cloud/clouds/test_proxmox.py +++ b/tests/pytests/unit/cloud/clouds/test_proxmox.py @@ -384,6 +384,7 @@ def test__authenticate_with_custom_port(): "https://proxmox.connection.url:9999/api2/json/access/ticket", verify=True, data={"username": ("fakeuser",), "password": "secretpassword"}, + timeout=120, ) diff --git a/tests/pytests/unit/daemons/masterapi/test_remote_funcs.py b/tests/pytests/unit/daemons/masterapi/test_remote_funcs.py index 8151dcaf006..99821a8f54a 100644 --- a/tests/pytests/unit/daemons/masterapi/test_remote_funcs.py +++ b/tests/pytests/unit/daemons/masterapi/test_remote_funcs.py @@ -42,7 +42,7 @@ def test_mine_get(funcs, tgt_type_key="tgt_type"): funcs.cache.store("minions/webserver", "mine", dict(ip_addr="2001:db8::1:3")) with patch( "salt.utils.minions.CkMinions._check_compound_minions", - MagicMock(return_value=(dict(minions=["webserver"], missing=[]))), + MagicMock(return_value=dict(minions=["webserver"], missing=[])), ): ret = funcs._mine_get( { @@ -81,7 +81,7 @@ def test_mine_get_dict_str(funcs, tgt_type_key="tgt_type"): ) with patch( "salt.utils.minions.CkMinions._check_compound_minions", - MagicMock(return_value=(dict(minions=["webserver"], missing=[]))), + MagicMock(return_value=dict(minions=["webserver"], missing=[])), ): ret = funcs._mine_get( { @@ -114,7 +114,7 @@ def test_mine_get_dict_list(funcs, tgt_type_key="tgt_type"): ) with patch( "salt.utils.minions.CkMinions._check_compound_minions", - MagicMock(return_value=(dict(minions=["webserver"], missing=[]))), + MagicMock(return_value=dict(minions=["webserver"], missing=[])), ): ret = funcs._mine_get( { diff --git a/tests/pytests/unit/fileserver/test_roots.py b/tests/pytests/unit/fileserver/test_roots.py index c1660280bc5..c6a58136a3c 100644 --- a/tests/pytests/unit/fileserver/test_roots.py +++ b/tests/pytests/unit/fileserver/test_roots.py @@ -290,7 +290,7 @@ def test_find_file_not_in_root(tmp_state_tree): """ badfile = pathlib.Path(tmp_state_tree).parent / "bar" badfile.write_text("Bad file") - badpath = f"../bar" + badpath = "../bar" ret = roots.find_file(badpath) assert ret == {"path": "", "rel": ""} badpath = f"{tmp_state_tree / '..' / 'bar'}" @@ -304,7 +304,7 @@ def test_serve_file_not_in_root(tmp_state_tree): """ badfile = pathlib.Path(tmp_state_tree).parent / "bar" badfile.write_text("Bad file") - badpath = f"../bar" + badpath = "../bar" load = {"path": "salt://|..\\bar", "saltenv": "base", "loc": 0} fnd = { "path": f"{tmp_state_tree / '..' / 'bar'}", diff --git a/tests/pytests/unit/modules/dockermod/test_module.py b/tests/pytests/unit/modules/dockermod/test_module.py index abfd101540d..4c820bd9190 100644 --- a/tests/pytests/unit/modules/dockermod/test_module.py +++ b/tests/pytests/unit/modules/dockermod/test_module.py @@ -307,10 +307,10 @@ def test_check_mine_cache_is_refreshed_on_container_change_event(command_name, a try: mine_send.assert_called_with("docker.ps", verbose=True, all=True, host=True) except AssertionError as exc: - raise Exception( + raise AssertionError( "command '{}' did not call docker.ps with expected " "arguments: {}".format(command_name, exc) - ) + ) from exc def test_update_mine(): @@ -319,24 +319,14 @@ def test_update_mine(): """ def config_get_disabled(val, default): - return { - "base_url": docker_mod.NOTSET, - "version": docker_mod.NOTSET, - "docker.url": docker_mod.NOTSET, - "docker.version": docker_mod.NOTSET, - "docker.machine": docker_mod.NOTSET, - "docker.update_mine": False, - }[val] + if val == "docker.update_mine": + return False + return docker_mod.NOTSET def config_get_enabled(val, default): - return { - "base_url": docker_mod.NOTSET, - "version": docker_mod.NOTSET, - "docker.url": docker_mod.NOTSET, - "docker.version": docker_mod.NOTSET, - "docker.machine": docker_mod.NOTSET, - "docker.update_mine": True, - }[val] + if val == "docker.update_mine": + return True + return docker_mod.NOTSET mine_mock = Mock() dunder_salt = { @@ -937,19 +927,19 @@ def test_compare_container_image_id_resolution(): """ def _inspect_container_effect(id_): - return { - "container1": { + if id_ == "container1": + return { "Config": {"Image": "realimage:latest"}, "HostConfig": {}, - }, - "container2": {"Config": {"Image": "image_id"}, "HostConfig": {}}, - }[id_] + } + if id_ == "container2": + return {"Config": {"Image": "image_id"}, "HostConfig": {}} def _inspect_image_effect(id_): - return { - "realimage:latest": {"Id": "image_id"}, - "image_id": {"Id": "image_id"}, - }[id_] + if id_ == "realimage:latest": + return {"Id": "image_id"} + if id_ == "image_id": + return {"Id": "image_id"} inspect_container_mock = MagicMock(side_effect=_inspect_container_effect) inspect_image_mock = MagicMock(side_effect=_inspect_image_effect) @@ -967,8 +957,8 @@ def test_compare_container_ulimits_order(): """ def _inspect_container_effect(id_): - return { - "container1": { + if id_ == "container1": + return { "Config": {}, "HostConfig": { "Ulimits": [ @@ -976,8 +966,9 @@ def test_compare_container_ulimits_order(): {"Hard": 65536, "Soft": 65536, "Name": "nofile"}, ] }, - }, - "container2": { + } + if id_ == "container2": + return { "Config": {}, "HostConfig": { "Ulimits": [ @@ -985,8 +976,7 @@ def test_compare_container_ulimits_order(): {"Hard": -1, "Soft": -1, "Name": "core"}, ] }, - }, - }[id_] + } inspect_container_mock = MagicMock(side_effect=_inspect_container_effect) @@ -1004,16 +994,16 @@ def test_compare_container_env_order(): """ def _inspect_container_effect(id_): - return { - "container1": { + if id_ == "container1": + return { "Config": {}, "HostConfig": {"Env": ["FOO=bar", "HELLO=world"]}, - }, - "container2": { + } + if id_ == "container2": + return { "Config": {}, "HostConfig": {"Env": ["HELLO=world", "FOO=bar"]}, - }, - }[id_] + } inspect_container_mock = MagicMock(side_effect=_inspect_container_effect) diff --git a/tests/pytests/unit/modules/file/test_file_line.py b/tests/pytests/unit/modules/file/test_file_line.py index 80030e1417d..5c2e444617e 100644 --- a/tests/pytests/unit/modules/file/test_file_line.py +++ b/tests/pytests/unit/modules/file/test_file_line.py @@ -1633,7 +1633,7 @@ def test_line_insert_ensure_beforeafter_twolines_exists(tempfile_name): ) # pylint: enable=W1401 after, before = ( - file_content.split(os.linesep)[0], + file_content.split(os.linesep, maxsplit=1)[0], file_content.split(os.linesep)[2], ) diff --git a/tests/pytests/unit/modules/file/test_file_lsattr.py b/tests/pytests/unit/modules/file/test_file_lsattr.py index 232f2a22d4b..5e211b06428 100644 --- a/tests/pytests/unit/modules/file/test_file_lsattr.py +++ b/tests/pytests/unit/modules/file/test_file_lsattr.py @@ -79,9 +79,7 @@ def test_if_chattr_version_is_less_than_required_flags_should_ignore_extended(): ) with patch_has_ext, patch_run: actual = set(filemod.lsattr(fname)[fname]) - msg = "Actual: {!r} Expected: {!r}".format( - actual, expected - ) # pylint: disable=E1322 + msg = f"Actual: {actual!r} Expected: {expected!r}" assert actual == expected, msg @@ -107,9 +105,7 @@ def test_if_chattr_version_is_high_enough_then_extended_flags_should_be_returned ) with patch_has_ext, patch_run: actual = set(filemod.lsattr(fname)[fname]) - msg = "Actual: {!r} Expected: {!r}".format( - actual, expected - ) # pylint: disable=E1322 + msg = f"Actual: {actual!r} Expected: {expected!r}" assert actual == expected, msg @@ -135,7 +131,5 @@ def test_if_supports_extended_but_there_are_no_flags_then_none_should_be_returne ) with patch_has_ext, patch_run: actual = set(filemod.lsattr(fname)[fname]) - msg = "Actual: {!r} Expected: {!r}".format( - actual, expected - ) # pylint: disable=E1322 + msg = f"Actual: {actual!r} Expected: {expected!r}" assert actual == expected, msg diff --git a/tests/pytests/unit/modules/file/test_file_module.py b/tests/pytests/unit/modules/file/test_file_module.py index 34fe4fa210d..ea6acc79fdc 100644 --- a/tests/pytests/unit/modules/file/test_file_module.py +++ b/tests/pytests/unit/modules/file/test_file_module.py @@ -506,12 +506,14 @@ def test_get_diff(): mockself.path = path def readlines(mockself): # pylint: disable=unused-argument - return { - "text1": text1.encode("utf8"), - "text2": text2.encode("utf8"), - "binary1": binary1, - "binary2": binary2, - }[mockself.path].splitlines(True) + if mockself.path == "text1": + return text1.encode("utf8").splitlines(True) + if mockself.path == "text2": + return text2.encode("utf8").splitlines(True) + if mockself.path == "binary1": + return binary1.splitlines(True) + if mockself.path == "binary2": + return binary2.splitlines(True) def __enter__(mockself): return mockself diff --git a/tests/pytests/unit/modules/state/test_state.py b/tests/pytests/unit/modules/state/test_state.py index 7c42646bcf7..e08b2be6ad7 100644 --- a/tests/pytests/unit/modules/state/test_state.py +++ b/tests/pytests/unit/modules/state/test_state.py @@ -759,9 +759,7 @@ def test_top(): with patch.object(os.path, "join", mock): mock = MagicMock(return_value=True) with patch.object(state, "_set_retcode", mock): - assert state.top( - "reverse_top.sls " "exclude=exclude.sls" - ) + assert state.top("reverse_top.sls exclude=exclude.sls") def test_highstate(): @@ -800,7 +798,7 @@ def test_highstate(): mock = MagicMock(return_value=True) with patch.object(salt.payload, "Serial", mock): with patch.object(os.path, "join", mock): - with patch.object(state, "_set" "_retcode", mock): + with patch.object(state, "_set_retcode", mock): assert state.highstate(arg) @@ -906,11 +904,11 @@ def test_sls(): assert state.sls(arg, None, None, True, cache=True) MockState.HighState.flag = True - assert state.sls("core,edit" ".vim dev", None, None, True) + assert state.sls("core,edit.vim dev", None, None, True) MockState.HighState.flag = False with patch.object( - state, "_filter_" "running", return_value=True + state, "_filter_running", return_value=True ), patch.object(os.path, "join", return_value=True), patch.object( os, "umask", return_value=True ), patch.object( @@ -922,7 +920,7 @@ def test_sls(): ), patch( "salt.utils.files.fopen", mock_open() ): - assert state.sls("core,edit" ".vim dev", None, None, True) + assert state.sls("core,edit.vim dev", None, None, True) def test_get_test_value(): diff --git a/tests/pytests/unit/modules/test_cp.py b/tests/pytests/unit/modules/test_cp.py index 6caa9ef5938..6700832e345 100644 --- a/tests/pytests/unit/modules/test_cp.py +++ b/tests/pytests/unit/modules/test_cp.py @@ -43,7 +43,10 @@ def test__render_filenames_render_failed(): saltenv = "base" template = "jinja" file_data = "Remember to keep your files well salted." - mock_jinja = lambda *args, **kwargs: {"result": False, "data": file_data} + + def mock_jinja(*args, **kwargs): + return {"result": False, "data": file_data} + with patch.dict(templates.TEMPLATE_REGISTRY, {"jinja": mock_jinja}): with patch("salt.utils.files.fopen", mock_open(read_data=file_data)): pytest.raises( @@ -65,7 +68,10 @@ def test__render_filenames_success(): saltenv = "base" template = "jinja" file_data = "/srv/salt/biscuits" - mock_jinja = lambda *args, **kwargs: {"result": True, "data": file_data} + + def mock_jinja(*args, **kwargs): + return {"result": True, "data": file_data} + ret = (file_data, file_data) # salt.utils.files.fopen can only be mocked once with patch.dict(templates.TEMPLATE_REGISTRY, {"jinja": mock_jinja}): with patch("salt.utils.files.fopen", mock_open(read_data=file_data)): @@ -149,7 +155,8 @@ def test_push(): assert num_opens == 1, num_opens fh_ = m_open.filehandles[filename][0] assert fh_.read.call_count == 2, fh_.read.call_count - req_channel_factory_mock().__enter__().send.assert_called_once_with( + + req_channel_factory_mock().__enter__().send.assert_called_once_with( # pylint: disable=unnecessary-dunder-call dict( loc=fh_.tell(), # pylint: disable=resource-leakage cmd="_file_recv", diff --git a/tests/pytests/unit/modules/test_devinfo.py b/tests/pytests/unit/modules/test_devinfo.py index d3895e53246..8e0db9bfdec 100644 --- a/tests/pytests/unit/modules/test_devinfo.py +++ b/tests/pytests/unit/modules/test_devinfo.py @@ -42,9 +42,17 @@ def test_devices(): "E": {"ID_BUS": "ata"}, } + def _udev_info(key): + if key == "sda": + return hd + if key == "sdb": + return usb + if key == "sr0": + return cdrom + with patch.dict( devinfo.__salt__, - {"udev.info": lambda d: {"sda": hd, "sdb": usb, "sr0": cdrom}[d]}, + {"udev.info": _udev_info}, ), patch.dict(devinfo.__grains__, {"disks": ["sda", "sdb", "sr0"]}): assert devinfo.filter_({"e.id_bus": "ata"}, {}) == ["sda", "sr0"] assert devinfo.filter_({"e.id_bus": "usb"}, {}) == ["sdb"] diff --git a/tests/pytests/unit/modules/test_glassfish.py b/tests/pytests/unit/modules/test_glassfish.py index 159d00cbb16..e6e22b3a696 100644 --- a/tests/pytests/unit/modules/test_glassfish.py +++ b/tests/pytests/unit/modules/test_glassfish.py @@ -33,6 +33,7 @@ def test__api_get(): url="http://localhost:4848/management/domain/ThePath", verify=True, auth=None, + timeout=120, ) @@ -51,6 +52,7 @@ def test__api_post(): verify=True, auth=None, data='{"1": 1}', + timeout=120, ) @@ -69,4 +71,5 @@ def test__api_delete(): verify=True, auth=None, params={1: 1}, + timeout=120, ) diff --git a/tests/pytests/unit/modules/test_gpg.py b/tests/pytests/unit/modules/test_gpg.py index 697f53c6541..67e6f2e0f84 100644 --- a/tests/pytests/unit/modules/test_gpg.py +++ b/tests/pytests/unit/modules/test_gpg.py @@ -621,7 +621,9 @@ def test_export_public_key_to_file(gpghome): keyids="xxxxxxxxxxxxxxxx", output=exported_keyfile, bare=True ) assert ret == GPG_TEST_PUB_KEY - keyfile_contents = pathlib.Path(exported_keyfile).read_text() + keyfile_contents = pathlib.Path(exported_keyfile).read_text( + encoding="utf-8" + ) assert keyfile_contents == GPG_TEST_PUB_KEY @@ -746,7 +748,9 @@ def test_export_secret_key_to_file_with_gpg_passphrase_in_pillar(gpghome): True, passphrase=GPG_TEST_KEY_PASSPHRASE, ) - keyfile_contents = pathlib.Path(exported_keyfile).read_text() + keyfile_contents = pathlib.Path(exported_keyfile).read_text( + encoding="utf-8" + ) assert keyfile_contents == GPG_TEST_PRIV_KEY diff --git a/tests/pytests/unit/modules/test_hg.py b/tests/pytests/unit/modules/test_hg.py index 314b48b2c8e..5d31217b76d 100644 --- a/tests/pytests/unit/modules/test_hg.py +++ b/tests/pytests/unit/modules/test_hg.py @@ -97,18 +97,15 @@ def test_status_multiple(): """ Test for Status to a given repository (cwd is list) """ + + def func(*args, **kwargs): + if kwargs["cwd"] == "dir 0": + return "A file 0\n" + return "M file 1" + with patch.dict( hg.__salt__, - { - "cmd.run_stdout": MagicMock( - side_effect=( - lambda *args, **kwargs: { - "dir 0": "A file 0\n", - "dir 1": "M file 1", - }[kwargs["cwd"]] - ) - ) - }, + {"cmd.run_stdout": MagicMock(side_effect=func)}, ): assert hg.status(["dir 0", "dir 1"]) == { "dir 0": {"added": ["file 0"]}, diff --git a/tests/pytests/unit/modules/test_mount.py b/tests/pytests/unit/modules/test_mount.py index 3a4e1d544e3..ea5feb8a5e0 100644 --- a/tests/pytests/unit/modules/test_mount.py +++ b/tests/pytests/unit/modules/test_mount.py @@ -416,8 +416,6 @@ def test_set_filesystems_with_data(tmp_sub_dir, config_file): Tests to verify set_filesystems reads and adjusts file /etc/filesystems correctly """ # Note AIX uses tabs in filesystems files, hence disable warings and errors for tabs and spaces - # pylint: disable=W8191 - # pylint: disable=E8101 config_filepath = str(tmp_sub_dir / "filesystems") with patch.dict(mount.__grains__, {"os": "AIX", "kernel": "AIX"}): mount.set_filesystems( diff --git a/tests/pytests/unit/modules/test_salt_version.py b/tests/pytests/unit/modules/test_salt_version.py index 4b7a7cd0731..6e3a09cbe78 100644 --- a/tests/pytests/unit/modules/test_salt_version.py +++ b/tests/pytests/unit/modules/test_salt_version.py @@ -29,8 +29,7 @@ def test_mocked_objects(): else: assert len(v) == 2 - sv = sv.__str__() - assert isinstance(sv, str) + assert isinstance(str(sv), str) with patch("salt.version.SaltStackVersion.LNAMES", {"neon": (2019, 8)}): sv = salt.version.SaltStackVersion.from_name("Neon") diff --git a/tests/pytests/unit/modules/test_solaris_shadow.py b/tests/pytests/unit/modules/test_solaris_shadow.py index 4cc99c6e983..85d7aa41fcd 100644 --- a/tests/pytests/unit/modules/test_solaris_shadow.py +++ b/tests/pytests/unit/modules/test_solaris_shadow.py @@ -29,7 +29,7 @@ skip_on_missing_pwd = pytest.mark.skipif( missing_pwd, reason="Has no pwd module for accessing /etc/password passwords" ) -# pylint: disable=singleton-comparison,comparison-to-True-should-be-if-cond-is-True-or-if-cond +# pylint: disable=singleton-comparison # TODO: A lot of the shadow functionality is common across solaris and Linux. # It would be possible to combine some of this into salt/utils -W. Werner, 2021-01-26 diff --git a/tests/pytests/unit/modules/test_win_powercfg.py b/tests/pytests/unit/modules/test_win_powercfg.py index e1cd9426a4c..ab6f0ee6258 100644 --- a/tests/pytests/unit/modules/test_win_powercfg.py +++ b/tests/pytests/unit/modules/test_win_powercfg.py @@ -168,7 +168,7 @@ def test_get_disk_timeout(query_output): calls = [ call("powercfg /getactivescheme", python_shell=False), call( - "powercfg /q 381b4222-f694-41f0-9685-ff5bb260df2e SUB_DISK" " DISKIDLE", + "powercfg /q 381b4222-f694-41f0-9685-ff5bb260df2e SUB_DISK DISKIDLE", python_shell=False, ), ] diff --git a/tests/pytests/unit/modules/test_zabbix.py b/tests/pytests/unit/modules/test_zabbix.py index 5c2f8fc7ee5..fd9fae8c1a6 100644 --- a/tests/pytests/unit/modules/test_zabbix.py +++ b/tests/pytests/unit/modules/test_zabbix.py @@ -407,7 +407,6 @@ def test_user_exists(conn_args, set_zabbix_version, query_return, mock_login): """ module_return = True - # pylint: disable=E8128 query_return( { "jsonrpc": "2.0", @@ -464,7 +463,6 @@ def test_user_get(conn_args, set_zabbix_version, query_return, mock_login): "type": "3", } ] - # pylint: disable=E8128 query_return( { "jsonrpc": "2.0", @@ -547,7 +545,6 @@ def test_user_getmedia(conn_args, set_zabbix_version, query_return, mock_login): "active": "0", } ] - # pylint: disable=E8128 query_return( { "jsonrpc": "2.0", @@ -707,7 +704,6 @@ def test_user_list(conn_args, query_return, mock_login): "type": "1", }, ] - # pylint: disable=E8128 query_return( { "jsonrpc": "2.0", @@ -924,7 +920,6 @@ def test_usergroup_list(conn_args, query_return, mock_login): "users_status": "0", }, ] - # pylint: disable=E8128 query_return( { "jsonrpc": "2.0", diff --git a/tests/pytests/unit/modules/virt/conftest.py b/tests/pytests/unit/modules/virt/conftest.py index 03225530056..fb0d8746c57 100644 --- a/tests/pytests/unit/modules/virt/conftest.py +++ b/tests/pytests/unit/modules/virt/conftest.py @@ -39,7 +39,7 @@ class MappedResultMock(MagicMock): def __init__(self): def mapped_results(*args, **kwargs): - if args[0] not in self._instances.keys(): + if args[0] not in self._instances: raise virt.libvirt.libvirtError("Not found: {}".format(args[0])) return self._instances[args[0]] diff --git a/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py b/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py index f808dbf4467..56eecd4bbc2 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py +++ b/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py @@ -83,7 +83,7 @@ def lgpo_bin(): # download lgpo.zip log.debug("Downloading LGPO.exe from Microsoft") url = "https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FFA-9429-7E023E7DA8D8/LGPO.zip" - r = requests.get(url) + r = requests.get(url, timeout=60) with salt.utils.files.fopen(zip_file, "wb") as f: f.write(r.content) # extract zip diff --git a/tests/pytests/unit/pillar/test_consul_pillar.py b/tests/pytests/unit/pillar/test_consul_pillar.py index 430f7aa5e43..b37d5f7876e 100644 --- a/tests/pytests/unit/pillar/test_consul_pillar.py +++ b/tests/pytests/unit/pillar/test_consul_pillar.py @@ -54,9 +54,7 @@ def configure_loader_modules(): def test_connection(base_pillar_data): - with patch.dict( - consul_pillar.__salt__, {"grains.get": MagicMock(return_value=({}))} - ): + with patch.dict(consul_pillar.__salt__, {"grains.get": MagicMock(return_value={})}): with patch.object( consul_pillar, "consul_fetch", @@ -71,9 +69,7 @@ def test_connection(base_pillar_data): def test_pillar_data(base_pillar_data): - with patch.dict( - consul_pillar.__salt__, {"grains.get": MagicMock(return_value=({}))} - ): + with patch.dict(consul_pillar.__salt__, {"grains.get": MagicMock(return_value={})}): with patch.object( consul_pillar, "consul_fetch", @@ -90,9 +86,7 @@ def test_pillar_data(base_pillar_data): def test_blank_root(base_pillar_data): - with patch.dict( - consul_pillar.__salt__, {"grains.get": MagicMock(return_value=({}))} - ): + with patch.dict(consul_pillar.__salt__, {"grains.get": MagicMock(return_value={})}): with patch.object( consul_pillar, "consul_fetch", @@ -104,9 +98,7 @@ def test_blank_root(base_pillar_data): def test_pillar_nest(base_pillar_data): - with patch.dict( - consul_pillar.__salt__, {"grains.get": MagicMock(return_value=({}))} - ): + with patch.dict(consul_pillar.__salt__, {"grains.get": MagicMock(return_value={})}): with patch.object( consul_pillar, "consul_fetch", @@ -122,9 +114,7 @@ def test_pillar_nest(base_pillar_data): def test_value_parsing(base_pillar_data): - with patch.dict( - consul_pillar.__salt__, {"grains.get": MagicMock(return_value=({}))} - ): + with patch.dict(consul_pillar.__salt__, {"grains.get": MagicMock(return_value={})}): with patch.object( consul_pillar, "consul_fetch", @@ -137,9 +127,7 @@ def test_value_parsing(base_pillar_data): def test_non_expansion(base_pillar_data): - with patch.dict( - consul_pillar.__salt__, {"grains.get": MagicMock(return_value=({}))} - ): + with patch.dict(consul_pillar.__salt__, {"grains.get": MagicMock(return_value={})}): with patch.object( consul_pillar, "consul_fetch", diff --git a/tests/pytests/unit/proxy/test_napalm.py b/tests/pytests/unit/proxy/test_napalm.py index f93279af900..2a537b8d61e 100644 --- a/tests/pytests/unit/proxy/test_napalm.py +++ b/tests/pytests/unit/proxy/test_napalm.py @@ -276,7 +276,7 @@ def test_grains_refresh(test_opts): def test_fns(): ret = napalm_proxy.fns() - assert "details" in ret.keys() + assert "details" in ret def test_shutdown(test_opts): diff --git a/tests/pytests/unit/runners/test_asam.py b/tests/pytests/unit/runners/test_asam.py index 285138781b7..2f2f7d7e786 100644 --- a/tests/pytests/unit/runners/test_asam.py +++ b/tests/pytests/unit/runners/test_asam.py @@ -44,6 +44,7 @@ def test_add_platform(): auth=("TheUsername", "ThePassword"), data={"manual": "false"}, verify=True, + timeout=120, ) @@ -69,6 +70,7 @@ def test_remove_platform(): "Submit": "Yes", }, verify=True, + timeout=120, ) @@ -88,6 +90,7 @@ def test_list_platforms(): auth=("TheUsername", "ThePassword"), data={"manual": "false"}, verify=True, + timeout=120, ) @@ -107,4 +110,5 @@ def test_list_platform_sets(): auth=("TheUsername", "ThePassword"), data={"manual": "false"}, verify=True, + timeout=120, ) diff --git a/tests/pytests/unit/runners/vault/test_app_role_auth.py b/tests/pytests/unit/runners/vault/test_app_role_auth.py index 241da179a37..14d5dc77ef7 100644 --- a/tests/pytests/unit/runners/vault/test_app_role_auth.py +++ b/tests/pytests/unit/runners/vault/test_app_role_auth.py @@ -73,7 +73,14 @@ def test_generate_token(): headers=ANY, json=ANY, verify=ANY, + timeout=120, + ), + call( + "http://fake_url", + headers=ANY, + json=ANY, + verify=ANY, + timeout=120, ), - call("http://fake_url", headers=ANY, json=ANY, verify=ANY), ] mock.assert_has_calls(calls) diff --git a/tests/pytests/unit/runners/vault/test_token_auth.py b/tests/pytests/unit/runners/vault/test_token_auth.py index 60307dc0955..fcd0ef8058b 100644 --- a/tests/pytests/unit/runners/vault/test_token_auth.py +++ b/tests/pytests/unit/runners/vault/test_token_auth.py @@ -68,7 +68,9 @@ def test_generate_token(): assert "error" not in result assert "token" in result assert result["token"] == "test" - mock.assert_called_with("http://fake_url", headers=ANY, json=ANY, verify=ANY) + mock.assert_called_with( + "http://fake_url", headers=ANY, json=ANY, verify=ANY, timeout=120 + ) # Test uses num_uses = 6 @@ -85,7 +87,11 @@ def test_generate_token(): }, } mock.assert_called_with( - "http://fake_url", headers=ANY, json=json_request, verify=ANY + "http://fake_url", + headers=ANY, + json=json_request, + verify=ANY, + timeout=120, ) # Test ttl @@ -103,7 +109,7 @@ def test_generate_token(): }, } mock.assert_called_with( - "http://fake_url", headers=ANY, json=json_request, verify=ANY + "http://fake_url", headers=ANY, json=json_request, verify=ANY, timeout=120 ) mock = _mock_json_response({}, status_code=403, reason="no reason") @@ -152,4 +158,5 @@ def test_generate_token_with_namespace(): }, json=ANY, verify=ANY, + timeout=120, ) diff --git a/tests/pytests/unit/serializers/test_serializers.py b/tests/pytests/unit/serializers/test_serializers.py index 0f3125c89e3..2d46f320b82 100644 --- a/tests/pytests/unit/serializers/test_serializers.py +++ b/tests/pytests/unit/serializers/test_serializers.py @@ -284,12 +284,12 @@ def test_sls_repr(): sls_obj = convert(OrderedDict([("foo", "bar"), ("baz", "qux")])) # ensure that repr and str are yaml friendly - assert sls_obj.__str__() == "{foo: bar, baz: qux}" - assert sls_obj.__repr__() == "{foo: bar, baz: qux}" + assert str(sls_obj) == "{foo: bar, baz: qux}" + assert repr(sls_obj) == "{foo: bar, baz: qux}" # ensure that repr and str are already quoted - assert sls_obj["foo"].__str__() == '"bar"' - assert sls_obj["foo"].__repr__() == '"bar"' + assert str(sls_obj["foo"]) == '"bar"' + assert repr(sls_obj["foo"]) == '"bar"' @pytest.mark.skipif(yamlex.available is False, reason=SKIP_MESSAGE.format("sls")) diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py index db91a0109d7..4bf8f4f751a 100644 --- a/tests/pytests/unit/state/test_state_compiler.py +++ b/tests/pytests/unit/state/test_state_compiler.py @@ -11,7 +11,6 @@ import salt.state import salt.utils.files import salt.utils.platform from salt.exceptions import CommandExecutionError -from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch log = logging.getLogger(__name__) @@ -56,21 +55,21 @@ def test_render_error_on_invalid_requisite(minion_opts): """ with patch("salt.state.State._gather_pillar"): high_data = { - "git": OrderedDict( + "git": salt.state.HashableOrderedDict( [ ( "pkg", [ - OrderedDict( + salt.state.HashableOrderedDict( [ ( "require", [ - OrderedDict( + salt.state.HashableOrderedDict( [ ( "file", - OrderedDict( + salt.state.HashableOrderedDict( [("test1", "test")] ), ) @@ -89,7 +88,9 @@ def test_render_error_on_invalid_requisite(minion_opts): ] ) } - minion_opts["pillar"] = {"git": OrderedDict([("test1", "test")])} + minion_opts["pillar"] = { + "git": salt.state.HashableOrderedDict([("test1", "test")]) + } state_obj = salt.state.State(minion_opts) with pytest.raises(salt.exceptions.SaltRenderError): state_obj.call_high(high_data) @@ -720,13 +721,22 @@ def test_render_requisite_require_disabled(minion_opts): """ with patch("salt.state.State._gather_pillar"): high_data = { - "step_one": OrderedDict( + "step_one": salt.state.HashableOrderedDict( [ ( "test", [ - OrderedDict( - [("require", [OrderedDict([("test", "step_two")])])] + salt.state.HashableOrderedDict( + [ + ( + "require", + [ + salt.state.HashableOrderedDict( + [("test", "step_two")] + ) + ], + ) + ] ), "succeed_with_changes", {"order": 10000}, @@ -764,16 +774,20 @@ def test_render_requisite_require_in_disabled(minion_opts): "__env__": "base", "__sls__": "test.disable_require_in", }, - "step_two": OrderedDict( + "step_two": salt.state.HashableOrderedDict( [ ( "test", [ - OrderedDict( + salt.state.HashableOrderedDict( [ ( "require_in", - [OrderedDict([("test", "step_one")])], + [ + salt.state.HashableOrderedDict( + [("test", "step_one")] + ) + ], ) ] ), @@ -974,7 +988,7 @@ def test_mod_aggregate(minion_opts): "__sls__": "test.62439", "__env__": "base", "__id__": "sl", - "require_in": [OrderedDict([("file", "/tmp/foo")])], + "require_in": [salt.state.HashableOrderedDict([("file", "/tmp/foo")])], "order": 10002, "aggregate": True, "fun": "installed", @@ -1000,7 +1014,7 @@ def test_mod_aggregate(minion_opts): "__env__": "base", "__id__": "figlet", "__agg__": True, - "require": [OrderedDict([("file", "/tmp/foo")])], + "require": [salt.state.HashableOrderedDict([("file", "/tmp/foo")])], "order": 10001, "aggregate": True, "fun": "installed", @@ -1011,7 +1025,7 @@ def test_mod_aggregate(minion_opts): "__sls__": "test.62439", "__env__": "base", "__id__": "sl", - "require_in": [OrderedDict([("file", "/tmp/foo")])], + "require_in": [salt.state.HashableOrderedDict([("file", "/tmp/foo")])], "order": 10002, "aggregate": True, "fun": "installed", @@ -1026,7 +1040,7 @@ def test_mod_aggregate(minion_opts): "__sls__": "test.62439", "__env__": "base", "__id__": "sl", - "require_in": [OrderedDict([("file", "/tmp/foo")])], + "require_in": [salt.state.HashableOrderedDict([("file", "/tmp/foo")])], "order": 10002, "fun": "installed", "__agg__": True, @@ -1045,7 +1059,9 @@ def test_mod_aggregate(minion_opts): assert "require_in" in low_ret # Ensure all the requires from pkg states are in low - assert low_ret["require_in"] == [OrderedDict([("file", "/tmp/foo")])] + assert low_ret["require_in"] == [ + salt.state.HashableOrderedDict([("file", "/tmp/foo")]) + ] # Ensure that the require requisite from the # figlet state doesn't find its way into this state @@ -1190,7 +1206,7 @@ def test_load_modules_list(minion_opts): "__sls__": "test", "__env__": "base", "__id__": "nginx", - "provider": [OrderedDict([("cmd", "cmdmod")])], + "provider": [salt.state.HashableOrderedDict([("cmd", "cmdmod")])], "order": 10000, "fun": "installed", } @@ -1215,7 +1231,7 @@ def test_load_modules_dict(minion_opts): "__sls__": "test", "__env__": "base", "__id__": "nginx", - "provider": OrderedDict([("cmd", "test")]), + "provider": salt.state.HashableOrderedDict([("cmd", "test")]), "order": 10000, "fun": "installed", } diff --git a/tests/pytests/unit/states/test_host.py b/tests/pytests/unit/states/test_host.py index 3a3ab022a02..92e7c5f0a67 100644 --- a/tests/pytests/unit/states/test_host.py +++ b/tests/pytests/unit/states/test_host.py @@ -259,11 +259,7 @@ def test_present(): ): ret = host.present(hostname, ip_str) assert ret["result"] is True - assert ( - ret["comment"] - == "Host {} ({}) already present".format(hostname, ip_str) - in ret["comment"] - ) + assert "Host {} ({}) already present".format(hostname, ip_str) in ret["comment"] assert ret["changes"] == {}, ret["changes"] assert add_host.mock_calls == [], add_host.mock_calls assert rm_host.mock_calls == [], rm_host.mock_calls diff --git a/tests/pytests/unit/transport/test_zeromq.py b/tests/pytests/unit/transport/test_zeromq.py index 97d65a204ad..ec93a72439e 100644 --- a/tests/pytests/unit/transport/test_zeromq.py +++ b/tests/pytests/unit/transport/test_zeromq.py @@ -616,7 +616,7 @@ def test_req_server_chan_encrypt_v2(pki_dir): if HAS_M2: aes = key.private_decrypt(ret["key"], RSA.pkcs1_oaep_padding) else: - cipher = PKCS1_OAEP.new(key) + cipher = PKCS1_OAEP.new(key) # pylint: disable=used-before-assignment aes = cipher.decrypt(ret["key"]) pcrypt = salt.crypt.Crypticle(opts, aes) signed_msg = pcrypt.loads(ret[dictkey]) @@ -1541,7 +1541,7 @@ async def test_unclosed_request_client(minion_opts, io_loop): try: assert client._closing is False with pytest.warns(salt.transport.base.TransportWarning): - client.__del__() + client.__del__() # pylint: disable=unnecessary-dunder-call finally: client.close() @@ -1557,6 +1557,6 @@ async def test_unclosed_publish_client(minion_opts, io_loop): try: assert client._closing is False with pytest.warns(salt.transport.base.TransportWarning): - client.__del__() + client.__del__() # pylint: disable=unnecessary-dunder-call finally: client.close() diff --git a/tests/pytests/unit/utils/test_cloud.py b/tests/pytests/unit/utils/test_cloud.py index 0bfe6d28ce6..7edce2000af 100644 --- a/tests/pytests/unit/utils/test_cloud.py +++ b/tests/pytests/unit/utils/test_cloud.py @@ -59,18 +59,18 @@ def create_class(tmp_path): def set_password( self, servicename, username, password - ): # pylint: disable=arguments-differ + ): # pylint: disable=arguments-differ,arguments-renamed self.__storage.setdefault(servicename, {}).update({username: password}) return 0 def get_password( self, servicename, username - ): # pylint: disable=arguments-differ + ): # pylint: disable=arguments-differ,arguments-renamed return self.__storage.setdefault(servicename, {}).get(username) def delete_password( self, servicename, username - ): # pylint: disable=arguments-differ + ): # pylint: disable=arguments-differ,arguments-renamed self.__storage.setdefault(servicename, {}).pop(username, None) return 0 @@ -249,6 +249,7 @@ def test_run_psexec_command_cleanup_lingering_paexec(caplog): "MermaidMan", "BarnicleBoy", ) + # pylint: disable=no-value-for-parameter mock_client.return_value.cleanup = MagicMock(side_effect=CannotDelete()) cloud.run_psexec_command( @@ -475,7 +476,7 @@ def test_winrm_pinnned_version(): ): try: - import winrm + import winrm # pylint: disable=unused-import except ImportError: raise pytest.skip('The "winrm" python module is not installed in this env.') else: diff --git a/tests/pytests/unit/utils/test_data.py b/tests/pytests/unit/utils/test_data.py index 5614a770316..e6a6cdd6185 100644 --- a/tests/pytests/unit/utils/test_data.py +++ b/tests/pytests/unit/utils/test_data.py @@ -14,8 +14,13 @@ from tests.support.unit import LOREM_IPSUM log = logging.getLogger(__name__) -_b = lambda x: x.encode("utf-8") -_s = lambda x: salt.utils.stringutils.to_str(x, normalize=True) + +def _b(x): + return x.encode("utf-8") + + +def _s(x): + return salt.utils.stringutils.to_str(x, normalize=True) @pytest.fixture @@ -566,7 +571,9 @@ def test_encode(get_test_data, get_BYTES, get_EGGS): None, [True, _b(get_EGGS), get_BYTES], ] - expected[11][_b("subdict")][_b("tuple")] = [ + expected[11][_b("subdict")][ # pylint: disable=unsupported-assignment-operation + _b("tuple") + ] = [ 123, _b("hello"), _b("world"), diff --git a/tests/pytests/unit/utils/test_vault.py b/tests/pytests/unit/utils/test_vault.py index 9e3dfe59f16..af755cadd4b 100644 --- a/tests/pytests/unit/utils/test_vault.py +++ b/tests/pytests/unit/utils/test_vault.py @@ -301,6 +301,7 @@ def test_make_request_single_use_token_run_ok(json_success, cache_single): "http://127.0.0.1:8200/key", headers=expected_headers, verify=ANY, + timeout=ANY, ) assert vault_return.json() == json_success @@ -324,6 +325,7 @@ def test_make_request_single_use_token_run_auth_error(json_denied, cache_single) "http://127.0.0.1:8200/key", headers=expected_headers, verify=ANY, + timeout=ANY, ) assert vault_return.json() == json_denied mock_del_cache.assert_called() @@ -358,6 +360,7 @@ def test_multi_use_token_successful_run(json_success, cache_uses): "http://127.0.0.1:8200/key", headers=expected_headers, verify=ANY, + timeout=ANY, ) mock_write_cache.assert_called_with(expected_cache_write) assert vault_return.json() == json_success @@ -381,6 +384,7 @@ def test_multi_use_token_last_use(json_success, cache_uses_last): "http://127.0.0.1:8200/key", headers=expected_headers, verify=ANY, + timeout=ANY, ) mock_del_cache.assert_called() assert vault_return.json() == json_success @@ -404,6 +408,7 @@ def test_unlimited_use_token_no_decrement(json_success, cache_unlimited): "http://127.0.0.1:8200/key", headers=expected_headers, verify=ANY, + timeout=ANY, ) assert ( not mock_del_cache.called @@ -508,6 +513,7 @@ def test_request_with_namespace(json_success, cache_single_namespace): "http://127.0.0.1:8200/key", headers=expected_headers, verify=ANY, + timeout=ANY, ) assert vault_return.json() == json_success diff --git a/tests/pytests/unit/utils/test_vt.py b/tests/pytests/unit/utils/test_vt.py index c31b25e623c..692bbf76f61 100644 --- a/tests/pytests/unit/utils/test_vt.py +++ b/tests/pytests/unit/utils/test_vt.py @@ -51,6 +51,6 @@ def test_log_sanitize(test_cmd, caplog): stream_stderr=False, ) with caplog.at_level(logging.DEBUG): - ret = term.recv() + term.recv() assert password not in caplog.text assert "******" in caplog.text diff --git a/tests/pytests/unit/wheel/test_file_roots.py b/tests/pytests/unit/wheel/test_file_roots.py index 5c8c54f23a5..4da2f359f2c 100644 --- a/tests/pytests/unit/wheel/test_file_roots.py +++ b/tests/pytests/unit/wheel/test_file_roots.py @@ -17,7 +17,7 @@ def _make_temp_root_file(root, *subpaths, binary=False, dir_only=False): full_path.write_bytes(content) else: content = str(full_path) - full_path.write_text(content) + full_path.write_text(content, encoding="utf-8") @pytest.fixture diff --git a/tests/salt-tcpdump.py b/tests/salt-tcpdump.py index 4a92966132b..c16e98a20e6 100644 --- a/tests/salt-tcpdump.py +++ b/tests/salt-tcpdump.py @@ -34,7 +34,7 @@ tcpdump "tcp[tcpflags] & tcp-syn != 0" and port 4506 and "tcp[tcpflags] & tcp-ac """ # pylint: disable=resource-leakage -import argparse # pylint: disable=minimum-python-version +import argparse import socket import sys import time @@ -124,7 +124,7 @@ class PCAPParser: packet_data = {"ip": {}, "tcp": {}} - (header, packet) = cap.next() # pylint: disable=incompatible-py3-code + (header, packet) = cap.next() eth_length, eth_protocol = self.parse_ether(packet) @@ -232,7 +232,7 @@ class SaltNetstat: """ Read the table of tcp connections & remove header """ - with open("/proc/net/tcp") as tcp_f: + with open("/proc/net/tcp", encoding="utf-8") as tcp_f: content = tcp_f.readlines() content.pop(0) return content diff --git a/tests/saltsh.py b/tests/saltsh.py index 64ace99cc3b..de87f55d9e7 100644 --- a/tests/saltsh.py +++ b/tests/saltsh.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -'''\ +''' Welcome to the Salt repl which exposes the execution environment of a minion in a pre-configured Python shell @@ -91,9 +91,11 @@ def get_salt_vars(): __pillar__ = {} # pylint: disable=invalid-name,unused-variable,possibly-unused-variable - JINJA = lambda x, **y: jinja2.Template(x).render( - grains=__grains__, salt=__salt__, opts=__opts__, pillar=__pillar__, **y - ) + def JINJA(x, **y): + return jinja2.Template(x).render( + grains=__grains__, salt=__salt__, opts=__opts__, pillar=__pillar__, **y + ) + # pylint: enable=invalid-name,unused-variable,possibly-unused-variable return locals() diff --git a/tests/support/copyartifacts.py b/tests/support/copyartifacts.py index a3054d80931..b0e5382a07f 100644 --- a/tests/support/copyartifacts.py +++ b/tests/support/copyartifacts.py @@ -2,7 +2,7 @@ Script for copying back xml junit files from tests """ -import argparse # pylint: disable=minimum-python-version +import argparse import os import subprocess @@ -19,13 +19,12 @@ class DownloadArtifacts: self.sftpclient = paramiko.SFTPClient.from_transport(self.transport) def setup_transport(self): - # pylint: disable=minimum-python-version + config = salt.utils.yaml.safe_load( subprocess.check_output( ["bundle", "exec", "kitchen", "diagnose", self.instance] ) ) - # pylint: enable=minimum-python-version state = config["instances"][self.instance]["state_file"] tport = config["instances"][self.instance]["transport"] transport = paramiko.Transport( @@ -44,9 +43,7 @@ class DownloadArtifacts: Make sure all xml files are readable by the world so that anyone can grab them """ for remote, _ in self.artifacts: - self.transport.open_session().exec_command( - "sudo chmod -R +r {}".format(remote) - ) + self.transport.open_session().exec_command(f"sudo chmod -R +r {remote}") def download(self): self._set_permissions() @@ -61,11 +58,11 @@ class DownloadArtifacts: self._do_download(remote, os.path.join(local, os.path.basename(remote))) def _do_download(self, remote, local): - print("Copying from {} to {}".format(remote, local)) + print(f"Copying from {remote} to {local}") try: self.sftpclient.get(remote, local) except OSError: - print("Failed to copy: {}".format(remote)) + print(f"Failed to copy: {remote}") if __name__ == "__main__": diff --git a/tests/support/generate-names-file-from-failed-test-reports.py b/tests/support/generate-names-file-from-failed-test-reports.py index ac4b13b2fe8..e565f335cf4 100644 --- a/tests/support/generate-names-file-from-failed-test-reports.py +++ b/tests/support/generate-names-file-from-failed-test-reports.py @@ -43,7 +43,7 @@ def main(): failures = set() for fname in sorted(glob.glob(os.path.join(options.reports_dir, "*.xml"))): total_xml_reports += 1 - with open(fname) as rfh: + with open(fname, encoding="utf-8") as rfh: test_suite, test_result = xunitparser.parse(rfh) if not test_result.errors and not test_result.failures: continue @@ -54,7 +54,7 @@ def main(): if not total_xml_reports: parser.exit(status=1, message="No JUnit XML files were parsed") - with open(options.output_file, "w") as wfh: + with open(options.output_file, "w", encoding="utf-8") as wfh: wfh.write(os.linesep.join(sorted(failures))) parser.exit(status=0) diff --git a/tests/support/pkg.py b/tests/support/pkg.py index 3d0e086e077..57feac63855 100644 --- a/tests/support/pkg.py +++ b/tests/support/pkg.py @@ -256,7 +256,7 @@ class SaltPkgInstall: self.install_dir / "salt-minion.exe" ).exists() and not self.relenv: log.debug( - f"Removing {(self.install_dir / 'salt-minion.exe')}" + "Removing %s", self.install_dir / "salt-minion.exe" ) (self.install_dir / "salt-minion.exe").unlink() @@ -640,7 +640,8 @@ class SaltPkgInstall: Pin: origin "repo.saltproject.io" Pin-Priority: 1001 """ - ) + ), + encoding="utf-8", ) cmd.append("--allow-downgrades") env = os.environ.copy() @@ -1487,7 +1488,7 @@ class ApiRequest: @pytest.helpers.register def download_file(url, dest, auth=None): # NOTE the stream=True parameter below - with requests.get(url, stream=True, auth=auth) as r: + with requests.get(url, stream=True, auth=auth, timeout=60) as r: r.raise_for_status() with salt.utils.files.fopen(dest, "wb") as f: for chunk in r.iter_content(chunk_size=8192): diff --git a/tests/support/pytest/etcd.py b/tests/support/pytest/etcd.py index 6606e9436b8..7bcc44fda03 100644 --- a/tests/support/pytest/etcd.py +++ b/tests/support/pytest/etcd.py @@ -59,7 +59,9 @@ def confirm_container_started(timeout_at, container): sleeptime = 1 while time.time() <= timeout_at: try: - response = requests.get("http://localhost:{}/version".format(etcd_port)) + response = requests.get( + "http://localhost:{}/version".format(etcd_port), timeout=60 + ) try: version = response.json() if "etcdserver" in version: diff --git a/tests/support/pytest/helpers.py b/tests/support/pytest/helpers.py index fa12784c04e..e6752ee7070 100644 --- a/tests/support/pytest/helpers.py +++ b/tests/support/pytest/helpers.py @@ -706,13 +706,17 @@ class EntropyGenerator: log.info("The '%s' file is not avilable", kernel_entropy_file) return - self.current_entropy = int(kernel_entropy_file.read_text().strip()) + self.current_entropy = int( + kernel_entropy_file.read_text(encoding="utf-8").strip() + ) log.info("Available Entropy: %s", self.current_entropy) if not kernel_poolsize_file.exists(): log.info("The '%s' file is not avilable", kernel_poolsize_file) else: - self.current_poolsize = int(kernel_poolsize_file.read_text().strip()) + self.current_poolsize = int( + kernel_poolsize_file.read_text(encoding="utf-8").strip() + ) log.info("Entropy Poolsize: %s", self.current_poolsize) # Account for smaller poolsizes using BLAKE2s if self.current_poolsize == 256: @@ -738,7 +742,9 @@ class EntropyGenerator: raise pytest.skip.Exception(message, _use_item_location=True) raise pytest.fail(message) subprocess.run([rngd, "-r", "/dev/urandom"], shell=False, check=True) - self.current_entropy = int(kernel_entropy_file.read_text().strip()) + self.current_entropy = int( + kernel_entropy_file.read_text(encoding="utf-8").strip() + ) log.info("Available Entropy: %s", self.current_entropy) if self.current_entropy >= self.minimum_entropy: break @@ -773,7 +779,9 @@ class EntropyGenerator: check=True, ) os.unlink(target_file.name) - self.current_entropy = int(kernel_entropy_file.read_text().strip()) + self.current_entropy = int( + kernel_entropy_file.read_text(encoding="utf-8").strip() + ) log.info("Available Entropy: %s", self.current_entropy) if self.current_entropy >= self.minimum_entropy: break diff --git a/tests/support/unit.py b/tests/support/unit.py index dc1051ea773..419e287b92f 100644 --- a/tests/support/unit.py +++ b/tests/support/unit.py @@ -158,7 +158,6 @@ class TestLoader(_TestLoader): class TestCase(_TestCase): - # pylint: disable=expected-an-indented-block-comment,too-many-leading-hastag-for-block-comment ## Commented out because it may be causing tests to hang ## at the end of the run # @@ -178,7 +177,6 @@ class TestCase(_TestCase): # print('\nWARNING: A misbehaving test has modified the working directory!\nThe test suite has reset the working directory ' # 'on tearDown() to {0}\n'.format(cls._cwd)) # cls._chdir_counter += 1 - # pylint: enable=expected-an-indented-block-comment,too-many-leading-hastag-for-block-comment def run(self, result=None): self._prerun_instance_attributes = dir(self) @@ -225,7 +223,7 @@ class TestCase(_TestCase): found_zombies += 1 except Exception: # pylint: disable=broad-except pass - proc_info += "|Z:{}".format(found_zombies) + proc_info += f"|Z:{found_zombies}" proc_info += "] {short_desc}".format(short_desc=desc if desc else "") return proc_info else: diff --git a/tests/support/win_installer.py b/tests/support/win_installer.py index 6a2f387dc84..65d39a40d1a 100644 --- a/tests/support/win_installer.py +++ b/tests/support/win_installer.py @@ -29,12 +29,15 @@ def download_and_verify(fp, name, repo=REPO): Download an installer and verify its contents. """ md5 = "{}.md5".format(name) - url = lambda x: "{}/{}".format(repo, x) - resp = requests.get(url(md5)) + + def url(x): + return "{}/{}".format(repo, x) + + resp = requests.get(url(md5), timeout=60) if resp.status_code != 200: raise Exception("Unable to fetch installer md5") installer_md5 = resp.text.strip().split()[0].lower() - resp = requests.get(url(name), stream=True) + resp = requests.get(url(name), stream=True, timeout=60) if resp.status_code != 200: raise Exception("Unable to fetch installer") md5hsh = hashlib.md5() diff --git a/tests/unit/ext/test_ipaddress.py b/tests/unit/ext/test_ipaddress.py index e4b2f98c357..474d05192fc 100644 --- a/tests/unit/ext/test_ipaddress.py +++ b/tests/unit/ext/test_ipaddress.py @@ -13,7 +13,7 @@ """Unittest for ipaddress module.""" -# pylint: disable=string-substitution-usage-error,pointless-statement,abstract-method,cell-var-from-loop +# pylint: disable=pointless-statement,abstract-method,cell-var-from-loop,unnecessary-dunder-call import contextlib import functools @@ -312,7 +312,7 @@ class AddressTestCase_v4(BaseTestCase, CommonTestMixin_v4): def test_invalid_characters(self): def assertBadOctet(addr, octet): - msg = "Only decimal digits permitted in {!r} in {!r}".format(octet, addr) + msg = f"Only decimal digits permitted in {octet!r} in {addr!r}" with self.assertAddressError(re.escape(msg)): ipaddress.IPv4Address(addr) @@ -657,7 +657,7 @@ class NetmaskTestMixin_v4(CommonTestMixin_v4): def assertBadNetmask(addr, netmask): msg = "%r is not a valid netmask" % netmask with self.assertNetmaskError(re.escape(msg)): - self.factory("{}/{}".format(addr, netmask)) + self.factory(f"{addr}/{netmask}") assertBadNetmask("1.2.3.4", "") assertBadNetmask("1.2.3.4", "-1") @@ -827,7 +827,7 @@ class NetmaskTestMixin_v6(CommonTestMixin_v6): def assertBadNetmask(addr, netmask): msg = "%r is not a valid netmask" % netmask with self.assertNetmaskError(re.escape(msg)): - self.factory("{}/{}".format(addr, netmask)) + self.factory(f"{addr}/{netmask}") assertBadNetmask("::1", "") assertBadNetmask("::1", "::1") diff --git a/tests/unit/modules/test_elasticsearch.py b/tests/unit/modules/test_elasticsearch.py index fc073f54d4d..4ab515e7d46 100644 --- a/tests/unit/modules/test_elasticsearch.py +++ b/tests/unit/modules/test_elasticsearch.py @@ -9,18 +9,14 @@ from salt.modules import elasticsearch from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase -# Import elasticsearch exceptions -NO_ELASTIC = False -try: - from elasticsearch import NotFoundError, TransportError -except Exception: # pylint: disable=broad-except - NO_ELASTIC = True - - -@pytest.mark.skipif( - NO_ELASTIC, +_es_module = pytest.importorskip( + "elasticsearch", reason="Install elasticsearch-py before running Elasticsearch unit tests.", ) +NotFoundError = _es_module.NotFoundError +TransportError = _es_module.TransportError + + class ElasticsearchTestCase(TestCase): """ Test cases for salt.modules.elasticsearch diff --git a/tests/unit/modules/test_sysmod.py b/tests/unit/modules/test_sysmod.py index 00185a90099..125f17d8606 100644 --- a/tests/unit/modules/test_sysmod.py +++ b/tests/unit/modules/test_sysmod.py @@ -113,15 +113,17 @@ class SysmodTestCase(TestCase, LoaderModuleMockMixin): cls.salt_dunder[func] = MockDocstringable(docstring) cls._docstrings[func] = docstring - module = func.split(".")[0] + module = func.split(".", maxsplit=1)[0] cls._statedocstrings[func] = docstring cls._statedocstrings[module] = "docstring for {}".format(module) - cls._modules.add(func.split(".")[0]) + cls._modules.add(func.split(".", maxsplit=1)[0]) docstring = "docstring for {}".format(func) mock = MockDocstringable(docstring) - mock.set_module_docstring("docstring for {}".format(func.split(".")[0])) + mock.set_module_docstring( + "docstring for {}".format(func.split(".", maxsplit=1)[0]) + ) Mockstate.State.states[func] = mock cls._modules = sorted(list(cls._modules)) diff --git a/tests/unit/modules/test_zcbuildout.py b/tests/unit/modules/test_zcbuildout.py index db7a862f727..b26fac3a928 100644 --- a/tests/unit/modules/test_zcbuildout.py +++ b/tests/unit/modules/test_zcbuildout.py @@ -116,7 +116,7 @@ class Base(TestCase, LoaderModuleMockMixin): def setUp(self): if salt.utils.platform.is_darwin(): self.patched_environ = patched_environ(__cleanup__=["__PYVENV_LAUNCHER__"]) - self.patched_environ.__enter__() + self.patched_environ.__enter__() # pylint: disable=unnecessary-dunder-call self.addCleanup(self.patched_environ.__exit__) super().setUp() @@ -490,8 +490,8 @@ class BuildoutOnlineTestCase(Base): out = ret["out"] comment = ret["comment"] self.assertTrue(ret["status"]) - self.assertTrue("Creating directory" in out) - self.assertTrue("Installing a." in out) + self.assertIn("Creating directory", out) + self.assertIn("Installing a.", out) self.assertTrue("{} bootstrap.py".format(self.py_st) in comment) self.assertTrue("buildout -c buildout.cfg" in comment) ret = buildout.buildout( @@ -500,17 +500,17 @@ class BuildoutOnlineTestCase(Base): outlog = ret["outlog"] out = ret["out"] comment = ret["comment"] - self.assertTrue("Installing single part: a" in outlog) - self.assertTrue("buildout -c buildout.cfg -N install a" in comment) - self.assertTrue("Installing b." in out) - self.assertTrue("Installing c." in out) + self.assertIn("Installing single part: a", outlog) + self.assertIn("buildout -c buildout.cfg -N install a", comment) + self.assertIn("Installing b.", out) + self.assertIn("Installing c.", out) ret = buildout.buildout( b_dir, parts=["a", "b", "c"], buildout_ver=2, newest=True, python=self.py_st ) outlog = ret["outlog"] out = ret["out"] comment = ret["comment"] - self.assertTrue("buildout -c buildout.cfg -n install a" in comment) + self.assertIn("buildout -c buildout.cfg -n install a", comment) # TODO: Is this test even still needed? @@ -537,8 +537,8 @@ class BuildoutAPITestCase(TestCase): out = ret["out"].decode("utf-8") for out in ["àé", "ççàé"]: - self.assertTrue(out in uretm["logs_by_level"]["info"]) - self.assertTrue(out in uretm["outlog_by_level"]) + self.assertIn(out, uretm["logs_by_level"]["info"]) + self.assertIn(out, uretm["outlog_by_level"]) def test_setup(self): buildout.LOG.clear() diff --git a/tests/unit/states/test_loop.py b/tests/unit/states/test_loop.py index ba100dfe663..ea3b0989d97 100644 --- a/tests/unit/states/test_loop.py +++ b/tests/unit/states/test_loop.py @@ -294,9 +294,7 @@ class LoopTestCaseNoEval(TestCase, LoaderModuleMockMixin): """ with patch.dict( salt.states.loop.__salt__, # pylint: disable=no-member - { - "foo.bar": MagicMock(side_effect=range(1, 7)) - }, # pylint: disable=incompatible-py3-code + {"foo.bar": MagicMock(side_effect=range(1, 7))}, ): self.assertDictEqual( salt.states.loop.until( @@ -312,9 +310,7 @@ class LoopTestCaseNoEval(TestCase, LoaderModuleMockMixin): with patch.dict( salt.states.loop.__salt__, # pylint: disable=no-member - { - "foo.bar": MagicMock(side_effect=range(1, 7)) - }, # pylint: disable=incompatible-py3-code + {"foo.bar": MagicMock(side_effect=range(1, 7))}, ): self.assertDictEqual( salt.states.loop.until_no_eval( @@ -334,9 +330,7 @@ class LoopTestCaseNoEval(TestCase, LoaderModuleMockMixin): """ with patch.dict( salt.states.loop.__salt__, # pylint: disable=no-member - { - "foo.bar": MagicMock(side_effect=range(1, 7)) - }, # pylint: disable=incompatible-py3-code + {"foo.bar": MagicMock(side_effect=range(1, 7))}, ): self.assertDictEqual( salt.states.loop.until( @@ -354,9 +348,7 @@ class LoopTestCaseNoEval(TestCase, LoaderModuleMockMixin): # returning a lower number of attempts (because it's slower). with patch.dict( salt.states.loop.__salt__, # pylint: disable=no-member - { - "foo.bar": MagicMock(side_effect=range(1, 7)) - }, # pylint: disable=incompatible-py3-code + {"foo.bar": MagicMock(side_effect=range(1, 7))}, ): self.assertDictEqual( salt.states.loop.until_no_eval( diff --git a/tests/unit/test_pillar.py b/tests/unit/test_pillar.py index b71c0e9a371..323d5660cfe 100644 --- a/tests/unit/test_pillar.py +++ b/tests/unit/test_pillar.py @@ -36,13 +36,13 @@ class MockFileclient: self.list_states = lambda *x, **y: list_states # pylint: disable=unused-argument,no-method-argument,method-hidden - def cache_file(*args, **kwargs): + def cache_file(self, *args, **kwargs): raise NotImplementedError() - def get_state(*args, **kwargs): + def get_state(self, *args, **kwargs): raise NotImplementedError() - def list_states(*args, **kwargs): + def list_states(self, *args, **kwargs): raise NotImplementedError() # pylint: enable=unused-argument,no-method-argument,method-hidden diff --git a/tests/unit/test_zypp_plugins.py b/tests/unit/test_zypp_plugins.py index 7bd248ffbd9..64bc86b49d3 100644 --- a/tests/unit/test_zypp_plugins.py +++ b/tests/unit/test_zypp_plugins.py @@ -1,7 +1,7 @@ """ :codeauthor: Bo Maryniuk """ -import imp +import imp # pylint: disable=deprecated-module import os import pytest diff --git a/tests/unit/utils/test_configparser.py b/tests/unit/utils/test_configparser.py index ab32ec992d9..d4d3a79ed3c 100644 --- a/tests/unit/utils/test_configparser.py +++ b/tests/unit/utils/test_configparser.py @@ -179,9 +179,7 @@ class TestGitConfigParser(TestCase): self.conf.write(fp_) # Confirm that the new file was written correctly expected = self.fix_indent(ORIG_CONFIG) - # pylint: disable=string-substitution-usage-error - expected.insert(6, "\tfetch = %s" % new_refspec) - # pylint: enable=string-substitution-usage-error + expected.insert(6, f"\tfetch = {new_refspec}") self.assertEqual(self.get_lines(self.new_config), expected) def test_remove_option(self): diff --git a/tests/unit/utils/test_context.py b/tests/unit/utils/test_context.py index abea69fbf62..8cdbb8d53c5 100644 --- a/tests/unit/utils/test_context.py +++ b/tests/unit/utils/test_context.py @@ -102,7 +102,7 @@ class ContextDictTests(AsyncTestCase): wait_iterator = salt.ext.tornado.gen.WaitIterator(*futures) while not wait_iterator.done(): - r = yield wait_iterator.next() # pylint: disable=incompatible-py3-code + r = yield wait_iterator.next() self.assertEqual(r[0], r[1]) # verify that the global value remails self.assertEqual(r[2], r[3]) # verify that the override sticks locally self.assertEqual( diff --git a/tests/unit/utils/test_dns.py b/tests/unit/utils/test_dns.py index 75ceeef1359..225f9811937 100644 --- a/tests/unit/utils/test_dns.py +++ b/tests/unit/utils/test_dns.py @@ -259,8 +259,8 @@ class DNSlookupsCase(TestCase): :param secure: delta cmd.run_all output for secured RESULTS """ # wrong - for wrong in wrong: - with self._mock_cmd_ret(wrong): + for _wrong in wrong: + with self._mock_cmd_ret(_wrong): self.assertEqual(lookup_cb("mockq", "A"), False) # empty response diff --git a/tests/unit/utils/test_systemd.py b/tests/unit/utils/test_systemd.py index 698a2337e5e..082076feba8 100644 --- a/tests/unit/utils/test_systemd.py +++ b/tests/unit/utils/test_systemd.py @@ -351,8 +351,6 @@ class SystemdTestCase(TestCase): Raised by DBUS, e.g. when a PID does not belong to a service """ - ... - dbus_mock = Mock() dbus_mock.DBusException = DBusException() dbus_mock.GetUnitByPID = Mock(site_effect=dbus_mock.DBusException) diff --git a/tests/unit/utils/test_thin.py b/tests/unit/utils/test_thin.py index 7fd1e7b5dc3..28f26824118 100644 --- a/tests/unit/utils/test_thin.py +++ b/tests/unit/utils/test_thin.py @@ -113,7 +113,8 @@ class SSHThinTestCase(TestCase): return popen - def _version_info(self, major=None, minor=None): + @staticmethod + def _version_info(major=None, minor=None): """ Fake version info. @@ -801,7 +802,7 @@ class SSHThinTestCase(TestCase): "salt.utils.thin.tempfile.mkstemp", MagicMock(return_value=(3, ".temporary")) ) @patch("salt.utils.thin.shutil", MagicMock()) - @patch("salt.utils.thin.sys.version_info", _version_info(None, 3, 6)) + @patch("salt.utils.thin.sys.version_info", _version_info(3, 6)) @patch("salt.utils.path.which", MagicMock(return_value="/usr/bin/python")) def test_gen_thin_compression_fallback_py3(self): """ @@ -852,7 +853,7 @@ class SSHThinTestCase(TestCase): "salt.utils.thin.tempfile.mkstemp", MagicMock(return_value=(3, ".temporary")) ) @patch("salt.utils.thin.shutil", MagicMock()) - @patch("salt.utils.thin.sys.version_info", _version_info(None, 3, 6)) + @patch("salt.utils.thin.sys.version_info", _version_info(3, 6)) @patch("salt.utils.path.which", MagicMock(return_value="/usr/bin/python")) def test_gen_thin_control_files_written_py3(self): """ @@ -905,7 +906,7 @@ class SSHThinTestCase(TestCase): "salt.utils.thin.tempfile.mkstemp", MagicMock(return_value=(3, ".temporary")) ) @patch("salt.utils.thin.shutil", MagicMock()) - @patch("salt.utils.thin.sys.version_info", _version_info(None, 3, 6)) + @patch("salt.utils.thin.sys.version_info", _version_info(3, 6)) @patch("salt.utils.hashutils.DigestCollector", MagicMock()) @patch("salt.utils.path.which", MagicMock(return_value="/usr/bin/python")) def test_gen_thin_main_content_files_written_py3(self): @@ -974,7 +975,7 @@ class SSHThinTestCase(TestCase): "salt.utils.thin.tempfile.mkstemp", MagicMock(return_value=(3, ".temporary")) ) @patch("salt.utils.thin.shutil", MagicMock()) - @patch("salt.utils.thin.sys.version_info", _version_info(None, 3, 6)) + @patch("salt.utils.thin.sys.version_info", _version_info(3, 6)) @patch("salt.utils.hashutils.DigestCollector", MagicMock()) @patch("salt.utils.path.which", MagicMock(return_value="/usr/bin/python")) def test_gen_thin_ext_alternative_content_files_written_py3(self): @@ -1087,7 +1088,7 @@ class SSHThinTestCase(TestCase): "salt.utils.thin.tempfile.mkstemp", MagicMock(return_value=(3, ".temporary")) ) @patch("salt.utils.thin.shutil", MagicMock()) - @patch("salt.utils.thin.sys.version_info", _version_info(None, 3, 6)) + @patch("salt.utils.thin.sys.version_info", _version_info(3, 6)) def test_gen_thin_control_files_written_access_denied_cwd(self): """ Test thin.gen_thin function if control files are written (version, salt-call etc) diff --git a/tests/wheeltest.py b/tests/wheeltest.py index 93880b0b9f3..1f661941a81 100644 --- a/tests/wheeltest.py +++ b/tests/wheeltest.py @@ -3,9 +3,7 @@ Test interacting with the wheel system. This script is useful when testing wheel modules """ - - -import optparse +import optparse # pylint: disable=deprecated-module import pprint import salt.auth diff --git a/tools/changelog.py b/tools/changelog.py index 8e9e3ff3e73..99c81c40082 100644 --- a/tools/changelog.py +++ b/tools/changelog.py @@ -110,18 +110,18 @@ def update_rpm(ctx: Context, salt_version: Version, draft: bool = False): header = f"* {date} Salt Project Packaging - {str_salt_version}\n" parts = orig.split("%changelog") tmpspec = "pkg/rpm/salt.spec.1" - with open(tmpspec, "w") as wfp: + with open(tmpspec, "w", encoding="utf-8") as wfp: wfp.write(parts[0]) wfp.write("%changelog\n") wfp.write(header) wfp.write(changes) wfp.write(parts[1]) try: - with open(tmpspec) as rfp: + with open(tmpspec, encoding="utf-8") as rfp: if draft: ctx.info(rfp.read()) else: - with open("pkg/rpm/salt.spec", "w") as wfp: + with open("pkg/rpm/salt.spec", "w", encoding="utf-8") as wfp: wfp.write(rfp.read()) finally: os.remove(tmpspec) @@ -153,20 +153,20 @@ def update_deb(ctx: Context, salt_version: Version, draft: bool = False): tmpchanges = "pkg/rpm/salt.spec.1" debian_changelog_path = "pkg/debian/changelog" tmp_debian_changelog_path = f"{debian_changelog_path}.1" - with open(tmp_debian_changelog_path, "w") as wfp: + with open(tmp_debian_changelog_path, "w", encoding="utf-8") as wfp: wfp.write(f"salt ({salt_version}) stable; urgency=medium\n\n") wfp.write(formated) wfp.write( f"\n -- Salt Project Packaging {date}\n\n" ) - with open(debian_changelog_path) as rfp: + with open(debian_changelog_path, encoding="utf-8") as rfp: wfp.write(rfp.read()) try: - with open(tmp_debian_changelog_path) as rfp: + with open(tmp_debian_changelog_path, encoding="utf-8") as rfp: if draft: ctx.info(rfp.read()) else: - with open(debian_changelog_path, "w") as wfp: + with open(debian_changelog_path, "w", encoding="utf-8") as wfp: wfp.write(rfp.read()) finally: os.remove(tmp_debian_changelog_path) @@ -254,7 +254,7 @@ def update_release_notes( return unreleased = " - UNRELEASED" - warning = f""" + warning = """ z_$(H7Kf_+0p3gquLS}VVJ*&2H~$LOXDl4k5^d2IH4%? z^DllD0^BRtr2==*PfNC=eYP#!yPCUjYZTVC{JIyeH!+j>(v9h~6@_hDpS>dLlKI=G zd25~wa8)YNuh(KjFM(1tDz~|w*q8Vc?#j6zwyePiFm=0bpGh`5 zDX~Yv;3jSjzv}cL!JyU@QZc5u)qvsYq?SvI8LNo9$CjU3KNOZ_-@O)4-dnevTKA7X zMmRk0$P^J_f^sbqlC_JP#Q*YThpj#dNg4ny{eEYEpet(Xxs{;LcTWv@!Epw#-*Bpw z=z;?vDxrz6QHgSiQd0vAlau72@DpV#j~K)T=gYnBQ2p}imzo+a&4*rMo{z7KPLpN( zlZMHHw?2J*?{Om4YwE9k)NDYaA#kACuyjmgcX*FbJF7e^IJto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eITn0~*Ie;zniN9-R9@96%LVkR!Ed z=+Rl-n0&SE5D|_r(%rI6i&h~_vlqrN`Q1A0{F9SCGvGk{g@4v@^!$p5{nA|jnq~Gy z_5Q=3zcmfN&Yx*``|~vX*M{d$XAM56?|N7ZqGaUl()`%NBI45=enETy1*QcKS9*=W z7zMkokA)W2avt=pU-?}E=!(9+xL3JvU+aF&p7|`tK=2+0;xFJ0sw!|G)B@K~=z-&E z1@;+FRUnf8Vg~xTDF*gnnP?we8MuQ#?w|``Bi!THaXPSdKF@s_r+@f5fBW)&ygJ}g zcmoU%{#Tdx1N!ay;hO!AFYkLE5A^)7L;g*sEJLNCG2bd_l4P>T0Bn*2%|X)q)3D#P zGpj%>dL?>K0;Dr$>X@sHP=jG4hGh?F<5ki3~iR9_mQ-wa>- zhR0*0AWS*xN1lmFx#c;dLoO@tPJ2>ce{0h9SpkD@%DZDg*YK(1TVH*J7$5TSCgJ(+ z67#cLFefK7V-fmEB=4_d@B-F;L?vj6MThqr=JQDdfp!8`SmAZgg(z=xHvXCaLtcb#BYZ9(ipUTG{=Ys z5&Y?i>a;@V)e1qaXO?>26w7LA(h#asOhAN)Z&w+8YMjQnHk|4Dzt7`A|BC(f@Q+E* i(Es87gYmELfB*aS-~RbO|NJk1{<}Z@=}$bg9RCFp{RA!m diff --git a/tests/kitchen/tests/wordpress/states/wp-config.php.j2 b/tests/kitchen/tests/wordpress/states/wp-config.php.j2 deleted file mode 100644 index 928dbddc335..00000000000 --- a/tests/kitchen/tests/wordpress/states/wp-config.php.j2 +++ /dev/null @@ -1,82 +0,0 @@ - Date: Tue, 27 Feb 2024 10:24:22 +0000 Subject: [PATCH 32/34] Update pre-commit hook versions --- .pre-commit-config.yaml | 25 +-- doc/ref/executors/index.rst | 3 +- doc/ref/modules/index.rst | 1 + doc/topics/development/tests/index.rst | 3 +- doc/topics/proxyminion/index.rst | 2 - doc/topics/releases/2016.11.0.rst | 15 +- noxfile.py | 3 +- salt/__init__.py | 7 - salt/_compat.py | 1 + salt/_logging/__init__.py | 1 + salt/auth/django.py | 1 - salt/auth/file.py | 1 - salt/auth/keystone.py | 1 - salt/auth/ldap.py | 1 + salt/auth/mysql.py | 1 - salt/auth/rest.py | 1 - salt/auth/yubico.py | 1 - salt/beacons/adb.py | 1 + salt/beacons/aix_account.py | 1 + salt/beacons/bonjour_announce.py | 1 + salt/beacons/cert_info.py | 1 + salt/beacons/diskusage.py | 1 + salt/beacons/glxinfo.py | 1 + salt/beacons/haproxy.py | 1 + salt/beacons/journald.py | 1 + salt/beacons/load.py | 1 + salt/beacons/log_beacon.py | 1 + salt/beacons/memusage.py | 1 + salt/beacons/network_info.py | 1 + salt/beacons/pkg.py | 1 + salt/beacons/proxy_example.py | 1 + salt/beacons/ps.py | 1 + salt/beacons/salt_monitor.py | 1 + salt/beacons/salt_proxy.py | 1 + salt/beacons/sensehat.py | 1 + salt/beacons/service.py | 1 + salt/beacons/sh.py | 1 + salt/beacons/smartos_imgadm.py | 1 + salt/beacons/smartos_vmadm.py | 1 + salt/beacons/status.py | 7 +- salt/beacons/swapusage.py | 1 + salt/beacons/telegram_bot_msg.py | 1 + salt/beacons/twilio_txt_msg.py | 1 + salt/cache/__init__.py | 1 - salt/cache/redis_cache.py | 1 - salt/channel/client.py | 1 - salt/cli/api.py | 1 - salt/cli/caller.py | 2 +- salt/cli/daemons.py | 1 - salt/cli/spm.py | 1 - salt/client/mixins.py | 8 +- salt/client/ssh/__init__.py | 12 +- salt/client/ssh/ssh_py_shim.py | 4 +- salt/client/ssh/wrapper/__init__.py | 1 - salt/client/ssh/wrapper/grains.py | 1 - salt/client/ssh/wrapper/mine.py | 1 - salt/cloud/__init__.py | 1 + salt/cloud/cli.py | 1 + salt/cloud/clouds/aliyun.py | 2 +- salt/cloud/clouds/cloudstack.py | 1 + salt/cloud/clouds/ec2.py | 1 + salt/cloud/clouds/gce.py | 2 +- salt/cloud/clouds/hetzner.py | 1 + salt/cloud/clouds/joyent.py | 1 - salt/cloud/clouds/libvirt.py | 2 +- salt/cloud/clouds/msazure.py | 1 + salt/cloud/clouds/opennebula.py | 2 +- salt/cloud/clouds/saltify.py | 2 +- salt/cloud/clouds/vmware.py | 118 ++++++++----- salt/config/__init__.py | 1 + salt/config/schemas/common.py | 1 - salt/config/schemas/esxcluster.py | 1 - salt/config/schemas/esxdatacenter.py | 1 - salt/config/schemas/esxi.py | 1 - salt/config/schemas/esxvm.py | 1 - salt/config/schemas/minion.py | 1 - salt/config/schemas/ssh.py | 1 - salt/daemons/masterapi.py | 4 +- salt/engines/__init__.py | 1 + salt/engines/docker_events.py | 1 + salt/engines/slack.py | 7 +- salt/engines/slack_bolt_engine.py | 7 +- salt/features.py | 1 + salt/fileclient.py | 1 + salt/fileserver/__init__.py | 1 - salt/fileserver/azurefs.py | 1 - salt/fileserver/gitfs.py | 1 - salt/fileserver/hgfs.py | 2 +- salt/fileserver/minionfs.py | 4 +- salt/fileserver/roots.py | 5 +- salt/fileserver/s3fs.py | 1 - salt/fileserver/svnfs.py | 3 +- salt/grains/cimc.py | 1 - salt/grains/core.py | 28 ++-- salt/grains/esxi.py | 1 - salt/grains/junos.py | 1 - salt/grains/minion_process.py | 1 - salt/grains/napalm.py | 1 - salt/grains/panos.py | 1 - salt/grains/pending_reboot.py | 1 + salt/loader/context.py | 1 + salt/loader/dunder.py | 1 + salt/loader/lazy.py | 2 +- salt/log_handlers/logstash_mod.py | 1 - salt/master.py | 7 +- salt/matchers/confirm_top.py | 1 + salt/metaproxy/deltaproxy.py | 16 +- salt/minion.py | 1 + salt/modules/aix_shadow.py | 2 - salt/modules/aliases.py | 6 +- salt/modules/apache.py | 1 - salt/modules/augeas_cfg.py | 6 +- salt/modules/beacons.py | 49 +++--- salt/modules/bluez_bluetooth.py | 1 + salt/modules/boto3_elasticsearch.py | 1 + salt/modules/boto3_route53.py | 26 +-- salt/modules/boto3_sns.py | 1 + salt/modules/boto_apigateway.py | 1 + salt/modules/boto_asg.py | 1 + salt/modules/boto_cfn.py | 1 + salt/modules/boto_cloudfront.py | 1 + salt/modules/boto_cloudtrail.py | 1 + salt/modules/boto_cloudwatch.py | 1 + salt/modules/boto_cloudwatch_event.py | 1 + salt/modules/boto_cognitoidentity.py | 8 +- salt/modules/boto_datapipeline.py | 1 - salt/modules/boto_dynamodb.py | 1 + salt/modules/boto_ec2.py | 12 +- salt/modules/boto_efs.py | 1 - salt/modules/boto_elasticache.py | 1 + salt/modules/boto_elasticsearch_domain.py | 1 + salt/modules/boto_elb.py | 1 + salt/modules/boto_elbv2.py | 1 + salt/modules/boto_iam.py | 1 + salt/modules/boto_iot.py | 1 + salt/modules/boto_kinesis.py | 1 + salt/modules/boto_kms.py | 1 + salt/modules/boto_lambda.py | 1 + salt/modules/boto_rds.py | 1 + salt/modules/boto_route53.py | 1 + salt/modules/boto_s3.py | 1 + salt/modules/boto_s3_bucket.py | 1 + salt/modules/boto_secgroup.py | 1 + salt/modules/boto_sns.py | 1 + salt/modules/boto_sqs.py | 1 + salt/modules/boto_ssm.py | 1 + salt/modules/boto_vpc.py | 8 +- salt/modules/bsd_shadow.py | 1 - salt/modules/btrfs.py | 6 +- salt/modules/chef.py | 1 - salt/modules/cimc.py | 1 - salt/modules/cloud.py | 1 - salt/modules/cmdmod.py | 9 +- salt/modules/consul.py | 12 +- salt/modules/container_resource.py | 1 + salt/modules/deb_postgres.py | 1 + salt/modules/debian_ip.py | 13 +- salt/modules/debuild_pkgbuild.py | 1 - salt/modules/defaults.py | 1 - salt/modules/djangomod.py | 1 - salt/modules/dnsmasq.py | 1 - salt/modules/dockercompose.py | 1 - salt/modules/dockermod.py | 6 +- salt/modules/drac.py | 1 - salt/modules/dracr.py | 1 - salt/modules/elasticsearch.py | 1 - salt/modules/eselect.py | 1 - salt/modules/esxi.py | 1 - salt/modules/esxvm.py | 1 - salt/modules/event.py | 1 - salt/modules/extfs.py | 1 - salt/modules/file.py | 8 +- salt/modules/firewalld.py | 1 - salt/modules/freebsd_sysctl.py | 1 - salt/modules/freebsd_update.py | 1 - salt/modules/freebsdjail.py | 1 - salt/modules/gentoo_service.py | 1 - salt/modules/github.py | 1 - salt/modules/glanceng.py | 1 - salt/modules/gnomedesktop.py | 1 - salt/modules/gpg.py | 6 +- salt/modules/grains.py | 2 +- salt/modules/haproxyconn.py | 2 +- salt/modules/hashutil.py | 1 - salt/modules/helm.py | 3 +- salt/modules/hg.py | 1 - salt/modules/hosts.py | 1 - salt/modules/http.py | 1 - salt/modules/icinga2.py | 1 - salt/modules/ifttt.py | 1 - salt/modules/influxdb08mod.py | 1 - salt/modules/influxdbmod.py | 5 +- salt/modules/ipmi.py | 1 - salt/modules/ipset.py | 1 - salt/modules/jboss7.py | 1 - salt/modules/jboss7_cli.py | 1 - salt/modules/jenkinsmod.py | 1 - salt/modules/junos.py | 132 +++++++-------- salt/modules/kerberos.py | 1 - salt/modules/keyboard.py | 1 - salt/modules/keystone.py | 12 +- salt/modules/keystoneng.py | 1 - salt/modules/keystore.py | 1 - salt/modules/launchctl_service.py | 1 - salt/modules/ldap3.py | 1 - salt/modules/ldapmod.py | 1 - salt/modules/libcloud_compute.py | 1 + salt/modules/libcloud_dns.py | 1 + salt/modules/libcloud_loadbalancer.py | 1 + salt/modules/libcloud_storage.py | 1 + salt/modules/lxc.py | 7 +- salt/modules/lxd.py | 17 +- salt/modules/mac_brew_pkg.py | 6 +- salt/modules/mac_group.py | 1 + salt/modules/mac_shadow.py | 1 + salt/modules/mandrill.py | 1 - salt/modules/marathon.py | 1 - salt/modules/mattermost.py | 1 - salt/modules/mdadm_raid.py | 1 + salt/modules/mdata.py | 1 - salt/modules/modjk.py | 1 + salt/modules/mount.py | 1 - salt/modules/mssql.py | 3 - salt/modules/mysql.py | 1 - salt/modules/nacl.py | 1 - salt/modules/nagios.py | 1 - salt/modules/nagios_rpc.py | 1 - salt/modules/namecheap_domains.py | 6 +- salt/modules/namecheap_domains_dns.py | 1 - salt/modules/napalm_bgp.py | 3 - salt/modules/napalm_network.py | 29 +--- salt/modules/napalm_ntp.py | 7 - salt/modules/napalm_probes.py | 4 - salt/modules/napalm_route.py | 2 - salt/modules/napalm_snmp.py | 4 - salt/modules/napalm_users.py | 4 - salt/modules/netaddress.py | 1 - salt/modules/neutronng.py | 1 - salt/modules/nftables.py | 80 ++++----- salt/modules/nix.py | 1 - salt/modules/nspawn.py | 1 - salt/modules/omapi.py | 1 - salt/modules/openbsdservice.py | 1 - salt/modules/openscap.py | 1 + salt/modules/osquery.py | 6 +- salt/modules/pacmanpkg.py | 2 +- salt/modules/panos.py | 1 - salt/modules/pcs.py | 1 - salt/modules/pf.py | 1 - salt/modules/pip.py | 10 +- salt/modules/pkg_resource.py | 1 - salt/modules/pkgng.py | 6 +- salt/modules/postfix.py | 28 ++-- salt/modules/proxy.py | 1 - salt/modules/ps.py | 1 - salt/modules/puppet.py | 1 - salt/modules/pushbullet.py | 1 - salt/modules/pushover_notify.py | 1 - salt/modules/qemu_nbd.py | 1 - salt/modules/rallydev.py | 1 - salt/modules/random_org.py | 19 ++- salt/modules/rbenv.py | 1 - salt/modules/reg.py | 1 + salt/modules/restartcheck.py | 1 + salt/modules/restconf.py | 1 - salt/modules/rh_ip.py | 5 - salt/modules/rpmbuild_pkgbuild.py | 1 - salt/modules/salt_version.py | 1 - salt/modules/saltcheck.py | 13 +- salt/modules/saltutil.py | 11 +- salt/modules/schedule.py | 47 +++--- salt/modules/scp_mod.py | 2 +- salt/modules/sdb.py | 1 - salt/modules/seed.py | 1 - salt/modules/selinux.py | 1 - salt/modules/sensehat.py | 1 - salt/modules/serverdensity_device.py | 1 - salt/modules/slack_notify.py | 1 - salt/modules/slsutil.py | 1 - salt/modules/smartos_nictagadm.py | 24 ++- salt/modules/smf_service.py | 1 - salt/modules/smtp.py | 1 - salt/modules/snapper.py | 7 +- salt/modules/solaris_user.py | 1 - salt/modules/solr.py | 1 - salt/modules/splunk_search.py | 2 +- salt/modules/state.py | 2 +- salt/modules/statuspage.py | 1 - salt/modules/supervisord.py | 1 - salt/modules/syslog_ng.py | 1 - salt/modules/system_profiler.py | 1 - salt/modules/textfsm_mod.py | 46 +++--- salt/modules/timezone.py | 1 - salt/modules/tls.py | 8 +- salt/modules/travisci.py | 1 + salt/modules/tuned.py | 1 - salt/modules/uptime.py | 1 - salt/modules/vault.py | 1 + salt/modules/vboxmanage.py | 1 - salt/modules/victorops.py | 1 - salt/modules/virt.py | 105 +++++++----- salt/modules/virtualenv_mod.py | 1 - salt/modules/vmctl.py | 1 - salt/modules/vsphere.py | 51 +++--- salt/modules/webutil.py | 1 - salt/modules/win_autoruns.py | 1 - salt/modules/win_dacl.py | 21 ++- salt/modules/win_event.py | 1 + salt/modules/win_iis.py | 1 + salt/modules/win_lgpo.py | 73 ++++---- salt/modules/win_lgpo_reg.py | 1 + salt/modules/win_license.py | 1 - salt/modules/win_pkg.py | 1 - salt/modules/win_servermanager.py | 1 - salt/modules/win_service.py | 1 + salt/modules/win_shortcut.py | 1 + salt/modules/win_status.py | 1 + salt/modules/win_task.py | 6 +- salt/modules/win_timezone.py | 1 + salt/modules/win_wua.py | 1 + salt/modules/win_wusa.py | 1 - salt/modules/winrepo.py | 1 + salt/modules/x509_v2.py | 9 +- salt/modules/xmpp.py | 1 - salt/modules/yumpkg.py | 7 +- salt/modules/zcbuildout.py | 7 +- salt/modules/zypperpkg.py | 17 +- salt/netapi/__init__.py | 1 - salt/netapi/rest_cherrypy/app.py | 14 +- salt/output/__init__.py | 1 - salt/output/highstate.py | 1 - salt/output/overstatestage.py | 1 - salt/output/pony.py | 1 - salt/output/progress.py | 1 - salt/output/raw.py | 1 - salt/output/table_out.py | 8 +- salt/pillar/cmd_yamlex.py | 1 - salt/pillar/cobbler.py | 2 +- salt/pillar/consul_pillar.py | 1 - salt/pillar/ec2_pillar.py | 1 - salt/pillar/extra_minion_data_in_pillar.py | 1 + salt/pillar/gpg.py | 1 - salt/pillar/hiera.py | 1 - salt/pillar/http_json.py | 1 - salt/pillar/http_yaml.py | 1 + salt/pillar/libvirt.py | 1 + salt/pillar/makostack.py | 1 - salt/pillar/nacl.py | 1 - salt/pillar/neutron.py | 1 - salt/pillar/reclass_adapter.py | 1 - salt/pillar/s3.py | 2 - salt/pillar/saltclass.py | 1 - salt/pillar/stack.py | 1 + salt/pillar/varstack_pillar.py | 1 - salt/pillar/vault.py | 1 - salt/proxy/cisconso.py | 1 - salt/proxy/esxcluster.py | 1 + salt/proxy/esxdatacenter.py | 1 - salt/proxy/esxi.py | 1 - salt/proxy/esxvm.py | 1 - salt/proxy/rest_sample.py | 2 - salt/proxy/restconf.py | 1 - salt/queues/pgjsonb_queue.py | 1 - salt/renderers/cheetah.py | 1 - salt/renderers/dson.py | 1 - salt/renderers/genshi.py | 1 - salt/renderers/gpg.py | 1 - salt/renderers/hjson.py | 1 - salt/renderers/jinja.py | 1 - salt/renderers/json.py | 1 - salt/renderers/json5.py | 1 - salt/renderers/mako.py | 1 - salt/renderers/nacl.py | 1 - salt/renderers/pass.py | 1 - salt/renderers/pydsl.py | 1 + salt/renderers/pyobjects.py | 1 + salt/renderers/stateconf.py | 3 +- salt/renderers/yaml.py | 1 - salt/returners/appoptics_return.py | 1 - salt/returners/couchdb_return.py | 1 - salt/returners/elasticsearch_return.py | 1 - salt/returners/librato_return.py | 1 - salt/returners/multi_returner.py | 1 - salt/returners/postgres_local_cache.py | 1 - salt/returners/rawfile_json.py | 1 - salt/returners/smtp_return.py | 1 - salt/returners/zabbix_return.py | 1 - salt/roster/cache.py | 6 +- salt/roster/cloud.py | 1 - salt/roster/clustershell.py | 1 - salt/roster/dir.py | 1 - salt/roster/sshknownhosts.py | 1 - salt/runners/auth.py | 1 - salt/runners/digicertapi.py | 1 + salt/runners/drac.py | 3 +- salt/runners/lxc.py | 1 - salt/runners/manage.py | 11 +- salt/runners/mattermost.py | 1 - salt/runners/nacl.py | 1 - salt/runners/network.py | 1 - salt/runners/pkg.py | 1 - salt/runners/queue.py | 1 - salt/runners/spacewalk.py | 2 +- salt/runners/ssh.py | 1 - salt/runners/thin.py | 1 - salt/runners/virt.py | 1 - salt/scripts.py | 4 +- salt/sdb/cache.py | 1 - salt/sdb/couchdb.py | 1 - salt/sdb/etcd_db.py | 1 - salt/sdb/rest.py | 1 - salt/sdb/tism.py | 1 - salt/sdb/vault.py | 1 - salt/sdb/yaml.py | 1 - salt/serializers/__init__.py | 1 - salt/serializers/json.py | 1 - salt/serializers/plist.py | 1 + salt/serializers/yaml.py | 1 - salt/serializers/yamlex.py | 1 + salt/spm/__init__.py | 4 +- salt/spm/pkgdb/sqlite3.py | 1 - salt/spm/pkgfiles/local.py | 1 - salt/state.py | 16 +- salt/states/alternatives.py | 24 +-- salt/states/ansiblegate.py | 6 +- salt/states/apache.py | 1 - salt/states/aptpkg.py | 1 - salt/states/archive.py | 40 ++--- salt/states/artifactory.py | 1 - salt/states/at.py | 8 +- salt/states/azurearm_compute.py | 12 +- salt/states/azurearm_dns.py | 39 ++--- salt/states/azurearm_network.py | 109 ++++++------ salt/states/azurearm_resource.py | 37 ++--- salt/states/bigip.py | 45 +++-- salt/states/boto3_elasticsearch.py | 1 - salt/states/boto3_route53.py | 97 +++++------ salt/states/boto3_sns.py | 8 +- salt/states/boto_apigateway.py | 37 ++--- salt/states/boto_asg.py | 1 - salt/states/boto_cloudfront.py | 1 - salt/states/boto_cloudtrail.py | 1 - salt/states/boto_cloudwatch_alarm.py | 1 - salt/states/boto_cloudwatch_event.py | 1 - salt/states/boto_cognitoidentity.py | 45 +++-- salt/states/boto_datapipeline.py | 1 - salt/states/boto_ec2.py | 48 +++--- salt/states/boto_elasticache.py | 7 +- salt/states/boto_elasticsearch_domain.py | 11 +- salt/states/boto_elb.py | 15 +- salt/states/boto_elbv2.py | 7 +- salt/states/boto_iam.py | 6 +- salt/states/boto_iam_role.py | 14 +- salt/states/boto_lambda.py | 1 - salt/states/boto_rds.py | 7 +- salt/states/boto_route53.py | 9 +- salt/states/boto_s3.py | 1 - salt/states/boto_s3_bucket.py | 1 - salt/states/boto_secgroup.py | 18 +- salt/states/boto_vpc.py | 10 +- salt/states/bower.py | 1 - salt/states/cabal.py | 1 - salt/states/chocolatey.py | 24 +-- salt/states/cimc.py | 7 +- salt/states/cloud.py | 9 +- salt/states/cmd.py | 13 +- salt/states/composer.py | 16 +- salt/states/consul.py | 1 + salt/states/cryptdev.py | 6 +- salt/states/debconfmod.py | 2 +- salt/states/dellchassis.py | 1 - salt/states/disk.py | 16 +- salt/states/docker_container.py | 18 +- salt/states/docker_image.py | 8 +- salt/states/docker_network.py | 14 +- salt/states/dvs.py | 13 +- salt/states/elasticsearch.py | 129 +++++++-------- salt/states/elasticsearch_index.py | 7 +- salt/states/elasticsearch_index_template.py | 15 +- salt/states/environ.py | 1 - salt/states/eselect.py | 1 - salt/states/esxcluster.py | 23 ++- salt/states/esxdatacenter.py | 1 - salt/states/esxi.py | 10 +- salt/states/esxvm.py | 1 - salt/states/etcd_mod.py | 1 - salt/states/ethtool.py | 25 ++- salt/states/event.py | 1 - salt/states/file.py | 105 ++++++------ salt/states/firewalld.py | 2 - salt/states/git.py | 24 ++- salt/states/github.py | 30 ++-- salt/states/glance_image.py | 1 - salt/states/glusterfs.py | 33 ++-- salt/states/grafana4_dashboard.py | 1 - salt/states/grafana_dashboard.py | 1 - salt/states/grains.py | 20 +-- salt/states/group.py | 7 +- salt/states/hg.py | 7 +- salt/states/highstate_doc.py | 1 - salt/states/host.py | 1 - salt/states/http.py | 1 - salt/states/icinga2.py | 25 ++- salt/states/influxdb_continuous_query.py | 6 +- salt/states/influxdb_retention_policy.py | 6 +- salt/states/influxdb_user.py | 6 +- salt/states/infoblox_a.py | 14 +- salt/states/infoblox_cname.py | 14 +- salt/states/infoblox_host_record.py | 14 +- salt/states/ini_manage.py | 1 - salt/states/ipset.py | 8 +- salt/states/iptables.py | 65 ++++---- salt/states/jboss7.py | 9 +- salt/states/jenkins.py | 1 - salt/states/kapacitor.py | 1 + salt/states/kernelpkg.py | 6 +- salt/states/keystone_domain.py | 1 - salt/states/keystone_endpoint.py | 1 - salt/states/keystone_group.py | 1 - salt/states/keystone_project.py | 1 - salt/states/keystone_role.py | 1 - salt/states/keystone_role_grant.py | 1 - salt/states/keystone_service.py | 1 - salt/states/keystone_user.py | 1 - salt/states/keystore.py | 1 - salt/states/libcloud_loadbalancer.py | 1 - salt/states/libcloud_storage.py | 1 - salt/states/linux_acl.py | 1 - salt/states/locale.py | 1 - salt/states/logrotate.py | 1 - salt/states/loop.py | 9 +- salt/states/lvm.py | 28 ++-- salt/states/lvs_server.py | 64 +++---- salt/states/lvs_service.py | 20 +-- salt/states/lxc.py | 1 - salt/states/lxd.py | 1 - salt/states/lxd_container.py | 15 +- salt/states/lxd_image.py | 1 - salt/states/lxd_profile.py | 9 +- salt/states/mdadm_raid.py | 17 +- salt/states/memcached.py | 1 - salt/states/modjk_worker.py | 14 +- salt/states/module.py | 9 +- salt/states/mount.py | 30 ++-- salt/states/mssql_database.py | 8 +- salt/states/mssql_login.py | 8 +- salt/states/mssql_role.py | 8 +- salt/states/mssql_user.py | 8 +- salt/states/msteams.py | 1 - salt/states/mysql_grants.py | 24 +-- salt/states/mysql_query.py | 1 - salt/states/netntp.py | 20 +-- salt/states/netsnmp.py | 14 -- salt/states/netusers.py | 9 - salt/states/network.py | 38 ++--- salt/states/neutron_network.py | 1 - salt/states/neutron_secgroup.py | 1 - salt/states/neutron_secgroup_rule.py | 1 - salt/states/neutron_subnet.py | 1 - salt/states/nexus.py | 1 - salt/states/nftables.py | 96 +++++------ salt/states/npm.py | 1 - salt/states/openstack_config.py | 1 - salt/states/openvswitch_port.py | 56 +++---- salt/states/opsgenie.py | 16 +- salt/states/pbm.py | 1 - salt/states/pip_state.py | 1 - salt/states/pkg.py | 87 +++++----- salt/states/pkgrepo.py | 19 +-- salt/states/ports.py | 16 +- salt/states/postgres_database.py | 22 +-- salt/states/postgres_privileges.py | 8 +- salt/states/postgres_schema.py | 8 +- salt/states/postgres_tablespace.py | 17 +- salt/states/probes.py | 10 -- salt/states/rabbitmq_plugin.py | 1 - salt/states/rabbitmq_upstream.py | 1 - salt/states/rabbitmq_user.py | 1 - salt/states/rabbitmq_vhost.py | 1 - salt/states/restconf.py | 1 - salt/states/saltmod.py | 8 +- salt/states/serverdensity_device.py | 13 +- salt/states/service.py | 78 ++++----- salt/states/slack.py | 1 - salt/states/smartos.py | 20 +-- salt/states/snapper.py | 1 - salt/states/solrcloud.py | 1 - salt/states/sqlite3.py | 1 - salt/states/ssh_auth.py | 15 +- salt/states/supervisord.py | 26 +-- salt/states/sysrc.py | 1 - salt/states/telemetry_alert.py | 8 +- salt/states/timezone.py | 8 +- salt/states/tls.py | 1 - salt/states/tuned.py | 1 - salt/states/user.py | 38 ++--- salt/states/vbox_guest.py | 6 +- salt/states/virt.py | 13 +- salt/states/virtualenv_mod.py | 1 - salt/states/webutil.py | 1 - salt/states/win_dns_client.py | 14 +- salt/states/win_iis.py | 1 - salt/states/win_lgpo.py | 1 + salt/states/win_lgpo_reg.py | 1 + salt/states/win_network.py | 34 ++-- salt/states/win_pki.py | 17 +- salt/states/win_powercfg.py | 1 - salt/states/win_shortcut.py | 1 + salt/states/win_smtp_server.py | 13 +- salt/states/win_system.py | 22 +-- salt/states/win_wusa.py | 1 - salt/states/x509_v2.py | 31 ++-- salt/states/zabbix_action.py | 8 +- salt/states/zabbix_template.py | 8 +- salt/states/zabbix_user.py | 7 +- salt/states/zabbix_valuemap.py | 8 +- salt/states/zenoss.py | 13 +- salt/states/zk_concurrency.py | 1 - salt/states/zone.py | 156 +++++++++--------- salt/states/zookeeper.py | 9 +- salt/syspaths.py | 1 - salt/template.py | 1 + salt/thorium/__init__.py | 1 + salt/thorium/calc.py | 1 - salt/thorium/file.py | 1 - salt/thorium/reg.py | 1 - salt/thorium/timer.py | 1 - salt/tokens/localfs.py | 3 +- salt/tops/cobbler.py | 3 +- salt/tops/ext_nodes.py | 1 + salt/tops/saltclass.py | 1 - salt/tops/varstack_top.py | 1 - salt/transport/__init__.py | 1 - salt/transport/client.py | 1 + salt/transport/frame.py | 1 - salt/transport/ipc.py | 1 - salt/transport/server.py | 1 + salt/transport/tcp.py | 1 - salt/transport/zeromq.py | 1 + salt/utils/aggregation.py | 2 - salt/utils/asynchronous.py | 1 - salt/utils/atomicfile.py | 1 + salt/utils/aws.py | 1 + salt/utils/boto3mod.py | 1 - salt/utils/botomod.py | 1 - salt/utils/cloud.py | 7 +- salt/utils/color.py | 1 - salt/utils/configparser.py | 4 +- salt/utils/crypt.py | 1 + salt/utils/data.py | 3 +- salt/utils/dateutils.py | 1 - salt/utils/decorators/__init__.py | 9 +- salt/utils/decorators/state.py | 1 - salt/utils/doc.py | 1 + salt/utils/dockermod/__init__.py | 1 - salt/utils/dockermod/translate/container.py | 8 +- salt/utils/dockermod/translate/helpers.py | 8 +- salt/utils/extend.py | 1 - salt/utils/files.py | 7 +- salt/utils/find.py | 1 - salt/utils/fsutils.py | 1 + salt/utils/functools.py | 1 + salt/utils/gitfs.py | 8 +- salt/utils/github.py | 1 - salt/utils/gzip_util.py | 1 - salt/utils/http.py | 16 +- salt/utils/idem.py | 1 + salt/utils/itertools.py | 1 - salt/utils/job.py | 1 - salt/utils/json.py | 1 - salt/utils/lazy.py | 1 - salt/utils/locales.py | 1 - salt/utils/master.py | 1 + salt/utils/memcached.py | 1 - salt/utils/mine.py | 1 - salt/utils/minion.py | 1 - salt/utils/minions.py | 1 - salt/utils/mount.py | 1 - salt/utils/msazure.py | 1 - salt/utils/msgpack.py | 1 + salt/utils/namecheap.py | 1 - salt/utils/napalm.py | 1 - salt/utils/network.py | 4 +- salt/utils/odict.py | 1 + salt/utils/openstack/neutron.py | 2 - salt/utils/openstack/nova.py | 7 +- salt/utils/parsers.py | 1 + salt/utils/path.py | 1 - salt/utils/pbm.py | 1 - salt/utils/pkg/rpm.py | 1 + salt/utils/pkg/win.py | 1 + salt/utils/platform.py | 1 + salt/utils/process.py | 5 +- salt/utils/profile.py | 1 - salt/utils/proxy.py | 1 - salt/utils/pycrypto.py | 1 + salt/utils/reactor.py | 1 + salt/utils/saltclass.py | 4 +- salt/utils/schedule.py | 33 ++-- salt/utils/smb.py | 7 +- salt/utils/smtp.py | 8 +- salt/utils/ssdp.py | 2 +- salt/utils/state.py | 1 - salt/utils/stringio.py | 1 - salt/utils/stringutils.py | 1 - salt/utils/templates.py | 1 + salt/utils/textformat.py | 1 - salt/utils/thin.py | 4 +- salt/utils/url.py | 1 - salt/utils/user.py | 1 - salt/utils/vault.py | 2 +- salt/utils/versions.py | 1 + salt/utils/vsan.py | 1 - salt/utils/win_lgpo_reg.py | 1 + salt/utils/win_network.py | 1 + salt/utils/win_osinfo.py | 1 + salt/utils/win_system.py | 1 + salt/utils/win_update.py | 1 + salt/utils/x509.py | 86 +++++----- salt/utils/xmlutil.py | 8 +- salt/utils/yaml.py | 1 + salt/utils/yamldumper.py | 1 + salt/utils/yamlencoding.py | 1 - salt/utils/yamlloader.py | 1 - salt/utils/yamlloader_old.py | 1 - salt/utils/zfs.py | 1 - salt/version.py | 1 + salt/wheel/file_roots.py | 1 - salt/wheel/key.py | 1 - salt/wheel/minions.py | 1 - tests/conftest.py | 4 +- tests/eventlisten.py | 1 + tests/integration/cli/test_custom_module.py | 2 +- .../cloud/clouds/test_digitalocean.py | 1 + .../cloud/clouds/test_dimensiondata.py | 1 - tests/integration/cloud/clouds/test_ec2.py | 1 + tests/integration/cloud/clouds/test_gce.py | 1 - tests/integration/cloud/clouds/test_linode.py | 1 - .../cloud/clouds/test_oneandone.py | 1 + .../cloud/clouds/test_profitbricks.py | 1 + .../cloud/helpers/cloud_test_base.py | 1 - tests/integration/cloud/test_cloud.py | 1 + tests/integration/conftest.py | 1 + .../pillar/ext_pillar_opts.py | 1 - .../file/base/_modules/runtests_helpers.py | 1 - .../files/returners/noop_returner.py | 1 - tests/integration/grains/test_core.py | 1 + tests/integration/grains/test_custom.py | 1 - tests/integration/loader/test_ext_grains.py | 1 - tests/integration/minion/test_timeout.py | 1 - tests/integration/modules/test_boto_iam.py | 1 + tests/integration/modules/test_boto_sns.py | 1 + tests/integration/modules/test_macdefaults.py | 1 + tests/integration/modules/test_test.py | 5 +- tests/integration/modules/test_timezone.py | 1 + tests/integration/shell/test_master_tops.py | 1 - tests/integration/spm/test_install.py | 1 + tests/integration/ssh/test_state.py | 2 +- tests/integration/states/test_boto_sns.py | 1 + tests/integration/states/test_compiler.py | 1 - .../integration/states/test_handle_iorder.py | 1 - tests/integration/states/test_lxd_image.py | 1 + tests/integration/states/test_lxd_profile.py | 1 + tests/integration/utils/test_idem.py | 1 + tests/integration/utils/test_smb.py | 1 + tests/packdump.py | 1 + tests/pytests/conftest.py | 2 + tests/pytests/functional/cli/test_batch.py | 1 + .../pytests/functional/cli/test_salt_cloud.py | 1 + .../functional/modules/file/test_replace.py | 1 + .../modules/state/test_jinja_filters.py | 1 + .../functional/modules/test_archive.py | 1 + .../functional/modules/test_dockermod.py | 1 + .../functional/modules/test_mac_pkgutil.py | 1 + .../pytests/functional/modules/test_mysql.py | 1 + .../functional/modules/test_network.py | 1 + .../functional/modules/test_win_shortcut.py | 1 + .../modules/win_file/test_check_perms.py | 1 + .../modules/win_file/test_remove.py | 1 + .../functional/modules/win_file/test_stat.py | 1 + .../functional/states/file/test_comment.py | 1 + .../functional/states/file/test_managed.py | 1 - .../functional/states/file/test_rename.py | 1 + .../states/test_chocolatey_1_2_1.py | 1 + .../states/test_chocolatey_latest.py | 1 + tests/pytests/functional/states/test_mysql.py | 1 + tests/pytests/functional/states/test_svn.py | 1 + .../functional/states/test_win_certutil.py | 1 + .../pytests/functional/states/test_x509_v2.py | 6 +- .../pytests/functional/utils/test_process.py | 1 + .../utils/win_dacl/test_get_name.py | 1 + .../functional/utils/win_dacl/test_get_sid.py | 1 + .../utils/win_dacl/test_get_sid_string.py | 1 + tests/pytests/integration/cli/test_salt.py | 1 + tests/pytests/integration/cli/test_salt_cp.py | 1 - .../integration/cli/test_salt_deltaproxy.py | 23 ++- .../integration/master/test_payload.py | 1 + .../integration/minion/test_return_retries.py | 4 +- .../integration/modules/grains/test_module.py | 1 - .../modules/saltutil/test_modules.py | 1 - .../modules/saltutil/test_pillar.py | 1 - .../modules/saltutil/test_wheel.py | 1 - .../integration/modules/test_beacons.py | 1 + .../pytests/integration/modules/test_event.py | 1 + .../pytests/integration/modules/test_file.py | 1 + .../pytests/integration/modules/test_idem.py | 1 + .../integration/modules/test_useradd.py | 1 + .../pytests/integration/modules/test_virt.py | 1 + .../integration/netapi/test_ssh_client.py | 2 +- .../pillar/cache/test_pillar_cache.py | 1 + .../integration/pillar/test_pillar_include.py | 13 +- tests/pytests/integration/proxy/conftest.py | 8 +- .../integration/proxy/test_deltaproxy.py | 1 + tests/pytests/integration/proxy/test_shell.py | 1 + .../pytests/integration/proxy/test_simple.py | 1 + .../runners/state/orchestrate/test_events.py | 1 + tests/pytests/integration/sdb/test_vault.py | 1 + tests/pytests/integration/ssh/test_log.py | 1 + .../integration/ssh/test_py_versions.py | 1 + .../pytests/integration/ssh/test_ssh_setup.py | 1 + .../pytests/integration/states/test_beacon.py | 1 + tests/pytests/integration/states/test_file.py | 9 +- tests/pytests/integration/states/test_idem.py | 1 + .../integration/states/test_include.py | 1 + .../integration/utils/test_templates.py | 1 + tests/pytests/pkg/conftest.py | 12 +- .../pytests/pkg/download/test_pkg_download.py | 1 + .../blackout/test_minion_blackout.py | 1 - tests/pytests/scenarios/compat/conftest.py | 1 + .../scenarios/compat/test_with_versions.py | 1 + .../pytests/scenarios/performance/conftest.py | 1 + tests/pytests/scenarios/setup/test_install.py | 1 + tests/pytests/unit/auth/test_ldap.py | 1 + tests/pytests/unit/beacons/test_adb.py | 1 + .../unit/beacons/test_avahi_announce.py | 1 + .../unit/beacons/test_bonjour_announce.py | 1 + tests/pytests/unit/beacons/test_diskusage.py | 1 + tests/pytests/unit/beacons/test_glxinfo.py | 1 + tests/pytests/unit/beacons/test_haproxy.py | 1 + tests/pytests/unit/beacons/test_load.py | 1 + tests/pytests/unit/beacons/test_log_beacon.py | 1 + tests/pytests/unit/beacons/test_memusage.py | 1 + .../pytests/unit/beacons/test_network_info.py | 1 + tests/pytests/unit/beacons/test_ps.py | 1 + tests/pytests/unit/beacons/test_swapusage.py | 1 + tests/pytests/unit/cache/test_localfs.py | 1 + tests/pytests/unit/cache/test_memcache.py | 1 + tests/pytests/unit/cache/test_mysql_cache.py | 1 - .../unit/cloud/clouds/test_azurearm.py | 12 +- .../unit/cloud/clouds/test_digitalocean.py | 1 - .../pytests/unit/cloud/clouds/test_hetzner.py | 12 +- .../pytests/unit/cloud/clouds/test_saltify.py | 1 + .../pytests/unit/cloud/clouds/test_vultrpy.py | 12 +- .../unit/config/test__validate_opts.py | 1 + .../unit/engines/test_libvirt_events.py | 1 + tests/pytests/unit/engines/test_slack.py | 1 + .../unit/engines/test_slack_bolt_engine.py | 23 ++- tests/pytests/unit/engines/test_sqs_events.py | 1 + .../unit/fileclient/test_fileclient.py | 1 + tests/pytests/unit/grains/test_core.py | 18 +- tests/pytests/unit/grains/test_esxi.py | 1 - tests/pytests/unit/loader/test_context.py | 1 + tests/pytests/unit/loader/test_lazy.py | 1 + tests/pytests/unit/loader/test_loader.py | 1 + .../unit/log_handlers/test_sentry_mod.py | 1 + .../unit/modules/file/test_file_line.py | 6 +- tests/pytests/unit/modules/napalm/test_bgp.py | 1 - tests/pytests/unit/modules/napalm/test_mod.py | 1 + .../unit/modules/napalm/test_network.py | 1 - .../pytests/unit/modules/napalm/test_snmp.py | 1 - .../pytests/unit/modules/napalm/test_users.py | 1 - tests/pytests/unit/modules/test_acme.py | 1 - tests/pytests/unit/modules/test_at.py | 1 - tests/pytests/unit/modules/test_augeas_cfg.py | 1 + tests/pytests/unit/modules/test_bigip.py | 1 + .../unit/modules/test_bluez_bluetooth.py | 1 - .../unit/modules/test_boto_dynamodb.py | 1 - tests/pytests/unit/modules/test_bower.py | 1 - tests/pytests/unit/modules/test_bridge.py | 1 - .../unit/modules/test_cassandra_cql.py | 1 - tests/pytests/unit/modules/test_chocolatey.py | 1 + tests/pytests/unit/modules/test_composer.py | 1 - tests/pytests/unit/modules/test_config.py | 1 - tests/pytests/unit/modules/test_consul.py | 1 - tests/pytests/unit/modules/test_cp.py | 1 - .../pytests/unit/modules/test_daemontools.py | 1 - tests/pytests/unit/modules/test_data.py | 1 + tests/pytests/unit/modules/test_deb_apache.py | 1 - tests/pytests/unit/modules/test_devmap.py | 1 - tests/pytests/unit/modules/test_dig.py | 1 - tests/pytests/unit/modules/test_disk.py | 1 + tests/pytests/unit/modules/test_djangomod.py | 1 + .../pytests/unit/modules/test_dpkg_lowpkg.py | 1 - tests/pytests/unit/modules/test_drac.py | 1 - tests/pytests/unit/modules/test_drbd.py | 1 - tests/pytests/unit/modules/test_etcd_mod.py | 1 - tests/pytests/unit/modules/test_extfs.py | 1 - tests/pytests/unit/modules/test_genesis.py | 1 - .../unit/modules/test_gentoo_service.py | 1 - tests/pytests/unit/modules/test_git.py | 9 +- tests/pytests/unit/modules/test_glassfish.py | 1 + tests/pytests/unit/modules/test_glusterfs.py | 1 - .../pytests/unit/modules/test_grub_legacy.py | 1 - tests/pytests/unit/modules/test_hadoop.py | 1 - .../pytests/unit/modules/test_haproxyconn.py | 1 - tests/pytests/unit/modules/test_hashutil.py | 1 - tests/pytests/unit/modules/test_helm.py | 1 - tests/pytests/unit/modules/test_hg.py | 1 - tests/pytests/unit/modules/test_http.py | 1 - tests/pytests/unit/modules/test_ilo.py | 1 - tests/pytests/unit/modules/test_incron.py | 1 - tests/pytests/unit/modules/test_ini_manage.py | 11 +- tests/pytests/unit/modules/test_introspect.py | 1 - tests/pytests/unit/modules/test_ipset.py | 1 + tests/pytests/unit/modules/test_junos.py | 1 + tests/pytests/unit/modules/test_key.py | 1 - tests/pytests/unit/modules/test_keyboard.py | 1 - tests/pytests/unit/modules/test_kubeadm.py | 1 - .../unit/modules/test_launchctl_service.py | 1 - tests/pytests/unit/modules/test_ldapmod.py | 1 - tests/pytests/unit/modules/test_linux_lvm.py | 1 - .../pytests/unit/modules/test_linux_shadow.py | 1 + tests/pytests/unit/modules/test_locate.py | 1 - tests/pytests/unit/modules/test_logadm.py | 1 - tests/pytests/unit/modules/test_logrotate.py | 1 - tests/pytests/unit/modules/test_lvs.py | 1 - .../pytests/unit/modules/test_mac_brew_pkg.py | 1 + .../pytests/unit/modules/test_mac_service.py | 1 - tests/pytests/unit/modules/test_mac_shadow.py | 1 + tests/pytests/unit/modules/test_mandrill.py | 1 - tests/pytests/unit/modules/test_match.py | 1 - tests/pytests/unit/modules/test_mdadm_raid.py | 1 + tests/pytests/unit/modules/test_mine.py | 1 - tests/pytests/unit/modules/test_mongodb.py | 56 +++++-- tests/pytests/unit/modules/test_monit.py | 1 - tests/pytests/unit/modules/test_mysql.py | 1 - tests/pytests/unit/modules/test_nacl.py | 1 + tests/pytests/unit/modules/test_nfs3.py | 1 - tests/pytests/unit/modules/test_nftables.py | 1 + tests/pytests/unit/modules/test_npm.py | 1 - tests/pytests/unit/modules/test_openbsdpkg.py | 1 - tests/pytests/unit/modules/test_oracle.py | 1 - tests/pytests/unit/modules/test_osquery.py | 1 - tests/pytests/unit/modules/test_pacmanpkg.py | 1 - tests/pytests/unit/modules/test_pagerduty.py | 1 - tests/pytests/unit/modules/test_pam.py | 1 + tests/pytests/unit/modules/test_parallels.py | 1 - tests/pytests/unit/modules/test_pecl.py | 1 - tests/pytests/unit/modules/test_pkgutil.py | 1 - .../unit/modules/test_portage_config.py | 3 +- tests/pytests/unit/modules/test_postfix.py | 1 - tests/pytests/unit/modules/test_ps.py | 8 +- tests/pytests/unit/modules/test_publish.py | 1 - tests/pytests/unit/modules/test_pw_user.py | 1 - tests/pytests/unit/modules/test_qemu_img.py | 1 - tests/pytests/unit/modules/test_rabbitmq.py | 1 - tests/pytests/unit/modules/test_rbenv.py | 1 - tests/pytests/unit/modules/test_rdp.py | 1 - .../pytests/unit/modules/test_restartcheck.py | 16 +- tests/pytests/unit/modules/test_ret.py | 1 - tests/pytests/unit/modules/test_rh_service.py | 1 - tests/pytests/unit/modules/test_rvm.py | 1 - tests/pytests/unit/modules/test_s6.py | 1 - .../pytests/unit/modules/test_saltcloudmod.py | 1 - tests/pytests/unit/modules/test_schedule.py | 78 +++++++-- tests/pytests/unit/modules/test_sdb.py | 1 + .../unit/modules/test_serverdensity_device.py | 1 - tests/pytests/unit/modules/test_servicenow.py | 1 - .../unit/modules/test_slackware_service.py | 1 + .../unit/modules/test_smartos_imgadm.py | 1 - tests/pytests/unit/modules/test_smtp.py | 1 - tests/pytests/unit/modules/test_status.py | 1 - tests/pytests/unit/modules/test_suse_ip.py | 4 +- tests/pytests/unit/modules/test_swift.py | 1 - tests/pytests/unit/modules/test_syslog_ng.py | 1 - tests/pytests/unit/modules/test_system.py | 1 + tests/pytests/unit/modules/test_telegram.py | 1 - tests/pytests/unit/modules/test_tomcat.py | 1 - .../unit/modules/test_transactional_update.py | 8 +- tests/pytests/unit/modules/test_tuned.py | 1 - tests/pytests/unit/modules/test_udev.py | 1 - tests/pytests/unit/modules/test_uptime.py | 1 - tests/pytests/unit/modules/test_uwsgi.py | 1 - tests/pytests/unit/modules/test_vagrant.py | 1 - tests/pytests/unit/modules/test_vault.py | 1 - tests/pytests/unit/modules/test_vmctl.py | 1 - tests/pytests/unit/modules/test_webutil.py | 1 - .../pytests/unit/modules/test_win_autoruns.py | 1 - .../unit/modules/test_win_dns_client.py | 1 - tests/pytests/unit/modules/test_win_iis.py | 1 - .../pytests/unit/modules/test_win_licence.py | 1 - tests/pytests/unit/modules/test_win_path.py | 1 - tests/pytests/unit/modules/test_win_pkg.py | 1 + tests/pytests/unit/modules/test_win_pki.py | 1 - .../pytests/unit/modules/test_win_powercfg.py | 1 - tests/pytests/unit/modules/test_win_psget.py | 1 - tests/pytests/unit/modules/test_win_shadow.py | 1 - tests/pytests/unit/modules/test_win_snmp.py | 1 - tests/pytests/unit/modules/test_win_system.py | 1 + tests/pytests/unit/modules/test_win_task.py | 1 + .../pytests/unit/modules/test_win_timezone.py | 1 + tests/pytests/unit/modules/test_win_wua.py | 1 + tests/pytests/unit/modules/test_xapi_virt.py | 1 - tests/pytests/unit/modules/test_xfs.py | 1 - tests/pytests/unit/modules/test_xml.py | 1 - tests/pytests/unit/modules/test_yumpkg.py | 6 +- tests/pytests/unit/modules/test_zenoss.py | 1 - tests/pytests/unit/modules/test_zfs.py | 6 +- tests/pytests/unit/modules/test_znc.py | 1 - tests/pytests/unit/modules/test_zpool.py | 6 +- tests/pytests/unit/modules/test_zypperpkg.py | 1 - .../pytests/unit/modules/virt/test_domain.py | 16 +- .../modules/win_lgpo/test_admx_policies.py | 1 + .../modules/win_lgpo/test_defined_policies.py | 1 + .../unit/modules/win_lgpo/test_mechanisms.py | 1 + .../win_lgpo/test_point_print_enabled.py | 1 + .../modules/win_lgpo/test_point_print_nc.py | 1 + .../unit/modules/win_lgpo/test_policy_info.py | 1 + .../win_lgpo/test_policy_info_functions.py | 1 + .../modules/win_lgpo/test_policy_resources.py | 1 + .../unit/modules/win_lgpo/test_reg_pol.py | 1 + tests/pytests/unit/output/test_json_out.py | 1 + tests/pytests/unit/output/test_nested.py | 1 + tests/pytests/unit/output/test_yaml_out.py | 1 + tests/pytests/unit/pillar/test_csvpillar.py | 1 - .../unit/proxy/nxos/test_nxos_nxapi.py | 18 -- .../pytests/unit/proxy/nxos/test_nxos_ssh.py | 14 -- .../pytests/unit/proxy/test_esxdatacenter.py | 1 + tests/pytests/unit/proxy/test_napalm.py | 1 + tests/pytests/unit/renderers/test_aws_kms.py | 1 + .../returners/test_elasticsearch_return.py | 1 + tests/pytests/unit/returners/test_pgjsonb.py | 1 - .../returners/test_slack_webhook_return.py | 1 + .../unit/returners/test_smtp_return.py | 1 + .../unit/returners/test_syslog_return.py | 1 + .../unit/returners/test_telegram_return.py | 1 + tests/pytests/unit/roster/test_dir.py | 1 - tests/pytests/unit/roster/test_terraform.py | 1 + tests/pytests/unit/runners/test_bgp.py | 1 + tests/pytests/unit/runners/test_fileserver.py | 1 - tests/pytests/unit/runners/test_git_pillar.py | 1 - tests/pytests/unit/runners/test_jobs.py | 1 + tests/pytests/unit/runners/test_network.py | 1 + tests/pytests/unit/runners/test_reactor.py | 1 - tests/pytests/unit/runners/test_spacewalk.py | 1 + tests/pytests/unit/runners/test_winrepo.py | 1 - .../unit/runners/vault/test_app_role_auth.py | 1 - .../unit/runners/vault/test_token_auth.py | 1 - .../pytests/unit/runners/vault/test_vault.py | 1 - tests/pytests/unit/sdb/test_yaml.py | 1 - tests/pytests/unit/state/test_state_basic.py | 1 + .../unit/states/file/test__clean_dir.py | 1 + .../states/file/test_retention_schedule.py | 14 +- .../unit/states/mysql/test_database.py | 1 + tests/pytests/unit/states/test_aptpkg.py | 1 - tests/pytests/unit/states/test_archive.py | 1 - tests/pytests/unit/states/test_aws_sqs.py | 1 + .../unit/states/test_boto_cloudfront.py | 1 + tests/pytests/unit/states/test_boto_lc.py | 1 + .../pytests/unit/states/test_boto_route53.py | 1 + tests/pytests/unit/states/test_boto_sns.py | 1 + tests/pytests/unit/states/test_boto_sqs.py | 1 + tests/pytests/unit/states/test_bower.py | 1 + tests/pytests/unit/states/test_chocolatey.py | 1 + tests/pytests/unit/states/test_consul.py | 1 - tests/pytests/unit/states/test_debconfmod.py | 1 + tests/pytests/unit/states/test_drac.py | 1 + .../pytests/unit/states/test_elasticsearch.py | 1 + tests/pytests/unit/states/test_eselect.py | 1 + tests/pytests/unit/states/test_etcd_mod.py | 1 - tests/pytests/unit/states/test_ethtool.py | 6 +- tests/pytests/unit/states/test_gem.py | 1 - tests/pytests/unit/states/test_git.py | 1 - .../pytests/unit/states/test_gnomedesktop.py | 1 - tests/pytests/unit/states/test_grains.py | 1 + tests/pytests/unit/states/test_group.py | 3 +- tests/pytests/unit/states/test_helm.py | 1 - tests/pytests/unit/states/test_ini_manage.py | 1 - tests/pytests/unit/states/test_iptables.py | 1 - tests/pytests/unit/states/test_kapacitor.py | 1 - tests/pytests/unit/states/test_kernelpkg.py | 1 - tests/pytests/unit/states/test_kmod.py | 1 + tests/pytests/unit/states/test_layman.py | 1 + tests/pytests/unit/states/test_ldap.py | 65 ++++---- .../pytests/unit/states/test_libcloud_dns.py | 1 - tests/pytests/unit/states/test_mount.py | 6 +- tests/pytests/unit/states/test_pip.py | 1 + tests/pytests/unit/states/test_ports.py | 1 + tests/pytests/unit/states/test_sysfs.py | 1 + .../unit/states/test_virtualenv_mod.py | 1 - tests/pytests/unit/states/test_webutil.py | 1 - tests/pytests/unit/states/test_win_lgpo.py | 1 + tests/pytests/unit/states/test_win_wua.py | 21 ++- tests/pytests/unit/states/test_xmpp.py | 1 - tests/pytests/unit/states/virt/test_domain.py | 22 ++- .../pytests/unit/states/zabbix/test_action.py | 8 +- .../unit/states/zabbix/test_valuemap.py | 8 +- tests/pytests/unit/test_acl.py | 1 - tests/pytests/unit/test_config.py | 1 + tests/pytests/unit/test_fileclient.py | 1 + tests/pytests/unit/test_log.py | 1 - tests/pytests/unit/test_syspaths.py | 1 + tests/pytests/unit/test_version.py | 1 + tests/pytests/unit/transport/test_base.py | 1 + tests/pytests/unit/utils/jinja/conftest.py | 1 + tests/pytests/unit/utils/jinja/test_jinja.py | 1 + .../pytests/unit/utils/scheduler/conftest.py | 1 - .../unit/utils/templates/test_jinja.py | 1 + .../utils/templates/test_wrap_tmpl_func.py | 1 + tests/pytests/unit/utils/test_aws.py | 1 + tests/pytests/unit/utils/test_cloud.py | 1 - tests/pytests/unit/utils/test_compat.py | 1 + tests/pytests/unit/utils/test_crypt.py | 1 + tests/pytests/unit/utils/test_data.py | 1 + tests/pytests/unit/utils/test_files.py | 1 - tests/pytests/unit/utils/test_nacl.py | 1 + tests/pytests/unit/utils/test_rsax931.py | 1 + tests/pytests/unit/utils/test_x509.py | 8 +- .../unit/utils/verify/test_clean_path_link.py | 1 + .../pytests/unit/utils/verify/test_verify.py | 16 +- tests/support/cli_scripts.py | 1 - tests/support/events.py | 1 - tests/support/helpers.py | 1 + tests/support/kernelpkg.py | 1 + tests/support/mixins.py | 6 +- tests/support/mock.py | 1 + tests/support/napalm.py | 1 - tests/support/pytest/helpers.py | 1 + tests/support/pytest/loader.py | 1 + tests/support/runtests.py | 16 +- tests/support/unit.py | 1 + tests/support/xmlunit.py | 1 + tests/support/zfs.py | 1 - tests/unit/ext/test_ipaddress.py | 4 +- tests/unit/modules/nxos/nxos_n36k.py | 1 - tests/unit/modules/nxos/nxos_n3k.py | 1 - tests/unit/modules/nxos/nxos_n5k.py | 1 - tests/unit/modules/nxos/nxos_n7k.py | 1 - tests/unit/modules/nxos/nxos_n93k.py | 1 - tests/unit/modules/nxos/nxos_n93klxc.py | 1 - tests/unit/modules/nxos/nxos_n95k.py | 1 - tests/unit/modules/nxos/nxos_platform.py | 4 - .../unit/modules/test_boto3_elasticsearch.py | 1 + tests/unit/modules/test_boto3_route53.py | 1 + tests/unit/modules/test_bsd_shadow.py | 1 + tests/unit/modules/test_freezer.py | 1 - tests/unit/modules/test_influxdb08mod.py | 1 - .../unit/modules/test_kernelpkg_linux_apt.py | 1 + .../unit/modules/test_kernelpkg_linux_yum.py | 1 + tests/unit/modules/test_kubernetesmod.py | 1 + tests/unit/modules/test_libcloud_compute.py | 1 + tests/unit/modules/test_libcloud_dns.py | 1 + .../modules/test_libcloud_loadbalancer.py | 1 + tests/unit/modules/test_libcloud_storage.py | 1 + tests/unit/modules/test_localemod.py | 1 + tests/unit/modules/test_memcached.py | 1 - tests/unit/modules/test_napalm_probes.py | 1 - tests/unit/modules/test_napalm_yang_mod.py | 1 - tests/unit/modules/test_netbox.py | 1 + tests/unit/modules/test_netscaler.py | 1 - tests/unit/modules/test_neutron.py | 1 - tests/unit/modules/test_nova.py | 1 - tests/unit/modules/test_nxos.py | 60 ------- tests/unit/modules/test_nxos_upgrade.py | 23 --- tests/unit/modules/test_openstack_config.py | 1 - tests/unit/modules/test_opkg.py | 6 +- tests/unit/modules/test_parted_partition.py | 1 - tests/unit/modules/test_rh_ip.py | 4 +- tests/unit/modules/test_snapper.py | 1 + tests/unit/modules/test_sqlite3.py | 1 - tests/unit/modules/test_supervisord.py | 1 - tests/unit/modules/test_sysmod.py | 1 - tests/unit/modules/test_systemd_service.py | 1 - tests/unit/modules/test_twilio_notify.py | 1 + tests/unit/modules/test_useradd.py | 1 + tests/unit/modules/test_virt.py | 40 +++-- tests/unit/modules/test_vsphere.py | 1 + tests/unit/modules/test_win_system.py | 1 + tests/unit/modules/test_zypperpkg.py | 1 - tests/unit/states/test_group.py | 1 - tests/unit/states/test_module.py | 1 - tests/unit/states/test_syslog_ng.py | 1 - tests/unit/test_config.py | 1 + tests/unit/test_zypp_plugins.py | 1 + tests/unit/transport/test_ipc.py | 1 + tests/unit/utils/test_color.py | 1 - tests/unit/utils/test_decorators.py | 1 - tests/unit/utils/test_doc.py | 1 - tests/unit/utils/test_environment.py | 1 + tests/unit/utils/test_extend.py | 1 + tests/unit/utils/test_filebuffer.py | 1 - tests/unit/utils/test_immutabletypes.py | 1 - tests/unit/utils/test_jid.py | 1 - tests/unit/utils/test_job.py | 1 - tests/unit/utils/test_mac_utils.py | 1 + tests/unit/utils/test_msgpack.py | 1 + tests/unit/utils/test_proxy.py | 1 - tests/unit/utils/test_roster_matcher.py | 1 + tests/unit/utils/test_sdb.py | 1 - tests/unit/utils/test_state.py | 1 - tests/unit/utils/test_thin.py | 2 +- tests/unit/utils/test_vmware.py | 30 ++-- tests/unit/utils/test_vsan.py | 1 + tests/unit/utils/test_win_chcp.py | 1 + tests/unit/utils/test_xmlutil.py | 1 + tests/unit/utils/test_yamlencoding.py | 1 - tests/unit/utils/test_zeromq.py | 1 + tests/unit/utils/test_zfs.py | 1 - tools/changelog.py | 1 + tools/ci.py | 1 + tools/docs.py | 1 + tools/pkg/__init__.py | 3 +- tools/pkg/build.py | 5 +- tools/pkg/repo/__init__.py | 1 + tools/pkg/repo/create.py | 1 + tools/pkg/repo/publish.py | 1 + tools/precommit/__init__.py | 1 + tools/precommit/changelog.py | 1 + tools/precommit/docs.py | 1 + tools/precommit/docstrings.py | 1 + tools/precommit/filemap.py | 1 + tools/precommit/workflows.py | 1 + tools/release.py | 1 + tools/testsuite/__init__.py | 1 + tools/testsuite/download.py | 1 + tools/vm.py | 1 + 1226 files changed, 2974 insertions(+), 3131 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd136d50a9c..9067d37d074 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ exclude: ^(doc/_static/.*|doc/_themes/.*)$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-merge-conflict # Check for files that contain merge conflict strings. - id: trailing-whitespace # Trims trailing whitespace. @@ -1622,7 +1622,7 @@ repos: # ----- Code Formatting -------------------------------------------------------------------------------------------> - repo: https://github.com/asottile/pyupgrade - rev: v2.37.2 + rev: v3.15.1 hooks: - id: pyupgrade name: Drop six usage and Py2 support @@ -1643,7 +1643,7 @@ repos: - repo: https://github.com/saltstack/salt-rewrite # Automatically rewrite code with known rules - rev: 2.4.4 + rev: 2.5.2 hooks: - id: salt-rewrite alias: rewrite-docstrings @@ -1662,7 +1662,7 @@ repos: args: [--silent, -E, fix_asserts, -E, fix_docstrings] - repo: https://github.com/timothycrosley/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort additional_dependencies: ['toml'] @@ -1675,31 +1675,32 @@ repos: )$ - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 24.2.0 hooks: - id: black # This tells pre-commit not to pass files to black. # This should be kept in sync with pyproject.toml exclude: > (?x)^( + salt/client/ssh/ssh_py_shim\.py| templates/.*| salt/ext/.*| )$ - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.16.0 hooks: - id: blacken-docs args: [--skip-errors] files: ^doc/.*\.rst additional_dependencies: - - black==22.6.0 + - black==24.2.0 # <---- Code Formatting -------------------------------------------------------------------------------------------- # ----- Security --------------------------------------------------------------------------------------------------> - repo: https://github.com/PyCQA/bandit - rev: "1.7.4" + rev: "1.7.7" hooks: - id: bandit alias: bandit-salt @@ -1713,7 +1714,7 @@ repos: )$ additional_dependencies: ['importlib_metadata<5'] - repo: https://github.com/PyCQA/bandit - rev: "1.7.4" + rev: "1.7.7" hooks: - id: bandit alias: bandit-tests @@ -1726,7 +1727,7 @@ repos: # ----- Pre-Commit ------------------------------------------------------------------------------------------------> - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.8.0 hooks: - id: mypy alias: mypy-tools @@ -1746,7 +1747,7 @@ repos: - python-tools-scripts==0.20.0 - repo: https://github.com/saltstack/mirrors-nox - rev: v2021.6.12 + rev: v2022.11.21 hooks: - id: nox alias: lint-salt @@ -1766,7 +1767,7 @@ repos: - pip>=20.2.4,<21.2 - repo: https://github.com/saltstack/mirrors-nox - rev: v2021.6.12 + rev: v2022.11.21 hooks: - id: nox alias: lint-tests diff --git a/doc/ref/executors/index.rst b/doc/ref/executors/index.rst index 97379fdba3a..44df3a12918 100644 --- a/doc/ref/executors/index.rst +++ b/doc/ref/executors/index.rst @@ -59,8 +59,7 @@ the ``execute`` function with the following signature: .. code-block:: python - def execute(opts, data, func, args, kwargs): - ... + def execute(opts, data, func, args, kwargs): ... Where the args are: diff --git a/doc/ref/modules/index.rst b/doc/ref/modules/index.rst index ca9171383c5..3231368c036 100644 --- a/doc/ref/modules/index.rst +++ b/doc/ref/modules/index.rst @@ -329,6 +329,7 @@ the case when the dependency is unavailable. """ Cheese execution (or returner/beacon/etc.) module """ + try: import enzymes diff --git a/doc/topics/development/tests/index.rst b/doc/topics/development/tests/index.rst index 55e8bb18f2a..a789bab089d 100644 --- a/doc/topics/development/tests/index.rst +++ b/doc/topics/development/tests/index.rst @@ -364,8 +364,7 @@ the actual testing, such as functions containing assertions, must start with .. code-block:: python - def test_user_present(self): - ... + def test_user_present(self): ... When functions in test files are not prepended with ``test_``, the function acts as a normal, helper function and is not run as a test by the test suite. diff --git a/doc/topics/proxyminion/index.rst b/doc/topics/proxyminion/index.rst index cb4aec151a2..2d18e3607cf 100644 --- a/doc/topics/proxyminion/index.rst +++ b/doc/topics/proxyminion/index.rst @@ -581,7 +581,6 @@ and status; "package" installation, and a ping. def uptodate(name): - """ Call the REST endpoint to see if the packages on the "server" are up to date. """ @@ -592,7 +591,6 @@ and status; "package" installation, and a ping. def package_remove(name): - """ Remove a "package" on the REST server """ diff --git a/doc/topics/releases/2016.11.0.rst b/doc/topics/releases/2016.11.0.rst index 2aad664eca9..227eaa9ce93 100644 --- a/doc/topics/releases/2016.11.0.rst +++ b/doc/topics/releases/2016.11.0.rst @@ -551,15 +551,13 @@ General Deprecations .. code-block:: python - def fcn(msg="", env="base", refresh=True, saltenv="base", **kwargs): - ... + def fcn(msg="", env="base", refresh=True, saltenv="base", **kwargs): ... has been changed to .. code-block:: python - def fcn(msg="", refresh=True, saltenv="base", **kwargs): - ... + def fcn(msg="", refresh=True, saltenv="base", **kwargs): ... - If ``env`` (or ``__env__``) is supplied as a keyword argument to a function that also accepts arbitrary keyword arguments, then a new warning informs the @@ -568,8 +566,7 @@ General Deprecations .. code-block:: python - def fcn(msg="", refresh=True, saltenv="base", **kwargs): - ... + def fcn(msg="", refresh=True, saltenv="base", **kwargs): ... .. code-block:: python @@ -582,8 +579,7 @@ General Deprecations .. code-block:: python - def fcn(msg="", refresh=True, saltenv="base"): - ... + def fcn(msg="", refresh=True, saltenv="base"): ... .. code-block:: python @@ -597,8 +593,7 @@ General Deprecations .. code-block:: python - def fcn(msg="", refresh=True, saltenv="base"): - ... + def fcn(msg="", refresh=True, saltenv="base"): ... .. code-block:: python diff --git a/noxfile.py b/noxfile.py index 1a78e4628ae..05de53de6f6 100644 --- a/noxfile.py +++ b/noxfile.py @@ -4,6 +4,7 @@ noxfile Nox configuration script """ + # pylint: disable=resource-leakage,3rd-party-module-not-gated import contextlib @@ -1712,7 +1713,7 @@ class Recompress: d_targz = tempd.joinpath(targz.name) with tarfile.open(d_tar, "w|") as wfile: with tarfile.open(targz, "r:gz") as rfile: - rfile.extractall(d_src) + rfile.extractall(d_src) # nosec extracted_dir = next(pathlib.Path(d_src).iterdir()) for name in sorted(extracted_dir.rglob("*")): wfile.add( diff --git a/salt/__init__.py b/salt/__init__.py index 2553ed40e9e..409ccabb2c3 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -7,13 +7,6 @@ import os import sys import warnings -if sys.version_info < (3,): # pragma: no cover - sys.stderr.write( - "\n\nAfter the Sodium release, 3001, Salt no longer supports Python 2. Exiting.\n\n" - ) - sys.stderr.flush() - - USE_VENDORED_TORNADO = True diff --git a/salt/_compat.py b/salt/_compat.py index 7d20691f594..2cead97d0b2 100644 --- a/salt/_compat.py +++ b/salt/_compat.py @@ -1,6 +1,7 @@ """ Salt compatibility code """ + # pylint: disable=unused-import import sys diff --git a/salt/_logging/__init__.py b/salt/_logging/__init__.py index 43bcbac3aca..ea97b6ce9a8 100644 --- a/salt/_logging/__init__.py +++ b/salt/_logging/__init__.py @@ -9,6 +9,7 @@ The ``salt._logging`` package should be imported as soon as possible since salt tweaks the python's logging system. """ + from salt._logging.impl import ( DFLT_LOG_DATEFMT, DFLT_LOG_DATEFMT_LOGFILE, diff --git a/salt/auth/django.py b/salt/auth/django.py index a5a52063eb7..0b810b83510 100644 --- a/salt/auth/django.py +++ b/salt/auth/django.py @@ -46,7 +46,6 @@ indicated above, though the model DOES NOT have to be named 'SaltExternalAuthModel'. """ - import logging import os import sys diff --git a/salt/auth/file.py b/salt/auth/file.py index 807c9c93bba..61f73480978 100644 --- a/salt/auth/file.py +++ b/salt/auth/file.py @@ -94,7 +94,6 @@ When using ``htdigest`` the ``^realm`` must be set: """ - import logging import os diff --git a/salt/auth/keystone.py b/salt/auth/keystone.py index 5ed9f7c499f..def2e8170e5 100644 --- a/salt/auth/keystone.py +++ b/salt/auth/keystone.py @@ -4,7 +4,6 @@ Provide authentication using OpenStack Keystone :depends: - keystoneclient Python module """ - try: from keystoneclient.exceptions import AuthorizationFailure, Unauthorized from keystoneclient.v2_0 import client diff --git a/salt/auth/ldap.py b/salt/auth/ldap.py index 629bd93a3e0..604f06c3d20 100644 --- a/salt/auth/ldap.py +++ b/salt/auth/ldap.py @@ -3,6 +3,7 @@ Provide authentication using simple LDAP binds :depends: - ldap Python module """ + import itertools import logging diff --git a/salt/auth/mysql.py b/salt/auth/mysql.py index d08accb6cf4..215e7a42d2b 100644 --- a/salt/auth/mysql.py +++ b/salt/auth/mysql.py @@ -47,7 +47,6 @@ Enable MySQL authentication. :depends: - MySQL-python Python module """ - import logging log = logging.getLogger(__name__) diff --git a/salt/auth/rest.py b/salt/auth/rest.py index 42fc73da59a..d48b24797aa 100644 --- a/salt/auth/rest.py +++ b/salt/auth/rest.py @@ -22,7 +22,6 @@ structure of a user as above. """ - import logging import salt.utils.http diff --git a/salt/auth/yubico.py b/salt/auth/yubico.py index f0b37eb6c0d..7682d444194 100644 --- a/salt/auth/yubico.py +++ b/salt/auth/yubico.py @@ -36,7 +36,6 @@ the API key will be updated on all the YubiCloud servers. """ - import logging log = logging.getLogger(__name__) diff --git a/salt/beacons/adb.py b/salt/beacons/adb.py index cea98eafdae..e5ebba1771c 100644 --- a/salt/beacons/adb.py +++ b/salt/beacons/adb.py @@ -3,6 +3,7 @@ Beacon to emit adb device state changes for Android devices .. versionadded:: 2016.3.0 """ + import logging import salt.utils.beacons diff --git a/salt/beacons/aix_account.py b/salt/beacons/aix_account.py index 8a9e0469bd0..07aad263846 100644 --- a/salt/beacons/aix_account.py +++ b/salt/beacons/aix_account.py @@ -5,6 +5,7 @@ Beacon to fire event when we notice a AIX user is locked due to many failed logi :depends: none """ + import logging log = logging.getLogger(__name__) diff --git a/salt/beacons/bonjour_announce.py b/salt/beacons/bonjour_announce.py index edbd135e751..c129128f849 100644 --- a/salt/beacons/bonjour_announce.py +++ b/salt/beacons/bonjour_announce.py @@ -1,6 +1,7 @@ """ Beacon to announce via Bonjour (zeroconf) """ + import atexit import logging import select diff --git a/salt/beacons/cert_info.py b/salt/beacons/cert_info.py index b9b59902063..298d56317bd 100644 --- a/salt/beacons/cert_info.py +++ b/salt/beacons/cert_info.py @@ -7,6 +7,7 @@ Beacon to monitor certificate expiration dates from files on the filesystem. :maturity: new :depends: OpenSSL """ + import logging from datetime import datetime diff --git a/salt/beacons/diskusage.py b/salt/beacons/diskusage.py index 5be33ff975e..eab69786902 100644 --- a/salt/beacons/diskusage.py +++ b/salt/beacons/diskusage.py @@ -5,6 +5,7 @@ Beacon to monitor disk usage. :depends: python-psutil """ + import logging import re diff --git a/salt/beacons/glxinfo.py b/salt/beacons/glxinfo.py index 20c4d4b9b01..a4aa4013804 100644 --- a/salt/beacons/glxinfo.py +++ b/salt/beacons/glxinfo.py @@ -3,6 +3,7 @@ Beacon to emit when a display is available to a linux machine .. versionadded:: 2016.3.0 """ + import logging import salt.utils.beacons diff --git a/salt/beacons/haproxy.py b/salt/beacons/haproxy.py index e19ec34abd2..a3aa13de597 100644 --- a/salt/beacons/haproxy.py +++ b/salt/beacons/haproxy.py @@ -4,6 +4,7 @@ Fire an event when over a specified threshold. .. versionadded:: 2016.11.0 """ + import logging import salt.utils.beacons diff --git a/salt/beacons/journald.py b/salt/beacons/journald.py index f2c46c02e7d..19618a59938 100644 --- a/salt/beacons/journald.py +++ b/salt/beacons/journald.py @@ -1,6 +1,7 @@ """ A simple beacon to watch journald for specific entries """ + import logging import salt.utils.beacons diff --git a/salt/beacons/load.py b/salt/beacons/load.py index 56bc5b0cfa0..90b76201f8e 100644 --- a/salt/beacons/load.py +++ b/salt/beacons/load.py @@ -1,6 +1,7 @@ """ Beacon to emit system load averages """ + import logging import os diff --git a/salt/beacons/log_beacon.py b/salt/beacons/log_beacon.py index 6e5621f53a7..52227cd09cb 100644 --- a/salt/beacons/log_beacon.py +++ b/salt/beacons/log_beacon.py @@ -4,6 +4,7 @@ Beacon to fire events at specific log messages. .. versionadded:: 2017.7.0 """ + import logging import salt.utils.beacons diff --git a/salt/beacons/memusage.py b/salt/beacons/memusage.py index a80423a398e..029fb8efbeb 100644 --- a/salt/beacons/memusage.py +++ b/salt/beacons/memusage.py @@ -5,6 +5,7 @@ Beacon to monitor memory usage. :depends: python-psutil """ + import logging import re diff --git a/salt/beacons/network_info.py b/salt/beacons/network_info.py index c8a28b4d700..8d2c94176ea 100644 --- a/salt/beacons/network_info.py +++ b/salt/beacons/network_info.py @@ -3,6 +3,7 @@ Beacon to monitor statistics from ethernet adapters .. versionadded:: 2015.5.0 """ + import logging import salt.utils.beacons diff --git a/salt/beacons/pkg.py b/salt/beacons/pkg.py index 2613f41a61f..2a7c5e19eec 100644 --- a/salt/beacons/pkg.py +++ b/salt/beacons/pkg.py @@ -3,6 +3,7 @@ Watch for pkgs that have upgrades, then fire an event. .. versionadded:: 2016.3.0 """ + import logging __virtualname__ = "pkg" diff --git a/salt/beacons/proxy_example.py b/salt/beacons/proxy_example.py index 1c804d05284..960e23fa709 100644 --- a/salt/beacons/proxy_example.py +++ b/salt/beacons/proxy_example.py @@ -7,6 +7,7 @@ Example beacon to use with salt-proxy proxy_example: endpoint: beacon """ + import logging import salt.utils.beacons diff --git a/salt/beacons/ps.py b/salt/beacons/ps.py index 6c19d8f8640..090a06b1235 100644 --- a/salt/beacons/ps.py +++ b/salt/beacons/ps.py @@ -1,6 +1,7 @@ """ Send events covering process status """ + import logging import salt.utils.beacons diff --git a/salt/beacons/salt_monitor.py b/salt/beacons/salt_monitor.py index 1776d0ce896..d389976ae2a 100644 --- a/salt/beacons/salt_monitor.py +++ b/salt/beacons/salt_monitor.py @@ -24,6 +24,7 @@ See example config below. - test.ping - interval: 3600 # seconds """ + import salt.utils.beacons diff --git a/salt/beacons/salt_proxy.py b/salt/beacons/salt_proxy.py index dea7ce42057..1eebc4103b9 100644 --- a/salt/beacons/salt_proxy.py +++ b/salt/beacons/salt_proxy.py @@ -4,6 +4,7 @@ .. versionadded:: 2015.8.3 """ + import logging import salt.utils.beacons diff --git a/salt/beacons/sensehat.py b/salt/beacons/sensehat.py index 8f1d1393350..6e3c29f4d36 100644 --- a/salt/beacons/sensehat.py +++ b/salt/beacons/sensehat.py @@ -8,6 +8,7 @@ Monitor temperature, humidity and pressure using the SenseHat of a Raspberry Pi :maturity: new :depends: sense_hat Python module """ + import logging import re diff --git a/salt/beacons/service.py b/salt/beacons/service.py index b27f75273af..6f7519e8f95 100644 --- a/salt/beacons/service.py +++ b/salt/beacons/service.py @@ -1,6 +1,7 @@ """ Send events covering service status """ + import logging import os import time diff --git a/salt/beacons/sh.py b/salt/beacons/sh.py index 29c2a2a206a..8141b5a1a95 100644 --- a/salt/beacons/sh.py +++ b/salt/beacons/sh.py @@ -1,6 +1,7 @@ """ Watch the shell commands being executed actively. This beacon requires strace. """ + import logging import time diff --git a/salt/beacons/smartos_imgadm.py b/salt/beacons/smartos_imgadm.py index 2432a54e79f..f1e3e83df3b 100644 --- a/salt/beacons/smartos_imgadm.py +++ b/salt/beacons/smartos_imgadm.py @@ -17,6 +17,7 @@ Beacon that fires events on image import/delete. - interval: 60 - startup_import_event: True """ + import logging import salt.utils.beacons diff --git a/salt/beacons/smartos_vmadm.py b/salt/beacons/smartos_vmadm.py index fd48253785b..1dae2430b1b 100644 --- a/salt/beacons/smartos_vmadm.py +++ b/salt/beacons/smartos_vmadm.py @@ -17,6 +17,7 @@ Beacon that fires events on vm state changes - interval: 60 - startup_create_event: True """ + import logging import salt.utils.beacons diff --git a/salt/beacons/status.py b/salt/beacons/status.py index aa5aa13b478..9492d339691 100644 --- a/salt/beacons/status.py +++ b/salt/beacons/status.py @@ -87,6 +87,7 @@ markers for specific list items: to check the minion log for errors after configuring this beacon. """ + import datetime import logging @@ -165,8 +166,8 @@ def beacon(config): except TypeError: ret[func][item] = data[int(item)] except KeyError as exc: - ret[ - func - ] = "Status beacon is incorrectly configured: {}".format(exc) + ret[func] = ( + "Status beacon is incorrectly configured: {}".format(exc) + ) return [{"tag": ctime, "data": ret}] diff --git a/salt/beacons/swapusage.py b/salt/beacons/swapusage.py index 0cbdec07ea4..1bb9a572a3d 100644 --- a/salt/beacons/swapusage.py +++ b/salt/beacons/swapusage.py @@ -5,6 +5,7 @@ Beacon to monitor swap usage. :depends: python-psutil """ + import logging import re diff --git a/salt/beacons/telegram_bot_msg.py b/salt/beacons/telegram_bot_msg.py index e11c869947f..76e0e2a6c34 100644 --- a/salt/beacons/telegram_bot_msg.py +++ b/salt/beacons/telegram_bot_msg.py @@ -4,6 +4,7 @@ Beacon to emit Telegram messages Requires the python-telegram-bot library """ + import logging import salt.utils.beacons diff --git a/salt/beacons/twilio_txt_msg.py b/salt/beacons/twilio_txt_msg.py index 7ff5a361fb6..742342ef9f9 100644 --- a/salt/beacons/twilio_txt_msg.py +++ b/salt/beacons/twilio_txt_msg.py @@ -1,6 +1,7 @@ """ Beacon to emit Twilio text messages """ + import logging import salt.utils.beacons diff --git a/salt/cache/__init__.py b/salt/cache/__init__.py index 2b13a364235..71fafc6d286 100644 --- a/salt/cache/__init__.py +++ b/salt/cache/__init__.py @@ -4,7 +4,6 @@ Loader mechanism for caching data, with data expiration, etc. .. versionadded:: 2016.11.0 """ - import logging import time diff --git a/salt/cache/redis_cache.py b/salt/cache/redis_cache.py index 6579303fef8..754bba71f0a 100644 --- a/salt/cache/redis_cache.py +++ b/salt/cache/redis_cache.py @@ -151,7 +151,6 @@ Cluster Configuration Example: cache.redis.separator: '@' """ - import itertools import logging import time diff --git a/salt/channel/client.py b/salt/channel/client.py index 8d43406728e..0360af34658 100644 --- a/salt/channel/client.py +++ b/salt/channel/client.py @@ -4,7 +4,6 @@ Encapsulate the different transports available to Salt. This includes client side transport, for the ReqServer and the Publisher """ - import logging import os import time diff --git a/salt/cli/api.py b/salt/cli/api.py index a54595578c4..3e46676e1ef 100644 --- a/salt/cli/api.py +++ b/salt/cli/api.py @@ -6,7 +6,6 @@ """ - import logging import salt.client.netapi diff --git a/salt/cli/caller.py b/salt/cli/caller.py index fd12b4e0ae3..ce2b8edfd4e 100644 --- a/salt/cli/caller.py +++ b/salt/cli/caller.py @@ -235,7 +235,7 @@ class BaseCaller: retcode = salt.defaults.exitcodes.EX_GENERIC ret["retcode"] = retcode - except (CommandExecutionError) as exc: + except CommandExecutionError as exc: msg = "Error running '{0}': {1}\n" active_level = LOG_LEVELS.get(self.opts["log_level"].lower(), logging.ERROR) if active_level <= logging.DEBUG: diff --git a/salt/cli/daemons.py b/salt/cli/daemons.py index ecc05c919ef..7578e8e64c3 100644 --- a/salt/cli/daemons.py +++ b/salt/cli/daemons.py @@ -2,7 +2,6 @@ Make me some salt! """ - import logging import os import warnings diff --git a/salt/cli/spm.py b/salt/cli/spm.py index 9098e0d78e6..a4c97da5570 100644 --- a/salt/cli/spm.py +++ b/salt/cli/spm.py @@ -7,7 +7,6 @@ .. versionadded:: 2015.8.0 """ - import salt.spm import salt.utils.parsers as parsers from salt.utils.verify import verify_env diff --git a/salt/client/mixins.py b/salt/client/mixins.py index c6b479e106b..6e05e86d342 100644 --- a/salt/client/mixins.py +++ b/salt/client/mixins.py @@ -387,10 +387,10 @@ class SyncClientMixin(ClientStateMixin): try: data["return"] = func(*args, **kwargs) except TypeError as exc: - data[ - "return" - ] = "\nPassed invalid arguments: {}\n\nUsage:\n{}".format( - exc, func.__doc__ + data["return"] = ( + "\nPassed invalid arguments: {}\n\nUsage:\n{}".format( + exc, func.__doc__ + ) ) try: data["success"] = self.context.get("retcode", 0) == 0 diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index a5f681569d1..80936a06112 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -745,9 +745,9 @@ class SSH(MultiprocessingStateMixin): data["id"] = id_ if "fun" not in data: data["fun"] = fun - data[ - "jid" - ] = jid # make the jid in the payload the same as the jid in the tag + data["jid"] = ( + jid # make the jid in the payload the same as the jid in the tag + ) self.event.fire_event( data, salt.utils.event.tagify([jid, "ret", host], "job") ) @@ -862,9 +862,9 @@ class SSH(MultiprocessingStateMixin): data["id"] = id_ if "fun" not in data: data["fun"] = fun - data[ - "jid" - ] = jid # make the jid in the payload the same as the jid in the tag + data["jid"] = ( + jid # make the jid in the payload the same as the jid in the tag + ) self.event.fire_event( data, salt.utils.event.tagify([jid, "ret", host], "job") ) diff --git a/salt/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py index f0b697d0ac4..679fb52cbbb 100644 --- a/salt/client/ssh/ssh_py_shim.py +++ b/salt/client/ssh/ssh_py_shim.py @@ -169,7 +169,7 @@ def unpack_thin(thin_path): """ tfile = tarfile.TarFile.gzopen(thin_path) old_umask = os.umask(0o077) # pylint: disable=blacklisted-function - tfile.extractall(path=OPTIONS.saltdir) + tfile.extractall(path=OPTIONS.saltdir) # nosec tfile.close() os.umask(old_umask) # pylint: disable=blacklisted-function try: @@ -196,7 +196,7 @@ def unpack_ext(ext_path): ) tfile = tarfile.TarFile.gzopen(ext_path) old_umask = os.umask(0o077) # pylint: disable=blacklisted-function - tfile.extractall(path=modcache) + tfile.extractall(path=modcache) # nosec tfile.close() os.umask(old_umask) # pylint: disable=blacklisted-function os.unlink(ext_path) diff --git a/salt/client/ssh/wrapper/__init__.py b/salt/client/ssh/wrapper/__init__.py index 42bdc624f21..deac7a465ef 100644 --- a/salt/client/ssh/wrapper/__init__.py +++ b/salt/client/ssh/wrapper/__init__.py @@ -5,7 +5,6 @@ to be easily rewritten to execute in a way that makes them do the same tasks as ZeroMQ salt, but via ssh. """ - import copy import salt.client.ssh diff --git a/salt/client/ssh/wrapper/grains.py b/salt/client/ssh/wrapper/grains.py index 92446f4018e..400131e1517 100644 --- a/salt/client/ssh/wrapper/grains.py +++ b/salt/client/ssh/wrapper/grains.py @@ -2,7 +2,6 @@ Return/control aspects of the grains data """ - import math import salt.utils.data diff --git a/salt/client/ssh/wrapper/mine.py b/salt/client/ssh/wrapper/mine.py index 1817058eea8..d22d0926ca1 100644 --- a/salt/client/ssh/wrapper/mine.py +++ b/salt/client/ssh/wrapper/mine.py @@ -4,7 +4,6 @@ Wrapper function for mine operations for salt-ssh .. versionadded:: 2015.5.0 """ - import copy import salt.client.ssh diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py index a4d11eed59a..2e1d1d4efa0 100644 --- a/salt/cloud/__init__.py +++ b/salt/cloud/__init__.py @@ -2,6 +2,7 @@ The top level interface used to translate configuration data back to the correct cloud modules """ + import copy import glob import logging diff --git a/salt/cloud/cli.py b/salt/cloud/cli.py index c633dce3b77..19b26e42287 100644 --- a/salt/cloud/cli.py +++ b/salt/cloud/cli.py @@ -1,6 +1,7 @@ """ Primary interfaces for the salt-cloud system """ + # Need to get data from 4 sources! # CLI options # salt cloud config - CONFIG_DIR + '/cloud' diff --git a/salt/cloud/clouds/aliyun.py b/salt/cloud/clouds/aliyun.py index 572f0cfde96..30a3cf593a8 100644 --- a/salt/cloud/clouds/aliyun.py +++ b/salt/cloud/clouds/aliyun.py @@ -575,7 +575,7 @@ def create_node(kwargs): "HostName", "Password", "SystemDisk.Category", - "VSwitchId" + "VSwitchId", # 'DataDisk.n.Size', 'DataDisk.n.Category', 'DataDisk.n.SnapshotId' ] diff --git a/salt/cloud/clouds/cloudstack.py b/salt/cloud/clouds/cloudstack.py index ef50aaf3bf0..ebf301e4ebf 100644 --- a/salt/cloud/clouds/cloudstack.py +++ b/salt/cloud/clouds/cloudstack.py @@ -20,6 +20,7 @@ Use of this module requires the ``apikey``, ``secretkey``, ``host`` and driver: cloudstack """ + # pylint: disable=function-redefined import logging diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index 571b0c04674..9cba9cd52b3 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -1197,6 +1197,7 @@ def get_imageid(vm_): "Filter.0.Name": "name", "Filter.0.Value.0": image, } + # Query AWS, sort by 'creationDate' and get the last imageId def _t(x): return datetime.datetime.strptime(x["creationDate"], "%Y-%m-%dT%H:%M:%S.%fZ") diff --git a/salt/cloud/clouds/gce.py b/salt/cloud/clouds/gce.py index 4c14f4e74d8..8e2d8618476 100644 --- a/salt/cloud/clouds/gce.py +++ b/salt/cloud/clouds/gce.py @@ -43,6 +43,7 @@ Example Provider Configuration :maintainer: Russell Tolle :depends: libcloud >= 1.0.0 """ + # pylint: disable=function-redefined import logging @@ -1698,7 +1699,6 @@ def delete_disk(kwargs=None, call=None): def create_disk(kwargs=None, call=None): - """ Create a new persistent disk. Must specify `disk_name` and `location`, and optionally can specify 'disk_type' as pd-standard or pd-ssd, which diff --git a/salt/cloud/clouds/hetzner.py b/salt/cloud/clouds/hetzner.py index e666769ee6a..48bf8610c18 100644 --- a/salt/cloud/clouds/hetzner.py +++ b/salt/cloud/clouds/hetzner.py @@ -16,6 +16,7 @@ Use of this module requires the ``key`` parameter to be set. driver: hetzner """ + # pylint: disable=invalid-name,function-redefined diff --git a/salt/cloud/clouds/joyent.py b/salt/cloud/clouds/joyent.py index cd68508f43a..0da4a4a5e64 100644 --- a/salt/cloud/clouds/joyent.py +++ b/salt/cloud/clouds/joyent.py @@ -532,7 +532,6 @@ def take_action( method="GET", location=DEFAULT_LOCATION, ): - """ take action call used by start,stop, reboot :param name: name given to the machine diff --git a/salt/cloud/clouds/libvirt.py b/salt/cloud/clouds/libvirt.py index 76f6f6daa26..59affa6b94b 100644 --- a/salt/cloud/clouds/libvirt.py +++ b/salt/cloud/clouds/libvirt.py @@ -258,7 +258,7 @@ def get_domain_ips(domain, ip_source): log.info("Exception polling address %s", error) return ips - for (name, val) in addresses.items(): + for name, val in addresses.items(): if val["addrs"]: for addr in val["addrs"]: tp = to_ip_addr_type(addr["type"]) diff --git a/salt/cloud/clouds/msazure.py b/salt/cloud/clouds/msazure.py index 8d5b74e701c..fef62f07a70 100644 --- a/salt/cloud/clouds/msazure.py +++ b/salt/cloud/clouds/msazure.py @@ -42,6 +42,7 @@ Example ``/etc/salt/cloud.providers`` or certificate_path: /etc/salt/azure.pem management_host: management.core.windows.net """ + # pylint: disable=function-redefined import copy diff --git a/salt/cloud/clouds/opennebula.py b/salt/cloud/clouds/opennebula.py index 02602ca1e17..71f9372a594 100644 --- a/salt/cloud/clouds/opennebula.py +++ b/salt/cloud/clouds/opennebula.py @@ -76,7 +76,7 @@ from salt.exceptions import ( ) try: - import xmlrpc.client + import xmlrpc.client # nosec from lxml import etree diff --git a/salt/cloud/clouds/saltify.py b/salt/cloud/clouds/saltify.py index 89082ddbef5..451478a5552 100644 --- a/salt/cloud/clouds/saltify.py +++ b/salt/cloud/clouds/saltify.py @@ -358,7 +358,7 @@ def _verify(vm_): log.debug("Testing SMB protocol for %s", vm_["name"]) if __utils__["smb.get_conn"](**kwargs) is False: return False - except (smbSessionError) as exc: + except smbSessionError as exc: log.error("Exception: %s", exc) return False diff --git a/salt/cloud/clouds/vmware.py b/salt/cloud/clouds/vmware.py index 72dcac96c20..f6d8cbcef6c 100644 --- a/salt/cloud/clouds/vmware.py +++ b/salt/cloud/clouds/vmware.py @@ -1454,15 +1454,21 @@ def _format_instance_info_select(vm, selection): if "storage" in selection: storage_full_info = { - "committed": int(vm["summary.storage.committed"]) - if "summary.storage.committed" in vm - else "N/A", - "uncommitted": int(vm["summary.storage.uncommitted"]) - if "summary.storage.uncommitted" in vm - else "N/A", - "unshared": int(vm["summary.storage.unshared"]) - if "summary.storage.unshared" in vm - else "N/A", + "committed": ( + int(vm["summary.storage.committed"]) + if "summary.storage.committed" in vm + else "N/A" + ), + "uncommitted": ( + int(vm["summary.storage.uncommitted"]) + if "summary.storage.uncommitted" in vm + else "N/A" + ), + "unshared": ( + int(vm["summary.storage.unshared"]) + if "summary.storage.unshared" in vm + else "N/A" + ), } vm_select_info["storage"] = storage_full_info @@ -1553,15 +1559,21 @@ def _format_instance_info(vm): ] = device.backing.fileName storage_full_info = { - "committed": int(vm["summary.storage.committed"]) - if "summary.storage.committed" in vm - else "N/A", - "uncommitted": int(vm["summary.storage.uncommitted"]) - if "summary.storage.uncommitted" in vm - else "N/A", - "unshared": int(vm["summary.storage.unshared"]) - if "summary.storage.unshared" in vm - else "N/A", + "committed": ( + int(vm["summary.storage.committed"]) + if "summary.storage.committed" in vm + else "N/A" + ), + "uncommitted": ( + int(vm["summary.storage.uncommitted"]) + if "summary.storage.uncommitted" in vm + else "N/A" + ), + "unshared": ( + int(vm["summary.storage.unshared"]) + if "summary.storage.unshared" in vm + else "N/A" + ), } file_full_info = {} @@ -1593,14 +1605,18 @@ def _format_instance_info(vm): ) vm_full_info = { "id": str(vm["name"]), - "image": "{} (Detected)".format(vm["config.guestFullName"]) - if "config.guestFullName" in vm - else "N/A", + "image": ( + "{} (Detected)".format(vm["config.guestFullName"]) + if "config.guestFullName" in vm + else "N/A" + ), "size": "cpu: {}\nram: {}".format(cpu, ram), "size_dict": {"cpu": cpu, "memory": ram}, - "state": str(vm["summary.runtime.powerState"]) - if "summary.runtime.powerState" in vm - else "N/A", + "state": ( + str(vm["summary.runtime.powerState"]) + if "summary.runtime.powerState" in vm + else "N/A" + ), "private_ips": ip_addresses, "public_ips": [], "devices": device_full_info, @@ -1610,12 +1626,14 @@ def _format_instance_info(vm): "hostname": str(vm["object"].guest.hostName), "mac_addresses": device_mac_addresses, "networks": network_full_info, - "path": str(vm["config.files.vmPathName"]) - if "config.files.vmPathName" in vm - else "N/A", - "tools_status": str(vm["guest.toolsStatus"]) - if "guest.toolsStatus" in vm - else "N/A", + "path": ( + str(vm["config.files.vmPathName"]) + if "config.files.vmPathName" in vm + else "N/A" + ), + "tools_status": ( + str(vm["guest.toolsStatus"]) if "guest.toolsStatus" in vm else "N/A" + ), } return vm_full_info @@ -2004,14 +2022,18 @@ def list_nodes(kwargs=None, call=None): ) vm_info = { "id": vm["name"], - "image": "{} (Detected)".format(vm["config.guestFullName"]) - if "config.guestFullName" in vm - else "N/A", + "image": ( + "{} (Detected)".format(vm["config.guestFullName"]) + if "config.guestFullName" in vm + else "N/A" + ), "size": "cpu: {}\nram: {}".format(cpu, ram), "size_dict": {"cpu": cpu, "memory": ram}, - "state": str(vm["summary.runtime.powerState"]) - if "summary.runtime.powerState" in vm - else "N/A", + "state": ( + str(vm["summary.runtime.powerState"]) + if "summary.runtime.powerState" in vm + else "N/A" + ), "private_ips": [vm["guest.ipAddress"]] if "guest.ipAddress" in vm else [], "public_ips": [], } @@ -2242,15 +2264,21 @@ def avail_images(call=None): if "config.template" in vm and vm["config.template"]: templates[vm["name"]] = { "name": vm["name"], - "guest_fullname": vm["config.guestFullName"] - if "config.guestFullName" in vm - else "N/A", - "cpus": vm["config.hardware.numCPU"] - if "config.hardware.numCPU" in vm - else "N/A", - "ram": vm["config.hardware.memoryMB"] - if "config.hardware.memoryMB" in vm - else "N/A", + "guest_fullname": ( + vm["config.guestFullName"] + if "config.guestFullName" in vm + else "N/A" + ), + "cpus": ( + vm["config.hardware.numCPU"] + if "config.hardware.numCPU" in vm + else "N/A" + ), + "ram": ( + vm["config.hardware.memoryMB"] + if "config.hardware.memoryMB" in vm + else "N/A" + ), } return templates diff --git a/salt/config/__init__.py b/salt/config/__init__.py index 4690c9f61d5..d94a690e8b9 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -1,6 +1,7 @@ """ All salt configuration loading and defaults should be in this module """ + import codecs import glob import logging diff --git a/salt/config/schemas/common.py b/salt/config/schemas/common.py index 9105ed39266..df136d537ea 100644 --- a/salt/config/schemas/common.py +++ b/salt/config/schemas/common.py @@ -8,7 +8,6 @@ Common salt configuration schemas """ - from salt.utils.schema import ArrayItem, OneOfItem, Schema, StringItem diff --git a/salt/config/schemas/esxcluster.py b/salt/config/schemas/esxcluster.py index 2522a4bf4e1..cc3f30da6e5 100644 --- a/salt/config/schemas/esxcluster.py +++ b/salt/config/schemas/esxcluster.py @@ -8,7 +8,6 @@ ESX Cluster configuration schemas """ - from salt.utils.schema import ( AnyOfItem, ArrayItem, diff --git a/salt/config/schemas/esxdatacenter.py b/salt/config/schemas/esxdatacenter.py index 2bb4ec0b29f..edf8b404cd4 100644 --- a/salt/config/schemas/esxdatacenter.py +++ b/salt/config/schemas/esxdatacenter.py @@ -8,7 +8,6 @@ ESX Datacenter configuration schemas """ - from salt.utils.schema import ArrayItem, IntegerItem, Schema, StringItem diff --git a/salt/config/schemas/esxi.py b/salt/config/schemas/esxi.py index 1bb03b44c34..822f382b098 100644 --- a/salt/config/schemas/esxi.py +++ b/salt/config/schemas/esxi.py @@ -8,7 +8,6 @@ ESXi host configuration schemas """ - from salt.utils.schema import ( ArrayItem, BooleanItem, diff --git a/salt/config/schemas/esxvm.py b/salt/config/schemas/esxvm.py index 5842cb0be5c..2dfdbb26ac5 100644 --- a/salt/config/schemas/esxvm.py +++ b/salt/config/schemas/esxvm.py @@ -7,7 +7,6 @@ ESX Virtual Machine configuration schemas """ - from salt.utils.schema import ( AnyOfItem, ArrayItem, diff --git a/salt/config/schemas/minion.py b/salt/config/schemas/minion.py index 9aee9fe4c0f..22fe2fdeb7f 100644 --- a/salt/config/schemas/minion.py +++ b/salt/config/schemas/minion.py @@ -7,7 +7,6 @@ Minion configuration schema """ - from salt.config.schemas.common import IncludeConfig, MinionDefaultInclude from salt.utils.schema import IPv4Item, Schema diff --git a/salt/config/schemas/ssh.py b/salt/config/schemas/ssh.py index 2db9acda5de..2123768935c 100644 --- a/salt/config/schemas/ssh.py +++ b/salt/config/schemas/ssh.py @@ -8,7 +8,6 @@ Salt SSH related configuration schemas """ - from salt.config.schemas.minion import MinionConfiguration from salt.utils.schema import ( AnyOfItem, diff --git a/salt/daemons/masterapi.py b/salt/daemons/masterapi.py index 3716c63d993..020bfb03198 100644 --- a/salt/daemons/masterapi.py +++ b/salt/daemons/masterapi.py @@ -132,7 +132,7 @@ def clean_pub_auth(opts): if not os.path.exists(auth_cache): return else: - for (dirpath, dirnames, filenames) in salt.utils.path.os_walk(auth_cache): + for dirpath, dirnames, filenames in salt.utils.path.os_walk(auth_cache): for auth_file in filenames: auth_file_path = os.path.join(dirpath, auth_file) if not os.path.isfile(auth_file_path): @@ -724,7 +724,7 @@ class RemoteFuncs: if not os.path.isdir(cdir): try: os.makedirs(cdir) - except os.error: + except OSError: pass if os.path.isfile(cpath) and load["loc"] != 0: mode = "ab" diff --git a/salt/engines/__init__.py b/salt/engines/__init__.py index edd4a178225..d7dc6befa90 100644 --- a/salt/engines/__init__.py +++ b/salt/engines/__init__.py @@ -2,6 +2,7 @@ Initialize the engines system. This plugin system allows for complex services to be encapsulated within the salt plugin environment """ + import logging import salt diff --git a/salt/engines/docker_events.py b/salt/engines/docker_events.py index 66b95c46b0b..d5b798484cb 100644 --- a/salt/engines/docker_events.py +++ b/salt/engines/docker_events.py @@ -2,6 +2,7 @@ Send events from Docker events :Depends: Docker API >= 1.22 """ + import logging import traceback diff --git a/salt/engines/slack.py b/salt/engines/slack.py index b6c868c0dbb..93f75f8cd4e 100644 --- a/salt/engines/slack.py +++ b/salt/engines/slack.py @@ -800,9 +800,9 @@ class SlackClient: channel = self.sc.server.channels.find(msg["channel"]) jid = self.run_command_async(msg) log.debug("Submitted a job and got jid: %s", jid) - outstanding[ - jid - ] = msg # record so we can return messages to the caller + outstanding[jid] = ( + msg # record so we can return messages to the caller + ) channel.send_message( "@{}'s job is submitted as salt jid {}".format( msg["user_name"], jid @@ -855,7 +855,6 @@ class SlackClient: del outstanding[jid] def run_command_async(self, msg): - """ :type message_generator: generator of dict :param message_generator: Generates messages from slack that should be run diff --git a/salt/engines/slack_bolt_engine.py b/salt/engines/slack_bolt_engine.py index ca4f1791371..7cd82ff877f 100644 --- a/salt/engines/slack_bolt_engine.py +++ b/salt/engines/slack_bolt_engine.py @@ -913,9 +913,9 @@ class SlackClient: if control and (len(msg) > 1) and msg.get("cmdline"): jid = self.run_command_async(msg) log.debug("Submitted a job and got jid: %s", jid) - outstanding[ - jid - ] = msg # record so we can return messages to the caller + outstanding[jid] = ( + msg # record so we can return messages to the caller + ) text_msg = "@{}'s job is submitted as salt jid {}".format( msg["user_name"], jid ) @@ -969,7 +969,6 @@ class SlackClient: del outstanding[jid] def run_command_async(self, msg): - """ :type msg: dict :param msg: The message dictionary that contains the command and all information. diff --git a/salt/features.py b/salt/features.py index 4335c46ca5a..51761c24fcb 100644 --- a/salt/features.py +++ b/salt/features.py @@ -1,6 +1,7 @@ """ Feature flags """ + import logging log = logging.getLogger(__name__) diff --git a/salt/fileclient.py b/salt/fileclient.py index 5929c1dbdc2..77e107830dd 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -1,6 +1,7 @@ """ Classes that manage file clients """ + import contextlib import errno import ftplib # nosec diff --git a/salt/fileserver/__init__.py b/salt/fileserver/__init__.py index 4eca98d14a4..f6a1c6cdc8b 100644 --- a/salt/fileserver/__init__.py +++ b/salt/fileserver/__init__.py @@ -2,7 +2,6 @@ File server pluggable modules and generic backend functions """ - import errno import fnmatch import logging diff --git a/salt/fileserver/azurefs.py b/salt/fileserver/azurefs.py index cdb1a390d7a..7e92a229cd9 100644 --- a/salt/fileserver/azurefs.py +++ b/salt/fileserver/azurefs.py @@ -45,7 +45,6 @@ permissions. Do not include the leading ? for sas_token if generated from the web """ - import base64 import logging import os diff --git a/salt/fileserver/gitfs.py b/salt/fileserver/gitfs.py index 968e2c9ebfe..3f947d2384c 100644 --- a/salt/fileserver/gitfs.py +++ b/salt/fileserver/gitfs.py @@ -47,7 +47,6 @@ Walkthrough `. .. _GitPython: https://github.com/gitpython-developers/GitPython """ - import logging import salt.utils.gitfs diff --git a/salt/fileserver/hgfs.py b/salt/fileserver/hgfs.py index a7f548ac6a9..c2c9f93ac5c 100644 --- a/salt/fileserver/hgfs.py +++ b/salt/fileserver/hgfs.py @@ -860,7 +860,7 @@ def _file_lists(load, form): if not os.path.isdir(list_cachedir): try: os.makedirs(list_cachedir) - except os.error: + except OSError: log.critical("Unable to make cachedir %s", list_cachedir) return [] list_cache = os.path.join(list_cachedir, "{}.p".format(load["saltenv"])) diff --git a/salt/fileserver/minionfs.py b/salt/fileserver/minionfs.py index 02b1b59eeab..0cc77994fc2 100644 --- a/salt/fileserver/minionfs.py +++ b/salt/fileserver/minionfs.py @@ -150,7 +150,7 @@ def update(): salt.fileserver.reap_fileserver_cache_dir( os.path.join(__opts__["cachedir"], "minionfs/hash"), find_file ) - except os.error: + except OSError: # Hash file won't exist if no files have yet been served up pass @@ -204,7 +204,7 @@ def file_hash(load, fnd): ret["hsum"] = hsum return ret # Can't use Python select() because we need Windows support - except os.error: + except OSError: log.debug("Fileserver encountered lock when reading cache file. Retrying.") file_hash(load, fnd) return ret diff --git a/salt/fileserver/roots.py b/salt/fileserver/roots.py index 4ffdb6df6ff..c79da1a616b 100644 --- a/salt/fileserver/roots.py +++ b/salt/fileserver/roots.py @@ -291,10 +291,7 @@ def file_hash(load, fnd): # check if mtime changed ret["hsum"] = hsum return ret - except ( - os.error, - OSError, - ): # Can't use Python select() because we need Windows support + except OSError: # Can't use Python select() because we need Windows support log.debug("Fileserver encountered lock when reading cache file. Retrying.") # Delete the file since its incomplete (either corrupted or incomplete) try: diff --git a/salt/fileserver/s3fs.py b/salt/fileserver/s3fs.py index f946eb2019b..01f527b1984 100644 --- a/salt/fileserver/s3fs.py +++ b/salt/fileserver/s3fs.py @@ -87,7 +87,6 @@ structure:: s3.s3_sync_on_update: False """ - import datetime import logging import os diff --git a/salt/fileserver/svnfs.py b/salt/fileserver/svnfs.py index 48843f22e67..b8582ff716c 100644 --- a/salt/fileserver/svnfs.py +++ b/salt/fileserver/svnfs.py @@ -30,7 +30,6 @@ This backend assumes a standard svn layout with directories for ``branches``, :conf_master:`documentation ` for more information. """ - import copy import errno import fnmatch @@ -721,7 +720,7 @@ def _file_lists(load, form): if not os.path.isdir(list_cachedir): try: os.makedirs(list_cachedir) - except os.error: + except OSError: log.critical("Unable to make cachedir %s", list_cachedir) return [] list_cache = os.path.join(list_cachedir, "{}.p".format(load["saltenv"])) diff --git a/salt/grains/cimc.py b/salt/grains/cimc.py index 72b89d931bb..30032159294 100644 --- a/salt/grains/cimc.py +++ b/salt/grains/cimc.py @@ -3,7 +3,6 @@ Generate baseline proxy minion grains for cimc hosts. """ - import logging import salt.proxy.cimc diff --git a/salt/grains/core.py b/salt/grains/core.py index 2edbcde420b..8dbcec294a5 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -2389,10 +2389,10 @@ def _legacy_linux_distribution_data(grains, os_release, lsb_has_error): "Please report this, as it is likely a bug." ) else: - grains[ - "osrelease" - ] = "{majorversion}.{minorversion}-{buildnumber}".format( - **synoinfo + grains["osrelease"] = ( + "{majorversion}.{minorversion}-{buildnumber}".format( + **synoinfo + ) ) log.trace( @@ -2880,14 +2880,16 @@ def fqdns(): opt = {"fqdns": []} if __opts__.get( "enable_fqdns_grains", - False - if salt.utils.platform.is_windows() - or salt.utils.platform.is_proxy() - or salt.utils.platform.is_sunos() - or salt.utils.platform.is_aix() - or salt.utils.platform.is_junos() - or salt.utils.platform.is_darwin() - else True, + ( + False + if salt.utils.platform.is_windows() + or salt.utils.platform.is_proxy() + or salt.utils.platform.is_sunos() + or salt.utils.platform.is_aix() + or salt.utils.platform.is_junos() + or salt.utils.platform.is_darwin() + else True + ), ): opt = __salt__["network.fqdns"]() return opt @@ -3318,7 +3320,7 @@ def _hw_data(osdata): # of information. With that said, consolidate the output from various # commands and attempt various lookups. data = "" - for (cmd, args) in ( + for cmd, args in ( ("/usr/sbin/prtdiag", "-v"), ("/usr/sbin/prtconf", "-vp"), ("/usr/sbin/virtinfo", "-a"), diff --git a/salt/grains/esxi.py b/salt/grains/esxi.py index 57041db8283..e9b40e73c22 100644 --- a/salt/grains/esxi.py +++ b/salt/grains/esxi.py @@ -13,7 +13,6 @@ Generate baseline proxy minion grains for ESXi hosts. """ - import logging import salt.utils.proxy diff --git a/salt/grains/junos.py b/salt/grains/junos.py index a24e39dade4..0dfd3344ff2 100644 --- a/salt/grains/junos.py +++ b/salt/grains/junos.py @@ -5,7 +5,6 @@ via salt-proxy-minion. Thus, some grains make sense to get them from the minion (PYTHONPATH), but others don't (ip_interfaces) """ - import logging import salt.utils.platform diff --git a/salt/grains/minion_process.py b/salt/grains/minion_process.py index 54c0b61eb07..9a8dd420f0a 100644 --- a/salt/grains/minion_process.py +++ b/salt/grains/minion_process.py @@ -2,7 +2,6 @@ Set grains describing the minion process. """ - import os import salt.utils.platform diff --git a/salt/grains/napalm.py b/salt/grains/napalm.py index d36eb0273ab..5fca987e132 100644 --- a/salt/grains/napalm.py +++ b/salt/grains/napalm.py @@ -15,7 +15,6 @@ Dependencies .. versionadded:: 2016.11.0 """ - import logging import salt.utils.dns diff --git a/salt/grains/panos.py b/salt/grains/panos.py index 60d0e52b71e..f5ba8d731de 100644 --- a/salt/grains/panos.py +++ b/salt/grains/panos.py @@ -3,7 +3,6 @@ Generate baseline proxy minion grains for panos hosts. """ - import logging import salt.proxy.panos diff --git a/salt/grains/pending_reboot.py b/salt/grains/pending_reboot.py index dddba83fb6f..c83aecaf7ed 100644 --- a/salt/grains/pending_reboot.py +++ b/salt/grains/pending_reboot.py @@ -3,6 +3,7 @@ Grain that indicates the system is pending a reboot See functions in salt.utils.win_system to see what conditions would indicate a reboot is pending """ + import logging import salt.utils.platform diff --git a/salt/loader/context.py b/salt/loader/context.py index 560b05a8d2b..88a6472a8f3 100644 --- a/salt/loader/context.py +++ b/salt/loader/context.py @@ -1,6 +1,7 @@ """ Manage the context a module loaded by Salt's loader """ + import collections.abc import contextlib import copy diff --git a/salt/loader/dunder.py b/salt/loader/dunder.py index f0235d19a29..d3027098b5a 100644 --- a/salt/loader/dunder.py +++ b/salt/loader/dunder.py @@ -1,6 +1,7 @@ """ Salt dunders. """ + import salt.loader.context loader_context = salt.loader.context.LoaderContext() diff --git a/salt/loader/lazy.py b/salt/loader/lazy.py index 5ad3c6c6d0b..f077d245248 100644 --- a/salt/loader/lazy.py +++ b/salt/loader/lazy.py @@ -318,7 +318,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): # A list to determine precedence of extensions # Prefer packages (directories) over modules (single files)! self.suffix_order = [""] - for (suffix, mode, kind) in SUFFIXES: + for suffix, mode, kind in SUFFIXES: self.suffix_map[suffix] = (suffix, mode, kind) self.suffix_order.append(suffix) diff --git a/salt/log_handlers/logstash_mod.py b/salt/log_handlers/logstash_mod.py index 1d69cfc8945..dcc54f5a68e 100644 --- a/salt/log_handlers/logstash_mod.py +++ b/salt/log_handlers/logstash_mod.py @@ -154,7 +154,6 @@ """ - import datetime import logging import logging.handlers diff --git a/salt/master.py b/salt/master.py index 2dbf519d1dd..caea839427c 100644 --- a/salt/master.py +++ b/salt/master.py @@ -2,6 +2,7 @@ This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. """ + import collections import copy import ctypes @@ -321,7 +322,7 @@ class Maintenance(salt.utils.process.SignalHandlingProcess): else: log.error("Found dropfile with incorrect permissions, ignoring...") os.remove(dfn) - except os.error: + except OSError: pass if self.opts.get("publish_session"): @@ -886,7 +887,7 @@ class ReqServer(salt.utils.process.SignalHandlingProcess): # Cannot delete read-only files on Windows. os.chmod(dfn, stat.S_IRUSR | stat.S_IWUSR) os.remove(dfn) - except os.error: + except OSError: pass # Wait for kill should be less then parent's ProcessManager. @@ -1577,7 +1578,7 @@ class AESFuncs(TransportMethods): if not os.path.isdir(cdir): try: os.makedirs(cdir) - except os.error: + except OSError: pass if os.path.isfile(cpath) and load["loc"] != 0: mode = "ab" diff --git a/salt/matchers/confirm_top.py b/salt/matchers/confirm_top.py index 7435f4ae94d..09a11ff428d 100644 --- a/salt/matchers/confirm_top.py +++ b/salt/matchers/confirm_top.py @@ -3,6 +3,7 @@ The matcher subsystem needs a function called "confirm_top", which takes the data passed to a top file environment and determines if that data matches this minion. """ + import logging import salt.loader diff --git a/salt/metaproxy/deltaproxy.py b/salt/metaproxy/deltaproxy.py index aacc4a336a2..82c3c12598c 100644 --- a/salt/metaproxy/deltaproxy.py +++ b/salt/metaproxy/deltaproxy.py @@ -371,10 +371,10 @@ def post_master_init(self, master): self.deltaproxy_objs[minion_id] = sub_proxy_data["proxy_minion"] if self.deltaproxy_opts[minion_id] and self.deltaproxy_objs[minion_id]: - self.deltaproxy_objs[ - minion_id - ].req_channel = salt.channel.client.AsyncReqChannel.factory( - sub_proxy_data["proxy_opts"], io_loop=self.io_loop + self.deltaproxy_objs[minion_id].req_channel = ( + salt.channel.client.AsyncReqChannel.factory( + sub_proxy_data["proxy_opts"], io_loop=self.io_loop + ) ) else: log.debug("Initiating non-parallel startup for proxies") @@ -398,10 +398,10 @@ def post_master_init(self, master): self.deltaproxy_objs[minion_id] = sub_proxy_data["proxy_minion"] if self.deltaproxy_opts[minion_id] and self.deltaproxy_objs[minion_id]: - self.deltaproxy_objs[ - minion_id - ].req_channel = salt.channel.client.AsyncReqChannel.factory( - sub_proxy_data["proxy_opts"], io_loop=self.io_loop + self.deltaproxy_objs[minion_id].req_channel = ( + salt.channel.client.AsyncReqChannel.factory( + sub_proxy_data["proxy_opts"], io_loop=self.io_loop + ) ) if _failed: diff --git a/salt/minion.py b/salt/minion.py index d948acde4ad..61965b70aed 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1,6 +1,7 @@ """ Routines to set up a minion """ + import binascii import contextlib import copy diff --git a/salt/modules/aix_shadow.py b/salt/modules/aix_shadow.py index aa7471cb026..3282603e01f 100644 --- a/salt/modules/aix_shadow.py +++ b/salt/modules/aix_shadow.py @@ -6,7 +6,6 @@ Manage account locks on AIX systems :depends: none """ - # Import python librarie import logging @@ -30,7 +29,6 @@ def __virtual__(): def login_failures(user): - """ Query for all accounts which have 3 or more login failures. diff --git a/salt/modules/aliases.py b/salt/modules/aliases.py index f04b457ac80..01337791ffe 100644 --- a/salt/modules/aliases.py +++ b/salt/modules/aliases.py @@ -74,7 +74,7 @@ def __write_aliases_file(lines): os.chmod(out.name, 0o644) os.chown(out.name, 0, 0) - for (line_alias, line_target, line_comment) in lines: + for line_alias, line_target, line_comment in lines: if isinstance(line_target, list): line_target = ", ".join(line_target) if not line_comment: @@ -173,7 +173,7 @@ def set_target(alias, target): lines = __parse_aliases() out = [] ovr = False - for (line_alias, line_target, line_comment) in lines: + for line_alias, line_target, line_comment in lines: if line_alias == alias: if not ovr: out.append((alias, target, line_comment)) @@ -202,7 +202,7 @@ def rm_alias(alias): lines = __parse_aliases() out = [] - for (line_alias, line_target, line_comment) in lines: + for line_alias, line_target, line_comment in lines: if line_alias != alias: out.append((line_alias, line_target, line_comment)) diff --git a/salt/modules/apache.py b/salt/modules/apache.py index 4b867706d10..d50ff3b17df 100644 --- a/salt/modules/apache.py +++ b/salt/modules/apache.py @@ -8,7 +8,6 @@ Support for Apache Debian-based system is detected. """ - import io import logging import re diff --git a/salt/modules/augeas_cfg.py b/salt/modules/augeas_cfg.py index 70f05b3a465..6fd455235af 100644 --- a/salt/modules/augeas_cfg.py +++ b/salt/modules/augeas_cfg.py @@ -230,9 +230,9 @@ def execute(context=None, lens=None, commands=(), load_path=None): # if command.split fails arg will not be set if "arg" not in locals(): arg = command - ret[ - "error" - ] = "Invalid formatted command, see debug log for details: {}".format(arg) + ret["error"] = ( + "Invalid formatted command, see debug log for details: {}".format(arg) + ) return ret args = salt.utils.data.decode(args, to_str=True) diff --git a/salt/modules/beacons.py b/salt/modules/beacons.py index 3aef0abbec2..0a759fbd7e5 100644 --- a/salt/modules/beacons.py +++ b/salt/modules/beacons.py @@ -5,7 +5,6 @@ Module for managing the Salt beacons on a minion """ - import difflib import logging import os @@ -185,10 +184,10 @@ def add(name, beacon_data, **kwargs): if not valid: ret["result"] = False - ret[ - "comment" - ] = "Beacon {} configuration invalid, not adding.\n{}".format( - name, vcomment + ret["comment"] = ( + "Beacon {} configuration invalid, not adding.\n{}".format( + name, vcomment + ) ) return ret except KeyError: @@ -285,10 +284,10 @@ def modify(name, beacon_data, **kwargs): if not valid: ret["result"] = False - ret[ - "comment" - ] = "Beacon {} configuration invalid, not modifying.\n{}".format( - name, vcomment + ret["comment"] = ( + "Beacon {} configuration invalid, not modifying.\n{}".format( + name, vcomment + ) ) return ret @@ -300,10 +299,10 @@ def modify(name, beacon_data, **kwargs): if not valid: ret["result"] = False - ret[ - "comment" - ] = "Beacon {} configuration invalid, not modifying.\n{}".format( - name, vcomment + ret["comment"] = ( + "Beacon {} configuration invalid, not modifying.\n{}".format( + name, vcomment + ) ) return ret @@ -459,9 +458,9 @@ def save(**kwargs): fp_.write(yaml_out) ret["comment"] = "Beacons saved to {}.".format(sfn) except OSError: - ret[ - "comment" - ] = "Unable to write to beacons file at {}. Check permissions.".format(sfn) + ret["comment"] = ( + "Unable to write to beacons file at {}. Check permissions.".format(sfn) + ) ret["result"] = False return ret @@ -636,9 +635,9 @@ def enable_beacon(name, **kwargs): ret["comment"] = "Enabled beacon {} on minion.".format(name) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to enable beacon {} on minion.".format(name) + ret["comment"] = ( + "Failed to enable beacon {} on minion.".format(name) + ) elif event_ret: ret["result"] = False ret["comment"] = event_ret["comment"] @@ -654,9 +653,9 @@ def enable_beacon(name, **kwargs): except KeyError: # Effectively a no-op, since we can't really return without an event system ret["result"] = False - ret[ - "comment" - ] = "Event module not available. Beacon enable_beacon job failed." + ret["comment"] = ( + "Event module not available. Beacon enable_beacon job failed." + ) return ret @@ -732,9 +731,9 @@ def disable_beacon(name, **kwargs): except KeyError: # Effectively a no-op, since we can't really return without an event system ret["result"] = False - ret[ - "comment" - ] = "Event module not available. Beacon disable_beacon job failed." + ret["comment"] = ( + "Event module not available. Beacon disable_beacon job failed." + ) return ret diff --git a/salt/modules/bluez_bluetooth.py b/salt/modules/bluez_bluetooth.py index ba2ec098e5d..043c404bb73 100644 --- a/salt/modules/bluez_bluetooth.py +++ b/salt/modules/bluez_bluetooth.py @@ -8,6 +8,7 @@ The following packages are required packages for this module: bluez-utils >= 5.7 pybluez >= 0.18 """ + import shlex import salt.utils.validate.net diff --git a/salt/modules/boto3_elasticsearch.py b/salt/modules/boto3_elasticsearch.py index 7462ea74d5d..60238776980 100644 --- a/salt/modules/boto3_elasticsearch.py +++ b/salt/modules/boto3_elasticsearch.py @@ -46,6 +46,7 @@ Connection module for Amazon Elasticsearch Service :codeauthor: Herbert Buurman :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto3_route53.py b/salt/modules/boto3_route53.py index 88a9b1b2cfc..8183de2f5db 100644 --- a/salt/modules/boto3_route53.py +++ b/salt/modules/boto3_route53.py @@ -913,10 +913,12 @@ def _aws_encode_changebatch(o): ) rr_idx += 1 if "AliasTarget" in o["Changes"][change_idx]["ResourceRecordSet"]: - o["Changes"][change_idx]["ResourceRecordSet"]["AliasTarget"][ - "DNSName" - ] = _aws_encode( - o["Changes"][change_idx]["ResourceRecordSet"]["AliasTarget"]["DNSName"] + o["Changes"][change_idx]["ResourceRecordSet"]["AliasTarget"]["DNSName"] = ( + _aws_encode( + o["Changes"][change_idx]["ResourceRecordSet"]["AliasTarget"][ + "DNSName" + ] + ) ) change_idx += 1 return o @@ -1026,13 +1028,17 @@ def get_resource_records( if done: return ret args = {"HostedZoneId": HostedZoneId} - args.update( - {"StartRecordName": _aws_encode(next_rr_name)} - ) if next_rr_name else None + ( + args.update({"StartRecordName": _aws_encode(next_rr_name)}) + if next_rr_name + else None + ) # Grrr, can't specify type unless name is set... We'll do this via filtering later instead - args.update( - {"StartRecordType": next_rr_type} - ) if next_rr_name and next_rr_type else None + ( + args.update({"StartRecordType": next_rr_type}) + if next_rr_name and next_rr_type + else None + ) args.update({"StartRecordIdentifier": next_rr_id}) if next_rr_id else None try: r = conn.list_resource_record_sets(**args) diff --git a/salt/modules/boto3_sns.py b/salt/modules/boto3_sns.py index 46026693b54..825c9b23bb0 100644 --- a/salt/modules/boto3_sns.py +++ b/salt/modules/boto3_sns.py @@ -38,6 +38,7 @@ Connection module for Amazon SNS :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_apigateway.py b/salt/modules/boto_apigateway.py index dad8858edb5..c889f272648 100644 --- a/salt/modules/boto_apigateway.py +++ b/salt/modules/boto_apigateway.py @@ -74,6 +74,7 @@ Connection module for Amazon APIGateway message: error message """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_asg.py b/salt/modules/boto_asg.py index c52c7946791..a3ff1619b78 100644 --- a/salt/modules/boto_asg.py +++ b/salt/modules/boto_asg.py @@ -41,6 +41,7 @@ Connection module for Amazon Autoscale Groups :depends: boto :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_cfn.py b/salt/modules/boto_cfn.py index 4c6b700482a..d02e82bc2b3 100644 --- a/salt/modules/boto_cfn.py +++ b/salt/modules/boto_cfn.py @@ -28,6 +28,7 @@ Connection module for Amazon Cloud Formation :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_cloudfront.py b/salt/modules/boto_cloudfront.py index 7e4db092d06..e9b72633ea4 100644 --- a/salt/modules/boto_cloudfront.py +++ b/salt/modules/boto_cloudfront.py @@ -46,6 +46,7 @@ Connection module for Amazon CloudFront key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_cloudtrail.py b/salt/modules/boto_cloudtrail.py index 25c165bd424..31d69846bee 100644 --- a/salt/modules/boto_cloudtrail.py +++ b/salt/modules/boto_cloudtrail.py @@ -45,6 +45,7 @@ The dependencies listed above can be installed via package or pip. region: us-east-1 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_cloudwatch.py b/salt/modules/boto_cloudwatch.py index f7967d23876..c3a36561f71 100644 --- a/salt/modules/boto_cloudwatch.py +++ b/salt/modules/boto_cloudwatch.py @@ -40,6 +40,7 @@ Connection module for Amazon CloudWatch :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_cloudwatch_event.py b/salt/modules/boto_cloudwatch_event.py index 1e8def652d1..1fd40f018bb 100644 --- a/salt/modules/boto_cloudwatch_event.py +++ b/salt/modules/boto_cloudwatch_event.py @@ -40,6 +40,7 @@ Connection module for Amazon CloudWatch Events :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_cognitoidentity.py b/salt/modules/boto_cognitoidentity.py index 5d8e7d8aa8f..f675c1682b0 100644 --- a/salt/modules/boto_cognitoidentity.py +++ b/salt/modules/boto_cognitoidentity.py @@ -72,6 +72,7 @@ Connection module for Amazon CognitoIdentity :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 @@ -147,7 +148,6 @@ def describe_identity_pools( keyid=None, profile=None, ): - """ Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) @@ -447,9 +447,9 @@ def update_identity_pool( if AllowUnauthenticatedIdentities != request_params.get( "AllowUnauthenticatedIdentities" ): - request_params[ - "AllowUnauthenticatedIdentities" - ] = AllowUnauthenticatedIdentities + request_params["AllowUnauthenticatedIdentities"] = ( + AllowUnauthenticatedIdentities + ) current_val = request_params.pop("SupportedLoginProviders", None) if SupportedLoginProviders is not None and SupportedLoginProviders != current_val: diff --git a/salt/modules/boto_datapipeline.py b/salt/modules/boto_datapipeline.py index 52d5872d360..bdbcebaa16a 100644 --- a/salt/modules/boto_datapipeline.py +++ b/salt/modules/boto_datapipeline.py @@ -6,7 +6,6 @@ Connection module for Amazon Data Pipeline :depends: boto3 """ - import logging import salt.utils.versions diff --git a/salt/modules/boto_dynamodb.py b/salt/modules/boto_dynamodb.py index 29e2757f63b..10201cb48e0 100644 --- a/salt/modules/boto_dynamodb.py +++ b/salt/modules/boto_dynamodb.py @@ -40,6 +40,7 @@ Connection module for Amazon DynamoDB :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_ec2.py b/salt/modules/boto_ec2.py index be4edce11dc..7ece2dbe6d3 100644 --- a/salt/modules/boto_ec2.py +++ b/salt/modules/boto_ec2.py @@ -39,6 +39,7 @@ as a passed in dict, or as a string to pull from pillars or minion config: :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 @@ -658,7 +659,6 @@ def find_instances( in_states=None, filters=None, ): - """ Given instance properties, find and return matching instance ids @@ -785,7 +785,6 @@ def find_images( profile=None, return_objs=False, ): - """ Given image properties, find and return matching AMI ids @@ -885,7 +884,6 @@ def get_id( in_states=None, filters=None, ): - """ Given instance properties, return the instance id if it exists. @@ -2295,10 +2293,10 @@ def set_volumes_tags( profile=profile, ): ret["success"] = False - ret[ - "comment" - ] = "Failed to remove tags on vol.id {}: {}".format( - vol.id, remove + ret["comment"] = ( + "Failed to remove tags on vol.id {}: {}".format( + vol.id, remove + ) ) return ret if changes["old"] or changes["new"]: diff --git a/salt/modules/boto_efs.py b/salt/modules/boto_efs.py index 70f226bf67c..800aa7977f6 100644 --- a/salt/modules/boto_efs.py +++ b/salt/modules/boto_efs.py @@ -47,7 +47,6 @@ Connection module for Amazon EFS :depends: boto3 """ - import logging import salt.utils.versions diff --git a/salt/modules/boto_elasticache.py b/salt/modules/boto_elasticache.py index 43f183b0f39..656182822bf 100644 --- a/salt/modules/boto_elasticache.py +++ b/salt/modules/boto_elasticache.py @@ -40,6 +40,7 @@ Connection module for Amazon Elasticache :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_elasticsearch_domain.py b/salt/modules/boto_elasticsearch_domain.py index 050ef2f011b..5440435dc2d 100644 --- a/salt/modules/boto_elasticsearch_domain.py +++ b/salt/modules/boto_elasticsearch_domain.py @@ -70,6 +70,7 @@ Connection module for Amazon Elasticsearch Service :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_elb.py b/salt/modules/boto_elb.py index 310b91134bf..a1aa8b16694 100644 --- a/salt/modules/boto_elb.py +++ b/salt/modules/boto_elb.py @@ -40,6 +40,7 @@ Connection module for Amazon ELB :depends: boto >= 2.33.0 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_elbv2.py b/salt/modules/boto_elbv2.py index d91927caa67..7754ef1ef86 100644 --- a/salt/modules/boto_elbv2.py +++ b/salt/modules/boto_elbv2.py @@ -36,6 +36,7 @@ Connection module for Amazon ALB :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_iam.py b/salt/modules/boto_iam.py index 521b1ff7140..fc13002d5ab 100644 --- a/salt/modules/boto_iam.py +++ b/salt/modules/boto_iam.py @@ -33,6 +33,7 @@ Connection module for Amazon IAM :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_iot.py b/salt/modules/boto_iot.py index 1243a1700f9..b7b798487cb 100644 --- a/salt/modules/boto_iot.py +++ b/salt/modules/boto_iot.py @@ -45,6 +45,7 @@ The dependencies listed above can be installed via package or pip. region: us-east-1 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_kinesis.py b/salt/modules/boto_kinesis.py index 846defa5d6a..0c9e7b4b5eb 100644 --- a/salt/modules/boto_kinesis.py +++ b/salt/modules/boto_kinesis.py @@ -41,6 +41,7 @@ Connection module for Amazon Kinesis :depends: boto3 """ + # keep lint from choking on _get_conn # pylint: disable=E0602 diff --git a/salt/modules/boto_kms.py b/salt/modules/boto_kms.py index ac106655d5b..70a172d51c7 100644 --- a/salt/modules/boto_kms.py +++ b/salt/modules/boto_kms.py @@ -32,6 +32,7 @@ Connection module for Amazon KMS :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_lambda.py b/salt/modules/boto_lambda.py index 5dcd82a3634..5a23660042e 100644 --- a/salt/modules/boto_lambda.py +++ b/salt/modules/boto_lambda.py @@ -74,6 +74,7 @@ as a passed in dict, or as a string to pull from pillars or minion config: message: error message """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_rds.py b/salt/modules/boto_rds.py index 129c80bc6fe..a241935a5e7 100644 --- a/salt/modules/boto_rds.py +++ b/salt/modules/boto_rds.py @@ -40,6 +40,7 @@ Connection module for Amazon RDS :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 # pylint whinging perfectly valid code diff --git a/salt/modules/boto_route53.py b/salt/modules/boto_route53.py index 500e6f2cb78..ddacf0926b6 100644 --- a/salt/modules/boto_route53.py +++ b/salt/modules/boto_route53.py @@ -41,6 +41,7 @@ Connection module for Amazon Route53 :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_s3.py b/salt/modules/boto_s3.py index bef68657e9b..54939033667 100644 --- a/salt/modules/boto_s3.py +++ b/salt/modules/boto_s3.py @@ -46,6 +46,7 @@ Connection module for Amazon S3 using boto3 :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_s3_bucket.py b/salt/modules/boto_s3_bucket.py index 9fc2417cbfc..a696bd5d2ee 100644 --- a/salt/modules/boto_s3_bucket.py +++ b/salt/modules/boto_s3_bucket.py @@ -45,6 +45,7 @@ The dependencies listed above can be installed via package or pip. region: us-east-1 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 # disable complaints about perfectly valid non-assignment code diff --git a/salt/modules/boto_secgroup.py b/salt/modules/boto_secgroup.py index 97941147933..2f0feb03814 100644 --- a/salt/modules/boto_secgroup.py +++ b/salt/modules/boto_secgroup.py @@ -40,6 +40,7 @@ Connection module for Amazon Security Groups :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_sns.py b/salt/modules/boto_sns.py index 7df58b95e5a..dc160896e7f 100644 --- a/salt/modules/boto_sns.py +++ b/salt/modules/boto_sns.py @@ -38,6 +38,7 @@ Connection module for Amazon SNS :depends: boto """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_sqs.py b/salt/modules/boto_sqs.py index c2a572ab248..cb9033d4ce4 100644 --- a/salt/modules/boto_sqs.py +++ b/salt/modules/boto_sqs.py @@ -40,6 +40,7 @@ Connection module for Amazon SQS :depends: boto3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/boto_ssm.py b/salt/modules/boto_ssm.py index f2908a46edc..475279a9153 100644 --- a/salt/modules/boto_ssm.py +++ b/salt/modules/boto_ssm.py @@ -12,6 +12,7 @@ Connection module for Amazon SSM :depends: boto3 """ + import logging import salt.utils.json as json diff --git a/salt/modules/boto_vpc.py b/salt/modules/boto_vpc.py index ee7a757e2b2..9b06a7b3db7 100644 --- a/salt/modules/boto_vpc.py +++ b/salt/modules/boto_vpc.py @@ -120,6 +120,7 @@ Deleting VPC peering connection via this module salt myminion boto_vpc.delete_vpc_peering_connection conn_id=pcx-8a8939e3 """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 @@ -579,7 +580,6 @@ def _find_vpcs( keyid=None, profile=None, ): - """ Given VPC properties, find and return matching VPC ids. """ @@ -1419,9 +1419,9 @@ def describe_subnets( subnet["id"], subnet["vpc_id"], conn=conn ) if explicit_route_table_assoc: - subnet[ - "explicit_route_table_association_id" - ] = explicit_route_table_assoc + subnet["explicit_route_table_association_id"] = ( + explicit_route_table_assoc + ) subnets_list.append(subnet) return {"subnets": subnets_list} diff --git a/salt/modules/bsd_shadow.py b/salt/modules/bsd_shadow.py index c9717d8c036..d3700df5d73 100644 --- a/salt/modules/bsd_shadow.py +++ b/salt/modules/bsd_shadow.py @@ -8,7 +8,6 @@ Manage the password database on BSD systems `. """ - import salt.utils.files import salt.utils.stringutils from salt.exceptions import CommandExecutionError, SaltInvocationError diff --git a/salt/modules/btrfs.py b/salt/modules/btrfs.py index 6adf421009b..ba09acffa1c 100644 --- a/salt/modules/btrfs.py +++ b/salt/modules/btrfs.py @@ -159,9 +159,9 @@ def defragment(path): and not d_res["passed"] and "range ioctl not supported" in d_res["log"] ): - d_res[ - "log" - ] = "Range ioctl defragmentation is not supported in this kernel." + d_res["log"] = ( + "Range ioctl defragmentation is not supported in this kernel." + ) if not is_mountpoint: d_res["mount_point"] = False diff --git a/salt/modules/chef.py b/salt/modules/chef.py index 698db0db560..57946400eb4 100644 --- a/salt/modules/chef.py +++ b/salt/modules/chef.py @@ -2,7 +2,6 @@ Execute chef in server or solo mode """ - import logging import os import tempfile diff --git a/salt/modules/cimc.py b/salt/modules/cimc.py index e555538a901..132b513c2aa 100644 --- a/salt/modules/cimc.py +++ b/salt/modules/cimc.py @@ -24,7 +24,6 @@ rest API. """ - import logging import salt.proxy.cimc diff --git a/salt/modules/cloud.py b/salt/modules/cloud.py index b4f52ae3b73..dd1ededf158 100644 --- a/salt/modules/cloud.py +++ b/salt/modules/cloud.py @@ -2,7 +2,6 @@ Salt-specific interface for calling Salt Cloud directly """ - import copy import logging import os diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py index 4822971d552..051143eb856 100644 --- a/salt/modules/cmdmod.py +++ b/salt/modules/cmdmod.py @@ -431,9 +431,11 @@ def _run( "as user '{}' ".format(runas) if runas else "", "in group '{}' ".format(group) if group else "", cwd, - ". Executing command in the background, no output will be logged." - if bg - else "", + ( + ". Executing command in the background, no output will be logged." + if bg + else "" + ), ) log.info(log_callback(msg)) @@ -999,7 +1001,6 @@ def _run_all_quiet( success_stderr=None, ignore_retcode=None, ): - """ Helper for running commands quietly for minion startup. Returns a dict of return data. diff --git a/salt/modules/consul.py b/salt/modules/consul.py index dfcf84c0ab8..01f161e5fe2 100644 --- a/salt/modules/consul.py +++ b/salt/modules/consul.py @@ -296,9 +296,9 @@ def put(consul_url=None, token=None, key=None, value=None, **kwargs): return ret query_params["cas"] = kwargs["cas"] else: - ret[ - "message" - ] = "Key {} does not exists, CAS argument can not be used.".format(key) + ret["message"] = ( + "Key {} does not exists, CAS argument can not be used.".format(key) + ) ret["res"] = False return ret @@ -1543,9 +1543,9 @@ def catalog_register(consul_url=None, token=None, **kwargs): "warning", "critical", ): - ret[ - "message" - ] = "Check status must be unknown, passing, warning, or critical." + ret["message"] = ( + "Check status must be unknown, passing, warning, or critical." + ) ret["res"] = False return ret data["Check"]["Status"] = kwargs["check_status"] diff --git a/salt/modules/container_resource.py b/salt/modules/container_resource.py index 0a44ce3e518..5474d43a54c 100644 --- a/salt/modules/container_resource.py +++ b/salt/modules/container_resource.py @@ -8,6 +8,7 @@ These functions are not designed to be called directly, but instead from the :mod:`docker ` execution modules. They provide for common logic to be re-used for common actions. """ + import copy import functools import logging diff --git a/salt/modules/deb_postgres.py b/salt/modules/deb_postgres.py index d92859562d4..e43f87f0fbd 100644 --- a/salt/modules/deb_postgres.py +++ b/salt/modules/deb_postgres.py @@ -2,6 +2,7 @@ Module to provide Postgres compatibility to salt for debian family specific tools. """ + import logging import shlex diff --git a/salt/modules/debian_ip.py b/salt/modules/debian_ip.py index 4a7062c48fc..8c901488d10 100644 --- a/salt/modules/debian_ip.py +++ b/salt/modules/debian_ip.py @@ -5,6 +5,7 @@ References: * http://www.debian.org/doc/manuals/debian-reference/ch05.en.html """ + import functools import io import logging @@ -908,7 +909,6 @@ def _parse_settings_bond_0(opts, iface, bond_def): def _parse_settings_bond_1(opts, iface, bond_def): - """ Filters given options and outputs valid settings for bond1. If an option has a value that is not expected, this @@ -995,7 +995,6 @@ def _parse_settings_bond_2(opts, iface, bond_def): def _parse_settings_bond_3(opts, iface, bond_def): - """ Filters given options and outputs valid settings for bond3. If an option has a value that is not expected, this @@ -1082,7 +1081,6 @@ def _parse_settings_bond_4(opts, iface, bond_def): def _parse_settings_bond_5(opts, iface, bond_def): - """ Filters given options and outputs valid settings for bond5. If an option has a value that is not expected, this @@ -1121,7 +1119,6 @@ def _parse_settings_bond_5(opts, iface, bond_def): def _parse_settings_bond_6(opts, iface, bond_def): - """ Filters given options and outputs valid settings for bond6. If an option has a value that is not expected, this @@ -1295,9 +1292,9 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): tmp_ethtool = _parse_ethtool_pppoe_opts(opts, iface) if tmp_ethtool: for item in tmp_ethtool: - adapters[iface]["data"][addrfam][ - _DEB_CONFIG_PPPOE_OPTS[item] - ] = tmp_ethtool[item] + adapters[iface]["data"][addrfam][_DEB_CONFIG_PPPOE_OPTS[item]] = ( + tmp_ethtool[item] + ) iface_data[addrfam]["addrfam"] = addrfam opts.pop("mode", None) @@ -1350,7 +1347,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): iface_data["inet6"][opt] = opts[opt] # Remove incomplete/disabled inet blocks - for (addrfam, opt) in [("inet", "enable_ipv4"), ("inet6", "enable_ipv6")]: + for addrfam, opt in [("inet", "enable_ipv4"), ("inet6", "enable_ipv6")]: if opts.get(opt, None) is False: iface_data.pop(addrfam) elif iface_data[addrfam].get("addrfam", "") != addrfam: diff --git a/salt/modules/debuild_pkgbuild.py b/salt/modules/debuild_pkgbuild.py index b63f0b3f183..21c2629332b 100644 --- a/salt/modules/debuild_pkgbuild.py +++ b/salt/modules/debuild_pkgbuild.py @@ -9,7 +9,6 @@ environments. This also provides a function to generate debian repositories This module implements the pkgbuild interface """ - import errno import logging import os diff --git a/salt/modules/defaults.py b/salt/modules/defaults.py index c807337dc2c..48ce0b11819 100644 --- a/salt/modules/defaults.py +++ b/salt/modules/defaults.py @@ -3,7 +3,6 @@ Module to work with salt formula defaults files """ - import copy import logging import os diff --git a/salt/modules/djangomod.py b/salt/modules/djangomod.py index 17942130e80..9047667e589 100644 --- a/salt/modules/djangomod.py +++ b/salt/modules/djangomod.py @@ -2,7 +2,6 @@ Manage Django sites """ - import os import salt.exceptions diff --git a/salt/modules/dnsmasq.py b/salt/modules/dnsmasq.py index e3f1d8bfa80..af9c8b8ccba 100644 --- a/salt/modules/dnsmasq.py +++ b/salt/modules/dnsmasq.py @@ -2,7 +2,6 @@ Module for managing dnsmasq """ - import logging import os diff --git a/salt/modules/dockercompose.py b/salt/modules/dockercompose.py index a785b983c62..7ebdf2207e9 100644 --- a/salt/modules/dockercompose.py +++ b/salt/modules/dockercompose.py @@ -103,7 +103,6 @@ Detailed Function Documentation ------------------------------- """ - import inspect import logging import os diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py index 49036f0f756..de88620159c 100644 --- a/salt/modules/dockermod.py +++ b/salt/modules/dockermod.py @@ -4491,9 +4491,9 @@ def load(path, repository=None, tag=None): result = tag_(top_level_images[0], repository=repository, tag=tag) ret["Image"] = tagged_image except IndexError: - ret[ - "Warning" - ] = "No top-level image layers were loaded, no image was tagged" + ret["Warning"] = ( + "No top-level image layers were loaded, no image was tagged" + ) except Exception as exc: # pylint: disable=broad-except ret["Warning"] = "Failed to tag {} as {}: {}".format( top_level_images[0], tagged_image, exc diff --git a/salt/modules/drac.py b/salt/modules/drac.py index 86ff8eedd5a..d752199fb7b 100644 --- a/salt/modules/drac.py +++ b/salt/modules/drac.py @@ -2,7 +2,6 @@ Manage Dell DRAC """ - import logging import salt.utils.path diff --git a/salt/modules/dracr.py b/salt/modules/dracr.py index c790f5423b2..bb3192c370f 100644 --- a/salt/modules/dracr.py +++ b/salt/modules/dracr.py @@ -4,7 +4,6 @@ Manage Dell DRAC. .. versionadded:: 2015.8.2 """ - import logging import os import re diff --git a/salt/modules/elasticsearch.py b/salt/modules/elasticsearch.py index 4db9b370abc..e8a468103fe 100644 --- a/salt/modules/elasticsearch.py +++ b/salt/modules/elasticsearch.py @@ -48,7 +48,6 @@ Module to provide Elasticsearch compatibility to Salt Some functionality might be limited by elasticsearch-py and Elasticsearch server versions. """ - import logging from salt.exceptions import CommandExecutionError, SaltInvocationError diff --git a/salt/modules/eselect.py b/salt/modules/eselect.py index 9a0c1cf6756..86c4d246a46 100644 --- a/salt/modules/eselect.py +++ b/salt/modules/eselect.py @@ -2,7 +2,6 @@ Support for eselect, Gentoo's configuration and management tool. """ - import logging import salt.utils.path diff --git a/salt/modules/esxi.py b/salt/modules/esxi.py index c436da91288..23499b7657c 100644 --- a/salt/modules/esxi.py +++ b/salt/modules/esxi.py @@ -34,7 +34,6 @@ type manor. """ - import logging from functools import wraps diff --git a/salt/modules/esxvm.py b/salt/modules/esxvm.py index bf910aee44c..3fac436e898 100644 --- a/salt/modules/esxvm.py +++ b/salt/modules/esxvm.py @@ -13,7 +13,6 @@ Module used to access the esx proxy connection methods """ - import logging from functools import wraps diff --git a/salt/modules/event.py b/salt/modules/event.py index bf6d4bde0d7..7bb64a8119a 100644 --- a/salt/modules/event.py +++ b/salt/modules/event.py @@ -3,7 +3,6 @@ Use the :ref:`Salt Event System ` to fire events from the master to the minion and vice-versa. """ - import logging import os import sys diff --git a/salt/modules/extfs.py b/salt/modules/extfs.py index 63d2cfeb1e1..370e3066b46 100644 --- a/salt/modules/extfs.py +++ b/salt/modules/extfs.py @@ -2,7 +2,6 @@ Module for managing ext2/3/4 file systems """ - import logging import salt.utils.platform diff --git a/salt/modules/file.py b/salt/modules/file.py index d65d3e9a15f..68576d04391 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -4924,9 +4924,11 @@ def extract_hash( if basename_searches: log.debug( "file.extract_hash: %s %s hash for file matching%s: %s", - "If no source_hash_name match found, will extract" - if source_hash_name - else "Extracting", + ( + "If no source_hash_name match found, will extract" + if source_hash_name + else "Extracting" + ), "any supported" if not hash_type else hash_type, "" if len(basename_searches) == 1 else " either of the following", ", ".join(basename_searches), diff --git a/salt/modules/firewalld.py b/salt/modules/firewalld.py index 135713d8516..2c5f35ea18b 100644 --- a/salt/modules/firewalld.py +++ b/salt/modules/firewalld.py @@ -4,7 +4,6 @@ Support for firewalld. .. versionadded:: 2015.2.0 """ - import logging import re diff --git a/salt/modules/freebsd_sysctl.py b/salt/modules/freebsd_sysctl.py index 3d6dd930ec5..6f809176f49 100644 --- a/salt/modules/freebsd_sysctl.py +++ b/salt/modules/freebsd_sysctl.py @@ -2,7 +2,6 @@ Module for viewing and modifying sysctl parameters """ - import logging import os diff --git a/salt/modules/freebsd_update.py b/salt/modules/freebsd_update.py index 26a6acd932f..816c2b13e96 100644 --- a/salt/modules/freebsd_update.py +++ b/salt/modules/freebsd_update.py @@ -8,7 +8,6 @@ Support for freebsd-update utility on FreeBSD. :platform: FreeBSD """ - import logging import salt.utils.path diff --git a/salt/modules/freebsdjail.py b/salt/modules/freebsdjail.py index 1c2343195c7..f86bdab07fd 100644 --- a/salt/modules/freebsdjail.py +++ b/salt/modules/freebsdjail.py @@ -2,7 +2,6 @@ The jail module for FreeBSD """ - import os import re import subprocess diff --git a/salt/modules/gentoo_service.py b/salt/modules/gentoo_service.py index 5a35ba0fcbd..ede473e6779 100644 --- a/salt/modules/gentoo_service.py +++ b/salt/modules/gentoo_service.py @@ -9,7 +9,6 @@ to the correct service manager `. """ - import fnmatch import logging import re diff --git a/salt/modules/github.py b/salt/modules/github.py index bc45f9cae96..d1c3d0e16b0 100644 --- a/salt/modules/github.py +++ b/salt/modules/github.py @@ -29,7 +29,6 @@ For example: allow_repo_privacy_changes: False """ - import logging import salt.utils.http diff --git a/salt/modules/glanceng.py b/salt/modules/glanceng.py index 7f1b824b0f6..85a76dc650a 100644 --- a/salt/modules/glanceng.py +++ b/salt/modules/glanceng.py @@ -25,7 +25,6 @@ Example configuration identity_api_version: 3 """ - HAS_SHADE = False try: import shade diff --git a/salt/modules/gnomedesktop.py b/salt/modules/gnomedesktop.py index abefaeb8586..2ae41dd1155 100644 --- a/salt/modules/gnomedesktop.py +++ b/salt/modules/gnomedesktop.py @@ -2,7 +2,6 @@ GNOME implementations """ - import logging import re diff --git a/salt/modules/gpg.py b/salt/modules/gpg.py index b713a0ae9fd..14949e993c4 100644 --- a/salt/modules/gpg.py +++ b/salt/modules/gpg.py @@ -576,9 +576,9 @@ def delete_key( if skey: if not delete_secret: ret["res"] = False - ret[ - "message" - ] = "Secret key exists, delete first or pass delete_secret=True." + ret["message"] = ( + "Secret key exists, delete first or pass delete_secret=True." + ) return ret else: if str(__delete_key(fingerprint, True, use_passphrase)) == "ok": diff --git a/salt/modules/grains.py b/salt/modules/grains.py index a7040e00b32..d803a209549 100644 --- a/salt/modules/grains.py +++ b/salt/modules/grains.py @@ -9,7 +9,6 @@ file on the minions. By default, this file is located at: ``/etc/salt/grains`` This does **NOT** override any grains set in the minion config file. """ - import collections import logging import math @@ -39,6 +38,7 @@ __outputter__ = { "setval": "nested", } + # http://stackoverflow.com/a/12414913/127816 def _infinitedict(): return collections.defaultdict(_infinitedict) diff --git a/salt/modules/haproxyconn.py b/salt/modules/haproxyconn.py index f9e156572bc..a7b0e31b89b 100644 --- a/salt/modules/haproxyconn.py +++ b/salt/modules/haproxyconn.py @@ -4,7 +4,6 @@ Support for haproxy .. versionadded:: 2014.7.0 """ - import logging import os import stat @@ -315,6 +314,7 @@ def set_state(name, backend, state, socket=DEFAULT_SOCKET_URL): salt '*' haproxy.set_state my_proxy_server my_backend ready """ + # Pulling this in from the latest 0.5 release which is not yet in PyPi. # https://github.com/neurogeek/haproxyctl class setServerState(haproxy.cmds.Cmd): diff --git a/salt/modules/hashutil.py b/salt/modules/hashutil.py index 926d385aa4f..cdddadc8d45 100644 --- a/salt/modules/hashutil.py +++ b/salt/modules/hashutil.py @@ -2,7 +2,6 @@ A collection of hashing and encoding functions """ - import base64 import hashlib import hmac diff --git a/salt/modules/helm.py b/salt/modules/helm.py index 19790726716..960c90e87bf 100644 --- a/salt/modules/helm.py +++ b/salt/modules/helm.py @@ -32,7 +32,6 @@ Detailed Function Documentation ------------------------------- """ - import copy import logging import re @@ -1044,7 +1043,7 @@ def repo_manage( ) already_present = False - for (index, repo_present) in enumerate(repos_present): + for index, repo_present in enumerate(repos_present): if repo.get("name") == repo_present.get("name") and repo.get( "url" ) == repo_present.get("url"): diff --git a/salt/modules/hg.py b/salt/modules/hg.py index 2835a531494..855fe2f2cfa 100644 --- a/salt/modules/hg.py +++ b/salt/modules/hg.py @@ -2,7 +2,6 @@ Support for the Mercurial SCM """ - import logging import salt.utils.data diff --git a/salt/modules/hosts.py b/salt/modules/hosts.py index a8c4d412c2a..83f60ab2050 100644 --- a/salt/modules/hosts.py +++ b/salt/modules/hosts.py @@ -2,7 +2,6 @@ Manage the information in the hosts file """ - import errno import logging import os diff --git a/salt/modules/http.py b/salt/modules/http.py index 44464eaa11b..6252b21dc16 100644 --- a/salt/modules/http.py +++ b/salt/modules/http.py @@ -5,7 +5,6 @@ like, but also useful for basic http testing. .. versionadded:: 2015.5.0 """ - import time import salt.utils.http diff --git a/salt/modules/icinga2.py b/salt/modules/icinga2.py index ef222ced217..e3e758d2259 100644 --- a/salt/modules/icinga2.py +++ b/salt/modules/icinga2.py @@ -6,7 +6,6 @@ Module to provide icinga2 compatibility to salt. :depends: - icinga2 server """ - import logging import salt.utils.path diff --git a/salt/modules/ifttt.py b/salt/modules/ifttt.py index 3c49b25a111..248e059b87a 100644 --- a/salt/modules/ifttt.py +++ b/salt/modules/ifttt.py @@ -11,7 +11,6 @@ Requires an ``api_key`` in ``/etc/salt/minion``: secret_key: '280d4699-a817-4719-ba6f-ca56e573e44f' """ - import logging import time diff --git a/salt/modules/influxdb08mod.py b/salt/modules/influxdb08mod.py index 8a46c7d4ef6..b48d08e0792 100644 --- a/salt/modules/influxdb08mod.py +++ b/salt/modules/influxdb08mod.py @@ -21,7 +21,6 @@ version 0.5-0.8) overwrite options passed into pillar. """ - import logging try: diff --git a/salt/modules/influxdbmod.py b/salt/modules/influxdbmod.py index 303ab044706..4793e54c8be 100644 --- a/salt/modules/influxdbmod.py +++ b/salt/modules/influxdbmod.py @@ -635,7 +635,8 @@ def create_continuous_query( .. code-block:: bash - salt '*' influxdb.create_continuous_query mydb cq_month 'SELECT mean(*) INTO mydb.a_month.:MEASUREMENT FROM mydb.a_week./.*/ GROUP BY time(5m), *'""" + salt '*' influxdb.create_continuous_query mydb cq_month 'SELECT mean(*) INTO mydb.a_month.:MEASUREMENT FROM mydb.a_week./.*/ GROUP BY time(5m), *' + """ client = _client(**client_args) full_query = "CREATE CONTINUOUS QUERY {name} ON {database}" if resample_time: @@ -683,7 +684,7 @@ def _pull_query_results(resultset): Parses a ResultSet returned from InfluxDB into a dictionary of results, grouped by series names and optional JSON-encoded grouping tags. """ - _results = collections.defaultdict(lambda: {}) + _results = collections.defaultdict(dict) for _header, _values in resultset.items(): _header, _group_tags = _header if _group_tags: diff --git a/salt/modules/ipmi.py b/salt/modules/ipmi.py index a30a8fb5a14..3e5cf05723f 100644 --- a/salt/modules/ipmi.py +++ b/salt/modules/ipmi.py @@ -30,7 +30,6 @@ systems hardware through IPMI drivers. It uses a python module `pyghmi`. uid=1 """ - IMPORT_ERR = None try: from pyghmi.ipmi import command # nosec diff --git a/salt/modules/ipset.py b/salt/modules/ipset.py index 25717e7676a..35401c11529 100644 --- a/salt/modules/ipset.py +++ b/salt/modules/ipset.py @@ -2,7 +2,6 @@ Support for ipset """ - import logging import salt.utils.path diff --git a/salt/modules/jboss7.py b/salt/modules/jboss7.py index f43a66fb1f4..e68621ced11 100644 --- a/salt/modules/jboss7.py +++ b/salt/modules/jboss7.py @@ -21,7 +21,6 @@ Example: """ - import logging import re diff --git a/salt/modules/jboss7_cli.py b/salt/modules/jboss7_cli.py index 683b61662e8..183d32998f2 100644 --- a/salt/modules/jboss7_cli.py +++ b/salt/modules/jboss7_cli.py @@ -35,7 +35,6 @@ Example: """ - import logging import pprint import re diff --git a/salt/modules/jenkinsmod.py b/salt/modules/jenkinsmod.py index d87c13c3049..46308a2062f 100644 --- a/salt/modules/jenkinsmod.py +++ b/salt/modules/jenkinsmod.py @@ -22,7 +22,6 @@ Module for controlling Jenkins api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15 """ - import logging import salt.utils.files diff --git a/salt/modules/junos.py b/salt/modules/junos.py index 2f1f0c6ab4f..e2afa164f78 100644 --- a/salt/modules/junos.py +++ b/salt/modules/junos.py @@ -479,10 +479,10 @@ def set_hostname(hostname=None, **kwargs): ret["out"] = True except Exception as exception: # pylint: disable=broad-except ret["out"] = False - ret[ - "message" - ] = 'Successfully loaded host-name but commit failed with "{}"'.format( - exception + ret["message"] = ( + 'Successfully loaded host-name but commit failed with "{}"'.format( + exception + ) ) _restart_connection() return ret @@ -493,10 +493,10 @@ def set_hostname(hostname=None, **kwargs): conn.cu.rollback() except Exception as exception: # pylint: disable=broad-except ret["out"] = False - ret[ - "message" - ] = 'Successfully loaded host-name but rollback before exit failed "{}"'.format( - exception + ret["message"] = ( + 'Successfully loaded host-name but rollback before exit failed "{}"'.format( + exception + ) ) _restart_connection() @@ -579,10 +579,10 @@ def commit(**kwargs): ret["out"] = False except Exception as exception: # pylint: disable=broad-except ret["out"] = False - ret[ - "message" - ] = 'Commit check succeeded but actual commit failed with "{}"'.format( - exception + ret["message"] = ( + 'Commit check succeeded but actual commit failed with "{}"'.format( + exception + ) ) _restart_connection() else: @@ -592,10 +592,10 @@ def commit(**kwargs): conn.cu.rollback() except Exception as exception: # pylint: disable=broad-except ret["out"] = False - ret[ - "message" - ] = 'Pre-commit check failed, and exception during rollback "{}"'.format( - exception + ret["message"] = ( + 'Pre-commit check failed, and exception during rollback "{}"'.format( + exception + ) ) _restart_connection() @@ -708,10 +708,10 @@ def rollback(**kwargs): ret["out"] = True except Exception as exception: # pylint: disable=broad-except ret["out"] = False - ret[ - "message" - ] = 'Rollback successful but commit failed with error "{}"'.format( - exception + ret["message"] = ( + 'Rollback successful but commit failed with error "{}"'.format( + exception + ) ) _restart_connection() return ret @@ -1078,9 +1078,9 @@ def install_config(path=None, **kwargs): ret["out"] = True if path is None: - ret[ - "message" - ] = "Please provide the salt path where the configuration is present" + ret["message"] = ( + "Please provide the salt path where the configuration is present" + ) ret["out"] = False return ret @@ -1139,9 +1139,9 @@ def install_config(path=None, **kwargs): db_mode = op.pop("mode", "exclusive") if write_diff and db_mode in ["dynamic", "ephemeral"]: - ret[ - "message" - ] = "Write diff is not supported with dynamic/ephemeral configuration mode" + ret["message"] = ( + "Write diff is not supported with dynamic/ephemeral configuration mode" + ) ret["out"] = False return ret @@ -1153,9 +1153,9 @@ def install_config(path=None, **kwargs): try: cu.load(**op) except Exception as exception: # pylint: disable=broad-except - ret[ - "message" - ] = 'Could not load configuration due to : "{}"'.format(exception) + ret["message"] = ( + 'Could not load configuration due to : "{}"'.format(exception) + ) ret["format"] = op["format"] ret["out"] = False _restart_connection() @@ -1185,10 +1185,10 @@ def install_config(path=None, **kwargs): try: check = cu.commit_check() except Exception as exception: # pylint: disable=broad-except - ret[ - "message" - ] = 'Commit check threw the following exception: "{}"'.format( - exception + ret["message"] = ( + 'Commit check threw the following exception: "{}"'.format( + exception + ) ) ret["out"] = False _restart_connection() @@ -1199,10 +1199,10 @@ def install_config(path=None, **kwargs): cu.commit(**commit_params) ret["message"] = "Successfully loaded and committed!" except Exception as exception: # pylint: disable=broad-except - ret[ - "message" - ] = 'Commit check successful but commit failed with "{}"'.format( - exception + ret["message"] = ( + 'Commit check successful but commit failed with "{}"'.format( + exception + ) ) ret["out"] = False _restart_connection() @@ -1248,9 +1248,9 @@ def install_config(path=None, **kwargs): with salt.utils.files.fopen(write_diff, "w") as fp: fp.write(salt.utils.stringutils.to_str(config_diff)) except Exception as exception: # pylint: disable=broad-except - ret[ - "message" - ] = "Could not write into diffs_file due to: '{}'".format(exception) + ret["message"] = ( + "Could not write into diffs_file due to: '{}'".format(exception) + ) ret["out"] = False except ValueError as ex: @@ -1396,9 +1396,9 @@ def install_os(path=None, **kwargs): no_copy_ = op.get("no_copy", False) if path is None: - ret[ - "message" - ] = "Please provide the salt path where the junos image is present." + ret["message"] = ( + "Please provide the salt path where the junos image is present." + ) ret["out"] = False return ret @@ -1467,10 +1467,10 @@ def install_os(path=None, **kwargs): conn.sw.reboot(**reboot_kwargs) except Exception as exception: # pylint: disable=broad-except __proxy__["junos.reboot_clear"]() - ret[ - "message" - ] = 'Installation successful but reboot failed due to : "{}"'.format( - exception + ret["message"] = ( + 'Installation successful but reboot failed due to : "{}"'.format( + exception + ) ) ret["out"] = False _restart_connection() @@ -1666,9 +1666,9 @@ def load(path=None, **kwargs): ret["out"] = True if path is None: - ret[ - "message" - ] = "Please provide the salt path where the configuration is present" + ret["message"] = ( + "Please provide the salt path where the configuration is present" + ) ret["out"] = False return ret @@ -1862,10 +1862,10 @@ def get_table( ) globals().update(FactoryLoader().load(ret["table"])) except OSError as err: - ret[ - "message" - ] = "Uncaught exception during YAML Load - please report: {}".format( - str(err) + ret["message"] = ( + "Uncaught exception during YAML Load - please report: {}".format( + str(err) + ) ) ret["out"] = False return ret @@ -1873,18 +1873,18 @@ def get_table( data = globals()[table](conn) data.get(**get_kvargs) except KeyError as err: - ret[ - "message" - ] = "Uncaught exception during get API call - please report: {}".format( - str(err) + ret["message"] = ( + "Uncaught exception during get API call - please report: {}".format( + str(err) + ) ) ret["out"] = False return ret except ConnectClosedError: - ret[ - "message" - ] = "Got ConnectClosedError exception. Connection lost with {}".format( - conn + ret["message"] = ( + "Got ConnectClosedError exception. Connection lost with {}".format( + conn + ) ) ret["out"] = False _restart_connection() @@ -1914,10 +1914,10 @@ def get_table( ret["table"][table]["args"] = args ret["table"][table]["command"] = data.GET_CMD except ConnectClosedError: - ret[ - "message" - ] = "Got ConnectClosedError exception. Connection lost with {}".format( - str(conn) + ret["message"] = ( + "Got ConnectClosedError exception. Connection lost with {}".format( + str(conn) + ) ) ret["out"] = False _restart_connection() diff --git a/salt/modules/kerberos.py b/salt/modules/kerberos.py index ea898a22634..30b0a356df0 100644 --- a/salt/modules/kerberos.py +++ b/salt/modules/kerberos.py @@ -19,7 +19,6 @@ authenticate as. auth_principal: kadmin/admin """ - import logging import salt.utils.path diff --git a/salt/modules/keyboard.py b/salt/modules/keyboard.py index 85d3e3aca93..ed26c7362d2 100644 --- a/salt/modules/keyboard.py +++ b/salt/modules/keyboard.py @@ -3,7 +3,6 @@ Module for managing keyboards on supported POSIX-like systems using systemd, or such as Redhat, Debian and Gentoo. """ - import logging import salt.utils.path diff --git a/salt/modules/keystone.py b/salt/modules/keystone.py index b39a8b0ae5b..9ca44b14337 100644 --- a/salt/modules/keystone.py +++ b/salt/modules/keystone.py @@ -355,11 +355,13 @@ def endpoint_get(service, region=None, profile=None, interface=None, **connectio e = [ _f for _f in [ - e - if e["service_id"] == service_id - and (e["region"] == region if region else True) - and (e["interface"] == interface if interface else True) - else None + ( + e + if e["service_id"] == service_id + and (e["region"] == region if region else True) + and (e["interface"] == interface if interface else True) + else None + ) for e in endpoints.values() ] if _f diff --git a/salt/modules/keystoneng.py b/salt/modules/keystoneng.py index 77c5e7f8b01..1bec255d60e 100644 --- a/salt/modules/keystoneng.py +++ b/salt/modules/keystoneng.py @@ -25,7 +25,6 @@ Example configuration identity_api_version: 3 """ - HAS_SHADE = False try: import shade diff --git a/salt/modules/keystore.py b/salt/modules/keystore.py index 449c78b9589..6a4b7b90bf2 100644 --- a/salt/modules/keystore.py +++ b/salt/modules/keystore.py @@ -2,7 +2,6 @@ Module to interact with keystores """ - import logging import os from datetime import datetime diff --git a/salt/modules/launchctl_service.py b/salt/modules/launchctl_service.py index b30ce1320f4..b1d2ec5a639 100644 --- a/salt/modules/launchctl_service.py +++ b/salt/modules/launchctl_service.py @@ -10,7 +10,6 @@ Module for the management of MacOS systems that use launchd/launchctl :depends: - plistlib Python module """ - import fnmatch import logging import os diff --git a/salt/modules/ldap3.py b/salt/modules/ldap3.py index 2313b024bb9..87836de7b6f 100644 --- a/salt/modules/ldap3.py +++ b/salt/modules/ldap3.py @@ -10,7 +10,6 @@ This is an alternative to the ``ldap`` interface provided by the :depends: - ``ldap`` Python module """ - import logging import salt.utils.data diff --git a/salt/modules/ldapmod.py b/salt/modules/ldapmod.py index 8b1e22d994e..ceac8cd5dc3 100644 --- a/salt/modules/ldapmod.py +++ b/salt/modules/ldapmod.py @@ -39,7 +39,6 @@ Salt interface to LDAP commands badness may ensue - you have been warned. """ - import logging import time diff --git a/salt/modules/libcloud_compute.py b/salt/modules/libcloud_compute.py index 73171caa553..b902055df36 100644 --- a/salt/modules/libcloud_compute.py +++ b/salt/modules/libcloud_compute.py @@ -26,6 +26,7 @@ Clouds include Amazon EC2, Azure, Google GCE, VMware, OpenStack Nova :depends: apache-libcloud """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/libcloud_dns.py b/salt/modules/libcloud_dns.py index 182b7fb7820..33779286112 100644 --- a/salt/modules/libcloud_dns.py +++ b/salt/modules/libcloud_dns.py @@ -24,6 +24,7 @@ Connection module for Apache Libcloud DNS management :depends: apache-libcloud """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/libcloud_loadbalancer.py b/salt/modules/libcloud_loadbalancer.py index 08d768ef626..3fa4fd49467 100644 --- a/salt/modules/libcloud_loadbalancer.py +++ b/salt/modules/libcloud_loadbalancer.py @@ -26,6 +26,7 @@ Clouds include Amazon ELB, ALB, Google, Aliyun, CloudStack, Softlayer :depends: apache-libcloud """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/libcloud_storage.py b/salt/modules/libcloud_storage.py index 7e055ab30e5..51fc04b5512 100644 --- a/salt/modules/libcloud_storage.py +++ b/salt/modules/libcloud_storage.py @@ -26,6 +26,7 @@ Clouds include Amazon S3, Google Storage, Aliyun, Azure Blobs, Ceph, OpenStack s :depends: apache-libcloud """ + # keep lint from choking on _get_conn and _cache_id # pylint: disable=E0602 diff --git a/salt/modules/lxc.py b/salt/modules/lxc.py index 444359bd216..4dab95f44eb 100644 --- a/salt/modules/lxc.py +++ b/salt/modules/lxc.py @@ -1666,9 +1666,9 @@ def init( ret["result"] = False else: if not result: - ret[ - "comment" - ] = "Bootstrap failed, see minion log for more information" + ret["comment"] = ( + "Bootstrap failed, see minion log for more information" + ) ret["result"] = False else: changes.append({"bootstrap": "Container successfully bootstrapped"}) @@ -3274,7 +3274,6 @@ def systemd_running_state(name, path=None): def test_sd_started_state(name, path=None): - """ Test if a systemd container is fully started diff --git a/salt/modules/lxd.py b/salt/modules/lxd.py index cc91c1b59b7..fadaa98f27e 100644 --- a/salt/modules/lxd.py +++ b/salt/modules/lxd.py @@ -31,7 +31,6 @@ several functions to help manage it and its containers. :platform: Linux """ - import logging import os from datetime import datetime @@ -3438,17 +3437,17 @@ def sync_config_devices(obj, newconfig, newdevices, test=False): if newconfig[k] != obj.config[k]: if not test: - config_changes[ - k - ] = 'Changed config key "{}" to "{}", its value was "{}"'.format( - k, newconfig[k], obj.config[k] + config_changes[k] = ( + 'Changed config key "{}" to "{}", its value was "{}"'.format( + k, newconfig[k], obj.config[k] + ) ) obj.config[k] = newconfig[k] else: - config_changes[ - k - ] = 'Would change config key "{}" to "{}", its current value is "{}"'.format( - k, newconfig[k], obj.config[k] + config_changes[k] = ( + 'Would change config key "{}" to "{}", its current value is "{}"'.format( + k, newconfig[k], obj.config[k] + ) ) # New keys diff --git a/salt/modules/mac_brew_pkg.py b/salt/modules/mac_brew_pkg.py index 976dd1ad615..26c47a7a5b8 100644 --- a/salt/modules/mac_brew_pkg.py +++ b/salt/modules/mac_brew_pkg.py @@ -725,9 +725,9 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 if result: changes = {"old": "hold", "new": "install"} ret[target].update(changes=changes, result=True) - ret[target][ - "comment" - ] = "Package {} is no longer being held.".format(target) + ret[target]["comment"] = ( + "Package {} is no longer being held.".format(target) + ) else: ret[target].update(result=False) ret[target]["comment"] = "Unable to unhold package {}.".format( diff --git a/salt/modules/mac_group.py b/salt/modules/mac_group.py index 4c13f598802..44b57f25909 100644 --- a/salt/modules/mac_group.py +++ b/salt/modules/mac_group.py @@ -1,6 +1,7 @@ """ Manage groups on Mac OS 10.7+ """ + import logging import salt.utils.functools diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index e5c23332ea5..d116f3e2077 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -6,6 +6,7 @@ Manage macOS local directory passwords and policies Note that it is usually better to apply password policies through the creation of a configuration profile. """ + # Authentication concepts reference: # https://developer.apple.com/library/mac/documentation/Networking/Conceptual/Open_Directory/openDirectoryConcepts/openDirectoryConcepts.html#//apple_ref/doc/uid/TP40000917-CH3-CIFCAIBB diff --git a/salt/modules/mandrill.py b/salt/modules/mandrill.py index d9c7d333ecd..5896662d664 100644 --- a/salt/modules/mandrill.py +++ b/salt/modules/mandrill.py @@ -17,7 +17,6 @@ In the minion configuration file, the following block is required: .. versionadded:: 2018.3.0 """ - import logging import salt.utils.json diff --git a/salt/modules/marathon.py b/salt/modules/marathon.py index c749f28015e..04e910dd5fd 100644 --- a/salt/modules/marathon.py +++ b/salt/modules/marathon.py @@ -6,7 +6,6 @@ Currently this only works when run through a proxy minion. .. versionadded:: 2015.8.2 """ - import logging import salt.utils.http diff --git a/salt/modules/mattermost.py b/salt/modules/mattermost.py index adb3cb7b676..5f821766a55 100644 --- a/salt/modules/mattermost.py +++ b/salt/modules/mattermost.py @@ -14,7 +14,6 @@ Module for sending messages to Mattermost api_url: https://example.com """ - import logging import salt.utils.json diff --git a/salt/modules/mdadm_raid.py b/salt/modules/mdadm_raid.py index e76f400a214..7333101cbaa 100644 --- a/salt/modules/mdadm_raid.py +++ b/salt/modules/mdadm_raid.py @@ -1,6 +1,7 @@ """ Salt module to manage RAID arrays with mdadm """ + import logging import os import re diff --git a/salt/modules/mdata.py b/salt/modules/mdata.py index 9b31be55dbc..8075922a5ef 100644 --- a/salt/modules/mdata.py +++ b/salt/modules/mdata.py @@ -8,7 +8,6 @@ Module for managaging metadata in SmartOS Zones :platform: smartos """ - import logging import salt.utils.decorators as decorators diff --git a/salt/modules/modjk.py b/salt/modules/modjk.py index 41f6253fd43..9b1ec755f61 100644 --- a/salt/modules/modjk.py +++ b/salt/modules/modjk.py @@ -29,6 +29,7 @@ this module. realm: authentication realm2 for digest passwords timeout: 600 """ + import urllib.parse import urllib.request diff --git a/salt/modules/mount.py b/salt/modules/mount.py index aedc8dc79f2..f27575fc8ed 100644 --- a/salt/modules/mount.py +++ b/salt/modules/mount.py @@ -2,7 +2,6 @@ Salt module to manage Unix mounts and the fstab file """ - import logging import os import re diff --git a/salt/modules/mssql.py b/salt/modules/mssql.py index 3b64899929c..9254d78fe5d 100644 --- a/salt/modules/mssql.py +++ b/salt/modules/mssql.py @@ -20,7 +20,6 @@ Module to provide MS SQL Server compatibility to salt. configs or pillars. """ - import salt.utils.json try: @@ -217,7 +216,6 @@ def db_remove(database_name, **kwargs): def role_list(**kwargs): - """ Lists database roles. @@ -231,7 +229,6 @@ def role_list(**kwargs): def role_exists(role, **kwargs): - """ Checks if a role exists. diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py index 4d8f5e07e8b..522b8858ce7 100644 --- a/salt/modules/mysql.py +++ b/salt/modules/mysql.py @@ -28,7 +28,6 @@ Module to provide MySQL compatibility to salt. Additionally, it is now possible to setup a user with no password. """ - import copy import hashlib import logging diff --git a/salt/modules/nacl.py b/salt/modules/nacl.py index ef0e1774548..ca1e54193e5 100644 --- a/salt/modules/nacl.py +++ b/salt/modules/nacl.py @@ -149,7 +149,6 @@ Optional small program to encrypt data without needing salt modules. """ - import salt.utils.nacl __virtualname__ = "nacl" diff --git a/salt/modules/nagios.py b/salt/modules/nagios.py index 29c02e4bf03..960b8b2e718 100644 --- a/salt/modules/nagios.py +++ b/salt/modules/nagios.py @@ -2,7 +2,6 @@ Run nagios plugins/checks from salt and get the return as data. """ - import logging import os import stat diff --git a/salt/modules/nagios_rpc.py b/salt/modules/nagios_rpc.py index 0f7969dbf38..5eae58b0b2b 100644 --- a/salt/modules/nagios_rpc.py +++ b/salt/modules/nagios_rpc.py @@ -5,7 +5,6 @@ Check Host & Service status from Nagios via JSON RPC. """ - import http.client import logging diff --git a/salt/modules/namecheap_domains.py b/salt/modules/namecheap_domains.py index 97ec8e215a0..c3d9f3ba1d0 100644 --- a/salt/modules/namecheap_domains.py +++ b/salt/modules/namecheap_domains.py @@ -402,9 +402,9 @@ def check(*domains_to_check): domains_checked = {} for result in response_xml.getElementsByTagName("DomainCheckResult"): available = result.getAttribute("Available") - domains_checked[ - result.getAttribute("Domain").lower() - ] = salt.utils.namecheap.string_to_value(available) + domains_checked[result.getAttribute("Domain").lower()] = ( + salt.utils.namecheap.string_to_value(available) + ) return domains_checked diff --git a/salt/modules/namecheap_domains_dns.py b/salt/modules/namecheap_domains_dns.py index ef6789ec778..24805acba6d 100644 --- a/salt/modules/namecheap_domains_dns.py +++ b/salt/modules/namecheap_domains_dns.py @@ -26,7 +26,6 @@ file, or in the Pillar data. #namecheap.url: https://api.sandbox.namecheap.xml.response """ - CAN_USE_NAMECHEAP = True diff --git a/salt/modules/napalm_bgp.py b/salt/modules/napalm_bgp.py index 84a19b27a2c..b7721397bd9 100644 --- a/salt/modules/napalm_bgp.py +++ b/salt/modules/napalm_bgp.py @@ -17,7 +17,6 @@ Dependencies .. versionadded:: 2016.11.0 """ - import logging # import NAPALM utils @@ -59,7 +58,6 @@ def __virtual__(): @proxy_napalm_wrap def config(group=None, neighbor=None, **kwargs): - """ Provides the BGP configuration on the device. @@ -169,7 +167,6 @@ def config(group=None, neighbor=None, **kwargs): @proxy_napalm_wrap def neighbors(neighbor=None, **kwargs): - """ Provides details regarding the BGP sessions configured on the network device. diff --git a/salt/modules/napalm_network.py b/salt/modules/napalm_network.py index 124d70b4876..c6156db1566 100644 --- a/salt/modules/napalm_network.py +++ b/salt/modules/napalm_network.py @@ -64,7 +64,6 @@ def __virtual__(): def _filter_list(input_list, search_key, search_value): - """ Filters a list of dictionary by a set of key-value pair. @@ -84,7 +83,6 @@ def _filter_list(input_list, search_key, search_value): def _filter_dict(input_dict, search_key, search_value): - """ Filters a dictionary of dictionaries by a key-value pair. @@ -310,9 +308,9 @@ def _config_logic( _comm = __salt__["napalm.junos_commit"](confirm=minutes) if not _comm["out"]: # If unable to commit confirm, should try to bail out - loaded_result[ - "comment" - ] = "Unable to commit confirm: {}".format(_comm["message"]) + loaded_result["comment"] = ( + "Unable to commit confirm: {}".format(_comm["message"]) + ) loaded_result["result"] = False # But before exiting, we must gracefully discard the config discarded = _safe_dicard_config(loaded_result, napalm_device) @@ -838,7 +836,6 @@ def cli(*commands, **kwargs): # pylint: disable=unused-argument def traceroute( destination, source=None, ttl=None, timeout=None, vrf=None, **kwargs ): # pylint: disable=unused-argument - """ Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute command executed on the device. @@ -892,7 +889,6 @@ def ping( vrf=None, **kwargs ): # pylint: disable=unused-argument - """ Executes a ping on the network device and returns a dictionary as a result. @@ -947,7 +943,6 @@ def ping( def arp( interface="", ipaddr="", macaddr="", **kwargs ): # pylint: disable=unused-argument - """ NAPALM returns a list of dictionaries with details of the ARP entries. @@ -1008,7 +1003,6 @@ def arp( @salt.utils.napalm.proxy_napalm_wrap def ipaddrs(**kwargs): # pylint: disable=unused-argument - """ Returns IP addresses configured on the device. @@ -1065,7 +1059,6 @@ def ipaddrs(**kwargs): # pylint: disable=unused-argument @salt.utils.napalm.proxy_napalm_wrap def interfaces(**kwargs): # pylint: disable=unused-argument - """ Returns details of the interfaces on the device. @@ -1109,7 +1102,6 @@ def interfaces(**kwargs): # pylint: disable=unused-argument @salt.utils.napalm.proxy_napalm_wrap def lldp(interface="", **kwargs): # pylint: disable=unused-argument - """ Returns a detailed view of the LLDP neighbors. @@ -1169,7 +1161,6 @@ def lldp(interface="", **kwargs): # pylint: disable=unused-argument @salt.utils.napalm.proxy_napalm_wrap def mac(address="", interface="", vlan=0, **kwargs): # pylint: disable=unused-argument - """ Returns the MAC Address Table on the device. @@ -1563,10 +1554,10 @@ def load_config( # When using salt:// or https://, if the resource is not available, # it will either raise an exception, or return False. ret = {"result": False, "out": None} - ret[ - "comment" - ] = "Unable to read from {}. Please specify a valid file or text.".format( - filename + ret["comment"] = ( + "Unable to read from {}. Please specify a valid file or text.".format( + filename + ) ) log.error(ret["comment"]) return ret @@ -2097,7 +2088,6 @@ def load_template( @salt.utils.napalm.proxy_napalm_wrap def commit(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument - """ Commits the configuration changes made on the network device. @@ -2117,7 +2107,6 @@ def commit(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argu def discard_config( inherit_napalm_device=None, **kwargs ): # pylint: disable=unused-argument - """ Discards the changes applied. @@ -2137,7 +2126,6 @@ def discard_config( def compare_config( inherit_napalm_device=None, **kwargs ): # pylint: disable=unused-argument - """ Returns the difference between the running config and the candidate config. @@ -2155,7 +2143,6 @@ def compare_config( @salt.utils.napalm.proxy_napalm_wrap def rollback(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument - """ Rollbacks the configuration. @@ -2175,7 +2162,6 @@ def rollback(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-ar def config_changed( inherit_napalm_device=None, **kwargs ): # pylint: disable=unused-argument - """ Will prompt if the configuration has been changed. @@ -2210,7 +2196,6 @@ def config_changed( def config_control( inherit_napalm_device=None, **kwargs ): # pylint: disable=unused-argument - """ Will check if the configuration was changed. If differences found, will try to commit. diff --git a/salt/modules/napalm_ntp.py b/salt/modules/napalm_ntp.py index 125c36dfb47..d737c149e23 100644 --- a/salt/modules/napalm_ntp.py +++ b/salt/modules/napalm_ntp.py @@ -20,7 +20,6 @@ Dependencies .. versionadded:: 2016.11.0 """ - import logging # import NAPALM utils @@ -62,7 +61,6 @@ def __virtual__(): @proxy_napalm_wrap def peers(**kwargs): # pylint: disable=unused-argument - """ Returns a list the NTP peers configured on the network device. @@ -103,7 +101,6 @@ def peers(**kwargs): # pylint: disable=unused-argument @proxy_napalm_wrap def servers(**kwargs): # pylint: disable=unused-argument - """ Returns a list of the configured NTP servers on the device. @@ -141,7 +138,6 @@ def servers(**kwargs): # pylint: disable=unused-argument @proxy_napalm_wrap def stats(peer=None, **kwargs): # pylint: disable=unused-argument - """ Returns a dictionary containing synchronization details of the NTP peers. @@ -208,7 +204,6 @@ def stats(peer=None, **kwargs): # pylint: disable=unused-argument @proxy_napalm_wrap def set_peers(*peers, **options): - """ Configures a list of NTP peers on the device. @@ -285,7 +280,6 @@ def set_servers(*servers, **options): @proxy_napalm_wrap def delete_peers(*peers, **options): - """ Removes NTP peers configured on the device. @@ -325,7 +319,6 @@ def delete_peers(*peers, **options): @proxy_napalm_wrap def delete_servers(*servers, **options): - """ Removes NTP servers configured on the device. diff --git a/salt/modules/napalm_probes.py b/salt/modules/napalm_probes.py index 7f798391a75..132b984d6b1 100644 --- a/salt/modules/napalm_probes.py +++ b/salt/modules/napalm_probes.py @@ -60,7 +60,6 @@ def __virtual__(): @proxy_napalm_wrap def config(**kwargs): # pylint: disable=unused-argument - """ Returns the configuration of the RPM probes. @@ -103,7 +102,6 @@ def config(**kwargs): # pylint: disable=unused-argument @proxy_napalm_wrap def results(**kwargs): # pylint: disable=unused-argument - """ Provides the results of the measurements of the RPM/SLA probes. @@ -270,7 +268,6 @@ def set_probes( def delete_probes( probes, test=False, commit=True, **kwargs ): # pylint: disable=unused-argument - """ Removes RPM/SLA probes from the network device. Calls the configuration template 'delete_probes' from the NAPALM library, @@ -327,7 +324,6 @@ def delete_probes( def schedule_probes( probes, test=False, commit=True, **kwargs ): # pylint: disable=unused-argument - """ Will schedule the probes. On Cisco devices, it is not enough to define the probes, it is also necessary to schedule them. diff --git a/salt/modules/napalm_route.py b/salt/modules/napalm_route.py index 41d8d74987e..1f88345c4fd 100644 --- a/salt/modules/napalm_route.py +++ b/salt/modules/napalm_route.py @@ -16,7 +16,6 @@ Dependencies .. versionadded:: 2016.11.0 """ - import logging # import NAPALM utils @@ -58,7 +57,6 @@ def __virtual__(): @proxy_napalm_wrap def show(destination, protocol=None, **kwargs): # pylint: disable=unused-argument - """ Displays all details for a certain route learned via a specific protocol. If the protocol is not specified, will return all possible routes. diff --git a/salt/modules/napalm_snmp.py b/salt/modules/napalm_snmp.py index dbcbb4ad700..2e72c03fa69 100644 --- a/salt/modules/napalm_snmp.py +++ b/salt/modules/napalm_snmp.py @@ -20,7 +20,6 @@ Dependencies .. versionadded:: 2016.11.0 """ - import logging # import NAPALM utils @@ -62,7 +61,6 @@ def __virtual__(): @proxy_napalm_wrap def config(**kwargs): # pylint: disable=unused-argument - """ Returns the SNMP configuration @@ -90,7 +88,6 @@ def remove_config( commit=True, **kwargs ): # pylint: disable=unused-argument - """ Removes a configuration element from the SNMP configuration. @@ -157,7 +154,6 @@ def update_config( commit=True, **kwargs ): # pylint: disable=unused-argument - """ Updates the SNMP configuration. diff --git a/salt/modules/napalm_users.py b/salt/modules/napalm_users.py index 170e441ba98..40603097102 100644 --- a/salt/modules/napalm_users.py +++ b/salt/modules/napalm_users.py @@ -19,7 +19,6 @@ Dependencies .. versionadded:: 2016.11.0 """ - import logging # import NAPALM utils @@ -61,7 +60,6 @@ def __virtual__(): @proxy_napalm_wrap def config(**kwargs): # pylint: disable=unused-argument - """ Returns the configuration of the users on the device @@ -100,7 +98,6 @@ def config(**kwargs): # pylint: disable=unused-argument def set_users( users, test=False, commit=True, **kwargs ): # pylint: disable=unused-argument - """ Configures users on network devices. @@ -149,7 +146,6 @@ def set_users( def delete_users( users, test=False, commit=True, **kwargs ): # pylint: disable=unused-argument - """ Removes users from the configuration of network devices. diff --git a/salt/modules/netaddress.py b/salt/modules/netaddress.py index 7c528c92a9e..86b7b1aae97 100644 --- a/salt/modules/netaddress.py +++ b/salt/modules/netaddress.py @@ -6,7 +6,6 @@ Module for getting information about network addresses. :depends: netaddr """ - __virtualname__ = "netaddress" try: diff --git a/salt/modules/neutronng.py b/salt/modules/neutronng.py index daf91f49ff7..3aa2817985c 100644 --- a/salt/modules/neutronng.py +++ b/salt/modules/neutronng.py @@ -25,7 +25,6 @@ Example configuration identity_api_version: 3 """ - HAS_SHADE = False try: import shade diff --git a/salt/modules/nftables.py b/salt/modules/nftables.py index d6020a10122..5af8f7b3b85 100644 --- a/salt/modules/nftables.py +++ b/salt/modules/nftables.py @@ -574,10 +574,10 @@ def check(table="filter", chain=None, rule=None, family="ipv4"): out = __salt__["cmd.run"](cmd, python_shell=False).find(search_rule) if out == -1: - ret[ - "comment" - ] = "Rule {} in chain {} in table {} in family {} does not exist".format( - rule, chain, table, family + ret["comment"] = ( + "Rule {} in chain {} in table {} in family {} does not exist".format( + rule, chain, table, family + ) ) else: ret["comment"] = "Rule {} in chain {} in table {} in family {} exists".format( @@ -799,10 +799,10 @@ def new_chain( ) ret["result"] = True else: - ret[ - "comment" - ] = "Chain {} in table {} in family {} could not be created".format( - chain, table, family + ret["comment"] = ( + "Chain {} in table {} in family {} could not be created".format( + chain, table, family + ) ) return ret @@ -850,10 +850,10 @@ def delete_chain(table="filter", chain=None, family="ipv4"): ) ret["result"] = True else: - ret[ - "comment" - ] = "Chain {} in table {} in family {} could not be deleted".format( - chain, table, family + ret["comment"] = ( + "Chain {} in table {} in family {} could not be deleted".format( + chain, table, family + ) ) return ret @@ -904,10 +904,10 @@ def append(table="filter", chain=None, rule=None, family="ipv4"): res = check(table, chain, rule, family=family) if res["result"]: - ret[ - "comment" - ] = "Rule {} chain {} in table {} in family {} already exists".format( - rule, chain, table, family + ret["comment"] = ( + "Rule {} chain {} in table {} in family {} already exists".format( + rule, chain, table, family + ) ) return ret @@ -923,10 +923,10 @@ def append(table="filter", chain=None, rule=None, family="ipv4"): rule, chain, table, family ) else: - ret[ - "comment" - ] = 'Failed to add rule "{}" chain {} in table {} in family {}.'.format( - rule, chain, table, family + ret["comment"] = ( + 'Failed to add rule "{}" chain {} in table {} in family {}.'.format( + rule, chain, table, family + ) ) return ret @@ -984,10 +984,10 @@ def insert(table="filter", chain=None, position=None, rule=None, family="ipv4"): res = check(table, chain, rule, family=family) if res["result"]: - ret[ - "comment" - ] = "Rule {} chain {} in table {} in family {} already exists".format( - rule, chain, table, family + ret["comment"] = ( + "Rule {} chain {} in table {} in family {} already exists".format( + rule, chain, table, family + ) ) return ret @@ -1008,10 +1008,10 @@ def insert(table="filter", chain=None, position=None, rule=None, family="ipv4"): rule, chain, table, family ) else: - ret[ - "comment" - ] = 'Failed to add rule "{}" chain {} in table {} in family {}.'.format( - rule, chain, table, family + ret["comment"] = ( + 'Failed to add rule "{}" chain {} in table {} in family {}.'.format( + rule, chain, table, family + ) ) return ret @@ -1061,10 +1061,10 @@ def delete(table, chain=None, position=None, rule=None, family="ipv4"): res = check(table, chain, rule, family=family) if not res["result"]: - ret[ - "comment" - ] = "Rule {} chain {} in table {} in family {} does not exist".format( - rule, chain, table, family + ret["comment"] = ( + "Rule {} chain {} in table {} in family {} does not exist".format( + rule, chain, table, family + ) ) return ret @@ -1081,16 +1081,16 @@ def delete(table, chain=None, position=None, rule=None, family="ipv4"): if not out: ret["result"] = True - ret[ - "comment" - ] = 'Deleted rule "{}" in chain {} in table {} in family {}.'.format( - rule, chain, table, family + ret["comment"] = ( + 'Deleted rule "{}" in chain {} in table {} in family {}.'.format( + rule, chain, table, family + ) ) else: - ret[ - "comment" - ] = 'Failed to delete rule "{}" in chain {} table {} in family {}'.format( - rule, chain, table, family + ret["comment"] = ( + 'Failed to delete rule "{}" in chain {} table {} in family {}'.format( + rule, chain, table, family + ) ) return ret diff --git a/salt/modules/nix.py b/salt/modules/nix.py index d5331cb7a97..b0e95afc2d1 100644 --- a/salt/modules/nix.py +++ b/salt/modules/nix.py @@ -18,7 +18,6 @@ For more information on nix, see the `nix documentation`_. .. _`nix-daemon`: https://nixos.org/nix/manual/#ssec-multi-user """ - import itertools import logging import os diff --git a/salt/modules/nspawn.py b/salt/modules/nspawn.py index ec74385fff9..a1893ef8d2c 100644 --- a/salt/modules/nspawn.py +++ b/salt/modules/nspawn.py @@ -20,7 +20,6 @@ Minions running systemd >= 219 will place new containers in package. """ - import errno import functools import logging diff --git a/salt/modules/omapi.py b/salt/modules/omapi.py index c63d94d3dae..fd92162b04b 100644 --- a/salt/modules/omapi.py +++ b/salt/modules/omapi.py @@ -11,7 +11,6 @@ config or pillar: :depends: pypureomapi Python module """ - import logging import struct diff --git a/salt/modules/openbsdservice.py b/salt/modules/openbsdservice.py index b68d217b448..58304aa9fdb 100644 --- a/salt/modules/openbsdservice.py +++ b/salt/modules/openbsdservice.py @@ -8,7 +8,6 @@ The service module for OpenBSD `. """ - import fnmatch import logging import os diff --git a/salt/modules/openscap.py b/salt/modules/openscap.py index 3f3ff6dffd8..ca026e02868 100644 --- a/salt/modules/openscap.py +++ b/salt/modules/openscap.py @@ -2,6 +2,7 @@ Module for OpenSCAP Management """ + import argparse import shlex import shutil diff --git a/salt/modules/osquery.py b/salt/modules/osquery.py index 93c3774dc18..c28d1685dc5 100644 --- a/salt/modules/osquery.py +++ b/salt/modules/osquery.py @@ -81,9 +81,9 @@ def _osquery_cmd(table, attrs=None, where=None, format="json"): for a in attrs: if a not in valid_attrs: ret["result"] = False - ret[ - "comment" - ] = "{} is not a valid attribute for table {}".format(a, table) + ret["comment"] = ( + "{} is not a valid attribute for table {}".format(a, table) + ) return ret _attrs = ",".join(attrs) else: diff --git a/salt/modules/pacmanpkg.py b/salt/modules/pacmanpkg.py index 88336f6957a..25ed1177d9d 100644 --- a/salt/modules/pacmanpkg.py +++ b/salt/modules/pacmanpkg.py @@ -8,6 +8,7 @@ A module to wrap pacman calls, since Arch is the best *'pkg.install' is not available*), see :ref:`here `. """ + import copy import fnmatch import logging @@ -363,7 +364,6 @@ def group_info(name): def group_diff(name): - """ .. versionadded:: 2016.11.0 diff --git a/salt/modules/panos.py b/salt/modules/panos.py index 64be78723de..f5e22d268be 100644 --- a/salt/modules/panos.py +++ b/salt/modules/panos.py @@ -27,7 +27,6 @@ through the XML API or through a brokered connection to Panorama. """ - import logging import time diff --git a/salt/modules/pcs.py b/salt/modules/pcs.py index 4e3c74158a3..8225206f51c 100644 --- a/salt/modules/pcs.py +++ b/salt/modules/pcs.py @@ -10,7 +10,6 @@ Pacemaker/Cororsync conifguration system (PCS) .. versionadded:: 2016.3.0 """ - import logging import salt.utils.path diff --git a/salt/modules/pf.py b/salt/modules/pf.py index c463e1ce50f..3a52257c8cf 100644 --- a/salt/modules/pf.py +++ b/salt/modules/pf.py @@ -6,7 +6,6 @@ Control the OpenBSD packet filter (PF). .. versionadded:: 2019.2.0 """ - import logging import re diff --git a/salt/modules/pip.py b/salt/modules/pip.py index ebe51b85474..aa58d230bec 100644 --- a/salt/modules/pip.py +++ b/salt/modules/pip.py @@ -872,9 +872,13 @@ def install( if download_cache or cache_dir: cmd.extend( [ - "--cache-dir" - if salt.utils.versions.compare(ver1=cur_version, oper=">=", ver2="6.0") - else "--download-cache", + ( + "--cache-dir" + if salt.utils.versions.compare( + ver1=cur_version, oper=">=", ver2="6.0" + ) + else "--download-cache" + ), download_cache or cache_dir, ] ) diff --git a/salt/modules/pkg_resource.py b/salt/modules/pkg_resource.py index 578e53da30d..6308641a2f9 100644 --- a/salt/modules/pkg_resource.py +++ b/salt/modules/pkg_resource.py @@ -2,7 +2,6 @@ Resources needed by pkg providers """ - import copy import fnmatch import logging diff --git a/salt/modules/pkgng.py b/salt/modules/pkgng.py index 8becb90cc91..e5f94b7c297 100644 --- a/salt/modules/pkgng.py +++ b/salt/modules/pkgng.py @@ -2018,9 +2018,9 @@ def unhold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613 ret[target]["changes"]["new"] = "" ret[target]["changes"]["old"] = "hold" else: - ret[target][ - "comment" - ] = "Package {} was unable to be unheld.".format(target) + ret[target]["comment"] = ( + "Package {} was unable to be unheld.".format(target) + ) else: ret[target].update(result=True) ret[target]["comment"] = "Package {} is not being held.".format(target) diff --git a/salt/modules/postfix.py b/salt/modules/postfix.py index aa67793fafe..64059bfe44b 100644 --- a/salt/modules/postfix.py +++ b/salt/modules/postfix.py @@ -456,17 +456,17 @@ def hold(queue_id): if queue_id == "ALL": ret["message"] = "Successfully placed all messages on hold" else: - ret[ - "message" - ] = "Successfully placed message on hold with queue id {}".format(queue_id) + ret["message"] = ( + "Successfully placed message on hold with queue id {}".format(queue_id) + ) else: if queue_id == "ALL": ret["message"] = "Unable to place all messages on hold" else: - ret[ - "message" - ] = "Unable to place message on hold with queue id {}: {}".format( - queue_id, result["stderr"] + ret["message"] = ( + "Unable to place message on hold with queue id {}: {}".format( + queue_id, result["stderr"] + ) ) return ret @@ -509,17 +509,17 @@ def unhold(queue_id): if queue_id == "ALL": ret["message"] = "Successfully set all message as unheld" else: - ret[ - "message" - ] = "Successfully set message as unheld with queue id {}".format(queue_id) + ret["message"] = ( + "Successfully set message as unheld with queue id {}".format(queue_id) + ) else: if queue_id == "ALL": ret["message"] = "Unable to set all message as unheld." else: - ret[ - "message" - ] = "Unable to set message as unheld with queue id {}: {}".format( - queue_id, result["stderr"] + ret["message"] = ( + "Unable to set message as unheld with queue id {}: {}".format( + queue_id, result["stderr"] + ) ) return ret diff --git a/salt/modules/proxy.py b/salt/modules/proxy.py index 370bd3eab93..1aa5dc9f2c6 100644 --- a/salt/modules/proxy.py +++ b/salt/modules/proxy.py @@ -6,7 +6,6 @@ This module allows you to manage proxy settings salt '*' network.get_http_proxy """ - import logging import re diff --git a/salt/modules/ps.py b/salt/modules/ps.py index 643764a1342..a6b23c500d0 100644 --- a/salt/modules/ps.py +++ b/salt/modules/ps.py @@ -5,7 +5,6 @@ See http://code.google.com/p/psutil. :depends: - python-utmp package (optional) """ - import datetime import re import time diff --git a/salt/modules/puppet.py b/salt/modules/puppet.py index b97eaa3ff60..8fd1e994c7e 100644 --- a/salt/modules/puppet.py +++ b/salt/modules/puppet.py @@ -2,7 +2,6 @@ Execute puppet routines """ - import datetime import logging import os diff --git a/salt/modules/pushbullet.py b/salt/modules/pushbullet.py index b716e667d04..ff58bbda489 100644 --- a/salt/modules/pushbullet.py +++ b/salt/modules/pushbullet.py @@ -21,7 +21,6 @@ For example: """ - import logging try: diff --git a/salt/modules/pushover_notify.py b/salt/modules/pushover_notify.py index 43f2f237009..2a0f2e3ecf3 100644 --- a/salt/modules/pushover_notify.py +++ b/salt/modules/pushover_notify.py @@ -15,7 +15,6 @@ Module for sending messages to Pushover (https://www.pushover.net) token: abAHuZyCLtdH8P4zhmFZmgUHUsv1ei8 """ - import logging import urllib.parse diff --git a/salt/modules/qemu_nbd.py b/salt/modules/qemu_nbd.py index 9a76d68cad5..c27bde15a78 100644 --- a/salt/modules/qemu_nbd.py +++ b/salt/modules/qemu_nbd.py @@ -5,7 +5,6 @@ The qemu system comes with powerful tools, such as qemu-img and qemu-nbd which are used here to build up kvm images. """ - import glob import logging import os diff --git a/salt/modules/rallydev.py b/salt/modules/rallydev.py index 6461fb133f5..219d0ab2baa 100644 --- a/salt/modules/rallydev.py +++ b/salt/modules/rallydev.py @@ -12,7 +12,6 @@ Requires a ``username`` and a ``password`` in ``/etc/salt/minion``: password: 123pass """ - import logging import salt.utils.http diff --git a/salt/modules/random_org.py b/salt/modules/random_org.py index 494c323eba5..f5d39cfbeaa 100644 --- a/salt/modules/random_org.py +++ b/salt/modules/random_org.py @@ -15,6 +15,7 @@ Module for retrieving random information from Random.org api_key: 7be1402d-5719-5bd3-a306-3def9f135da5 api_version: 1 """ + import http.client import logging import urllib.request @@ -218,9 +219,9 @@ def generateIntegers(api_key=None, api_version=None, **kwargs): or not -1000000000 <= kwargs["minimum"] <= 1000000000 ): ret["res"] = False - ret[ - "message" - ] = "Minimum argument must be between -1,000,000,000 and 1,000,000,000" + ret["message"] = ( + "Minimum argument must be between -1,000,000,000 and 1,000,000,000" + ) return ret if ( @@ -228,9 +229,9 @@ def generateIntegers(api_key=None, api_version=None, **kwargs): or not -1000000000 <= kwargs["maximum"] <= 1000000000 ): ret["res"] = False - ret[ - "message" - ] = "Maximum argument must be between -1,000,000,000 and 1,000,000,000" + ret["message"] = ( + "Maximum argument must be between -1,000,000,000 and 1,000,000,000" + ) return ret if "base" in kwargs: @@ -614,9 +615,9 @@ def generateGaussians(api_key=None, api_version=None, **kwargs): or not -1000000 <= kwargs["standardDeviation"] <= 1000000 ): ret["res"] = False - ret[ - "message" - ] = "The distribution's standard deviation must be between -1000000 and 1000000" + ret["message"] = ( + "The distribution's standard deviation must be between -1000000 and 1000000" + ) return ret if ( diff --git a/salt/modules/rbenv.py b/salt/modules/rbenv.py index e0bc1e82503..b41ed1e8909 100644 --- a/salt/modules/rbenv.py +++ b/salt/modules/rbenv.py @@ -9,7 +9,6 @@ http://misheska.com/blog/2013/06/15/using-rbenv-to-manage-multiple-versions-of-r .. versionadded:: 0.16.0 """ - import logging import os import re diff --git a/salt/modules/reg.py b/salt/modules/reg.py index 229998e27a9..5184d0423e2 100644 --- a/salt/modules/reg.py +++ b/salt/modules/reg.py @@ -64,6 +64,7 @@ Value: :depends: - salt.utils.win_reg """ + # When production windows installer is using Python 3, Python 2 code can be removed import logging diff --git a/salt/modules/restartcheck.py b/salt/modules/restartcheck.py index 287b9bd3b38..b2a2a30bb66 100644 --- a/salt/modules/restartcheck.py +++ b/salt/modules/restartcheck.py @@ -9,6 +9,7 @@ https://packages.debian.org/debian-goodies) and psdel by Sam Morris. :codeauthor: Jiri Kotlin """ + import os import re import subprocess diff --git a/salt/modules/restconf.py b/salt/modules/restconf.py index 3007adc225d..1a2d4f7799c 100644 --- a/salt/modules/restconf.py +++ b/salt/modules/restconf.py @@ -7,7 +7,6 @@ Execution module for RESTCONF Proxy minions """ - import logging __proxyenabled__ = ["restconf"] diff --git a/salt/modules/rh_ip.py b/salt/modules/rh_ip.py index e476bbd3f6e..b6ee34846e2 100644 --- a/salt/modules/rh_ip.py +++ b/salt/modules/rh_ip.py @@ -372,7 +372,6 @@ def _parse_settings_bond_0(opts, iface): def _parse_settings_bond_1(opts, iface): - """ Filters given options and outputs valid settings for bond1. If an option has a value that is not expected, this @@ -418,7 +417,6 @@ def _parse_settings_bond_2(opts, iface): def _parse_settings_bond_3(opts, iface): - """ Filters given options and outputs valid settings for bond3. If an option has a value that is not expected, this @@ -491,7 +489,6 @@ def _parse_settings_bond_4(opts, iface): def _parse_settings_bond_5(opts, iface): - """ Filters given options and outputs valid settings for bond5. If an option has a value that is not expected, this @@ -511,7 +508,6 @@ def _parse_settings_bond_5(opts, iface): def _parse_settings_bond_6(opts, iface): - """ Filters given options and outputs valid settings for bond6. If an option has a value that is not expected, this @@ -531,7 +527,6 @@ def _parse_settings_bond_6(opts, iface): def _parse_settings_vlan(opts, iface): - """ Filters given options and outputs valid settings for a vlan """ diff --git a/salt/modules/rpmbuild_pkgbuild.py b/salt/modules/rpmbuild_pkgbuild.py index 1532817222f..9d205392b1b 100644 --- a/salt/modules/rpmbuild_pkgbuild.py +++ b/salt/modules/rpmbuild_pkgbuild.py @@ -9,7 +9,6 @@ environments. This also provides a function to generate yum repositories This module implements the pkgbuild interface """ - import errno import functools import logging diff --git a/salt/modules/salt_version.py b/salt/modules/salt_version.py index 99dae5f61a5..56dde8f708c 100644 --- a/salt/modules/salt_version.py +++ b/salt/modules/salt_version.py @@ -30,7 +30,6 @@ A simple example might be something like the following: """ - import logging import salt.utils.versions diff --git a/salt/modules/saltcheck.py b/salt/modules/saltcheck.py index 99672a3c133..77a010f3fb1 100644 --- a/salt/modules/saltcheck.py +++ b/salt/modules/saltcheck.py @@ -297,7 +297,6 @@ Supported assertions ``saltcheck.run_highstate_tests`` are needed. """ - import copy import logging import multiprocessing @@ -879,12 +878,12 @@ class SaltCheck: else: assertion_section_repr_title = "" assertion_section_repr_value = "" - value[ - "module.function [args]{}".format(assertion_section_repr_title) - ] = "{} {}{}".format( - mod_and_func, - dumps(args), - assertion_section_repr_value, + value["module.function [args]{}".format(assertion_section_repr_title)] = ( + "{} {}{}".format( + mod_and_func, + dumps(args), + assertion_section_repr_value, + ) ) value["saltcheck assertion"] = "{}{} {}".format( ("" if expected_return is None else "{} ".format(expected_return)), diff --git a/salt/modules/saltutil.py b/salt/modules/saltutil.py index dd3c89908c6..57b18d007f9 100644 --- a/salt/modules/saltutil.py +++ b/salt/modules/saltutil.py @@ -5,6 +5,7 @@ minion. :depends: - esky Python module for update functionality """ + import copy import fnmatch import logging @@ -1533,7 +1534,7 @@ def regen_keys(): path = os.path.join(__opts__["pki_dir"], fn_) try: os.remove(path) - except os.error: + except OSError: pass # TODO: move this into a channel function? Or auth? # create a channel again, this will force the key regen @@ -1639,9 +1640,11 @@ def _exec( old_ret, fcn_ret = fcn_ret, {} for key, value in old_ret.items(): fcn_ret[key] = { - "out": value.get("out", "highstate") - if isinstance(value, dict) - else "highstate", + "out": ( + value.get("out", "highstate") + if isinstance(value, dict) + else "highstate" + ), "ret": value, } diff --git a/salt/modules/schedule.py b/salt/modules/schedule.py index b8553bc6f78..1fab2038924 100644 --- a/salt/modules/schedule.py +++ b/salt/modules/schedule.py @@ -7,7 +7,6 @@ Requires that python-dateutil is installed on the minion. """ - import copy as pycopy import datetime import logging @@ -425,10 +424,10 @@ def delete(name, **kwargs): ) ret["changes"][name] = "removed" else: - ret[ - "comment" - ] = "Failed to delete job {} from schedule.".format( - name + ret["comment"] = ( + "Failed to delete job {} from schedule.".format( + name + ) ) return ret except KeyError: @@ -908,9 +907,9 @@ def enable_job(name, **kwargs): ret["changes"][name] = "enabled" else: ret["result"] = False - ret[ - "comment" - ] = "Failed to enable job {} in schedule.".format(name) + ret["comment"] = ( + "Failed to enable job {} in schedule.".format(name) + ) return ret except KeyError: # Effectively a no-op, since we can't really return without an event system @@ -971,9 +970,9 @@ def disable_job(name, **kwargs): ret["changes"][name] = "disabled" else: ret["result"] = False - ret[ - "comment" - ] = "Failed to disable job {} in schedule.".format(name) + ret["comment"] = ( + "Failed to disable job {} in schedule.".format(name) + ) return ret except KeyError: # Effectively a no-op, since we can't really return without an event system @@ -1397,9 +1396,9 @@ def postpone_job(name, current_time, new_time, **kwargs): ) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to postpone job {} in schedule.".format(name) + ret["comment"] = ( + "Failed to postpone job {} in schedule.".format(name) + ) return ret except KeyError: # Effectively a no-op, since we can't really return without an event system @@ -1486,9 +1485,9 @@ def skip_job(name, current_time, **kwargs): ) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to skip job {} in schedule.".format(name) + ret["comment"] = ( + "Failed to skip job {} in schedule.".format(name) + ) return ret except KeyError: # Effectively a no-op, since we can't really return without an event system @@ -1528,9 +1527,9 @@ def show_next_fire_time(name, **kwargs): except KeyError: # Effectively a no-op, since we can't really return without an event system ret = {} - ret[ - "comment" - ] = "Event module not available. Schedule show next fire time failed." + ret["comment"] = ( + "Event module not available. Schedule show next fire time failed." + ) ret["result"] = True return ret @@ -1555,9 +1554,11 @@ def job_status(name, time_fmt="%Y-%m-%dT%H:%M:%S"): def convert_datetime_objects_in_dict_to_string(data_dict, time_fmt): return { - key: value.strftime(time_fmt) - if isinstance(value, datetime.datetime) - else value + key: ( + value.strftime(time_fmt) + if isinstance(value, datetime.datetime) + else value + ) for key, value in data_dict.items() } diff --git a/salt/modules/scp_mod.py b/salt/modules/scp_mod.py index 4121bdbf4a7..e193b1c9816 100644 --- a/salt/modules/scp_mod.py +++ b/salt/modules/scp_mod.py @@ -55,7 +55,7 @@ def _prepare_connection(**kwargs): paramiko_kwargs, scp_kwargs = _select_kwargs(**kwargs) ssh = paramiko.SSHClient() if paramiko_kwargs.pop("auto_add_policy", False): - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec ssh.connect(**paramiko_kwargs) scp_client = scp.SCPClient(ssh.get_transport(), **scp_kwargs) return scp_client diff --git a/salt/modules/sdb.py b/salt/modules/sdb.py index 6dc4457b1f8..1182d6dc934 100644 --- a/salt/modules/sdb.py +++ b/salt/modules/sdb.py @@ -3,7 +3,6 @@ Module for Manipulating Data via the Salt DB API ================================================ """ - import salt.utils.sdb __func_alias__ = { diff --git a/salt/modules/seed.py b/salt/modules/seed.py index 7b985249cac..9bce998fd38 100644 --- a/salt/modules/seed.py +++ b/salt/modules/seed.py @@ -2,7 +2,6 @@ Virtual machine image management tools """ - import logging import os import shutil diff --git a/salt/modules/selinux.py b/salt/modules/selinux.py index 552ec282ff2..71dae99a7a0 100644 --- a/salt/modules/selinux.py +++ b/salt/modules/selinux.py @@ -10,7 +10,6 @@ Execute calls on selinux proper packages are installed. """ - import os import re diff --git a/salt/modules/sensehat.py b/salt/modules/sensehat.py index d5ba0b5f1f1..404f469933d 100644 --- a/salt/modules/sensehat.py +++ b/salt/modules/sensehat.py @@ -19,7 +19,6 @@ Example: """ - import logging try: diff --git a/salt/modules/serverdensity_device.py b/salt/modules/serverdensity_device.py index f55815fb07a..23c228ea706 100644 --- a/salt/modules/serverdensity_device.py +++ b/salt/modules/serverdensity_device.py @@ -5,7 +5,6 @@ Wrapper around Server Density API .. versionadded:: 2014.7.0 """ - import logging import os import tempfile diff --git a/salt/modules/slack_notify.py b/salt/modules/slack_notify.py index d0d32fabe18..9ac29929bd6 100644 --- a/salt/modules/slack_notify.py +++ b/salt/modules/slack_notify.py @@ -15,7 +15,6 @@ Module for sending messages to Slack api_key: peWcBiMOS9HrZG15peWcBiMOS9HrZG15 """ - import logging import urllib.parse diff --git a/salt/modules/slsutil.py b/salt/modules/slsutil.py index fe7ba15f336..df78b727f79 100644 --- a/salt/modules/slsutil.py +++ b/salt/modules/slsutil.py @@ -2,7 +2,6 @@ Utility functions for use with or in SLS files """ - import os import posixpath import textwrap diff --git a/salt/modules/smartos_nictagadm.py b/salt/modules/smartos_nictagadm.py index 99d09826e28..9112b44efa9 100644 --- a/salt/modules/smartos_nictagadm.py +++ b/salt/modules/smartos_nictagadm.py @@ -170,9 +170,11 @@ def add(name, mac, mtu=1500): return True else: return { - "Error": "failed to create nictag." - if "stderr" not in res and res["stderr"] == "" - else res["stderr"] + "Error": ( + "failed to create nictag." + if "stderr" not in res and res["stderr"] == "" + else res["stderr"] + ) } @@ -226,9 +228,11 @@ def update(name, mac=None, mtu=None): return True else: return { - "Error": "failed to update nictag." - if "stderr" not in res and res["stderr"] == "" - else res["stderr"] + "Error": ( + "failed to update nictag." + if "stderr" not in res and res["stderr"] == "" + else res["stderr"] + ) } @@ -259,7 +263,9 @@ def delete(name, force=False): return True else: return { - "Error": "failed to delete nictag." - if "stderr" not in res and res["stderr"] == "" - else res["stderr"] + "Error": ( + "failed to delete nictag." + if "stderr" not in res and res["stderr"] == "" + else res["stderr"] + ) } diff --git a/salt/modules/smf_service.py b/salt/modules/smf_service.py index 5c3d948b9d9..f45ba48af75 100644 --- a/salt/modules/smf_service.py +++ b/salt/modules/smf_service.py @@ -9,7 +9,6 @@ that use SMF also. (e.g. SmartOS) `. """ - import fnmatch import re diff --git a/salt/modules/smtp.py b/salt/modules/smtp.py index 8eaa6bb0a73..acfa0d0d639 100644 --- a/salt/modules/smtp.py +++ b/salt/modules/smtp.py @@ -40,7 +40,6 @@ Module for Sending Messages via SMTP """ - import logging import os import socket diff --git a/salt/modules/snapper.py b/salt/modules/snapper.py index 4968dbc329d..f5781a1a64f 100644 --- a/salt/modules/snapper.py +++ b/salt/modules/snapper.py @@ -11,6 +11,7 @@ Module to manage filesystem snapshots with snapper :maturity: new :platform: Linux """ + import difflib import logging import os @@ -524,9 +525,9 @@ def modify_snapshot( try: # Updating only the explicitly provided attributes by the user updated_opts = { - "description": description - if description is not None - else snapshot["description"], + "description": ( + description if description is not None else snapshot["description"] + ), "cleanup": cleanup if cleanup is not None else snapshot["cleanup"], "userdata": userdata if userdata is not None else snapshot["userdata"], } diff --git a/salt/modules/solaris_user.py b/salt/modules/solaris_user.py index e8d7d0b2bc4..f2c45f809b5 100644 --- a/salt/modules/solaris_user.py +++ b/salt/modules/solaris_user.py @@ -10,7 +10,6 @@ Manage users with the useradd command """ - import copy import logging diff --git a/salt/modules/solr.py b/salt/modules/solr.py index 373aee65b20..fca581922f1 100644 --- a/salt/modules/solr.py +++ b/salt/modules/solr.py @@ -58,7 +58,6 @@ verbose : True Get verbose output """ - import os import urllib.request diff --git a/salt/modules/splunk_search.py b/salt/modules/splunk_search.py index be9a50c28e5..e0d101cb2f3 100644 --- a/salt/modules/splunk_search.py +++ b/salt/modules/splunk_search.py @@ -286,7 +286,7 @@ def list_all( d = [{"name": name}] # add the rest of the splunk settings, ignoring any defaults description = "" - for (k, v) in sorted(search.content.items()): + for k, v in sorted(search.content.items()): if k in readonly_keys: continue if k.startswith("display."): diff --git a/salt/modules/state.py b/salt/modules/state.py index ca86bcc62dc..20e1e67a24b 100644 --- a/salt/modules/state.py +++ b/salt/modules/state.py @@ -2345,7 +2345,7 @@ def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): return {} elif "..{}".format(os.sep) in salt.utils.stringutils.to_unicode(member.path): return {} - s_pkg.extractall(root) + s_pkg.extractall(root) # nosec s_pkg.close() lowstate_json = os.path.join(root, "lowstate.json") with salt.utils.files.fopen(lowstate_json, "r") as fp_: diff --git a/salt/modules/statuspage.py b/salt/modules/statuspage.py index 0bfbd2798e0..4670d628151 100644 --- a/salt/modules/statuspage.py +++ b/salt/modules/statuspage.py @@ -18,7 +18,6 @@ In the minion configuration file, the following block is required: .. versionadded:: 2017.7.0 """ - import logging # import third party diff --git a/salt/modules/supervisord.py b/salt/modules/supervisord.py index eee4a9f42cf..90754afc70a 100644 --- a/salt/modules/supervisord.py +++ b/salt/modules/supervisord.py @@ -3,7 +3,6 @@ Provide the service module for system supervisord or supervisord in a virtualenv """ - import configparser import os diff --git a/salt/modules/syslog_ng.py b/salt/modules/syslog_ng.py index 9e8e8829df7..5df09f233b4 100644 --- a/salt/modules/syslog_ng.py +++ b/salt/modules/syslog_ng.py @@ -24,7 +24,6 @@ configuration file. """ - import logging import os import os.path diff --git a/salt/modules/system_profiler.py b/salt/modules/system_profiler.py index 5cbb4998a8c..aa3af692a37 100644 --- a/salt/modules/system_profiler.py +++ b/salt/modules/system_profiler.py @@ -8,7 +8,6 @@ information about package receipts and installed applications. """ - import plistlib import subprocess diff --git a/salt/modules/textfsm_mod.py b/salt/modules/textfsm_mod.py index 0e0d390b87d..bcade66de15 100644 --- a/salt/modules/textfsm_mod.py +++ b/salt/modules/textfsm_mod.py @@ -195,20 +195,20 @@ def extract(template_path, raw_text=None, raw_text_file=None, saltenv="base"): fsm_handler = textfsm.TextFSM(tpl_file_handle) except textfsm.TextFSMTemplateError as tfte: log.error("Unable to parse the TextFSM template", exc_info=True) - ret[ - "comment" - ] = "Unable to parse the TextFSM template from {}: {}. Please check the logs.".format( - template_path, tfte + ret["comment"] = ( + "Unable to parse the TextFSM template from {}: {}. Please check the logs.".format( + template_path, tfte + ) ) return ret if not raw_text and raw_text_file: log.debug("Trying to read the raw input from %s", raw_text_file) raw_text = __salt__["cp.get_file_str"](raw_text_file, saltenv=saltenv) if raw_text is False: - ret[ - "comment" - ] = "Unable to read from {}. Please specify a valid input file or text.".format( - raw_text_file + ret["comment"] = ( + "Unable to read from {}. Please specify a valid input file or text.".format( + raw_text_file + ) ) log.error(ret["comment"]) return ret @@ -393,17 +393,17 @@ def index( ) platform = __grains__.get(platform_grain_name) if not platform: - ret[ - "comment" - ] = "Unable to identify the platform name using the {} grain.".format( - platform_grain_name + ret["comment"] = ( + "Unable to identify the platform name using the {} grain.".format( + platform_grain_name + ) ) return ret log.info("Using platform: %s", platform) else: - ret[ - "comment" - ] = "No platform specified, no platform grain identifier configured." + ret["comment"] = ( + "No platform specified, no platform grain identifier configured." + ) log.error(ret["comment"]) return ret if not textfsm_path: @@ -431,10 +431,10 @@ def index( ) log.debug("Cache fun return:\n%s", textfsm_cachedir_ret) if not textfsm_cachedir_ret: - ret[ - "comment" - ] = "Unable to fetch from {}. Is the TextFSM path correctly specified?".format( - textfsm_path + ret["comment"] = ( + "Unable to fetch from {}. Is the TextFSM path correctly specified?".format( + textfsm_path + ) ) log.error(ret["comment"]) return ret @@ -457,10 +457,10 @@ def index( log.debug("Processing the output from %s", output_file) output = __salt__["cp.get_file_str"](output_file, saltenv=saltenv) if output is False: - ret[ - "comment" - ] = "Unable to read from {}. Please specify a valid file or text.".format( - output_file + ret["comment"] = ( + "Unable to read from {}. Please specify a valid file or text.".format( + output_file + ) ) log.error(ret["comment"]) return ret diff --git a/salt/modules/timezone.py b/salt/modules/timezone.py index 4904c8dcc6e..26d37943987 100644 --- a/salt/modules/timezone.py +++ b/salt/modules/timezone.py @@ -2,7 +2,6 @@ Module for managing timezone on POSIX-like systems. """ - import errno import filecmp import logging diff --git a/salt/modules/tls.py b/salt/modules/tls.py index b74b765cfbb..d54922a26c9 100644 --- a/salt/modules/tls.py +++ b/salt/modules/tls.py @@ -1929,10 +1929,10 @@ def revoke_cert( ) except ValueError: ret["retcode"] = 1 - ret[ - "comment" - ] = "Revocation date '{}' does not matchformat '{}'".format( - revoke_date, two_digit_year_fmt + ret["comment"] = ( + "Revocation date '{}' does not matchformat '{}'".format( + revoke_date, two_digit_year_fmt + ) ) return ret elif index_serial_subject in line: diff --git a/salt/modules/travisci.py b/salt/modules/travisci.py index 70672403b5b..100890e103a 100644 --- a/salt/modules/travisci.py +++ b/salt/modules/travisci.py @@ -3,6 +3,7 @@ Commands for working with travisci. :depends: pyOpenSSL >= 16.0.0 """ + import base64 import urllib.parse diff --git a/salt/modules/tuned.py b/salt/modules/tuned.py index 73742a9d54e..8db9ea83e98 100644 --- a/salt/modules/tuned.py +++ b/salt/modules/tuned.py @@ -7,7 +7,6 @@ Interface to Red Hat tuned-adm module :platform: Linux """ - import re import salt.utils.path diff --git a/salt/modules/uptime.py b/salt/modules/uptime.py index 294e91aeee4..34ebff403a1 100644 --- a/salt/modules/uptime.py +++ b/salt/modules/uptime.py @@ -3,7 +3,6 @@ Wrapper around uptime API ========================= """ - import logging from salt.exceptions import CommandExecutionError diff --git a/salt/modules/vault.py b/salt/modules/vault.py index 8abd7bb04d7..8dc2e5868d0 100644 --- a/salt/modules/vault.py +++ b/salt/modules/vault.py @@ -212,6 +212,7 @@ Functions to interact with Hashicorp Vault. .. _vault-setup: """ + import logging import os diff --git a/salt/modules/vboxmanage.py b/salt/modules/vboxmanage.py index 635734466a2..39ca6ecb3e6 100644 --- a/salt/modules/vboxmanage.py +++ b/salt/modules/vboxmanage.py @@ -15,7 +15,6 @@ The default for this setting is ``False``. :depends: virtualbox """ - import logging import os.path import re diff --git a/salt/modules/victorops.py b/salt/modules/victorops.py index c5288355579..3f41a0b8ba4 100644 --- a/salt/modules/victorops.py +++ b/salt/modules/victorops.py @@ -11,7 +11,6 @@ Requires an ``api_key`` in ``/etc/salt/minion``: api_key: '280d4699-a817-4719-ba6f-ca56e573e44f' """ - import datetime import logging import time diff --git a/salt/modules/virt.py b/salt/modules/virt.py index 0f11dbde206..f5c58f235a0 100644 --- a/salt/modules/virt.py +++ b/salt/modules/virt.py @@ -116,6 +116,7 @@ ZB 10**21 YB 10**24 ====== ======= """ + # Special Thanks to Michael Dehann, many of the concepts, and a few structures # of his in the virt func module have been used @@ -322,9 +323,9 @@ def _parse_qemu_img_info(info): "file format": disk_infos["format"], "disk size": disk_infos["actual-size"], "virtual size": disk_infos["virtual-size"], - "cluster size": disk_infos["cluster-size"] - if "cluster-size" in disk_infos - else None, + "cluster size": ( + disk_infos["cluster-size"] if "cluster-size" in disk_infos else None + ), } if "full-backing-filename" in disk_infos.keys(): @@ -554,9 +555,9 @@ def _get_disks(conn, dom): "file": backing_path.text } if backing_format is not None: - extra_properties["backing file"][ - "file format" - ] = backing_format.get("type") + extra_properties["backing file"]["file format"] = ( + backing_format.get("type") + ) except libvirt.libvirtError: # The volume won't be found if the pool is not started, just output less infos log.info( @@ -773,7 +774,7 @@ def _migrate(dom, dst_uri, **kwargs): "comp_xbzrle_cache": libvirt.VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE, } - for (comp_option, param_key) in comp_options.items(): + for comp_option, param_key in comp_options.items(): comp_option_value = kwargs.get(comp_option) if comp_option_value: try: @@ -1297,9 +1298,11 @@ def _gen_pool_xml( ): source = { "devices": source_devices or [], - "dir": source_dir - if source_format != "cifs" or not source_dir - else source_dir.lstrip("/"), + "dir": ( + source_dir + if source_format != "cifs" or not source_dir + else source_dir.lstrip("/") + ), "adapter": source_adapter, "hosts": [ {"name": host[0], "port": host[1] if len(host) > 1 else None} @@ -2975,12 +2978,16 @@ def _nics_equal(nic1, nic2): } return { "type": source_type, - "source": source_getters[source_type](source_node) - if source_node is not None - else None, - "model": nic.find("model").attrib["type"] - if nic.find("model") is not None - else None, + "source": ( + source_getters[source_type](source_node) + if source_node is not None + else None + ), + "model": ( + nic.find("model").attrib["type"] + if nic.find("model") is not None + else None + ), } def _get_mac(nic): @@ -3228,12 +3235,16 @@ def _serial_or_concole_equal(old, new): """ return { "type": item.attrib["type"], - "port": item.find("source").get("service") - if item.find("source") is not None - else None, - "protocol": item.find("protocol").get("type") - if item.find("protocol") is not None - else None, + "port": ( + item.find("source").get("service") + if item.find("source") is not None + else None + ), + "protocol": ( + item.find("protocol").get("type") + if item.find("protocol") is not None + else None + ), } return _filter_serial_or_concole(old) == _filter_serial_or_concole(new) @@ -6438,15 +6449,19 @@ def _parse_caps_host(host): elif child.tag == "cpu": cpu = { - "arch": child.find("arch").text - if child.find("arch") is not None - else None, - "model": child.find("model").text - if child.find("model") is not None - else None, - "vendor": child.find("vendor").text - if child.find("vendor") is not None - else None, + "arch": ( + child.find("arch").text if child.find("arch") is not None else None + ), + "model": ( + child.find("model").text + if child.find("model") is not None + else None + ), + "vendor": ( + child.find("vendor").text + if child.find("vendor") is not None + else None + ), "features": [ feature.get("name") for feature in child.findall("feature") ], @@ -6492,12 +6507,14 @@ def _parse_caps_host(host): result["security"] = [ { - "model": secmodel.find("model").text - if secmodel.find("model") is not None - else None, - "doi": secmodel.find("doi").text - if secmodel.find("doi") is not None - else None, + "model": ( + secmodel.find("model").text + if secmodel.find("model") is not None + else None + ), + "doi": ( + secmodel.find("doi").text if secmodel.find("doi") is not None else None + ), "baselabels": [ {"type": label.get("type"), "label": label.text} for label in secmodel.findall("baselabel") @@ -6645,9 +6662,9 @@ def _parse_domain_caps(caps): result = { "emulator": caps.find("path").text if caps.find("path") is not None else None, "domain": caps.find("domain").text if caps.find("domain") is not None else None, - "machine": caps.find("machine").text - if caps.find("machine") is not None - else None, + "machine": ( + caps.find("machine").text if caps.find("machine") is not None else None + ), "arch": caps.find("arch").text if caps.find("arch") is not None else None, } @@ -8708,9 +8725,11 @@ def volume_infos(pool=None, volume=None, **kwargs): if backing_store_path is not None: backing_store = { "path": backing_store_path.text, - "format": backing_store_format.get("type") - if backing_store_format is not None - else None, + "format": ( + backing_store_format.get("type") + if backing_store_format is not None + else None + ), } format_node = vol_xml.find("./target/format") diff --git a/salt/modules/virtualenv_mod.py b/salt/modules/virtualenv_mod.py index 81c270196d2..e662b339214 100644 --- a/salt/modules/virtualenv_mod.py +++ b/salt/modules/virtualenv_mod.py @@ -4,7 +4,6 @@ Create virtualenv environments. .. versionadded:: 0.17.0 """ - import glob import logging import os diff --git a/salt/modules/vmctl.py b/salt/modules/vmctl.py index 6b3d7b8880c..01021c3225f 100644 --- a/salt/modules/vmctl.py +++ b/salt/modules/vmctl.py @@ -11,7 +11,6 @@ Manage vms running on the OpenBSD VMM hypervisor using vmctl(8). target machine. """ - import logging import re diff --git a/salt/modules/vsphere.py b/salt/modules/vsphere.py index 29aa68cf4da..95dc3e03c29 100644 --- a/salt/modules/vsphere.py +++ b/salt/modules/vsphere.py @@ -181,7 +181,6 @@ connection credentials are used instead of vCenter credentials, the ``host_names 6500 """ - import datetime import logging import sys @@ -9682,7 +9681,7 @@ def _create_scsi_devices(scsi_devices): log.trace("Creating SCSI devices %s", devs) # unitNumber for disk attachment, 0:0 1st 0 is the controller busNumber, # 2nd is the unitNumber - for (key, scsi_controller) in zip(keys, scsi_devices): + for key, scsi_controller in zip(keys, scsi_devices): # create the SCSI controller scsi_spec = _apply_scsi_controller( scsi_controller["adapter"], @@ -9730,9 +9729,9 @@ def _create_network_adapters(network_interfaces, parent=None): interface["switch_type"], network_adapter_label=interface["adapter"], operation="add", - connectable=interface["connectable"] - if "connectable" in interface - else None, + connectable=( + interface["connectable"] if "connectable" in interface else None + ), mac=interface["mac"], parent=parent, ) @@ -9800,15 +9799,17 @@ def _create_cd_drives(cd_drives, controllers=None, parent_ref=None): key, drive["device_type"], "add", - client_device=drive["client_device"] - if "client_device" in drive - else None, - datastore_iso_file=drive["datastore_iso_file"] - if "datastore_iso_file" in drive - else None, - connectable=drive["connectable"] - if "connectable" in drive - else None, + client_device=( + drive["client_device"] if "client_device" in drive else None + ), + datastore_iso_file=( + drive["datastore_iso_file"] + if "datastore_iso_file" in drive + else None + ), + connectable=( + drive["connectable"] if "connectable" in drive else None + ), controller_key=controller_key, parent_ref=parent_ref, ) @@ -10098,9 +10099,9 @@ def get_vm_config(name, datacenter=None, objects=True, service_instance=None): if isinstance(device, vim.vm.device.VirtualEthernetCard): interface = {} interface["adapter"] = device.deviceInfo.label - interface[ - "adapter_type" - ] = salt.utils.vmware.get_network_adapter_object_type(device) + interface["adapter_type"] = ( + salt.utils.vmware.get_network_adapter_object_type(device) + ) interface["connectable"] = { "allow_guest_control": device.connectable.allowGuestControl, "connected": device.connectable.connected, @@ -10438,12 +10439,16 @@ def _update_cd_drives(drives_old_new, controllers=None, parent=None): current_drive["key"], new_drive["device_type"], "edit", - client_device=new_drive["client_device"] - if "client_device" in new_drive - else None, - datastore_iso_file=new_drive["datastore_iso_file"] - if "datastore_iso_file" in new_drive - else None, + client_device=( + new_drive["client_device"] + if "client_device" in new_drive + else None + ), + datastore_iso_file=( + new_drive["datastore_iso_file"] + if "datastore_iso_file" in new_drive + else None + ), connectable=new_drive["connectable"], controller_key=controller_key, parent_ref=parent, diff --git a/salt/modules/webutil.py b/salt/modules/webutil.py index 42da8f330d4..746c9a7299b 100644 --- a/salt/modules/webutil.py +++ b/salt/modules/webutil.py @@ -7,7 +7,6 @@ The functions here will load inside the webutil module. This allows other functions that don't use htpasswd to use the webutil module name. """ - import logging import os diff --git a/salt/modules/win_autoruns.py b/salt/modules/win_autoruns.py index 14497199e25..940474138c1 100644 --- a/salt/modules/win_autoruns.py +++ b/salt/modules/win_autoruns.py @@ -3,7 +3,6 @@ Module for listing programs that automatically run on startup (very alpha...not tested on anything but my Win 7x64) """ - import os import salt.utils.platform diff --git a/salt/modules/win_dacl.py b/salt/modules/win_dacl.py index a084a75684f..d9114a56453 100644 --- a/salt/modules/win_dacl.py +++ b/salt/modules/win_dacl.py @@ -4,7 +4,6 @@ Manage DACLs on Windows :depends: - winreg Python module """ - import logging import os import re @@ -503,10 +502,10 @@ def add_ace(path, objectType, user, permission, acetype, propagation): ) ret["result"] = True except Exception as e: # pylint: disable=broad-except - ret[ - "comment" - ] = "An error occurred attempting to add the ace. The error was {}".format( - e + ret["comment"] = ( + "An error occurred attempting to add the ace. The error was {}".format( + e + ) ) ret["result"] = False return ret @@ -730,9 +729,9 @@ def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=F ret["result"] = True except Exception as e: # pylint: disable=broad-except ret["result"] = False - ret[ - "comment" - ] = "Error attempting to set the inheritance. The error was {}.".format(e) + ret["comment"] = ( + "Error attempting to set the inheritance. The error was {}.".format(e) + ) return ret @@ -818,9 +817,9 @@ def check_inheritance(path, objectType, user=None): dacls = sd.GetSecurityDescriptorDacl() except Exception as e: # pylint: disable=broad-except ret["result"] = False - ret[ - "comment" - ] = "Error obtaining the Security Descriptor or DACL of the path: {}.".format(e) + ret["comment"] = ( + "Error obtaining the Security Descriptor or DACL of the path: {}.".format(e) + ) return ret for counter in range(0, dacls.GetAceCount()): diff --git a/salt/modules/win_event.py b/salt/modules/win_event.py index f813abb329a..d8d9bde990b 100644 --- a/salt/modules/win_event.py +++ b/salt/modules/win_event.py @@ -2,6 +2,7 @@ A module for working with the Windows Event log system. .. versionadded:: 3006.0 """ + # https://docs.microsoft.com/en-us/windows/win32/eventlog/event-logging import collections diff --git a/salt/modules/win_iis.py b/salt/modules/win_iis.py index 3a2500d637b..68f67c01d9c 100644 --- a/salt/modules/win_iis.py +++ b/salt/modules/win_iis.py @@ -8,6 +8,7 @@ Microsoft IIS site management via WebAdministration powershell module .. versionadded:: 2016.3.0 """ + import decimal import logging import os diff --git a/salt/modules/win_lgpo.py b/salt/modules/win_lgpo.py index 1875edad440..f387eeebeb3 100644 --- a/salt/modules/win_lgpo.py +++ b/salt/modules/win_lgpo.py @@ -41,6 +41,7 @@ Current known limitations - struct - salt.utils.win_reg """ + import csv import ctypes import glob @@ -6938,9 +6939,9 @@ def _checkAllAdmxPolicies( TRUE_VALUE_XPATH, policy_file_data, ): - configured_elements[ - this_element_name - ] = True + configured_elements[this_element_name] = ( + True + ) log.trace( "element %s is configured true", child_item.attrib["id"], @@ -6957,9 +6958,9 @@ def _checkAllAdmxPolicies( FALSE_VALUE_XPATH, policy_file_data, ): - configured_elements[ - this_element_name - ] = False + configured_elements[this_element_name] = ( + False + ) policy_disabled_elements = ( policy_disabled_elements + 1 ) @@ -6981,9 +6982,9 @@ def _checkAllAdmxPolicies( TRUE_LIST_XPATH, policy_file_data, ): - configured_elements[ - this_element_name - ] = True + configured_elements[this_element_name] = ( + True + ) log.trace( "element %s is configured true", child_item.attrib["id"], @@ -7000,9 +7001,9 @@ def _checkAllAdmxPolicies( FALSE_LIST_XPATH, policy_file_data, ): - configured_elements[ - this_element_name - ] = False + configured_elements[this_element_name] = ( + False + ) policy_disabled_elements = ( policy_disabled_elements + 1 ) @@ -7102,9 +7103,9 @@ def _checkAllAdmxPolicies( ), policy_file_data, ) - configured_elements[ - this_element_name - ] = configured_value + configured_elements[this_element_name] = ( + configured_value + ) log.trace( "element %s is enabled, value == %s", child_item.attrib["id"], @@ -7224,9 +7225,9 @@ def _checkAllAdmxPolicies( policy_file_data, return_value_name=return_value_name, ) - configured_elements[ - this_element_name - ] = configured_value + configured_elements[this_element_name] = ( + configured_value + ) log.trace( "element %s is enabled values: %s", child_item.attrib["id"], @@ -9402,23 +9403,23 @@ def _get_policy_adm_setting( log.trace( "all valueList items exist in file" ) - configured_elements[ - this_element_name - ] = _getAdmlDisplayName( + configured_elements[this_element_name] = ( + _getAdmlDisplayName( + adml_xml_data=adml_policy_resources, + display_name=enum_item.attrib[ + "displayName" + ], + ) + ) + break + else: + configured_elements[this_element_name] = ( + _getAdmlDisplayName( adml_xml_data=adml_policy_resources, display_name=enum_item.attrib[ "displayName" ], ) - break - else: - configured_elements[ - this_element_name - ] = _getAdmlDisplayName( - adml_xml_data=adml_policy_resources, - display_name=enum_item.attrib[ - "displayName" - ], ) break elif etree.QName(child_item).localname == "list": @@ -9553,12 +9554,12 @@ def _get_policy_adm_setting( this_policy_namespace in policy_vals and this_policy_name in policy_vals[this_policy_namespace] ): - hierarchy.setdefault(this_policy_namespace, {})[ - this_policy_name - ] = _build_parent_list( - policy_definition=admx_policy, - return_full_policy_names=return_full_policy_names, - adml_language=adml_language, + hierarchy.setdefault(this_policy_namespace, {})[this_policy_name] = ( + _build_parent_list( + policy_definition=admx_policy, + return_full_policy_names=return_full_policy_names, + adml_language=adml_language, + ) ) if policy_vals and return_full_policy_names and not hierarchical_return: diff --git a/salt/modules/win_lgpo_reg.py b/salt/modules/win_lgpo_reg.py index b3e1fef58e4..3ee147aa812 100644 --- a/salt/modules/win_lgpo_reg.py +++ b/salt/modules/win_lgpo_reg.py @@ -54,6 +54,7 @@ The same values can also be used to create states for setting these policies. you will have to find the values needed to set them with this module using a different method. """ + import logging import salt.utils.platform diff --git a/salt/modules/win_license.py b/salt/modules/win_license.py index 669521368ef..5311418abd0 100644 --- a/salt/modules/win_license.py +++ b/salt/modules/win_license.py @@ -6,7 +6,6 @@ This module allows you to manage windows licensing via slmgr.vbs salt '*' license.install XXXXX-XXXXX-XXXXX-XXXXX-XXXXX """ - import logging import re diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index fec5ab56a9c..bc421a1f9bd 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -36,7 +36,6 @@ old. """ - import collections import datetime import errno diff --git a/salt/modules/win_servermanager.py b/salt/modules/win_servermanager.py index f26ce42183d..cab3d996e82 100644 --- a/salt/modules/win_servermanager.py +++ b/salt/modules/win_servermanager.py @@ -7,7 +7,6 @@ available and installed roles/features. Can install and remove roles/features. :depends: PowerShell module ``ServerManager`` """ - import logging import shlex diff --git a/salt/modules/win_service.py b/salt/modules/win_service.py index f788f7559d9..604a22fd5bd 100644 --- a/salt/modules/win_service.py +++ b/salt/modules/win_service.py @@ -5,6 +5,7 @@ Windows Service module. Rewritten to use PyWin32 """ + import fnmatch import logging import re diff --git a/salt/modules/win_shortcut.py b/salt/modules/win_shortcut.py index 97048b45560..6bdb679d385 100644 --- a/salt/modules/win_shortcut.py +++ b/salt/modules/win_shortcut.py @@ -6,6 +6,7 @@ url shortcuts. .. versionadded:: 3005 """ + # https://docs.microsoft.com/en-us/troubleshoot/windows-client/admin-development/create-desktop-shortcut-with-wsh # https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/windows-scripting/f5y78918(v=vs.84) import logging diff --git a/salt/modules/win_status.py b/salt/modules/win_status.py index 033af16e063..8b349a79bcc 100644 --- a/salt/modules/win_status.py +++ b/salt/modules/win_status.py @@ -7,6 +7,7 @@ or for problem solving if your minion is having problems. :depends: - wmi """ + import ctypes import datetime import logging diff --git a/salt/modules/win_task.py b/salt/modules/win_task.py index 2e8750ddb97..2b23e381bc0 100644 --- a/salt/modules/win_task.py +++ b/salt/modules/win_task.py @@ -1582,9 +1582,9 @@ def info(name, location="\\"): trigger["repeat_interval"] = _reverse_lookup( duration, triggerObj.Repetition.Interval ) - trigger[ - "repeat_stop_at_duration_end" - ] = triggerObj.Repetition.StopAtDurationEnd + trigger["repeat_stop_at_duration_end"] = ( + triggerObj.Repetition.StopAtDurationEnd + ) triggers.append(trigger) properties["settings"] = settings diff --git a/salt/modules/win_timezone.py b/salt/modules/win_timezone.py index d8c3c82bb23..d95f7338bfe 100644 --- a/salt/modules/win_timezone.py +++ b/salt/modules/win_timezone.py @@ -1,6 +1,7 @@ """ Module for managing timezone on Windows systems. """ + import logging from datetime import datetime diff --git a/salt/modules/win_wua.py b/salt/modules/win_wua.py index 1393fc6efaf..9c4a0bc8f2d 100644 --- a/salt/modules/win_wua.py +++ b/salt/modules/win_wua.py @@ -54,6 +54,7 @@ Group Policy using the ``lgpo`` module. :depends: salt.utils.win_update """ + import logging import salt.utils.platform diff --git a/salt/modules/win_wusa.py b/salt/modules/win_wusa.py index e6a8730f009..c4c5f21ea01 100644 --- a/salt/modules/win_wusa.py +++ b/salt/modules/win_wusa.py @@ -8,7 +8,6 @@ Microsoft Update files management via wusa.exe .. versionadded:: 2018.3.4 """ - import logging import os diff --git a/salt/modules/winrepo.py b/salt/modules/winrepo.py index 12d4a0b4c5f..227e81ee2e8 100644 --- a/salt/modules/winrepo.py +++ b/salt/modules/winrepo.py @@ -6,6 +6,7 @@ Module to manage Windows software repo on a Standalone Minion For documentation on Salt's Windows Repo feature, see :ref:`here `. """ + import logging import os diff --git a/salt/modules/x509_v2.py b/salt/modules/x509_v2.py index f0b9b40130e..72e8f466bb7 100644 --- a/salt/modules/x509_v2.py +++ b/salt/modules/x509_v2.py @@ -132,6 +132,7 @@ Note that when a ``ca_server`` is involved, both peers must use the updated modu .. _x509-setup: """ + import base64 import copy import datetime @@ -733,9 +734,11 @@ def encode_certificate( else: cipher = serialization.BestAvailableEncryption(pkcs12_passphrase) crt_bytes = serialization.pkcs12.serialize_key_and_certificates( - name=salt.utils.stringutils.to_bytes(pkcs12_friendlyname) - if pkcs12_friendlyname - else None, + name=( + salt.utils.stringutils.to_bytes(pkcs12_friendlyname) + if pkcs12_friendlyname + else None + ), key=private_key, cert=cert, cas=append_certs, diff --git a/salt/modules/xmpp.py b/salt/modules/xmpp.py index 5e058ff1324..944ef5c92af 100644 --- a/salt/modules/xmpp.py +++ b/salt/modules/xmpp.py @@ -34,7 +34,6 @@ Module for Sending Messages via XMPP (a.k.a. Jabber) """ - import logging HAS_LIBS = False diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index fa8e0eeffe3..4e5cd8416d8 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -17,7 +17,6 @@ Support for YUM/DNF """ - import configparser import contextlib import datetime @@ -2411,9 +2410,9 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 ret[target]["changes"]["new"] = "" ret[target]["changes"]["old"] = "hold" else: - ret[target][ - "comment" - ] = "Package {} was unable to be unheld.".format(target) + ret[target]["comment"] = ( + "Package {} was unable to be unheld.".format(target) + ) else: ret[target].update(result=True) ret[target]["comment"] = "Package {} is not being held.".format(target) diff --git a/salt/modules/zcbuildout.py b/salt/modules/zcbuildout.py index 3552d580890..e4a8b36e403 100644 --- a/salt/modules/zcbuildout.py +++ b/salt/modules/zcbuildout.py @@ -22,7 +22,6 @@ You have those following methods: * buildout """ - import copy import logging import os @@ -190,9 +189,9 @@ def _encode_status(status): logs = status["logs_by_level"].get(logger, [])[:] if logs: for i, log in enumerate(logs): - status["logs_by_level"][logger][ - i - ] = salt.utils.stringutils.to_unicode(log) + status["logs_by_level"][logger][i] = ( + salt.utils.stringutils.to_unicode(log) + ) return status diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py index 9d16fcb0b1b..5d3404a4ab1 100644 --- a/salt/modules/zypperpkg.py +++ b/salt/modules/zypperpkg.py @@ -11,7 +11,6 @@ Package support for openSUSE via the zypper package manager """ - import configparser import datetime import errno @@ -2322,10 +2321,10 @@ def unhold(name=None, pkgs=None, root=None, **kwargs): lock_ver = lock_ver.lstrip("= ") if version and lock_ver != version: ret[target]["result"] = False - ret[target][ - "comment" - ] = "Unable to unhold package {} as it is held with the other version.".format( - target + ret[target]["comment"] = ( + "Unable to unhold package {} as it is held with the other version.".format( + target + ) ) else: removed.append( @@ -2892,10 +2891,10 @@ def download(*packages, **kwargs): if pkg_ret: failed = [pkg for pkg in packages if pkg not in pkg_ret] if failed: - pkg_ret[ - "_error" - ] = "The following package(s) failed to download: {}".format( - ", ".join(failed) + pkg_ret["_error"] = ( + "The following package(s) failed to download: {}".format( + ", ".join(failed) + ) ) return pkg_ret diff --git a/salt/netapi/__init__.py b/salt/netapi/__init__.py index a89c1a19af0..c0275c127fe 100644 --- a/salt/netapi/__init__.py +++ b/salt/netapi/__init__.py @@ -2,7 +2,6 @@ Make api awesomeness """ - import copy import inspect import logging diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index 3a4571968b4..52334728242 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -898,9 +898,11 @@ def hypermedia_handler(*args, **kwargs): ret = { "status": cherrypy.response.status, - "return": "{}".format(traceback.format_exc()) - if cherrypy.config["debug"] - else "An unexpected error occurred", + "return": ( + "{}".format(traceback.format_exc()) + if cherrypy.config["debug"] + else "An unexpected error occurred" + ), } # Raises 406 if requested content-type is not supported @@ -1747,9 +1749,9 @@ class Keys(LowDataAdapter): tarball.close() headers = cherrypy.response.headers - headers[ - "Content-Disposition" - ] = 'attachment; filename="saltkeys-{}.tar"'.format(lowstate[0]["id_"]) + headers["Content-Disposition"] = ( + 'attachment; filename="saltkeys-{}.tar"'.format(lowstate[0]["id_"]) + ) headers["Content-Type"] = "application/x-tar" headers["Content-Length"] = len(fileobj.getvalue()) headers["Cache-Control"] = "no-cache" diff --git a/salt/output/__init__.py b/salt/output/__init__.py index 32d0560772d..a8c318579df 100644 --- a/salt/output/__init__.py +++ b/salt/output/__init__.py @@ -3,7 +3,6 @@ Used to manage the outputter system. This package is the modular system used for managing outputters. """ - import errno import io import logging diff --git a/salt/output/highstate.py b/salt/output/highstate.py index 6c852554fc4..76ebac0d6d0 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -123,7 +123,6 @@ Example output with no special settings in configuration files: Total: 0 """ - import collections import logging import pprint diff --git a/salt/output/overstatestage.py b/salt/output/overstatestage.py index 3f80e0871f6..a8facfcb308 100644 --- a/salt/output/overstatestage.py +++ b/salt/output/overstatestage.py @@ -6,7 +6,6 @@ This outputter is used to display :ref:`Orchestrate Runner ` stages, and should not be called directly. """ - import salt.utils.color # [{'group2': {'match': ['fedora17-2', 'fedora17-3'], diff --git a/salt/output/pony.py b/salt/output/pony.py index f1d6d1e3d9a..60e47ba281a 100644 --- a/salt/output/pony.py +++ b/salt/output/pony.py @@ -46,7 +46,6 @@ CLI Example: salt '*' foo.bar --out=pony """ - import subprocess import salt.utils.data diff --git a/salt/output/progress.py b/salt/output/progress.py index 1d00a379cc4..302ce1f1467 100644 --- a/salt/output/progress.py +++ b/salt/output/progress.py @@ -2,7 +2,6 @@ Display return data as a progress bar """ - try: import progressbar diff --git a/salt/output/raw.py b/salt/output/raw.py index d2e68041180..a3005948e42 100644 --- a/salt/output/raw.py +++ b/salt/output/raw.py @@ -24,7 +24,6 @@ Example output: {'myminion': {'foo': {'list': ['Hello', 'World'], 'bar': 'baz', 'dictionary': {'abc': 123, 'def': 456}}}} """ - import salt.utils.stringutils diff --git a/salt/output/table_out.py b/salt/output/table_out.py index 730e0cb2df8..8bc94eb3e46 100644 --- a/salt/output/table_out.py +++ b/salt/output/table_out.py @@ -42,7 +42,6 @@ CLI Example: salt '*' foo.bar --out=table """ - import operator from functools import reduce # pylint: disable=redefined-builtin @@ -117,9 +116,9 @@ class TableDisplay: ) def wrap_onspace(self, text): - """ - When the text inside the column is longer then the width, will split by space and continue on the next line.""" + When the text inside the column is longer then the width, will split by space and continue on the next line. + """ def _truncate(line, word): return "{line}{part}{word}".format( @@ -136,7 +135,6 @@ class TableDisplay: return reduce(_truncate, text.split(" ")) def prepare_rows(self, rows, indent, has_header): - """Prepare rows content to be displayed.""" out = [] @@ -198,7 +196,6 @@ class TableDisplay: return out def display_rows(self, rows, labels, indent): - """Prepares row content and displays.""" out = [] @@ -245,7 +242,6 @@ class TableDisplay: return self.prepare_rows(labels_and_rows, indent + 4, has_header) def display(self, ret, indent, out, rows_key=None, labels_key=None): - """Display table(s).""" rows = [] diff --git a/salt/pillar/cmd_yamlex.py b/salt/pillar/cmd_yamlex.py index c014370f1d0..bf6d40a65fa 100644 --- a/salt/pillar/cmd_yamlex.py +++ b/salt/pillar/cmd_yamlex.py @@ -4,7 +4,6 @@ Execute a command and read the output as YAMLEX. The YAMLEX data is then directly overlaid onto the minion's Pillar data """ - import logging from salt.serializers.yamlex import deserialize diff --git a/salt/pillar/cobbler.py b/salt/pillar/cobbler.py index 5103d91f419..41425c12734 100644 --- a/salt/pillar/cobbler.py +++ b/salt/pillar/cobbler.py @@ -25,7 +25,7 @@ Module Documentation """ import logging -import xmlrpc.client +import xmlrpc.client # nosec __opts__ = { "cobbler.url": "http://localhost/cobbler_api", diff --git a/salt/pillar/consul_pillar.py b/salt/pillar/consul_pillar.py index 2b28b297353..3e4ff329329 100644 --- a/salt/pillar/consul_pillar.py +++ b/salt/pillar/consul_pillar.py @@ -315,7 +315,6 @@ def pillar_format(ret, keys, value, expand_keys): def get_conn(opts, profile): - """ Return a client object for accessing consul """ diff --git a/salt/pillar/ec2_pillar.py b/salt/pillar/ec2_pillar.py index e197940908b..c4fe8e17519 100644 --- a/salt/pillar/ec2_pillar.py +++ b/salt/pillar/ec2_pillar.py @@ -53,7 +53,6 @@ returns a list of key/value pairs for all of the EC2 tags assigned to the instance. """ - import logging import re diff --git a/salt/pillar/extra_minion_data_in_pillar.py b/salt/pillar/extra_minion_data_in_pillar.py index 170cdb6fa08..457c79462b0 100644 --- a/salt/pillar/extra_minion_data_in_pillar.py +++ b/salt/pillar/extra_minion_data_in_pillar.py @@ -27,6 +27,7 @@ Complete example in etc/salt/master include: """ + import logging # Set up logging diff --git a/salt/pillar/gpg.py b/salt/pillar/gpg.py index 28497a51f2c..8652a18b2a5 100644 --- a/salt/pillar/gpg.py +++ b/salt/pillar/gpg.py @@ -15,7 +15,6 @@ Set ``gpg_keydir`` in your config to adjust the homedir the renderer uses. """ - import salt.loader diff --git a/salt/pillar/hiera.py b/salt/pillar/hiera.py index 19e9c78c034..55b8305db72 100644 --- a/salt/pillar/hiera.py +++ b/salt/pillar/hiera.py @@ -2,7 +2,6 @@ Use hiera data as a Pillar source """ - import logging import salt.utils.path diff --git a/salt/pillar/http_json.py b/salt/pillar/http_json.py index f79f8655020..acebb3aaf89 100644 --- a/salt/pillar/http_json.py +++ b/salt/pillar/http_json.py @@ -48,7 +48,6 @@ Module Documentation ==================== """ - import logging import re import urllib.parse diff --git a/salt/pillar/http_yaml.py b/salt/pillar/http_yaml.py index 434d5b8a892..ff791c6cd8c 100644 --- a/salt/pillar/http_yaml.py +++ b/salt/pillar/http_yaml.py @@ -43,6 +43,7 @@ in <> brackets) in the url in order to populate pillar data based on the grain v Module Documentation ==================== """ + import logging import re import urllib.parse diff --git a/salt/pillar/libvirt.py b/salt/pillar/libvirt.py index 072293df251..ae957639b7d 100644 --- a/salt/pillar/libvirt.py +++ b/salt/pillar/libvirt.py @@ -4,6 +4,7 @@ generated using the libvirt key runner :depends: certtool """ + import os import subprocess diff --git a/salt/pillar/makostack.py b/salt/pillar/makostack.py index b689bd5f4cd..ef3b3d64cb5 100644 --- a/salt/pillar/makostack.py +++ b/salt/pillar/makostack.py @@ -372,7 +372,6 @@ You can also select a custom merging strategy using a ``__`` object in a list: +----------------+-------------------------+-------------------------+ """ - import functools import logging import os diff --git a/salt/pillar/nacl.py b/salt/pillar/nacl.py index 67f8c6fd25a..5e0a03512d7 100644 --- a/salt/pillar/nacl.py +++ b/salt/pillar/nacl.py @@ -18,7 +18,6 @@ Set ``nacl.config`` in your config. """ - import salt __virtualname__ = "nacl" diff --git a/salt/pillar/neutron.py b/salt/pillar/neutron.py index 738305b916b..2999f9a6b7c 100644 --- a/salt/pillar/neutron.py +++ b/salt/pillar/neutron.py @@ -42,7 +42,6 @@ name after the Keystone profile name: - neutron: my_openstack_config neutron_networks """ - import logging try: diff --git a/salt/pillar/reclass_adapter.py b/salt/pillar/reclass_adapter.py index 2f7e158ce75..f47b4c52de2 100644 --- a/salt/pillar/reclass_adapter.py +++ b/salt/pillar/reclass_adapter.py @@ -45,7 +45,6 @@ either let the master know via the ``PYTHONPATH`` environment variable, or by setting the configuration option, like in the example above. """ - # This file cannot be called reclass.py, because then the module import would # not work. Thanks to the __virtual__ function, however, the plugin still # responds to the name 'reclass'. diff --git a/salt/pillar/s3.py b/salt/pillar/s3.py index 6e97dfd33bd..7f08439f8e4 100644 --- a/salt/pillar/s3.py +++ b/salt/pillar/s3.py @@ -87,7 +87,6 @@ for each environment rather than specifying multiple_env. This is due to issue #22471 (https://github.com/saltstack/salt/issues/22471) """ - import logging import os import pickle @@ -144,7 +143,6 @@ def ext_pillar( path_style=False, https_enable=True, ): - """ Execute a command and read the output as YAML """ diff --git a/salt/pillar/saltclass.py b/salt/pillar/saltclass.py index 3354b1ae7ba..badf776eb0d 100644 --- a/salt/pillar/saltclass.py +++ b/salt/pillar/saltclass.py @@ -11,7 +11,6 @@ SaltClass Pillar Module For additional configuration instructions, see the :mod:`saltclass ` module """ - import logging import salt.utils.saltclass as sc diff --git a/salt/pillar/stack.py b/salt/pillar/stack.py index f5e2a07ea44..0d72444418d 100644 --- a/salt/pillar/stack.py +++ b/salt/pillar/stack.py @@ -373,6 +373,7 @@ You can also select a custom merging strategy using a ``__`` object in a list: | - root | - mat | | +----------------+-------------------------+-------------------------+ """ + import functools import glob import logging diff --git a/salt/pillar/varstack_pillar.py b/salt/pillar/varstack_pillar.py index 7f1d707b538..eebb12fda19 100644 --- a/salt/pillar/varstack_pillar.py +++ b/salt/pillar/varstack_pillar.py @@ -18,7 +18,6 @@ data to return as pillar information. From there you can take a look at the varstack on how this file is evaluated. """ - try: import varstack except ImportError: diff --git a/salt/pillar/vault.py b/salt/pillar/vault.py index 6388ab923dd..904c626b0e6 100644 --- a/salt/pillar/vault.py +++ b/salt/pillar/vault.py @@ -150,7 +150,6 @@ You can override the merging behavior per defined ext_pillar: merge_lists: false """ - import logging from requests.exceptions import HTTPError diff --git a/salt/proxy/cisconso.py b/salt/proxy/cisconso.py index aa97f37b1b5..8d9bd56c629 100644 --- a/salt/proxy/cisconso.py +++ b/salt/proxy/cisconso.py @@ -171,7 +171,6 @@ responding: salt test.ping """ - import logging from salt.exceptions import SaltSystemExit diff --git a/salt/proxy/esxcluster.py b/salt/proxy/esxcluster.py index 4448178398a..cbb15e587ff 100644 --- a/salt/proxy/esxcluster.py +++ b/salt/proxy/esxcluster.py @@ -149,6 +149,7 @@ Associated states are documented in Look there to find an example structure for Pillar as well as an example ``.sls`` file for configuring an ESX cluster from scratch. """ + import logging import os diff --git a/salt/proxy/esxdatacenter.py b/salt/proxy/esxdatacenter.py index 98b0be0e1d1..ff100786656 100644 --- a/salt/proxy/esxdatacenter.py +++ b/salt/proxy/esxdatacenter.py @@ -144,7 +144,6 @@ Look there to find an example structure for Pillar as well as an example ``.sls`` file for configuring an ESX datacenter from scratch. """ - import logging import os diff --git a/salt/proxy/esxi.py b/salt/proxy/esxi.py index af58e48185c..a7f6b1e90e4 100644 --- a/salt/proxy/esxi.py +++ b/salt/proxy/esxi.py @@ -277,7 +277,6 @@ for standing up an ESXi host from scratch. """ - import logging import os diff --git a/salt/proxy/esxvm.py b/salt/proxy/esxvm.py index ac46bdf304c..247aa078b47 100644 --- a/salt/proxy/esxvm.py +++ b/salt/proxy/esxvm.py @@ -144,7 +144,6 @@ Look there to find an example structure for Pillar as well as an example ``.sls`` file for configuring an ESX virtual machine from scratch. """ - import logging import os diff --git a/salt/proxy/rest_sample.py b/salt/proxy/rest_sample.py index 596e91494e3..4e66bbfd67e 100644 --- a/salt/proxy/rest_sample.py +++ b/salt/proxy/rest_sample.py @@ -192,7 +192,6 @@ def fix_outage(): def uptodate(name): - """ Call the REST endpoint to see if the packages on the "server" are up to date. """ @@ -205,7 +204,6 @@ def uptodate(name): def package_remove(name): - """ Remove a "package" on the REST server """ diff --git a/salt/proxy/restconf.py b/salt/proxy/restconf.py index d375894b368..31f214aa7cb 100644 --- a/salt/proxy/restconf.py +++ b/salt/proxy/restconf.py @@ -72,7 +72,6 @@ Proxy Pillar Example verify: false """ - import copy import json import logging diff --git a/salt/queues/pgjsonb_queue.py b/salt/queues/pgjsonb_queue.py index decade54234..aa42daa650d 100644 --- a/salt/queues/pgjsonb_queue.py +++ b/salt/queues/pgjsonb_queue.py @@ -38,7 +38,6 @@ Use the following Pg database schema: salt-run queue.process_queue test all backend=pgjsonb """ - import logging import sys from contextlib import contextmanager diff --git a/salt/renderers/cheetah.py b/salt/renderers/cheetah.py index d7351fa6af9..5cb8499e390 100644 --- a/salt/renderers/cheetah.py +++ b/salt/renderers/cheetah.py @@ -2,7 +2,6 @@ Cheetah Renderer for Salt """ - try: from Cheetah.Template import Template diff --git a/salt/renderers/dson.py b/salt/renderers/dson.py index 0a9597aa5f6..45d4f1ab252 100644 --- a/salt/renderers/dson.py +++ b/salt/renderers/dson.py @@ -11,7 +11,6 @@ This renderer requires `Dogeon`__ (installable via pip) .. __: https://github.com/soasme/dogeon """ - import logging try: diff --git a/salt/renderers/genshi.py b/salt/renderers/genshi.py index 9a9e57b6711..680da8bcbc7 100644 --- a/salt/renderers/genshi.py +++ b/salt/renderers/genshi.py @@ -2,7 +2,6 @@ Genshi Renderer for Salt """ - try: from genshi.template import MarkupTemplate # pylint: disable=no-name-in-module from genshi.template import NewTextTemplate # pylint: disable=no-name-in-module diff --git a/salt/renderers/gpg.py b/salt/renderers/gpg.py index 7218b613de5..f6569c6d637 100644 --- a/salt/renderers/gpg.py +++ b/salt/renderers/gpg.py @@ -335,7 +335,6 @@ In the Chlorine release, the default behavior will be reversed and an error message will be added to ``_errors`` by default. """ - import logging import os import re diff --git a/salt/renderers/hjson.py b/salt/renderers/hjson.py index f76f993dee6..84a7531af94 100644 --- a/salt/renderers/hjson.py +++ b/salt/renderers/hjson.py @@ -6,7 +6,6 @@ See the hjson_ documentation for more information .. _hjson: http://laktak.github.io/hjson/ """ - try: import hjson diff --git a/salt/renderers/jinja.py b/salt/renderers/jinja.py index 3ad9855805f..e19636dba00 100644 --- a/salt/renderers/jinja.py +++ b/salt/renderers/jinja.py @@ -4,7 +4,6 @@ Jinja loading utils to enable a more powerful backend for jinja templates .. include:: ../../../_incl/jinja_security.rst """ - import logging from io import StringIO diff --git a/salt/renderers/json.py b/salt/renderers/json.py index 36125685334..79d29fa6b37 100644 --- a/salt/renderers/json.py +++ b/salt/renderers/json.py @@ -2,7 +2,6 @@ JSON Renderer for Salt """ - import salt.utils.json json = salt.utils.json.import_json() diff --git a/salt/renderers/json5.py b/salt/renderers/json5.py index 9d4b345113f..ed8e96e5aa1 100644 --- a/salt/renderers/json5.py +++ b/salt/renderers/json5.py @@ -11,7 +11,6 @@ This renderer requires the `json5 python bindings`__, installable via pip. .. __: https://pypi.python.org/pypi/json5 """ - import logging try: diff --git a/salt/renderers/mako.py b/salt/renderers/mako.py index 01d413140ba..9032542f865 100644 --- a/salt/renderers/mako.py +++ b/salt/renderers/mako.py @@ -10,7 +10,6 @@ To install Mako, do the following: salt-pip install mako """ - import io import salt.utils.templates diff --git a/salt/renderers/nacl.py b/salt/renderers/nacl.py index 9cd2ba0f46b..6fa0351d45c 100644 --- a/salt/renderers/nacl.py +++ b/salt/renderers/nacl.py @@ -50,7 +50,6 @@ data like so: a-secret: "NACL[MRN3cc+fmdxyQbz6WMF+jq1hKdU5X5BBI7OjK+atvHo1ll+w1gZ7XyWtZVfq9gK9rQaMfkDxmidJKwE0Mw==]" """ - import logging import re diff --git a/salt/renderers/pass.py b/salt/renderers/pass.py index ba0f152c23e..12f7d47e833 100644 --- a/salt/renderers/pass.py +++ b/salt/renderers/pass.py @@ -75,7 +75,6 @@ Salt master configuration options pass_dir: """ - import logging import os from os.path import expanduser diff --git a/salt/renderers/pydsl.py b/salt/renderers/pydsl.py index 5cd74941bf2..996bbb13848 100644 --- a/salt/renderers/pydsl.py +++ b/salt/renderers/pydsl.py @@ -333,6 +333,7 @@ For example: my_mod = sys.modules['salt.loaded.ext.module.my_mod'] """ + import types import salt.utils.pydsl as pydsl diff --git a/salt/renderers/pyobjects.py b/salt/renderers/pyobjects.py index ad56246396b..f8de8d1f9e8 100644 --- a/salt/renderers/pyobjects.py +++ b/salt/renderers/pyobjects.py @@ -313,6 +313,7 @@ file ``samba/map.sls``, you could do the following. Service.running("samba", name=Samba.service) """ + # TODO: Interface for working with reactor files diff --git a/salt/renderers/stateconf.py b/salt/renderers/stateconf.py index c93a564f0ed..e65664754d8 100644 --- a/salt/renderers/stateconf.py +++ b/salt/renderers/stateconf.py @@ -5,6 +5,7 @@ A flexible renderer that takes a templating engine and a data format :maturity: new :platform: all """ + # See http://docs.saltstack.org/en/latest/ref/renderers/all/salt.renderers.stateconf.html # for a guide to using this module. # @@ -50,7 +51,7 @@ __opts__ = { # name of the state id for the generated start state. "stateconf_goal_state": ".goal", # name of the state id for the generated goal state. - "stateconf_state_func": "stateconf.set" + "stateconf_state_func": "stateconf.set", # names the state and the state function to be recognized as a special # state from which to gather sls file context variables. It should be # specified in the 'state.func' notation, and both the state module and diff --git a/salt/renderers/yaml.py b/salt/renderers/yaml.py index eb76a431372..cfc908bce19 100644 --- a/salt/renderers/yaml.py +++ b/salt/renderers/yaml.py @@ -4,7 +4,6 @@ YAML Renderer for Salt For YAML usage information see :ref:`Understanding YAML `. """ - import logging import warnings diff --git a/salt/returners/appoptics_return.py b/salt/returners/appoptics_return.py index c49d5e22e28..036112e11fa 100644 --- a/salt/returners/appoptics_return.py +++ b/salt/returners/appoptics_return.py @@ -69,7 +69,6 @@ the name of the state that was invoked, e.g. ``role_salt_master.netapi``. """ - import logging import salt.returners diff --git a/salt/returners/couchdb_return.py b/salt/returners/couchdb_return.py index 1a67a61d275..eff8c919bb0 100644 --- a/salt/returners/couchdb_return.py +++ b/salt/returners/couchdb_return.py @@ -51,7 +51,6 @@ otherwise multi-minion targeting can lead to losing output: * other minions fail with ``{'error': 'HTTP Error 409: Conflict'}`` """ - import logging import time from urllib.error import HTTPError diff --git a/salt/returners/elasticsearch_return.py b/salt/returners/elasticsearch_return.py index e4c790b64b5..aa93542339a 100644 --- a/salt/returners/elasticsearch_return.py +++ b/salt/returners/elasticsearch_return.py @@ -93,7 +93,6 @@ Minion configuration: - saltutil.find_job """ - import datetime import logging import uuid diff --git a/salt/returners/librato_return.py b/salt/returners/librato_return.py index cceaffb6490..890393808e1 100644 --- a/salt/returners/librato_return.py +++ b/salt/returners/librato_return.py @@ -29,7 +29,6 @@ by adding more tags to the submission. """ - import logging import salt.returners diff --git a/salt/returners/multi_returner.py b/salt/returners/multi_returner.py index 550a6c1e43e..9a030a2ae60 100644 --- a/salt/returners/multi_returner.py +++ b/salt/returners/multi_returner.py @@ -3,7 +3,6 @@ Read/Write multiple returners """ - import logging import salt.minion diff --git a/salt/returners/postgres_local_cache.py b/salt/returners/postgres_local_cache.py index 58d2a19766e..4a8c6d4262e 100644 --- a/salt/returners/postgres_local_cache.py +++ b/salt/returners/postgres_local_cache.py @@ -106,7 +106,6 @@ and then: Required python modules: psycopg2 """ - import logging import re import sys diff --git a/salt/returners/rawfile_json.py b/salt/returners/rawfile_json.py index e06347180d5..a4687611813 100644 --- a/salt/returners/rawfile_json.py +++ b/salt/returners/rawfile_json.py @@ -16,7 +16,6 @@ noise, so you may wish to configure batch processing and/or configure the to restrict the events that are written. """ - import logging import salt.returners diff --git a/salt/returners/smtp_return.py b/salt/returners/smtp_return.py index 7e3787d46e8..ca10015ef24 100644 --- a/salt/returners/smtp_return.py +++ b/salt/returners/smtp_return.py @@ -104,7 +104,6 @@ Also you need to create additional file ``/srv/salt/templates/email.j2`` with em This configuration enables Salt Master to send an email when accepting or rejecting minions keys. """ - import io import logging import os diff --git a/salt/returners/zabbix_return.py b/salt/returners/zabbix_return.py index ce751c50b7d..acf9db3f746 100644 --- a/salt/returners/zabbix_return.py +++ b/salt/returners/zabbix_return.py @@ -16,7 +16,6 @@ To use the Zabbix returner, append '--return zabbix' to the salt command. ex: salt '*' test.ping --return zabbix """ - import os # Define the module's virtual name diff --git a/salt/roster/cache.py b/salt/roster/cache.py index ebae66ba2d5..5a6018d69d0 100644 --- a/salt/roster/cache.py +++ b/salt/roster/cache.py @@ -235,9 +235,9 @@ def _minion_lookup(minion_id, key, minion): else: # Take the addresses from the grains and filter them filters = { - "global": lambda addr: addr.is_global - if addr.version == 6 - else not addr.is_private, + "global": lambda addr: ( + addr.is_global if addr.version == 6 else not addr.is_private + ), "public": lambda addr: not addr.is_private, "private": lambda addr: addr.is_private and not addr.is_loopback diff --git a/salt/roster/cloud.py b/salt/roster/cloud.py index 7b9305fbd0c..096329f569d 100644 --- a/salt/roster/cloud.py +++ b/salt/roster/cloud.py @@ -17,7 +17,6 @@ usually located at /etc/salt/cloud. For example, add the following: sudo: True """ - import copy import os diff --git a/salt/roster/clustershell.py b/salt/roster/clustershell.py index 1d07bf4adc4..ea3250117ef 100644 --- a/salt/roster/clustershell.py +++ b/salt/roster/clustershell.py @@ -11,7 +11,6 @@ When you want to use host globs for target matching, use ``--roster clustershell """ - import copy import socket diff --git a/salt/roster/dir.py b/salt/roster/dir.py index b194f192fd0..2aa78dffe4e 100644 --- a/salt/roster/dir.py +++ b/salt/roster/dir.py @@ -46,7 +46,6 @@ This makes it possible to avoid having to specify the hostnames when you always their minion id plus some domain. """ - import logging import os diff --git a/salt/roster/sshknownhosts.py b/salt/roster/sshknownhosts.py index 33ecea925a1..9f8432e1672 100644 --- a/salt/roster/sshknownhosts.py +++ b/salt/roster/sshknownhosts.py @@ -36,7 +36,6 @@ Or with a Saltfile """ - import logging import os diff --git a/salt/runners/auth.py b/salt/runners/auth.py index 7485ef55a44..91f20c52e38 100644 --- a/salt/runners/auth.py +++ b/salt/runners/auth.py @@ -5,7 +5,6 @@ Authentication runner for creating, deleting, and managing eauth tokens. """ - import os import salt.auth diff --git a/salt/runners/digicertapi.py b/salt/runners/digicertapi.py index 76db62ed61f..44c8d02f728 100644 --- a/salt/runners/digicertapi.py +++ b/salt/runners/digicertapi.py @@ -34,6 +34,7 @@ This API currently only supports RSA key types. Support for other key types wil if interest warrants. """ + import logging import os import re diff --git a/salt/runners/drac.py b/salt/runners/drac.py index f5e9d39ed7d..0a377c6d808 100644 --- a/salt/runners/drac.py +++ b/salt/runners/drac.py @@ -12,7 +12,6 @@ configuration file. """ - import logging try: @@ -58,7 +57,7 @@ def __connect(hostname, timeout=20, username=None, password=None): password = drac_cred.get("password", None) client = paramiko.SSHClient() - client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec try: client.connect(hostname, username=username, password=password, timeout=timeout) diff --git a/salt/runners/lxc.py b/salt/runners/lxc.py index 0ded584f427..f325dcb7b64 100644 --- a/salt/runners/lxc.py +++ b/salt/runners/lxc.py @@ -4,7 +4,6 @@ Control Linux Containers via Salt :depends: lxc execution module """ - import copy import logging import os diff --git a/salt/runners/manage.py b/salt/runners/manage.py index 3a0a201a4ef..63ee54e4b66 100644 --- a/salt/runners/manage.py +++ b/salt/runners/manage.py @@ -3,7 +3,6 @@ General management functions for salt, tools like seeing what hosts are up and what hosts are down """ - import logging import operator import os @@ -134,7 +133,7 @@ def key_regen(): path = os.path.join(root, fn_) try: os.remove(path) - except os.error: + except OSError: pass msg = ( "The minion and master keys have been deleted. Restart the Salt\n" @@ -540,10 +539,10 @@ def safe_accept(target, tgt_type="glob"): elif minion not in pending: failures[minion] = "Minion key {} not found by salt-key".format(minion) elif pending[minion] != finger: - failures[ - minion - ] = "Minion key {} does not match the key in salt-key: {}".format( - finger, pending[minion] + failures[minion] = ( + "Minion key {} does not match the key in salt-key: {}".format( + finger, pending[minion] + ) ) else: subprocess.call(["salt-key", "-qya", minion]) diff --git a/salt/runners/mattermost.py b/salt/runners/mattermost.py index 40309f62160..bb332de3411 100644 --- a/salt/runners/mattermost.py +++ b/salt/runners/mattermost.py @@ -14,7 +14,6 @@ Module for sending messages to Mattermost api_url: https://example.com """ - import logging import salt.utils.json diff --git a/salt/runners/nacl.py b/salt/runners/nacl.py index 3c097604bad..62b89444723 100644 --- a/salt/runners/nacl.py +++ b/salt/runners/nacl.py @@ -111,7 +111,6 @@ Larger files like certificates can be encrypted with: """ - import salt.utils.nacl __virtualname__ = "nacl" diff --git a/salt/runners/network.py b/salt/runners/network.py index 1a56da20f17..2812bb3a94e 100644 --- a/salt/runners/network.py +++ b/salt/runners/network.py @@ -2,7 +2,6 @@ Network tools to run from the Master """ - import logging import socket diff --git a/salt/runners/pkg.py b/salt/runners/pkg.py index 5d084b45032..1987b696920 100644 --- a/salt/runners/pkg.py +++ b/salt/runners/pkg.py @@ -4,7 +4,6 @@ Package helper functions using ``salt.modules.pkg`` .. versionadded:: 2015.8.0 """ - import salt.minion import salt.output diff --git a/salt/runners/queue.py b/salt/runners/queue.py index 286ebebcbff..36c77daaa98 100644 --- a/salt/runners/queue.py +++ b/salt/runners/queue.py @@ -61,7 +61,6 @@ run them. And it will do this every minute, unless there are any jobs that are still running from the last time the process_runner task was executed. """ - import salt.loader from salt.exceptions import SaltInvocationError from salt.utils.event import get_event, tagify diff --git a/salt/runners/spacewalk.py b/salt/runners/spacewalk.py index 638e338b496..69fce4731cd 100644 --- a/salt/runners/spacewalk.py +++ b/salt/runners/spacewalk.py @@ -31,7 +31,7 @@ master configuration at ``/etc/salt/master`` or ``/etc/salt/master.d/spacewalk.c import atexit import logging -import xmlrpc.client +import xmlrpc.client # nosec log = logging.getLogger(__name__) diff --git a/salt/runners/ssh.py b/salt/runners/ssh.py index 90ac4cfc02d..6a6086d21c1 100644 --- a/salt/runners/ssh.py +++ b/salt/runners/ssh.py @@ -4,7 +4,6 @@ A Runner module interface on top of the salt-ssh Python API. This allows for programmatic use from salt-api, the Reactor, Orchestrate, etc. """ - import salt.client.ssh.client diff --git a/salt/runners/thin.py b/salt/runners/thin.py index 83698cf6eb2..346c9ce68b0 100644 --- a/salt/runners/thin.py +++ b/salt/runners/thin.py @@ -6,7 +6,6 @@ in a standalone way. This runner has tools which generate the standalone salt system for easy consumption. """ - import salt.utils.thin diff --git a/salt/runners/virt.py b/salt/runners/virt.py index 71e665b4c50..317a7206068 100644 --- a/salt/runners/virt.py +++ b/salt/runners/virt.py @@ -2,7 +2,6 @@ Control virtual machines via Salt """ - import logging import os.path diff --git a/salt/scripts.py b/salt/scripts.py index 3c74fb5a3ef..dd3af6247fc 100644 --- a/salt/scripts.py +++ b/salt/scripts.py @@ -1,6 +1,7 @@ """ This module contains the function calls to execute command line scripts """ + import contextlib import functools import logging @@ -18,9 +19,6 @@ from salt.exceptions import SaltClientError, SaltReqTimeoutError, SaltSystemExit log = logging.getLogger(__name__) -if sys.version_info < (3,): - raise SystemExit(salt.defaults.exitcodes.EX_GENERIC) - def _handle_signals(client, signum, sigframe): try: diff --git a/salt/sdb/cache.py b/salt/sdb/cache.py index 837fcba8ff1..96503b3bbc3 100644 --- a/salt/sdb/cache.py +++ b/salt/sdb/cache.py @@ -44,7 +44,6 @@ it must be specified in the URI: master_ip: sdb://mastercloudcache/public_ips?bank=cloud/active/ec2/my-ec2-conf/saltmaster """ - import salt.cache __func_alias__ = {"set_": "set"} diff --git a/salt/sdb/couchdb.py b/salt/sdb/couchdb.py index 978385f9788..5e7012798a1 100644 --- a/salt/sdb/couchdb.py +++ b/salt/sdb/couchdb.py @@ -35,7 +35,6 @@ Additional contributions to build true map-reduce functionality into this module would be welcome. """ - # Import Python libraries import logging from uuid import uuid4 diff --git a/salt/sdb/etcd_db.py b/salt/sdb/etcd_db.py index bf31fc74eb3..aa2858307c7 100644 --- a/salt/sdb/etcd_db.py +++ b/salt/sdb/etcd_db.py @@ -39,7 +39,6 @@ defaults to true, meaning you will use v2 unless you specify otherwise. """ - import logging try: diff --git a/salt/sdb/rest.py b/salt/sdb/rest.py index f436fc5802b..dfcb980331b 100644 --- a/salt/sdb/rest.py +++ b/salt/sdb/rest.py @@ -64,7 +64,6 @@ For instance: user: myuser """ - import logging import salt.loader diff --git a/salt/sdb/tism.py b/salt/sdb/tism.py index 08b05b08b4a..50c72b85317 100644 --- a/salt/sdb/tism.py +++ b/salt/sdb/tism.py @@ -27,7 +27,6 @@ configuration. token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6MSwiZXhwIjoxNTg1MTExNDYwLCJqdGkiOiI3NnA5cWNiMWdtdmw4Iiwia2V5cyI6WyJBTEwiXX0.RtAhG6Uorf5xnSf4Ya_GwJnoHkCsql4r1_hiOeDSLzo """ - import logging import salt.utils.http as http diff --git a/salt/sdb/vault.py b/salt/sdb/vault.py index 08360e2d84f..6e99e267a45 100644 --- a/salt/sdb/vault.py +++ b/salt/sdb/vault.py @@ -39,7 +39,6 @@ The above URI is analogous to running the following vault command: $ vault read -field=mypassword secret/passwords """ - import logging import salt.exceptions diff --git a/salt/sdb/yaml.py b/salt/sdb/yaml.py index 1411e6c2899..e899382eff5 100644 --- a/salt/sdb/yaml.py +++ b/salt/sdb/yaml.py @@ -41,7 +41,6 @@ embedded GPG-encrypted data using the :py:mod:`GPG renderer `. """ - import logging import salt.exceptions diff --git a/salt/serializers/__init__.py b/salt/serializers/__init__.py index 2d0b5dc10db..afa7ff49cb3 100644 --- a/salt/serializers/__init__.py +++ b/salt/serializers/__init__.py @@ -14,7 +14,6 @@ """ - from salt.exceptions import SaltException, SaltRenderError diff --git a/salt/serializers/json.py b/salt/serializers/json.py index 8ee1085452c..cea79944b42 100644 --- a/salt/serializers/json.py +++ b/salt/serializers/json.py @@ -7,7 +7,6 @@ It's just a wrapper around json (or simplejson if available). """ - import salt.utils.json from salt.serializers import DeserializationError, SerializationError diff --git a/salt/serializers/plist.py b/salt/serializers/plist.py index a833b4e7897..d205d68ea1d 100644 --- a/salt/serializers/plist.py +++ b/salt/serializers/plist.py @@ -7,6 +7,7 @@ Wrapper around plistlib. """ + import logging import plistlib diff --git a/salt/serializers/yaml.py b/salt/serializers/yaml.py index dc1099db448..ae050376d6f 100644 --- a/salt/serializers/yaml.py +++ b/salt/serializers/yaml.py @@ -8,7 +8,6 @@ It also use C bindings if they are available. """ - import datetime import logging diff --git a/salt/serializers/yamlex.py b/salt/serializers/yamlex.py index d67ff7a60b2..ec77d2c7333 100644 --- a/salt/serializers/yamlex.py +++ b/salt/serializers/yamlex.py @@ -98,6 +98,7 @@ Document is defacto an aggregate mapping. """ + # pylint: disable=invalid-name,no-member,missing-docstring,no-self-use # pylint: disable=too-few-public-methods,too-many-public-methods diff --git a/salt/spm/__init__.py b/salt/spm/__init__.py index fa8f366702c..6738d108a6f 100644 --- a/salt/spm/__init__.py +++ b/salt/spm/__init__.py @@ -635,7 +635,7 @@ class SPMClient: if os.path.exists(self.opts["spm_repos_config"]): repo_files.append(self.opts["spm_repos_config"]) - for (dirpath, dirnames, filenames) in salt.utils.path.os_walk( + for dirpath, dirnames, filenames in salt.utils.path.os_walk( "{}.d".format(self.opts["spm_repos_config"]) ): for repo_file in filenames: @@ -753,7 +753,7 @@ class SPMClient: old_files = [] repo_metadata = {} - for (dirpath, dirnames, filenames) in salt.utils.path.os_walk(repo_path): + for dirpath, dirnames, filenames in salt.utils.path.os_walk(repo_path): for spm_file in filenames: if not spm_file.endswith(".spm"): continue diff --git a/salt/spm/pkgdb/sqlite3.py b/salt/spm/pkgdb/sqlite3.py index 48a23e0109a..7d1634c3b76 100644 --- a/salt/spm/pkgdb/sqlite3.py +++ b/salt/spm/pkgdb/sqlite3.py @@ -4,7 +4,6 @@ This module allows SPM to use sqlite3 as the backend for SPM's package database. .. versionadded:: 2015.8.0 """ - import datetime import logging import os diff --git a/salt/spm/pkgfiles/local.py b/salt/spm/pkgfiles/local.py index b75a1457448..6eab896bf68 100644 --- a/salt/spm/pkgfiles/local.py +++ b/salt/spm/pkgfiles/local.py @@ -4,7 +4,6 @@ This module allows SPM to use the local filesystem to install files for SPM. .. versionadded:: 2015.8.0 """ - import logging import os import os.path diff --git a/salt/state.py b/salt/state.py index 9cd31e6ab8b..08198e7f54f 100644 --- a/salt/state.py +++ b/salt/state.py @@ -4465,9 +4465,11 @@ class BaseHighState: " on the salt master in saltenv(s): {} ".format( env_key, inc_sls, - ", ".join(matches) - if env_key == xenv_key - else env_key, + ( + ", ".join(matches) + if env_key == xenv_key + else env_key + ), ) ) elif len(resolved_envs) > 1: @@ -4669,10 +4671,10 @@ class BaseHighState: # match SLS foobar in environment this_sls = "SLS {} in saltenv".format(sls_match) if this_sls in error: - errors[ - i - ] = "No matching sls found for '{}' in env '{}'".format( - sls_match, saltenv + errors[i] = ( + "No matching sls found for '{}' in env '{}'".format( + sls_match, saltenv + ) ) all_errors.extend(errors) diff --git a/salt/states/alternatives.py b/salt/states/alternatives.py index f69b5f70351..de4e119c529 100644 --- a/salt/states/alternatives.py +++ b/salt/states/alternatives.py @@ -76,10 +76,10 @@ def install(name, link, path, priority): ) else: if __opts__["test"]: - ret[ - "comment" - ] = "Alternative will be set for {} to {} with priority {}".format( - name, path, priority + ret["comment"] = ( + "Alternative will be set for {} to {} with priority {}".format( + name, path, priority + ) ) ret["result"] = None return ret @@ -87,10 +87,10 @@ def install(name, link, path, priority): out = __salt__["alternatives.install"](name, link, path, priority) if __salt__["alternatives.check_exists"](name, path): if __salt__["alternatives.check_installed"](name, path): - ret[ - "comment" - ] = "Alternative for {} set to path {} with priority {}".format( - name, path, priority + ret["comment"] = ( + "Alternative for {} set to path {} with priority {}".format( + name, path, priority + ) ) else: ret["comment"] = ( @@ -135,10 +135,10 @@ def remove(name, path): current = __salt__["alternatives.show_current"](name) if current: ret["result"] = True - ret[ - "comment" - ] = "Alternative for {} removed. Falling back to path {}".format( - name, current + ret["comment"] = ( + "Alternative for {} removed. Falling back to path {}".format( + name, current + ) ) ret["changes"] = {"path": current} return ret diff --git a/salt/states/ansiblegate.py b/salt/states/ansiblegate.py index ec8913dee59..2ecc18f6e81 100644 --- a/salt/states/ansiblegate.py +++ b/salt/states/ansiblegate.py @@ -236,7 +236,7 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs= if ret["result"]: ret["comment"] = "Changes were made by playbook {}".format(name) else: - ret[ - "comment" - ] = "There were some issues running the playbook {}".format(name) + ret["comment"] = ( + "There were some issues running the playbook {}".format(name) + ) return ret diff --git a/salt/states/apache.py b/salt/states/apache.py index 8b340b7de48..60ed48f8043 100644 --- a/salt/states/apache.py +++ b/salt/states/apache.py @@ -84,7 +84,6 @@ it still needs keyword ``this`` with empty string (or "\b" if nicer output is re do: another thing """ - import os import salt.utils.files diff --git a/salt/states/aptpkg.py b/salt/states/aptpkg.py index 62b83f37b26..7a285bfc913 100644 --- a/salt/states/aptpkg.py +++ b/salt/states/aptpkg.py @@ -3,7 +3,6 @@ Package management operations specific to APT- and DEB-based systems ==================================================================== """ - import logging import salt.utils.data diff --git a/salt/states/archive.py b/salt/states/archive.py index 8de42988764..bf47864f542 100644 --- a/salt/states/archive.py +++ b/salt/states/archive.py @@ -716,9 +716,9 @@ def extracted( kwargs = salt.utils.args.clean_kwargs(**kwargs) if skip_files_list_verify and skip_verify: - ret[ - "comment" - ] = 'Only one of "skip_files_list_verify" and "skip_verify" can be set to True' + ret["comment"] = ( + 'Only one of "skip_files_list_verify" and "skip_verify" can be set to True' + ) return ret if "keep_source" in kwargs and "keep" in kwargs: @@ -780,9 +780,9 @@ def extracted( # from making this state blow up with a traceback. not_rel = True if not_rel: - ret[ - "comment" - ] = "Value for 'enforce_ownership_on' must be within {}".format(name) + ret["comment"] = ( + "Value for 'enforce_ownership_on' must be within {}".format(name) + ) return ret if if_missing is not None and os.path.exists(if_missing): @@ -792,9 +792,9 @@ def extracted( if user or group: if salt.utils.platform.is_windows(): - ret[ - "comment" - ] = "User/group ownership cannot be enforced on Windows minions" + ret["comment"] = ( + "User/group ownership cannot be enforced on Windows minions" + ) return ret if user: @@ -941,9 +941,9 @@ def extracted( ) else: if password: - ret[ - "comment" - ] = "The 'password' argument is only supported for zip archives" + ret["comment"] = ( + "The 'password' argument is only supported for zip archives" + ) return ret if archive_format == "rar": @@ -971,9 +971,9 @@ def extracted( # string-ified integer. trim_output = int(trim_output) except TypeError: - ret[ - "comment" - ] = "Invalid value for trim_output, must be True/False or an integer" + ret["comment"] = ( + "Invalid value for trim_output, must be True/False or an integer" + ) return ret if source_hash: @@ -1048,10 +1048,10 @@ def extracted( # salt/states/file.py from being processed through the loader. If # that is the case, we have much more important problems as _all_ # file states would be unavailable. - ret[ - "comment" - ] = "Unable to cache {}, file.cached state not available".format( - salt.utils.url.redact_http_basic_auth(source_match) + ret["comment"] = ( + "Unable to cache {}, file.cached state not available".format( + salt.utils.url.redact_http_basic_auth(source_match) + ) ) return ret @@ -1423,7 +1423,7 @@ def extracted( if options is None: try: with closing(tarfile.open(cached, "r")) as tar: - tar.extractall(salt.utils.stringutils.to_str(name)) + tar.extractall(salt.utils.stringutils.to_str(name)) # nosec files = tar.getnames() if trim_output: files = files[:trim_output] diff --git a/salt/states/artifactory.py b/salt/states/artifactory.py index 2395fe7d6c4..23fa8d8dd59 100644 --- a/salt/states/artifactory.py +++ b/salt/states/artifactory.py @@ -3,7 +3,6 @@ This state downloads artifacts from artifactory. """ - import logging log = logging.getLogger(__name__) diff --git a/salt/states/at.py b/salt/states/at.py index a4065314552..09b2fd0e423 100644 --- a/salt/states/at.py +++ b/salt/states/at.py @@ -209,10 +209,10 @@ def absent(name, jobid=None, **kwargs): return ret else: ret["result"] = False - ret[ - "comment" - ] = "more than one job was return for job with id {jobid}".format( - jobid=jobid + ret["comment"] = ( + "more than one job was return for job with id {jobid}".format( + jobid=jobid + ) ) return ret diff --git a/salt/states/azurearm_compute.py b/salt/states/azurearm_compute.py index e23461afd27..bfdd2dd925a 100644 --- a/salt/states/azurearm_compute.py +++ b/salt/states/azurearm_compute.py @@ -198,9 +198,9 @@ def availability_set_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret if sku: @@ -325,9 +325,9 @@ def availability_set_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret aset = __salt__["azurearm_compute.availability_set_get"]( diff --git a/salt/states/azurearm_dns.py b/salt/states/azurearm_dns.py index 90f8c0b61c8..6002d24a821 100644 --- a/salt/states/azurearm_dns.py +++ b/salt/states/azurearm_dns.py @@ -116,6 +116,7 @@ Optional provider parameters: - connection_auth: {{ profile }} """ + import logging from functools import wraps @@ -232,9 +233,9 @@ def zone_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret zone = __salt__["azurearm_dns.zone_get"]( @@ -377,9 +378,9 @@ def zone_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret zone = __salt__["azurearm_dns.zone_get"]( @@ -564,9 +565,9 @@ def record_set_present( ] if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret rec_set = __salt__["azurearm_dns.record_set_get"]( @@ -590,19 +591,19 @@ def record_set_present( record = eval(record_str) if record: if not ttl: - ret[ - "comment" - ] = "TTL is required when specifying record information!" + ret["comment"] = ( + "TTL is required when specifying record information!" + ) return ret if not rec_set.get(record_str): ret["changes"] = {"new": {record_str: record}} continue if record_str[-1] != "s": if not isinstance(record, dict): - ret[ - "comment" - ] = "{} record information must be specified as a dictionary!".format( - record_str + ret["comment"] = ( + "{} record information must be specified as a dictionary!".format( + record_str + ) ) return ret for k, v in record.items(): @@ -723,9 +724,9 @@ def record_set_absent(name, zone_name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret rec_set = __salt__["azurearm_dns.record_set_get"]( diff --git a/salt/states/azurearm_network.py b/salt/states/azurearm_network.py index 2555a2d06ad..513206d95f2 100644 --- a/salt/states/azurearm_network.py +++ b/salt/states/azurearm_network.py @@ -91,6 +91,7 @@ Azure (ARM) Network State Module - connection_auth: {{ profile }} """ + import logging from functools import wraps @@ -188,9 +189,9 @@ def virtual_network_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret vnet = __salt__["azurearm_network.virtual_network_get"]( @@ -312,9 +313,9 @@ def virtual_network_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret vnet = __salt__["azurearm_network.virtual_network_get"]( @@ -409,9 +410,9 @@ def subnet_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret snet = __salt__["azurearm_network.subnet_get"]( @@ -517,9 +518,9 @@ def subnet_absent(name, virtual_network, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret snet = __salt__["azurearm_network.subnet_get"]( @@ -625,9 +626,9 @@ def network_security_group_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret nsg = __salt__["azurearm_network.network_security_group_get"]( @@ -721,9 +722,9 @@ def network_security_group_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret nsg = __salt__["azurearm_network.network_security_group_get"]( @@ -873,9 +874,9 @@ def security_rule_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret exclusive_params = [ @@ -1127,9 +1128,9 @@ def security_rule_absent(name, security_group, resource_group, connection_auth=N ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret rule = __salt__["azurearm_network.security_rule_get"]( @@ -1351,9 +1352,9 @@ def load_balancer_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret if sku: @@ -1565,9 +1566,9 @@ def load_balancer_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret load_bal = __salt__["azurearm_network.load_balancer_get"]( @@ -1678,9 +1679,9 @@ def public_ip_address_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret if sku: @@ -1823,9 +1824,9 @@ def public_ip_address_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret pub_ip = __salt__["azurearm_network.public_ip_address_get"]( @@ -1968,9 +1969,9 @@ def network_interface_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret iface = __salt__["azurearm_network.network_interface_get"]( @@ -2151,9 +2152,9 @@ def network_interface_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret iface = __salt__["azurearm_network.network_interface_get"]( @@ -2250,9 +2251,9 @@ def route_table_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret rt_tbl = __salt__["azurearm_network.route_table_get"]( @@ -2359,9 +2360,9 @@ def route_table_absent(name, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret rt_tbl = __salt__["azurearm_network.route_table_get"]( @@ -2455,9 +2456,9 @@ def route_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret route = __salt__["azurearm_network.route_get"]( @@ -2557,9 +2558,9 @@ def route_absent(name, route_table, resource_group, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret route = __salt__["azurearm_network.route_get"]( diff --git a/salt/states/azurearm_resource.py b/salt/states/azurearm_resource.py index 7cef3bc0bd9..5cd896c4252 100644 --- a/salt/states/azurearm_resource.py +++ b/salt/states/azurearm_resource.py @@ -86,7 +86,6 @@ Azure (ARM) Resource State Module """ - import json import logging from functools import wraps @@ -172,9 +171,9 @@ def resource_group_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret group = {} @@ -255,9 +254,9 @@ def resource_group_absent(name, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret group = {} @@ -415,9 +414,9 @@ def policy_definition_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret if not policy_rule and not policy_rule_json and not policy_rule_file: @@ -630,9 +629,9 @@ def policy_definition_absent(name, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret policy = __salt__["azurearm_resource.policy_definition_get"]( @@ -726,9 +725,9 @@ def policy_assignment_present( ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret policy = __salt__["azurearm_resource.policy_assignment_get"]( @@ -843,9 +842,9 @@ def policy_assignment_absent(name, scope, connection_auth=None): ret = {"name": name, "result": False, "comment": "", "changes": {}} if not isinstance(connection_auth, dict): - ret[ - "comment" - ] = "Connection information must be specified via connection_auth dictionary!" + ret["comment"] = ( + "Connection information must be specified via connection_auth dictionary!" + ) return ret policy = __salt__["azurearm_resource.policy_assignment_get"]( diff --git a/salt/states/bigip.py b/salt/states/bigip.py index 58b525435c6..2b72e4b7530 100644 --- a/salt/states/bigip.py +++ b/salt/states/bigip.py @@ -4,7 +4,6 @@ A state module designed to enforce load-balancing configurations for F5 Big-IP e :platform: f5_bigip_11.6 """ - import salt.utils.json @@ -331,9 +330,9 @@ def manage_node( # we think we are managing if existing["content"]["address"] != address: ret["result"] = False - ret[ - "comment" - ] = "A node with this name exists but the address does not match." + ret["comment"] = ( + "A node with this name exists but the address does not match." + ) modified = __salt__["bigip.modify_node"]( hostname=hostname, @@ -1443,10 +1442,10 @@ def add_pool_member(hostname, username, password, name, member): if exists: ret["result"] = True - ret[ - "comment" - ] = "Member: {name} already exists within this pool. No changes made.".format( - name=member["name"] + ret["comment"] = ( + "Member: {name} already exists within this pool. No changes made.".format( + name=member["name"] + ) ) ret["changes"]["old"] = {} ret["changes"]["new"] = {} @@ -1457,10 +1456,10 @@ def add_pool_member(hostname, username, password, name, member): if new_member["code"] == 200: ret["result"] = True - ret[ - "comment" - ] = "Member: {name} has been successfully added to the pool.".format( - name=member["name"] + ret["comment"] = ( + "Member: {name} has been successfully added to the pool.".format( + name=member["name"] + ) ) ret["changes"]["old"] = {} @@ -1636,10 +1635,10 @@ def modify_pool_member( else: ret = _load_result(modified, ret) else: - ret[ - "comment" - ] = "Member: {name} does not exists within this pool. No changes made.".format( - name=member["name"] + ret["comment"] = ( + "Member: {name} does not exists within this pool. No changes made.".format( + name=member["name"] + ) ) # pool does not exists @@ -1706,10 +1705,10 @@ def delete_pool_member(hostname, username, password, name, member): # did we get rid of it? if deleted["code"] == 200: ret["result"] = True - ret[ - "comment" - ] = "Pool Member: {member} was successfully deleted.".format( - member=member + ret["comment"] = ( + "Pool Member: {member} was successfully deleted.".format( + member=member + ) ) ret["changes"]["old"] = existing_member ret["changes"]["new"] = {} @@ -2353,9 +2352,9 @@ def manage_virtual( ret["result"] = True ret["changes"]["old"] = {} ret["changes"]["new"] = virtual["content"] - ret[ - "comment" - ] = "Virtual was successfully created and enforced to the desired state." + ret["comment"] = ( + "Virtual was successfully created and enforced to the desired state." + ) else: ret = _load_result(virtual, ret) diff --git a/salt/states/boto3_elasticsearch.py b/salt/states/boto3_elasticsearch.py index ff0dae55457..ac50995660c 100644 --- a/salt/states/boto3_elasticsearch.py +++ b/salt/states/boto3_elasticsearch.py @@ -43,7 +43,6 @@ Manage Elasticsearch Service :depends: boto3 """ - import logging import salt.utils.json diff --git a/salt/states/boto3_route53.py b/salt/states/boto3_route53.py index 56f93256fbe..7cd3ede3452 100644 --- a/salt/states/boto3_route53.py +++ b/salt/states/boto3_route53.py @@ -59,6 +59,7 @@ passed in as a dict, or as a string to pull from pillars or minion config: - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs """ + # keep lint from choking # pylint: disable=W0106 @@ -281,10 +282,10 @@ def hosted_zone_present( if update_comment: if __opts__["test"]: - ret[ - "comment" - ] = "Route 53 {} hosted zone {} comment would be updated.".format( - "private" if PrivateZone else "public", Name + ret["comment"] = ( + "Route 53 {} hosted zone {} comment would be updated.".format( + "private" if PrivateZone else "public", Name + ) ) ret["result"] = None return ret @@ -309,10 +310,10 @@ def hosted_zone_present( ret["changes"].get("new", {}), r ) else: - ret[ - "comment" - ] = "Update of Route 53 {} hosted zone {} comment failed".format( - "private" if PrivateZone else "public", Name + ret["comment"] = ( + "Update of Route 53 {} hosted zone {} comment failed".format( + "private" if PrivateZone else "public", Name + ) ) log.error(ret["comment"]) ret["result"] = False @@ -320,10 +321,10 @@ def hosted_zone_present( if add_vpcs or del_vpcs: if __opts__["test"]: - ret[ - "comment" - ] = "Route 53 {} hosted zone {} associated VPCs would be updated.".format( - "private" if PrivateZone else "public", Name + ret["comment"] = ( + "Route 53 {} hosted zone {} associated VPCs would be updated.".format( + "private" if PrivateZone else "public", Name + ) ) ret["result"] = None return ret @@ -365,10 +366,10 @@ def hosted_zone_present( log.info(msg) ret["comment"] = " ".join([ret["comment"], msg]) else: - ret[ - "comment" - ] = "Update of Route 53 {} hosted zone {} associated VPCs failed".format( - "private" if PrivateZone else "public", Name + ret["comment"] = ( + "Update of Route 53 {} hosted zone {} associated VPCs failed".format( + "private" if PrivateZone else "public", Name + ) ) log.error(ret["comment"]) ret["result"] = False @@ -696,19 +697,19 @@ def rr_present( profile=profile, ) if len(r) < 1: - ret[ - "comment" - ] = "No EC2 instance with tag {} == {} found".format( - tag_name, tag_value + ret["comment"] = ( + "No EC2 instance with tag {} == {} found".format( + tag_name, tag_value + ) ) log.error(ret["comment"]) ret["result"] = False return ret if len(r) > 1: - ret[ - "comment" - ] = "Multiple EC2 instances with tag {} == {} found".format( - tag_name, tag_value + ret["comment"] = ( + "Multiple EC2 instances with tag {} == {} found".format( + tag_name, tag_value + ) ) log.error(ret["comment"]) ret["result"] = False @@ -781,10 +782,10 @@ def rr_present( if not recordsets: create = True if __opts__["test"]: - ret[ - "comment" - ] = "Route 53 resource record {} with type {} would be added.".format( - Name, Type + ret["comment"] = ( + "Route 53 resource record {} with type {} would be added.".format( + Name, Type + ) ) ret["result"] = None return ret @@ -817,10 +818,10 @@ def rr_present( return ret else: if __opts__["test"]: - ret[ - "comment" - ] = "Route 53 resource record {} with type {} would be updated.".format( - Name, Type + ret["comment"] = ( + "Route 53 resource record {} with type {} would be updated.".format( + Name, Type + ) ) ret["result"] = None return ret @@ -858,10 +859,10 @@ def rr_present( ret["changes"]["old"] = rrset ret["changes"]["new"] = ResourceRecordSet else: - ret[ - "comment" - ] = "Failed to {} Route 53 resource record {} with type {}.".format( - "create" if create else "update", Name, Type + ret["comment"] = ( + "Failed to {} Route 53 resource record {} with type {}.".format( + "create" if create else "update", Name, Type + ) ) log.error(ret["comment"]) ret["result"] = False @@ -966,10 +967,10 @@ def rr_absent( recordsets = [r for r in recordsets if r.get("SetIdentifier") == SetIdentifier] log.debug("Resulted in recordsets %s.", recordsets) if not recordsets: - ret[ - "comment" - ] = "Route 53 resource record {} with type {} already absent.".format( - Name, Type + ret["comment"] = ( + "Route 53 resource record {} with type {} already absent.".format( + Name, Type + ) ) return ret elif len(recordsets) > 1: @@ -979,10 +980,10 @@ def rr_absent( return ret ResourceRecordSet = recordsets[0] if __opts__["test"]: - ret[ - "comment" - ] = "Route 53 resource record {} with type {} would be deleted.".format( - Name, Type + ret["comment"] = ( + "Route 53 resource record {} with type {} would be deleted.".format( + Name, Type + ) ) ret["result"] = None return ret @@ -1006,10 +1007,10 @@ def rr_absent( ret["changes"]["old"] = ResourceRecordSet ret["changes"]["new"] = None else: - ret[ - "comment" - ] = "Failed to delete Route 53 resource record {} with type {}.".format( - Name, Type + ret["comment"] = ( + "Failed to delete Route 53 resource record {} with type {}.".format( + Name, Type + ) ) log.error(ret["comment"]) ret["result"] = False diff --git a/salt/states/boto3_sns.py b/salt/states/boto3_sns.py index 30509176e70..b47b4447288 100644 --- a/salt/states/boto3_sns.py +++ b/salt/states/boto3_sns.py @@ -350,10 +350,10 @@ def topic_absent( log.debug("Deleted subscription %s for SNS topic %s", sub, TopicArn) something_changed = True else: - ret[ - "comment" - ] = "Failed to delete subscription {} for SNS topic {}".format( - sub, TopicArn + ret["comment"] = ( + "Failed to delete subscription {} for SNS topic {}".format( + sub, TopicArn + ) ) ret["result"] = False return ret diff --git a/salt/states/boto_apigateway.py b/salt/states/boto_apigateway.py index f70edf470f1..32aad36f677 100644 --- a/salt/states/boto_apigateway.py +++ b/salt/states/boto_apigateway.py @@ -50,7 +50,6 @@ config: """ - import hashlib import logging import os @@ -1255,10 +1254,10 @@ class _Swagger: if not result.get("deleted"): ret["abort"] = True ret["result"] = False - ret[ - "comment" - ] = "delete_stage delete_api_deployment, {}".format( - result.get("error") + ret["comment"] = ( + "delete_stage delete_api_deployment, {}".format( + result.get("error") + ) ) else: ret["comment"] = "stage {} has been deleted.\n".format( @@ -1601,12 +1600,12 @@ class _Swagger: ret["result"] = False ret["abort"] = True if "error" in create_model_response: - ret[ - "comment" - ] = "Failed to create model {}, schema {}, error: {}".format( - model, - _dict_to_json_pretty(schema), - create_model_response["error"]["message"], + ret["comment"] = ( + "Failed to create model {}, schema {}, error: {}".format( + model, + _dict_to_json_pretty(schema), + create_model_response["error"]["message"], + ) ) return ret @@ -2264,10 +2263,10 @@ def usage_plan_association_present( plan_id, stages_to_add, **common_args ) if "error" in result: - ret[ - "comment" - ] = "Failed to associate a usage plan {} to the apis {}, {}".format( - plan_name, stages_to_add, result["error"] + ret["comment"] = ( + "Failed to associate a usage plan {} to the apis {}, {}".format( + plan_name, stages_to_add, result["error"] + ) ) ret["result"] = False return ret @@ -2371,10 +2370,10 @@ def usage_plan_association_absent( plan_id, stages_to_remove, **common_args ) if "error" in result: - ret[ - "comment" - ] = "Failed to disassociate a usage plan {} from the apis {}, {}".format( - plan_name, stages_to_remove, result["error"] + ret["comment"] = ( + "Failed to disassociate a usage plan {} from the apis {}, {}".format( + plan_name, stages_to_remove, result["error"] + ) ) ret["result"] = False return ret diff --git a/salt/states/boto_asg.py b/salt/states/boto_asg.py index 58a5baed2ca..2734aec50c3 100644 --- a/salt/states/boto_asg.py +++ b/salt/states/boto_asg.py @@ -191,7 +191,6 @@ Overriding the alarm values on the resource: threshold: 50.0 """ - import copy import hashlib import logging diff --git a/salt/states/boto_cloudfront.py b/salt/states/boto_cloudfront.py index db83cc10b80..fbfe1602eaa 100644 --- a/salt/states/boto_cloudfront.py +++ b/salt/states/boto_cloudfront.py @@ -43,7 +43,6 @@ either passed in as a dict, or a string to pull from pillars or minion config: :depends: boto3 """ - import difflib import logging diff --git a/salt/states/boto_cloudtrail.py b/salt/states/boto_cloudtrail.py index 5699ef2033d..dc8a12b153a 100644 --- a/salt/states/boto_cloudtrail.py +++ b/salt/states/boto_cloudtrail.py @@ -51,7 +51,6 @@ config: """ - import logging import os import os.path diff --git a/salt/states/boto_cloudwatch_alarm.py b/salt/states/boto_cloudwatch_alarm.py index a3737765dff..25600b363e7 100644 --- a/salt/states/boto_cloudwatch_alarm.py +++ b/salt/states/boto_cloudwatch_alarm.py @@ -52,7 +52,6 @@ as a passed in dict, or as a string to pull from pillars or minion config: - arn:aws:sns:us-east-1:1111111:myalerting-action """ - import salt.utils.data diff --git a/salt/states/boto_cloudwatch_event.py b/salt/states/boto_cloudwatch_event.py index 4a421549bfc..65c460ca28b 100644 --- a/salt/states/boto_cloudwatch_event.py +++ b/salt/states/boto_cloudwatch_event.py @@ -51,7 +51,6 @@ config: """ - import logging import os diff --git a/salt/states/boto_cognitoidentity.py b/salt/states/boto_cognitoidentity.py index cb6905a2781..41f8e3dc573 100644 --- a/salt/states/boto_cognitoidentity.py +++ b/salt/states/boto_cognitoidentity.py @@ -45,7 +45,6 @@ config: """ - import logging log = logging.getLogger(__name__) @@ -234,10 +233,10 @@ def pool_present( IdentityPoolName ) else: - ret[ - "comment" - ] = "An existing identity pool named {} with id {} will be updated.".format( - IdentityPoolName, IdentityPoolId + ret["comment"] = ( + "An existing identity pool named {} with id {} will be updated.".format( + IdentityPoolName, IdentityPoolId + ) ) ret["result"] = None return ret @@ -261,10 +260,10 @@ def pool_present( if r.get("created"): updated_identity_pool = r.get("identity_pool") IdentityPoolId = updated_identity_pool.get("IdentityPoolId") - ret[ - "comment" - ] = "A new identity pool with name {}, id {} is created.".format( - IdentityPoolName, IdentityPoolId + ret["comment"] = ( + "A new identity pool with name {}, id {} is created.".format( + IdentityPoolName, IdentityPoolId + ) ) else: ret["result"] = False @@ -280,19 +279,19 @@ def pool_present( if r.get("updated"): updated_identity_pool = r.get("identity_pool") - ret[ - "comment" - ] = "Existing identity pool with name {}, id {} is updated.".format( - IdentityPoolName, IdentityPoolId + ret["comment"] = ( + "Existing identity pool with name {}, id {} is updated.".format( + IdentityPoolName, IdentityPoolId + ) ) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to update an existing identity pool {} {}: {}".format( - IdentityPoolName, - IdentityPoolId, - r["error"].get("message", r["error"]), + ret["comment"] = ( + "Failed to update an existing identity pool {} {}: {}".format( + IdentityPoolName, + IdentityPoolId, + r["error"].get("message", r["error"]), + ) ) return ret @@ -388,10 +387,10 @@ def pool_absent( return ret if __opts__["test"]: - ret[ - "comment" - ] = "The following matched identity pools will be deleted.\n{}".format( - identity_pools + ret["comment"] = ( + "The following matched identity pools will be deleted.\n{}".format( + identity_pools + ) ) ret["result"] = None return ret diff --git a/salt/states/boto_datapipeline.py b/salt/states/boto_datapipeline.py index e42e328791e..40735585868 100644 --- a/salt/states/boto_datapipeline.py +++ b/salt/states/boto_datapipeline.py @@ -48,7 +48,6 @@ config: myDDBTableName: my-dynamo-table """ - import copy import datetime import difflib diff --git a/salt/states/boto_ec2.py b/salt/states/boto_ec2.py index 773016b48a7..fda59c13b5b 100644 --- a/salt/states/boto_ec2.py +++ b/salt/states/boto_ec2.py @@ -50,7 +50,6 @@ The below code deletes a key pair: - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs """ - import logging from time import sleep, time @@ -624,10 +623,10 @@ def snapshot_created( state=images[0].state ) else: - ret[ - "comment" - ] = "AMI with name {ami_name} not found after timeout.".format( - ami_name=ami_name + ret["comment"] = ( + "AMI with name {ami_name} not found after timeout.".format( + ami_name=ami_name + ) ) ret["result"] = False return ret @@ -1007,10 +1006,10 @@ def instance_present( if r[0].get("instance_id"): if r[0]["instance_id"] != instance_id: ret["result"] = False - ret[ - "comment" - ] = "EIP {} is already associated with instance {}.".format( - public_ip if public_ip else allocation_id, r[0]["instance_id"] + ret["comment"] = ( + "EIP {} is already associated with instance {}.".format( + public_ip if public_ip else allocation_id, r[0]["instance_id"] + ) ) return ret else: @@ -1070,10 +1069,10 @@ def instance_present( ) except SaltInvocationError as e: ret["result"] = False - ret[ - "comment" - ] = "Failed to set attribute {} to {} on instance {}.".format( - k, v, instance_name + ret["comment"] = ( + "Failed to set attribute {} to {} on instance {}.".format( + k, v, instance_name + ) ) return ret ret["changes"] = ( @@ -1309,9 +1308,9 @@ def instance_absent( else: # I /believe/ this situation is impossible but let's hedge our bets... ret["result"] = False - ret[ - "comment" - ] = "Can't determine AllocationId for address {}.".format(ip) + ret["comment"] = ( + "Can't determine AllocationId for address {}.".format(ip) + ) return ret else: public_ip = instance.ip_address @@ -1748,14 +1747,14 @@ def volume_present( return ret else: if __opts__["test"]: - ret[ - "comment" - ] = "The volume {} is set to be detached from {}({} and attached on {}({}).".format( - attach_data.instance_id, - attach_data.devic, - volume_id, - instance_id, - device, + ret["comment"] = ( + "The volume {} is set to be detached from {}({} and attached on {}({}).".format( + attach_data.instance_id, + attach_data.devic, + volume_id, + instance_id, + device, + ) ) ret["result"] = None return ret @@ -1956,7 +1955,6 @@ def private_ips_absent( keyid=None, profile=None, ): - """ Ensure an ENI does not have secondary private ip addresses associated with it diff --git a/salt/states/boto_elasticache.py b/salt/states/boto_elasticache.py index f46b2f7a1b4..475f165484f 100644 --- a/salt/states/boto_elasticache.py +++ b/salt/states/boto_elasticache.py @@ -75,7 +75,6 @@ passed in as a dict, or as a string to pull from pillars or minion config: key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs """ - import logging log = logging.getLogger(__name__) @@ -520,9 +519,9 @@ def replication_group_absent( return ret if __opts__["test"]: - ret[ - "comment" - ] = "ElastiCache replication group {} is set to be removed.".format(name) + ret["comment"] = ( + "ElastiCache replication group {} is set to be removed.".format(name) + ) ret["result"] = True return ret deleted = __salt__["boto_elasticache.delete_replication_group"]( diff --git a/salt/states/boto_elasticsearch_domain.py b/salt/states/boto_elasticsearch_domain.py index 4c47222b560..c0f1f8b059b 100644 --- a/salt/states/boto_elasticsearch_domain.py +++ b/salt/states/boto_elasticsearch_domain.py @@ -77,7 +77,6 @@ config: """ - import logging import os @@ -275,11 +274,11 @@ def present( )["domain"] if _status.get("ElasticsearchVersion") != str(ElasticsearchVersion): ret["result"] = False - ret[ - "comment" - ] = "Failed to update domain: version cannot be modified from {} to {}.".format( - _status.get("ElasticsearchVersion"), - str(ElasticsearchVersion), + ret["comment"] = ( + "Failed to update domain: version cannot be modified from {} to {}.".format( + _status.get("ElasticsearchVersion"), + str(ElasticsearchVersion), + ) ) return ret _describe = __salt__["boto_elasticsearch_domain.describe"]( diff --git a/salt/states/boto_elb.py b/salt/states/boto_elb.py index 0fd59a31088..73a3f7d62e3 100644 --- a/salt/states/boto_elb.py +++ b/salt/states/boto_elb.py @@ -234,7 +234,6 @@ Tags can also be set: OtherTag: 'My Other Value' """ - import hashlib import logging import re @@ -730,10 +729,10 @@ def _elb_present( profile=profile, ) if not _security_groups: - ret[ - "comment" - ] = "Security groups {} do not map to valid security group ids.".format( - security_groups + ret["comment"] = ( + "Security groups {} do not map to valid security group ids.".format( + security_groups + ) ) ret["result"] = False return ret @@ -1039,9 +1038,9 @@ def _zones_present(name, availability_zones, region, key, keyid, profile): if enabled: ret["comment"] = "Enabled availability zones on {} ELB.".format(name) else: - ret[ - "comment" - ] = "Failed to enable availability zones on {} ELB.".format(name) + ret["comment"] = ( + "Failed to enable availability zones on {} ELB.".format(name) + ) ret["result"] = False if to_disable: disabled = __salt__["boto_elb.disable_availability_zones"]( diff --git a/salt/states/boto_elbv2.py b/salt/states/boto_elbv2.py index b3c2fe2a2e0..d2eca045f0a 100644 --- a/salt/states/boto_elbv2.py +++ b/salt/states/boto_elbv2.py @@ -66,7 +66,6 @@ def create_target_group( unhealthy_threshold_count=2, **kwargs ): - """ .. versionadded:: 2017.11.0 @@ -348,9 +347,9 @@ def targets_deregistered( changes = True ret["result"] = True else: - ret[ - "comment" - ] = "Target Group {} failed to remove targets".format(name) + ret["comment"] = ( + "Target Group {} failed to remove targets".format(name) + ) failure = True if failure: ret["result"] = False diff --git a/salt/states/boto_iam.py b/salt/states/boto_iam.py index 93400521fce..a5bbd1ee8b3 100644 --- a/salt/states/boto_iam.py +++ b/salt/states/boto_iam.py @@ -1957,9 +1957,9 @@ def saml_provider_present( ET.fromstring(saml_metadata_document) except OSError as e: log.debug(e) - ret[ - "comment" - ] = "SAML document file {} not found or could not be loaded".format(name) + ret["comment"] = ( + "SAML document file {} not found or could not be loaded".format(name) + ) ret["result"] = False return ret for provider in __salt__["boto_iam.list_saml_providers"]( diff --git a/salt/states/boto_iam_role.py b/salt/states/boto_iam_role.py index 67c41f760a0..1ff1abcc5c8 100644 --- a/salt/states/boto_iam_role.py +++ b/salt/states/boto_iam_role.py @@ -344,9 +344,9 @@ def _instance_profile_associated(name, region=None, key=None, keyid=None, profil ret["comment"] = "Instance profile {} associated.".format(name) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to associate {0} instance profile with {0} role.".format(name) + ret["comment"] = ( + "Failed to associate {0} instance profile with {0} role.".format(name) + ) return ret @@ -729,9 +729,9 @@ def _instance_profile_disassociated( ret["comment"] = "Instance profile {} disassociated.".format(name) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to disassociate {0} instance profile from {0} role.".format( - name + ret["comment"] = ( + "Failed to disassociate {0} instance profile from {0} role.".format( + name + ) ) return ret diff --git a/salt/states/boto_lambda.py b/salt/states/boto_lambda.py index cd8bca05f52..2a0cb1c20a3 100644 --- a/salt/states/boto_lambda.py +++ b/salt/states/boto_lambda.py @@ -59,7 +59,6 @@ config: """ - import hashlib import logging import os diff --git a/salt/states/boto_rds.py b/salt/states/boto_rds.py index b5894c1fbd3..e7af123149e 100644 --- a/salt/states/boto_rds.py +++ b/salt/states/boto_rds.py @@ -68,7 +68,6 @@ config: """ - import logging import os @@ -470,9 +469,9 @@ def replica_present( ) if not modified: ret["result"] = False - ret[ - "comment" - ] = "Failed to update parameter group of {} RDS instance.".format(name) + ret["comment"] = ( + "Failed to update parameter group of {} RDS instance.".format(name) + ) ret["changes"]["old"] = pmg_name ret["changes"]["new"] = db_parameter_group_name ret["result"] = True diff --git a/salt/states/boto_route53.py b/salt/states/boto_route53.py index 0143c4e276f..2f2792c6449 100644 --- a/salt/states/boto_route53.py +++ b/salt/states/boto_route53.py @@ -70,7 +70,6 @@ passed in as a dict, or as a string to pull from pillars or minion config: key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs """ - import logging import uuid @@ -186,10 +185,10 @@ def present( log.info("Found private IP %s for instance %s", private_ip, name_tag) else: if public_ip is None: - ret[ - "comment" - ] = "Error: No Public IP assigned to instance with Name {}".format( - name_tag + ret["comment"] = ( + "Error: No Public IP assigned to instance with Name {}".format( + name_tag + ) ) ret["result"] = False return ret diff --git a/salt/states/boto_s3.py b/salt/states/boto_s3.py index d466374cc27..d5ab644a661 100644 --- a/salt/states/boto_s3.py +++ b/salt/states/boto_s3.py @@ -48,7 +48,6 @@ config: :depends: boto3 """ - import copy import difflib import logging diff --git a/salt/states/boto_s3_bucket.py b/salt/states/boto_s3_bucket.py index 66dc68db08d..d3a4067dd47 100644 --- a/salt/states/boto_s3_bucket.py +++ b/salt/states/boto_s3_bucket.py @@ -137,7 +137,6 @@ config: """ - import copy import logging diff --git a/salt/states/boto_secgroup.py b/salt/states/boto_secgroup.py index b4037ad11a2..983ef5b80e5 100644 --- a/salt/states/boto_secgroup.py +++ b/salt/states/boto_secgroup.py @@ -509,9 +509,9 @@ def _rules_present( vpc_name=vpc_name, ) if not sg: - ret[ - "comment" - ] = "{} security group configuration could not be retrieved.".format(name) + ret["comment"] = ( + "{} security group configuration could not be retrieved.".format(name) + ) ret["result"] = False return ret rules = _split_rules(rules) @@ -654,9 +654,9 @@ def _rules_egress_present( vpc_name=vpc_name, ) if not sg: - ret[ - "comment" - ] = "{} security group configuration could not be retrieved.".format(name) + ret["comment"] = ( + "{} security group configuration could not be retrieved.".format(name) + ) ret["result"] = False return ret rules_egress = _split_rules(rules_egress) @@ -882,9 +882,9 @@ def _tags_present( vpc_name=vpc_name, ) if not sg: - ret[ - "comment" - ] = "{} security group configuration could not be retrieved.".format(name) + ret["comment"] = ( + "{} security group configuration could not be retrieved.".format(name) + ) ret["result"] = False return ret tags_to_add = tags diff --git a/salt/states/boto_vpc.py b/salt/states/boto_vpc.py index d822adbbeb7..d0a567fad35 100644 --- a/salt/states/boto_vpc.py +++ b/salt/states/boto_vpc.py @@ -141,7 +141,6 @@ Delete also accepts a VPC peering connection id. """ - import logging import salt.utils.dictupdate as dictupdate @@ -548,7 +547,6 @@ def subnet_present( route_table_name=None, auto_assign_public_ipv4=False, ): - """ Ensure a subnet exists. @@ -2053,10 +2051,10 @@ def vpc_peering_connection_present( keyid=keyid, profile=profile, ): - ret[ - "comment" - ] = "VPC peering {} already requested - pending acceptance by {}".format( - conn_name, peer_owner_id or peer_vpc_name or peer_vpc_id + ret["comment"] = ( + "VPC peering {} already requested - pending acceptance by {}".format( + conn_name, peer_owner_id or peer_vpc_name or peer_vpc_id + ) ) log.info(ret["comment"]) return ret diff --git a/salt/states/bower.py b/salt/states/bower.py index 0c1928ca47c..f6185825b04 100644 --- a/salt/states/bower.py +++ b/salt/states/bower.py @@ -29,7 +29,6 @@ Example: - npm: bower """ - from salt.exceptions import CommandExecutionError, CommandNotFoundError diff --git a/salt/states/cabal.py b/salt/states/cabal.py index 8c415e32c4f..4b38de6eda7 100644 --- a/salt/states/cabal.py +++ b/salt/states/cabal.py @@ -22,7 +22,6 @@ pkg.installed state for the package which provides cabal """ - import salt.utils.path from salt.exceptions import CommandExecutionError, CommandNotFoundError diff --git a/salt/states/chocolatey.py b/salt/states/chocolatey.py index 87dad46a751..5e49113607e 100644 --- a/salt/states/chocolatey.py +++ b/salt/states/chocolatey.py @@ -141,13 +141,13 @@ def installed( ret["comment"] = f"{name} {version} is already installed" else: if allow_multiple: - ret[ - "comment" - ] = f"{name} {version} will be installed side by side with {name} {installed_version} if supported" + ret["comment"] = ( + f"{name} {version} will be installed side by side with {name} {installed_version} if supported" + ) else: - ret[ - "comment" - ] = f"{name} {version} will be installed over {name} {installed_version}" + ret["comment"] = ( + f"{name} {version} will be installed over {name} {installed_version}" + ) force = True else: version = installed_version @@ -374,14 +374,14 @@ def upgraded( if salt.utils.versions.compare( ver1=installed_version, oper="<", ver2=version ): - ret[ - "comment" - ] = f"{name} {installed_version} will be upgraded to version {version}" + ret["comment"] = ( + f"{name} {installed_version} will be upgraded to version {version}" + ) # If installed version is newer than new version else: - ret[ - "comment" - ] = f"{name} {installed_version} (newer) is already installed" + ret["comment"] = ( + f"{name} {installed_version} (newer) is already installed" + ) return ret # Catch all for a condition where version is not passed and there is no # available version diff --git a/salt/states/cimc.py b/salt/states/cimc.py index 09832c99ed4..ac6996211bc 100644 --- a/salt/states/cimc.py +++ b/salt/states/cimc.py @@ -17,7 +17,6 @@ relies on the CIMC proxy module to interface with the device. """ - import logging log = logging.getLogger(__name__) @@ -477,9 +476,9 @@ def user(name, id="", user="", priv="", password="", status="active"): if not conf: ret["result"] = False - ret[ - "comment" - ] = "Unable to find requested user id on device. Please verify id is valid." + ret["comment"] = ( + "Unable to find requested user id on device. Please verify id is valid." + ) return ret updates = __salt__["cimc.set_user"](str(id), user, password, priv, status) diff --git a/salt/states/cloud.py b/salt/states/cloud.py index adb55dcab0f..5cc287db906 100644 --- a/salt/states/cloud.py +++ b/salt/states/cloud.py @@ -13,7 +13,6 @@ Use this minion to spin up a cloud instance: my-ec2-config """ - import pprint import salt.utils.cloud as suc @@ -114,10 +113,10 @@ def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs) if info and "Error" not in info: ret["changes"] = info ret["result"] = True - ret[ - "comment" - ] = "Created instance {} using provider {} and the following options: {}".format( - name, cloud_provider, pprint.pformat(kwargs) + ret["comment"] = ( + "Created instance {} using provider {} and the following options: {}".format( + name, cloud_provider, pprint.pformat(kwargs) + ) ) elif info and "Error" in info: ret["result"] = False diff --git a/salt/states/cmd.py b/salt/states/cmd.py index 5a859c8092c..8518659061f 100644 --- a/salt/states/cmd.py +++ b/salt/states/cmd.py @@ -231,7 +231,6 @@ To use it, one may pass it like this. Example: """ - import copy import logging import os @@ -1100,14 +1099,14 @@ def script( return ret if context and not isinstance(context, dict): - ret[ - "comment" - ] = "Invalidly-formatted 'context' parameter. Must be formed as a dict." + ret["comment"] = ( + "Invalidly-formatted 'context' parameter. Must be formed as a dict." + ) return ret if defaults and not isinstance(defaults, dict): - ret[ - "comment" - ] = "Invalidly-formatted 'defaults' parameter. Must be formed as a dict." + ret["comment"] = ( + "Invalidly-formatted 'defaults' parameter. Must be formed as a dict." + ) return ret if runas and salt.utils.platform.is_windows() and not password: diff --git a/salt/states/composer.py b/salt/states/composer.py index c21ae515098..79629271c17 100644 --- a/salt/states/composer.py +++ b/salt/states/composer.py @@ -161,7 +161,7 @@ def installed( composer_home=composer_home, env=env, ) - except (SaltException) as err: + except SaltException as err: ret["result"] = False ret["comment"] = "Error executing composer in '{}': {}".format(name, err) return ret @@ -172,9 +172,9 @@ def installed( ret["result"] = True if quiet is True: - ret[ - "comment" - ] = "Composer install completed successfully, output silenced by quiet flag" + ret["comment"] = ( + "Composer install completed successfully, output silenced by quiet flag" + ) else: ret["comment"] = "Composer install completed successfully" ret["changes"] = {"stderr": call["stderr"], "stdout": call["stdout"]} @@ -281,7 +281,7 @@ def update( composer_home=composer_home, env=env, ) - except (SaltException) as err: + except SaltException as err: ret["result"] = False ret["comment"] = "Error executing composer in '{}': {}".format(name, err) return ret @@ -292,9 +292,9 @@ def update( ret["result"] = True if quiet is True: - ret[ - "comment" - ] = "Composer update completed successfully, output silenced by quiet flag" + ret["comment"] = ( + "Composer update completed successfully, output silenced by quiet flag" + ) else: ret["comment"] = "Composer update completed successfully" ret["changes"] = {"stderr": call["stderr"], "stdout": call["stdout"]} diff --git a/salt/states/consul.py b/salt/states/consul.py index b35b72649ed..181ebc9ea9d 100644 --- a/salt/states/consul.py +++ b/salt/states/consul.py @@ -20,6 +20,7 @@ The consul module is used to create and manage Consul ACLs consul.acl_absent: - id: 38AC8470-4A83-4140-8DFD-F924CD32917F """ + import logging log = logging.getLogger(__name__) diff --git a/salt/states/cryptdev.py b/salt/states/cryptdev.py index 2b5740f7f79..54a167f7018 100644 --- a/salt/states/cryptdev.py +++ b/salt/states/cryptdev.py @@ -85,9 +85,9 @@ def mapped( # If neither option is set, we've been asked to do nothing. if not immediate and not persist: ret["result"] = False - ret[ - "comment" - ] = "Either persist or immediate must be set, otherwise this state does nothing" + ret["comment"] = ( + "Either persist or immediate must be set, otherwise this state does nothing" + ) return ret if immediate and (keyfile is None or keyfile == "none" or keyfile == "-"): diff --git a/salt/states/debconfmod.py b/salt/states/debconfmod.py index cb93d0d721c..0006e9696fa 100644 --- a/salt/states/debconfmod.py +++ b/salt/states/debconfmod.py @@ -184,7 +184,7 @@ def set(name, data, **kwargs): current = __salt__["debconf.show"](name) - for (key, args) in data.items(): + for key, args in data.items(): # For debconf data, valid booleans are 'true' and 'false'; # But str()'ing the args['value'] will result in 'True' and 'False' # which will be ignored and overridden by a dpkg-reconfigure. diff --git a/salt/states/dellchassis.py b/salt/states/dellchassis.py index 2ac905c8ad2..6f95f4f20df 100644 --- a/salt/states/dellchassis.py +++ b/salt/states/dellchassis.py @@ -153,7 +153,6 @@ pillar stated above: """ - import logging import os diff --git a/salt/states/disk.py b/salt/states/disk.py index c257870c1be..255cc225383 100644 --- a/salt/states/disk.py +++ b/salt/states/disk.py @@ -136,10 +136,10 @@ def _check_min_max(absolute, free, available, used, maximum, minimum, ret): return ret else: if used < minimum: - ret[ - "comment" - ] = "Disk used space is below minimum of {0} {2} at {1} {2}".format( - minimum, used, unit + ret["comment"] = ( + "Disk used space is below minimum of {0} {2} at {1} {2}".format( + minimum, used, unit + ) ) return ret if maximum is not None: @@ -153,10 +153,10 @@ def _check_min_max(absolute, free, available, used, maximum, minimum, ret): return ret else: if used > maximum: - ret[ - "comment" - ] = "Disk used space is above maximum of {0} {2} at {1} {2}".format( - maximum, used, unit + ret["comment"] = ( + "Disk used space is above maximum of {0} {2} at {1} {2}".format( + maximum, used, unit + ) ) return ret ret["comment"] = "Disk used space in acceptable range" diff --git a/salt/states/docker_container.py b/salt/states/docker_container.py index da18c2c6d17..040e8553fd3 100644 --- a/salt/states/docker_container.py +++ b/salt/states/docker_container.py @@ -1877,9 +1877,9 @@ def running( if not _replace(name, temp_container_name): ret["result"] = False return _format_comments(ret, comments) - ret["changes"].setdefault("container_id", {})[ - "added" - ] = temp_container["Id"] + ret["changes"].setdefault("container_id", {})["added"] = ( + temp_container["Id"] + ) else: # No changes between existing container and temp container. # First check if a requisite is asking to send a signal to the @@ -2235,9 +2235,9 @@ def run( if remove is not None: if not ignore_collisions: ret["result"] = False - ret[ - "comment" - ] = "'rm' is an alias for 'auto_remove', they cannot both be used" + ret["comment"] = ( + "'rm' is an alias for 'auto_remove', they cannot both be used" + ) return ret else: remove = bool(val) @@ -2275,9 +2275,9 @@ def run( pass else: ret["result"] = False if failhard and retcode != 0 else True - ret[ - "comment" - ] = "Container ran and exited with a return code of {}".format(retcode) + ret["comment"] = ( + "Container ran and exited with a return code of {}".format(retcode) + ) if remove: id_ = ret.get("changes", {}).get("Id") diff --git a/salt/states/docker_image.py b/salt/states/docker_image.py index 6dbce1b7cac..b2b887ffea3 100644 --- a/salt/states/docker_image.py +++ b/salt/states/docker_image.py @@ -310,10 +310,10 @@ def present( repository=name, tag=tag, base=base, mods=sls, **sls_build_kwargs ) except Exception as exc: # pylint: disable=broad-except - ret[ - "comment" - ] = "Encountered error using SLS {} for building {}: {}".format( - sls, full_image, exc + ret["comment"] = ( + "Encountered error using SLS {} for building {}: {}".format( + sls, full_image, exc + ) ) return ret if image_info is None or image_update["Id"] != image_info["Id"][:12]: diff --git a/salt/states/docker_network.py b/salt/states/docker_network.py index 94ca9696649..4ff8c95382c 100644 --- a/salt/states/docker_network.py +++ b/salt/states/docker_network.py @@ -619,9 +619,9 @@ def present( # Set the comment now to say that it already exists, if we need to # recreate the network with new config we'll update the comment later. - ret[ - "comment" - ] = "Network '{}' already exists, and is configured as specified".format(name) + ret["comment"] = ( + "Network '{}' already exists, and is configured as specified".format(name) + ) log.trace("Details of docker network '%s': %s", name, network) temp_net_name = "".join( @@ -862,9 +862,11 @@ def present( errors.append(str(exc)) else: ret["changes"].setdefault( - "reconnected" - if cid in disconnected_containers - else "connected", + ( + "reconnected" + if cid in disconnected_containers + else "connected" + ), [], ).append(connect_info["Name"]) else: diff --git a/salt/states/dvs.py b/salt/states/dvs.py index 7b4cdf4ba00..5b757c13678 100644 --- a/salt/states/dvs.py +++ b/salt/states/dvs.py @@ -200,7 +200,6 @@ The 5.5.0.2014.1.1 is a known stable version that this original ESXi State Module was developed against. """ - import logging import sys @@ -363,12 +362,12 @@ def dvs_configured(name, dvs): ) updated_infra_res_pools.append(dict(dvs[infra_prop][idx])) if updated_infra_res_pools: - props_to_original_values[ - "infrastructure_traffic_resource_pools" - ] = original_infra_res_pools - props_to_updated_values[ - "infrastructure_traffic_resource_pools" - ] = updated_infra_res_pools + props_to_original_values["infrastructure_traffic_resource_pools"] = ( + original_infra_res_pools + ) + props_to_updated_values["infrastructure_traffic_resource_pools"] = ( + updated_infra_res_pools + ) if props_to_updated_values: if __opts__["test"]: changes_string = "" diff --git a/salt/states/elasticsearch.py b/salt/states/elasticsearch.py index bf58af5913d..ae9a37c3e8e 100644 --- a/salt/states/elasticsearch.py +++ b/salt/states/elasticsearch.py @@ -4,7 +4,6 @@ State module to manage Elasticsearch. .. versionadded:: 2017.7.0 """ - import logging import salt.utils.json @@ -35,9 +34,9 @@ def index_absent(name): ret["comment"] = "Successfully removed index {}".format(name) ret["changes"]["old"] = index[name] else: - ret[ - "comment" - ] = "Failed to remove index {} for unknown reasons".format(name) + ret["comment"] = ( + "Failed to remove index {} for unknown reasons".format(name) + ) else: ret["comment"] = "Index {} is already absent".format(name) except Exception as err: # pylint: disable=broad-except @@ -136,17 +135,17 @@ def alias_absent(name, index): aliases=name, indices=index ) if ret["result"]: - ret[ - "comment" - ] = "Successfully removed alias {} for index {}".format(name, index) + ret["comment"] = ( + "Successfully removed alias {} for index {}".format(name, index) + ) ret["changes"]["old"] = ( alias.get(index, {}).get("aliases", {}).get(name, {}) ) else: - ret[ - "comment" - ] = "Failed to remove alias {} for index {} for unknown reasons".format( - name, index + ret["comment"] = ( + "Failed to remove alias {} for index {} for unknown reasons".format( + name, index + ) ) else: ret["comment"] = "Alias {} for index {} is already absent".format( @@ -198,10 +197,10 @@ def alias_present(name, index, definition=None): if ret["changes"] or not definition: if __opts__["test"]: if not old: - ret[ - "comment" - ] = "Alias {} for index {} does not exist and will be created".format( - name, index + ret["comment"] = ( + "Alias {} for index {} does not exist and will be created".format( + name, index + ) ) else: ret["comment"] = ( @@ -216,16 +215,16 @@ def alias_present(name, index, definition=None): ) if output: if not old: - ret[ - "comment" - ] = "Successfully created alias {} for index {}".format( - name, index + ret["comment"] = ( + "Successfully created alias {} for index {}".format( + name, index + ) ) else: - ret[ - "comment" - ] = "Successfully replaced alias {} for index {}".format( - name, index + ret["comment"] = ( + "Successfully replaced alias {} for index {}".format( + name, index + ) ) else: ret["result"] = False @@ -270,10 +269,10 @@ def index_template_absent(name): ) ret["changes"]["old"] = index_template[name] else: - ret[ - "comment" - ] = "Failed to remove index template {} for unknown reasons".format( - name + ret["comment"] = ( + "Failed to remove index template {} for unknown reasons".format( + name + ) ) else: ret["comment"] = "Index template {} is already absent".format(name) @@ -316,9 +315,9 @@ def index_template_present(name, definition, check_definition=False): ) if not index_template_exists: if __opts__["test"]: - ret[ - "comment" - ] = "Index template {} does not exist and will be created".format(name) + ret["comment"] = ( + "Index template {} does not exist and will be created".format(name) + ) ret["changes"] = {"new": definition} ret["result"] = None else: @@ -357,10 +356,10 @@ def index_template_present(name, definition, check_definition=False): ) if len(diff) != 0: if __opts__["test"]: - ret[ - "comment" - ] = "Index template {} exist but need to be updated".format( - name + ret["comment"] = ( + "Index template {} exist but need to be updated".format( + name + ) ) ret["changes"] = diff ret["result"] = None @@ -369,22 +368,22 @@ def index_template_present(name, definition, check_definition=False): name=name, body=definition ) if output: - ret[ - "comment" - ] = "Successfully updated index template {}".format(name) + ret["comment"] = ( + "Successfully updated index template {}".format(name) + ) ret["changes"] = diff else: ret["result"] = False - ret[ - "comment" - ] = "Cannot update index template {}, {}".format( - name, output + ret["comment"] = ( + "Cannot update index template {}, {}".format( + name, output + ) ) else: - ret[ - "comment" - ] = "Index template {} is already present and up to date".format( - name + ret["comment"] = ( + "Index template {} is already present and up to date".format( + name + ) ) else: ret["comment"] = "Index template {} is already present".format(name) @@ -418,9 +417,9 @@ def pipeline_absent(name): ret["comment"] = "Successfully removed pipeline {}".format(name) ret["changes"]["old"] = pipeline[name] else: - ret[ - "comment" - ] = "Failed to remove pipeline {} for unknown reasons".format(name) + ret["comment"] = ( + "Failed to remove pipeline {} for unknown reasons".format(name) + ) else: ret["comment"] = "Pipeline {} is already absent".format(name) except Exception as err: # pylint: disable=broad-except @@ -465,9 +464,9 @@ def pipeline_present(name, definition): if ret["changes"] or not definition: if __opts__["test"]: if not pipeline: - ret[ - "comment" - ] = "Pipeline {} does not exist and will be created".format(name) + ret["comment"] = ( + "Pipeline {} does not exist and will be created".format(name) + ) else: ret["comment"] = ( "Pipeline {} exists with wrong configuration and will be" @@ -527,10 +526,10 @@ def search_template_absent(name): ) ret["changes"]["old"] = salt.utils.json.loads(template["template"]) else: - ret[ - "comment" - ] = "Failed to remove search template {} for unknown reasons".format( - name + ret["comment"] = ( + "Failed to remove search template {} for unknown reasons".format( + name + ) ) else: ret["comment"] = "Search template {} is already absent".format(name) @@ -575,10 +574,10 @@ def search_template_present(name, definition): if ret["changes"] or not definition: if __opts__["test"]: if not template: - ret[ - "comment" - ] = "Search template {} does not exist and will be created".format( - name + ret["comment"] = ( + "Search template {} does not exist and will be created".format( + name + ) ) else: ret["comment"] = ( @@ -593,13 +592,13 @@ def search_template_present(name, definition): ) if output: if not template: - ret[ - "comment" - ] = "Successfully created search template {}".format(name) + ret["comment"] = ( + "Successfully created search template {}".format(name) + ) else: - ret[ - "comment" - ] = "Successfully replaced search template {}".format(name) + ret["comment"] = ( + "Successfully replaced search template {}".format(name) + ) else: ret["result"] = False ret["comment"] = "Cannot create search template {}, {}".format( diff --git a/salt/states/elasticsearch_index.py b/salt/states/elasticsearch_index.py index 9acd98a629c..48fcbf891c1 100644 --- a/salt/states/elasticsearch_index.py +++ b/salt/states/elasticsearch_index.py @@ -6,7 +6,6 @@ State module to manage Elasticsearch indices Use elasticsearch state instead """ - import logging log = logging.getLogger(__name__) @@ -35,9 +34,9 @@ def absent(name): ret["comment"] = "Successfully removed index {}".format(name) ret["changes"]["old"] = index[name] else: - ret[ - "comment" - ] = "Failed to remove index {} for unknown reasons".format(name) + ret["comment"] = ( + "Failed to remove index {} for unknown reasons".format(name) + ) else: ret["comment"] = "Index {} is already absent".format(name) except Exception as err: # pylint: disable=broad-except diff --git a/salt/states/elasticsearch_index_template.py b/salt/states/elasticsearch_index_template.py index 841fa381b43..61ae82e1838 100644 --- a/salt/states/elasticsearch_index_template.py +++ b/salt/states/elasticsearch_index_template.py @@ -6,7 +6,6 @@ State module to manage Elasticsearch index templates Use elasticsearch state instead """ - import logging log = logging.getLogger(__name__) @@ -39,10 +38,10 @@ def absent(name): ) ret["changes"]["old"] = index_template[name] else: - ret[ - "comment" - ] = "Failed to remove index template {} for unknown reasons".format( - name + ret["comment"] = ( + "Failed to remove index template {} for unknown reasons".format( + name + ) ) else: ret["comment"] = "Index template {} is already absent".format(name) @@ -88,9 +87,9 @@ def present(name, definition): ) if not index_template_exists: if __opts__["test"]: - ret[ - "comment" - ] = "Index template {} does not exist and will be created".format(name) + ret["comment"] = ( + "Index template {} does not exist and will be created".format(name) + ) ret["changes"] = {"new": definition} ret["result"] = None else: diff --git a/salt/states/environ.py b/salt/states/environ.py index c561fb899d4..4c22a98da50 100644 --- a/salt/states/environ.py +++ b/salt/states/environ.py @@ -3,7 +3,6 @@ Support for getting and setting the environment variables of the current salt process. """ - import os import salt.utils.platform diff --git a/salt/states/eselect.py b/salt/states/eselect.py index 18d4f644771..36246efdd99 100644 --- a/salt/states/eselect.py +++ b/salt/states/eselect.py @@ -6,7 +6,6 @@ A state module to manage Gentoo configuration via eselect """ - # Define a function alias in order not to shadow built-in's __func_alias__ = {"set_": "set"} diff --git a/salt/states/esxcluster.py b/salt/states/esxcluster.py index 6cb06df1ab2..b8509b4a329 100644 --- a/salt/states/esxcluster.py +++ b/salt/states/esxcluster.py @@ -48,7 +48,6 @@ The 5.5.0.2014.1.1 is a known stable version that this original ESXi State Module was developed against. """ - import logging import sys from functools import wraps @@ -408,11 +407,11 @@ def vsan_datastore_configured(name, datastore_name): ret.update( { - "result": True - if (not changes_required) - else None - if __opts__["test"] - else True, + "result": ( + True + if (not changes_required) + else None if __opts__["test"] else True + ), "comment": "\n".join(comments), "changes": changes, } @@ -606,13 +605,11 @@ def licenses_configured(name, licenses=None): ret.update( { - "result": True - if (not needs_changes) - else None - if __opts__["test"] - else False - if has_errors - else True, + "result": ( + True + if (not needs_changes) + else None if __opts__["test"] else False if has_errors else True + ), "comment": "\n".join(comments), "changes": changes if not __opts__["test"] else {}, } diff --git a/salt/states/esxdatacenter.py b/salt/states/esxdatacenter.py index c4414c287fa..b341a1ed9bb 100644 --- a/salt/states/esxdatacenter.py +++ b/salt/states/esxdatacenter.py @@ -58,7 +58,6 @@ State configuration: esxdatacenter.datacenter_configured """ - import logging from functools import wraps diff --git a/salt/states/esxi.py b/salt/states/esxi.py index 54a0c58192e..566396e5e7b 100644 --- a/salt/states/esxi.py +++ b/salt/states/esxi.py @@ -1407,11 +1407,11 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): result = ( True if not (changes or errors) - else None # no changes/errors - if __opts__["test"] - else False # running in test mode - if errors - else True + else ( + None # no changes/errors + if __opts__["test"] + else False if errors else True # running in test mode + ) ) # found errors; defaults to True ret.update( {"result": result, "comment": "\n".join(comments), "changes": diskgroup_changes} diff --git a/salt/states/esxvm.py b/salt/states/esxvm.py index a99ccb92c0a..3a429aa8bd6 100644 --- a/salt/states/esxvm.py +++ b/salt/states/esxvm.py @@ -192,7 +192,6 @@ execution functions against ESXi hosts via a Salt Proxy Minion, and a larger sta example. """ - import logging import sys from functools import wraps diff --git a/salt/states/etcd_mod.py b/salt/states/etcd_mod.py index ec8cc96c355..5bf2c0e9175 100644 --- a/salt/states/etcd_mod.py +++ b/salt/states/etcd_mod.py @@ -154,7 +154,6 @@ Available Functions - file: /some/file.txt """ - # Define the module's virtual name __virtualname__ = "etcd" diff --git a/salt/states/ethtool.py b/salt/states/ethtool.py index 3d9fff691ec..2d735fd37dc 100644 --- a/salt/states/ethtool.py +++ b/salt/states/ethtool.py @@ -29,7 +29,6 @@ Configuration of network device """ - import logging from salt.exceptions import CommandExecutionError @@ -118,10 +117,10 @@ def coalesce(name, **kwargs): return ret if new: ret["result"] = None - ret[ - "comment" - ] = "Device {} coalescing settings are set to be updated:\n{}".format( - name, "\n".join(diff) + ret["comment"] = ( + "Device {} coalescing settings are set to be updated:\n{}".format( + name, "\n".join(diff) + ) ) return ret @@ -205,10 +204,10 @@ def ring(name, **kwargs): return ret if new: ret["result"] = None - ret[ - "comment" - ] = "Device {} ring parameters are set to be updated:\n{}".format( - name, "\n".join(diff) + ret["comment"] = ( + "Device {} ring parameters are set to be updated:\n{}".format( + name, "\n".join(diff) + ) ) return ret @@ -284,10 +283,10 @@ def offload(name, **kwargs): return ret if new: ret["result"] = None - ret[ - "comment" - ] = "Device {} offload settings are set to be updated:\n{}".format( - name, "\n".join(diff) + ret["comment"] = ( + "Device {} offload settings are set to be updated:\n{}".format( + name, "\n".join(diff) + ) ) return ret diff --git a/salt/states/event.py b/salt/states/event.py index 2026b2e2032..759bd16dd83 100644 --- a/salt/states/event.py +++ b/salt/states/event.py @@ -2,7 +2,6 @@ Send events through Salt's event system during state runs """ - import salt.utils.functools diff --git a/salt/states/file.py b/salt/states/file.py index 56a7ae2118f..5c084634350 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -277,7 +277,6 @@ For example: """ - import copy import difflib import itertools @@ -1139,7 +1138,7 @@ def _get_template_texts( txtl = [] - for (source, source_hash) in source_list: + for source, source_hash in source_list: tmpctx = defaults if defaults else {} if context: @@ -1897,9 +1896,7 @@ def symlink( fs_entry_type = ( "File" if os.path.isfile(name) - else "Directory" - if os.path.isdir(name) - else "File system entry" + else "Directory" if os.path.isdir(name) else "File system entry" ) return _error( ret, @@ -3113,9 +3110,9 @@ def managed( if not create: if not os.path.isfile(name): # Don't create a file that is not already present - ret[ - "comment" - ] = "File {} is not present and is not set for creation".format(name) + ret["comment"] = ( + "File {} is not present and is not set for creation".format(name) + ) return ret u_check = _check_user(user, group) if u_check: @@ -3178,9 +3175,9 @@ def managed( else: ret["comment"] = "File {} not updated".format(name) elif not ret["changes"] and ret["result"]: - ret[ - "comment" - ] = "File {} exists with proper permissions. No changes made.".format(name) + ret["comment"] = ( + "File {} exists with proper permissions. No changes made.".format(name) + ) return ret accum_data, _ = _load_accumulators() @@ -4084,9 +4081,9 @@ def directory( # As above with user, we need to make sure group exists. if isinstance(gid, str): ret["result"] = False - ret[ - "comment" - ] = "Failed to enforce group ownership for group {}".format(group) + ret["comment"] = ( + "Failed to enforce group ownership for group {}".format(group) + ) else: ret["result"] = False ret["comment"] = ( @@ -6088,9 +6085,9 @@ def blockreplace( ) except Exception as exc: # pylint: disable=broad-except log.exception("Encountered error managing block") - ret[ - "comment" - ] = "Encountered error managing block: {}. See the log for details.".format(exc) + ret["comment"] = ( + "Encountered error managing block: {}. See the log for details.".format(exc) + ) return ret if changes: @@ -7583,16 +7580,16 @@ def copy_( ) ret["result"] = None else: - ret[ - "comment" - ] = 'The target file "{}" exists and will not be overwritten'.format(name) + ret["comment"] = ( + 'The target file "{}" exists and will not be overwritten'.format(name) + ) ret["result"] = True return ret if not changed: - ret[ - "comment" - ] = 'The target file "{}" exists and will not be overwritten'.format(name) + ret["comment"] = ( + 'The target file "{}" exists and will not be overwritten'.format(name) + ) ret["result"] = True return ret @@ -7687,9 +7684,9 @@ def rename(name, source, force=False, makedirs=False, **kwargs): if os.path.lexists(source) and os.path.lexists(name): if not force: - ret[ - "comment" - ] = 'The target file "{}" exists and will not be overwritten'.format(name) + ret["comment"] = ( + 'The target file "{}" exists and will not be overwritten'.format(name) + ) return ret elif not __opts__["test"]: # Remove the destination to prevent problems later @@ -8057,9 +8054,9 @@ def serialize( if not create: if not os.path.isfile(name): # Don't create a file that is not already present - ret[ - "comment" - ] = "File {} is not present and is not set for creation".format(name) + ret["comment"] = ( + "File {} is not present and is not set for creation".format(name) + ) return ret formatter = kwargs.pop("formatter", None) @@ -8337,17 +8334,17 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): else: ret = __salt__["file.check_perms"](name, None, user, group, mode)[0] if not ret["changes"]: - ret[ - "comment" - ] = "Character device {} is in the correct state".format(name) + ret["comment"] = ( + "Character device {} is in the correct state".format(name) + ) elif ntype == "b": # Check for file existence if __salt__["file.file_exists"](name): - ret[ - "comment" - ] = "File {} exists and is not a block device. Refusing to continue".format( - name + ret["comment"] = ( + "File {} exists and is not a block device. Refusing to continue".format( + name + ) ) # Check if it is a block device @@ -8379,10 +8376,10 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): elif ntype == "p": # Check for file existence if __salt__["file.file_exists"](name): - ret[ - "comment" - ] = "File {} exists and is not a fifo pipe. Refusing to continue".format( - name + ret["comment"] = ( + "File {} exists and is not a fifo pipe. Refusing to continue".format( + name + ) ) # Check if it is a fifo @@ -8976,9 +8973,9 @@ def cached( if hash == source_sum["hsum"]: ret["comment"] = "File already cached: {}".format(name) else: - ret[ - "comment" - ] = "Hashes don't match.\nFile will be cached: {}".format(name) + ret["comment"] = ( + "Hashes don't match.\nFile will be cached: {}".format(name) + ) else: ret["comment"] = "No hash found. File will be cached: {}".format(name) else: @@ -8998,10 +8995,10 @@ def cached( ) if local_hash == source_sum["hsum"]: ret["result"] = True - ret[ - "comment" - ] = "File {} is present on the minion and has hash {}".format( - full_path, local_hash + ret["comment"] = ( + "File {} is present on the minion and has hash {}".format( + full_path, local_hash + ) ) else: ret["comment"] = ( @@ -9059,10 +9056,10 @@ def cached( return ret if not local_copy: - ret[ - "comment" - ] = "Failed to cache {}, check minion log for more information".format( - salt.utils.url.redact_http_basic_auth(name) + ret["comment"] = ( + "Failed to cache {}, check minion log for more information".format( + salt.utils.url.redact_http_basic_auth(name) + ) ) return ret @@ -9259,9 +9256,9 @@ def pruned(name, recurse=False, ignore_errors=False, older_than=None): if result: if recurse and res["deleted"]: - ret[ - "comment" - ] = "Recursively removed empty directories under {}".format(name) + ret["comment"] = ( + "Recursively removed empty directories under {}".format(name) + ) ret["changes"]["deleted"] = sorted(res["deleted"]) elif not recurse: ret["comment"] = "Removed directory {}".format(name) diff --git a/salt/states/firewalld.py b/salt/states/firewalld.py index cc6eaba5c3f..2e090326ebc 100644 --- a/salt/states/firewalld.py +++ b/salt/states/firewalld.py @@ -102,7 +102,6 @@ with an example output of: rule service name="snmp" accept """ - import logging import salt.utils.path @@ -204,7 +203,6 @@ def present( rich_rules=None, prune_rich_rules=False, ): - """ Ensure a zone has specific attributes. diff --git a/salt/states/git.py b/salt/states/git.py index 32a597ec74d..d5127437208 100644 --- a/salt/states/git.py +++ b/salt/states/git.py @@ -235,12 +235,16 @@ def _not_fast_forward( "Repository would be updated {}{}, but {}. Set 'force_reset' to " "True{} to force this update{}.{}".format( f"from {pre} to {post}" if local_changes and pre != post else f"to {post}", - f" (after checking out local branch '{branch}')" - if _need_branch_change(branch, local_branch) - else "", - "this is not a fast-forward merge" - if not local_changes - else "there are uncommitted changes", + ( + f" (after checking out local branch '{branch}')" + if _need_branch_change(branch, local_branch) + else "" + ), + ( + "this is not a fast-forward merge" + if not local_changes + else "there are uncommitted changes" + ), " (or 'remote-changes')" if local_changes else "", " and discard these changes" if local_changes else "", branch_msg, @@ -1249,9 +1253,11 @@ def latest( else: actions.append( "Repository would be {} from {} to {}".format( - "hard-reset" - if force_reset and has_remote_rev - else "updated", + ( + "hard-reset" + if force_reset and has_remote_rev + else "updated" + ), _short_sha(local_rev), _short_sha(remote_rev), ) diff --git a/salt/states/github.py b/salt/states/github.py index f93e6e8799d..b1d3e480f2b 100644 --- a/salt/states/github.py +++ b/salt/states/github.py @@ -302,10 +302,10 @@ def team_present( } else: ret["result"] = False - ret[ - "comment" - ] = "Failed to remove repo {} from team {}.".format( - repo_name, name + ret["comment"] = ( + "Failed to remove repo {} from team {}.".format( + repo_name, name + ) ) return ret @@ -373,9 +373,9 @@ def team_present( ) if result: ret["changes"][member] = {} - ret["changes"][member][ - "old" - ] = "User {} is not in team {}".format(member, name) + ret["changes"][member]["old"] = ( + "User {} is not in team {}".format(member, name) + ) ret["changes"][member]["new"] = "User {} is in team {}".format( member, name ) @@ -684,10 +684,10 @@ def repo_present( ret["changes"][team_name] = team_change else: ret["result"] = False - ret[ - "comment" - ] = "Failed to remove repo {} from team {}.".format( - name, team_name + ret["comment"] = ( + "Failed to remove repo {} from team {}.".format( + name, team_name + ) ) return ret @@ -709,10 +709,10 @@ def repo_present( ret["changes"][team_name] = team_change else: ret["result"] = False - ret[ - "comment" - ] = "Failed to remove repo {} from team {}.".format( - name, team_name + ret["comment"] = ( + "Failed to remove repo {} from team {}.".format( + name, team_name + ) ) return ret else: diff --git a/salt/states/glance_image.py b/salt/states/glance_image.py index fe8f7857ce7..385244cb7be 100644 --- a/salt/states/glance_image.py +++ b/salt/states/glance_image.py @@ -22,7 +22,6 @@ Example States - name: cirros """ - __virtualname__ = "glance_image" diff --git a/salt/states/glusterfs.py b/salt/states/glusterfs.py index bfe4fb63380..aefe8499960 100644 --- a/salt/states/glusterfs.py +++ b/salt/states/glusterfs.py @@ -2,7 +2,6 @@ Manage GlusterFS pool. """ - import logging import salt.utils.cloud as suc @@ -105,10 +104,10 @@ def peered(name): ret["comment"] = "Host {} successfully peered".format(name) ret["changes"] = {"new": newpeers, "old": peers} else: - ret[ - "comment" - ] = "Host {} was successfully peered but did not appear in the list of peers".format( - name + ret["comment"] = ( + "Host {} was successfully peered but did not appear in the list of peers".format( + name + ) ) return ret @@ -368,10 +367,10 @@ def op_version(name, version): ret["result"] = True return ret elif __opts__["test"]: - ret[ - "comment" - ] = "An attempt would be made to set the cluster.op-version for {} to {}.".format( - name, version + ret["comment"] = ( + "An attempt would be made to set the cluster.op-version for {} to {}.".format( + name, version + ) ) ret["result"] = None return ret @@ -421,18 +420,18 @@ def max_op_version(name): return ret if current == max_version: - ret[ - "comment" - ] = "The cluster.op-version is already set to the cluster.max-op-version of {}".format( - current + ret["comment"] = ( + "The cluster.op-version is already set to the cluster.max-op-version of {}".format( + current + ) ) ret["result"] = True return ret elif __opts__["test"]: - ret[ - "comment" - ] = "An attempt would be made to set the cluster.op-version to {}.".format( - max_version + ret["comment"] = ( + "An attempt would be made to set the cluster.op-version to {}.".format( + max_version + ) ) ret["result"] = None return ret diff --git a/salt/states/grafana4_dashboard.py b/salt/states/grafana4_dashboard.py index 8f85ebad9cc..fa3414ae6b4 100644 --- a/salt/states/grafana4_dashboard.py +++ b/salt/states/grafana4_dashboard.py @@ -52,7 +52,6 @@ allowing users to manage their own custom rows. type: graph """ - import copy import salt.utils.json diff --git a/salt/states/grafana_dashboard.py b/salt/states/grafana_dashboard.py index 0ba2b5f7622..143eb35c134 100644 --- a/salt/states/grafana_dashboard.py +++ b/salt/states/grafana_dashboard.py @@ -37,7 +37,6 @@ they exist in dashboards. The module will not manage rows that are not defined, allowing users to manage their own custom rows. """ - import copy import requests diff --git a/salt/states/grains.py b/salt/states/grains.py index fadc518a254..8ffe5fe3cc9 100644 --- a/salt/states/grains.py +++ b/salt/states/grains.py @@ -199,10 +199,10 @@ def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM): value = list( set(value).difference(__context__["pending_grains"][name]) ) - ret[ - "comment" - ] = 'Removed value {} from update due to context found in "{}".\n'.format( - value, name + ret["comment"] = ( + 'Removed value {} from update due to context found in "{}".\n'.format( + value, name + ) ) if "pending_grains" not in __context__: __context__["pending_grains"] = {} @@ -378,9 +378,9 @@ def absent(name, destructive=False, delimiter=DEFAULT_TARGET_DELIM, force=False) ret["comment"] = "Grain {} is set to be deleted".format(name) ret["changes"] = {"deleted": name} else: - ret[ - "comment" - ] = "Value for grain {} is set to be deleted (None)".format(name) + ret["comment"] = ( + "Value for grain {} is set to be deleted (None)".format(name) + ) ret["changes"] = {"grain": name, "value": None} return ret ret = __salt__["grains.set"](name, None, destructive=destructive, force=force) @@ -436,9 +436,9 @@ def append(name, value, convert=False, delimiter=DEFAULT_TARGET_DELIM): if grain or name in __grains__: if isinstance(grain, list): if value in grain: - ret[ - "comment" - ] = "Value {1} is already in the list for grain {0}".format(name, value) + ret["comment"] = ( + "Value {1} is already in the list for grain {0}".format(name, value) + ) return ret if __opts__["test"]: ret["result"] = None diff --git a/salt/states/group.py b/salt/states/group.py index 601283fae51..6180b661a6b 100644 --- a/salt/states/group.py +++ b/salt/states/group.py @@ -33,7 +33,6 @@ In Windows, if no domain is specified in the user or group name (i.e. - user2 """ - import sys import salt.utils.platform @@ -188,9 +187,9 @@ def present( # -- if trying to add and delete the same user(s) at the same time. if not set(addusers).isdisjoint(set(delusers)): ret["result"] = None - ret[ - "comment" - ] = "Error. Same user(s) can not be added and deleted simultaneously" + ret["comment"] = ( + "Error. Same user(s) can not be added and deleted simultaneously" + ) return ret changes = _changes(name, gid, addusers, delusers, members) diff --git a/salt/states/hg.py b/salt/states/hg.py index c75e58435fb..f4c5592a41f 100644 --- a/salt/states/hg.py +++ b/salt/states/hg.py @@ -13,7 +13,6 @@ in ~/.ssh/known_hosts, and the remote host has this host's public key. - target: /tmp/example_repo """ - import logging import os import shutil @@ -145,9 +144,9 @@ def _update_repo(ret, name, target, clean, user, identity, rev, opts, update_hea " updating." ) else: - ret[ - "comment" - ] = "No changes found and update_head=False so will skip updating." + ret["comment"] = ( + "No changes found and update_head=False so will skip updating." + ) return ret if rev: diff --git a/salt/states/highstate_doc.py b/salt/states/highstate_doc.py index ea7c27e0125..83bc4db149e 100644 --- a/salt/states/highstate_doc.py +++ b/salt/states/highstate_doc.py @@ -2,7 +2,6 @@ To be used with processors in module `highstate_doc`. """ - __virtualname__ = "highstate_doc" diff --git a/salt/states/host.py b/salt/states/host.py index c70f04d9ed7..eadb30c00a2 100644 --- a/salt/states/host.py +++ b/salt/states/host.py @@ -70,7 +70,6 @@ You can also include comments: """ - import logging import salt.utils.validate.net diff --git a/salt/states/http.py b/salt/states/http.py index 271f06fece1..bef03f01309 100644 --- a/salt/states/http.py +++ b/salt/states/http.py @@ -6,7 +6,6 @@ Perform an HTTP query and statefully return the result .. versionadded:: 2015.5.0 """ - import logging import re import sys diff --git a/salt/states/icinga2.py b/salt/states/icinga2.py index c67e58b3451..f8134630cc1 100644 --- a/salt/states/icinga2.py +++ b/salt/states/icinga2.py @@ -18,7 +18,6 @@ Its output may be stored in a file or in a grain. - output: "/tmp/query_id.txt" """ - import os.path import salt.utils.files @@ -69,10 +68,10 @@ def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): return ret elif __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "Ticket generation would be executed, storing result in grain: {}".format( - grain + ret["comment"] = ( + "Ticket generation would be executed, storing result in grain: {}".format( + grain + ) ) return ret elif grain: @@ -102,10 +101,10 @@ def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): return ret elif __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "Ticket generation would be executed, storing result in file: {}".format( - output + ret["comment"] = ( + "Ticket generation would be executed, storing result in file: {}".format( + output + ) ) return ret elif __opts__["test"]: @@ -156,10 +155,10 @@ def generate_cert(name): # Checking if execution is needed. if os.path.isfile(cert) and os.path.isfile(key): - ret[ - "comment" - ] = "No execution needed. Cert: {} and key: {} already generated.".format( - cert, key + ret["comment"] = ( + "No execution needed. Cert: {} and key: {} already generated.".format( + cert, key + ) ) return ret if __opts__["test"]: diff --git a/salt/states/influxdb_continuous_query.py b/salt/states/influxdb_continuous_query.py index 8c402dc1b09..d769c4d865c 100644 --- a/salt/states/influxdb_continuous_query.py +++ b/salt/states/influxdb_continuous_query.py @@ -86,9 +86,9 @@ def absent(name, database, **client_args): if __salt__["influxdb.continuous_query_exists"](database, name, **client_args): if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "continuous query {} is present and needs to be removed".format(name) + ret["comment"] = ( + "continuous query {} is present and needs to be removed".format(name) + ) return ret if __salt__["influxdb.drop_continuous_query"](database, name, **client_args): ret["comment"] = "continuous query {} has been removed".format(name) diff --git a/salt/states/influxdb_retention_policy.py b/salt/states/influxdb_retention_policy.py index e729269a605..2c4e7fae9ba 100644 --- a/salt/states/influxdb_retention_policy.py +++ b/salt/states/influxdb_retention_policy.py @@ -142,9 +142,9 @@ def absent(name, database, **client_args): if __salt__["influxdb.retention_policy_exists"](database, name, **client_args): if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "retention policy {} is present and needs to be removed".format(name) + ret["comment"] = ( + "retention policy {} is present and needs to be removed".format(name) + ) return ret if __salt__["influxdb.drop_retention_policy"](database, name, **client_args): ret["comment"] = "retention policy {} has been removed".format(name) diff --git a/salt/states/influxdb_user.py b/salt/states/influxdb_user.py index 52f153ccc53..7088a84ed8a 100644 --- a/salt/states/influxdb_user.py +++ b/salt/states/influxdb_user.py @@ -118,9 +118,9 @@ def present(name, passwd, admin=False, grants=None, **client_args): else: if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "User {} will be updated with the following changes:".format(name) + ret["comment"] = ( + "User {} will be updated with the following changes:".format(name) + ) for k, v in ret["changes"].items(): ret["comment"] += "\n{} => {}".format(k, v) ret["changes"] = {} diff --git a/salt/states/infoblox_a.py b/salt/states/infoblox_a.py index 35f3d716aa5..c2b43599c64 100644 --- a/salt/states/infoblox_a.py +++ b/salt/states/infoblox_a.py @@ -48,10 +48,10 @@ def present(name=None, ipv4addr=None, data=None, ensure_data=True, **api_opts): if obj: # warn user that the data was updated and does not match ret["result"] = False - ret[ - "comment" - ] = "** please update the name: {} to equal the updated data name {}".format( - name, data["name"] + ret["comment"] = ( + "** please update the name: {} to equal the updated data name {}".format( + name, data["name"] + ) ) return ret @@ -59,9 +59,9 @@ def present(name=None, ipv4addr=None, data=None, ensure_data=True, **api_opts): obj = obj[0] if not ensure_data: ret["result"] = True - ret[ - "comment" - ] = "infoblox record already created (supplied fields not ensured to match)" + ret["comment"] = ( + "infoblox record already created (supplied fields not ensured to match)" + ) return ret diff = __salt__["infoblox.diff_objects"](data, obj) diff --git a/salt/states/infoblox_cname.py b/salt/states/infoblox_cname.py index 99c42a6d9f8..f02470261d9 100644 --- a/salt/states/infoblox_cname.py +++ b/salt/states/infoblox_cname.py @@ -57,19 +57,19 @@ def present(name=None, data=None, ensure_data=True, **api_opts): if obj: # warn user that the data was updated and does not match ret["result"] = False - ret[ - "comment" - ] = "** please update the name: {} to equal the updated data name {}".format( - name, data["name"] + ret["comment"] = ( + "** please update the name: {} to equal the updated data name {}".format( + name, data["name"] + ) ) return ret if obj: if not ensure_data: ret["result"] = True - ret[ - "comment" - ] = "infoblox record already created (supplied fields not ensured to match)" + ret["comment"] = ( + "infoblox record already created (supplied fields not ensured to match)" + ) return ret diff = __salt__["infoblox.diff_objects"](data, obj) diff --git a/salt/states/infoblox_host_record.py b/salt/states/infoblox_host_record.py index e5c5ecb9529..49f6f0fb15f 100644 --- a/salt/states/infoblox_host_record.py +++ b/salt/states/infoblox_host_record.py @@ -53,19 +53,19 @@ def present(name=None, data=None, ensure_data=True, **api_opts): if obj: # warn user that the host name was updated and does not match ret["result"] = False - ret[ - "comment" - ] = "please update the name: {} to equal the updated data name {}".format( - name, data["name"] + ret["comment"] = ( + "please update the name: {} to equal the updated data name {}".format( + name, data["name"] + ) ) return ret if obj: if not ensure_data: ret["result"] = True - ret[ - "comment" - ] = "infoblox record already created (supplied fields not ensured to match)" + ret["comment"] = ( + "infoblox record already created (supplied fields not ensured to match)" + ) return ret obj = __salt__["infoblox.get_host_advanced"](name=name, **api_opts) diff --git a/salt/states/ini_manage.py b/salt/states/ini_manage.py index 9d3989769c7..5d5e7159bf9 100644 --- a/salt/states/ini_manage.py +++ b/salt/states/ini_manage.py @@ -9,7 +9,6 @@ Manage ini files """ - from salt.utils.odict import OrderedDict __virtualname__ = "ini" diff --git a/salt/states/ipset.py b/salt/states/ipset.py index f59e01f80c9..dd8535a4d28 100644 --- a/salt/states/ipset.py +++ b/salt/states/ipset.py @@ -212,10 +212,10 @@ def present(name, entry=None, family="ipv4", **kwargs): ) else: ret["result"] = False - ret[ - "comment" - ] = "Failed to add to entry {1} to set {0} for family {2}.\n{3}".format( - kwargs["set_name"], _entry, family, command + ret["comment"] = ( + "Failed to add to entry {1} to set {0} for family {2}.\n{3}".format( + kwargs["set_name"], _entry, family, command + ) ) return ret diff --git a/salt/states/iptables.py b/salt/states/iptables.py index 79edd60b8ff..8917f624087 100644 --- a/salt/states/iptables.py +++ b/salt/states/iptables.py @@ -245,6 +245,7 @@ Example rules for IPSec policy: output of iptables-save. This may have unintended consequences on legacy releases of ``iptables``. """ + import copy from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS @@ -324,10 +325,10 @@ def chain_absent(name, table="filter", family="ipv4"): chain_check = __salt__["iptables.check_chain"](table, name, family) if not chain_check: ret["result"] = True - ret[ - "comment" - ] = "iptables {} chain is already absent in {} table for {}".format( - name, table, family + ret["comment"] = ( + "iptables {} chain is already absent in {} table for {}".format( + name, table, family + ) ) return ret if __opts__["test"]: @@ -341,10 +342,10 @@ def chain_absent(name, table="filter", family="ipv4"): if command is True: ret["changes"] = {"locale": name} ret["result"] = True - ret[ - "comment" - ] = "iptables {} chain in {} table delete success for {}".format( - name, table, family + ret["comment"] = ( + "iptables {} chain in {} table delete success for {}".format( + name, table, family + ) ) else: ret["result"] = False @@ -497,10 +498,10 @@ def append(name, table="filter", family="ipv4", **kwargs): return ret else: ret["result"] = False - ret[ - "comment" - ] = "Failed to set iptables rule for {}.\nAttempted rule was {} for {}".format( - name, command.strip(), family + ret["comment"] = ( + "Failed to set iptables rule for {}.\nAttempted rule was {} for {}".format( + name, command.strip(), family + ) ) return ret @@ -633,10 +634,10 @@ def insert(name, table="filter", family="ipv4", **kwargs): return ret else: ret["result"] = False - ret[ - "comment" - ] = "Failed to set iptables rule for {}.\nAttempted rule was {}".format( - name, command.strip() + ret["comment"] = ( + "Failed to set iptables rule for {}.\nAttempted rule was {}".format( + name, command.strip() + ) ) return ret @@ -749,10 +750,10 @@ def delete(name, table="filter", family="ipv4", **kwargs): return ret else: ret["result"] = False - ret[ - "comment" - ] = "Failed to delete iptables rule for {}.\nAttempted rule was {}".format( - name, command.strip() + ret["comment"] = ( + "Failed to delete iptables rule for {}.\nAttempted rule was {}".format( + name, command.strip() + ) ) return ret @@ -788,10 +789,10 @@ def set_policy(name, table="filter", family="ipv4", **kwargs): == kwargs["policy"] ): ret["result"] = True - ret[ - "comment" - ] = "iptables default policy for chain {} on table {} for {} already set to {}".format( - kwargs["chain"], table, family, kwargs["policy"] + ret["comment"] = ( + "iptables default policy for chain {} on table {} for {} already set to {}".format( + kwargs["chain"], table, family, kwargs["policy"] + ) ) return ret if __opts__["test"]: @@ -814,10 +815,10 @@ def set_policy(name, table="filter", family="ipv4", **kwargs): else: filename = None __salt__["iptables.save"](filename=filename, family=family) - ret[ - "comment" - ] = "Set and saved default policy for {} to {} family {}".format( - kwargs["chain"], kwargs["policy"], family + ret["comment"] = ( + "Set and saved default policy for {} to {} family {}".format( + kwargs["chain"], kwargs["policy"], family + ) ) return ret else: @@ -852,10 +853,10 @@ def flush(name, table="filter", family="ipv4", **kwargs): if "chain" not in kwargs: kwargs["chain"] = "" if __opts__["test"]: - ret[ - "comment" - ] = "iptables rules in {} table {} chain {} family needs to be flushed".format( - name, table, family + ret["comment"] = ( + "iptables rules in {} table {} chain {} family needs to be flushed".format( + name, table, family + ) ) return ret if not __salt__["iptables.flush"](table, kwargs["chain"], family): diff --git a/salt/states/jboss7.py b/salt/states/jboss7.py index 8d3438d9940..1b018196244 100644 --- a/salt/states/jboss7.py +++ b/salt/states/jboss7.py @@ -35,7 +35,6 @@ For the sake of brevity, examples for each state assume that jboss_config is con """ - import logging import re import time @@ -649,10 +648,10 @@ def reloaded(name, jboss_config, timeout=60, interval=5): ret["changes"]["reloaded"] = "configuration" else: ret["result"] = False - ret[ - "comment" - ] = "Could not reload the configuration. Timeout ({} s) exceeded. ".format( - timeout + ret["comment"] = ( + "Could not reload the configuration. Timeout ({} s) exceeded. ".format( + timeout + ) ) if not status["success"]: ret["comment"] = __append_comment( diff --git a/salt/states/jenkins.py b/salt/states/jenkins.py index 3b04caf3b0c..4386577a420 100644 --- a/salt/states/jenkins.py +++ b/salt/states/jenkins.py @@ -6,7 +6,6 @@ Management of Jenkins """ - import difflib import io import logging diff --git a/salt/states/kapacitor.py b/salt/states/kapacitor.py index 23f99ff2e8a..07d33b2457c 100644 --- a/salt/states/kapacitor.py +++ b/salt/states/kapacitor.py @@ -15,6 +15,7 @@ Kapacitor state module. .. versionadded:: 2016.11.0 """ + import difflib import salt.utils.files diff --git a/salt/states/kernelpkg.py b/salt/states/kernelpkg.py index 0f535e74038..85476c071da 100644 --- a/salt/states/kernelpkg.py +++ b/salt/states/kernelpkg.py @@ -99,9 +99,9 @@ def latest_installed(name, **kwargs): # pylint: disable=unused-argument result = __salt__["kernelpkg.upgrade"]() ret["result"] = True ret["changes"] = result["upgrades"] - ret[ - "comment" - ] = "The latest kernel package has been installed, but not activated." + ret["comment"] = ( + "The latest kernel package has been installed, but not activated." + ) return ret diff --git a/salt/states/keystone_domain.py b/salt/states/keystone_domain.py index b8df63b9871..a639aec50f3 100644 --- a/salt/states/keystone_domain.py +++ b/salt/states/keystone_domain.py @@ -26,7 +26,6 @@ Example States - name: domain1 """ - __virtualname__ = "keystone_domain" diff --git a/salt/states/keystone_endpoint.py b/salt/states/keystone_endpoint.py index 279c3be23f6..56b30d20d0a 100644 --- a/salt/states/keystone_endpoint.py +++ b/salt/states/keystone_endpoint.py @@ -36,7 +36,6 @@ Example States - service_name: glance """ - __virtualname__ = "keystone_endpoint" diff --git a/salt/states/keystone_group.py b/salt/states/keystone_group.py index ac6077a3f9a..678b5ebce83 100644 --- a/salt/states/keystone_group.py +++ b/salt/states/keystone_group.py @@ -26,7 +26,6 @@ Example States - description: 'my group' """ - __virtualname__ = "keystone_group" diff --git a/salt/states/keystone_project.py b/salt/states/keystone_project.py index b6db7cc2033..49d0b80f61f 100644 --- a/salt/states/keystone_project.py +++ b/salt/states/keystone_project.py @@ -27,7 +27,6 @@ Example States - description: 'my project' """ - __virtualname__ = "keystone_project" diff --git a/salt/states/keystone_role.py b/salt/states/keystone_role.py index 1cb938a4a51..3ca384bdbf4 100644 --- a/salt/states/keystone_role.py +++ b/salt/states/keystone_role.py @@ -25,7 +25,6 @@ Example States - description: 'my group' """ - __virtualname__ = "keystone_role" diff --git a/salt/states/keystone_role_grant.py b/salt/states/keystone_role_grant.py index edc17a1148c..d908cf93af5 100644 --- a/salt/states/keystone_role_grant.py +++ b/salt/states/keystone_role_grant.py @@ -26,7 +26,6 @@ Example States - description: 'my group' """ - __virtualname__ = "keystone_role_grant" diff --git a/salt/states/keystone_service.py b/salt/states/keystone_service.py index 988eae706e6..4a62e711465 100644 --- a/salt/states/keystone_service.py +++ b/salt/states/keystone_service.py @@ -28,7 +28,6 @@ Example States - description: 'OpenStack Image' """ - __virtualname__ = "keystone_service" diff --git a/salt/states/keystone_user.py b/salt/states/keystone_user.py index 8f9ec9f8c8d..527d71916ad 100644 --- a/salt/states/keystone_user.py +++ b/salt/states/keystone_user.py @@ -29,7 +29,6 @@ Example States - description: 'my user' """ - __virtualname__ = "keystone_user" diff --git a/salt/states/keystore.py b/salt/states/keystore.py index 5990c9d1e0c..de1586e1a5f 100644 --- a/salt/states/keystore.py +++ b/salt/states/keystore.py @@ -2,7 +2,6 @@ State management of a java keystore """ - import logging import os diff --git a/salt/states/libcloud_loadbalancer.py b/salt/states/libcloud_loadbalancer.py index c49ea093c1f..b10bb0b854c 100644 --- a/salt/states/libcloud_loadbalancer.py +++ b/salt/states/libcloud_loadbalancer.py @@ -45,7 +45,6 @@ Using States to deploy a load balancer with extended arguments to specify region :depends: apache-libcloud """ - import logging log = logging.getLogger(__name__) diff --git a/salt/states/libcloud_storage.py b/salt/states/libcloud_storage.py index a2a70f44389..641155f4cea 100644 --- a/salt/states/libcloud_storage.py +++ b/salt/states/libcloud_storage.py @@ -63,7 +63,6 @@ This example will download the file from the remote cloud and keep it locally :depends: apache-libcloud """ - import logging log = logging.getLogger(__name__) diff --git a/salt/states/linux_acl.py b/salt/states/linux_acl.py index c45c9383487..582b6bb8b7d 100644 --- a/salt/states/linux_acl.py +++ b/salt/states/linux_acl.py @@ -52,7 +52,6 @@ Ensure a Linux ACL list does not exist - perms: rwx """ - import logging import os diff --git a/salt/states/locale.py b/salt/states/locale.py index 23a8c8684f7..856e17d2747 100644 --- a/salt/states/locale.py +++ b/salt/states/locale.py @@ -17,7 +17,6 @@ Manage the available locales and the system default: - locale: us_locale """ - from salt.exceptions import CommandExecutionError diff --git a/salt/states/logrotate.py b/salt/states/logrotate.py index fcac9f20ff3..aaeb49cec0f 100644 --- a/salt/states/logrotate.py +++ b/salt/states/logrotate.py @@ -5,7 +5,6 @@ Module for managing logrotate. """ - _DEFAULT_CONF = "/etc/logrotate.conf" # Define the module's virtual name diff --git a/salt/states/loop.py b/salt/states/loop.py index 6b787393858..e99ab55abbe 100644 --- a/salt/states/loop.py +++ b/salt/states/loop.py @@ -57,7 +57,6 @@ The function :py:func:`data.subdict_match ` check instances: "{{ instance }}" """ - import logging import operator import sys @@ -222,10 +221,10 @@ def until_no_eval( break time.sleep(period) else: - ret[ - "comment" - ] = "Call did not produce the expected result after {} attempts".format( - current_attempt + ret["comment"] = ( + "Call did not produce the expected result after {} attempts".format( + current_attempt + ) ) log.debug( "%s:until_no_eval:\n\t\tResults of all attempts: %s", diff --git a/salt/states/lvm.py b/salt/states/lvm.py index b48bf6dde3a..a7a1df8b609 100644 --- a/salt/states/lvm.py +++ b/salt/states/lvm.py @@ -342,18 +342,18 @@ def lv_present( else: # ignore percentage "extents" if the logical volume already exists if "%" in str(extents): - ret[ - "comment" - ] = "Logical Volume {} already present, {} won't be resized.".format( - name, extents + ret["comment"] = ( + "Logical Volume {} already present, {} won't be resized.".format( + name, extents + ) ) extents = old_extents size_mb = old_size_mb if force is False and (size_mb < old_size_mb or extents < old_extents): - ret[ - "comment" - ] = "To reduce a Logical Volume option 'force' must be True." + ret["comment"] = ( + "To reduce a Logical Volume option 'force' must be True." + ) ret["result"] = False return ret @@ -378,9 +378,9 @@ def lv_present( ) if not changes: - ret[ - "comment" - ] = "Failed to resize Logical Volume. Unknown Error." + ret["comment"] = ( + "Failed to resize Logical Volume. Unknown Error." + ) ret["result"] = False lv_info = __salt__["lvm.lvdisplay"](lvpath, quiet=True)[lvpath] @@ -389,10 +389,10 @@ def lv_present( ret["comment"] = "Resized Logical Volume {}".format(name) ret["changes"]["resized"] = changes else: - ret[ - "comment" - ] = "Failed to resize Logical Volume {}.\nError: {}".format( - name, changes["Output from lvresize"] + ret["comment"] = ( + "Failed to resize Logical Volume {}.\nError: {}".format( + name, changes["Output from lvresize"] + ) ) ret["result"] = False return ret diff --git a/salt/states/lvs_server.py b/salt/states/lvs_server.py index 1c0eb81fb69..4d86848b9de 100644 --- a/salt/states/lvs_server.py +++ b/salt/states/lvs_server.py @@ -91,27 +91,27 @@ def present( weight=weight, ) if server_edit is True: - ret[ - "comment" - ] = "LVS Server {} in service {}({}) has been updated".format( - name, service_address, protocol + ret["comment"] = ( + "LVS Server {} in service {}({}) has been updated".format( + name, service_address, protocol + ) ) ret["changes"][name] = "Update" return ret else: ret["result"] = False - ret[ - "comment" - ] = "LVS Server {} in service {}({}) update failed({})".format( - name, service_address, protocol, server_edit + ret["comment"] = ( + "LVS Server {} in service {}({}) update failed({})".format( + name, service_address, protocol, server_edit + ) ) return ret else: if __opts__["test"]: - ret[ - "comment" - ] = "LVS Server {} in service {}({}) is not present and needs to be created".format( - name, service_address, protocol + ret["comment"] = ( + "LVS Server {} in service {}({}) is not present and needs to be created".format( + name, service_address, protocol + ) ) ret["result"] = None return ret @@ -124,18 +124,18 @@ def present( weight=weight, ) if server_add is True: - ret[ - "comment" - ] = "LVS Server {} in service {}({}) has been created".format( - name, service_address, protocol + ret["comment"] = ( + "LVS Server {} in service {}({}) has been created".format( + name, service_address, protocol + ) ) ret["changes"][name] = "Present" return ret else: - ret[ - "comment" - ] = "LVS Service {} in service {}({}) create failed({})".format( - name, service_address, protocol, server_add + ret["comment"] = ( + "LVS Service {} in service {}({}) create failed({})".format( + name, service_address, protocol, server_add + ) ) ret["result"] = False return ret @@ -168,10 +168,10 @@ def absent(name, protocol=None, service_address=None, server_address=None): if server_check is True: if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "LVS Server {} in service {}({}) is present and needs to be removed".format( - name, service_address, protocol + ret["comment"] = ( + "LVS Server {} in service {}({}) is present and needs to be removed".format( + name, service_address, protocol + ) ) return ret server_delete = __salt__["lvs.delete_server"]( @@ -186,18 +186,18 @@ def absent(name, protocol=None, service_address=None, server_address=None): ret["changes"][name] = "Absent" return ret else: - ret[ - "comment" - ] = "LVS Server {} in service {}({}) removed failed({})".format( - name, service_address, protocol, server_delete + ret["comment"] = ( + "LVS Server {} in service {}({}) removed failed({})".format( + name, service_address, protocol, server_delete + ) ) ret["result"] = False return ret else: - ret[ - "comment" - ] = "LVS Server {} in service {}({}) is not present, so it cannot be removed".format( - name, service_address, protocol + ret["comment"] = ( + "LVS Server {} in service {}({}) is not present, so it cannot be removed".format( + name, service_address, protocol + ) ) return ret diff --git a/salt/states/lvs_service.py b/salt/states/lvs_service.py index 4e12c321773..8aee6a062f0 100644 --- a/salt/states/lvs_service.py +++ b/salt/states/lvs_service.py @@ -58,10 +58,10 @@ def present( else: if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "LVS Service {} is present but some options should update".format( - name + ret["comment"] = ( + "LVS Service {} is present but some options should update".format( + name + ) ) return ret else: @@ -80,9 +80,9 @@ def present( return ret else: if __opts__["test"]: - ret[ - "comment" - ] = "LVS Service {} is not present and needs to be created".format(name) + ret["comment"] = ( + "LVS Service {} is not present and needs to be created".format(name) + ) ret["result"] = None return ret else: @@ -141,8 +141,8 @@ def absent(name, protocol=None, service_address=None): ret["result"] = False return ret else: - ret[ - "comment" - ] = "LVS Service {} is not present, so it cannot be removed".format(name) + ret["comment"] = ( + "LVS Service {} is not present, so it cannot be removed".format(name) + ) return ret diff --git a/salt/states/lxc.py b/salt/states/lxc.py index 51dae0b92c6..98ccd67fcb2 100644 --- a/salt/states/lxc.py +++ b/salt/states/lxc.py @@ -3,7 +3,6 @@ Manage Linux Containers ======================= """ - from salt.exceptions import CommandExecutionError, SaltInvocationError __docformat__ = "restructuredtext en" diff --git a/salt/states/lxd.py b/salt/states/lxd.py index e5ddbf382af..30991ab1e8d 100644 --- a/salt/states/lxd.py +++ b/salt/states/lxd.py @@ -27,7 +27,6 @@ Manage LXD profiles. :platform: Linux """ - import os.path from salt.exceptions import CommandExecutionError, SaltInvocationError diff --git a/salt/states/lxd_container.py b/salt/states/lxd_container.py index 014c0265522..065e267c5fd 100644 --- a/salt/states/lxd_container.py +++ b/salt/states/lxd_container.py @@ -27,7 +27,6 @@ Manage LXD containers. :platform: Linux """ - from salt.exceptions import CommandExecutionError, SaltInvocationError __docformat__ = "restructuredtext en" @@ -580,9 +579,9 @@ def frozen(name, start=True, remote_addr=None, cert=None, key=None, verify_cert= elif not is_running and start: if __opts__["test"]: - ret["changes"][ - "started" - ] = 'Would start the container "{}" and freeze it after'.format(name) + ret["changes"]["started"] = ( + 'Would start the container "{}" and freeze it after'.format(name) + ) return _unchanged(ret, ret["changes"]["started"]) else: container.start(wait=True) @@ -780,10 +779,10 @@ def migrated( return _error(ret, 'Source Container "{}" not found'.format(name)) if __opts__["test"]: - ret["changes"][ - "migrated" - ] = 'Would migrate the container "{}" from "{}" to "{}"'.format( - name, src_remote_addr, remote_addr + ret["changes"]["migrated"] = ( + 'Would migrate the container "{}" from "{}" to "{}"'.format( + name, src_remote_addr, remote_addr + ) ) return _unchanged(ret, ret["changes"]["migrated"]) diff --git a/salt/states/lxd_image.py b/salt/states/lxd_image.py index c6d554ee284..5fc991b6466 100644 --- a/salt/states/lxd_image.py +++ b/salt/states/lxd_image.py @@ -28,7 +28,6 @@ Manage LXD images. :platform: Linux """ - from salt.exceptions import CommandExecutionError, SaltInvocationError __docformat__ = "restructuredtext en" diff --git a/salt/states/lxd_profile.py b/salt/states/lxd_profile.py index a4a0176ad39..35c781941b7 100644 --- a/salt/states/lxd_profile.py +++ b/salt/states/lxd_profile.py @@ -27,7 +27,6 @@ Manage LXD profiles. :platform: Linux """ - from salt.exceptions import CommandExecutionError, SaltInvocationError __docformat__ = "restructuredtext en" @@ -156,10 +155,10 @@ def present( # Description change # if str(profile.description) != str(description): - ret["changes"][ - "description" - ] = 'Description changed, from "{}" to "{}".'.format( - profile.description, description + ret["changes"]["description"] = ( + 'Description changed, from "{}" to "{}".'.format( + profile.description, description + ) ) profile.description = description diff --git a/salt/states/mdadm_raid.py b/salt/states/mdadm_raid.py index 7f32f3bd991..9d7fb7e9557 100644 --- a/salt/states/mdadm_raid.py +++ b/salt/states/mdadm_raid.py @@ -19,7 +19,6 @@ A state module for creating or destroying software RAID devices. - run: True """ - import logging import salt.utils.path @@ -100,20 +99,20 @@ def present(name, level, devices, **kwargs): new_devices.append(dev) if len(uuid_dict) > 1: - ret[ - "comment" - ] = "Devices are a mix of RAID constituents with multiple MD_UUIDs: {}.".format( - sorted(uuid_dict) + ret["comment"] = ( + "Devices are a mix of RAID constituents with multiple MD_UUIDs: {}.".format( + sorted(uuid_dict) + ) ) ret["result"] = False return ret elif len(uuid_dict) == 1: uuid = next(iter(uuid_dict)) if present and present["uuid"] != uuid: - ret[ - "comment" - ] = "Devices MD_UUIDs: {} differs from present RAID uuid {}.".format( - uuid, present["uuid"] + ret["comment"] = ( + "Devices MD_UUIDs: {} differs from present RAID uuid {}.".format( + uuid, present["uuid"] + ) ) ret["result"] = False return ret diff --git a/salt/states/memcached.py b/salt/states/memcached.py index 9f4a6d367dd..14cfd6771c2 100644 --- a/salt/states/memcached.py +++ b/salt/states/memcached.py @@ -5,7 +5,6 @@ States for Management of Memcached Keys .. versionadded:: 2014.1.0 """ - from salt.exceptions import CommandExecutionError, SaltInvocationError from salt.modules.memcached import ( DEFAULT_HOST, diff --git a/salt/states/modjk_worker.py b/salt/states/modjk_worker.py index bcf745c03eb..120531356b3 100644 --- a/salt/states/modjk_worker.py +++ b/salt/states/modjk_worker.py @@ -127,16 +127,16 @@ def _talk2modjk(name, lbn, target, action, profile="default", tgt_type="glob"): return ret if status["errors"]: ret["result"] = False - ret[ - "comment" - ] = "the following balancers could not find the worker {}: {}".format( - name, status["errors"] + ret["comment"] = ( + "the following balancers could not find the worker {}: {}".format( + name, status["errors"] + ) ) return ret if not status["wrong_state"]: - ret[ - "comment" - ] = "the worker is in the desired activation state on all the balancers" + ret["comment"] = ( + "the worker is in the desired activation state on all the balancers" + ) return ret else: ret["comment"] = "the action {} will be sent to the balancers {}".format( diff --git a/salt/states/module.py b/salt/states/module.py index 5ad87b053d2..e6422e146f8 100644 --- a/salt/states/module.py +++ b/salt/states/module.py @@ -300,6 +300,7 @@ Windows system: .. _file_roots: https://docs.saltproject.io/en/latest/ref/configuration/master.html#file-roots """ + import logging import salt.loader @@ -464,9 +465,11 @@ def _run(**kwargs): success.append( "{}: {}".format( func, - func_ret.get("comment", "Success") - if isinstance(func_ret, dict) - else func_ret, + ( + func_ret.get("comment", "Success") + if isinstance(func_ret, dict) + else func_ret + ), ) ) ret["changes"][func] = func_ret diff --git a/salt/states/mount.py b/salt/states/mount.py index 36b9a16b5d0..c820d268325 100644 --- a/salt/states/mount.py +++ b/salt/states/mount.py @@ -477,10 +477,10 @@ def mounted( if trigger_remount: if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "Remount would be forced because options ({}) changed".format( - ",".join(sorted(trigger_remount)) + ret["comment"] = ( + "Remount would be forced because options ({}) changed".format( + ",".join(sorted(trigger_remount)) + ) ) return ret else: @@ -642,9 +642,9 @@ def mounted( elif mkmnt: ret["comment"] = "{} would be created and mounted".format(name) else: - ret[ - "comment" - ] = "{} does not exist and would not be created".format(name) + ret["comment"] = ( + "{} does not exist and would not be created".format(name) + ) return ret if not os.path.exists(name) and not mkmnt: @@ -670,10 +670,10 @@ def mounted( if mkmnt: ret["comment"] = "{} would be created, but not mounted".format(name) else: - ret[ - "comment" - ] = "{} does not exist and would neither be created nor mounted".format( - name + ret["comment"] = ( + "{} does not exist and would neither be created nor mounted".format( + name + ) ) elif mkmnt: __salt__["file.mkdir"](name, user=user) @@ -861,10 +861,10 @@ def swap(name, persist=True, config="/etc/fstab"): ]: ret["result"] = None if name in on_: - ret[ - "comment" - ] = "Swap {} is set to be added to the fstab and to be activated".format( - name + ret["comment"] = ( + "Swap {} is set to be added to the fstab and to be activated".format( + name + ) ) return ret diff --git a/salt/states/mssql_database.py b/salt/states/mssql_database.py index e5c4c3cc67f..532a93fa5b7 100644 --- a/salt/states/mssql_database.py +++ b/salt/states/mssql_database.py @@ -51,10 +51,10 @@ def present(name, containment="NONE", options=None, **kwargs): ret = {"name": name, "changes": {}, "result": True, "comment": ""} if __salt__["mssql.db_exists"](name, **kwargs): - ret[ - "comment" - ] = "Database {} is already present (Not going to try to set its options)".format( - name + ret["comment"] = ( + "Database {} is already present (Not going to try to set its options)".format( + name + ) ) return ret if __opts__["test"]: diff --git a/salt/states/mssql_login.py b/salt/states/mssql_login.py index 89ace89bcaf..d635a3c42e0 100644 --- a/salt/states/mssql_login.py +++ b/salt/states/mssql_login.py @@ -67,10 +67,10 @@ def present( ret["comment"] = "One and only one of password and domain should be specifies" return ret if __salt__["mssql.login_exists"](name, domain=domain, **kwargs): - ret[ - "comment" - ] = "Login {} is already present (Not going to try to set its password)".format( - name + ret["comment"] = ( + "Login {} is already present (Not going to try to set its password)".format( + name + ) ) return ret if __opts__["test"]: diff --git a/salt/states/mssql_role.py b/salt/states/mssql_role.py index 2fbdfe172a7..5434c226512 100644 --- a/salt/states/mssql_role.py +++ b/salt/states/mssql_role.py @@ -35,10 +35,10 @@ def present(name, owner=None, grants=None, **kwargs): ret = {"name": name, "changes": {}, "result": True, "comment": ""} if __salt__["mssql.role_exists"](name, **kwargs): - ret[ - "comment" - ] = "Role {} is already present (Not going to try to set its grants)".format( - name + ret["comment"] = ( + "Role {} is already present (Not going to try to set its grants)".format( + name + ) ) return ret if __opts__["test"]: diff --git a/salt/states/mssql_user.py b/salt/states/mssql_user.py index d07c0d56cca..f7acf30489e 100644 --- a/salt/states/mssql_user.py +++ b/salt/states/mssql_user.py @@ -66,10 +66,10 @@ def present( ret["comment"] = "domain cannot be set without login" return ret if __salt__["mssql.user_exists"](name, domain=domain, database=database, **kwargs): - ret[ - "comment" - ] = "User {} is already present (Not going to try to set its roles or options)".format( - name + ret["comment"] = ( + "User {} is already present (Not going to try to set its roles or options)".format( + name + ) ) return ret if __opts__["test"]: diff --git a/salt/states/msteams.py b/salt/states/msteams.py index d84387c7d68..d061051c5d0 100644 --- a/salt/states/msteams.py +++ b/salt/states/msteams.py @@ -21,7 +21,6 @@ The hook_url can be specified in the master or minion configuration like below: hook_url: https://outlook.office.com/webhook/837 """ - from salt.exceptions import SaltInvocationError diff --git a/salt/states/mysql_grants.py b/salt/states/mysql_grants.py index acc9856a1f4..cefba9465bc 100644 --- a/salt/states/mysql_grants.py +++ b/salt/states/mysql_grants.py @@ -257,28 +257,28 @@ def absent( else: err = _get_mysql_error() if err is not None: - ret[ - "comment" - ] = "Unable to revoke grant {} on {} for {}@{} ({})".format( - grant, database, user, host, err + ret["comment"] = ( + "Unable to revoke grant {} on {} for {}@{} ({})".format( + grant, database, user, host, err + ) ) ret["result"] = False return ret else: err = _get_mysql_error() if err is not None: - ret[ - "comment" - ] = "Unable to determine if grant {} on {} for {}@{} exists ({})".format( - grant, database, user, host, err + ret["comment"] = ( + "Unable to determine if grant {} on {} for {}@{} exists ({})".format( + grant, database, user, host, err + ) ) ret["result"] = False return ret # fallback - ret[ - "comment" - ] = "Grant {} on {} to {}@{} is not present, so it cannot be revoked".format( - grant, database, user, host + ret["comment"] = ( + "Grant {} on {} to {}@{} is not present, so it cannot be revoked".format( + grant, database, user, host + ) ) return ret diff --git a/salt/states/mysql_query.py b/salt/states/mysql_query.py index be4ee5169a6..46bac68c201 100644 --- a/salt/states/mysql_query.py +++ b/salt/states/mysql_query.py @@ -19,7 +19,6 @@ Its output may be stored in a file or in a grain. - output: "/tmp/query_id.txt" """ - import os.path import sys diff --git a/salt/states/netntp.py b/salt/states/netntp.py index 27a8b09713f..e0efb1b14a5 100644 --- a/salt/states/netntp.py +++ b/salt/states/netntp.py @@ -80,21 +80,18 @@ def _default_ret(name): def _retrieve_ntp_peers(): - """Retrieves configured NTP peers""" return __salt__["ntp.peers"]() def _retrieve_ntp_servers(): - """Retrieves configured NTP servers""" return __salt__["ntp.servers"]() def _check(peers): - """Checks whether the input is a valid list of peers and transforms domain names into IP Addresses""" if not isinstance(peers, list): @@ -141,28 +138,24 @@ def _clean(lst): def _set_ntp_peers(peers): - """Calls ntp.set_peers.""" return __salt__["ntp.set_peers"](*peers, commit=False) def _set_ntp_servers(servers): - """Calls ntp.set_servers.""" return __salt__["ntp.set_servers"](*servers, commit=False) def _delete_ntp_peers(peers): - """Calls ntp.delete_peers.""" return __salt__["ntp.delete_peers"](*peers, commit=False) def _delete_ntp_servers(servers): - """Calls ntp.delete_servers.""" return __salt__["ntp.delete_servers"](*servers, commit=False) @@ -276,7 +269,6 @@ def _check_diff_and_configure(fun_name, peers_servers, name="peers"): def managed(name, peers=None, servers=None): - """ Manages the configuration of NTP peers and servers on the device, as specified in the state SLS file. NTP entities not specified in these lists will be removed whilst entities not configured on the device will be set. @@ -334,15 +326,15 @@ def managed(name, peers=None, servers=None): return ret # just exit if isinstance(peers, list) and not _check(peers): # check and clean peers - ret[ - "comment" - ] = "NTP peers must be a list of valid IP Addresses or Domain Names" + ret["comment"] = ( + "NTP peers must be a list of valid IP Addresses or Domain Names" + ) return ret if isinstance(servers, list) and not _check(servers): # check and clean servers - ret[ - "comment" - ] = "NTP servers must be a list of valid IP Addresses or Domain Names" + ret["comment"] = ( + "NTP servers must be a list of valid IP Addresses or Domain Names" + ) return ret # ----- Retrieve existing NTP peers and determine peers to be added/removed ---------------------------------------> diff --git a/salt/states/netsnmp.py b/salt/states/netsnmp.py index a0f0d50b5f5..325ca88e9f7 100644 --- a/salt/states/netsnmp.py +++ b/salt/states/netsnmp.py @@ -60,7 +60,6 @@ def __virtual__(): def _ordered_dict_to_dict(config): - """ Forced the datatype to dict, in case OrderedDict is used. """ @@ -69,7 +68,6 @@ def _ordered_dict_to_dict(config): def _expand_config(config, defaults): - """ Completed the values of the expected config for the edge cases with the default values. """ @@ -79,7 +77,6 @@ def _expand_config(config, defaults): def _valid_dict(dic): - """ Valid dictionary? """ @@ -88,7 +85,6 @@ def _valid_dict(dic): def _valid_str(value): - """ Valid str? """ @@ -97,7 +93,6 @@ def _valid_str(value): def _community_defaults(): - """ Returns the default values of a community. """ @@ -106,7 +101,6 @@ def _community_defaults(): def _clear_community_details(community_details): - """ Clears community details. """ @@ -126,7 +120,6 @@ def _clear_community_details(community_details): def _str_elem(config, key): - """ Re-adds the value of a specific key in the dict, only in case of valid str value. """ @@ -137,7 +130,6 @@ def _str_elem(config, key): def _check_config(config): - """ Checks the desired config and clears interesting details. """ @@ -187,7 +179,6 @@ def _check_config(config): def _retrieve_device_config(): - """ Retrieves the SNMP config from the device. """ @@ -196,7 +187,6 @@ def _retrieve_device_config(): def _create_diff_action(diff, diff_key, key, value): - """ DRY to build diff parts (added, removed, updated). """ @@ -207,7 +197,6 @@ def _create_diff_action(diff, diff_key, key, value): def _create_diff(diff, fun, key, prev, curr): - """ Builds the diff dictionary. """ @@ -221,7 +210,6 @@ def _create_diff(diff, fun, key, prev, curr): def _compute_diff(existing, expected): - """ Computes the differences between the existing and the expected SNMP config. """ @@ -240,7 +228,6 @@ def _compute_diff(existing, expected): def _configure(changes): - """ Calls the configuration template to apply the configuration changes on the device. """ @@ -279,7 +266,6 @@ def _configure(changes): def managed(name, config=None, defaults=None): - """ Configures the SNMP on the device as specified in the SLS file. diff --git a/salt/states/netusers.py b/salt/states/netusers.py index 9120ce358aa..98b589cfb90 100644 --- a/salt/states/netusers.py +++ b/salt/states/netusers.py @@ -54,21 +54,18 @@ def __virtual__(): def _retrieve_users(): - """Retrieves configured users""" return __salt__["users.config"]() def _ordered_dict_to_dict(probes): - """.""" return salt.utils.json.loads(salt.utils.json.dumps(probes)) def _expand_users(device_users, common_users): - """Creates a longer list of accepted users on the device.""" expected_users = copy.deepcopy(common_users) @@ -78,7 +75,6 @@ def _expand_users(device_users, common_users): def _check_users(users): - """Checks if the input dictionary of users is valid.""" messg = "" @@ -103,7 +99,6 @@ def _check_users(users): def _compute_diff(configured, expected): - """Computes the differences between the actual config and the expected config""" diff = {"add": {}, "update": {}, "remove": {}} @@ -135,21 +130,18 @@ def _compute_diff(configured, expected): def _set_users(users): - """Calls users.set_users.""" return __salt__["users.set_users"](users, commit=False) def _update_users(users): - """Calls users.set_users.""" return __salt__["users.set_users"](users, commit=False) def _delete_users(users): - """Calls users.delete_users.""" return __salt__["users.delete_users"](users, commit=False) @@ -161,7 +153,6 @@ def _delete_users(users): def managed(name, users=None, defaults=None): - """ Manages the configuration of the users on the device, as specified in the state SLS file. Users not defined in that file will be removed whilst users not configured on the device, will be added. diff --git a/salt/states/network.py b/salt/states/network.py index b942a7e58d4..d3a2a2e203d 100644 --- a/salt/states/network.py +++ b/salt/states/network.py @@ -554,10 +554,10 @@ def managed(name, enabled=True, **kwargs): elif old != new: diff = difflib.unified_diff(old, new, lineterm="") ret["result"] = None - ret[ - "comment" - ] = "Bond interface {} is set to be updated:\n{}".format( - name, "\n".join(diff) + ret["comment"] = ( + "Bond interface {} is set to be updated:\n{}".format( + name, "\n".join(diff) + ) ) else: if not old and new: @@ -626,9 +626,9 @@ def managed(name, enabled=True, **kwargs): # Interface should restart to validate if it's up __salt__["ip.down"](name, iface_type) __salt__["ip.up"](name, iface_type) - ret["changes"][ - "status" - ] = "Interface {} restart to validate".format(name) + ret["changes"]["status"] = ( + "Interface {} restart to validate".format(name) + ) else: __salt__["ip.up"](name, iface_type) ret["changes"]["status"] = "Interface {} is up".format(name) @@ -670,10 +670,10 @@ def managed(name, enabled=True, **kwargs): __salt__["cmd.run"](cmd, python_shell=False) else: log.error("Command 'ifenslave' not found") - ret["changes"][ - "enslave" - ] = "Added slaves '{}' to master '{}'".format( - " ".join(missing_slaves), name + ret["changes"]["enslave"] = ( + "Added slaves '{}' to master '{}'".format( + " ".join(missing_slaves), name + ) ) else: log.info( @@ -726,10 +726,10 @@ def routes(name, **kwargs): elif old != new: diff = difflib.unified_diff(old, new, lineterm="") ret["result"] = None - ret[ - "comment" - ] = "Interface {} routes are set to be updated:\n{}".format( - name, "\n".join(diff) + ret["comment"] = ( + "Interface {} routes are set to be updated:\n{}".format( + name, "\n".join(diff) + ) ) return ret if not old and new: @@ -791,10 +791,10 @@ def system(name, **kwargs): elif old != new: diff = difflib.unified_diff(old, new, lineterm="") ret["result"] = None - ret[ - "comment" - ] = "Global network settings are set to be updated:\n{}".format( - "\n".join(diff) + ret["comment"] = ( + "Global network settings are set to be updated:\n{}".format( + "\n".join(diff) + ) ) return ret if not old and new: diff --git a/salt/states/neutron_network.py b/salt/states/neutron_network.py index 30e6cfb050f..3361675749a 100644 --- a/salt/states/neutron_network.py +++ b/salt/states/neutron_network.py @@ -28,7 +28,6 @@ Example States - project: project1 """ - __virtualname__ = "neutron_network" diff --git a/salt/states/neutron_secgroup.py b/salt/states/neutron_secgroup.py index 045f413c945..144178bbc2d 100644 --- a/salt/states/neutron_secgroup.py +++ b/salt/states/neutron_secgroup.py @@ -34,7 +34,6 @@ Example States - project_name: Project1 """ - __virtualname__ = "neutron_secgroup" diff --git a/salt/states/neutron_secgroup_rule.py b/salt/states/neutron_secgroup_rule.py index db4721fc79e..3c65fc34308 100644 --- a/salt/states/neutron_secgroup_rule.py +++ b/salt/states/neutron_secgroup_rule.py @@ -28,7 +28,6 @@ Example States - project_id: 1dcac318a83b4610b7a7f7ba01465548 """ - __virtualname__ = "neutron_secgroup_rule" diff --git a/salt/states/neutron_subnet.py b/salt/states/neutron_subnet.py index 30c69992b58..60e241e69ef 100644 --- a/salt/states/neutron_subnet.py +++ b/salt/states/neutron_subnet.py @@ -46,7 +46,6 @@ Example States - ip_version: 6 """ - __virtualname__ = "neutron_subnet" diff --git a/salt/states/nexus.py b/salt/states/nexus.py index a823b0a47d0..10d71db4cd8 100644 --- a/salt/states/nexus.py +++ b/salt/states/nexus.py @@ -4,7 +4,6 @@ This state downloads artifacts from Nexus 3.x. .. versionadded:: 2018.3.0 """ - import logging log = logging.getLogger(__name__) diff --git a/salt/states/nftables.py b/salt/states/nftables.py index 71c6e997eed..2088e51efea 100644 --- a/salt/states/nftables.py +++ b/salt/states/nftables.py @@ -157,10 +157,10 @@ def chain_present( return ret if __opts__["test"]: - ret[ - "comment" - ] = "nftables chain {} would be created in table {} for family {}".format( - name, table, family + ret["comment"] = ( + "nftables chain {} would be created in table {} for family {}".format( + name, table, family + ) ) return ret @@ -198,10 +198,10 @@ def chain_absent(name, table="filter", family="ipv4"): chain_check = __salt__["nftables.check_chain"](table, name, family) if not chain_check: ret["result"] = True - ret[ - "comment" - ] = "nftables {} chain is already absent in {} table for {}".format( - name, table, family + ret["comment"] = ( + "nftables {} chain is already absent in {} table for {}".format( + name, table, family + ) ) return ret @@ -211,10 +211,10 @@ def chain_absent(name, table="filter", family="ipv4"): if command is True: ret["changes"] = {"locale": name} ret["result"] = True - ret[ - "comment" - ] = "nftables {} chain in {} table delete success for {}".format( - name, table, family + ret["comment"] = ( + "nftables {} chain in {} table delete success for {}".format( + name, table, family + ) ) else: ret["result"] = False @@ -286,18 +286,18 @@ def append(name, family="ipv4", **kwargs): if "save" in kwargs: if kwargs["save"]: __salt__["nftables.save"](filename=None, family=family) - ret[ - "comment" - ] = "Set and Saved nftables rule for {} to: {} for {}".format( - name, command.strip(), family + ret["comment"] = ( + "Set and Saved nftables rule for {} to: {} for {}".format( + name, command.strip(), family + ) ) return ret else: ret["result"] = False - ret[ - "comment" - ] = "Failed to set nftables rule for {}.\nAttempted rule was {} for {}.\n{}".format( - name, command.strip(), family, res["comment"] + ret["comment"] = ( + "Failed to set nftables rule for {}.\nAttempted rule was {} for {}.\n{}".format( + name, command.strip(), family, res["comment"] + ) ) return ret @@ -361,18 +361,18 @@ def insert(name, family="ipv4", **kwargs): if "save" in kwargs: if kwargs["save"]: __salt__["nftables.save"](filename=None, family=family) - ret[ - "comment" - ] = "Set and Saved nftables rule for {} to: {} for {}".format( - name, command.strip(), family + ret["comment"] = ( + "Set and Saved nftables rule for {} to: {} for {}".format( + name, command.strip(), family + ) ) return ret else: ret["result"] = False - ret[ - "comment" - ] = "Failed to set nftables rule for {}.\nAttempted rule was {}".format( - name, command.strip() + ret["comment"] = ( + "Failed to set nftables rule for {}.\nAttempted rule was {}".format( + name, command.strip() + ) ) return ret @@ -442,18 +442,18 @@ def delete(name, family="ipv4", **kwargs): if "save" in kwargs: if kwargs["save"]: __salt__["nftables.save"](filename=None, family=family) - ret[ - "comment" - ] = "Deleted and Saved nftables rule for {} for {}{}".format( - name, command.strip(), family + ret["comment"] = ( + "Deleted and Saved nftables rule for {} for {}{}".format( + name, command.strip(), family + ) ) return ret else: ret["result"] = False - ret[ - "comment" - ] = "Failed to delete nftables rule for {}.\nAttempted rule was {}".format( - name, command.strip() + ret["comment"] = ( + "Failed to delete nftables rule for {}.\nAttempted rule was {}".format( + name, command.strip() + ) ) return ret @@ -492,10 +492,10 @@ def flush(name, family="ipv4", ignore_absence=False, **kwargs): check_table = __salt__["nftables.check_table"](kwargs["table"], family=family) if not ignore_absence and not check_table["result"]: ret["result"] = False - ret[ - "comment" - ] = "Failed to flush table {} in family {}, table does not exist.".format( - kwargs["table"], family + ret["comment"] = ( + "Failed to flush table {} in family {}, table does not exist.".format( + kwargs["table"], family + ) ) return ret @@ -562,10 +562,10 @@ def set_policy(name, table="filter", family="ipv4", **kwargs): if (policy or "").lower() == kwargs["policy"].lower(): ret["result"] = True - ret[ - "comment" - ] = "nftables default policy for chain {} on table {} for {} already set to {}".format( - kwargs["chain"], table, family, kwargs["policy"] + ret["comment"] = ( + "nftables default policy for chain {} on table {} for {} already set to {}".format( + kwargs["chain"], table, family, kwargs["policy"] + ) ) return ret @@ -590,10 +590,10 @@ def set_policy(name, table="filter", family="ipv4", **kwargs): __salt__["nftables.save"]( filename=kwargs.get("save_filename"), family=family ) - ret[ - "comment" - ] = "Set and saved default policy for {} to {} family {}".format( - kwargs["chain"], kwargs["policy"], family + ret["comment"] = ( + "Set and saved default policy for {} to {} family {}".format( + kwargs["chain"], kwargs["policy"], family + ) ) else: ret["result"] = False diff --git a/salt/states/npm.py b/salt/states/npm.py index 535a516a1d4..8f7415d1f58 100644 --- a/salt/states/npm.py +++ b/salt/states/npm.py @@ -18,7 +18,6 @@ for the package which provides npm (simply ``npm`` in most cases). Example: - pkg: npm """ - import re from salt.exceptions import CommandExecutionError, CommandNotFoundError diff --git a/salt/states/openstack_config.py b/salt/states/openstack_config.py index e9154d57a4f..e635366f696 100644 --- a/salt/states/openstack_config.py +++ b/salt/states/openstack_config.py @@ -8,7 +8,6 @@ Manage OpenStack configuration file settings. """ - from salt.exceptions import CommandExecutionError diff --git a/salt/states/openvswitch_port.py b/salt/states/openvswitch_port.py index 3ca769b1e37..efacfe5800f 100644 --- a/salt/states/openvswitch_port.py +++ b/salt/states/openvswitch_port.py @@ -52,19 +52,19 @@ def present( comments["comment_port_created"] = "Port {} created on bridge {}.".format( name, bridge ) - comments[ - "comment_port_notcreated" - ] = "Unable to create port {} on bridge {}.".format(name, bridge) + comments["comment_port_notcreated"] = ( + "Unable to create port {} on bridge {}.".format(name, bridge) + ) comments["changes_port_created"] = { name: { "old": "No port named {} present.".format(name), "new": "Created port {1} on bridge {0}.".format(bridge, name), } } - comments[ - "comment_port_internal" - ] = "Port {} already exists, but interface type has been changed to internal.".format( - name + comments["comment_port_internal"] = ( + "Port {} already exists, but interface type has been changed to internal.".format( + name + ) ) comments["changes_port_internal"] = {"internal": {"old": False, "new": True}} comments["comment_port_internal_not_changed"] = ( @@ -76,23 +76,23 @@ def present( comments["comment_invalid_ip"] = "Remote is not valid ip address." if tunnel_type == "vlan": comments["comment_vlan_invalid_id"] = "VLANs id must be between 0 and 4095." - comments[ - "comment_vlan_invalid_name" - ] = "Could not find network interface {}.".format(name) - comments[ - "comment_vlan_port_exists" - ] = "Port {} with access to VLAN {} already exists on bridge {}.".format( - name, id, bridge + comments["comment_vlan_invalid_name"] = ( + "Could not find network interface {}.".format(name) ) - comments[ - "comment_vlan_created" - ] = "Created port {} with access to VLAN {} on bridge {}.".format( - name, id, bridge + comments["comment_vlan_port_exists"] = ( + "Port {} with access to VLAN {} already exists on bridge {}.".format( + name, id, bridge + ) ) - comments[ - "comment_vlan_notcreated" - ] = "Unable to create port {} with access to VLAN {} on bridge {}.".format( - name, id, bridge + comments["comment_vlan_created"] = ( + "Created port {} with access to VLAN {} on bridge {}.".format( + name, id, bridge + ) + ) + comments["comment_vlan_notcreated"] = ( + "Unable to create port {} with access to VLAN {} on bridge {}.".format( + name, id, bridge + ) ) comments["changes_vlan_created"] = { name: { @@ -108,9 +108,9 @@ def present( } elif tunnel_type == "gre": - comments[ - "comment_gre_invalid_id" - ] = "Id of GRE tunnel must be an unsigned 32-bit integer." + comments["comment_gre_invalid_id"] = ( + "Id of GRE tunnel must be an unsigned 32-bit integer." + ) comments["comment_gre_interface_exists"] = ( "GRE tunnel interface {} with rempte ip {} and key {} " "already exists on bridge {}.".format(name, remote, id, bridge) @@ -139,9 +139,9 @@ def present( comments["comment_dstport"] = ( " (dst_port" + str(dst_port) + ")" if 0 < dst_port <= 65535 else "" ) - comments[ - "comment_vxlan_invalid_id" - ] = "Id of VXLAN tunnel must be an unsigned 64-bit integer." + comments["comment_vxlan_invalid_id"] = ( + "Id of VXLAN tunnel must be an unsigned 64-bit integer." + ) comments["comment_vxlan_interface_exists"] = ( "VXLAN tunnel interface {} with rempte ip {} and key {} " "already exists on bridge {}{}.".format( diff --git a/salt/states/opsgenie.py b/salt/states/opsgenie.py index 8e80bf2ef90..f7cafcccfd9 100644 --- a/salt/states/opsgenie.py +++ b/salt/states/opsgenie.py @@ -75,10 +75,10 @@ def create_alert(name=None, api_key=None, reason=None, action_type="Create"): raise salt.exceptions.SaltInvocationError("API Key or Reason cannot be None.") if __opts__["test"] is True: - ret[ - "comment" - ] = 'Test: {} alert request will be processed using the API Key="{}".'.format( - action_type, api_key + ret["comment"] = ( + 'Test: {} alert request will be processed using the API Key="{}".'.format( + action_type, api_key + ) ) # Return ``None`` when running with ``test=true``. @@ -96,10 +96,10 @@ def create_alert(name=None, api_key=None, reason=None, action_type="Create"): response_text, response_status_code, ) - ret[ - "comment" - ] = 'Test: {} alert request will be processed using the API Key="{}".'.format( - action_type, api_key + ret["comment"] = ( + 'Test: {} alert request will be processed using the API Key="{}".'.format( + action_type, api_key + ) ) ret["result"] = True else: diff --git a/salt/states/pbm.py b/salt/states/pbm.py index ae21462ea47..6e761f41957 100644 --- a/salt/states/pbm.py +++ b/salt/states/pbm.py @@ -90,7 +90,6 @@ PyVmomi can be installed via pip: information. """ - import copy import logging import sys diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index f8447ec350c..917d2748778 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -18,7 +18,6 @@ requisite to a pkg.installed state for the package which provides pip - pkg: python-pip """ - import logging import re import sys diff --git a/salt/states/pkg.py b/salt/states/pkg.py index 908d3711b07..df57a7477a2 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -67,6 +67,7 @@ state module Make sure the package name has the correct case for package managers which are case-sensitive (such as :mod:`pkgng `). """ + import fnmatch import logging import os @@ -1890,10 +1891,10 @@ def installed( ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret[ - "comment" - ] = "An error was encountered while installing package(s): {}".format( - exc + ret["comment"] = ( + "An error was encountered while installing package(s): {}".format( + exc + ) ) if warnings: ret.setdefault("warnings", []).extend(warnings) @@ -2298,9 +2299,9 @@ def downloaded( ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret[ - "comment" - ] = "An error was encountered while downloading package(s): {}".format(exc) + ret["comment"] = ( + "An error was encountered while downloading package(s): {}".format(exc) + ) return ret new_pkgs = __salt__["pkg.list_downloaded"](**kwargs) @@ -2355,9 +2356,9 @@ def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs): if "pkg.list_patches" not in __salt__: ret["result"] = False - ret[ - "comment" - ] = "The pkg.patch_installed state is not available on this platform" + ret["comment"] = ( + "The pkg.patch_installed state is not available on this platform" + ) return ret if isinstance(advisory_ids, list) and len(advisory_ids) == 0: @@ -2378,9 +2379,9 @@ def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs): if __opts__["test"]: summary = ", ".join(targets) - ret[ - "comment" - ] = "The following advisory patches would be downloaded: {}".format(summary) + ret["comment"] = ( + "The following advisory patches would be downloaded: {}".format(summary) + ) return ret try: @@ -2397,18 +2398,18 @@ def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs): ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret[ - "comment" - ] = "An error was encountered while downloading package(s): {}".format(exc) + ret["comment"] = ( + "An error was encountered while downloading package(s): {}".format(exc) + ) return ret if not ret["changes"] and not ret["comment"]: status = "downloaded" if downloadonly else "installed" ret["result"] = True - ret[ - "comment" - ] = "Advisory patch is not needed or related packages are already {}".format( - status + ret["comment"] = ( + "Advisory patch is not needed or related packages are already {}".format( + status + ) ) return ret @@ -3094,9 +3095,9 @@ def removed(name, version=None, pkgs=None, normalize=True, ignore_epoch=None, ** ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret[ - "comment" - ] = "An error was encountered while removing package(s): {}".format(exc) + ret["comment"] = ( + "An error was encountered while removing package(s): {}".format(exc) + ) return ret @@ -3186,9 +3187,9 @@ def purged(name, version=None, pkgs=None, normalize=True, ignore_epoch=None, **k ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret[ - "comment" - ] = "An error was encountered while purging package(s): {}".format(exc) + ret["comment"] = ( + "An error was encountered while purging package(s): {}".format(exc) + ) return ret @@ -3278,9 +3279,9 @@ def uptodate(name, refresh=False, pkgs=None, **kwargs): ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret[ - "comment" - ] = "An error was encountered while updating packages: {}".format(exc) + ret["comment"] = ( + "An error was encountered while updating packages: {}".format(exc) + ) return ret # If a package list was provided, ensure those packages were updated @@ -3425,19 +3426,19 @@ def group_installed(name, skip=None, include=None, **kwargs): if "unexpected keyword argument" in str(err): ret["comment"] = "Repo options are not supported on this platform" else: - ret[ - "comment" - ] = f"An error was encountered while installing/updating group '{name}': {err}." + ret["comment"] = ( + f"An error was encountered while installing/updating group '{name}': {err}." + ) return ret mandatory = diff["mandatory"]["installed"] + diff["mandatory"]["not installed"] invalid_skip = [x for x in mandatory if x in skip] if invalid_skip: - ret[ - "comment" - ] = "The following mandatory packages cannot be skipped: {}".format( - ", ".join(invalid_skip) + ret["comment"] = ( + "The following mandatory packages cannot be skipped: {}".format( + ", ".join(invalid_skip) + ) ) return ret @@ -3459,9 +3460,9 @@ def group_installed(name, skip=None, include=None, **kwargs): if __opts__["test"]: ret["result"] = None if partially_installed: - ret[ - "comment" - ] = "Group '{}' is partially installed and will be updated".format(name) + ret["comment"] = ( + "Group '{}' is partially installed and will be updated".format(name) + ) else: ret["comment"] = "Group '{}' will be installed".format(name) return ret @@ -3960,9 +3961,11 @@ def unheld(name, version=None, pkgs=None, all=False, **kwargs): comments.append( "The following package would be unheld: {}{}".format( pkg_name, - "" - if not dpkgs.get(pkg_name) - else " (version = {})".format(lock_ver), + ( + "" + if not dpkgs.get(pkg_name) + else " (version = {})".format(lock_ver) + ), ) ) else: diff --git a/salt/states/pkgrepo.py b/salt/states/pkgrepo.py index 7a55c5c0c59..3aaa5791a27 100644 --- a/salt/states/pkgrepo.py +++ b/salt/states/pkgrepo.py @@ -117,7 +117,6 @@ Using ``aptkey: False`` with ``keyserver`` and ``keyid``: - aptkey: False """ - import sys import salt.utils.data @@ -365,15 +364,15 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs): if "key_url" in kwargs and ("keyid" in kwargs or "keyserver" in kwargs): ret["result"] = False - ret[ - "comment" - ] = 'You may not use both "keyid"/"keyserver" and "key_url" argument.' + ret["comment"] = ( + 'You may not use both "keyid"/"keyserver" and "key_url" argument.' + ) if "key_text" in kwargs and ("keyid" in kwargs or "keyserver" in kwargs): ret["result"] = False - ret[ - "comment" - ] = 'You may not use both "keyid"/"keyserver" and "key_text" argument.' + ret["comment"] = ( + 'You may not use both "keyid"/"keyserver" and "key_text" argument.' + ) if "key_text" in kwargs and ("key_url" in kwargs): ret["result"] = False ret["comment"] = 'You may not use both "key_url" and "key_text" argument.' @@ -409,9 +408,9 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs): ) else: ret["result"] = False - ret[ - "comment" - ] = "Cannot have 'key_url' using http with 'allow_insecure_key' set to True" + ret["comment"] = ( + "Cannot have 'key_url' using http with 'allow_insecure_key' set to True" + ) return ret repo = name diff --git a/salt/states/ports.py b/salt/states/ports.py index b4e53c4a6a7..2d9acff696e 100644 --- a/salt/states/ports.py +++ b/salt/states/ports.py @@ -128,10 +128,10 @@ def installed(name, options=None): if not default_options: if options: ret["result"] = False - ret[ - "comment" - ] = "{} does not have any build options, yet options were specified".format( - name + ret["comment"] = ( + "{} does not have any build options, yet options were specified".format( + name + ) ) return ret else: @@ -143,10 +143,10 @@ def installed(name, options=None): bad_opts = [x for x in options if x not in default_options] if bad_opts: ret["result"] = False - ret[ - "comment" - ] = "The following options are not available for {}: {}".format( - name, ", ".join(bad_opts) + ret["comment"] = ( + "The following options are not available for {}: {}".format( + name, ", ".join(bad_opts) + ) ) return ret diff --git a/salt/states/postgres_database.py b/salt/states/postgres_database.py index 7e162d6e7ff..b5de4fa1f97 100644 --- a/salt/states/postgres_database.py +++ b/salt/states/postgres_database.py @@ -119,17 +119,19 @@ def present( return ret elif name in dbs and any( ( - db_params.get("Encoding").lower() != encoding.lower() - if encoding - else False, + ( + db_params.get("Encoding").lower() != encoding.lower() + if encoding + else False + ), db_params.get("Collate") != lc_collate if lc_collate else False, db_params.get("Ctype") != lc_ctype if lc_ctype else False, ) ): - ret[ - "comment" - ] = "Database {} has wrong parameters which couldn't be changed on fly.".format( - name + ret["comment"] = ( + "Database {} has wrong parameters which couldn't be changed on fly.".format( + name + ) ) ret["result"] = False return ret @@ -140,9 +142,9 @@ def present( if name not in dbs: ret["comment"] = "Database {} is set to be created".format(name) else: - ret[ - "comment" - ] = "Database {} exists, but parameters need to be changed".format(name) + ret["comment"] = ( + "Database {} exists, but parameters need to be changed".format(name) + ) return ret if name not in dbs and __salt__["postgres.db_create"]( name, diff --git a/salt/states/postgres_privileges.py b/salt/states/postgres_privileges.py index 9241c2de6e4..9829e583441 100644 --- a/salt/states/postgres_privileges.py +++ b/salt/states/postgres_privileges.py @@ -311,10 +311,10 @@ def absent( if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "The privilege(s): {} are set to be revoked from {}".format( - _privs, name + ret["comment"] = ( + "The privilege(s): {} are set to be revoked from {}".format( + _privs, name + ) ) return ret diff --git a/salt/states/postgres_schema.py b/salt/states/postgres_schema.py index 0f58db1afe8..7e77da04642 100644 --- a/salt/states/postgres_schema.py +++ b/salt/states/postgres_schema.py @@ -166,10 +166,10 @@ def absent( ret["comment"] = "Schema {} failed to be removed".format(name) return ret else: - ret[ - "comment" - ] = "Schema {} is not present in database {}, so it cannot be removed".format( - name, dbname + ret["comment"] = ( + "Schema {} is not present in database {}, so it cannot be removed".format( + name, dbname + ) ) return ret diff --git a/salt/states/postgres_tablespace.py b/salt/states/postgres_tablespace.py index fcb28d68774..a946b1b65fc 100644 --- a/salt/states/postgres_tablespace.py +++ b/salt/states/postgres_tablespace.py @@ -15,7 +15,6 @@ A module used to create and manage PostgreSQL tablespaces. """ - import salt.utils.dictupdate as dictupdate @@ -120,11 +119,11 @@ def present( # already exists, make sure it's got the right config if tblspaces[name]["Location"] != directory and not __opts__["test"]: - ret[ - "comment" - ] = """Tablespace {} is not at the right location. This is + ret["comment"] = ( + """Tablespace {} is not at the right location. This is unfixable without dropping and recreating the tablespace.""".format( - name + name + ) ) ret["result"] = False return ret @@ -152,11 +151,11 @@ def present( if "{}={}".format(k, v) not in tblspaces[name]["Opts"]: if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = """Tablespace {} options to be + ret["comment"] = ( + """Tablespace {} options to be altered""".format( - name + name + ) ) break # we know it's going to be altered, no reason to cont if __salt__["postgres.tablespace_alter"](name, set_option={k: v}): diff --git a/salt/states/probes.py b/salt/states/probes.py index 6adc6183f4e..1c7e7525000 100644 --- a/salt/states/probes.py +++ b/salt/states/probes.py @@ -54,7 +54,6 @@ def __virtual__(): def _default_ret(name): - """ Returns a default structure of the dictionary to be returned as output of the state functions. """ @@ -63,7 +62,6 @@ def _default_ret(name): def _retrieve_rpm_probes(): - """ Will retrieve the probes from the network device using salt module "probes" throught NAPALM proxy. """ @@ -72,7 +70,6 @@ def _retrieve_rpm_probes(): def _expand_probes(probes, defaults): - """ Updates the probes dictionary with different levels of default values. """ @@ -104,7 +101,6 @@ def _expand_probes(probes, defaults): def _clean_probes(probes): - """ Will remove empty and useless values from the probes dictionary. """ @@ -127,7 +123,6 @@ def _clean_probes(probes): def _compare_probes(configured_probes, expected_probes): - """ Compares configured probes on the device with the expected configuration and returns the differences. """ @@ -190,14 +185,12 @@ def _compare_probes(configured_probes, expected_probes): def _ordered_dict_to_dict(probes): - """Mandatory to be dict type in order to be used in the NAPALM Jinja template.""" return salt.utils.json.loads(salt.utils.json.dumps(probes)) def _set_rpm_probes(probes): - """ Calls the Salt module "probes" to configure the probes on the device. """ @@ -209,7 +202,6 @@ def _set_rpm_probes(probes): def _schedule_probes(probes): - """ Calls the Salt module "probes" to schedule the configured probes on the device. """ @@ -221,7 +213,6 @@ def _schedule_probes(probes): def _delete_rpm_probes(probes): - """ Calls the Salt module "probes" to delete probes from the device. """ @@ -240,7 +231,6 @@ def _delete_rpm_probes(probes): def managed(name, probes, defaults=None): - """ Ensure the networks device is configured as specified in the state SLS file. Probes not specified will be removed, while probes not confiured as expected will trigger config updates. diff --git a/salt/states/rabbitmq_plugin.py b/salt/states/rabbitmq_plugin.py index d59e74fa035..4994e52f95f 100644 --- a/salt/states/rabbitmq_plugin.py +++ b/salt/states/rabbitmq_plugin.py @@ -12,7 +12,6 @@ Example: rabbitmq_plugin.enabled: [] """ - import logging from salt.exceptions import CommandExecutionError diff --git a/salt/states/rabbitmq_upstream.py b/salt/states/rabbitmq_upstream.py index da0e74ee746..35e0b008454 100644 --- a/salt/states/rabbitmq_upstream.py +++ b/salt/states/rabbitmq_upstream.py @@ -17,7 +17,6 @@ Example: .. versionadded:: 3000 """ - import json import logging diff --git a/salt/states/rabbitmq_user.py b/salt/states/rabbitmq_user.py index 8cf9d5f7e75..fcd14ce3757 100644 --- a/salt/states/rabbitmq_user.py +++ b/salt/states/rabbitmq_user.py @@ -21,7 +21,6 @@ Example: - runas: rabbitmq """ - import logging import salt.utils.path diff --git a/salt/states/rabbitmq_vhost.py b/salt/states/rabbitmq_vhost.py index 4231e9519f4..3aba14a55d1 100644 --- a/salt/states/rabbitmq_vhost.py +++ b/salt/states/rabbitmq_vhost.py @@ -14,7 +14,6 @@ Example: - read: .* """ - import logging import salt.utils.path diff --git a/salt/states/restconf.py b/salt/states/restconf.py index 4ac74e27bd4..44fcbc5896c 100644 --- a/salt/states/restconf.py +++ b/salt/states/restconf.py @@ -11,7 +11,6 @@ This state module was designed to manage RESTCONF states. This module relies on the RESTCONF proxy module to interface with the devices. """ - import difflib import json import logging diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py index d904da011d0..e120e418875 100644 --- a/salt/states/saltmod.py +++ b/salt/states/saltmod.py @@ -349,9 +349,11 @@ def state( cmd_ret = { __opts__["id"]: { "ret": tmp_ret, - "out": tmp_ret.get("out", "highstate") - if isinstance(tmp_ret, dict) - else "highstate", + "out": ( + tmp_ret.get("out", "highstate") + if isinstance(tmp_ret, dict) + else "highstate" + ), } } diff --git a/salt/states/serverdensity_device.py b/salt/states/serverdensity_device.py index bce8db5bc92..02eced4b42f 100644 --- a/salt/states/serverdensity_device.py +++ b/salt/states/serverdensity_device.py @@ -46,7 +46,6 @@ Example: serverdensity_device.monitored """ - import logging import salt.utils.json @@ -206,9 +205,9 @@ def monitored( ret["changes"] = {} if __opts__["test"]: ret["result"] = None - ret[ - "comment" - ] = "Agent is not installed and device is not in the Server Density DB" + ret["comment"] = ( + "Agent is not installed and device is not in the Server Density DB" + ) return ret if __opts__["test"]: @@ -224,8 +223,8 @@ def monitored( ) ret["result"] = True - ret[ - "comment" - ] = "Successfully installed agent and created device in Server Density db." + ret["comment"] = ( + "Successfully installed agent and created device in Server Density db." + ) ret["changes"] = {"created_device": device, "installed_agent": installed_agent} return ret diff --git a/salt/states/service.py b/salt/states/service.py index 0bb04c34cc1..650def38a38 100644 --- a/salt/states/service.py +++ b/salt/states/service.py @@ -155,10 +155,10 @@ def _enable(name, started, result=True, **kwargs): # Check to see if this minion supports enable if "service.enable" not in __salt__ or "service.enabled" not in __salt__: if started is True: - ret[ - "comment" - ] = "Enable is not available on this minion, service {} started".format( - name + ret["comment"] = ( + "Enable is not available on this minion, service {} started".format( + name + ) ) elif started is None: ret["comment"] = ( @@ -166,10 +166,10 @@ def _enable(name, started, result=True, **kwargs): " service {} is in the desired state".format(name) ) else: - ret[ - "comment" - ] = "Enable is not available on this minion, service {} is dead".format( - name + ret["comment"] = ( + "Enable is not available on this minion, service {} is dead".format( + name + ) ) return ret @@ -184,10 +184,10 @@ def _enable(name, started, result=True, **kwargs): elif started is None: # always be sure in this case to reset the changes dict ret["changes"] = {} - ret[ - "comment" - ] = "Service {} is already enabled, and is in the desired state".format( - name + ret["comment"] = ( + "Service {} is already enabled, and is in the desired state".format( + name + ) ) else: ret["comment"] = "Service {} is already enabled, and is dead".format(name) @@ -214,10 +214,10 @@ def _enable(name, started, result=True, **kwargs): name ) elif started is None: - ret[ - "comment" - ] = "Service {} has been enabled, and is in the desired state".format( - name + ret["comment"] = ( + "Service {} has been enabled, and is in the desired state".format( + name + ) ) else: ret["comment"] = "Service {} has been enabled, and is dead".format(name) @@ -240,10 +240,10 @@ def _enable(name, started, result=True, **kwargs): " but the service was already running".format(name) ) else: - ret[ - "comment" - ] = "Failed when setting service {} to start at boot, and the service is dead".format( - name + ret["comment"] = ( + "Failed when setting service {} to start at boot, and the service is dead".format( + name + ) ) if enable_error: @@ -274,10 +274,10 @@ def _disable(name, started, result=True, **kwargs): # is enable/disable available? if "service.disable" not in __salt__ or "service.disabled" not in __salt__: if started is True: - ret[ - "comment" - ] = "Disable is not available on this minion, service {} started".format( - name + ret["comment"] = ( + "Disable is not available on this minion, service {} started".format( + name + ) ) elif started is None: ret["comment"] = ( @@ -285,10 +285,10 @@ def _disable(name, started, result=True, **kwargs): " service {} is in the desired state".format(name) ) else: - ret[ - "comment" - ] = "Disable is not available on this minion, service {} is dead".format( - name + ret["comment"] = ( + "Disable is not available on this minion, service {} is dead".format( + name + ) ) return ret @@ -310,10 +310,10 @@ def _disable(name, started, result=True, **kwargs): elif started is None: # always be sure in this case to reset the changes dict ret["changes"] = {} - ret[ - "comment" - ] = "Service {} is already disabled, and is in the desired state".format( - name + ret["comment"] = ( + "Service {} is already disabled, and is in the desired state".format( + name + ) ) else: ret["comment"] = "Service {} is already disabled, and is dead".format(name) @@ -337,9 +337,9 @@ def _disable(name, started, result=True, **kwargs): if started is True: ret["comment"] = "Service {} has been disabled, and is running".format(name) elif started is None: - ret[ - "comment" - ] = "Service {} has been disabled, and is in the desired state".format(name) + ret["comment"] = ( + "Service {} has been disabled, and is in the desired state".format(name) + ) else: ret["comment"] = "Service {} has been disabled, and is dead".format(name) return ret @@ -347,10 +347,10 @@ def _disable(name, started, result=True, **kwargs): # Service failed to be disabled ret["result"] = False if started is True: - ret[ - "comment" - ] = "Failed when setting service {} to not start at boot, and is running".format( - name + ret["comment"] = ( + "Failed when setting service {} to not start at boot, and is running".format( + name + ) ) elif started is None: ret["comment"] = ( diff --git a/salt/states/slack.py b/salt/states/slack.py index a0c1b3a2dfc..1ba0f4b4e59 100644 --- a/salt/states/slack.py +++ b/salt/states/slack.py @@ -24,7 +24,6 @@ The api key can be specified in the master or minion configuration like below: """ - from salt.exceptions import SaltInvocationError diff --git a/salt/states/smartos.py b/salt/states/smartos.py index 7420d6ba33f..29c2bb72352 100644 --- a/salt/states/smartos.py +++ b/salt/states/smartos.py @@ -381,10 +381,10 @@ def config_present(name, value): ret["result"] = _write_config(config) if not ret["result"]: - ret[ - "comment" - ] = 'Could not add property {} with value "{}" to config'.format( - name, value + ret["comment"] = ( + 'Could not add property {} with value "{}" to config'.format( + name, value + ) ) return ret @@ -1026,9 +1026,9 @@ def vm_present(name, vmconfig, config=None): "update_{}".format(instance) ] = [] - update_cfg[ - vmconfig_type["instance"][instance] - ] = state_cfg[vmconfig_type["instance"][instance]] + update_cfg[vmconfig_type["instance"][instance]] = ( + state_cfg[vmconfig_type["instance"][instance]] + ) vmconfig["changed"][ "update_{}".format(instance) ].append(update_cfg) @@ -1156,9 +1156,9 @@ def vm_present(name, vmconfig, config=None): ) if vmconfig["state"]["hostname"] not in ret["changes"]: ret["changes"][vmconfig["state"]["hostname"]] = {} - ret["changes"][vmconfig["state"]["hostname"]][ - "image_uuid" - ] = vmconfig["reprovision_uuid"] + ret["changes"][vmconfig["state"]["hostname"]]["image_uuid"] = ( + vmconfig["reprovision_uuid"] + ) else: log.warning( "smartos.vm_present::%s::reprovision - " diff --git a/salt/states/snapper.py b/salt/states/snapper.py index 964c88c5001..6a6a7d66973 100644 --- a/salt/states/snapper.py +++ b/salt/states/snapper.py @@ -106,7 +106,6 @@ and include this change. :platform: Linux """ - import os diff --git a/salt/states/solrcloud.py b/salt/states/solrcloud.py index 6e9aaab545e..edbb6baf74b 100644 --- a/salt/states/solrcloud.py +++ b/salt/states/solrcloud.py @@ -5,7 +5,6 @@ States for solrcloud alias and collection configuration """ - import salt.utils.json diff --git a/salt/states/sqlite3.py b/salt/states/sqlite3.py index d0eb0615dd2..3cddab97d97 100644 --- a/salt/states/sqlite3.py +++ b/salt/states/sqlite3.py @@ -92,7 +92,6 @@ can be approximated with sqlite3's module functions and module.run: - sqlite3: zone-insert-12 """ - try: import sqlite3 diff --git a/salt/states/ssh_auth.py b/salt/states/ssh_auth.py index 1806a34709a..19bc0ae2934 100644 --- a/salt/states/ssh_auth.py +++ b/salt/states/ssh_auth.py @@ -59,7 +59,6 @@ to use a YAML 'explicit key', as demonstrated in the second example below. - AAAAB3NzaC1kcQ9fJFF435bYTEyY== newcomment """ - import re import sys @@ -356,10 +355,10 @@ def present( ) return ret elif data == "no change": - ret[ - "comment" - ] = "The authorized host key {} is already present for user {}".format( - name, user + ret["comment"] = ( + "The authorized host key {} is already present for user {}".format( + name, user + ) ) elif data == "new": ret["changes"][name] = "New" @@ -386,9 +385,9 @@ def present( ) elif data == "invalid" or data == "Invalid public key": ret["result"] = False - ret[ - "comment" - ] = "Invalid public ssh key, most likely has spaces or invalid syntax" + ret["comment"] = ( + "Invalid public ssh key, most likely has spaces or invalid syntax" + ) return ret diff --git a/salt/states/supervisord.py b/salt/states/supervisord.py index d0a5614c939..68ec8717ad6 100644 --- a/salt/states/supervisord.py +++ b/salt/states/supervisord.py @@ -82,9 +82,9 @@ def running( if "supervisord.status" not in __salt__: ret["result"] = False - ret[ - "comment" - ] = "Supervisord module not activated. Do you need to install supervisord?" + ret["comment"] = ( + "Supervisord module not activated. Do you need to install supervisord?" + ) return ret all_processes = __salt__["supervisord.status"]( @@ -115,14 +115,14 @@ def running( if name.endswith(":"): # Process group if len(to_start) == len(matches): - ret[ - "comment" - ] = "All services in group '{}' will be started".format(name) + ret["comment"] = ( + "All services in group '{}' will be started".format(name) + ) else: - ret[ - "comment" - ] = "The following services will be started: {}".format( - " ".join(to_start) + ret["comment"] = ( + "The following services will be started: {}".format( + " ".join(to_start) + ) ) else: # Single program @@ -130,9 +130,9 @@ def running( else: if name.endswith(":"): # Process group - ret[ - "comment" - ] = "All services in group '{}' are already running".format(name) + ret["comment"] = ( + "All services in group '{}' are already running".format(name) + ) else: ret["comment"] = "Service {} is already running".format(name) else: diff --git a/salt/states/sysrc.py b/salt/states/sysrc.py index 991e33bbff9..2a620b4cc93 100644 --- a/salt/states/sysrc.py +++ b/salt/states/sysrc.py @@ -3,7 +3,6 @@ State to work with sysrc """ - # define the module's virtual name __virtualname__ = "sysrc" diff --git a/salt/states/telemetry_alert.py b/salt/states/telemetry_alert.py index ccbe8fb9791..eb94cb86b3e 100644 --- a/salt/states/telemetry_alert.py +++ b/salt/states/telemetry_alert.py @@ -190,10 +190,10 @@ def absent(name, deployment_id, metric_name, api_key=None, profile="telemetry"): if is_present: alert_id = is_present.get("_id") if __opts__["test"]: - ret[ - "comment" - ] = "alert {} is set to be removed from deployment: {}.".format( - metric_name, deployment_id + ret["comment"] = ( + "alert {} is set to be removed from deployment: {}.".format( + metric_name, deployment_id + ) ) ret["result"] = None return ret diff --git a/salt/states/timezone.py b/salt/states/timezone.py index 514e4c0dda6..558cd1d6486 100644 --- a/salt/states/timezone.py +++ b/salt/states/timezone.py @@ -58,10 +58,10 @@ def system(name, utc=True): compzone = __salt__["timezone.zone_compare"](name) except (SaltInvocationError, CommandExecutionError) as exc: ret["result"] = False - ret[ - "comment" - ] = "Unable to compare desired timezone '{}' to system timezone: {}".format( - name, exc + ret["comment"] = ( + "Unable to compare desired timezone '{}' to system timezone: {}".format( + name, exc + ) ) return ret diff --git a/salt/states/tls.py b/salt/states/tls.py index 8e0f1249424..9881505d124 100644 --- a/salt/states/tls.py +++ b/salt/states/tls.py @@ -4,7 +4,6 @@ Enforce state for SSL/TLS """ - import datetime import logging import time diff --git a/salt/states/tuned.py b/salt/states/tuned.py index d158f2ad104..91759ddb76f 100644 --- a/salt/states/tuned.py +++ b/salt/states/tuned.py @@ -7,7 +7,6 @@ Interface to Red Hat tuned-adm module :platform: Linux """ - import salt.exceptions diff --git a/salt/states/user.py b/salt/states/user.py index d575655cf34..83693a809ac 100644 --- a/salt/states/user.py +++ b/salt/states/user.py @@ -914,10 +914,10 @@ def present( __salt__["shadow.set_password"](name, password) spost = __salt__["shadow.info"](name) if spost["passwd"] != password: - ret[ - "comment" - ] = "User {} created but failed to set password to {}".format( - name, "XXX-REDACTED-XXX" + ret["comment"] = ( + "User {} created but failed to set password to {}".format( + name, "XXX-REDACTED-XXX" + ) ) ret["result"] = False ret["changes"]["password"] = "XXX-REDACTED-XXX" @@ -925,9 +925,9 @@ def present( __salt__["shadow.del_password"](name) spost = __salt__["shadow.info"](name) if spost["passwd"] != "": - ret[ - "comment" - ] = "User {} created but failed to empty password".format(name) + ret["comment"] = ( + "User {} created but failed to empty password".format(name) + ) ret["result"] = False ret["changes"]["password"] = "" if date is not None: @@ -978,10 +978,10 @@ def present( __salt__["shadow.set_warndays"](name, warndays) spost = __salt__["shadow.info"](name) if spost["warn"] != warndays: - ret[ - "comment" - ] = "User {} created but failed to set warn days to {}".format( - name, warndays + ret["comment"] = ( + "User {} created but failed to set warn days to {}".format( + name, warndays + ) ) ret["result"] = False ret["changes"]["warndays"] = warndays @@ -999,10 +999,10 @@ def present( elif salt.utils.platform.is_windows(): if password and not empty_password: if not __salt__["user.setpassword"](name, password): - ret[ - "comment" - ] = "User {} created but failed to set password to {}".format( - name, "XXX-REDACTED-XXX" + ret["comment"] = ( + "User {} created but failed to set password to {}".format( + name, "XXX-REDACTED-XXX" + ) ) ret["result"] = False ret["changes"]["passwd"] = "XXX-REDACTED-XXX" @@ -1021,10 +1021,10 @@ def present( ret["changes"]["expiration_date"] = spost["expire"] elif salt.utils.platform.is_darwin() and password and not empty_password: if not __salt__["shadow.set_password"](name, password): - ret[ - "comment" - ] = "User {} created but failed to set password to {}".format( - name, "XXX-REDACTED-XXX" + ret["comment"] = ( + "User {} created but failed to set password to {}".format( + name, "XXX-REDACTED-XXX" + ) ) ret["result"] = False ret["changes"]["passwd"] = "XXX-REDACTED-XXX" diff --git a/salt/states/vbox_guest.py b/salt/states/vbox_guest.py index 45a78381d59..78907dd14f7 100644 --- a/salt/states/vbox_guest.py +++ b/salt/states/vbox_guest.py @@ -126,9 +126,9 @@ def grant_access_to_shared_folders_to(name, users=None): name=name, users=users ) - ret[ - "comment" - ] = "List of users who have access to auto-mounted shared folders was changed" + ret["comment"] = ( + "List of users who have access to auto-mounted shared folders was changed" + ) ret["changes"] = { "old": current_state, "new": new_state, diff --git a/salt/states/virt.py b/salt/states/virt.py index 3b958e32d60..2565be0af4a 100644 --- a/salt/states/virt.py +++ b/salt/states/virt.py @@ -11,7 +11,6 @@ for the generation and signing of certificates for systems running libvirt: virt.keys """ - import fnmatch import logging import os @@ -680,9 +679,9 @@ def defined( ret["comment"] = "Domain {} unchanged".format(name) ret["result"] = True elif status.get("errors"): - ret[ - "comment" - ] = "Domain {} updated with live update(s) failures".format(name) + ret["comment"] = ( + "Domain {} updated with live update(s) failures".format(name) + ) else: ret["comment"] = "Domain {} updated".format(name) else: @@ -2422,9 +2421,9 @@ def volume_defined( # otherwise assume the volume has already been defined # if the sizes don't match, issue a warning comment: too dangerous to do this for now if int(vol_infos.get("capacity")) != int(size) * 1024 * 1024: - ret[ - "comment" - ] = "The capacity of the volume is different, but no resize performed" + ret["comment"] = ( + "The capacity of the volume is different, but no resize performed" + ) return ret ret["result"] = None if __opts__["test"] else True diff --git a/salt/states/virtualenv_mod.py b/salt/states/virtualenv_mod.py index d395dd2cc1a..729e16a8e28 100644 --- a/salt/states/virtualenv_mod.py +++ b/salt/states/virtualenv_mod.py @@ -4,7 +4,6 @@ Setup of Python virtualenv sandboxes. .. versionadded:: 0.17.0 """ - import logging import os diff --git a/salt/states/webutil.py b/salt/states/webutil.py index 573e494cef6..d988c4e30e0 100644 --- a/salt/states/webutil.py +++ b/salt/states/webutil.py @@ -14,7 +14,6 @@ Support for htpasswd module. Requires the apache2-utils package for Debian-based """ - import salt.utils.path __virtualname__ = "webutil" diff --git a/salt/states/win_dns_client.py b/salt/states/win_dns_client.py index 9afa0faf368..48d045bbd76 100644 --- a/salt/states/win_dns_client.py +++ b/salt/states/win_dns_client.py @@ -89,9 +89,9 @@ def dns_exists(name, servers=None, interface="Local Area Connection", replace=Fa ret["changes"]["Servers Removed"].append(server) else: if not __salt__["win_dns_client.rm_dns"](server, interface): - ret[ - "comment" - ] = "Failed to remove {} from DNS server list".format(server) + ret["comment"] = ( + "Failed to remove {} from DNS server list".format(server) + ) ret["result"] = False return ret else: @@ -217,10 +217,10 @@ def primary_suffix(name, suffix=None, updates=False): else: # Changes to updates policy needed if reg_data["updates"]["new"] != reg_data["updates"]["old"]: - ret[ - "comment" - ] = "Updated primary DNS suffix ({}) and {} suffix updates".format( - suffix, updates_operation + ret["comment"] = ( + "Updated primary DNS suffix ({}) and {} suffix updates".format( + suffix, updates_operation + ) ) ret["changes"] = { "old": { diff --git a/salt/states/win_iis.py b/salt/states/win_iis.py index 4d1162680bd..4c19e823e77 100644 --- a/salt/states/win_iis.py +++ b/salt/states/win_iis.py @@ -8,7 +8,6 @@ from Microsoft IIS. """ - # Define the module's virtual name __virtualname__ = "win_iis" diff --git a/salt/states/win_lgpo.py b/salt/states/win_lgpo.py index 07b5d98cb08..125b1e9e895 100644 --- a/salt/states/win_lgpo.py +++ b/salt/states/win_lgpo.py @@ -206,6 +206,7 @@ Multiple policy configuration Windows Components\\Windows Update\\Configure Automatic Updates: """ + import logging import salt.utils.data diff --git a/salt/states/win_lgpo_reg.py b/salt/states/win_lgpo_reg.py index 8377817a198..7bd3919b350 100644 --- a/salt/states/win_lgpo_reg.py +++ b/salt/states/win_lgpo_reg.py @@ -53,6 +53,7 @@ configure that policy. you will have to find the values needed to set them with this module using a different method. """ + import salt.utils.data import salt.utils.platform diff --git a/salt/states/win_network.py b/salt/states/win_network.py index 72bf74fca13..b0549ba6dab 100644 --- a/salt/states/win_network.py +++ b/salt/states/win_network.py @@ -312,27 +312,27 @@ def managed( else: if not __salt__["ip.enable"](name): ret["result"] = False - ret[ - "comment" - ] = "Failed to enable interface '{}' to make changes".format(name) + ret["comment"] = ( + "Failed to enable interface '{}' to make changes".format(name) + ) return ret errors = _validate(dns_proto, dns_servers, ip_proto, ip_addrs, gateway) if errors: ret["result"] = False - ret[ - "comment" - ] = "The following SLS configuration errors were detected:\n- {}".format( - "\n- ".join(errors) + ret["comment"] = ( + "The following SLS configuration errors were detected:\n- {}".format( + "\n- ".join(errors) + ) ) return ret old = __salt__["ip.get_interface"](name) if not old: ret["result"] = False - ret[ - "comment" - ] = "Unable to get current configuration for interface '{}'".format(name) + ret["comment"] = ( + "Unable to get current configuration for interface '{}'".format(name) + ) return ret changes = _changes(old, dns_proto, dns_servers, ip_proto, ip_addrs, gateway) @@ -382,10 +382,10 @@ def managed( ) ret["result"] = None - ret[ - "comment" - ] = "The following changes will be made to interface '{}':\n- {}".format( - name, "\n- ".join(comments) + ret["comment"] = ( + "The following changes will be made to interface '{}':\n- {}".format( + name, "\n- ".join(comments) + ) ) return ret @@ -431,7 +431,7 @@ def managed( "for interface '{}'".format(name) ) else: - ret[ - "comment" - ] = "Successfully updated configuration for interface '{}'".format(name) + ret["comment"] = ( + "Successfully updated configuration for interface '{}'".format(name) + ) return ret diff --git a/salt/states/win_pki.py b/salt/states/win_pki.py index 168939374e1..658d979bef8 100644 --- a/salt/states/win_pki.py +++ b/salt/states/win_pki.py @@ -6,7 +6,6 @@ Microsoft certificate management via the Pki PowerShell module. .. versionadded:: 2016.11.0 """ - _DEFAULT_CONTEXT = "LocalMachine" _DEFAULT_FORMAT = "cer" _DEFAULT_STORE = "My" @@ -104,10 +103,10 @@ def import_cert( cert_props["thumbprint"], store_path ) else: - ret[ - "comment" - ] = "Certificate '{}' unable to be imported into store: {}".format( - cert_props["thumbprint"], store_path + ret["comment"] = ( + "Certificate '{}' unable to be imported into store: {}".format( + cert_props["thumbprint"], store_path + ) ) return ret @@ -163,9 +162,9 @@ def remove_cert(name, thumbprint, context=_DEFAULT_CONTEXT, store=_DEFAULT_STORE thumbprint, store_path ) else: - ret[ - "comment" - ] = "Certificate '{}' unable to be removed from store: {}".format( - thumbprint, store_path + ret["comment"] = ( + "Certificate '{}' unable to be removed from store: {}".format( + thumbprint, store_path + ) ) return ret diff --git a/salt/states/win_powercfg.py b/salt/states/win_powercfg.py index b7f4e82a139..c65b80ad0ed 100644 --- a/salt/states/win_powercfg.py +++ b/salt/states/win_powercfg.py @@ -14,7 +14,6 @@ powercfg. - power: dc """ - import logging import salt.utils.data diff --git a/salt/states/win_shortcut.py b/salt/states/win_shortcut.py index 8443a187a3c..3f14d1f6a4d 100644 --- a/salt/states/win_shortcut.py +++ b/salt/states/win_shortcut.py @@ -6,6 +6,7 @@ shortcuts. .. versionadded:: 3005 """ + import salt.utils.data import salt.utils.path import salt.utils.platform diff --git a/salt/states/win_smtp_server.py b/salt/states/win_smtp_server.py index e3eadc82745..fa5a9a76bbe 100644 --- a/salt/states/win_smtp_server.py +++ b/salt/states/win_smtp_server.py @@ -3,7 +3,6 @@ Module for managing IIS SMTP server configuration on Windows servers. """ - import salt.utils.args _DEFAULT_SERVER = "SmtpSvc/1" @@ -144,17 +143,17 @@ def active_log_format(name, log_format, server=_DEFAULT_SERVER): current_log_format = __salt__["win_smtp_server.get_log_format"](server) if log_format == current_log_format: - ret[ - "comment" - ] = "LogPluginClsid already contains the id of the provided log format." + ret["comment"] = ( + "LogPluginClsid already contains the id of the provided log format." + ) ret["result"] = True elif __opts__["test"]: ret["comment"] = "LogPluginClsid will be changed." ret["changes"] = {"old": current_log_format, "new": log_format} else: - ret[ - "comment" - ] = "Set LogPluginClsid to contain the id of the provided log format." + ret["comment"] = ( + "Set LogPluginClsid to contain the id of the provided log format." + ) ret["changes"] = {"old": current_log_format, "new": log_format} ret["result"] = __salt__["win_smtp_server.set_log_format"](log_format, server) return ret diff --git a/salt/states/win_system.py b/salt/states/win_system.py index 34f47f15e0d..1e8d66ec81e 100644 --- a/salt/states/win_system.py +++ b/salt/states/win_system.py @@ -191,9 +191,7 @@ def workgroup(name): current_workgroup = ( out["Domain"] if "Domain" in out - else out["Workgroup"] - if "Workgroup" in out - else "" + else out["Workgroup"] if "Workgroup" in out else "" ) # Notify the user if the requested workgroup is the same @@ -216,9 +214,7 @@ def workgroup(name): new_workgroup = ( out["Domain"] if "Domain" in out - else out["Workgroup"] - if "Workgroup" in out - else "" + else out["Workgroup"] if "Workgroup" in out else "" ) # Return our results based on the changes @@ -461,14 +457,14 @@ def shutdown( if only_on_pending_reboot and not __salt__["system.get_pending_reboot"](): if __opts__["test"]: - ret[ - "comment" - ] = "System {} will be skipped because no reboot is pending".format(action) + ret["comment"] = ( + "System {} will be skipped because no reboot is pending".format(action) + ) else: - ret[ - "comment" - ] = "System {} has been skipped because no reboot was pending".format( - action + ret["comment"] = ( + "System {} has been skipped because no reboot was pending".format( + action + ) ) return ret diff --git a/salt/states/win_wusa.py b/salt/states/win_wusa.py index 4371bfc1341..17996c0bde7 100644 --- a/salt/states/win_wusa.py +++ b/salt/states/win_wusa.py @@ -7,7 +7,6 @@ without WSUS or Windows Update .. versionadded:: 2018.3.4 """ - import logging import salt.utils.platform diff --git a/salt/states/x509_v2.py b/salt/states/x509_v2.py index ffabf7a4a83..7047b3612c9 100644 --- a/salt/states/x509_v2.py +++ b/salt/states/x509_v2.py @@ -180,6 +180,7 @@ according to the www policy. - require: - x509: /etc/pki/www.key """ + import base64 import copy import datetime @@ -433,9 +434,9 @@ def certificate_managed( file_managed_test = _file_managed(name, test=True, replace=False, **file_args) if file_managed_test["result"] is False: ret["result"] = False - ret[ - "comment" - ] = "Problem while testing file.managed changes, see its output" + ret["comment"] = ( + "Problem while testing file.managed changes, see its output" + ) _add_sub_state_run(ret, file_managed_test) return ret @@ -839,9 +840,9 @@ def crl_managed( if file_managed_test["result"] is False: ret["result"] = False - ret[ - "comment" - ] = "Problem while testing file.managed changes, see its output" + ret["comment"] = ( + "Problem while testing file.managed changes, see its output" + ) _add_sub_state_run(ret, file_managed_test) return ret @@ -1078,9 +1079,9 @@ def csr_managed( if file_managed_test["result"] is False: ret["result"] = False - ret[ - "comment" - ] = "Problem while testing file.managed changes, see its output" + ret["comment"] = ( + "Problem while testing file.managed changes, see its output" + ) _add_sub_state_run(ret, file_managed_test) return ret @@ -1362,9 +1363,9 @@ def private_key_managed( if file_managed_test["result"] is False: ret["result"] = False - ret[ - "comment" - ] = "Problem while testing file.managed changes, see its output" + ret["comment"] = ( + "Problem while testing file.managed changes, see its output" + ) _add_sub_state_run(ret, file_managed_test) return ret @@ -1584,9 +1585,9 @@ def _file_managed(name, test=None, **kwargs): def _check_file_ret(fret, ret, current): if fret["result"] is False: ret["result"] = False - ret[ - "comment" - ] = f"Could not {'create' if not current else 'update'} file, see file.managed output" + ret["comment"] = ( + f"Could not {'create' if not current else 'update'} file, see file.managed output" + ) ret["changes"] = {} return False return True diff --git a/salt/states/zabbix_action.py b/salt/states/zabbix_action.py index 01877edcacd..c3ff6a05054 100644 --- a/salt/states/zabbix_action.py +++ b/salt/states/zabbix_action.py @@ -164,10 +164,10 @@ def present(name, params, **kwargs): else: ret["result"] = True - ret[ - "comment" - ] = 'Zabbix Action "{}" already exists and corresponds to a definition.'.format( - name + ret["comment"] = ( + 'Zabbix Action "{}" already exists and corresponds to a definition.'.format( + name + ) ) else: diff --git a/salt/states/zabbix_template.py b/salt/states/zabbix_template.py index 53efe618cac..0e0bc6169eb 100644 --- a/salt/states/zabbix_template.py +++ b/salt/states/zabbix_template.py @@ -867,10 +867,10 @@ def present(name, params, static_host_list=True, **kwargs): if not CHANGE_STACK: ret["result"] = True - ret[ - "comment" - ] = 'Zabbix Template "{}" already exists and corresponds to a definition.'.format( - name + ret["comment"] = ( + 'Zabbix Template "{}" already exists and corresponds to a definition.'.format( + name + ) ) else: tmpl_action = next( diff --git a/salt/states/zabbix_user.py b/salt/states/zabbix_user.py index 51158b2e599..e1236458801 100644 --- a/salt/states/zabbix_user.py +++ b/salt/states/zabbix_user.py @@ -6,7 +6,6 @@ Management of Zabbix users. """ - import logging from copy import deepcopy @@ -84,9 +83,9 @@ def admin_password_present(name, password=None, **kwargs): unique_passwords.reverse() if not unique_passwords: - ret[ - "comment" - ] = "Could not find any Zabbix Admin password setting! See documentation." + ret["comment"] = ( + "Could not find any Zabbix Admin password setting! See documentation." + ) return ret else: desired_password = unique_passwords[0] diff --git a/salt/states/zabbix_valuemap.py b/salt/states/zabbix_valuemap.py index 23c14e16869..2475b2b4e53 100644 --- a/salt/states/zabbix_valuemap.py +++ b/salt/states/zabbix_valuemap.py @@ -132,10 +132,10 @@ def present(name, params, **kwargs): else: ret["result"] = True - ret[ - "comment" - ] = 'Zabbix Value map "{}" already exists and corresponds to a definition.'.format( - name + ret["comment"] = ( + 'Zabbix Value map "{}" already exists and corresponds to a definition.'.format( + name + ) ) else: diff --git a/salt/states/zenoss.py b/salt/states/zenoss.py index 0a05c67af23..a2b11e888c7 100644 --- a/salt/states/zenoss.py +++ b/salt/states/zenoss.py @@ -17,7 +17,6 @@ Allows for setting a state of minions in Zenoss using the Zenoss API. Currently - prod_state: 1000 """ - import logging log = logging.getLogger(__name__) @@ -60,15 +59,15 @@ def monitored(name, device_class=None, collector="localhost", prod_state=None): # if prod_state is set, ensure it matches with the current state if prod_state is not None and device["productionState"] != prod_state: if __opts__["test"]: - ret[ - "comment" - ] = "{} is already monitored but prodState will be updated".format(name) + ret["comment"] = ( + "{} is already monitored but prodState will be updated".format(name) + ) ret["result"] = None else: __salt__["zenoss.set_prod_state"](prod_state, name) - ret[ - "comment" - ] = "{} is already monitored but prodState was updated".format(name) + ret["comment"] = ( + "{} is already monitored but prodState was updated".format(name) + ) ret["changes"] = { "old": "prodState == {}".format(device["productionState"]), diff --git a/salt/states/zk_concurrency.py b/salt/states/zk_concurrency.py index f76ffdd64d4..0bf709911fc 100644 --- a/salt/states/zk_concurrency.py +++ b/salt/states/zk_concurrency.py @@ -45,7 +45,6 @@ This example would allow the file state to change, but would limit the concurrency of the trafficserver service restart to 4. """ - # TODO: use depends decorator to make these per function deps, instead of all or nothing REQUIRED_FUNCS = ( "zk_concurrency.lock", diff --git a/salt/states/zone.py b/salt/states/zone.py index d411ad33a0a..e4a1af32a32 100644 --- a/salt/states/zone.py +++ b/salt/states/zone.py @@ -193,10 +193,10 @@ def property_present(name, property, value): else: ## zone does not exist ret["result"] = False - ret[ - "comment" - ] = "The zone {} is not in the configured, installed, or booted state.".format( - name + ret["comment"] = ( + "The zone {} is not in the configured, installed, or booted state.".format( + name + ) ) return ret @@ -250,10 +250,10 @@ def property_absent(name, property): else: ## zone does not exist ret["result"] = False - ret[ - "comment" - ] = "The zone {} is not in the configured, installed, or booted state.".format( - name + ret["comment"] = ( + "The zone {} is not in the configured, installed, or booted state.".format( + name + ) ) return ret @@ -373,31 +373,31 @@ def resource_present( ) if ret["comment"] == "": if resource_selector_property: - ret[ - "comment" - ] = "The {} resource {} was updated.".format( - resource_type, - resource_selector_value, + ret["comment"] = ( + "The {} resource {} was updated.".format( + resource_type, + resource_selector_value, + ) ) else: - ret[ - "comment" - ] = "The {} resource was updated.".format( - resource_type, + ret["comment"] = ( + "The {} resource was updated.".format( + resource_type, + ) ) elif ret["comment"] == "": if resource_selector_property: - ret[ - "comment" - ] = "The {} resource {} was not updated.".format( - resource_type, - resource_selector_value, + ret["comment"] = ( + "The {} resource {} was not updated.".format( + resource_type, + resource_selector_value, + ) ) else: - ret[ - "comment" - ] = "The {} resource was not updated.".format( - resource_type, + ret["comment"] = ( + "The {} resource was not updated.".format( + resource_type, + ) ) if ret["result"] is None: ## add @@ -418,9 +418,9 @@ def resource_present( ret["changes"][resource_type][resource_selector_value] = {} for key in kwargs if ret["result"] else []: if resource_selector_property: - ret["changes"][resource_type][resource_selector_value][ - key - ] = _parse_value(kwargs[key]) + ret["changes"][resource_type][resource_selector_value][key] = ( + _parse_value(kwargs[key]) + ) else: ret["changes"][resource_type][key] = _parse_value(kwargs[key]) if ret["comment"] == "": @@ -436,10 +436,10 @@ def resource_present( else: ## zone does not exist ret["result"] = False - ret[ - "comment" - ] = "The zone {} is not in the configured, installed, or booted state.".format( - name + ret["comment"] = ( + "The zone {} is not in the configured, installed, or booted state.".format( + name + ) ) return ret @@ -541,10 +541,10 @@ def resource_absent( else: ## zone does not exist ret["result"] = False - ret[ - "comment" - ] = "The zone {} is not in the configured, installed, or booted state.".format( - name + ret["comment"] = ( + "The zone {} is not in the configured, installed, or booted state.".format( + name + ) ) return ret @@ -682,11 +682,11 @@ def export(name, path, replace=False): if __salt__["file.file_exists"](path) and not replace: ret["result"] = False ret["changes"] = {} - ret[ - "comment" - ] = "File {} exists, zone configuration for {} not exported.".format( - path, - name, + ret["comment"] = ( + "File {} exists, zone configuration for {} not exported.".format( + path, + name, + ) ) else: ## export and update file @@ -700,29 +700,29 @@ def export(name, path, replace=False): if __salt__["file.file_exists"](cfg_tmp): __salt__["file.remove"](cfg_tmp) ret["result"] = False - ret[ - "comment" - ] = "Unable to export zone configuration for {} to {}!".format( - name, - path, + ret["comment"] = ( + "Unable to export zone configuration for {} to {}!".format( + name, + path, + ) ) else: ret["result"] = True - ret[ - "comment" - ] = "Zone configuration for {} was exported to {}.".format( - name, - path, + ret["comment"] = ( + "Zone configuration for {} was exported to {}.".format( + name, + path, + ) ) ret["changes"][name] = "exported" else: cfg_diff = __salt__["file.get_diff"](path, cfg_tmp) if not cfg_diff: ret["result"] = True - ret[ - "comment" - ] = "Zone configuration for {} was already exported to {}.".format( - name, path + ret["comment"] = ( + "Zone configuration for {} was already exported to {}.".format( + name, path + ) ) if __salt__["file.file_exists"](cfg_tmp): __salt__["file.remove"](cfg_tmp) @@ -743,11 +743,11 @@ def export(name, path, replace=False): ) else: ret["result"] = True - ret[ - "comment" - ] = "Zone configuration for {} was re-exported to {}.".format( - name, - path, + ret["comment"] = ( + "Zone configuration for {} was re-exported to {}.".format( + name, + path, + ) ) ret["changes"][name] = "exported" else: @@ -820,9 +820,9 @@ def import_(name, path, mode="import", nodataset=False, brand_opts=None): res_import = __salt__["zonecfg.import"](name, path) if not res_import["status"]: ret["result"] = False - ret[ - "comment" - ] = "Unable to import zone configuration for {}!".format(name) + ret["comment"] = ( + "Unable to import zone configuration for {}!".format(name) + ) else: ret["result"] = True ret["changes"][name] = "imported" @@ -874,9 +874,9 @@ def import_(name, path, mode="import", nodataset=False, brand_opts=None): ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = False - ret[ - "comment" - ] = "The file {} does not exists, unable to import!".format(path) + ret["comment"] = ( + "The file {} does not exists, unable to import!".format(path) + ) else: ## zone exist ret["result"] = True @@ -1020,25 +1020,25 @@ def present(name, brand, zonepath, properties=None, resources=None): name, resource_cfg["resource_type"], resource_selector_property=resource_selector_property, - resource_selector_value=resource_cfg[ - resource_selector_property - ] - if resource_selector_property - else None, + resource_selector_value=( + resource_cfg[resource_selector_property] + if resource_selector_property + else None + ), ) else: - resource_cfg[ - "resource_selector_property" - ] = resource_selector_property + resource_cfg["resource_selector_property"] = ( + resource_selector_property + ) if resource_selector_property in resource_cfg: resource_cfg["resource_selector_value"] = resource_cfg[ resource_selector_property ] else: resource_cfg["resource_selector_value"] = None - resource_cfg[ - "name" - ] = name # we do this last because name can also be a attrib value + resource_cfg["name"] = ( + name # we do this last because name can also be a attrib value + ) res = resource_present(**resource_cfg) if res: ret["result"] = ret["result"] if res["result"] else False diff --git a/salt/states/zookeeper.py b/salt/states/zookeeper.py index 5fb20f1d813..2f629afa76b 100644 --- a/salt/states/zookeeper.py +++ b/salt/states/zookeeper.py @@ -27,7 +27,6 @@ The following options can be included in the acl dictionary: :type all: bool """ - __virtualname__ = "zookeeper" @@ -154,10 +153,10 @@ def present( cur_acls = __salt__["zookeeper.get_acls"](name, **connkwargs) if cur_value == value and _check_acls(cur_acls, chk_acls): ret["result"] = True - ret[ - "comment" - ] = "Znode {} is already set to the correct value with the correct acls".format( - name + ret["comment"] = ( + "Znode {} is already set to the correct value with the correct acls".format( + name + ) ) return ret elif __opts__["test"] is True: diff --git a/salt/syspaths.py b/salt/syspaths.py index ce9bbc44ef6..23445622614 100644 --- a/salt/syspaths.py +++ b/salt/syspaths.py @@ -13,7 +13,6 @@ paths that are set in the master/minion config files. """ - import logging import os import os.path diff --git a/salt/template.py b/salt/template.py index 7de759dc4fb..1836259257f 100644 --- a/salt/template.py +++ b/salt/template.py @@ -1,6 +1,7 @@ """ Manage basic template commands """ + import codecs import io import logging diff --git a/salt/thorium/__init__.py b/salt/thorium/__init__.py index 0b2bfb37f0d..97b37d75b95 100644 --- a/salt/thorium/__init__.py +++ b/salt/thorium/__init__.py @@ -1,6 +1,7 @@ """ The thorium system allows for advanced event tracking and reactions """ + # Needed: # Use a top file to load sls files locally # use the existing state system to compile a low state diff --git a/salt/thorium/calc.py b/salt/thorium/calc.py index 9eba4317779..b01b4d37c58 100644 --- a/salt/thorium/calc.py +++ b/salt/thorium/calc.py @@ -7,7 +7,6 @@ values are stored and computed, such as averages etc. :depends: statistics PyPi module """ - try: import statistics diff --git a/salt/thorium/file.py b/salt/thorium/file.py index 1e7dcc8f09e..ad6911e9003 100644 --- a/salt/thorium/file.py +++ b/salt/thorium/file.py @@ -37,7 +37,6 @@ Be warned that if you do this, then the file will be saved, but not in a format that can be re-imported into Python. """ - import os import salt.utils.data diff --git a/salt/thorium/reg.py b/salt/thorium/reg.py index 20cbebb253f..57842202cdf 100644 --- a/salt/thorium/reg.py +++ b/salt/thorium/reg.py @@ -3,7 +3,6 @@ Used to manage the thorium register. The thorium register is where compound values are stored and computed, such as averages etc. """ - import salt.utils.stringutils __func_alias__ = { diff --git a/salt/thorium/timer.py b/salt/thorium/timer.py index a1eefa3aa6f..bc67ec502a0 100644 --- a/salt/thorium/timer.py +++ b/salt/thorium/timer.py @@ -3,7 +3,6 @@ Allow for flow based timers. These timers allow for a sleep to exist across multiple runs of the flow """ - import time diff --git a/salt/tokens/localfs.py b/salt/tokens/localfs.py index 61c2d945ad3..8e739ae11be 100644 --- a/salt/tokens/localfs.py +++ b/salt/tokens/localfs.py @@ -2,7 +2,6 @@ Stores eauth tokens in the filesystem of the master. Location is configured by the master config option 'token_dir' """ - import hashlib import logging import os @@ -93,7 +92,7 @@ def list_tokens(opts): :returns: List of dicts (tokens) """ ret = [] - for (dirpath, dirnames, filenames) in salt.utils.path.os_walk(opts["token_dir"]): + for dirpath, dirnames, filenames in salt.utils.path.os_walk(opts["token_dir"]): for token in filenames: ret.append(token) return ret diff --git a/salt/tops/cobbler.py b/salt/tops/cobbler.py index 7a5d66662ab..5e5aed16a4b 100644 --- a/salt/tops/cobbler.py +++ b/salt/tops/cobbler.py @@ -20,9 +20,8 @@ Module Documentation """ import logging -import xmlrpc.client +import xmlrpc.client # nosec -# Set up logging log = logging.getLogger(__name__) diff --git a/salt/tops/ext_nodes.py b/salt/tops/ext_nodes.py index 4aa7ee1566c..a32c9f8eae8 100644 --- a/salt/tops/ext_nodes.py +++ b/salt/tops/ext_nodes.py @@ -44,6 +44,7 @@ The above essentially is the same as a top.sls containing the following: - basepackages - database """ + import logging import shlex import subprocess diff --git a/salt/tops/saltclass.py b/salt/tops/saltclass.py index 94dbae8b156..f9057842f47 100644 --- a/salt/tops/saltclass.py +++ b/salt/tops/saltclass.py @@ -207,7 +207,6 @@ Not using ``^`` as the first entry will simply merge the lists escaped one will not be correctly rendered - '\${xx}' will stay as is instead of being rendered as '${xx}' """ - import logging import salt.utils.saltclass as sc diff --git a/salt/tops/varstack_top.py b/salt/tops/varstack_top.py index 7f0f833cb65..479701d60ac 100644 --- a/salt/tops/varstack_top.py +++ b/salt/tops/varstack_top.py @@ -42,7 +42,6 @@ managed by salt as if given from a top.sls file. """ - try: import varstack except ImportError: diff --git a/salt/transport/__init__.py b/salt/transport/__init__.py index 3c7e2326efa..0086e5db395 100644 --- a/salt/transport/__init__.py +++ b/salt/transport/__init__.py @@ -2,7 +2,6 @@ Encapsulate the different transports available to Salt. """ - import logging import warnings diff --git a/salt/transport/client.py b/salt/transport/client.py index bd79ac357b4..2de5ddff47a 100644 --- a/salt/transport/client.py +++ b/salt/transport/client.py @@ -7,6 +7,7 @@ This includes client side transport, for the ReqServer and the Publisher NOTE: This module has been deprecated and will be removed in Argon. Please use salt.channel.server instead. """ + import logging from salt.utils.versions import warn_until diff --git a/salt/transport/frame.py b/salt/transport/frame.py index c545a6ee7cf..aa6961f5ad9 100644 --- a/salt/transport/frame.py +++ b/salt/transport/frame.py @@ -2,7 +2,6 @@ Helper functions for transport components to handle message framing """ - import salt.utils.msgpack diff --git a/salt/transport/ipc.py b/salt/transport/ipc.py index 9921fe72e5e..2ee99eb06d0 100644 --- a/salt/transport/ipc.py +++ b/salt/transport/ipc.py @@ -2,7 +2,6 @@ IPC transport classes """ - import errno import logging import socket diff --git a/salt/transport/server.py b/salt/transport/server.py index a289c88be50..67720c08098 100644 --- a/salt/transport/server.py +++ b/salt/transport/server.py @@ -7,6 +7,7 @@ This includes server side transport, for the ReqServer and the Publisher NOTE: This module has been deprecated and will be removed in Argon. Please use salt.channel.server instead. """ + import logging from salt.utils.versions import warn_until diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index 2c3b5644fe6..e64b013a978 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -6,7 +6,6 @@ Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" """ - import errno import logging import multiprocessing diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index 96f12a0d6f7..e2278dff055 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -1,6 +1,7 @@ """ Zeromq transport classes """ + import errno import hashlib import logging diff --git a/salt/utils/aggregation.py b/salt/utils/aggregation.py index e668f2c3782..eadbd2cfeb5 100644 --- a/salt/utils/aggregation.py +++ b/salt/utils/aggregation.py @@ -102,7 +102,6 @@ """ - import copy import logging @@ -132,7 +131,6 @@ class Sequence(list, Aggregate): def Scalar(obj): - """ Shortcut for Sequence creation diff --git a/salt/utils/asynchronous.py b/salt/utils/asynchronous.py index 0c645bbc3bb..b156c020ab3 100644 --- a/salt/utils/asynchronous.py +++ b/salt/utils/asynchronous.py @@ -2,7 +2,6 @@ Helpers/utils for working with tornado asynchronous stuff """ - import contextlib import logging import sys diff --git a/salt/utils/atomicfile.py b/salt/utils/atomicfile.py index 59f7e273715..8ef7ca58592 100644 --- a/salt/utils/atomicfile.py +++ b/salt/utils/atomicfile.py @@ -2,6 +2,7 @@ A module written originally by Armin Ronacher to manage file transfers in an atomic way """ + import errno import os import random diff --git a/salt/utils/aws.py b/salt/utils/aws.py index 1231661d970..7cf604fa1be 100644 --- a/salt/utils/aws.py +++ b/salt/utils/aws.py @@ -7,6 +7,7 @@ This is a base library used by a number of AWS services. :depends: requests """ + import binascii import copy import hashlib diff --git a/salt/utils/boto3mod.py b/salt/utils/boto3mod.py index 3692ae5549e..cc6d1117a1b 100644 --- a/salt/utils/boto3mod.py +++ b/salt/utils/boto3mod.py @@ -24,7 +24,6 @@ Example Usage: .. versionadded:: 2015.8.0 """ - import hashlib import logging import sys diff --git a/salt/utils/botomod.py b/salt/utils/botomod.py index 8d9d5cad535..cdadb4f0bcc 100644 --- a/salt/utils/botomod.py +++ b/salt/utils/botomod.py @@ -24,7 +24,6 @@ Example Usage: .. versionadded:: 2015.8.0 """ - import hashlib import logging import sys diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py index 5a1660cfd6a..ab389610938 100644 --- a/salt/utils/cloud.py +++ b/salt/utils/cloud.py @@ -2,7 +2,6 @@ Utility functions for salt.cloud """ - import codecs import copy import errno @@ -565,9 +564,9 @@ def bootstrap(vm_, opts=None): ) if saltify_driver: - deploy_kwargs[ - "wait_for_passwd_maxtries" - ] = 0 # No need to wait/retry with Saltify + deploy_kwargs["wait_for_passwd_maxtries"] = ( + 0 # No need to wait/retry with Saltify + ) win_installer = salt.config.get_cloud_config_value("win_installer", vm_, opts) if win_installer: diff --git a/salt/utils/color.py b/salt/utils/color.py index d765288f496..37da77472a6 100644 --- a/salt/utils/color.py +++ b/salt/utils/color.py @@ -2,7 +2,6 @@ Functions used for CLI color themes. """ - import logging import os diff --git a/salt/utils/configparser.py b/salt/utils/configparser.py index 10e3c889ef0..b636d5e320e 100644 --- a/salt/utils/configparser.py +++ b/salt/utils/configparser.py @@ -261,12 +261,12 @@ class GitConfigParser(RawConfigParser): ) if self._defaults: fp_.write(convert("[%s]\n" % self.DEFAULTSECT)) - for (key, value) in self._defaults.items(): + for key, value in self._defaults.items(): value = salt.utils.stringutils.to_unicode(value).replace("\n", "\n\t") fp_.write(convert(f"{key} = {value}\n")) for section in self._sections: fp_.write(convert("[%s]\n" % section)) - for (key, value) in self._sections[section].items(): + for key, value in self._sections[section].items(): if (value is not None) or (self._optcre == self.OPTCRE): if not isinstance(value, list): value = [value] diff --git a/salt/utils/crypt.py b/salt/utils/crypt.py index 3f9c5955915..de892d55597 100644 --- a/salt/utils/crypt.py +++ b/salt/utils/crypt.py @@ -1,6 +1,7 @@ """ Functions dealing with encryption """ + import hashlib import logging import os diff --git a/salt/utils/data.py b/salt/utils/data.py index 40c79e3418a..e525f47c47d 100644 --- a/salt/utils/data.py +++ b/salt/utils/data.py @@ -3,7 +3,6 @@ Functions for manipulating, inspecting, or otherwise working with data types and data structures. """ - import copy import datetime import fnmatch @@ -1385,7 +1384,7 @@ def recursive_diff( append_old = list(old.keys())[min_length:] append_new = list(new.keys())[min_length:] # Compare ordered - for (key_old, key_new) in zip(old, new): + for key_old, key_new in zip(old, new): if key_old == key_new: if key_old in ignore_keys: del ret_old[key_old] diff --git a/salt/utils/dateutils.py b/salt/utils/dateutils.py index b55d9a40027..e219753da6a 100644 --- a/salt/utils/dateutils.py +++ b/salt/utils/dateutils.py @@ -2,7 +2,6 @@ Convenience functions for dealing with datetime classes """ - import datetime import salt.utils.stringutils diff --git a/salt/utils/decorators/__init__.py b/salt/utils/decorators/__init__.py index 1f62d5f3d65..b849ca31145 100644 --- a/salt/utils/decorators/__init__.py +++ b/salt/utils/decorators/__init__.py @@ -2,7 +2,6 @@ Helpful decorators for module writing """ - import errno import inspect import logging @@ -217,9 +216,11 @@ class Depends: mod_name, func_name, dependency, - " version {}".format(params["version"]) - if "version" in params - else "", + ( + " version {}".format(params["version"]) + if "version" in params + else "" + ), ) # if not, unload the function if frame: diff --git a/salt/utils/decorators/state.py b/salt/utils/decorators/state.py index bcca040b996..569df725f85 100644 --- a/salt/utils/decorators/state.py +++ b/salt/utils/decorators/state.py @@ -4,7 +4,6 @@ Decorators for salt.state :codeauthor: :email:`Bo Maryniuk (bo@suse.de)` """ - import logging import salt.utils.stringutils diff --git a/salt/utils/doc.py b/salt/utils/doc.py index 9f80bc3337b..4fcbe1549d6 100644 --- a/salt/utils/doc.py +++ b/salt/utils/doc.py @@ -1,6 +1,7 @@ """ Functions for analyzing/parsing docstrings """ + import logging import re diff --git a/salt/utils/dockermod/__init__.py b/salt/utils/dockermod/__init__.py index 00b012b8992..d0f504e60dc 100644 --- a/salt/utils/dockermod/__init__.py +++ b/salt/utils/dockermod/__init__.py @@ -5,7 +5,6 @@ This module contains logic to accommodate docker/salt CLI usage, as well as input as formatted by states. """ - import copy import logging diff --git a/salt/utils/dockermod/translate/container.py b/salt/utils/dockermod/translate/container.py index 3bc37101f76..8dd21b7dc9f 100644 --- a/salt/utils/dockermod/translate/container.py +++ b/salt/utils/dockermod/translate/container.py @@ -445,9 +445,11 @@ def port_bindings(val, **kwargs): bind_vals = [ ( _format_port(val, proto), - (host_ip,) - if hport_list[idx] is None - else (host_ip, hport_list[idx]), + ( + (host_ip,) + if hport_list[idx] is None + else (host_ip, hport_list[idx]) + ), ) for idx, val in enumerate(cport_list) ] diff --git a/salt/utils/dockermod/translate/helpers.py b/salt/utils/dockermod/translate/helpers.py index 5d81f89c99e..2b090de0d78 100644 --- a/salt/utils/dockermod/translate/helpers.py +++ b/salt/utils/dockermod/translate/helpers.py @@ -110,9 +110,11 @@ def map_vals(val, *names, **extra_opts): "'{}' contains {} value(s) (expected {})".format( item, num_elements, - expected_num_elements - if fill is NOTSET - else "up to {}".format(expected_num_elements), + ( + expected_num_elements + if fill is NOTSET + else "up to {}".format(expected_num_elements) + ), ) ) val[idx] = dict(zip(names, elements)) diff --git a/salt/utils/extend.py b/salt/utils/extend.py index 72903af23fc..5fbef75fbed 100644 --- a/salt/utils/extend.py +++ b/salt/utils/extend.py @@ -12,7 +12,6 @@ This tool is accessed using `salt-extend` :codeauthor: Anthony Shaw """ - import logging import os import shutil diff --git a/salt/utils/files.py b/salt/utils/files.py index 8071a55d3a4..6a70ca6f304 100644 --- a/salt/utils/files.py +++ b/salt/utils/files.py @@ -2,7 +2,6 @@ Functions for working with files """ - import codecs import contextlib import errno @@ -490,7 +489,7 @@ def safe_walk(top, topdown=True, onerror=None, followlinks=True, _seen=None): # Note that listdir and error are globals in this module due # to earlier import-*. names = os.listdir(top) - except os.error as err: + except OSError as err: if onerror is not None: onerror(err) return @@ -699,7 +698,7 @@ def is_binary(path): return salt.utils.stringutils.is_binary(data) except UnicodeDecodeError: return True - except os.error: + except OSError: return False @@ -888,7 +887,7 @@ def get_encoding(path): try: with fopen(path, "rb") as fp_: data = fp_.read(2048) - except os.error: + except OSError: raise CommandExecutionError("Failed to open file") # Check for Unicode BOM diff --git a/salt/utils/find.py b/salt/utils/find.py index c82b27965f1..f6fc3bf9250 100644 --- a/salt/utils/find.py +++ b/salt/utils/find.py @@ -82,7 +82,6 @@ the following: user: user name """ - import logging import os import re diff --git a/salt/utils/fsutils.py b/salt/utils/fsutils.py index 96d0cd16bb8..7dda4454e9d 100644 --- a/salt/utils/fsutils.py +++ b/salt/utils/fsutils.py @@ -1,6 +1,7 @@ """ Run-time utilities """ + # # Copyright (C) 2014 SUSE LLC diff --git a/salt/utils/functools.py b/salt/utils/functools.py index f4d4cbdb3de..e164811393e 100644 --- a/salt/utils/functools.py +++ b/salt/utils/functools.py @@ -1,6 +1,7 @@ """ Utility functions to modify other functions """ + import logging import types diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index 934794bfab7..730e6b01993 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -3054,9 +3054,9 @@ class GitFS(GitBase): remotes if remotes is not None else [], per_remote_overrides=per_remote_overrides, per_remote_only=per_remote_only, - git_providers=git_providers - if git_providers is not None - else GIT_PROVIDERS, + git_providers=( + git_providers if git_providers is not None else GIT_PROVIDERS + ), cache_root=cache_root, init_remotes=init_remotes, ) @@ -3291,7 +3291,7 @@ class GitFS(GitBase): if not os.path.isdir(self.file_list_cachedir): try: os.makedirs(self.file_list_cachedir) - except os.error: + except OSError: log.error("Unable to make cachedir %s", self.file_list_cachedir) return [] list_cache = salt.utils.path.join( diff --git a/salt/utils/github.py b/salt/utils/github.py index 1d6824f2ae9..d24244e5a0e 100644 --- a/salt/utils/github.py +++ b/salt/utils/github.py @@ -2,7 +2,6 @@ Connection library for GitHub """ - import logging import salt.utils.http diff --git a/salt/utils/gzip_util.py b/salt/utils/gzip_util.py index 5946d2269ab..49592e7280e 100644 --- a/salt/utils/gzip_util.py +++ b/salt/utils/gzip_util.py @@ -4,7 +4,6 @@ Helper module for handling gzip consistently between 2.7+ and 2.6- """ - import gzip import io diff --git a/salt/utils/http.py b/salt/utils/http.py index 30c7fbdc8de..991b4735f5b 100644 --- a/salt/utils/http.py +++ b/salt/utils/http.py @@ -485,10 +485,10 @@ def query( try: match_hostname(sockwrap.getpeercert(), hostname) except CertificateError as exc: - ret[ - "error" - ] = "The certificate was invalid. Error returned was: {}".format( - pprint.pformat(exc) + ret["error"] = ( + "The certificate was invalid. Error returned was: {}".format( + pprint.pformat(exc) + ) ) return ret @@ -725,10 +725,10 @@ def query( valid_decodes = ("json", "xml", "yaml", "plain") if decode_type not in valid_decodes: - ret[ - "error" - ] = "Invalid decode_type specified. Valid decode types are: {}".format( - pprint.pformat(valid_decodes) + ret["error"] = ( + "Invalid decode_type specified. Valid decode types are: {}".format( + pprint.pformat(valid_decodes) + ) ) log.error(ret["error"]) return ret diff --git a/salt/utils/idem.py b/salt/utils/idem.py index ab7641a8e91..c05f9c26f00 100644 --- a/salt/utils/idem.py +++ b/salt/utils/idem.py @@ -6,6 +6,7 @@ This util provides access to an idem-ready hub .. versionadded:: 3002 """ + import logging import sys diff --git a/salt/utils/itertools.py b/salt/utils/itertools.py index a1f55cb026a..3e0635e15c7 100644 --- a/salt/utils/itertools.py +++ b/salt/utils/itertools.py @@ -2,7 +2,6 @@ Helpful generators and other tools """ - import fnmatch import re diff --git a/salt/utils/job.py b/salt/utils/job.py index 140f315f6c9..3d4653d412d 100644 --- a/salt/utils/job.py +++ b/salt/utils/job.py @@ -2,7 +2,6 @@ Functions for interacting with the job cache """ - import logging import salt.minion diff --git a/salt/utils/json.py b/salt/utils/json.py index 33cdbf401df..5e14872309f 100644 --- a/salt/utils/json.py +++ b/salt/utils/json.py @@ -2,7 +2,6 @@ Functions to work with JSON """ - import json import logging diff --git a/salt/utils/lazy.py b/salt/utils/lazy.py index cdc963aa801..832be90fc0d 100644 --- a/salt/utils/lazy.py +++ b/salt/utils/lazy.py @@ -2,7 +2,6 @@ Lazily-evaluated data structures, primarily used by Salt's loader """ - import logging from collections.abc import MutableMapping diff --git a/salt/utils/locales.py b/salt/utils/locales.py index 8017958d5de..cd42a8c9e8a 100644 --- a/salt/utils/locales.py +++ b/salt/utils/locales.py @@ -2,7 +2,6 @@ the locale utils used by salt """ - import sys from salt.utils.decorators import memoize as real_memoize diff --git a/salt/utils/master.py b/salt/utils/master.py index 031b151caef..ce2dfe46bf0 100644 --- a/salt/utils/master.py +++ b/salt/utils/master.py @@ -5,6 +5,7 @@ Utilities that can only be used on a salt master. """ + import logging import os import signal diff --git a/salt/utils/memcached.py b/salt/utils/memcached.py index 3bb1fa94000..11248abadd6 100644 --- a/salt/utils/memcached.py +++ b/salt/utils/memcached.py @@ -34,7 +34,6 @@ specified, rather than top-level configurations. This being the case, it is better to always use a named configuration profile, as shown above. """ - import logging from salt.exceptions import CommandExecutionError, SaltInvocationError diff --git a/salt/utils/mine.py b/salt/utils/mine.py index 4f6416e554f..04795b0f8a3 100644 --- a/salt/utils/mine.py +++ b/salt/utils/mine.py @@ -2,7 +2,6 @@ This module contains routines used for the salt mine """ - import logging import salt.utils.data diff --git a/salt/utils/minion.py b/salt/utils/minion.py index 28e63af1df3..9c53428c89b 100644 --- a/salt/utils/minion.py +++ b/salt/utils/minion.py @@ -2,7 +2,6 @@ Utility functions for minions """ - import logging import os import threading diff --git a/salt/utils/minions.py b/salt/utils/minions.py index 082b6985225..3006118c239 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -3,7 +3,6 @@ This module contains routines used to verify the matcher against the minions expected to return """ - import fnmatch import logging import os diff --git a/salt/utils/mount.py b/salt/utils/mount.py index 019cac5562b..c09791e668e 100644 --- a/salt/utils/mount.py +++ b/salt/utils/mount.py @@ -2,7 +2,6 @@ Common functions for managing mounts """ - import logging import os diff --git a/salt/utils/msazure.py b/salt/utils/msazure.py index de4419caacd..7b76f2f6b32 100644 --- a/salt/utils/msazure.py +++ b/salt/utils/msazure.py @@ -4,7 +4,6 @@ Utilities for accessing storage container blobs on Azure """ - import logging from salt.exceptions import SaltSystemExit diff --git a/salt/utils/msgpack.py b/salt/utils/msgpack.py index fcd9f93a04f..6dde58938ff 100644 --- a/salt/utils/msgpack.py +++ b/salt/utils/msgpack.py @@ -1,6 +1,7 @@ """ Functions to work with MessagePack """ + import logging log = logging.getLogger(__name__) diff --git a/salt/utils/namecheap.py b/salt/utils/namecheap.py index 343ecfb62b6..c09a04b6ac6 100644 --- a/salt/utils/namecheap.py +++ b/salt/utils/namecheap.py @@ -15,7 +15,6 @@ """ - import logging import xml.dom.minidom diff --git a/salt/utils/napalm.py b/salt/utils/napalm.py index d78422a7111..9fc15e45fdb 100644 --- a/salt/utils/napalm.py +++ b/salt/utils/napalm.py @@ -14,7 +14,6 @@ Utils for the NAPALM modules and proxy. .. versionadded:: 2017.7.0 """ - import copy import importlib import logging diff --git a/salt/utils/network.py b/salt/utils/network.py index 13eaa4835ca..29c6c2f1049 100644 --- a/salt/utils/network.py +++ b/salt/utils/network.py @@ -2174,9 +2174,7 @@ def dns_check(addr, port, safe=False, ipv6=None): family = ( socket.AF_INET6 if ipv6 - else socket.AF_INET - if ipv6 is False - else socket.AF_UNSPEC + else socket.AF_INET if ipv6 is False else socket.AF_UNSPEC ) socket_error = False try: diff --git a/salt/utils/odict.py b/salt/utils/odict.py index bf9dd06e448..2834f1d9246 100644 --- a/salt/utils/odict.py +++ b/salt/utils/odict.py @@ -11,6 +11,7 @@ http://stackoverflow.com/questions/6190331/ """ + import copy from collections import OrderedDict from collections.abc import Callable diff --git a/salt/utils/openstack/neutron.py b/salt/utils/openstack/neutron.py index b7934b5f651..cace3e3b77a 100644 --- a/salt/utils/openstack/neutron.py +++ b/salt/utils/openstack/neutron.py @@ -2,7 +2,6 @@ Neutron class """ - import logging import salt.utils.versions @@ -89,7 +88,6 @@ class SaltNeutron(NeutronShell): use_keystoneauth=False, **kwargs ): - """ Set up neutron credentials """ diff --git a/salt/utils/openstack/nova.py b/salt/utils/openstack/nova.py index 386b585c861..90b0b1f8269 100644 --- a/salt/utils/openstack/nova.py +++ b/salt/utils/openstack/nova.py @@ -2,7 +2,6 @@ Nova class """ - import inspect import logging import time @@ -1033,9 +1032,9 @@ class SaltNova: "OS-EXT-SRV-ATTR:host" ] if hasattr(item.__dict__, "OS-EXT-SRV-ATTR:hypervisor_hostname"): - ret[item.name]["OS-EXT-SRV-ATTR"][ - "hypervisor_hostname" - ] = item.__dict__["OS-EXT-SRV-ATTR:hypervisor_hostname"] + ret[item.name]["OS-EXT-SRV-ATTR"]["hypervisor_hostname"] = ( + item.__dict__["OS-EXT-SRV-ATTR:hypervisor_hostname"] + ) if hasattr(item.__dict__, "OS-EXT-SRV-ATTR:instance_name"): ret[item.name]["OS-EXT-SRV-ATTR"]["instance_name"] = item.__dict__[ "OS-EXT-SRV-ATTR:instance_name" diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index 385e69f6a15..c915d5621f6 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -7,6 +7,7 @@ This is where all the black magic happens on all of salt's CLI tools. """ + # pylint: disable=missing-docstring,protected-access,too-many-ancestors,too-few-public-methods # pylint: disable=attribute-defined-outside-init,no-self-use diff --git a/salt/utils/path.py b/salt/utils/path.py index f6aa7d5dad7..80b4dcb405f 100644 --- a/salt/utils/path.py +++ b/salt/utils/path.py @@ -3,7 +3,6 @@ Platform independent versions of some os/os.path functions. Gets around PY2's lack of support for reading NTFS links. """ - import logging import os import posixpath diff --git a/salt/utils/pbm.py b/salt/utils/pbm.py index c8eceaeedb3..6e3e32ddbcb 100644 --- a/salt/utils/pbm.py +++ b/salt/utils/pbm.py @@ -37,7 +37,6 @@ version currently listed in PyPi, run the following: pip install pyVmomi==5.5.0.2014.1.1 """ - import logging import salt.utils.vmware diff --git a/salt/utils/pkg/rpm.py b/salt/utils/pkg/rpm.py index f9975f8dff1..4f91278fc7d 100644 --- a/salt/utils/pkg/rpm.py +++ b/salt/utils/pkg/rpm.py @@ -1,6 +1,7 @@ """ Common functions for working with RPM packages """ + import collections import datetime import logging diff --git a/salt/utils/pkg/win.py b/salt/utils/pkg/win.py index f988f7a99af..91e93d9aac0 100644 --- a/salt/utils/pkg/win.py +++ b/salt/utils/pkg/win.py @@ -10,6 +10,7 @@ Collect information about software installed on Windows OS Known Issue: install_date may not match Control Panel\Programs\Programs and Features """ + import collections import datetime import locale diff --git a/salt/utils/platform.py b/salt/utils/platform.py index 35bb7ff3f81..c6ca7fe8cae 100644 --- a/salt/utils/platform.py +++ b/salt/utils/platform.py @@ -1,6 +1,7 @@ """ Functions for identifying which platform a machine is """ + import contextlib import multiprocessing import os diff --git a/salt/utils/process.py b/salt/utils/process.py index 765a2fac8d9..fc63cd0778f 100644 --- a/salt/utils/process.py +++ b/salt/utils/process.py @@ -1,6 +1,7 @@ """ Functions for daemonizing and otherwise modifying running processes """ + import contextlib import copy import errno @@ -920,9 +921,9 @@ class Process(multiprocessing.Process): self.__init__(*args, **kwargs) # Override self.__logging_config__ with what's in state self.__logging_config__ = logging_config - for (function, args, kwargs) in state["after_fork_methods"]: + for function, args, kwargs in state["after_fork_methods"]: self.register_after_fork_method(function, *args, **kwargs) - for (function, args, kwargs) in state["finalize_methods"]: + for function, args, kwargs in state["finalize_methods"]: self.register_finalize_method(function, *args, **kwargs) def __getstate__(self): diff --git a/salt/utils/profile.py b/salt/utils/profile.py index 30f4276ef0c..a9fa13b9b48 100644 --- a/salt/utils/profile.py +++ b/salt/utils/profile.py @@ -2,7 +2,6 @@ Decorator and functions to profile Salt using cProfile """ - import datetime import logging import os diff --git a/salt/utils/proxy.py b/salt/utils/proxy.py index 6677134f478..b9db9251582 100644 --- a/salt/utils/proxy.py +++ b/salt/utils/proxy.py @@ -2,7 +2,6 @@ Utils for proxy. """ - import logging import salt.utils.platform diff --git a/salt/utils/pycrypto.py b/salt/utils/pycrypto.py index a0f3874035e..d42ee6db9b9 100644 --- a/salt/utils/pycrypto.py +++ b/salt/utils/pycrypto.py @@ -1,6 +1,7 @@ """ Use pycrypto to generate random passwords on the fly. """ + import logging import random import re diff --git a/salt/utils/reactor.py b/salt/utils/reactor.py index 3ddb363117c..0229738ec3c 100644 --- a/salt/utils/reactor.py +++ b/salt/utils/reactor.py @@ -1,6 +1,7 @@ """ Functions which implement running reactor jobs """ + import fnmatch import glob import logging diff --git a/salt/utils/saltclass.py b/salt/utils/saltclass.py index bbd33068b06..6667226bd74 100644 --- a/salt/utils/saltclass.py +++ b/salt/utils/saltclass.py @@ -138,7 +138,7 @@ def dict_merge(a, b, path=None): # Recursive search and replace in a dict def dict_search_and_replace(d, old, new, expanded): - for (k, v) in d.items(): + for k, v in d.items(): if isinstance(v, dict): dict_search_and_replace(d[k], old, new, expanded) @@ -206,7 +206,7 @@ def expand_variables(a, b, expanded, path=None): b = a.copy() path = [] - for (k, v) in a.items(): + for k, v in a.items(): if isinstance(v, dict): expand_variables(v, b, expanded, path + [str(k)]) else: diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py index 6565dda59e6..34b29d36738 100644 --- a/salt/utils/schedule.py +++ b/salt/utils/schedule.py @@ -1108,10 +1108,10 @@ class Schedule: and i in self.opts["grains"]["whens"] ): if not isinstance(self.opts["grains"]["whens"], dict): - data[ - "_error" - ] = 'Grain "whens" must be a dict. Ignoring job {}.'.format( - data["name"] + data["_error"] = ( + 'Grain "whens" must be a dict. Ignoring job {}.'.format( + data["name"] + ) ) log.error(data["_error"]) return @@ -1123,10 +1123,10 @@ class Schedule: try: when_ = dateutil_parser.parse(when_) except ValueError: - data[ - "_error" - ] = "Invalid date string {}. Ignoring job {}.".format( - i, data["name"] + data["_error"] = ( + "Invalid date string {}. Ignoring job {}.".format( + i, data["name"] + ) ) log.error(data["_error"]) return @@ -1382,10 +1382,10 @@ class Schedule: try: start = dateutil_parser.parse(start) except ValueError: - data[ - "_error" - ] = "Invalid date string for start. Ignoring job {}.".format( - data["name"] + data["_error"] = ( + "Invalid date string for start. Ignoring job {}.".format( + data["name"] + ) ) log.error(data["_error"]) return @@ -1394,10 +1394,10 @@ class Schedule: try: end = dateutil_parser.parse(end) except ValueError: - data[ - "_error" - ] = "Invalid date string for end. Ignoring job {}.".format( - data["name"] + data["_error"] = ( + "Invalid date string for end. Ignoring job {}.".format( + data["name"] + ) ) log.error(data["_error"]) return @@ -1883,7 +1883,6 @@ class Schedule: def clean_proc_dir(opts): - """ Loop through jid files in the minion proc directory (default /var/cache/salt/minion/proc) and remove any that refer to processes that no longer exist diff --git a/salt/utils/smb.py b/salt/utils/smb.py index d3468078a48..a31c8e175fc 100644 --- a/salt/utils/smb.py +++ b/salt/utils/smb.py @@ -4,7 +4,6 @@ Utility functions for SMB connections :depends: impacket """ - import logging import socket import uuid @@ -87,9 +86,9 @@ class SMBProto: file = cls.normalize_filename(file) # ensure file is created, get maximal access, and set everybody read access max_req = SMB2CreateContextRequest() - max_req[ - "buffer_name" - ] = CreateContextName.SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST + max_req["buffer_name"] = ( + CreateContextName.SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST + ) max_req["buffer_data"] = SMB2CreateQueryMaximalAccessRequest() # create security buffer that sets the ACL for everyone to have read access diff --git a/salt/utils/smtp.py b/salt/utils/smtp.py index bab7a3aa4eb..a138a03110b 100644 --- a/salt/utils/smtp.py +++ b/salt/utils/smtp.py @@ -83,10 +83,10 @@ def send(kwargs, opts): config["smtp.content"] = str(encrypted_data) else: log.error("SMTP: Encryption failed, only an error message will be sent") - config[ - "smtp.content" - ] = "Encryption failed, the return data was not sent.\r\n\r\n{}\r\n{}".format( - encrypted_data.status, encrypted_data.stderr + config["smtp.content"] = ( + "Encryption failed, the return data was not sent.\r\n\r\n{}\r\n{}".format( + encrypted_data.status, encrypted_data.stderr + ) ) message = "From: {}\r\nTo: {}\r\nDate: {}\r\nSubject: {}\r\n\r\n{}".format( diff --git a/salt/utils/ssdp.py b/salt/utils/ssdp.py index 4c7e588284d..bbc0c07eb23 100644 --- a/salt/utils/ssdp.py +++ b/salt/utils/ssdp.py @@ -306,7 +306,7 @@ class SSDPDiscoveryServer(SSDPBase): if not addr_pairs_info: raise ValueError("can not get address information") exceptions = [] - for ((family, proto), (local_address, remote_address)) in addr_pairs_info: + for (family, proto), (local_address, remote_address) in addr_pairs_info: sock = r_addr = None try: sock = socket.socket(family=family, type=socket.SOCK_DGRAM, proto=proto) diff --git a/salt/utils/state.py b/salt/utils/state.py index de3913e0286..41c2e191cc9 100644 --- a/salt/utils/state.py +++ b/salt/utils/state.py @@ -4,7 +4,6 @@ Utility functions for state functions .. versionadded:: 2018.3.0 """ - import copy import salt.state diff --git a/salt/utils/stringio.py b/salt/utils/stringio.py index 1dae9346484..0d3cadf2936 100644 --- a/salt/utils/stringio.py +++ b/salt/utils/stringio.py @@ -2,7 +2,6 @@ Functions for StringIO objects """ - import io readable_types = (io.StringIO,) diff --git a/salt/utils/stringutils.py b/salt/utils/stringutils.py index 30ca46fee5c..6f7af315eda 100644 --- a/salt/utils/stringutils.py +++ b/salt/utils/stringutils.py @@ -2,7 +2,6 @@ Functions for manipulating or otherwise processing strings """ - import base64 import difflib import errno diff --git a/salt/utils/templates.py b/salt/utils/templates.py index 872d92686af..23990534546 100644 --- a/salt/utils/templates.py +++ b/salt/utils/templates.py @@ -1,6 +1,7 @@ """ Template render systems """ + import codecs import importlib.machinery import importlib.util diff --git a/salt/utils/textformat.py b/salt/utils/textformat.py index 304456a0e50..c3298d17d68 100644 --- a/salt/utils/textformat.py +++ b/salt/utils/textformat.py @@ -3,7 +3,6 @@ ANSI escape code utilities, see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf """ - graph_prefix = "\x1b[" graph_suffix = "m" codes = { diff --git a/salt/utils/thin.py b/salt/utils/thin.py index 80766a286a9..3c77898fc69 100644 --- a/salt/utils/thin.py +++ b/salt/utils/thin.py @@ -701,7 +701,7 @@ def gen_thin( # This is likely a compressed python .egg tempdir = tempfile.mkdtemp() egg = zipfile.ZipFile(top_dirname) - egg.extractall(tempdir) + egg.extractall(tempdir) # nosec top = os.path.join(tempdir, base) os.chdir(tempdir) @@ -973,7 +973,7 @@ def gen_min( # This is likely a compressed python .egg tempdir = tempfile.mkdtemp() egg = zipfile.ZipFile(top_dirname) - egg.extractall(tempdir) + egg.extractall(tempdir) # nosec top = os.path.join(tempdir, base) os.chdir(tempdir) if not os.path.isdir(top): diff --git a/salt/utils/url.py b/salt/utils/url.py index a30610394c1..a5d2e566670 100644 --- a/salt/utils/url.py +++ b/salt/utils/url.py @@ -2,7 +2,6 @@ URL utils """ - import re import sys from urllib.parse import urlparse, urlunparse diff --git a/salt/utils/user.py b/salt/utils/user.py index c9c12f5ca64..1ce7aa2c78e 100644 --- a/salt/utils/user.py +++ b/salt/utils/user.py @@ -3,7 +3,6 @@ Functions for querying and modifying a user account and the groups to which it belongs. """ - import ctypes import getpass import logging diff --git a/salt/utils/vault.py b/salt/utils/vault.py index 9e31adf5066..c8b54ef2e49 100644 --- a/salt/utils/vault.py +++ b/salt/utils/vault.py @@ -609,7 +609,7 @@ def expand_pattern_lists(pattern, **mappings): # very expensive, since patterns will typically involve a handful of lists at # most. - for (_, field_name, _, _) in f.parse(pattern): + for _, field_name, _, _ in f.parse(pattern): if field_name is None: continue (value, _) = f.get_field(field_name, None, mappings) diff --git a/salt/utils/versions.py b/salt/utils/versions.py index 5c03a15b090..7a5ca51a4ce 100644 --- a/salt/utils/versions.py +++ b/salt/utils/versions.py @@ -6,6 +6,7 @@ which works under python 3 because on python 3 you can no longer compare strings against integers. """ + import datetime import inspect import logging diff --git a/salt/utils/vsan.py b/salt/utils/vsan.py index 7f893150fa6..c44cb50a2f0 100644 --- a/salt/utils/vsan.py +++ b/salt/utils/vsan.py @@ -41,7 +41,6 @@ The 5.5.0.2014.1.1 is a known stable version that this original VMware utils fil was developed against. """ - import logging import ssl import sys diff --git a/salt/utils/win_lgpo_reg.py b/salt/utils/win_lgpo_reg.py index 8144d87f5de..c6f7e17f323 100644 --- a/salt/utils/win_lgpo_reg.py +++ b/salt/utils/win_lgpo_reg.py @@ -2,6 +2,7 @@ A Salt Util for working with the Registry.pol file. The Registry.pol file is the source of truth for registry settings that are configured via LGPO. """ + import logging import os import re diff --git a/salt/utils/win_network.py b/salt/utils/win_network.py index 1e8ac4db3b8..8d168595967 100644 --- a/salt/utils/win_network.py +++ b/salt/utils/win_network.py @@ -18,6 +18,7 @@ depending on the version of Windows this is run on. Once support for Windows :depends: - pythonnet - wmi """ + # https://docs.microsoft.com/en-us/dotnet/api/system.net.networkinformation.networkinterface.getallnetworkinterfaces?view=netframework-4.7.2 import logging diff --git a/salt/utils/win_osinfo.py b/salt/utils/win_osinfo.py index 56f1e12d50f..99a3b0ad9fd 100644 --- a/salt/utils/win_osinfo.py +++ b/salt/utils/win_osinfo.py @@ -1,6 +1,7 @@ """ Get Version information from Windows """ + # http://stackoverflow.com/questions/32300004/python-ctypes-getting-0-with-getversionex-function import ctypes diff --git a/salt/utils/win_system.py b/salt/utils/win_system.py index e9f38c9171e..125024674ce 100644 --- a/salt/utils/win_system.py +++ b/salt/utils/win_system.py @@ -5,6 +5,7 @@ Functions shared with salt.modules.win_system and salt.grains.pending_reboot .. versionadded:: 3001 """ + # NOTE: DO NOT USE RAW STRINGS IN THIS MODULE! UNICODE_LITERALS DOES NOT PLAY # NICELY WITH RAW STRINGS CONTAINING \u or \U. diff --git a/salt/utils/win_update.py b/salt/utils/win_update.py index 778acd141fa..edbc60881db 100644 --- a/salt/utils/win_update.py +++ b/salt/utils/win_update.py @@ -1,6 +1,7 @@ """ Classes for working with Windows Update Agent """ + import logging import subprocess diff --git a/salt/utils/x509.py b/salt/utils/x509.py index 37ee5155f73..e9575875c10 100644 --- a/salt/utils/x509.py +++ b/salt/utils/x509.py @@ -1190,21 +1190,21 @@ def _create_authority_key_identifier(val, ca_crt, ca_pub, **kwargs): cx509.SubjectKeyIdentifier ).value.digest except cx509.ExtensionNotFound: - args[ - "key_identifier" - ] = cx509.AuthorityKeyIdentifier.from_issuer_public_key( - ca_crt.public_key() - ).key_identifier + args["key_identifier"] = ( + cx509.AuthorityKeyIdentifier.from_issuer_public_key( + ca_crt.public_key() + ).key_identifier + ) except Exception: # pylint: disable=broad-except pass if not args["key_identifier"] and ca_pub: # this should happen for self-signed certificates try: - args[ - "key_identifier" - ] = cx509.AuthorityKeyIdentifier.from_issuer_public_key( - ca_pub - ).key_identifier + args["key_identifier"] = ( + cx509.AuthorityKeyIdentifier.from_issuer_public_key( + ca_pub + ).key_identifier + ) except Exception: # pylint: disable=broad-except pass @@ -1484,12 +1484,14 @@ def _create_policy_constraints(val, **kwargs): if isinstance(val, str): val, critical = _deserialize_openssl_confstring(val) args = { - "require_explicit_policy": int(val["requireExplicitPolicy"]) - if "requireExplicitPolicy" in val - else None, - "inhibit_policy_mapping": int(val["inhibitPolicyMapping"]) - if "inhibitPolicyMapping" in val - else None, + "require_explicit_policy": ( + int(val["requireExplicitPolicy"]) + if "requireExplicitPolicy" in val + else None + ), + "inhibit_policy_mapping": ( + int(val["inhibitPolicyMapping"]) if "inhibitPolicyMapping" in val else None + ), } try: # not sure why pylint complains about this line having kwargs from keyUsage @@ -1544,12 +1546,12 @@ def _create_name_constraints(val, **kwargs): ], } args = { - "permitted_subtrees": _parse_general_names(val["permitted"]) - if "permitted" in val - else None, - "excluded_subtrees": _parse_general_names(val["excluded"]) - if "excluded" in val - else None, + "permitted_subtrees": ( + _parse_general_names(val["permitted"]) if "permitted" in val else None + ), + "excluded_subtrees": ( + _parse_general_names(val["excluded"]) if "excluded" in val else None + ), } if not any(args.values()): raise SaltInvocationError("nameConstraints needs at least one definition") @@ -1954,13 +1956,15 @@ def _render_subject_key_identifier(ext): def _render_authority_key_identifier(ext): return { - "keyid": pretty_hex(ext.value.key_identifier) - if ext.value.key_identifier - else None, + "keyid": ( + pretty_hex(ext.value.key_identifier) if ext.value.key_identifier else None + ), "issuer": [render_gn(x) for x in ext.value.authority_cert_issuer or []] or None, - "issuer_sn": dec2hex(ext.value.authority_cert_serial_number) - if ext.value.authority_cert_serial_number - else None, + "issuer_sn": ( + dec2hex(ext.value.authority_cert_serial_number) + if ext.value.authority_cert_serial_number + else None + ), } @@ -1994,11 +1998,11 @@ def _render_authority_info_access(ext): for description in ext.value._descriptions: rendered.append( { - description.access_method._name - if description.access_method._name != "Unknown OID" - else description.access_method.dotted_string: render_gn( - description.access_location.value - ) + ( + description.access_method._name + if description.access_method._name != "Unknown OID" + else description.access_method.dotted_string + ): render_gn(description.access_location.value) } ) except AttributeError: @@ -2015,9 +2019,11 @@ def _render_distribution_points(ext): "crlissuer": [render_gn(x) for x in dpoint.crl_issuer or []], "fullname": [render_gn(x) for x in dpoint.full_name or []], "reasons": list(sorted(x.value for x in dpoint.reasons or [])), - "relativename": dpoint.relative_name.rfc4514_string() - if dpoint.relative_name - else None, + "relativename": ( + dpoint.relative_name.rfc4514_string() + if dpoint.relative_name + else None + ), } ) except AttributeError: @@ -2031,9 +2037,11 @@ def _render_issuing_distribution_point(ext): "onysomereasons": list( sorted(x.value for x in ext.value.only_some_reasons or []) ), - "relativename": ext.value.relative_name.rfc4514_string() - if ext.value.relative_name - else None, + "relativename": ( + ext.value.relative_name.rfc4514_string() + if ext.value.relative_name + else None + ), "onlyuser": ext.value.only_contains_user_certs, "onlyCA": ext.value.only_contains_ca_certs, "onlyAA": ext.value.only_contains_attribute_certs, diff --git a/salt/utils/xmlutil.py b/salt/utils/xmlutil.py index 46e2946f914..9943c28b7c7 100644 --- a/salt/utils/xmlutil.py +++ b/salt/utils/xmlutil.py @@ -331,9 +331,11 @@ def change_xml(doc, data, mapping): if new_value is not None: # We need to increment ids from arrays since xpath starts at 1 converters = { - p: (lambda n: n + 1) - if "[${}]".format(p) in xpath - else (lambda n: n) + p: ( + (lambda n: n + 1) + if "[${}]".format(p) in xpath + else (lambda n: n) + ) for p in placeholders } ctx = { diff --git a/salt/utils/yaml.py b/salt/utils/yaml.py index f590d493261..8e9e202b15f 100644 --- a/salt/utils/yaml.py +++ b/salt/utils/yaml.py @@ -1,6 +1,7 @@ """ Convenience module that provides our custom loader and dumper in a single module """ + # pylint: disable=wildcard-import,unused-wildcard-import,unused-import from yaml import YAMLError, parser, scanner diff --git a/salt/utils/yamldumper.py b/salt/utils/yamldumper.py index e5e937cac7d..8c6e40394a3 100644 --- a/salt/utils/yamldumper.py +++ b/salt/utils/yamldumper.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~~~~~~~ """ + # pylint: disable=W0232 # class has no __init__ method diff --git a/salt/utils/yamlencoding.py b/salt/utils/yamlencoding.py index 7e26b9afcb5..b9c2d20d6c8 100644 --- a/salt/utils/yamlencoding.py +++ b/salt/utils/yamlencoding.py @@ -2,7 +2,6 @@ Functions for adding yaml encoding to the jinja context """ - import io import sys diff --git a/salt/utils/yamlloader.py b/salt/utils/yamlloader.py index 25b4b3bb936..f5bba7dc5c4 100644 --- a/salt/utils/yamlloader.py +++ b/salt/utils/yamlloader.py @@ -2,7 +2,6 @@ Custom YAML loading in Salt """ - import yaml # pylint: disable=blacklisted-import from yaml.constructor import ConstructorError from yaml.nodes import MappingNode, SequenceNode diff --git a/salt/utils/yamlloader_old.py b/salt/utils/yamlloader_old.py index d24717a79b2..9a81f5c8793 100644 --- a/salt/utils/yamlloader_old.py +++ b/salt/utils/yamlloader_old.py @@ -2,7 +2,6 @@ Custom YAML loading in Salt """ - import re import yaml # pylint: disable=blacklisted-import diff --git a/salt/utils/zfs.py b/salt/utils/zfs.py index 3c38cecc7aa..593cd8f96c8 100644 --- a/salt/utils/zfs.py +++ b/salt/utils/zfs.py @@ -12,7 +12,6 @@ These functions are for dealing with type conversion and basic execution """ - import logging import math import os diff --git a/salt/version.py b/salt/version.py index 8cc50f6ef05..53522e3f9a2 100644 --- a/salt/version.py +++ b/salt/version.py @@ -1,6 +1,7 @@ """ Set up the version of Salt """ + import argparse import operator import os diff --git a/salt/wheel/file_roots.py b/salt/wheel/file_roots.py index c25bb883fbe..6fb23d2cd4d 100644 --- a/salt/wheel/file_roots.py +++ b/salt/wheel/file_roots.py @@ -2,7 +2,6 @@ Read in files from the file_root and save files to the file root """ - import os import salt.utils.files diff --git a/salt/wheel/key.py b/salt/wheel/key.py index 44a1b7ab626..1b756c683f6 100644 --- a/salt/wheel/key.py +++ b/salt/wheel/key.py @@ -26,7 +26,6 @@ The wheel key functions can also be called via a ``salt`` command at the CLI using the :mod:`saltutil execution module `. """ - import hashlib import logging import os diff --git a/salt/wheel/minions.py b/salt/wheel/minions.py index 75d06a94f02..65ac422f268 100644 --- a/salt/wheel/minions.py +++ b/salt/wheel/minions.py @@ -2,7 +2,6 @@ Wheel system wrapper for connected minions """ - import salt.config import salt.utils.minions from salt.utils.cache import CacheCli diff --git a/tests/conftest.py b/tests/conftest.py index 38cfa97c7f7..24ad882c878 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -519,7 +519,9 @@ def pytest_collection_modifyitems(config, items): log.debug("Finish called on %s", self) try: return func(request) - except BaseException as exc: # pylint: disable=broad-except + except ( + BaseException # pylint: disable=broad-except + ) as exc: pytest.fail( "Failed to run finish() on {}: {}".format( fixturedef, exc diff --git a/tests/eventlisten.py b/tests/eventlisten.py index 4b56378a448..c2ced91a979 100644 --- a/tests/eventlisten.py +++ b/tests/eventlisten.py @@ -4,6 +4,7 @@ what the sock_dir is. This script is a generic tool to test event output """ + import optparse # pylint: disable=deprecated-module import os import pprint diff --git a/tests/integration/cli/test_custom_module.py b/tests/integration/cli/test_custom_module.py index 68d42ff2cd8..7a307f139e0 100644 --- a/tests/integration/cli/test_custom_module.py +++ b/tests/integration/cli/test_custom_module.py @@ -36,7 +36,7 @@ from tests.support.case import SSHCase pytestmark = [ pytest.mark.skipif( "grains['osfinger'] == 'Fedora Linux-39'", - reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12" + reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12", # Actually, the problem is that the tornado we ship is not prepared for Python 3.12, # and it imports `ssl` and checks if the `match_hostname` function is defined, which # has been deprecated since Python 3.7, so, the logic goes into trying to import diff --git a/tests/integration/cloud/clouds/test_digitalocean.py b/tests/integration/cloud/clouds/test_digitalocean.py index 64ad0f17426..7e2230c6b17 100644 --- a/tests/integration/cloud/clouds/test_digitalocean.py +++ b/tests/integration/cloud/clouds/test_digitalocean.py @@ -1,6 +1,7 @@ """ Integration tests for DigitalOcean APIv2 """ + import base64 import hashlib diff --git a/tests/integration/cloud/clouds/test_dimensiondata.py b/tests/integration/cloud/clouds/test_dimensiondata.py index 56ac83042c3..0d258216f93 100644 --- a/tests/integration/cloud/clouds/test_dimensiondata.py +++ b/tests/integration/cloud/clouds/test_dimensiondata.py @@ -2,7 +2,6 @@ Integration tests for the Dimension Data cloud provider """ - from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest diff --git a/tests/integration/cloud/clouds/test_ec2.py b/tests/integration/cloud/clouds/test_ec2.py index c3c3da8484e..c349c40844f 100644 --- a/tests/integration/cloud/clouds/test_ec2.py +++ b/tests/integration/cloud/clouds/test_ec2.py @@ -1,6 +1,7 @@ """ :codeauthor: Nicole Thomas """ + import os import pytest diff --git a/tests/integration/cloud/clouds/test_gce.py b/tests/integration/cloud/clouds/test_gce.py index affa0134fc5..a2366b1d90d 100644 --- a/tests/integration/cloud/clouds/test_gce.py +++ b/tests/integration/cloud/clouds/test_gce.py @@ -3,7 +3,6 @@ :codeauthor: Tomas Sirny """ - from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest diff --git a/tests/integration/cloud/clouds/test_linode.py b/tests/integration/cloud/clouds/test_linode.py index 7b0919cb2f1..1b06fe72620 100644 --- a/tests/integration/cloud/clouds/test_linode.py +++ b/tests/integration/cloud/clouds/test_linode.py @@ -2,7 +2,6 @@ :codeauthor: Nicole Thomas """ - # Create the cloud instance name to be used throughout the tests from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest diff --git a/tests/integration/cloud/clouds/test_oneandone.py b/tests/integration/cloud/clouds/test_oneandone.py index 64a2d16694d..148d9aafe53 100644 --- a/tests/integration/cloud/clouds/test_oneandone.py +++ b/tests/integration/cloud/clouds/test_oneandone.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`Amel Ajdinovic ` """ + import pytest from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest diff --git a/tests/integration/cloud/clouds/test_profitbricks.py b/tests/integration/cloud/clouds/test_profitbricks.py index 0428b40c260..bc7928f4c1e 100644 --- a/tests/integration/cloud/clouds/test_profitbricks.py +++ b/tests/integration/cloud/clouds/test_profitbricks.py @@ -1,6 +1,7 @@ """ :codeauthor: Ethan Devenport """ + import pytest from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest diff --git a/tests/integration/cloud/helpers/cloud_test_base.py b/tests/integration/cloud/helpers/cloud_test_base.py index 48e44a6f0fa..ec634ab7380 100644 --- a/tests/integration/cloud/helpers/cloud_test_base.py +++ b/tests/integration/cloud/helpers/cloud_test_base.py @@ -2,7 +2,6 @@ Tests for the Openstack Cloud Provider """ - import logging import os import shutil diff --git a/tests/integration/cloud/test_cloud.py b/tests/integration/cloud/test_cloud.py index 29bd820da7b..85a0d397efe 100644 --- a/tests/integration/cloud/test_cloud.py +++ b/tests/integration/cloud/test_cloud.py @@ -1,6 +1,7 @@ """ Integration tests for functions located in the salt.cloud.__init__.py file. """ + import pytest import salt.cloud diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 1e1baf6134a..13ded49f4a6 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -4,6 +4,7 @@ Integration tests PyTest configuration/fixtures """ + import logging import pathlib diff --git a/tests/integration/files/extension_modules/pillar/ext_pillar_opts.py b/tests/integration/files/extension_modules/pillar/ext_pillar_opts.py index 19d4d4e9420..37d8e0d2450 100644 --- a/tests/integration/files/extension_modules/pillar/ext_pillar_opts.py +++ b/tests/integration/files/extension_modules/pillar/ext_pillar_opts.py @@ -6,7 +6,6 @@ Returns a hash of the name of the pillar module as defined in _virtual__ with the value __opts__ """ - import logging # Set up logging diff --git a/tests/integration/files/file/base/_modules/runtests_helpers.py b/tests/integration/files/file/base/_modules/runtests_helpers.py index 3ee0e2da5f3..a38dd1835cf 100644 --- a/tests/integration/files/file/base/_modules/runtests_helpers.py +++ b/tests/integration/files/file/base/_modules/runtests_helpers.py @@ -6,7 +6,6 @@ ~~~~~~~~~~~~~~~~~~~ """ - import logging import os import sys diff --git a/tests/integration/files/returners/noop_returner.py b/tests/integration/files/returners/noop_returner.py index 0201e5076b9..c6a34f975c2 100644 --- a/tests/integration/files/returners/noop_returner.py +++ b/tests/integration/files/returners/noop_returner.py @@ -5,7 +5,6 @@ noop_returner A returner that does nothing which is used to test the salt-master `event_return` functionality """ - import logging import salt.utils.jid diff --git a/tests/integration/grains/test_core.py b/tests/integration/grains/test_core.py index e45836e4ad2..59b84456938 100644 --- a/tests/integration/grains/test_core.py +++ b/tests/integration/grains/test_core.py @@ -1,6 +1,7 @@ """ Test the core grains """ + import pytest import salt.loader diff --git a/tests/integration/grains/test_custom.py b/tests/integration/grains/test_custom.py index 17a09a4797e..d99e88d1902 100644 --- a/tests/integration/grains/test_custom.py +++ b/tests/integration/grains/test_custom.py @@ -2,7 +2,6 @@ Test the core grains """ - import pytest from tests.support.case import ModuleCase diff --git a/tests/integration/loader/test_ext_grains.py b/tests/integration/loader/test_ext_grains.py index af98e544f65..242519aa3f4 100644 --- a/tests/integration/loader/test_ext_grains.py +++ b/tests/integration/loader/test_ext_grains.py @@ -5,7 +5,6 @@ Test Salt's loader regarding external grains """ - import os import time diff --git a/tests/integration/minion/test_timeout.py b/tests/integration/minion/test_timeout.py index 8ceb66c4a5d..29923ffc49d 100644 --- a/tests/integration/minion/test_timeout.py +++ b/tests/integration/minion/test_timeout.py @@ -2,7 +2,6 @@ Tests for various minion timeouts """ - import os import sys diff --git a/tests/integration/modules/test_boto_iam.py b/tests/integration/modules/test_boto_iam.py index 01f15d76edd..667395083b6 100644 --- a/tests/integration/modules/test_boto_iam.py +++ b/tests/integration/modules/test_boto_iam.py @@ -1,6 +1,7 @@ """ Validate the boto_iam module """ + import pytest from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_boto_sns.py b/tests/integration/modules/test_boto_sns.py index fd4313a3344..46eb1c1657a 100644 --- a/tests/integration/modules/test_boto_sns.py +++ b/tests/integration/modules/test_boto_sns.py @@ -1,6 +1,7 @@ """ Validate the boto_sns module """ + import re import pytest diff --git a/tests/integration/modules/test_macdefaults.py b/tests/integration/modules/test_macdefaults.py index da7a6ef854d..bdd74901628 100644 --- a/tests/integration/modules/test_macdefaults.py +++ b/tests/integration/modules/test_macdefaults.py @@ -1,6 +1,7 @@ """ Validate the mac-defaults module """ + import pytest from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_test.py b/tests/integration/modules/test_test.py index f9849e3a48c..06f9d23341c 100644 --- a/tests/integration/modules/test_test.py +++ b/tests/integration/modules/test_test.py @@ -82,7 +82,10 @@ class TestModuleTest(ModuleCase, AdaptedConfigurationTestCaseMixin): test.collatz """ self.assertEqual( - self.run_function("test.collatz", ["40"],)[ + self.run_function( + "test.collatz", + ["40"], + )[ 0 ][-1], 2, diff --git a/tests/integration/modules/test_timezone.py b/tests/integration/modules/test_timezone.py index 8d7180cbd13..3af9bf628ec 100644 --- a/tests/integration/modules/test_timezone.py +++ b/tests/integration/modules/test_timezone.py @@ -3,6 +3,7 @@ Integration tests for timezone module Linux and Solaris are supported """ + import pytest from tests.support.case import ModuleCase diff --git a/tests/integration/shell/test_master_tops.py b/tests/integration/shell/test_master_tops.py index 27625a4ff60..ac419de96b6 100644 --- a/tests/integration/shell/test_master_tops.py +++ b/tests/integration/shell/test_master_tops.py @@ -3,7 +3,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import pytest from tests.support.case import ShellCase diff --git a/tests/integration/spm/test_install.py b/tests/integration/spm/test_install.py index c73f6639230..bd4d3617694 100644 --- a/tests/integration/spm/test_install.py +++ b/tests/integration/spm/test_install.py @@ -1,6 +1,7 @@ """ Tests for the spm install utility """ + import os import pytest diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index 8193c148a8c..812a6489a6c 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -14,7 +14,7 @@ from tests.support.runtests import RUNTIME_VARS pytestmark = [ pytest.mark.skipif( "grains['osfinger'] == 'Fedora Linux-39'", - reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12" + reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12", # Actually, the problem is that the tornado we ship is not prepared for Python 3.12, # and it imports `ssl` and checks if the `match_hostname` function is defined, which # has been deprecated since Python 3.7, so, the logic goes into trying to import diff --git a/tests/integration/states/test_boto_sns.py b/tests/integration/states/test_boto_sns.py index c40adbdba5f..2978e6fbf35 100644 --- a/tests/integration/states/test_boto_sns.py +++ b/tests/integration/states/test_boto_sns.py @@ -1,6 +1,7 @@ """ Tests for the boto_sns state """ + import re import pytest diff --git a/tests/integration/states/test_compiler.py b/tests/integration/states/test_compiler.py index ea64759e26d..257655fae91 100644 --- a/tests/integration/states/test_compiler.py +++ b/tests/integration/states/test_compiler.py @@ -2,7 +2,6 @@ tests for host state """ - from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_handle_iorder.py b/tests/integration/states/test_handle_iorder.py index 39a5e88fe32..7bdd4a0d0df 100644 --- a/tests/integration/states/test_handle_iorder.py +++ b/tests/integration/states/test_handle_iorder.py @@ -2,7 +2,6 @@ tests for host state """ - from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_lxd_image.py b/tests/integration/states/test_lxd_image.py index 374aac57762..b0ab485bdf3 100644 --- a/tests/integration/states/test_lxd_image.py +++ b/tests/integration/states/test_lxd_image.py @@ -1,6 +1,7 @@ """ Integration tests for the lxd states """ + import pytest import salt.modules.lxd diff --git a/tests/integration/states/test_lxd_profile.py b/tests/integration/states/test_lxd_profile.py index cfcc24d968d..e6df9db2ef8 100644 --- a/tests/integration/states/test_lxd_profile.py +++ b/tests/integration/states/test_lxd_profile.py @@ -1,6 +1,7 @@ """ Integration tests for the lxd states """ + import pytest import salt.modules.lxd diff --git a/tests/integration/utils/test_idem.py b/tests/integration/utils/test_idem.py index c2b57b1ec14..eb2fcd83254 100644 --- a/tests/integration/utils/test_idem.py +++ b/tests/integration/utils/test_idem.py @@ -1,6 +1,7 @@ """ Test utility methods that the idem module and state share """ + from contextlib import contextmanager import pytest diff --git a/tests/integration/utils/test_smb.py b/tests/integration/utils/test_smb.py index 5f7db744242..8ef792d6340 100644 --- a/tests/integration/utils/test_smb.py +++ b/tests/integration/utils/test_smb.py @@ -1,6 +1,7 @@ """ Test utility methods that communicate with SMB shares. """ + import getpass import logging import os diff --git a/tests/packdump.py b/tests/packdump.py index d25b5454e73..e9b7b70096a 100644 --- a/tests/packdump.py +++ b/tests/packdump.py @@ -1,6 +1,7 @@ """ Simple script to dump the contents of msgpack files to the terminal """ + # pylint: disable=resource-leakage import os diff --git a/tests/pytests/conftest.py b/tests/pytests/conftest.py index 79807df8055..1179e0e1dfb 100644 --- a/tests/pytests/conftest.py +++ b/tests/pytests/conftest.py @@ -2,6 +2,7 @@ tests.pytests.conftest ~~~~~~~~~~~~~~~~~~~~~~ """ + import functools import inspect import logging @@ -643,6 +644,7 @@ def io_loop(): # <---- Async Test Fixtures ------------------------------------------------------------------------------------------ + # ----- Helpers -----------------------------------------------------------------------------------------------------> @pytest.helpers.proxy.register def delta_proxy_minion_ids(): diff --git a/tests/pytests/functional/cli/test_batch.py b/tests/pytests/functional/cli/test_batch.py index 8c69b48cf4a..b13ed3fb7b8 100644 --- a/tests/pytests/functional/cli/test_batch.py +++ b/tests/pytests/functional/cli/test_batch.py @@ -2,6 +2,7 @@ tests.pytests.functional.cli.test_batch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ + import salt.cli.batch import salt.config import salt.utils.jid diff --git a/tests/pytests/functional/cli/test_salt_cloud.py b/tests/pytests/functional/cli/test_salt_cloud.py index 0b661490bfe..4bd33bdc6c9 100644 --- a/tests/pytests/functional/cli/test_salt_cloud.py +++ b/tests/pytests/functional/cli/test_salt_cloud.py @@ -2,6 +2,7 @@ tests.pytests.integration.cli.test_salt_cloud ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ + import pytest pytest.importorskip("libcloud", reason="salt-cloud requires >= libcloud 0.11.4") diff --git a/tests/pytests/functional/modules/file/test_replace.py b/tests/pytests/functional/modules/file/test_replace.py index 3be41d0661d..3505cc38bf5 100644 --- a/tests/pytests/functional/modules/file/test_replace.py +++ b/tests/pytests/functional/modules/file/test_replace.py @@ -1,6 +1,7 @@ """ Tests for file.rename function """ + import os import shutil diff --git a/tests/pytests/functional/modules/state/test_jinja_filters.py b/tests/pytests/functional/modules/state/test_jinja_filters.py index 0fd44dba74c..7a72ba7f530 100644 --- a/tests/pytests/functional/modules/state/test_jinja_filters.py +++ b/tests/pytests/functional/modules/state/test_jinja_filters.py @@ -1,6 +1,7 @@ """ Testing Jinja filters availablilty via state system """ + import logging import os diff --git a/tests/pytests/functional/modules/test_archive.py b/tests/pytests/functional/modules/test_archive.py index 60f06aef71f..158ac4d0cf4 100644 --- a/tests/pytests/functional/modules/test_archive.py +++ b/tests/pytests/functional/modules/test_archive.py @@ -1,6 +1,7 @@ """ Tests for the archive state """ + import os import pathlib import shutil diff --git a/tests/pytests/functional/modules/test_dockermod.py b/tests/pytests/functional/modules/test_dockermod.py index 3c7bb25e461..7d66379de0c 100644 --- a/tests/pytests/functional/modules/test_dockermod.py +++ b/tests/pytests/functional/modules/test_dockermod.py @@ -1,6 +1,7 @@ """ Integration tests for the docker_container states """ + import logging import pytest diff --git a/tests/pytests/functional/modules/test_mac_pkgutil.py b/tests/pytests/functional/modules/test_mac_pkgutil.py index 397bb895871..6b9233c2ecd 100644 --- a/tests/pytests/functional/modules/test_mac_pkgutil.py +++ b/tests/pytests/functional/modules/test_mac_pkgutil.py @@ -1,6 +1,7 @@ """ integration tests for mac_pkgutil """ + import shutil import pytest diff --git a/tests/pytests/functional/modules/test_mysql.py b/tests/pytests/functional/modules/test_mysql.py index d920bbdbc03..c82bba30193 100644 --- a/tests/pytests/functional/modules/test_mysql.py +++ b/tests/pytests/functional/modules/test_mysql.py @@ -1,6 +1,7 @@ """ Test Salt MySQL module across various MySQL variants """ + import logging import time diff --git a/tests/pytests/functional/modules/test_network.py b/tests/pytests/functional/modules/test_network.py index 702373c15ae..e2515e4556b 100644 --- a/tests/pytests/functional/modules/test_network.py +++ b/tests/pytests/functional/modules/test_network.py @@ -1,6 +1,7 @@ """ Validate network module """ + import pytest pytestmark = [ diff --git a/tests/pytests/functional/modules/test_win_shortcut.py b/tests/pytests/functional/modules/test_win_shortcut.py index 292f439536b..90aa30d614d 100644 --- a/tests/pytests/functional/modules/test_win_shortcut.py +++ b/tests/pytests/functional/modules/test_win_shortcut.py @@ -1,6 +1,7 @@ """ Tests for win_shortcut execution module """ + import os import shutil import subprocess diff --git a/tests/pytests/functional/modules/win_file/test_check_perms.py b/tests/pytests/functional/modules/win_file/test_check_perms.py index 7b829b35eed..f2196185904 100644 --- a/tests/pytests/functional/modules/win_file/test_check_perms.py +++ b/tests/pytests/functional/modules/win_file/test_check_perms.py @@ -1,6 +1,7 @@ """ Tests for win_file execution module """ + import pytest import salt.modules.win_file as win_file diff --git a/tests/pytests/functional/modules/win_file/test_remove.py b/tests/pytests/functional/modules/win_file/test_remove.py index 6cc26686f5a..d9e92411ca2 100644 --- a/tests/pytests/functional/modules/win_file/test_remove.py +++ b/tests/pytests/functional/modules/win_file/test_remove.py @@ -1,6 +1,7 @@ """ Tests for win_file execution module """ + import pytest import salt.modules.win_file as win_file diff --git a/tests/pytests/functional/modules/win_file/test_stat.py b/tests/pytests/functional/modules/win_file/test_stat.py index 0ff78e85fb7..a09d7d43aa9 100644 --- a/tests/pytests/functional/modules/win_file/test_stat.py +++ b/tests/pytests/functional/modules/win_file/test_stat.py @@ -1,6 +1,7 @@ """ Tests for win_file execution module """ + import pytest import salt.modules.win_file as win_file diff --git a/tests/pytests/functional/states/file/test_comment.py b/tests/pytests/functional/states/file/test_comment.py index b7a7c8a7c95..cd825d75d83 100644 --- a/tests/pytests/functional/states/file/test_comment.py +++ b/tests/pytests/functional/states/file/test_comment.py @@ -1,6 +1,7 @@ """ Tests for file.comment state function """ + import re import pytest diff --git a/tests/pytests/functional/states/file/test_managed.py b/tests/pytests/functional/states/file/test_managed.py index 9678fb63432..7746134d564 100644 --- a/tests/pytests/functional/states/file/test_managed.py +++ b/tests/pytests/functional/states/file/test_managed.py @@ -658,7 +658,6 @@ def test_issue_8947_utf8_sls(modules, tmp_path, state_tree, subtests): @pytest.mark.skip_if_not_root @pytest.mark.skip_on_windows(reason="Windows does not support setuid. Skipping.") def test_owner_after_setuid(file, modules, tmp_path, state_file_account): - """ Test to check file user/group after setting setuid or setgid. Because Python os.chown() does reset the setuid/setgid to 0. diff --git a/tests/pytests/functional/states/file/test_rename.py b/tests/pytests/functional/states/file/test_rename.py index db293d16277..1aa4fc77b68 100644 --- a/tests/pytests/functional/states/file/test_rename.py +++ b/tests/pytests/functional/states/file/test_rename.py @@ -1,6 +1,7 @@ """ Tests for file.rename state function """ + # nox -e pytest-zeromq-3.8(coverage=False) -- -vvv --run-slow --run-destructive tests\pytests\functional\states\file\test_rename.py import pytest diff --git a/tests/pytests/functional/states/test_chocolatey_1_2_1.py b/tests/pytests/functional/states/test_chocolatey_1_2_1.py index 9dcc186636a..0e9972df17e 100644 --- a/tests/pytests/functional/states/test_chocolatey_1_2_1.py +++ b/tests/pytests/functional/states/test_chocolatey_1_2_1.py @@ -1,6 +1,7 @@ """ Functional tests for chocolatey state """ + import os import pathlib diff --git a/tests/pytests/functional/states/test_chocolatey_latest.py b/tests/pytests/functional/states/test_chocolatey_latest.py index 9d329d5fc59..41ba0df5b38 100644 --- a/tests/pytests/functional/states/test_chocolatey_latest.py +++ b/tests/pytests/functional/states/test_chocolatey_latest.py @@ -1,6 +1,7 @@ """ Functional tests for chocolatey state """ + import os import pathlib diff --git a/tests/pytests/functional/states/test_mysql.py b/tests/pytests/functional/states/test_mysql.py index 355f2cc1eba..1f14d8d8ed2 100644 --- a/tests/pytests/functional/states/test_mysql.py +++ b/tests/pytests/functional/states/test_mysql.py @@ -1,6 +1,7 @@ """ Test Salt MySQL state module across various MySQL variants """ + import logging import time diff --git a/tests/pytests/functional/states/test_svn.py b/tests/pytests/functional/states/test_svn.py index 5ad09ad37e2..b4f04dd8a6d 100644 --- a/tests/pytests/functional/states/test_svn.py +++ b/tests/pytests/functional/states/test_svn.py @@ -1,6 +1,7 @@ """ Tests for the SVN state """ + import logging import pytest diff --git a/tests/pytests/functional/states/test_win_certutil.py b/tests/pytests/functional/states/test_win_certutil.py index 92d238b3f4a..6b3d58b19c6 100644 --- a/tests/pytests/functional/states/test_win_certutil.py +++ b/tests/pytests/functional/states/test_win_certutil.py @@ -1,6 +1,7 @@ """ Tests for win_certutil state module """ + import pytest import salt.utils.files diff --git a/tests/pytests/functional/states/test_x509_v2.py b/tests/pytests/functional/states/test_x509_v2.py index 3cd09d7d840..01c877fceda 100644 --- a/tests/pytests/functional/states/test_x509_v2.py +++ b/tests/pytests/functional/states/test_x509_v2.py @@ -572,9 +572,9 @@ def existing_cert(x509, cert_args, ca_key, rsa_privkey, request): ca_key, encoding=cert_args.get("encoding", "pem"), passphrase=cert_args.get("pkcs12_passphrase"), - subject=subject - if "signing_policy" not in cert_args - else "CN=from_signing_policy", + subject=( + subject if "signing_policy" not in cert_args else "CN=from_signing_policy" + ), ) yield cert_args["name"] diff --git a/tests/pytests/functional/utils/test_process.py b/tests/pytests/functional/utils/test_process.py index 6c420b95f48..bbb83638761 100644 --- a/tests/pytests/functional/utils/test_process.py +++ b/tests/pytests/functional/utils/test_process.py @@ -4,6 +4,7 @@ tests.pytests.functional.utils.test_process Test salt's process utility module """ + import pytest import salt.utils.process diff --git a/tests/pytests/functional/utils/win_dacl/test_get_name.py b/tests/pytests/functional/utils/win_dacl/test_get_name.py index 8ea5d7614e4..f35c1336ec4 100644 --- a/tests/pytests/functional/utils/win_dacl/test_get_name.py +++ b/tests/pytests/functional/utils/win_dacl/test_get_name.py @@ -4,6 +4,7 @@ tests.pytests.unit.utils.win_dacl.test_get_name Test the get_name function in the win_dacl utility module """ + import pytest import salt.exceptions diff --git a/tests/pytests/functional/utils/win_dacl/test_get_sid.py b/tests/pytests/functional/utils/win_dacl/test_get_sid.py index e2e09f6dea6..4560713dad5 100644 --- a/tests/pytests/functional/utils/win_dacl/test_get_sid.py +++ b/tests/pytests/functional/utils/win_dacl/test_get_sid.py @@ -4,6 +4,7 @@ tests.pytests.unit.utils.win_dacl.test_get_sid Test the get_sid function in the win_dacl utility module """ + import pytest import salt.utils.win_dacl diff --git a/tests/pytests/functional/utils/win_dacl/test_get_sid_string.py b/tests/pytests/functional/utils/win_dacl/test_get_sid_string.py index adde42501ae..bea9240f75e 100644 --- a/tests/pytests/functional/utils/win_dacl/test_get_sid_string.py +++ b/tests/pytests/functional/utils/win_dacl/test_get_sid_string.py @@ -4,6 +4,7 @@ tests.pytests.unit.utils.win_dacl.test_get_sid_string Test the get_sid_string function in the win_dacl utility module """ + import pytest import salt.utils.win_dacl diff --git a/tests/pytests/integration/cli/test_salt.py b/tests/pytests/integration/cli/test_salt.py index 30752102025..46680b449ea 100644 --- a/tests/pytests/integration/cli/test_salt.py +++ b/tests/pytests/integration/cli/test_salt.py @@ -1,6 +1,7 @@ """ :codeauthor: Thayne Harbaugh (tharbaug@adobe.com) """ + import logging import os import shutil diff --git a/tests/pytests/integration/cli/test_salt_cp.py b/tests/pytests/integration/cli/test_salt_cp.py index 9c303e7c9b4..ce01de43437 100644 --- a/tests/pytests/integration/cli/test_salt_cp.py +++ b/tests/pytests/integration/cli/test_salt_cp.py @@ -3,7 +3,6 @@ tests.integration.shell.cp ~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import logging import os import pathlib diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index 99c8368b73d..26ba9eedfad 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -1,6 +1,7 @@ """ :codeauthor: Gareth J. Greenaway (ggreenaway@vmware.com) """ + import logging import random @@ -177,7 +178,9 @@ def test_exit_status_correct_usage( "{}.sls".format(proxy_two), dummy_proxy_two_pillar_file, ) - with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile: + with ( + top_tempfile + ), controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile: factory = salt_master.salt_proxy_minion_daemon( proxy_minion_id, defaults=config_defaults, @@ -404,7 +407,11 @@ def test_invalid_connection( broken_proxy_two_tempfile = salt_master.pillar_tree.base.temp_file( "{}.sls".format(broken_proxy_two), broken_proxy_two_pillar_file ) - with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, broken_proxy_one_tempfile, broken_proxy_two_tempfile: + with ( + top_tempfile + ), ( + controlproxy_tempfile + ), dummy_proxy_one_tempfile, broken_proxy_one_tempfile, broken_proxy_two_tempfile: factory = salt_master.salt_proxy_minion_daemon( proxy_minion_id, defaults=config_defaults, @@ -533,7 +540,11 @@ def ping(): custom_proxy_module = salt_master.state_tree.base.temp_file( "_proxy/custom_dummy.py", module_contents ) - with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile, custom_proxy_module: + with ( + top_tempfile + ), ( + controlproxy_tempfile + ), dummy_proxy_one_tempfile, dummy_proxy_two_tempfile, custom_proxy_module: factory = salt_master.salt_proxy_minion_daemon( proxy_minion_id, defaults=config_defaults, @@ -666,7 +677,11 @@ def ping(): custom_proxy_module = salt_master.state_tree.base.temp_file( "_proxy/custom_dummy.py", module_contents ) - with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile, custom_proxy_module: + with ( + top_tempfile + ), ( + controlproxy_tempfile + ), dummy_proxy_one_tempfile, dummy_proxy_two_tempfile, custom_proxy_module: factory = salt_master.salt_proxy_minion_daemon( proxy_minion_id, defaults=config_defaults, diff --git a/tests/pytests/integration/master/test_payload.py b/tests/pytests/integration/master/test_payload.py index 692005b5692..9d663ac34ee 100644 --- a/tests/pytests/integration/master/test_payload.py +++ b/tests/pytests/integration/master/test_payload.py @@ -1,6 +1,7 @@ """ Tests for payload """ + import pytest diff --git a/tests/pytests/integration/minion/test_return_retries.py b/tests/pytests/integration/minion/test_return_retries.py index 37ea32ffce8..8d59a89de13 100644 --- a/tests/pytests/integration/minion/test_return_retries.py +++ b/tests/pytests/integration/minion/test_return_retries.py @@ -110,7 +110,9 @@ def test_pillar_timeout(salt_master_factory, tmp_path): sls_tempfile = master.state_tree.base.temp_file( "{}.sls".format(sls_name), sls_contents ) - with master.started(), minion1.started(), minion2.started(), minion3.started(), minion4.started(), sls_tempfile: + with master.started(), minion1.started(), minion2.started(), minion3.started(), minion4.started(), ( + sls_tempfile + ): cmd = 'import time; time.sleep(6); print(\'{"foo": "bang"}\');\n' with salt.utils.files.fopen(tmp_path / "script.py", "w") as fp: fp.write(cmd) diff --git a/tests/pytests/integration/modules/grains/test_module.py b/tests/pytests/integration/modules/grains/test_module.py index cbbb149d2ad..bb977af9183 100644 --- a/tests/pytests/integration/modules/grains/test_module.py +++ b/tests/pytests/integration/modules/grains/test_module.py @@ -2,7 +2,6 @@ Test the grains module """ - import logging import time diff --git a/tests/pytests/integration/modules/saltutil/test_modules.py b/tests/pytests/integration/modules/saltutil/test_modules.py index 9d10189bb30..d35cb735f2e 100644 --- a/tests/pytests/integration/modules/saltutil/test_modules.py +++ b/tests/pytests/integration/modules/saltutil/test_modules.py @@ -2,7 +2,6 @@ Integration tests for the saltutil module. """ - import pytest pytestmark = [ diff --git a/tests/pytests/integration/modules/saltutil/test_pillar.py b/tests/pytests/integration/modules/saltutil/test_pillar.py index 7eb51605604..c1e451772c3 100644 --- a/tests/pytests/integration/modules/saltutil/test_pillar.py +++ b/tests/pytests/integration/modules/saltutil/test_pillar.py @@ -2,7 +2,6 @@ Integration tests for the saltutil module. """ - import logging import time diff --git a/tests/pytests/integration/modules/saltutil/test_wheel.py b/tests/pytests/integration/modules/saltutil/test_wheel.py index 51164c62399..3ddb95c2dc3 100644 --- a/tests/pytests/integration/modules/saltutil/test_wheel.py +++ b/tests/pytests/integration/modules/saltutil/test_wheel.py @@ -2,7 +2,6 @@ Integration tests for the saltutil module. """ - import pathlib import shutil diff --git a/tests/pytests/integration/modules/test_beacons.py b/tests/pytests/integration/modules/test_beacons.py index 1a1ae274854..7908f4db609 100644 --- a/tests/pytests/integration/modules/test_beacons.py +++ b/tests/pytests/integration/modules/test_beacons.py @@ -1,6 +1,7 @@ """ :codeauthor: Justin Anderson """ + import pathlib import shutil diff --git a/tests/pytests/integration/modules/test_event.py b/tests/pytests/integration/modules/test_event.py index 172b2ab445b..b6ea0a2d1cb 100644 --- a/tests/pytests/integration/modules/test_event.py +++ b/tests/pytests/integration/modules/test_event.py @@ -2,6 +2,7 @@ tests.pytests.integration.modules.test_event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ + import time import pytest diff --git a/tests/pytests/integration/modules/test_file.py b/tests/pytests/integration/modules/test_file.py index 1489269a93f..27d3af8f5d9 100644 --- a/tests/pytests/integration/modules/test_file.py +++ b/tests/pytests/integration/modules/test_file.py @@ -1,6 +1,7 @@ """ Tests for the file state """ + import os import pytest diff --git a/tests/pytests/integration/modules/test_idem.py b/tests/pytests/integration/modules/test_idem.py index 90e319cab0d..9ddc3eb4412 100644 --- a/tests/pytests/integration/modules/test_idem.py +++ b/tests/pytests/integration/modules/test_idem.py @@ -1,6 +1,7 @@ """ Integration tests for the idem execution module """ + from contextlib import contextmanager import pytest diff --git a/tests/pytests/integration/modules/test_useradd.py b/tests/pytests/integration/modules/test_useradd.py index 6b180d89df6..25c2d7090da 100644 --- a/tests/pytests/integration/modules/test_useradd.py +++ b/tests/pytests/integration/modules/test_useradd.py @@ -1,6 +1,7 @@ """ Integration tests for modules/useradd.py and modules/win_useradd.py """ + import pytest from saltfactories.utils import random_string diff --git a/tests/pytests/integration/modules/test_virt.py b/tests/pytests/integration/modules/test_virt.py index df1f516636b..b14d03ec73d 100644 --- a/tests/pytests/integration/modules/test_virt.py +++ b/tests/pytests/integration/modules/test_virt.py @@ -1,6 +1,7 @@ """ Validate the virt module """ + import logging from numbers import Number from xml.etree import ElementTree diff --git a/tests/pytests/integration/netapi/test_ssh_client.py b/tests/pytests/integration/netapi/test_ssh_client.py index 3f4b8855064..6582c993f9e 100644 --- a/tests/pytests/integration/netapi/test_ssh_client.py +++ b/tests/pytests/integration/netapi/test_ssh_client.py @@ -10,7 +10,7 @@ pytestmark = [ pytest.mark.requires_sshd_server, pytest.mark.skipif( "grains['osfinger'] == 'Fedora Linux-39'", - reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12" + reason="Fedora 39 ships with Python 3.12. Test can't run with system Python on 3.12", # Actually, the problem is that the tornado we ship is not prepared for Python 3.12, # and it imports `ssl` and checks if the `match_hostname` function is defined, which # has been deprecated since Python 3.7, so, the logic goes into trying to import diff --git a/tests/pytests/integration/pillar/cache/test_pillar_cache.py b/tests/pytests/integration/pillar/cache/test_pillar_cache.py index d54bbfa082f..86f0d49d39b 100644 --- a/tests/pytests/integration/pillar/cache/test_pillar_cache.py +++ b/tests/pytests/integration/pillar/cache/test_pillar_cache.py @@ -1,6 +1,7 @@ """ Pillar cache tests """ + import pytest diff --git a/tests/pytests/integration/pillar/test_pillar_include.py b/tests/pytests/integration/pillar/test_pillar_include.py index 63a76599660..dfabd4cb99f 100644 --- a/tests/pytests/integration/pillar/test_pillar_include.py +++ b/tests/pytests/integration/pillar/test_pillar_include.py @@ -1,6 +1,7 @@ """ Pillar include tests """ + import pytest @@ -83,8 +84,16 @@ def pillar_include_tree(base_env_pillar_tree_root_dir, salt_minion, salt_call_cl "glob-include-b.sls", glob_include_b_pillar_file, base_env_pillar_tree_root_dir ) try: - with top_tempfile, include_tempfile, include_a_tempfile, include_b_tempfile, include_c_tempfile, include_d_tempfile: - with glob_include_tempfile, glob_include_a_tempfile, glob_include_b_tempfile: + with ( + top_tempfile + ), ( + include_tempfile + ), ( + include_a_tempfile + ), include_b_tempfile, include_c_tempfile, include_d_tempfile: + with ( + glob_include_tempfile + ), glob_include_a_tempfile, glob_include_b_tempfile: ret = salt_call_cli.run("saltutil.refresh_pillar", wait=True) assert ret.returncode == 0 assert ret.data is True diff --git a/tests/pytests/integration/proxy/conftest.py b/tests/pytests/integration/proxy/conftest.py index d924f4eba8a..5c7abec4c84 100644 --- a/tests/pytests/integration/proxy/conftest.py +++ b/tests/pytests/integration/proxy/conftest.py @@ -89,7 +89,13 @@ def deltaproxy_pillar_tree(request, salt_master, salt_delta_proxy_factory): dummy_proxy_four_tempfile = salt_master.pillar_tree.base.temp_file( "{}.sls".format(proxy_four), dummy_proxy_pillar_file ) - with top_tempfile, controlproxy_tempfile, dummy_proxy_one_tempfile, dummy_proxy_two_tempfile, dummy_proxy_three_tempfile, dummy_proxy_four_tempfile: + with ( + top_tempfile + ), ( + controlproxy_tempfile + ), ( + dummy_proxy_one_tempfile + ), dummy_proxy_two_tempfile, dummy_proxy_three_tempfile, dummy_proxy_four_tempfile: yield diff --git a/tests/pytests/integration/proxy/test_deltaproxy.py b/tests/pytests/integration/proxy/test_deltaproxy.py index 48f23b18d68..c95c43f17bf 100644 --- a/tests/pytests/integration/proxy/test_deltaproxy.py +++ b/tests/pytests/integration/proxy/test_deltaproxy.py @@ -1,6 +1,7 @@ """ Simple Smoke Tests for Connected Proxy Minion """ + import logging import pytest diff --git a/tests/pytests/integration/proxy/test_shell.py b/tests/pytests/integration/proxy/test_shell.py index 44a0e137f75..fec736d7063 100644 --- a/tests/pytests/integration/proxy/test_shell.py +++ b/tests/pytests/integration/proxy/test_shell.py @@ -1,6 +1,7 @@ """ Simple Smoke Tests for Connected Proxy Minion """ + import logging import random diff --git a/tests/pytests/integration/proxy/test_simple.py b/tests/pytests/integration/proxy/test_simple.py index f3d26834ef9..048138e43e5 100644 --- a/tests/pytests/integration/proxy/test_simple.py +++ b/tests/pytests/integration/proxy/test_simple.py @@ -1,6 +1,7 @@ """ Simple Smoke Tests for Connected Proxy Minion """ + import logging import pytest diff --git a/tests/pytests/integration/runners/state/orchestrate/test_events.py b/tests/pytests/integration/runners/state/orchestrate/test_events.py index f1deeb5c6f5..387133b6e40 100644 --- a/tests/pytests/integration/runners/state/orchestrate/test_events.py +++ b/tests/pytests/integration/runners/state/orchestrate/test_events.py @@ -1,6 +1,7 @@ """ Tests for orchestration events """ + import concurrent.futures import functools import json diff --git a/tests/pytests/integration/sdb/test_vault.py b/tests/pytests/integration/sdb/test_vault.py index c70c251c2a9..c4327ef1019 100644 --- a/tests/pytests/integration/sdb/test_vault.py +++ b/tests/pytests/integration/sdb/test_vault.py @@ -1,6 +1,7 @@ """ Integration tests for the vault modules """ + import json import logging import subprocess diff --git a/tests/pytests/integration/ssh/test_log.py b/tests/pytests/integration/ssh/test_log.py index e87c4a8581f..cc851407521 100644 --- a/tests/pytests/integration/ssh/test_log.py +++ b/tests/pytests/integration/ssh/test_log.py @@ -1,6 +1,7 @@ """ Integration tests for salt-ssh logging """ + import logging import time diff --git a/tests/pytests/integration/ssh/test_py_versions.py b/tests/pytests/integration/ssh/test_py_versions.py index 52ab819e808..cacd2ba97cb 100644 --- a/tests/pytests/integration/ssh/test_py_versions.py +++ b/tests/pytests/integration/ssh/test_py_versions.py @@ -1,6 +1,7 @@ """ Integration tests for salt-ssh py_versions """ + import logging import socket import time diff --git a/tests/pytests/integration/ssh/test_ssh_setup.py b/tests/pytests/integration/ssh/test_ssh_setup.py index 00e7e6394ff..2b68f5c4a48 100644 --- a/tests/pytests/integration/ssh/test_ssh_setup.py +++ b/tests/pytests/integration/ssh/test_ssh_setup.py @@ -1,6 +1,7 @@ """ Integration tests for salt-ssh py_versions """ + import logging import os import signal diff --git a/tests/pytests/integration/states/test_beacon.py b/tests/pytests/integration/states/test_beacon.py index 5d6737e6a18..5aefa6ecf2b 100644 --- a/tests/pytests/integration/states/test_beacon.py +++ b/tests/pytests/integration/states/test_beacon.py @@ -1,6 +1,7 @@ """ Integration tests for the beacon states """ + import logging import pytest diff --git a/tests/pytests/integration/states/test_file.py b/tests/pytests/integration/states/test_file.py index 42bdc06baad..31d3a85cde2 100644 --- a/tests/pytests/integration/states/test_file.py +++ b/tests/pytests/integration/states/test_file.py @@ -1,6 +1,7 @@ """ Tests for the file state """ + import logging import os import pathlib @@ -655,7 +656,9 @@ def test_patch_single_file_failure( math_tempfile = pytest.helpers.temp_file(math_file, content[1], tmp_path) reject_tempfile = pytest.helpers.temp_file("reject.txt", "", tmp_path) - with sls_tempfile, sls_reject_tempfile, numbers_tempfile, math_tempfile, reject_tempfile: + with ( + sls_tempfile + ), sls_reject_tempfile, numbers_tempfile, math_tempfile, reject_tempfile: # Empty the file to ensure that the patch doesn't apply cleanly with salt.utils.files.fopen(numbers_file, "w"): pass @@ -730,7 +733,9 @@ def test_patch_directory_failure( math_tempfile = pytest.helpers.temp_file(math_file, content[1], tmp_path) reject_tempfile = pytest.helpers.temp_file("reject.txt", "", tmp_path) - with sls_tempfile, sls_reject_tempfile, numbers_tempfile, math_tempfile, reject_tempfile: + with ( + sls_tempfile + ), sls_reject_tempfile, numbers_tempfile, math_tempfile, reject_tempfile: # Empty the file to ensure that the patch doesn't apply cleanly with salt.utils.files.fopen(math_file, "w"): pass diff --git a/tests/pytests/integration/states/test_idem.py b/tests/pytests/integration/states/test_idem.py index feab60d4951..afdd9c93637 100644 --- a/tests/pytests/integration/states/test_idem.py +++ b/tests/pytests/integration/states/test_idem.py @@ -1,6 +1,7 @@ """ Tests for the idem state """ + import tempfile from contextlib import contextmanager diff --git a/tests/pytests/integration/states/test_include.py b/tests/pytests/integration/states/test_include.py index f814328c5e4..f4ebe611e39 100644 --- a/tests/pytests/integration/states/test_include.py +++ b/tests/pytests/integration/states/test_include.py @@ -1,6 +1,7 @@ """ Integration tests for the jinja includes in states """ + import logging import pytest diff --git a/tests/pytests/integration/utils/test_templates.py b/tests/pytests/integration/utils/test_templates.py index 241bd8f58d8..0d4ee011d31 100644 --- a/tests/pytests/integration/utils/test_templates.py +++ b/tests/pytests/integration/utils/test_templates.py @@ -1,6 +1,7 @@ """ Tests for the templates utils """ + import os import pytest diff --git a/tests/pytests/pkg/conftest.py b/tests/pytests/pkg/conftest.py index 048ad7a238d..20d71f14228 100644 --- a/tests/pytests/pkg/conftest.py +++ b/tests/pytests/pkg/conftest.py @@ -373,12 +373,12 @@ def salt_minion(salt_factories, salt_master, install_salt): "open_mode": True, } if platform.is_windows(): - config_overrides[ - "winrepo_dir" - ] = rf"{salt_factories.root_dir}\srv\salt\win\repo" - config_overrides[ - "winrepo_dir_ng" - ] = rf"{salt_factories.root_dir}\srv\salt\win\repo_ng" + config_overrides["winrepo_dir"] = ( + rf"{salt_factories.root_dir}\srv\salt\win\repo" + ) + config_overrides["winrepo_dir_ng"] = ( + rf"{salt_factories.root_dir}\srv\salt\win\repo_ng" + ) config_overrides["winrepo_source_dir"] = r"salt://win/repo_ng" if install_salt.classic and platform.is_windows(): diff --git a/tests/pytests/pkg/download/test_pkg_download.py b/tests/pytests/pkg/download/test_pkg_download.py index 57b1e4c834e..b774d9fa047 100644 --- a/tests/pytests/pkg/download/test_pkg_download.py +++ b/tests/pytests/pkg/download/test_pkg_download.py @@ -1,6 +1,7 @@ """ Test Salt Pkg Downloads """ + import contextlib import logging import os diff --git a/tests/pytests/scenarios/blackout/test_minion_blackout.py b/tests/pytests/scenarios/blackout/test_minion_blackout.py index 581ad2b135b..ed5fca72c48 100644 --- a/tests/pytests/scenarios/blackout/test_minion_blackout.py +++ b/tests/pytests/scenarios/blackout/test_minion_blackout.py @@ -2,7 +2,6 @@ Tests for minion blackout """ - import logging import pytest diff --git a/tests/pytests/scenarios/compat/conftest.py b/tests/pytests/scenarios/compat/conftest.py index 29d58354abc..3d7c44381b8 100644 --- a/tests/pytests/scenarios/compat/conftest.py +++ b/tests/pytests/scenarios/compat/conftest.py @@ -4,6 +4,7 @@ Salt Compatibility PyTest Fixtures """ + import logging import os import shutil diff --git a/tests/pytests/scenarios/compat/test_with_versions.py b/tests/pytests/scenarios/compat/test_with_versions.py index ecb3a73de1a..cc61a01f509 100644 --- a/tests/pytests/scenarios/compat/test_with_versions.py +++ b/tests/pytests/scenarios/compat/test_with_versions.py @@ -4,6 +4,7 @@ Test current salt master with older salt minions """ + import logging import pathlib diff --git a/tests/pytests/scenarios/performance/conftest.py b/tests/pytests/scenarios/performance/conftest.py index 13fbb831d7c..ef29cf03973 100644 --- a/tests/pytests/scenarios/performance/conftest.py +++ b/tests/pytests/scenarios/performance/conftest.py @@ -1,6 +1,7 @@ """ Salt performance tests """ + import logging import shutil diff --git a/tests/pytests/scenarios/setup/test_install.py b/tests/pytests/scenarios/setup/test_install.py index 9c506b56cab..5953a9640c5 100644 --- a/tests/pytests/scenarios/setup/test_install.py +++ b/tests/pytests/scenarios/setup/test_install.py @@ -1,6 +1,7 @@ """ Tests for building and installing salt """ + import json import logging import os diff --git a/tests/pytests/unit/auth/test_ldap.py b/tests/pytests/unit/auth/test_ldap.py index fe973701af3..6a43bb350d0 100644 --- a/tests/pytests/unit/auth/test_ldap.py +++ b/tests/pytests/unit/auth/test_ldap.py @@ -1,6 +1,7 @@ """ Unit tests for salt.auth.ldap """ + import pytest import salt.auth.ldap diff --git a/tests/pytests/unit/beacons/test_adb.py b/tests/pytests/unit/beacons/test_adb.py index 0d9ee99ee6a..945e782093b 100644 --- a/tests/pytests/unit/beacons/test_adb.py +++ b/tests/pytests/unit/beacons/test_adb.py @@ -4,6 +4,7 @@ ADB beacon test cases """ + import pytest import salt.beacons.adb as adb diff --git a/tests/pytests/unit/beacons/test_avahi_announce.py b/tests/pytests/unit/beacons/test_avahi_announce.py index 2eb95a35a2f..bd7359dcd58 100644 --- a/tests/pytests/unit/beacons/test_avahi_announce.py +++ b/tests/pytests/unit/beacons/test_avahi_announce.py @@ -4,6 +4,7 @@ Avahi announce beacon test cases """ + import pytest import salt.beacons.avahi_announce as avahi_announce diff --git a/tests/pytests/unit/beacons/test_bonjour_announce.py b/tests/pytests/unit/beacons/test_bonjour_announce.py index c5551edebfd..25df0ffbd13 100644 --- a/tests/pytests/unit/beacons/test_bonjour_announce.py +++ b/tests/pytests/unit/beacons/test_bonjour_announce.py @@ -4,6 +4,7 @@ Bonjour announce beacon test cases """ + import pytest import salt.beacons.bonjour_announce as bonjour_announce diff --git a/tests/pytests/unit/beacons/test_diskusage.py b/tests/pytests/unit/beacons/test_diskusage.py index e37863cd733..94fff2fa918 100644 --- a/tests/pytests/unit/beacons/test_diskusage.py +++ b/tests/pytests/unit/beacons/test_diskusage.py @@ -4,6 +4,7 @@ Disk usage beacon test cases """ + from collections import namedtuple import pytest diff --git a/tests/pytests/unit/beacons/test_glxinfo.py b/tests/pytests/unit/beacons/test_glxinfo.py index b556c2cafa9..4888c6301d2 100644 --- a/tests/pytests/unit/beacons/test_glxinfo.py +++ b/tests/pytests/unit/beacons/test_glxinfo.py @@ -4,6 +4,7 @@ glxinfo beacon test cases """ + import pytest import salt.beacons.glxinfo as glxinfo diff --git a/tests/pytests/unit/beacons/test_haproxy.py b/tests/pytests/unit/beacons/test_haproxy.py index 33197cb1414..dc0c961d547 100644 --- a/tests/pytests/unit/beacons/test_haproxy.py +++ b/tests/pytests/unit/beacons/test_haproxy.py @@ -4,6 +4,7 @@ HAProxy beacon test cases """ + import pytest import salt.beacons.haproxy as haproxy diff --git a/tests/pytests/unit/beacons/test_load.py b/tests/pytests/unit/beacons/test_load.py index a0a28428e4b..0f57465cfe3 100644 --- a/tests/pytests/unit/beacons/test_load.py +++ b/tests/pytests/unit/beacons/test_load.py @@ -4,6 +4,7 @@ Load beacon test cases """ + import pytest import salt.beacons.load as load diff --git a/tests/pytests/unit/beacons/test_log_beacon.py b/tests/pytests/unit/beacons/test_log_beacon.py index f0dc61865cb..18184936d9d 100644 --- a/tests/pytests/unit/beacons/test_log_beacon.py +++ b/tests/pytests/unit/beacons/test_log_beacon.py @@ -4,6 +4,7 @@ log beacon test cases """ + import pytest import salt.beacons.log_beacon as log_beacon diff --git a/tests/pytests/unit/beacons/test_memusage.py b/tests/pytests/unit/beacons/test_memusage.py index bab3d5321e2..6f172c9c1d8 100644 --- a/tests/pytests/unit/beacons/test_memusage.py +++ b/tests/pytests/unit/beacons/test_memusage.py @@ -4,6 +4,7 @@ Memory usage beacon test cases """ + from collections import namedtuple import pytest diff --git a/tests/pytests/unit/beacons/test_network_info.py b/tests/pytests/unit/beacons/test_network_info.py index ee48fc57905..0e80637f7d7 100644 --- a/tests/pytests/unit/beacons/test_network_info.py +++ b/tests/pytests/unit/beacons/test_network_info.py @@ -4,6 +4,7 @@ Network info beacon test cases """ + from collections import namedtuple import pytest diff --git a/tests/pytests/unit/beacons/test_ps.py b/tests/pytests/unit/beacons/test_ps.py index 55d448ae78a..aa869dc4535 100644 --- a/tests/pytests/unit/beacons/test_ps.py +++ b/tests/pytests/unit/beacons/test_ps.py @@ -4,6 +4,7 @@ ps usage beacon test cases """ + import pytest import salt.beacons.ps as ps diff --git a/tests/pytests/unit/beacons/test_swapusage.py b/tests/pytests/unit/beacons/test_swapusage.py index 5ffed290bf8..39070ce49bf 100644 --- a/tests/pytests/unit/beacons/test_swapusage.py +++ b/tests/pytests/unit/beacons/test_swapusage.py @@ -4,6 +4,7 @@ Swap usage beacon test cases """ + from collections import namedtuple import pytest diff --git a/tests/pytests/unit/cache/test_localfs.py b/tests/pytests/unit/cache/test_localfs.py index cda71066368..e5f7c6cc30b 100644 --- a/tests/pytests/unit/cache/test_localfs.py +++ b/tests/pytests/unit/cache/test_localfs.py @@ -1,6 +1,7 @@ """ Validate the functions in the localfs cache """ + import errno import shutil diff --git a/tests/pytests/unit/cache/test_memcache.py b/tests/pytests/unit/cache/test_memcache.py index d8a074c5c35..7a1d9374335 100644 --- a/tests/pytests/unit/cache/test_memcache.py +++ b/tests/pytests/unit/cache/test_memcache.py @@ -1,6 +1,7 @@ """ Validate Cache class methods """ + import pytest import salt.cache diff --git a/tests/pytests/unit/cache/test_mysql_cache.py b/tests/pytests/unit/cache/test_mysql_cache.py index c74f44d4310..11959279695 100644 --- a/tests/pytests/unit/cache/test_mysql_cache.py +++ b/tests/pytests/unit/cache/test_mysql_cache.py @@ -2,7 +2,6 @@ unit tests for the mysql_cache cache """ - import logging import pytest diff --git a/tests/pytests/unit/cloud/clouds/test_azurearm.py b/tests/pytests/unit/cloud/clouds/test_azurearm.py index d84aeeffd65..699a94981dd 100644 --- a/tests/pytests/unit/cloud/clouds/test_azurearm.py +++ b/tests/pytests/unit/cloud/clouds/test_azurearm.py @@ -66,15 +66,15 @@ def test_function_signatures(): mock_azure.salt.utils.cloud.gen_keys.return_value = [MagicMock(), MagicMock()] mock_azure.__opts__["pki_dir"] = None - mock_azure.request_instance.__globals__[ - "__builtins__" - ] = mock_azure.request_instance.__globals__["__builtins__"].copy() + mock_azure.request_instance.__globals__["__builtins__"] = ( + mock_azure.request_instance.__globals__["__builtins__"].copy() + ) mock_azure.request_instance.__globals__["__builtins__"]["getattr"] = MagicMock() mock_azure.__utils__["cloud.fire_event"] = mock_azure.salt.utils.cloud.fire_event - mock_azure.__utils__[ - "cloud.filter_event" - ] = mock_azure.salt.utils.cloud.filter_event + mock_azure.__utils__["cloud.filter_event"] = ( + mock_azure.salt.utils.cloud.filter_event + ) mock_azure.__opts__["sock_dir"] = MagicMock() mock_azure.__opts__["transport"] = MagicMock() diff --git a/tests/pytests/unit/cloud/clouds/test_digitalocean.py b/tests/pytests/unit/cloud/clouds/test_digitalocean.py index 576264864d1..ec949457364 100644 --- a/tests/pytests/unit/cloud/clouds/test_digitalocean.py +++ b/tests/pytests/unit/cloud/clouds/test_digitalocean.py @@ -5,7 +5,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import logging import pytest diff --git a/tests/pytests/unit/cloud/clouds/test_hetzner.py b/tests/pytests/unit/cloud/clouds/test_hetzner.py index cfe5bb4e85e..c423d83dbca 100644 --- a/tests/pytests/unit/cloud/clouds/test_hetzner.py +++ b/tests/pytests/unit/cloud/clouds/test_hetzner.py @@ -490,9 +490,9 @@ def test_destroy(): connect.return_value.servers.get_by_name.return_value = None hetzner.destroy("myvm", "action") - server = ( - connect.return_value.servers.get_by_name.return_value - ) = MagicMock() + server = connect.return_value.servers.get_by_name.return_value = ( + MagicMock() + ) # Stop the server before shutdown but failed hetzner.destroy("myvm", "action") @@ -531,9 +531,9 @@ def test_resize(): hetzner.resize("myvm", kwargs, "action") - server = ( - connect.return_value.servers.get_by_name.return_value - ) = MagicMock() + server = connect.return_value.servers.get_by_name.return_value = ( + MagicMock() + ) # Invalid server size with pytest.raises(SaltCloudException): diff --git a/tests/pytests/unit/cloud/clouds/test_saltify.py b/tests/pytests/unit/cloud/clouds/test_saltify.py index 8dd0359185a..851c05d0f80 100644 --- a/tests/pytests/unit/cloud/clouds/test_saltify.py +++ b/tests/pytests/unit/cloud/clouds/test_saltify.py @@ -1,6 +1,7 @@ """ :codeauthor: Alexander Schwartz """ + import pytest import salt.client diff --git a/tests/pytests/unit/cloud/clouds/test_vultrpy.py b/tests/pytests/unit/cloud/clouds/test_vultrpy.py index a388ba7f2a5..2945588280d 100644 --- a/tests/pytests/unit/cloud/clouds/test_vultrpy.py +++ b/tests/pytests/unit/cloud/clouds/test_vultrpy.py @@ -96,7 +96,9 @@ def test_create_firewall_ssh(): patch_show = patch("salt.cloud.clouds.vultrpy.show_instance", MagicMock()) - with patch_scripts, patch_firewall, patch_keys, patch_vultrid, patch_query, patch_show: + with ( + patch_scripts + ), patch_firewall, patch_keys, patch_vultrid, patch_query, patch_show: vultr.create(kwargs) query_ret = mock_query.call_args.kwargs["data"] assert "SSHKEYID=key1%2Ckey2%2Ckey3" in query_ret @@ -143,7 +145,9 @@ def test_create_firewall_doesnotexist(caplog): patch_show = patch("salt.cloud.clouds.vultrpy.show_instance", MagicMock()) - with patch_scripts, patch_firewall, patch_keys, patch_vultrid, patch_query, patch_show: + with ( + patch_scripts + ), patch_firewall, patch_keys, patch_vultrid, patch_query, patch_show: with caplog.at_level(logging.INFO): ret = vultr.create(kwargs) assert ( @@ -193,7 +197,9 @@ def test_create_ssh_key_ids_doesnotexist(caplog): patch_show = patch("salt.cloud.clouds.vultrpy.show_instance", MagicMock()) - with patch_scripts, patch_firewall, patch_keys, patch_vultrid, patch_query, patch_show: + with ( + patch_scripts + ), patch_firewall, patch_keys, patch_vultrid, patch_query, patch_show: with caplog.at_level(logging.INFO): ret = vultr.create(kwargs) assert ( diff --git a/tests/pytests/unit/config/test__validate_opts.py b/tests/pytests/unit/config/test__validate_opts.py index 741631e6f81..f07a60c3c1f 100644 --- a/tests/pytests/unit/config/test__validate_opts.py +++ b/tests/pytests/unit/config/test__validate_opts.py @@ -1,6 +1,7 @@ """ Test config option type enforcement """ + import pytest import salt.config diff --git a/tests/pytests/unit/engines/test_libvirt_events.py b/tests/pytests/unit/engines/test_libvirt_events.py index 382ec311732..a83a1948fac 100644 --- a/tests/pytests/unit/engines/test_libvirt_events.py +++ b/tests/pytests/unit/engines/test_libvirt_events.py @@ -1,6 +1,7 @@ """ unit tests for the libvirt_events engine """ + import pytest import salt.engines.libvirt_events as libvirt_events diff --git a/tests/pytests/unit/engines/test_slack.py b/tests/pytests/unit/engines/test_slack.py index c375e903b7b..b3269a6f2a5 100644 --- a/tests/pytests/unit/engines/test_slack.py +++ b/tests/pytests/unit/engines/test_slack.py @@ -1,6 +1,7 @@ """ unit tests for the slack engine """ + import pytest import salt.engines.slack as slack diff --git a/tests/pytests/unit/engines/test_slack_bolt_engine.py b/tests/pytests/unit/engines/test_slack_bolt_engine.py index e537a859550..1d2e30a045b 100644 --- a/tests/pytests/unit/engines/test_slack_bolt_engine.py +++ b/tests/pytests/unit/engines/test_slack_bolt_engine.py @@ -1,6 +1,7 @@ """ unit tests for the slack engine """ + import pytest import salt.engines.slack_bolt_engine as slack_bolt_engine @@ -327,7 +328,13 @@ def test_run_commands_from_slack_async(slack_client): # # test with control as True and fire_all as False # - with patch_slack_client_run_until, patch_slack_client_run_command_async, patch_slack_client_get_jobs_from_runner, patch_app_client_files_upload as app_client_files_upload, patch_app_client_chat_postMessage as app_client_chat_postMessage: + with ( + patch_slack_client_run_until + ), ( + patch_slack_client_run_command_async + ), ( + patch_slack_client_get_jobs_from_runner + ), patch_app_client_files_upload as app_client_files_upload, patch_app_client_chat_postMessage as app_client_chat_postMessage: slack_client.run_commands_from_slack_async( message_generator=message_generator, fire_all=False, @@ -389,7 +396,15 @@ def test_run_commands_from_slack_async(slack_client): }, ) ] - with patch_slack_client_run_until, patch_slack_client_run_command_async, patch_slack_client_get_jobs_from_runner, patch_event_send, patch_app_client_files_upload as app_client_files_upload, patch_app_client_chat_postMessage as app_client_chat_postMessage: + with ( + patch_slack_client_run_until + ), ( + patch_slack_client_run_command_async + ), ( + patch_slack_client_get_jobs_from_runner + ), ( + patch_event_send + ), patch_app_client_files_upload as app_client_files_upload, patch_app_client_chat_postMessage as app_client_chat_postMessage: slack_client.run_commands_from_slack_async( message_generator=message_generator, fire_all=True, @@ -509,6 +524,8 @@ def test_run_command_async(slack_client): }, ) ] - with patch_runner_client, patch_runner_client_asynchronous as runner_client_asynchronous: + with ( + patch_runner_client + ), patch_runner_client_asynchronous as runner_client_asynchronous: ret = slack_client.run_command_async(msg) runner_client_asynchronous.assert_has_calls(expected_calls) diff --git a/tests/pytests/unit/engines/test_sqs_events.py b/tests/pytests/unit/engines/test_sqs_events.py index 894d1d6f652..28fb75f8f89 100644 --- a/tests/pytests/unit/engines/test_sqs_events.py +++ b/tests/pytests/unit/engines/test_sqs_events.py @@ -1,6 +1,7 @@ """ unit tests for the sqs_events engine """ + import pytest import salt.engines.sqs_events as sqs_events diff --git a/tests/pytests/unit/fileclient/test_fileclient.py b/tests/pytests/unit/fileclient/test_fileclient.py index cbdbd763313..b9acd173c5e 100644 --- a/tests/pytests/unit/fileclient/test_fileclient.py +++ b/tests/pytests/unit/fileclient/test_fileclient.py @@ -1,6 +1,7 @@ """ Tests for the salt fileclient """ + import errno import logging import os diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index a87451af336..af6f721f843 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -1780,9 +1780,9 @@ def test_lxc_virtual(): os.path, "isfile", MagicMock( - side_effect=lambda x: True - if x in ("/proc/1/cgroup", "/proc/1/environ") - else False + side_effect=lambda x: ( + True if x in ("/proc/1/cgroup", "/proc/1/environ") else False + ) ), ), patch("salt.utils.files.fopen", mock_open(read_data=file_contents)), patch.dict( core.__salt__, {"cmd.run_all": MagicMock()} @@ -1828,9 +1828,11 @@ def test_container_inside_virtual_machine(): os.path, "isfile", MagicMock( - side_effect=lambda x: True - if x in ("/proc/cpuinfo", "/proc/1/cgroup", "/proc/1/environ") - else False + side_effect=lambda x: ( + True + if x in ("/proc/cpuinfo", "/proc/1/cgroup", "/proc/1/environ") + else False + ) ), ), patch("salt.utils.files.fopen", mock_open(read_data=file_contents)), patch.dict( core.__salt__, {"cmd.run_all": MagicMock()} @@ -3603,8 +3605,8 @@ def test_linux_devicetree_data(test_input, expected): raise FileNotFoundError() m = MagicMock() - m.__enter__.return_value.read = ( - lambda: test_input.get(filename) # pylint: disable=W0640 + m.__enter__.return_value.read = lambda: ( + test_input.get(filename) # pylint: disable=W0640 if filename in test_input # pylint: disable=W0640 else _raise_fnfe() ) diff --git a/tests/pytests/unit/grains/test_esxi.py b/tests/pytests/unit/grains/test_esxi.py index 29be04bc56e..e158b2b3843 100644 --- a/tests/pytests/unit/grains/test_esxi.py +++ b/tests/pytests/unit/grains/test_esxi.py @@ -4,7 +4,6 @@ :codeauthor: :email:`Gareth J. Greenaway ` """ - import logging import pytest diff --git a/tests/pytests/unit/loader/test_context.py b/tests/pytests/unit/loader/test_context.py index 9815f443f25..64b36411f4b 100644 --- a/tests/pytests/unit/loader/test_context.py +++ b/tests/pytests/unit/loader/test_context.py @@ -1,6 +1,7 @@ """ Tests for salt.loader.context """ + import copy import salt.loader.context diff --git a/tests/pytests/unit/loader/test_lazy.py b/tests/pytests/unit/loader/test_lazy.py index 571f458b360..8e461b454b4 100644 --- a/tests/pytests/unit/loader/test_lazy.py +++ b/tests/pytests/unit/loader/test_lazy.py @@ -1,6 +1,7 @@ """ Tests for salt.loader.lazy """ + import sys import pytest diff --git a/tests/pytests/unit/loader/test_loader.py b/tests/pytests/unit/loader/test_loader.py index 3c26b435c8c..e7359c6a74a 100644 --- a/tests/pytests/unit/loader/test_loader.py +++ b/tests/pytests/unit/loader/test_loader.py @@ -4,6 +4,7 @@ tests.pytests.unit.loader.test_loader Unit tests for salt's loader """ + import os import shutil import textwrap diff --git a/tests/pytests/unit/log_handlers/test_sentry_mod.py b/tests/pytests/unit/log_handlers/test_sentry_mod.py index 4c2d174b710..e011719ca84 100644 --- a/tests/pytests/unit/log_handlers/test_sentry_mod.py +++ b/tests/pytests/unit/log_handlers/test_sentry_mod.py @@ -1,6 +1,7 @@ """ Tests for salt.log_handlers.sentry_mod """ + import pytest import salt.log_handlers.sentry_mod diff --git a/tests/pytests/unit/modules/file/test_file_line.py b/tests/pytests/unit/modules/file/test_file_line.py index 5c2e444617e..4099d61b845 100644 --- a/tests/pytests/unit/modules/file/test_file_line.py +++ b/tests/pytests/unit/modules/file/test_file_line.py @@ -1588,7 +1588,7 @@ def test_line_insert_ensure_beforeafter_twolines(tempfile_name, get_body): isfile_mock = MagicMock( side_effect=lambda x: True if x == tempfile_name else DEFAULT ) - for (_after, _before) in [(after, before), ("NAME_.*", "SKEL_.*")]: + for _after, _before in [(after, before), ("NAME_.*", "SKEL_.*")]: with patch("os.path.isfile", isfile_mock), patch( "os.stat", MagicMock(return_value=DummyStat()) ), patch("salt.utils.files.fopen", mock_open(read_data=file_content)), patch( @@ -1640,7 +1640,7 @@ def test_line_insert_ensure_beforeafter_twolines_exists(tempfile_name): isfile_mock = MagicMock( side_effect=lambda x: True if x == tempfile_name else DEFAULT ) - for (_after, _before) in [(after, before), ("NAME_.*", "SKEL_.*")]: + for _after, _before in [(after, before), ("NAME_.*", "SKEL_.*")]: with patch("os.path.isfile", isfile_mock), patch( "os.stat", MagicMock(return_value=DummyStat()) ), patch("salt.utils.files.fopen", mock_open(read_data=file_content)), patch( @@ -1677,7 +1677,7 @@ def test_line_insert_ensure_beforeafter_rangelines(): file_content.split(os.linesep)[0], file_content.split(os.linesep)[-1], ) - for (_after, _before) in [(after, before), ("NAME_.*", "SKEL_.*")]: + for _after, _before in [(after, before), ("NAME_.*", "SKEL_.*")]: with patch("os.path.realpath", MagicMock(wraps=lambda x: x)), patch( "os.path.isfile", MagicMock(return_value=True) ), patch("os.stat", MagicMock()), patch( diff --git a/tests/pytests/unit/modules/napalm/test_bgp.py b/tests/pytests/unit/modules/napalm/test_bgp.py index e9dcb21ecf5..48a7105342d 100644 --- a/tests/pytests/unit/modules/napalm/test_bgp.py +++ b/tests/pytests/unit/modules/napalm/test_bgp.py @@ -2,7 +2,6 @@ :codeauthor: :email:`Anthony Shaw ` """ - import pytest import salt.modules.napalm_bgp as napalm_bgp diff --git a/tests/pytests/unit/modules/napalm/test_mod.py b/tests/pytests/unit/modules/napalm/test_mod.py index 306a9840a46..5b693c2de2a 100644 --- a/tests/pytests/unit/modules/napalm/test_mod.py +++ b/tests/pytests/unit/modules/napalm/test_mod.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`David Murphy ` """ + import logging import pytest diff --git a/tests/pytests/unit/modules/napalm/test_network.py b/tests/pytests/unit/modules/napalm/test_network.py index 4dfaf8af447..2ce2d6e621b 100644 --- a/tests/pytests/unit/modules/napalm/test_network.py +++ b/tests/pytests/unit/modules/napalm/test_network.py @@ -2,7 +2,6 @@ :codeauthor: Anthony Shaw """ - import pytest import salt.modules.napalm_network as napalm_network diff --git a/tests/pytests/unit/modules/napalm/test_snmp.py b/tests/pytests/unit/modules/napalm/test_snmp.py index 67d25850f3a..5166372ca68 100644 --- a/tests/pytests/unit/modules/napalm/test_snmp.py +++ b/tests/pytests/unit/modules/napalm/test_snmp.py @@ -2,7 +2,6 @@ :codeauthor: :email:`Anthony Shaw ` """ - import pytest import salt.modules.napalm_network as napalm_network diff --git a/tests/pytests/unit/modules/napalm/test_users.py b/tests/pytests/unit/modules/napalm/test_users.py index b76010e76f1..f55a649aa7b 100644 --- a/tests/pytests/unit/modules/napalm/test_users.py +++ b/tests/pytests/unit/modules/napalm/test_users.py @@ -2,7 +2,6 @@ :codeauthor: :email:`Anthony Shaw ` """ - import pytest import salt.modules.napalm_network as napalm_network diff --git a/tests/pytests/unit/modules/test_acme.py b/tests/pytests/unit/modules/test_acme.py index 2d7aa6d2883..aa56dc59813 100644 --- a/tests/pytests/unit/modules/test_acme.py +++ b/tests/pytests/unit/modules/test_acme.py @@ -2,7 +2,6 @@ :codeauthor: Herbert Buurman """ - import datetime import os import textwrap diff --git a/tests/pytests/unit/modules/test_at.py b/tests/pytests/unit/modules/test_at.py index 0a44d83beea..da5be7f4b0e 100644 --- a/tests/pytests/unit/modules/test_at.py +++ b/tests/pytests/unit/modules/test_at.py @@ -4,7 +4,6 @@ TestCase for the salt.modules.at module """ - import pytest import salt.modules.at as at diff --git a/tests/pytests/unit/modules/test_augeas_cfg.py b/tests/pytests/unit/modules/test_augeas_cfg.py index 0720b6b25b9..dd197555665 100644 --- a/tests/pytests/unit/modules/test_augeas_cfg.py +++ b/tests/pytests/unit/modules/test_augeas_cfg.py @@ -3,6 +3,7 @@ Test cases for salt.modules.augeas_cfg """ + import pytest import salt.modules.augeas_cfg as augeas_cfg diff --git a/tests/pytests/unit/modules/test_bigip.py b/tests/pytests/unit/modules/test_bigip.py index 3e24ad9df4a..2fc8cb44c50 100644 --- a/tests/pytests/unit/modules/test_bigip.py +++ b/tests/pytests/unit/modules/test_bigip.py @@ -4,6 +4,7 @@ tests.unit.modules.test_bigip Unit tests for the bigip module """ + import logging import pytest diff --git a/tests/pytests/unit/modules/test_bluez_bluetooth.py b/tests/pytests/unit/modules/test_bluez_bluetooth.py index e7b832e613f..d3bab5ba043 100644 --- a/tests/pytests/unit/modules/test_bluez_bluetooth.py +++ b/tests/pytests/unit/modules/test_bluez_bluetooth.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import pytest import salt.modules.bluez_bluetooth as bluez diff --git a/tests/pytests/unit/modules/test_boto_dynamodb.py b/tests/pytests/unit/modules/test_boto_dynamodb.py index f5b983e13f0..0a2fe186a1c 100644 --- a/tests/pytests/unit/modules/test_boto_dynamodb.py +++ b/tests/pytests/unit/modules/test_boto_dynamodb.py @@ -2,7 +2,6 @@ Test cases for salt.modules.boto_dynamodb """ - import pytest import salt.modules.boto_dynamodb as boto_dynamodb diff --git a/tests/pytests/unit/modules/test_bower.py b/tests/pytests/unit/modules/test_bower.py index df33182ab1a..537fb08fbaa 100644 --- a/tests/pytests/unit/modules/test_bower.py +++ b/tests/pytests/unit/modules/test_bower.py @@ -2,7 +2,6 @@ :codeauthor: Alexander Pyatkin """ - import pytest import salt.modules.bower as bower diff --git a/tests/pytests/unit/modules/test_bridge.py b/tests/pytests/unit/modules/test_bridge.py index f68ffbce2d7..7595e4263ee 100644 --- a/tests/pytests/unit/modules/test_bridge.py +++ b/tests/pytests/unit/modules/test_bridge.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import pytest import salt.modules.bridge as bridge diff --git a/tests/pytests/unit/modules/test_cassandra_cql.py b/tests/pytests/unit/modules/test_cassandra_cql.py index 6b39d2f0cc4..b50a101e416 100644 --- a/tests/pytests/unit/modules/test_cassandra_cql.py +++ b/tests/pytests/unit/modules/test_cassandra_cql.py @@ -2,7 +2,6 @@ Test case for the cassandra_cql module """ - import logging import ssl diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index ac2c7341045..8dd630793f1 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -1,6 +1,7 @@ """ Test for the chocolatey module """ + import os import pytest diff --git a/tests/pytests/unit/modules/test_composer.py b/tests/pytests/unit/modules/test_composer.py index 74d828aee6a..c0f5f552f2a 100644 --- a/tests/pytests/unit/modules/test_composer.py +++ b/tests/pytests/unit/modules/test_composer.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import pytest import salt.modules.composer as composer diff --git a/tests/pytests/unit/modules/test_config.py b/tests/pytests/unit/modules/test_config.py index c522dc7897c..122d41b9291 100644 --- a/tests/pytests/unit/modules/test_config.py +++ b/tests/pytests/unit/modules/test_config.py @@ -2,7 +2,6 @@ Test cases for salt.modules.config """ - import fnmatch import pytest diff --git a/tests/pytests/unit/modules/test_consul.py b/tests/pytests/unit/modules/test_consul.py index 52f1c8ece2e..59c07ff43da 100644 --- a/tests/pytests/unit/modules/test_consul.py +++ b/tests/pytests/unit/modules/test_consul.py @@ -2,7 +2,6 @@ Test case for the consul execution module """ - import logging import pytest diff --git a/tests/pytests/unit/modules/test_cp.py b/tests/pytests/unit/modules/test_cp.py index 6700832e345..2e626e5da45 100644 --- a/tests/pytests/unit/modules/test_cp.py +++ b/tests/pytests/unit/modules/test_cp.py @@ -2,7 +2,6 @@ :codeauthor: jmoney """ - import pytest import salt.channel.client diff --git a/tests/pytests/unit/modules/test_daemontools.py b/tests/pytests/unit/modules/test_daemontools.py index 3a5e51fcba4..a5cbed24568 100644 --- a/tests/pytests/unit/modules/test_daemontools.py +++ b/tests/pytests/unit/modules/test_daemontools.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_data.py b/tests/pytests/unit/modules/test_data.py index 02a91c36a14..4a575a19dd9 100644 --- a/tests/pytests/unit/modules/test_data.py +++ b/tests/pytests/unit/modules/test_data.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.data as data diff --git a/tests/pytests/unit/modules/test_deb_apache.py b/tests/pytests/unit/modules/test_deb_apache.py index 1608321f107..d78f17c5d60 100644 --- a/tests/pytests/unit/modules/test_deb_apache.py +++ b/tests/pytests/unit/modules/test_deb_apache.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.deb_apache as deb_apache diff --git a/tests/pytests/unit/modules/test_devmap.py b/tests/pytests/unit/modules/test_devmap.py index f7fc9f09ea1..405eccac1b4 100644 --- a/tests/pytests/unit/modules/test_devmap.py +++ b/tests/pytests/unit/modules/test_devmap.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import os.path import pytest diff --git a/tests/pytests/unit/modules/test_dig.py b/tests/pytests/unit/modules/test_dig.py index dcc0acc8295..0d39a20e73c 100644 --- a/tests/pytests/unit/modules/test_dig.py +++ b/tests/pytests/unit/modules/test_dig.py @@ -2,7 +2,6 @@ Test cases for salt.modules.dig """ - import pytest import salt.modules.dig as dig diff --git a/tests/pytests/unit/modules/test_disk.py b/tests/pytests/unit/modules/test_disk.py index 58d8cbc305c..33bee16deaa 100644 --- a/tests/pytests/unit/modules/test_disk.py +++ b/tests/pytests/unit/modules/test_disk.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.disk as disk diff --git a/tests/pytests/unit/modules/test_djangomod.py b/tests/pytests/unit/modules/test_djangomod.py index f3a22dd8052..f3fb1ed884e 100644 --- a/tests/pytests/unit/modules/test_djangomod.py +++ b/tests/pytests/unit/modules/test_djangomod.py @@ -3,6 +3,7 @@ Test cases for salt.modules.djangomod """ + import pytest import salt.modules.djangomod as djangomod diff --git a/tests/pytests/unit/modules/test_dpkg_lowpkg.py b/tests/pytests/unit/modules/test_dpkg_lowpkg.py index 41bd615ff29..625015b7590 100644 --- a/tests/pytests/unit/modules/test_dpkg_lowpkg.py +++ b/tests/pytests/unit/modules/test_dpkg_lowpkg.py @@ -4,7 +4,6 @@ Test cases for salt.modules.dpkg """ - import logging import os diff --git a/tests/pytests/unit/modules/test_drac.py b/tests/pytests/unit/modules/test_drac.py index 2a8da5a23f6..9d684797e0c 100644 --- a/tests/pytests/unit/modules/test_drac.py +++ b/tests/pytests/unit/modules/test_drac.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import pytest import salt.modules.drac as drac diff --git a/tests/pytests/unit/modules/test_drbd.py b/tests/pytests/unit/modules/test_drbd.py index ce9625c2d0c..c4686093a5a 100644 --- a/tests/pytests/unit/modules/test_drbd.py +++ b/tests/pytests/unit/modules/test_drbd.py @@ -4,7 +4,6 @@ Test cases for salt.modules.drbd """ - import pytest import salt.modules.drbd as drbd diff --git a/tests/pytests/unit/modules/test_etcd_mod.py b/tests/pytests/unit/modules/test_etcd_mod.py index 1c43772524d..d4b26a8486f 100644 --- a/tests/pytests/unit/modules/test_etcd_mod.py +++ b/tests/pytests/unit/modules/test_etcd_mod.py @@ -9,7 +9,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.etcd_mod as etcd_mod diff --git a/tests/pytests/unit/modules/test_extfs.py b/tests/pytests/unit/modules/test_extfs.py index c4ab8d3bc6b..bef0e35bfea 100644 --- a/tests/pytests/unit/modules/test_extfs.py +++ b/tests/pytests/unit/modules/test_extfs.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.extfs as extfs diff --git a/tests/pytests/unit/modules/test_genesis.py b/tests/pytests/unit/modules/test_genesis.py index 0a2100f4848..2fd7f091006 100644 --- a/tests/pytests/unit/modules/test_genesis.py +++ b/tests/pytests/unit/modules/test_genesis.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import sys import pytest diff --git a/tests/pytests/unit/modules/test_gentoo_service.py b/tests/pytests/unit/modules/test_gentoo_service.py index 1d7e8eca7f9..31df975cb53 100644 --- a/tests/pytests/unit/modules/test_gentoo_service.py +++ b/tests/pytests/unit/modules/test_gentoo_service.py @@ -2,7 +2,6 @@ Test cases for salt.modules.gentoo_service """ - import pytest import salt.modules.gentoo_service as gentoo_service diff --git a/tests/pytests/unit/modules/test_git.py b/tests/pytests/unit/modules/test_git.py index 9d7c9ae9fc7..4da79b7bd55 100644 --- a/tests/pytests/unit/modules/test_git.py +++ b/tests/pytests/unit/modules/test_git.py @@ -2,7 +2,6 @@ :codeauthor: Erik Johnson """ - import copy import logging import os @@ -88,9 +87,11 @@ def test_list_worktrees(worktree_info, worktree_root): return "worktree {}\nHEAD {}\n{}\n".format( path, worktree_info[path]["HEAD"], - "branch {}".format(worktree_info[path]["branch"]) - if worktree_info[path]["branch"] != "detached" - else "detached", + ( + "branch {}".format(worktree_info[path]["branch"]) + if worktree_info[path]["branch"] != "detached" + else "detached" + ), ) # Build dict for _cmd_run_side_effect below. Start with the output from diff --git a/tests/pytests/unit/modules/test_glassfish.py b/tests/pytests/unit/modules/test_glassfish.py index e6e22b3a696..fa0022f5fe6 100644 --- a/tests/pytests/unit/modules/test_glassfish.py +++ b/tests/pytests/unit/modules/test_glassfish.py @@ -4,6 +4,7 @@ tests.unit.modules.test_glassfish Unit tests for the glassfish module """ + import logging import pytest diff --git a/tests/pytests/unit/modules/test_glusterfs.py b/tests/pytests/unit/modules/test_glusterfs.py index 2816a18ffd3..79d61c3e2ba 100644 --- a/tests/pytests/unit/modules/test_glusterfs.py +++ b/tests/pytests/unit/modules/test_glusterfs.py @@ -5,7 +5,6 @@ Test cases for salt.modules.glusterfs """ - import pytest import salt.modules.glusterfs as glusterfs diff --git a/tests/pytests/unit/modules/test_grub_legacy.py b/tests/pytests/unit/modules/test_grub_legacy.py index 47ec919939c..4d0feae6f4b 100644 --- a/tests/pytests/unit/modules/test_grub_legacy.py +++ b/tests/pytests/unit/modules/test_grub_legacy.py @@ -4,7 +4,6 @@ Test cases for salt.modules.grub_legacy """ - import errno import pytest diff --git a/tests/pytests/unit/modules/test_hadoop.py b/tests/pytests/unit/modules/test_hadoop.py index 37416403274..fad51b9b6e6 100644 --- a/tests/pytests/unit/modules/test_hadoop.py +++ b/tests/pytests/unit/modules/test_hadoop.py @@ -4,7 +4,6 @@ Test cases for salt.modules.hadoop """ - import pytest import salt.modules.hadoop as hadoop diff --git a/tests/pytests/unit/modules/test_haproxyconn.py b/tests/pytests/unit/modules/test_haproxyconn.py index 7834818fbea..51d39fc7d3b 100644 --- a/tests/pytests/unit/modules/test_haproxyconn.py +++ b/tests/pytests/unit/modules/test_haproxyconn.py @@ -4,7 +4,6 @@ Test cases for salt.modules.haproxyconn """ - import pytest import salt.modules.haproxyconn as haproxyconn diff --git a/tests/pytests/unit/modules/test_hashutil.py b/tests/pytests/unit/modules/test_hashutil.py index 57a237bad66..cf1527e624e 100644 --- a/tests/pytests/unit/modules/test_hashutil.py +++ b/tests/pytests/unit/modules/test_hashutil.py @@ -2,7 +2,6 @@ Test cases for salt.modules.hashutil """ - import pytest import salt.modules.hashutil as hashutil diff --git a/tests/pytests/unit/modules/test_helm.py b/tests/pytests/unit/modules/test_helm.py index 8286f4af27a..776ed45734e 100644 --- a/tests/pytests/unit/modules/test_helm.py +++ b/tests/pytests/unit/modules/test_helm.py @@ -2,7 +2,6 @@ Test cases for salt.modules.helm """ - import pytest import salt.modules.helm as helm diff --git a/tests/pytests/unit/modules/test_hg.py b/tests/pytests/unit/modules/test_hg.py index 5d31217b76d..723bf5044d9 100644 --- a/tests/pytests/unit/modules/test_hg.py +++ b/tests/pytests/unit/modules/test_hg.py @@ -4,7 +4,6 @@ Test cases for salt.modules.hg """ - import pytest import salt.modules.hg as hg diff --git a/tests/pytests/unit/modules/test_http.py b/tests/pytests/unit/modules/test_http.py index 7e2c33dc4c6..16aa8a72a99 100644 --- a/tests/pytests/unit/modules/test_http.py +++ b/tests/pytests/unit/modules/test_http.py @@ -4,7 +4,6 @@ Test cases for salt.modules.http """ - import pytest import salt.modules.http as http diff --git a/tests/pytests/unit/modules/test_ilo.py b/tests/pytests/unit/modules/test_ilo.py index 0df13c8be7d..3328856e577 100644 --- a/tests/pytests/unit/modules/test_ilo.py +++ b/tests/pytests/unit/modules/test_ilo.py @@ -4,7 +4,6 @@ Test cases for salt.modules.ilo """ - import tempfile import pytest diff --git a/tests/pytests/unit/modules/test_incron.py b/tests/pytests/unit/modules/test_incron.py index 9f241d570f1..cae619a6968 100644 --- a/tests/pytests/unit/modules/test_incron.py +++ b/tests/pytests/unit/modules/test_incron.py @@ -4,7 +4,6 @@ Test cases for salt.modules.incron """ - import pytest import salt.modules.incron as incron diff --git a/tests/pytests/unit/modules/test_ini_manage.py b/tests/pytests/unit/modules/test_ini_manage.py index 538e75c171b..5074f026860 100644 --- a/tests/pytests/unit/modules/test_ini_manage.py +++ b/tests/pytests/unit/modules/test_ini_manage.py @@ -437,9 +437,7 @@ def test_unicode_set_option(encoding, linesep, ini_file, unicode_content): assert ini.get_option(str(ini_file), "Ascii", "ay", encoding=encoding) == "Aymar" # Check new section and option added - assert ( - ini.get_option(str(ini_file), "Юникод", "dv", encoding=encoding) == "ދިވެހިބަސް" - ) + assert ini.get_option(str(ini_file), "Юникод", "dv", encoding=encoding) == "ދިވެހިބަސް" @pytest.mark.parametrize("linesep", ["\r", "\n", "\r\n"]) @@ -478,9 +476,12 @@ def test_unicode_remove_option(encoding, linesep, ini_file, unicode_content): ini_file.write_bytes(content) assert ( - ini.remove_option(str(ini_file), "Юникод", "繁體中文", encoding=encoding) == "zh_TW" + ini.remove_option(str(ini_file), "Юникод", "繁體中文", encoding=encoding) + == "zh_TW" + ) + assert ( + ini.get_option(str(ini_file), "Юникод", "繁體中文", encoding=encoding) is None ) - assert ini.get_option(str(ini_file), "Юникод", "繁體中文", encoding=encoding) is None @pytest.mark.parametrize("linesep", ["\r", "\n", "\r\n"]) diff --git a/tests/pytests/unit/modules/test_introspect.py b/tests/pytests/unit/modules/test_introspect.py index caf9db42eee..fa2c99d6672 100644 --- a/tests/pytests/unit/modules/test_introspect.py +++ b/tests/pytests/unit/modules/test_introspect.py @@ -4,7 +4,6 @@ Test cases for salt.modules.introspect """ - import pytest import salt.modules.introspect as introspect diff --git a/tests/pytests/unit/modules/test_ipset.py b/tests/pytests/unit/modules/test_ipset.py index e0f486300f3..83d07f1d4ef 100644 --- a/tests/pytests/unit/modules/test_ipset.py +++ b/tests/pytests/unit/modules/test_ipset.py @@ -1,6 +1,7 @@ """ :codeauthor: Rupesh Tare """ + import pytest import salt.modules.ipset as ipset diff --git a/tests/pytests/unit/modules/test_junos.py b/tests/pytests/unit/modules/test_junos.py index 616f15f1d8a..1c4e3d57f29 100644 --- a/tests/pytests/unit/modules/test_junos.py +++ b/tests/pytests/unit/modules/test_junos.py @@ -1,6 +1,7 @@ """ :codeauthor: Rajvi Dhimar """ + import os import pytest diff --git a/tests/pytests/unit/modules/test_key.py b/tests/pytests/unit/modules/test_key.py index bfc9442a103..726d7db44ca 100644 --- a/tests/pytests/unit/modules/test_key.py +++ b/tests/pytests/unit/modules/test_key.py @@ -4,7 +4,6 @@ Test cases for salt.modules.key """ - import os.path import pytest diff --git a/tests/pytests/unit/modules/test_keyboard.py b/tests/pytests/unit/modules/test_keyboard.py index d88f52bd6d6..ceb0d7effe0 100644 --- a/tests/pytests/unit/modules/test_keyboard.py +++ b/tests/pytests/unit/modules/test_keyboard.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.keyboard as keyboard diff --git a/tests/pytests/unit/modules/test_kubeadm.py b/tests/pytests/unit/modules/test_kubeadm.py index 252a89da2f9..a4c1d2fc449 100644 --- a/tests/pytests/unit/modules/test_kubeadm.py +++ b/tests/pytests/unit/modules/test_kubeadm.py @@ -2,7 +2,6 @@ Test cases for salt.modules.kubeadm """ - import pytest import salt.modules.kubeadm as kubeadm diff --git a/tests/pytests/unit/modules/test_launchctl_service.py b/tests/pytests/unit/modules/test_launchctl_service.py index bda0137189b..afb0920476a 100644 --- a/tests/pytests/unit/modules/test_launchctl_service.py +++ b/tests/pytests/unit/modules/test_launchctl_service.py @@ -4,7 +4,6 @@ Test cases for salt.modules.launchctl """ - import pytest import salt.modules.launchctl_service as launchctl diff --git a/tests/pytests/unit/modules/test_ldapmod.py b/tests/pytests/unit/modules/test_ldapmod.py index 751625eb992..9b8207ed5bf 100644 --- a/tests/pytests/unit/modules/test_ldapmod.py +++ b/tests/pytests/unit/modules/test_ldapmod.py @@ -4,7 +4,6 @@ Test cases for salt.modules.ldapmod """ - import time import pytest diff --git a/tests/pytests/unit/modules/test_linux_lvm.py b/tests/pytests/unit/modules/test_linux_lvm.py index 848a57040a1..9c39f63e747 100644 --- a/tests/pytests/unit/modules/test_linux_lvm.py +++ b/tests/pytests/unit/modules/test_linux_lvm.py @@ -4,7 +4,6 @@ TestCase for the salt.modules.linux_lvm module """ - import os.path import pytest diff --git a/tests/pytests/unit/modules/test_linux_shadow.py b/tests/pytests/unit/modules/test_linux_shadow.py index 5d977fc5212..0c742672750 100644 --- a/tests/pytests/unit/modules/test_linux_shadow.py +++ b/tests/pytests/unit/modules/test_linux_shadow.py @@ -1,6 +1,7 @@ """ :codeauthor: Erik Johnson """ + import types import pytest diff --git a/tests/pytests/unit/modules/test_locate.py b/tests/pytests/unit/modules/test_locate.py index f74853a10bc..f4e5b2fb822 100644 --- a/tests/pytests/unit/modules/test_locate.py +++ b/tests/pytests/unit/modules/test_locate.py @@ -4,7 +4,6 @@ Test cases for salt.modules.locate """ - import pytest import salt.modules.locate as locate diff --git a/tests/pytests/unit/modules/test_logadm.py b/tests/pytests/unit/modules/test_logadm.py index 7926252d025..fd5e61ba30f 100644 --- a/tests/pytests/unit/modules/test_logadm.py +++ b/tests/pytests/unit/modules/test_logadm.py @@ -4,7 +4,6 @@ Test cases for salt.modules.logadm """ - import pytest import salt.modules.logadm as logadm diff --git a/tests/pytests/unit/modules/test_logrotate.py b/tests/pytests/unit/modules/test_logrotate.py index 86caa5e58ad..03872c4cf06 100644 --- a/tests/pytests/unit/modules/test_logrotate.py +++ b/tests/pytests/unit/modules/test_logrotate.py @@ -4,7 +4,6 @@ Test cases for salt.modules.logrotate """ - import pytest import salt.modules.logrotate as logrotate diff --git a/tests/pytests/unit/modules/test_lvs.py b/tests/pytests/unit/modules/test_lvs.py index 58ba24a4160..513046787f0 100644 --- a/tests/pytests/unit/modules/test_lvs.py +++ b/tests/pytests/unit/modules/test_lvs.py @@ -4,7 +4,6 @@ Test cases for salt.modules.lvs """ - import pytest import salt.modules.lvs as lvs diff --git a/tests/pytests/unit/modules/test_mac_brew_pkg.py b/tests/pytests/unit/modules/test_mac_brew_pkg.py index 749c9765cce..99574efb01d 100644 --- a/tests/pytests/unit/modules/test_mac_brew_pkg.py +++ b/tests/pytests/unit/modules/test_mac_brew_pkg.py @@ -1,6 +1,7 @@ """ :codeauthor: Nicole Thomas """ + import textwrap import pytest diff --git a/tests/pytests/unit/modules/test_mac_service.py b/tests/pytests/unit/modules/test_mac_service.py index c657ea893c5..91578d946cf 100644 --- a/tests/pytests/unit/modules/test_mac_service.py +++ b/tests/pytests/unit/modules/test_mac_service.py @@ -2,7 +2,6 @@ :codeauthor: Megan Wilhite """ - import pytest import salt.modules.mac_service as mac_service diff --git a/tests/pytests/unit/modules/test_mac_shadow.py b/tests/pytests/unit/modules/test_mac_shadow.py index fa294b6651d..94d3c36b046 100644 --- a/tests/pytests/unit/modules/test_mac_shadow.py +++ b/tests/pytests/unit/modules/test_mac_shadow.py @@ -1,6 +1,7 @@ """ Unit Tests for the mac_desktop execution module. """ + from datetime import datetime import pytest diff --git a/tests/pytests/unit/modules/test_mandrill.py b/tests/pytests/unit/modules/test_mandrill.py index c1930d470e3..4f1c62e4673 100644 --- a/tests/pytests/unit/modules/test_mandrill.py +++ b/tests/pytests/unit/modules/test_mandrill.py @@ -2,7 +2,6 @@ Tests for the Mandrill execution module. """ - import pytest import salt.modules.mandrill as mandrill diff --git a/tests/pytests/unit/modules/test_match.py b/tests/pytests/unit/modules/test_match.py index 3a942dec752..d6ec425a02d 100644 --- a/tests/pytests/unit/modules/test_match.py +++ b/tests/pytests/unit/modules/test_match.py @@ -2,7 +2,6 @@ :codeauthor: Oleg Lipovchenko """ - import pytest import salt.loader diff --git a/tests/pytests/unit/modules/test_mdadm_raid.py b/tests/pytests/unit/modules/test_mdadm_raid.py index f496339b738..ebbf9cecc25 100644 --- a/tests/pytests/unit/modules/test_mdadm_raid.py +++ b/tests/pytests/unit/modules/test_mdadm_raid.py @@ -5,6 +5,7 @@ tests.unit.modules.mdadm_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ + import re import pytest diff --git a/tests/pytests/unit/modules/test_mine.py b/tests/pytests/unit/modules/test_mine.py index 9fdfecbd0c1..9f7ec6b998a 100644 --- a/tests/pytests/unit/modules/test_mine.py +++ b/tests/pytests/unit/modules/test_mine.py @@ -3,7 +3,6 @@ :codeauthor: Herbert Buurman """ - import pytest import salt.modules.mine as mine diff --git a/tests/pytests/unit/modules/test_mongodb.py b/tests/pytests/unit/modules/test_mongodb.py index b8b011dfdac..37bf432af25 100644 --- a/tests/pytests/unit/modules/test_mongodb.py +++ b/tests/pytests/unit/modules/test_mongodb.py @@ -112,7 +112,9 @@ def test_version(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_command, patch_pymongo_database, patch_salt_dict: + with ( + patch_mongo_client + ), patch_pymongo_command, patch_pymongo_database, patch_salt_dict: ret = mongodb.version() assert ret == "6.0.2" @@ -139,7 +141,9 @@ def test_db_list(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_list_db_names, patch_mongo_client, patch_pymongo_database, patch_salt_dict: + with ( + patch_list_db_names + ), patch_mongo_client, patch_pymongo_database, patch_salt_dict: ret = mongodb.db_list() assert ret == ["admin", "config", "local"] @@ -167,7 +171,9 @@ def test_db_exists(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_list_db_names, patch_mongo_client, patch_pymongo_database, patch_salt_dict: + with ( + patch_list_db_names + ), patch_mongo_client, patch_pymongo_database, patch_salt_dict: ret = mongodb.db_exists("admin") assert ret @@ -215,7 +221,9 @@ def test_user_list(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_pymongo_command, patch_salt_dict: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_pymongo_command, patch_salt_dict: ret = mongodb.user_list() expected = [ { @@ -318,7 +326,9 @@ def test_user_create(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_create("test_user", "test_password") assert ret @@ -344,7 +354,9 @@ def test_user_create_exception(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_create("test_user", "test_password") assert not ret @@ -370,7 +382,9 @@ def test_user_remove(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_remove("test_user") assert ret @@ -396,7 +410,9 @@ def test_user_remove_exception(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_remove("test_user") assert not ret @@ -446,7 +462,9 @@ def test_user_roles_exists(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_roles_exists("test_user", '["read"]', "admin") assert ret @@ -471,7 +489,9 @@ def test_user_grant_roles(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_grant_roles( "test_user", '[{"role": "readWrite", "db": "admin" }]', "admin" ) @@ -498,7 +518,9 @@ def test_user_revoke_roles(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.user_revoke_roles( "test_user", '[{"role": "readWrite", "db": "admin" }]', "admin" ) @@ -525,7 +547,9 @@ def test_collection_create(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_command: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_command: ret = mongodb.collection_create("test_collection") assert ret @@ -552,7 +576,9 @@ def test_collections_list(): mongodb.__salt__, {"config.option": config_option_mock} ) - with patch_mongo_client, patch_pymongo_database, patch_salt_dict, patch_pymongo_list_collection_names: + with ( + patch_mongo_client + ), patch_pymongo_database, patch_salt_dict, patch_pymongo_list_collection_names: ret = mongodb.collections_list() assert ret == ["system.users", "mycollection", "system.version"] @@ -579,7 +605,9 @@ def test_insert(): patch_pymongo_database = patch("pymongo.database.Database", pymongo_database_mock) patch_pymongo_collection = patch.object(mongodb, "getattr", pymongo_collection_mock) - with patch_mongo_client, patch_salt_dict, patch_pymongo_database, patch_pymongo_collection: + with ( + patch_mongo_client + ), patch_salt_dict, patch_pymongo_database, patch_pymongo_collection: patch_pymongo_collection_insert = patch.object( MockPyMongoCollection, "insert_many", diff --git a/tests/pytests/unit/modules/test_monit.py b/tests/pytests/unit/modules/test_monit.py index 092782bc1dd..7e16f1eca69 100644 --- a/tests/pytests/unit/modules/test_monit.py +++ b/tests/pytests/unit/modules/test_monit.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import pytest import salt.modules.monit as monit diff --git a/tests/pytests/unit/modules/test_mysql.py b/tests/pytests/unit/modules/test_mysql.py index 001655c8fd1..beb6b3b6d69 100644 --- a/tests/pytests/unit/modules/test_mysql.py +++ b/tests/pytests/unit/modules/test_mysql.py @@ -6,7 +6,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import logging import pytest diff --git a/tests/pytests/unit/modules/test_nacl.py b/tests/pytests/unit/modules/test_nacl.py index 915e2c5e3dd..2906ebc5419 100644 --- a/tests/pytests/unit/modules/test_nacl.py +++ b/tests/pytests/unit/modules/test_nacl.py @@ -1,6 +1,7 @@ """ Unit tests for the salt.modules.nacl module """ + import pytest import salt.utils.stringutils diff --git a/tests/pytests/unit/modules/test_nfs3.py b/tests/pytests/unit/modules/test_nfs3.py index 030e7f6d6f2..ecb16dff4a5 100644 --- a/tests/pytests/unit/modules/test_nfs3.py +++ b/tests/pytests/unit/modules/test_nfs3.py @@ -4,7 +4,6 @@ Test cases for salt.modules.nfs3 """ - import pytest import salt.modules.nfs3 as nfs3 diff --git a/tests/pytests/unit/modules/test_nftables.py b/tests/pytests/unit/modules/test_nftables.py index 423a38c0101..855e7712e7f 100644 --- a/tests/pytests/unit/modules/test_nftables.py +++ b/tests/pytests/unit/modules/test_nftables.py @@ -3,6 +3,7 @@ Test cases for salt.modules.nftables """ + import json import pytest diff --git a/tests/pytests/unit/modules/test_npm.py b/tests/pytests/unit/modules/test_npm.py index 61117ffcc12..53243964953 100644 --- a/tests/pytests/unit/modules/test_npm.py +++ b/tests/pytests/unit/modules/test_npm.py @@ -4,7 +4,6 @@ Test cases for salt.modules.npm """ - import textwrap import pytest diff --git a/tests/pytests/unit/modules/test_openbsdpkg.py b/tests/pytests/unit/modules/test_openbsdpkg.py index 33261be9464..aca6068cc48 100644 --- a/tests/pytests/unit/modules/test_openbsdpkg.py +++ b/tests/pytests/unit/modules/test_openbsdpkg.py @@ -2,7 +2,6 @@ :codeauthor: Eric Radman """ - import pytest import salt.modules.openbsdpkg as openbsdpkg diff --git a/tests/pytests/unit/modules/test_oracle.py b/tests/pytests/unit/modules/test_oracle.py index 2e578e6b5db..4aa8318d9b7 100644 --- a/tests/pytests/unit/modules/test_oracle.py +++ b/tests/pytests/unit/modules/test_oracle.py @@ -4,7 +4,6 @@ Test cases for salt.modules.oracle """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_osquery.py b/tests/pytests/unit/modules/test_osquery.py index 98ce22b25e3..20647a6dfc4 100644 --- a/tests/pytests/unit/modules/test_osquery.py +++ b/tests/pytests/unit/modules/test_osquery.py @@ -4,7 +4,6 @@ Test cases for salt.modules.osquery """ - import pytest import salt.modules.osquery as osquery diff --git a/tests/pytests/unit/modules/test_pacmanpkg.py b/tests/pytests/unit/modules/test_pacmanpkg.py index 09a6f6aef16..d3728936da9 100644 --- a/tests/pytests/unit/modules/test_pacmanpkg.py +++ b/tests/pytests/unit/modules/test_pacmanpkg.py @@ -2,7 +2,6 @@ :codeauthor: Eric Vz """ - import pytest import salt.modules.pacmanpkg as pacman diff --git a/tests/pytests/unit/modules/test_pagerduty.py b/tests/pytests/unit/modules/test_pagerduty.py index 0d4cda95868..f43df961f53 100644 --- a/tests/pytests/unit/modules/test_pagerduty.py +++ b/tests/pytests/unit/modules/test_pagerduty.py @@ -4,7 +4,6 @@ Test cases for salt.modules.pagerduty """ - import pytest import salt.modules.pagerduty as pagerduty diff --git a/tests/pytests/unit/modules/test_pam.py b/tests/pytests/unit/modules/test_pam.py index 0fd8078a560..6f1e7faf661 100644 --- a/tests/pytests/unit/modules/test_pam.py +++ b/tests/pytests/unit/modules/test_pam.py @@ -3,6 +3,7 @@ Test cases for salt.modules.pam """ + import pytest import salt.modules.pam as pam diff --git a/tests/pytests/unit/modules/test_parallels.py b/tests/pytests/unit/modules/test_parallels.py index 2d48ccb6146..6f6acb2c00a 100644 --- a/tests/pytests/unit/modules/test_parallels.py +++ b/tests/pytests/unit/modules/test_parallels.py @@ -2,7 +2,6 @@ Test parallels desktop execution module functions """ - import textwrap import pytest diff --git a/tests/pytests/unit/modules/test_pecl.py b/tests/pytests/unit/modules/test_pecl.py index 65b1235ce18..8113fb4ce64 100644 --- a/tests/pytests/unit/modules/test_pecl.py +++ b/tests/pytests/unit/modules/test_pecl.py @@ -4,7 +4,6 @@ Test cases for salt.modules.pecl """ - import pytest import salt.modules.pecl as pecl diff --git a/tests/pytests/unit/modules/test_pkgutil.py b/tests/pytests/unit/modules/test_pkgutil.py index 627c807d917..5df0044fc30 100644 --- a/tests/pytests/unit/modules/test_pkgutil.py +++ b/tests/pytests/unit/modules/test_pkgutil.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.pkgutil as pkgutil diff --git a/tests/pytests/unit/modules/test_portage_config.py b/tests/pytests/unit/modules/test_portage_config.py index 34b388a8a43..71da51390e2 100644 --- a/tests/pytests/unit/modules/test_portage_config.py +++ b/tests/pytests/unit/modules/test_portage_config.py @@ -4,6 +4,7 @@ pytest.unit.modules.portage_flags ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ + import pytest import salt.modules.portage_config as portage_config @@ -26,7 +27,7 @@ def test_get_config_file_wildcards(): ("cat/pkg::repo", "/etc/portage/package.mask/cat/pkg"), ] - for (atom, expected) in pairs: + for atom, expected in pairs: assert portage_config._get_config_file("mask", atom) == expected diff --git a/tests/pytests/unit/modules/test_postfix.py b/tests/pytests/unit/modules/test_postfix.py index e834b654473..72ed5a8d4b7 100644 --- a/tests/pytests/unit/modules/test_postfix.py +++ b/tests/pytests/unit/modules/test_postfix.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.postfix as postfix diff --git a/tests/pytests/unit/modules/test_ps.py b/tests/pytests/unit/modules/test_ps.py index ebff755e0ac..14a75446890 100644 --- a/tests/pytests/unit/modules/test_ps.py +++ b/tests/pytests/unit/modules/test_ps.py @@ -84,7 +84,9 @@ def sample_process(): patch_create_time = patch( "psutil._psplatform.Process.create_time", return_value=393829200 ) - with patch_stat_file, patch_status, patch_create_time, patch_exe, patch_oneshot, patch_kinfo: + with ( + patch_stat_file + ), patch_status, patch_create_time, patch_exe, patch_oneshot, patch_kinfo: proc = psutil.Process(pid=42) proc.info = proc.as_dict(("name", "status")) yield proc @@ -1137,7 +1139,9 @@ def test_proc_info(): patch_create_time = patch( "psutil._psplatform.Process.create_time", return_value=393829200 ) - with patch_stat_file, patch_status, patch_create_time, patch_exe, patch_oneshot, patch_kinfo: + with ( + patch_stat_file + ), patch_status, patch_create_time, patch_exe, patch_oneshot, patch_kinfo: if salt.utils.platform.is_windows(): with patch("psutil._pswindows.cext") as mock__psutil_windows: with patch("psutil._pswindows.Process.ppid", return_value=99): diff --git a/tests/pytests/unit/modules/test_publish.py b/tests/pytests/unit/modules/test_publish.py index 38731761a91..5da0902dfa7 100644 --- a/tests/pytests/unit/modules/test_publish.py +++ b/tests/pytests/unit/modules/test_publish.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.publish as publish diff --git a/tests/pytests/unit/modules/test_pw_user.py b/tests/pytests/unit/modules/test_pw_user.py index c527bcbd2df..9b1c86f1039 100644 --- a/tests/pytests/unit/modules/test_pw_user.py +++ b/tests/pytests/unit/modules/test_pw_user.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import logging import pytest diff --git a/tests/pytests/unit/modules/test_qemu_img.py b/tests/pytests/unit/modules/test_qemu_img.py index b616f6f172b..ed175d33a36 100644 --- a/tests/pytests/unit/modules/test_qemu_img.py +++ b/tests/pytests/unit/modules/test_qemu_img.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_rabbitmq.py b/tests/pytests/unit/modules/test_rabbitmq.py index b9004962b4f..13860cd33f5 100644 --- a/tests/pytests/unit/modules/test_rabbitmq.py +++ b/tests/pytests/unit/modules/test_rabbitmq.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import logging import pytest diff --git a/tests/pytests/unit/modules/test_rbenv.py b/tests/pytests/unit/modules/test_rbenv.py index ed0a535ec37..5d36acc2094 100644 --- a/tests/pytests/unit/modules/test_rbenv.py +++ b/tests/pytests/unit/modules/test_rbenv.py @@ -4,7 +4,6 @@ Test cases for salt.modules.rbenv """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_rdp.py b/tests/pytests/unit/modules/test_rdp.py index 682bd752f1b..8815b201737 100644 --- a/tests/pytests/unit/modules/test_rdp.py +++ b/tests/pytests/unit/modules/test_rdp.py @@ -4,7 +4,6 @@ Test cases for salt.modules.rdp """ - import pytest import salt.modules.rdp as rdp diff --git a/tests/pytests/unit/modules/test_restartcheck.py b/tests/pytests/unit/modules/test_restartcheck.py index 14efa9a7add..c5ce6e8a0ce 100644 --- a/tests/pytests/unit/modules/test_restartcheck.py +++ b/tests/pytests/unit/modules/test_restartcheck.py @@ -217,7 +217,11 @@ def test_when_nilinuxrt_and_not_kernel_modules_changed_or_sysapi_files_changed_a return_value=[], ) - with patch_grains, patch_kernel_versions, patch_salt, patch_sysapi_changed, patch_kernel_mod_changed, patch_del_files: + with ( + patch_grains + ), ( + patch_kernel_versions + ), patch_salt, patch_sysapi_changed, patch_kernel_mod_changed, patch_del_files: actual_result = restartcheck.restartcheck() assert actual_result == expected_result @@ -262,7 +266,11 @@ def test_when_nilinuxrt_and_not_kernel_modules_changed_or_sysapi_files_changed_a return_value=[], ) - with patch_grains, patch_kernel_versions, patch_salt, patch_sysapi_changed, patch_kernel_mod_changed, patch_del_files: + with ( + patch_grains + ), ( + patch_kernel_versions + ), patch_salt, patch_sysapi_changed, patch_kernel_mod_changed, patch_del_files: actual_result = restartcheck.restartcheck() assert actual_result == expected_result @@ -635,7 +643,9 @@ def test_valid_command_b(): patch_popen = patch("subprocess.Popen", popen_mock) patch_grains = patch.dict(restartcheck.__grains__, {"os_family": "RedHat"}) - with patch_kernel, patch_salt, patch_deleted, patch_readlink, patch_grains, patch_popen: + with ( + patch_kernel + ), patch_salt, patch_deleted, patch_readlink, patch_grains, patch_popen: ret = restartcheck.restartcheck() assert "Found 1 processes using old versions of upgraded files" in ret popen_mock.assert_called_with( diff --git a/tests/pytests/unit/modules/test_ret.py b/tests/pytests/unit/modules/test_ret.py index 85c4e539859..25d85beecfa 100644 --- a/tests/pytests/unit/modules/test_ret.py +++ b/tests/pytests/unit/modules/test_ret.py @@ -4,7 +4,6 @@ Test cases for salt.modules.ret """ - import pytest import salt.loader diff --git a/tests/pytests/unit/modules/test_rh_service.py b/tests/pytests/unit/modules/test_rh_service.py index bee9e1e0860..e6373b92e6e 100644 --- a/tests/pytests/unit/modules/test_rh_service.py +++ b/tests/pytests/unit/modules/test_rh_service.py @@ -4,7 +4,6 @@ Test cases for salt.modules.rh_service """ - import textwrap import pytest diff --git a/tests/pytests/unit/modules/test_rvm.py b/tests/pytests/unit/modules/test_rvm.py index 0125d7a42ff..dab57c2a2ff 100644 --- a/tests/pytests/unit/modules/test_rvm.py +++ b/tests/pytests/unit/modules/test_rvm.py @@ -2,7 +2,6 @@ Test cases for salt.modules.rvm """ - import pytest import salt.modules.rvm as rvm diff --git a/tests/pytests/unit/modules/test_s6.py b/tests/pytests/unit/modules/test_s6.py index 7809051f03f..a66fd62018b 100644 --- a/tests/pytests/unit/modules/test_s6.py +++ b/tests/pytests/unit/modules/test_s6.py @@ -4,7 +4,6 @@ Test cases for salt.modules.s6 """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_saltcloudmod.py b/tests/pytests/unit/modules/test_saltcloudmod.py index 54f56552329..53f2f61f77b 100644 --- a/tests/pytests/unit/modules/test_saltcloudmod.py +++ b/tests/pytests/unit/modules/test_saltcloudmod.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import pytest import salt.modules.saltcloudmod as saltcloudmod diff --git a/tests/pytests/unit/modules/test_schedule.py b/tests/pytests/unit/modules/test_schedule.py index d39ae30e5c2..1b656144162 100644 --- a/tests/pytests/unit/modules/test_schedule.py +++ b/tests/pytests/unit/modules/test_schedule.py @@ -52,7 +52,11 @@ def test_purge(job1): schedule, "list_", MagicMock(return_value=_schedule_data) ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_list: + with ( + patch_makedirs + ), ( + patch_schedule_opts + ), patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_list: assert schedule.purge() == { "comment": ["Deleted job: job1 from schedule."], "changes": {"job1": "removed"}, @@ -103,7 +107,9 @@ def test_delete(job1): SaltEvent, "get_event", return_value={"complete": True, "schedule": {}} ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: assert schedule.delete("job1") == { "comment": "Job job1 does not exist.", "changes": {}, @@ -339,7 +345,9 @@ def test_run_job(job1): return_value={"complete": True, "schedule": {"job1": job1}}, ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: assert schedule.run_job("job1") == { "comment": "Scheduling Job job1 on minion.", "result": True, @@ -365,7 +373,9 @@ def test_enable_job(): SaltEvent, "get_event", return_value={"complete": True, "schedule": {}} ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: assert schedule.enable_job("job1") == { "comment": "Job job1 does not exist.", "changes": {}, @@ -392,7 +402,9 @@ def test_disable_job(): SaltEvent, "get_event", return_value={"complete": True, "schedule": {}} ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: assert schedule.disable_job("job1") == { "comment": "Job job1 does not exist.", "changes": {}, @@ -474,7 +486,9 @@ def test_move(job1): return_value={"complete": True, "schedule": {"job1": job1}}, ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: mock = MagicMock(return_value={}) patch_schedule_publish = patch.dict( schedule.__salt__, {"publish.publish": mock} @@ -516,7 +530,9 @@ def test_move(job1): mock = MagicMock(side_effect=[{}, {"job1": {}}]) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: with patch.dict(schedule.__pillar__, {"schedule": {"job1": job1}}): mock = MagicMock(return_value={}) patch_schedule_publish = patch.dict( @@ -576,7 +592,9 @@ def test_copy(job1): return_value={"complete": True, "schedule": {"job1": job1}}, ) - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: mock = MagicMock(return_value={}) patch_schedule_publish = patch.dict( schedule.__salt__, {"publish.publish": mock} @@ -616,7 +634,9 @@ def test_copy(job1): "result": False, } - with patch_makedirs, patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event: mock = MagicMock(return_value={}) patch_schedule_publish = patch.dict( schedule.__salt__, {"publish.publish": mock} @@ -887,7 +907,9 @@ def test_is_enabled(): return_value={"complete": True, "schedule": {"job1": job1}}, ) - with patch_makedirs, patch_schedule_opts, patch_schedule_get_event, patch_schedule_salt: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_get_event, patch_schedule_salt: ret = schedule.is_enabled("job1") assert ret == job1 @@ -925,7 +947,9 @@ def test_job_status(): SaltEvent, "get_event", return_value={"complete": True, "data": job1} ) - with patch_makedirs, patch_schedule_opts, patch_schedule_get_event, patch_schedule_salt: + with ( + patch_makedirs + ), patch_schedule_opts, patch_schedule_get_event, patch_schedule_salt: ret = schedule.job_status("job1") assert ret == { "_last_run": "2021-11-01T12:36:57", @@ -978,7 +1002,11 @@ def test_list(job1): "os.path.exists", MagicMock(return_value=True) ) - with patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: + with ( + patch_schedule_opts + ), ( + patch_schedule_event_fire + ), patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: with patch( "salt.utils.files.fopen", mock_open(read_data=saved_schedule) ) as fopen_mock: @@ -1006,7 +1034,13 @@ def test_list(job1): seconds: 10 """ - with patch_schedule_opts, patch_makedirs, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_os_path_exists: + with ( + patch_schedule_opts + ), ( + patch_makedirs + ), ( + patch_schedule_event_fire + ), patch_schedule_get_event, patch_schedule_os_path_exists: with patch("salt.utils.files.fopen", mock_open(read_data="")) as fopen_mock: ret = schedule.list_() assert ret == expected @@ -1038,7 +1072,11 @@ def test_list(job1): seconds: 10 """ - with patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: + with ( + patch_schedule_opts + ), ( + patch_schedule_event_fire + ), patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: with patch( "salt.utils.files.fopen", mock_open(read_data=saved_schedule) ) as fopen_mock: @@ -1094,7 +1132,11 @@ def test_list_global_enabled(job1): "os.path.exists", MagicMock(return_value=True) ) - with patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: + with ( + patch_schedule_opts + ), ( + patch_schedule_event_fire + ), patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: with patch( "salt.utils.files.fopen", mock_open(read_data=saved_schedule) ) as fopen_mock: @@ -1151,7 +1193,11 @@ def test_list_global_disabled(job1): "os.path.exists", MagicMock(return_value=True) ) - with patch_schedule_opts, patch_schedule_event_fire, patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: + with ( + patch_schedule_opts + ), ( + patch_schedule_event_fire + ), patch_schedule_get_event, patch_schedule_os_path_exists, patch_makedirs: with patch( "salt.utils.files.fopen", mock_open(read_data=saved_schedule) ) as fopen_mock: diff --git a/tests/pytests/unit/modules/test_sdb.py b/tests/pytests/unit/modules/test_sdb.py index 01d1e1a6273..aa046d7cffe 100644 --- a/tests/pytests/unit/modules/test_sdb.py +++ b/tests/pytests/unit/modules/test_sdb.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.sdb as sdb diff --git a/tests/pytests/unit/modules/test_serverdensity_device.py b/tests/pytests/unit/modules/test_serverdensity_device.py index 6d79aefa813..5a65012c11e 100644 --- a/tests/pytests/unit/modules/test_serverdensity_device.py +++ b/tests/pytests/unit/modules/test_serverdensity_device.py @@ -4,7 +4,6 @@ TestCase for salt.modules.serverdensity_device """ - import pytest import salt.modules.serverdensity_device as serverdensity_device diff --git a/tests/pytests/unit/modules/test_servicenow.py b/tests/pytests/unit/modules/test_servicenow.py index 1971b63f653..d5e9a96ae13 100644 --- a/tests/pytests/unit/modules/test_servicenow.py +++ b/tests/pytests/unit/modules/test_servicenow.py @@ -4,7 +4,6 @@ TestCase for salt.modules.servicenow """ - import pytest import salt.modules.servicenow as servicenow diff --git a/tests/pytests/unit/modules/test_slackware_service.py b/tests/pytests/unit/modules/test_slackware_service.py index c2cd52e1a5d..93e685a0677 100644 --- a/tests/pytests/unit/modules/test_slackware_service.py +++ b/tests/pytests/unit/modules/test_slackware_service.py @@ -1,6 +1,7 @@ """ :codeauthor: Piter Punk """ + import os import pytest diff --git a/tests/pytests/unit/modules/test_smartos_imgadm.py b/tests/pytests/unit/modules/test_smartos_imgadm.py index 3f9500aaa81..111e28529dc 100644 --- a/tests/pytests/unit/modules/test_smartos_imgadm.py +++ b/tests/pytests/unit/modules/test_smartos_imgadm.py @@ -4,7 +4,6 @@ TestCase for salt.modules.smartos_imgadm module """ - import pytest import salt.modules.smartos_imgadm as imgadm diff --git a/tests/pytests/unit/modules/test_smtp.py b/tests/pytests/unit/modules/test_smtp.py index 983bb209cf2..840b6c08fbb 100644 --- a/tests/pytests/unit/modules/test_smtp.py +++ b/tests/pytests/unit/modules/test_smtp.py @@ -4,7 +4,6 @@ TestCase for salt.modules.smtp """ - import pytest import salt.modules.smtp as smtp diff --git a/tests/pytests/unit/modules/test_status.py b/tests/pytests/unit/modules/test_status.py index e0bb270df66..7b6bb6ce854 100644 --- a/tests/pytests/unit/modules/test_status.py +++ b/tests/pytests/unit/modules/test_status.py @@ -2,7 +2,6 @@ Test cases for salt.modules.status """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_suse_ip.py b/tests/pytests/unit/modules/test_suse_ip.py index b6812a0043f..7494ab57d2e 100644 --- a/tests/pytests/unit/modules/test_suse_ip.py +++ b/tests/pytests/unit/modules/test_suse_ip.py @@ -585,9 +585,7 @@ def test_build_interface_bond_mode_4(): "lacp_rate={}".format( "1" if lacp_rate == "fast" - else "0" - if lacp_rate == "slow" - else lacp_rate + else "0" if lacp_rate == "slow" else lacp_rate ), "miimon=100", "mode=4", diff --git a/tests/pytests/unit/modules/test_swift.py b/tests/pytests/unit/modules/test_swift.py index f8c0f313387..3fb5c504df8 100644 --- a/tests/pytests/unit/modules/test_swift.py +++ b/tests/pytests/unit/modules/test_swift.py @@ -4,7 +4,6 @@ Test cases for salt.modules.swift """ - import pytest import salt.modules.swift as swift diff --git a/tests/pytests/unit/modules/test_syslog_ng.py b/tests/pytests/unit/modules/test_syslog_ng.py index 5a4b2f57942..ad5d76ee475 100644 --- a/tests/pytests/unit/modules/test_syslog_ng.py +++ b/tests/pytests/unit/modules/test_syslog_ng.py @@ -2,7 +2,6 @@ Test cases for salt.modules.syslog_ng """ - import os from textwrap import dedent diff --git a/tests/pytests/unit/modules/test_system.py b/tests/pytests/unit/modules/test_system.py index d2a8a4ba9a9..c825db51cbc 100644 --- a/tests/pytests/unit/modules/test_system.py +++ b/tests/pytests/unit/modules/test_system.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.system as system diff --git a/tests/pytests/unit/modules/test_telegram.py b/tests/pytests/unit/modules/test_telegram.py index 568c01002b2..02679df4d1a 100644 --- a/tests/pytests/unit/modules/test_telegram.py +++ b/tests/pytests/unit/modules/test_telegram.py @@ -4,7 +4,6 @@ Test cases for salt.modules.telegram. """ - import pytest import salt.modules.telegram as telegram diff --git a/tests/pytests/unit/modules/test_tomcat.py b/tests/pytests/unit/modules/test_tomcat.py index 869c3f96c85..6658fca0dad 100644 --- a/tests/pytests/unit/modules/test_tomcat.py +++ b/tests/pytests/unit/modules/test_tomcat.py @@ -2,7 +2,6 @@ Tests cases for salt.modules.tomcat """ - import io import urllib.request diff --git a/tests/pytests/unit/modules/test_transactional_update.py b/tests/pytests/unit/modules/test_transactional_update.py index 5d9294c49bd..eb6dfae2868 100644 --- a/tests/pytests/unit/modules/test_transactional_update.py +++ b/tests/pytests/unit/modules/test_transactional_update.py @@ -178,9 +178,11 @@ def test_commands_with_global_params(): "--non-interactive", "--drop-if-no-change", "--no-selfupdate", - cmd.replace("_", ".") - if cmd.startswith("grub") - else cmd.replace("_", "-"), + ( + cmd.replace("_", ".") + if cmd.startswith("grub") + else cmd.replace("_", "-") + ), ] ) diff --git a/tests/pytests/unit/modules/test_tuned.py b/tests/pytests/unit/modules/test_tuned.py index 01240df03cc..561dd53990c 100644 --- a/tests/pytests/unit/modules/test_tuned.py +++ b/tests/pytests/unit/modules/test_tuned.py @@ -2,7 +2,6 @@ Test for the salt.modules.tuned """ - import pytest from salt.modules import tuned diff --git a/tests/pytests/unit/modules/test_udev.py b/tests/pytests/unit/modules/test_udev.py index d5dbee9d20f..19e055908ee 100644 --- a/tests/pytests/unit/modules/test_udev.py +++ b/tests/pytests/unit/modules/test_udev.py @@ -4,7 +4,6 @@ Test cases for salt.modules.udev """ - import pytest import salt.modules.udev as udev diff --git a/tests/pytests/unit/modules/test_uptime.py b/tests/pytests/unit/modules/test_uptime.py index 2e129a7c9bb..9857a9959f4 100644 --- a/tests/pytests/unit/modules/test_uptime.py +++ b/tests/pytests/unit/modules/test_uptime.py @@ -2,7 +2,6 @@ Test cases for salt.modules.uptime """ - import pytest import salt.modules.uptime as uptime diff --git a/tests/pytests/unit/modules/test_uwsgi.py b/tests/pytests/unit/modules/test_uwsgi.py index 5c97c191ce8..0de0995f15b 100644 --- a/tests/pytests/unit/modules/test_uwsgi.py +++ b/tests/pytests/unit/modules/test_uwsgi.py @@ -2,7 +2,6 @@ Test cases for salt.modules.uswgi """ - import pytest import salt.modules.uwsgi as uwsgi diff --git a/tests/pytests/unit/modules/test_vagrant.py b/tests/pytests/unit/modules/test_vagrant.py index 2a4b5de0b56..53566cb1a2d 100644 --- a/tests/pytests/unit/modules/test_vagrant.py +++ b/tests/pytests/unit/modules/test_vagrant.py @@ -2,7 +2,6 @@ TestCase for the salt.modules.vagrant module. """ - import pytest import salt.exceptions diff --git a/tests/pytests/unit/modules/test_vault.py b/tests/pytests/unit/modules/test_vault.py index c72c958f4f2..b9de4b941c7 100644 --- a/tests/pytests/unit/modules/test_vault.py +++ b/tests/pytests/unit/modules/test_vault.py @@ -2,7 +2,6 @@ Test case for the vault execution module """ - import pytest import salt.modules.vault as vault diff --git a/tests/pytests/unit/modules/test_vmctl.py b/tests/pytests/unit/modules/test_vmctl.py index e0935924a43..b264d99f1c7 100644 --- a/tests/pytests/unit/modules/test_vmctl.py +++ b/tests/pytests/unit/modules/test_vmctl.py @@ -2,7 +2,6 @@ Test for salt.modules.vmctl """ - import pytest import salt.modules.vmctl as vmctl diff --git a/tests/pytests/unit/modules/test_webutil.py b/tests/pytests/unit/modules/test_webutil.py index d6e9d0b466d..038e4778206 100644 --- a/tests/pytests/unit/modules/test_webutil.py +++ b/tests/pytests/unit/modules/test_webutil.py @@ -4,7 +4,6 @@ Test cases for salt.modules.webutil """ - import pytest import salt.modules.webutil as htpasswd diff --git a/tests/pytests/unit/modules/test_win_autoruns.py b/tests/pytests/unit/modules/test_win_autoruns.py index dd8060eedd8..1261a05c012 100644 --- a/tests/pytests/unit/modules/test_win_autoruns.py +++ b/tests/pytests/unit/modules/test_win_autoruns.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.modules.win_autoruns as win_autoruns diff --git a/tests/pytests/unit/modules/test_win_dns_client.py b/tests/pytests/unit/modules/test_win_dns_client.py index 8dfad4d0127..8e30c1bb58e 100644 --- a/tests/pytests/unit/modules/test_win_dns_client.py +++ b/tests/pytests/unit/modules/test_win_dns_client.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import types import pytest diff --git a/tests/pytests/unit/modules/test_win_iis.py b/tests/pytests/unit/modules/test_win_iis.py index f5e37724d24..4562f5a491e 100644 --- a/tests/pytests/unit/modules/test_win_iis.py +++ b/tests/pytests/unit/modules/test_win_iis.py @@ -2,7 +2,6 @@ Test cases for salt.modules.win_iis """ - import pytest import salt.modules.win_iis as win_iis diff --git a/tests/pytests/unit/modules/test_win_licence.py b/tests/pytests/unit/modules/test_win_licence.py index 2948be088f0..70a6cfbc490 100644 --- a/tests/pytests/unit/modules/test_win_licence.py +++ b/tests/pytests/unit/modules/test_win_licence.py @@ -2,7 +2,6 @@ Test cases for salt.modules.win_licence """ - import pytest import salt.modules.win_license as win_license diff --git a/tests/pytests/unit/modules/test_win_path.py b/tests/pytests/unit/modules/test_win_path.py index 7dad024a878..8b12653feed 100644 --- a/tests/pytests/unit/modules/test_win_path.py +++ b/tests/pytests/unit/modules/test_win_path.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import os import pytest diff --git a/tests/pytests/unit/modules/test_win_pkg.py b/tests/pytests/unit/modules/test_win_pkg.py index 9ef693a21f7..33c3325e146 100644 --- a/tests/pytests/unit/modules/test_win_pkg.py +++ b/tests/pytests/unit/modules/test_win_pkg.py @@ -1,6 +1,7 @@ """ Tests for the win_pkg module """ + import logging import pytest diff --git a/tests/pytests/unit/modules/test_win_pki.py b/tests/pytests/unit/modules/test_win_pki.py index 128fb14f820..600282e8bd8 100644 --- a/tests/pytests/unit/modules/test_win_pki.py +++ b/tests/pytests/unit/modules/test_win_pki.py @@ -2,7 +2,6 @@ Test cases for salt.modules.win_pki """ - import pytest import salt.modules.win_pki as win_pki diff --git a/tests/pytests/unit/modules/test_win_powercfg.py b/tests/pytests/unit/modules/test_win_powercfg.py index ab6f0ee6258..3fefad60804 100644 --- a/tests/pytests/unit/modules/test_win_powercfg.py +++ b/tests/pytests/unit/modules/test_win_powercfg.py @@ -2,7 +2,6 @@ Test cases for salt.modules.win_powercfg """ - import pytest import salt.modules.win_powercfg as powercfg diff --git a/tests/pytests/unit/modules/test_win_psget.py b/tests/pytests/unit/modules/test_win_psget.py index af7737b121f..417106affe8 100644 --- a/tests/pytests/unit/modules/test_win_psget.py +++ b/tests/pytests/unit/modules/test_win_psget.py @@ -2,7 +2,6 @@ Test cases for salt.modules.win_psget """ - import pytest import salt.modules.win_psget as win_psget diff --git a/tests/pytests/unit/modules/test_win_shadow.py b/tests/pytests/unit/modules/test_win_shadow.py index bccb67fe9da..dbac3807172 100644 --- a/tests/pytests/unit/modules/test_win_shadow.py +++ b/tests/pytests/unit/modules/test_win_shadow.py @@ -4,7 +4,6 @@ Test cases for salt.modules.win_shadow """ - import pytest import salt.modules.win_shadow as win_shadow diff --git a/tests/pytests/unit/modules/test_win_snmp.py b/tests/pytests/unit/modules/test_win_snmp.py index 339f834e0d8..bb8370a521a 100644 --- a/tests/pytests/unit/modules/test_win_snmp.py +++ b/tests/pytests/unit/modules/test_win_snmp.py @@ -2,7 +2,6 @@ Test cases for salt.modules.win_snmp """ - import pytest import salt.modules.win_snmp as win_snmp diff --git a/tests/pytests/unit/modules/test_win_system.py b/tests/pytests/unit/modules/test_win_system.py index a33aa3b1002..54eed432995 100644 --- a/tests/pytests/unit/modules/test_win_system.py +++ b/tests/pytests/unit/modules/test_win_system.py @@ -1,6 +1,7 @@ """ :codeauthor: Gareth J. Greenaway """ + import pytest import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/test_win_task.py b/tests/pytests/unit/modules/test_win_task.py index 6e71612264a..ee61d739b99 100644 --- a/tests/pytests/unit/modules/test_win_task.py +++ b/tests/pytests/unit/modules/test_win_task.py @@ -1,6 +1,7 @@ """ Test the win_task execution module """ + from datetime import datetime import pytest diff --git a/tests/pytests/unit/modules/test_win_timezone.py b/tests/pytests/unit/modules/test_win_timezone.py index 26a867dff85..b32b6a0187b 100644 --- a/tests/pytests/unit/modules/test_win_timezone.py +++ b/tests/pytests/unit/modules/test_win_timezone.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.win_timezone as win_timezone diff --git a/tests/pytests/unit/modules/test_win_wua.py b/tests/pytests/unit/modules/test_win_wua.py index 234574a015d..ee4db206a03 100644 --- a/tests/pytests/unit/modules/test_win_wua.py +++ b/tests/pytests/unit/modules/test_win_wua.py @@ -1,6 +1,7 @@ """ Test the win_wua execution module """ + import pytest import salt.modules.win_wua as win_wua diff --git a/tests/pytests/unit/modules/test_xapi_virt.py b/tests/pytests/unit/modules/test_xapi_virt.py index 47cdc4b6376..2f854f64cc9 100644 --- a/tests/pytests/unit/modules/test_xapi_virt.py +++ b/tests/pytests/unit/modules/test_xapi_virt.py @@ -4,7 +4,6 @@ Test cases for salt.modules.xapi """ - import pytest import salt.modules.xapi_virt as xapi diff --git a/tests/pytests/unit/modules/test_xfs.py b/tests/pytests/unit/modules/test_xfs.py index 9d1ce9dff34..79ff0dc2f34 100644 --- a/tests/pytests/unit/modules/test_xfs.py +++ b/tests/pytests/unit/modules/test_xfs.py @@ -2,7 +2,6 @@ Test cases for salt.modules.xfs """ - import textwrap import pytest diff --git a/tests/pytests/unit/modules/test_xml.py b/tests/pytests/unit/modules/test_xml.py index 334d2f2b73e..e627a5b6402 100644 --- a/tests/pytests/unit/modules/test_xml.py +++ b/tests/pytests/unit/modules/test_xml.py @@ -2,7 +2,6 @@ Tests for xml module """ - import pytest from salt.modules import xml diff --git a/tests/pytests/unit/modules/test_yumpkg.py b/tests/pytests/unit/modules/test_yumpkg.py index 188ed58ec7e..a44c35a41c6 100644 --- a/tests/pytests/unit/modules/test_yumpkg.py +++ b/tests/pytests/unit/modules/test_yumpkg.py @@ -1557,9 +1557,9 @@ def test_remove_with_epoch_and_arch_info(): installed = "8:3.8.12-4.n.el7" list_pkgs_mock = MagicMock( side_effect=lambda **kwargs: { - name_and_arch: [installed] - if kwargs.get("versions_as_list", False) - else installed + name_and_arch: ( + [installed] if kwargs.get("versions_as_list", False) else installed + ) } ) cmd_mock = MagicMock( diff --git a/tests/pytests/unit/modules/test_zenoss.py b/tests/pytests/unit/modules/test_zenoss.py index 3d03f11d770..fb2834cc484 100644 --- a/tests/pytests/unit/modules/test_zenoss.py +++ b/tests/pytests/unit/modules/test_zenoss.py @@ -2,7 +2,6 @@ Test cases for salt.modules.keystone """ - import pytest import salt.modules.config as config diff --git a/tests/pytests/unit/modules/test_zfs.py b/tests/pytests/unit/modules/test_zfs.py index a9d8a3016ec..a60a61f2aa6 100644 --- a/tests/pytests/unit/modules/test_zfs.py +++ b/tests/pytests/unit/modules/test_zfs.py @@ -215,9 +215,9 @@ def test_create_error_missing_parent(utils_patch): ) ret = {} ret["stdout"] = "" - ret[ - "stderr" - ] = "cannot create 'myzpool/mydataset/mysubdataset': parent does not exist" + ret["stderr"] = ( + "cannot create 'myzpool/mydataset/mysubdataset': parent does not exist" + ) ret["retcode"] = 1 mock_cmd = MagicMock(return_value=ret) with patch.dict(zfs.__salt__, {"cmd.run_all": mock_cmd}), patch.dict( diff --git a/tests/pytests/unit/modules/test_znc.py b/tests/pytests/unit/modules/test_znc.py index a28f8f1ca26..1cf491e5b0a 100644 --- a/tests/pytests/unit/modules/test_znc.py +++ b/tests/pytests/unit/modules/test_znc.py @@ -4,7 +4,6 @@ TestCase for salt.modules.znc """ - import pytest import salt.modules.znc as znc diff --git a/tests/pytests/unit/modules/test_zpool.py b/tests/pytests/unit/modules/test_zpool.py index 48fcf9e272c..f3256db0b8c 100644 --- a/tests/pytests/unit/modules/test_zpool.py +++ b/tests/pytests/unit/modules/test_zpool.py @@ -469,9 +469,9 @@ def test_split_not_mirror(utils_patch): """ ret = {} ret["stdout"] = "" - ret[ - "stderr" - ] = "Unable to split datapool: Source pool must be composed only of mirrors" + ret["stderr"] = ( + "Unable to split datapool: Source pool must be composed only of mirrors" + ) ret["retcode"] = 1 mock_cmd = MagicMock(return_value=ret) diff --git a/tests/pytests/unit/modules/test_zypperpkg.py b/tests/pytests/unit/modules/test_zypperpkg.py index 1e2d6ea443a..4a6357cc753 100644 --- a/tests/pytests/unit/modules/test_zypperpkg.py +++ b/tests/pytests/unit/modules/test_zypperpkg.py @@ -2,7 +2,6 @@ :codeauthor: Gareth J. Greenaway """ - import os import textwrap diff --git a/tests/pytests/unit/modules/virt/test_domain.py b/tests/pytests/unit/modules/virt/test_domain.py index 1d1a3d1849a..00e74f01d15 100644 --- a/tests/pytests/unit/modules/virt/test_domain.py +++ b/tests/pytests/unit/modules/virt/test_domain.py @@ -1946,9 +1946,11 @@ def test_update_disks(make_mock_vm): ] == 'qemu-img create -f qcow2 "{}" 2048M'.format(added_disk_path) assert mock_chmod.call_args[0][0] == added_disk_path assert [ - ET.fromstring(disk).find("source").get("file") - if str(disk).find(" -1 - else None + ( + ET.fromstring(disk).find("source").get("file") + if str(disk).find(" -1 + else None + ) for disk in ret["disk"]["attached"] ] == [None, os.path.join(root_dir, "my_vm_added.qcow2")] @@ -2018,9 +2020,11 @@ def test_update_disks_existing_block(make_mock_vm): ], ) assert [ - ET.fromstring(disk).find("source").get("file") - if str(disk).find(" -1 - else None + ( + ET.fromstring(disk).find("source").get("file") + if str(disk).find(" -1 + else None + ) for disk in ret["disk"]["attached"] ] == ["/dev/ssd/data"] diff --git a/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py b/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py index 56eecd4bbc2..cc178662b63 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py +++ b/tests/pytests/unit/modules/win_lgpo/test_admx_policies.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import glob import logging import os diff --git a/tests/pytests/unit/modules/win_lgpo/test_defined_policies.py b/tests/pytests/unit/modules/win_lgpo/test_defined_policies.py index 9acfc0f141c..7b3366eff8c 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_defined_policies.py +++ b/tests/pytests/unit/modules/win_lgpo/test_defined_policies.py @@ -1,6 +1,7 @@ """ This tests policies that are defined in the giant dictionary in the LGPO module """ + import pytest import salt.modules.win_file as win_file diff --git a/tests/pytests/unit/modules/win_lgpo/test_mechanisms.py b/tests/pytests/unit/modules/win_lgpo/test_mechanisms.py index b9d659acb5f..5ce9ce2a4fb 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_mechanisms.py +++ b/tests/pytests/unit/modules/win_lgpo/test_mechanisms.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import os import pytest diff --git a/tests/pytests/unit/modules/win_lgpo/test_point_print_enabled.py b/tests/pytests/unit/modules/win_lgpo/test_point_print_enabled.py index 88b1c05b4e7..4d39311f8e4 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_point_print_enabled.py +++ b/tests/pytests/unit/modules/win_lgpo/test_point_print_enabled.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import pytest import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/win_lgpo/test_point_print_nc.py b/tests/pytests/unit/modules/win_lgpo/test_point_print_nc.py index 174ca38fb50..2196c7624c3 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_point_print_nc.py +++ b/tests/pytests/unit/modules/win_lgpo/test_point_print_nc.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import pytest import salt.config diff --git a/tests/pytests/unit/modules/win_lgpo/test_policy_info.py b/tests/pytests/unit/modules/win_lgpo/test_policy_info.py index d0ed3c911a3..a11bf800dc0 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_policy_info.py +++ b/tests/pytests/unit/modules/win_lgpo/test_policy_info.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import pytest import salt.modules.win_file as win_file diff --git a/tests/pytests/unit/modules/win_lgpo/test_policy_info_functions.py b/tests/pytests/unit/modules/win_lgpo/test_policy_info_functions.py index bedacc237fb..2c3bb255212 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_policy_info_functions.py +++ b/tests/pytests/unit/modules/win_lgpo/test_policy_info_functions.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import pytest import salt.modules.win_lgpo as win_lgpo diff --git a/tests/pytests/unit/modules/win_lgpo/test_policy_resources.py b/tests/pytests/unit/modules/win_lgpo/test_policy_resources.py index b7a6618f47e..8d49468792a 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_policy_resources.py +++ b/tests/pytests/unit/modules/win_lgpo/test_policy_resources.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import pytest import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/win_lgpo/test_reg_pol.py b/tests/pytests/unit/modules/win_lgpo/test_reg_pol.py index 79c8a10393c..ae7a2a55f8a 100644 --- a/tests/pytests/unit/modules/win_lgpo/test_reg_pol.py +++ b/tests/pytests/unit/modules/win_lgpo/test_reg_pol.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import pytest import salt.modules.win_lgpo as win_lgpo diff --git a/tests/pytests/unit/output/test_json_out.py b/tests/pytests/unit/output/test_json_out.py index 229315b31fe..3ade8e44e7c 100644 --- a/tests/pytests/unit/output/test_json_out.py +++ b/tests/pytests/unit/output/test_json_out.py @@ -1,6 +1,7 @@ """ unittests for json outputter """ + import pytest import salt.output.json_out as json_out diff --git a/tests/pytests/unit/output/test_nested.py b/tests/pytests/unit/output/test_nested.py index c56faf89672..4e85ff623cb 100644 --- a/tests/pytests/unit/output/test_nested.py +++ b/tests/pytests/unit/output/test_nested.py @@ -1,6 +1,7 @@ """ Unit tests for the Nested outputter """ + import pytest import salt.output.nested as nested diff --git a/tests/pytests/unit/output/test_yaml_out.py b/tests/pytests/unit/output/test_yaml_out.py index 6a87fd667c2..53380cc2c9a 100644 --- a/tests/pytests/unit/output/test_yaml_out.py +++ b/tests/pytests/unit/output/test_yaml_out.py @@ -1,6 +1,7 @@ """ unittests for yaml outputter """ + import pytest import salt.output.yaml_out as yaml diff --git a/tests/pytests/unit/pillar/test_csvpillar.py b/tests/pytests/unit/pillar/test_csvpillar.py index 82d270b0d43..cbb411ca9c2 100644 --- a/tests/pytests/unit/pillar/test_csvpillar.py +++ b/tests/pytests/unit/pillar/test_csvpillar.py @@ -1,6 +1,5 @@ """test for pillar csvpillar.py""" - import salt.pillar.csvpillar as csvpillar from tests.support.mock import mock_open, patch diff --git a/tests/pytests/unit/proxy/nxos/test_nxos_nxapi.py b/tests/pytests/unit/proxy/nxos/test_nxos_nxapi.py index 7b703f4f901..8e632649ac1 100644 --- a/tests/pytests/unit/proxy/nxos/test_nxos_nxapi.py +++ b/tests/pytests/unit/proxy/nxos/test_nxos_nxapi.py @@ -32,7 +32,6 @@ def configure_loader_modules(): def test_check_virtual(): - """UT: nxos module:check_virtual method - return value""" result = nxos_proxy.__virtual__() @@ -40,7 +39,6 @@ def test_check_virtual(): def test_init(): - """UT: nxos module:init method - nxapi proxy""" with patch.object(nxos_proxy, "__opts__", {"proxy": {"connection": "nxapi"}}): @@ -50,7 +48,6 @@ def test_init(): def test_init_opts_none(): - """UT: nxos module:init method - __opts__ connection is None""" with patch.object(nxos_proxy, "__opts__", {"proxy": {"connection": None}}): @@ -60,14 +57,12 @@ def test_init_opts_none(): def test_init_bad_connection_type(): - """UT: nxos module:init method - bad CONNECTION type""" with patch.object(nxos_proxy, "__opts__", {"proxy": {"connection": "unknown"}}): assert not nxos_proxy.init() def test_initialized(): - """UT: nxos module:initialized method - nxapi proxy""" with patch( @@ -78,7 +73,6 @@ def test_initialized(): def test_ping(): - """UT: nxos module:ping method - nxapi proxy""" with patch("salt.proxy.nxos._ping_nxapi", autospec=True) as ping_nxapi: @@ -87,7 +81,6 @@ def test_ping(): def test_grains(): - """UT: nxos module:grains method - nxapi grains""" with patch( @@ -98,7 +91,6 @@ def test_grains(): def test_grains_cache_set(): - """UT: nxos module:grains method - nxapi grains cache set""" with patch("salt.proxy.nxos.DEVICE_DETAILS", {"grains_cache": n9k_grains["nxos"]}): @@ -112,7 +104,6 @@ def test_grains_cache_set(): def test_grains_refresh(): - """UT: nxos module:grains_refresh method - nxapi grains""" device_details = {"grains_cache": None} @@ -125,7 +116,6 @@ def test_grains_refresh(): def test_sendline(): - """UT: nxos module:sendline method - nxapi""" command = "show version" @@ -136,7 +126,6 @@ def test_sendline(): def test_proxy_config(): - """UT: nxos module:proxy_config method - nxapi success path""" commands = ["feature bgp", "router bgp 65535"] @@ -148,7 +137,6 @@ def test_proxy_config(): def test_proxy_config_save_config(): - """UT: nxos module:proxy_config method - nxapi success path""" commands = ["feature bgp", "router bgp 65535"] @@ -160,7 +148,6 @@ def test_proxy_config_save_config(): def test__init_nxapi(): - """UT: nxos module:_init_nxapi method - successful connectinon""" opts = {"proxy": {"arg1": None}} @@ -194,7 +181,6 @@ def test_bad__init_nxapi(): def test__initialized_nxapi(): - """UT: nxos module:_initialized_nxapi method""" result = nxos_proxy._initialized_nxapi() @@ -206,7 +192,6 @@ def test__initialized_nxapi(): def test__ping_nxapi(): - """UT: nxos module:_ping_nxapi method""" result = nxos_proxy._ping_nxapi() @@ -218,7 +203,6 @@ def test__ping_nxapi(): def test__shutdown_nxapi(): - """UT: nxos module:_shutdown_nxapi method""" opts = {"id": "value"} @@ -229,7 +213,6 @@ def test__shutdown_nxapi(): def test__nxapi_request_ssh_return(): - """UT: nxos module:_nxapi_request method - CONNECTION == 'ssh'""" commands = "show version" @@ -240,7 +223,6 @@ def test__nxapi_request_ssh_return(): def test__nxapi_request_connect(): - """UT: nxos module:_nxapi_request method""" commands = "show version" diff --git a/tests/pytests/unit/proxy/nxos/test_nxos_ssh.py b/tests/pytests/unit/proxy/nxos/test_nxos_ssh.py index ef14addbdf9..b6f4f991ad4 100644 --- a/tests/pytests/unit/proxy/nxos/test_nxos_ssh.py +++ b/tests/pytests/unit/proxy/nxos/test_nxos_ssh.py @@ -42,7 +42,6 @@ def configure_loader_modules(): def test_init(): - """UT: nxos module:init method - ssh proxy""" with patch("salt.proxy.nxos._init_ssh", autospec=True) as init_ssh: @@ -51,7 +50,6 @@ def test_init(): def test_init_opts_none(): - """UT: nxos module:init method - __opts__ connection is None""" with patch("salt.proxy.nxos.__opts__", {"proxy": {"connection": None}}): @@ -61,7 +59,6 @@ def test_init_opts_none(): def test_initialized(): - """UT: nxos module:initialized method - ssh proxy""" with patch("salt.proxy.nxos._initialized_ssh", autospec=True) as initialized_ssh: @@ -70,7 +67,6 @@ def test_initialized(): def test_ping(): - """UT: nxos module:ping method - ssh proxy""" with patch("salt.proxy.nxos._ping_ssh", autospec=True) as ping_ssh: @@ -79,7 +75,6 @@ def test_ping(): def test_grains(): - """UT: nxos module:grains method - ssh grains""" with patch( @@ -90,7 +85,6 @@ def test_grains(): def test_sendline(): - """UT: nxos module:sendline method - nxapi""" command = "show version" @@ -101,7 +95,6 @@ def test_sendline(): def test_proxy_config(): - """UT: nxos module:proxy_config method - ssh success path""" commands = ["feature bgp", "router bgp 65535"] @@ -113,7 +106,6 @@ def test_proxy_config(): def test_proxy_config_save_config(): - """UT: nxos module:proxy_config method - ssh success path""" commands = ["feature bgp", "router bgp 65535"] @@ -125,7 +117,6 @@ def test_proxy_config_save_config(): def test_proxy_config_error(): - """UT: nxos module:proxy_config method - CommandExecutionError""" with patch( @@ -156,7 +147,6 @@ def test__init_ssh_device_details(): def test__init_ssh_opts(): - """UT: nxos module:_init_ssh method - successful connectinon""" with patch("salt.proxy.nxos.DEVICE_DETAILS", {}): @@ -174,7 +164,6 @@ def test__init_ssh_opts(): def test__init_ssh_prompt(): - """UT: nxos module:_init_ssh method - prompt regex""" with patch("salt.proxy.nxos.DEVICE_DETAILS", {}): @@ -198,7 +187,6 @@ def test__init_ssh_prompt(): def test__initialized_ssh(): - """UT: nxos module:_initialized_ssh method""" with patch("salt.proxy.nxos.DEVICE_DETAILS", {"initialized": True}): @@ -211,7 +199,6 @@ def test__initialized_ssh(): def test__parse_output_for_errors(): - """UT: nxos module:_parse_output_for_errors method""" data = "% Incomplete command at '^' marker." @@ -246,7 +233,6 @@ def test__parse_output_for_errors(): def test__init_ssh_raise_exception(): - """UT: nxos module:_init_ssh method - raise exception""" class SSHException(Exception): diff --git a/tests/pytests/unit/proxy/test_esxdatacenter.py b/tests/pytests/unit/proxy/test_esxdatacenter.py index bcba6514af5..1142626e675 100644 --- a/tests/pytests/unit/proxy/test_esxdatacenter.py +++ b/tests/pytests/unit/proxy/test_esxdatacenter.py @@ -3,6 +3,7 @@ Tests for esxdatacenter proxy """ + import pytest import salt.exceptions diff --git a/tests/pytests/unit/proxy/test_napalm.py b/tests/pytests/unit/proxy/test_napalm.py index 2a537b8d61e..dbf108b6977 100644 --- a/tests/pytests/unit/proxy/test_napalm.py +++ b/tests/pytests/unit/proxy/test_napalm.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`Anthony Shaw ` """ + import pytest import salt.proxy.napalm as napalm_proxy diff --git a/tests/pytests/unit/renderers/test_aws_kms.py b/tests/pytests/unit/renderers/test_aws_kms.py index 9770531633f..8562d9f3e16 100644 --- a/tests/pytests/unit/renderers/test_aws_kms.py +++ b/tests/pytests/unit/renderers/test_aws_kms.py @@ -1,6 +1,7 @@ """ Unit tests for AWS KMS Decryption Renderer. """ + import pytest import salt.exceptions diff --git a/tests/pytests/unit/returners/test_elasticsearch_return.py b/tests/pytests/unit/returners/test_elasticsearch_return.py index 9b8940bc8f3..8c711d32c97 100644 --- a/tests/pytests/unit/returners/test_elasticsearch_return.py +++ b/tests/pytests/unit/returners/test_elasticsearch_return.py @@ -1,6 +1,7 @@ """ Test the elasticsearch returner """ + import pytest import salt.returners.elasticsearch_return as elasticsearch_return diff --git a/tests/pytests/unit/returners/test_pgjsonb.py b/tests/pytests/unit/returners/test_pgjsonb.py index 92abcddd7a8..d0c2bf83a5c 100644 --- a/tests/pytests/unit/returners/test_pgjsonb.py +++ b/tests/pytests/unit/returners/test_pgjsonb.py @@ -2,7 +2,6 @@ Unit tests for the PGJsonb returner (pgjsonb). """ - import pytest import salt.returners.pgjsonb as pgjsonb diff --git a/tests/pytests/unit/returners/test_slack_webhook_return.py b/tests/pytests/unit/returners/test_slack_webhook_return.py index 0cfc7df00c0..0846680f6c1 100644 --- a/tests/pytests/unit/returners/test_slack_webhook_return.py +++ b/tests/pytests/unit/returners/test_slack_webhook_return.py @@ -3,6 +3,7 @@ Unit tests for the Slack Webhook Returner. """ + import pytest import salt.returners.slack_webhook_return as slack_webhook diff --git a/tests/pytests/unit/returners/test_smtp_return.py b/tests/pytests/unit/returners/test_smtp_return.py index 67ad2c877f8..61045bb548b 100644 --- a/tests/pytests/unit/returners/test_smtp_return.py +++ b/tests/pytests/unit/returners/test_smtp_return.py @@ -3,6 +3,7 @@ Test SMTP returner """ + import pytest import salt.returners.smtp_return as smtp diff --git a/tests/pytests/unit/returners/test_syslog_return.py b/tests/pytests/unit/returners/test_syslog_return.py index 8f8de24e18e..c4879c4c07f 100644 --- a/tests/pytests/unit/returners/test_syslog_return.py +++ b/tests/pytests/unit/returners/test_syslog_return.py @@ -3,6 +3,7 @@ :codeauthor: :email:`Megan Wilhite (mwilhite@saltstack.com)` """ + import pytest import salt.returners.syslog_return as syslog diff --git a/tests/pytests/unit/returners/test_telegram_return.py b/tests/pytests/unit/returners/test_telegram_return.py index 0502b6975a9..23cbec36ea5 100644 --- a/tests/pytests/unit/returners/test_telegram_return.py +++ b/tests/pytests/unit/returners/test_telegram_return.py @@ -3,6 +3,7 @@ :codeauthor: :email:`Roald Nefs (info@roaldnefs.com)` """ + import pytest import salt.returners.telegram_return as telegram diff --git a/tests/pytests/unit/roster/test_dir.py b/tests/pytests/unit/roster/test_dir.py index 72279119357..aa85ed8f72e 100644 --- a/tests/pytests/unit/roster/test_dir.py +++ b/tests/pytests/unit/roster/test_dir.py @@ -2,7 +2,6 @@ Test the directory roster. """ - import logging import pytest diff --git a/tests/pytests/unit/roster/test_terraform.py b/tests/pytests/unit/roster/test_terraform.py index b79d7985461..596c5723407 100644 --- a/tests/pytests/unit/roster/test_terraform.py +++ b/tests/pytests/unit/roster/test_terraform.py @@ -1,6 +1,7 @@ """ unittests for terraform roster """ + import pathlib import pytest diff --git a/tests/pytests/unit/runners/test_bgp.py b/tests/pytests/unit/runners/test_bgp.py index 4eeb32538e9..620e162a412 100644 --- a/tests/pytests/unit/runners/test_bgp.py +++ b/tests/pytests/unit/runners/test_bgp.py @@ -1,6 +1,7 @@ """ Test the bgp runner """ + import pytest import salt.runners.bgp as bgp diff --git a/tests/pytests/unit/runners/test_fileserver.py b/tests/pytests/unit/runners/test_fileserver.py index a258ace46ca..4ba6d7c0261 100644 --- a/tests/pytests/unit/runners/test_fileserver.py +++ b/tests/pytests/unit/runners/test_fileserver.py @@ -2,7 +2,6 @@ unit tests for the fileserver runner """ - import pytest import salt.loader diff --git a/tests/pytests/unit/runners/test_git_pillar.py b/tests/pytests/unit/runners/test_git_pillar.py index 958d8372360..9edabb64648 100644 --- a/tests/pytests/unit/runners/test_git_pillar.py +++ b/tests/pytests/unit/runners/test_git_pillar.py @@ -2,7 +2,6 @@ unit tests for the git_pillar runner """ - import logging import pytest diff --git a/tests/pytests/unit/runners/test_jobs.py b/tests/pytests/unit/runners/test_jobs.py index a1146e7f7d0..8d9fe3853a7 100644 --- a/tests/pytests/unit/runners/test_jobs.py +++ b/tests/pytests/unit/runners/test_jobs.py @@ -1,6 +1,7 @@ """ unit tests for the jobs runner """ + import pytest import salt.minion diff --git a/tests/pytests/unit/runners/test_network.py b/tests/pytests/unit/runners/test_network.py index 6d16d54eb94..9531d4ff8e0 100644 --- a/tests/pytests/unit/runners/test_network.py +++ b/tests/pytests/unit/runners/test_network.py @@ -1,6 +1,7 @@ """ Unit tests for Network runner """ + import logging import pytest diff --git a/tests/pytests/unit/runners/test_reactor.py b/tests/pytests/unit/runners/test_reactor.py index 545caa5147d..cc8e370f73c 100644 --- a/tests/pytests/unit/runners/test_reactor.py +++ b/tests/pytests/unit/runners/test_reactor.py @@ -2,7 +2,6 @@ unit tests for the reactor runner """ - import logging import pytest diff --git a/tests/pytests/unit/runners/test_spacewalk.py b/tests/pytests/unit/runners/test_spacewalk.py index c6bacd4b117..410b3dc290c 100644 --- a/tests/pytests/unit/runners/test_spacewalk.py +++ b/tests/pytests/unit/runners/test_spacewalk.py @@ -1,6 +1,7 @@ """ Unit tests for Spacewalk runner """ + import salt.runners.spacewalk as spacewalk from tests.support.mock import Mock, call, patch diff --git a/tests/pytests/unit/runners/test_winrepo.py b/tests/pytests/unit/runners/test_winrepo.py index aecdaaf10a4..4245ba453ac 100644 --- a/tests/pytests/unit/runners/test_winrepo.py +++ b/tests/pytests/unit/runners/test_winrepo.py @@ -2,7 +2,6 @@ Test the winrepo runner """ - import textwrap import pytest diff --git a/tests/pytests/unit/runners/vault/test_app_role_auth.py b/tests/pytests/unit/runners/vault/test_app_role_auth.py index 14d5dc77ef7..0680726623c 100644 --- a/tests/pytests/unit/runners/vault/test_app_role_auth.py +++ b/tests/pytests/unit/runners/vault/test_app_role_auth.py @@ -2,7 +2,6 @@ Unit tests for the Vault runner """ - import logging import pytest diff --git a/tests/pytests/unit/runners/vault/test_token_auth.py b/tests/pytests/unit/runners/vault/test_token_auth.py index fcd0ef8058b..034b3db9516 100644 --- a/tests/pytests/unit/runners/vault/test_token_auth.py +++ b/tests/pytests/unit/runners/vault/test_token_auth.py @@ -2,7 +2,6 @@ Unit tests for the Vault runner """ - import logging import pytest diff --git a/tests/pytests/unit/runners/vault/test_vault.py b/tests/pytests/unit/runners/vault/test_vault.py index 3634e862e8e..de15c62f2f4 100644 --- a/tests/pytests/unit/runners/vault/test_vault.py +++ b/tests/pytests/unit/runners/vault/test_vault.py @@ -2,7 +2,6 @@ Unit tests for the Vault runner """ - import logging import pytest diff --git a/tests/pytests/unit/sdb/test_yaml.py b/tests/pytests/unit/sdb/test_yaml.py index 102bf4881b2..d6a505178af 100644 --- a/tests/pytests/unit/sdb/test_yaml.py +++ b/tests/pytests/unit/sdb/test_yaml.py @@ -2,7 +2,6 @@ Test case for the YAML SDB module """ - import salt.sdb.yaml as sdb from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/state/test_state_basic.py b/tests/pytests/unit/state/test_state_basic.py index a8a56fba82b..c76a8b950ad 100644 --- a/tests/pytests/unit/state/test_state_basic.py +++ b/tests/pytests/unit/state/test_state_basic.py @@ -1,6 +1,7 @@ """ Test functions in state.py that are not a part of a class """ + import pytest import salt.state diff --git a/tests/pytests/unit/states/file/test__clean_dir.py b/tests/pytests/unit/states/file/test__clean_dir.py index 43504105a31..7602ba6f93d 100644 --- a/tests/pytests/unit/states/file/test__clean_dir.py +++ b/tests/pytests/unit/states/file/test__clean_dir.py @@ -1,6 +1,7 @@ """ Tests for _clean_dir function """ + import pytest import salt.states.file as file diff --git a/tests/pytests/unit/states/file/test_retention_schedule.py b/tests/pytests/unit/states/file/test_retention_schedule.py index 3e9179afcbf..7fd57195a25 100644 --- a/tests/pytests/unit/states/file/test_retention_schedule.py +++ b/tests/pytests/unit/states/file/test_retention_schedule.py @@ -209,16 +209,14 @@ def test_retention_schedule(): } if test: expected_ret["result"] = None - expected_ret[ - "comment" - ] = "{} backups would have been removed from {}.\n" "".format( - len(deleted_files), fake_name + expected_ret["comment"] = ( + "{} backups would have been removed from {}.\n" + "".format(len(deleted_files), fake_name) ) else: - expected_ret[ - "comment" - ] = "{} backups were removed from {}.\n" "".format( - len(deleted_files), fake_name + expected_ret["comment"] = ( + "{} backups were removed from {}.\n" + "".format(len(deleted_files), fake_name) ) mock_remove.assert_has_calls( [call(os.path.join(fake_name, x)) for x in deleted_files], diff --git a/tests/pytests/unit/states/mysql/test_database.py b/tests/pytests/unit/states/mysql/test_database.py index 4176d85fb88..5eb78a9f318 100644 --- a/tests/pytests/unit/states/mysql/test_database.py +++ b/tests/pytests/unit/states/mysql/test_database.py @@ -1,6 +1,7 @@ """ This test checks mysql_database salt state """ + import pytest import salt.states.mysql_database as mysql_database diff --git a/tests/pytests/unit/states/test_aptpkg.py b/tests/pytests/unit/states/test_aptpkg.py index fb36e377800..843fd4ff88f 100644 --- a/tests/pytests/unit/states/test_aptpkg.py +++ b/tests/pytests/unit/states/test_aptpkg.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import pytest import salt.states.aptpkg as aptpkg diff --git a/tests/pytests/unit/states/test_archive.py b/tests/pytests/unit/states/test_archive.py index 178f00b83a1..d7d2171e27e 100644 --- a/tests/pytests/unit/states/test_archive.py +++ b/tests/pytests/unit/states/test_archive.py @@ -2,7 +2,6 @@ :codeauthor: Alexander Schwartz """ - import os import pytest diff --git a/tests/pytests/unit/states/test_aws_sqs.py b/tests/pytests/unit/states/test_aws_sqs.py index dd132c88420..c5f0f68c849 100644 --- a/tests/pytests/unit/states/test_aws_sqs.py +++ b/tests/pytests/unit/states/test_aws_sqs.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.aws_sqs as aws_sqs diff --git a/tests/pytests/unit/states/test_boto_cloudfront.py b/tests/pytests/unit/states/test_boto_cloudfront.py index fef82fcda2c..634d316cbd6 100644 --- a/tests/pytests/unit/states/test_boto_cloudfront.py +++ b/tests/pytests/unit/states/test_boto_cloudfront.py @@ -1,6 +1,7 @@ """ Unit tests for the boto_cloudfront state module. """ + import copy import textwrap diff --git a/tests/pytests/unit/states/test_boto_lc.py b/tests/pytests/unit/states/test_boto_lc.py index ab44a58f586..604af3bd6a7 100644 --- a/tests/pytests/unit/states/test_boto_lc.py +++ b/tests/pytests/unit/states/test_boto_lc.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.boto_lc as boto_lc diff --git a/tests/pytests/unit/states/test_boto_route53.py b/tests/pytests/unit/states/test_boto_route53.py index 7d0f125223b..ff3fce60ef9 100644 --- a/tests/pytests/unit/states/test_boto_route53.py +++ b/tests/pytests/unit/states/test_boto_route53.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.boto_route53 as boto53mod diff --git a/tests/pytests/unit/states/test_boto_sns.py b/tests/pytests/unit/states/test_boto_sns.py index d6fbdcee059..0db5d1db9cb 100644 --- a/tests/pytests/unit/states/test_boto_sns.py +++ b/tests/pytests/unit/states/test_boto_sns.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.boto_sns as boto_sns diff --git a/tests/pytests/unit/states/test_boto_sqs.py b/tests/pytests/unit/states/test_boto_sqs.py index 25175463eda..de8a8e9954f 100644 --- a/tests/pytests/unit/states/test_boto_sqs.py +++ b/tests/pytests/unit/states/test_boto_sqs.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import textwrap import pytest diff --git a/tests/pytests/unit/states/test_bower.py b/tests/pytests/unit/states/test_bower.py index f375f6ab58c..7a019d787b4 100644 --- a/tests/pytests/unit/states/test_bower.py +++ b/tests/pytests/unit/states/test_bower.py @@ -1,6 +1,7 @@ """ :codeauthor: Alexander Pyatkin """ + import pytest import salt.states.bower as bower diff --git a/tests/pytests/unit/states/test_chocolatey.py b/tests/pytests/unit/states/test_chocolatey.py index 5f24d3cb9ae..660ba4b61b2 100644 --- a/tests/pytests/unit/states/test_chocolatey.py +++ b/tests/pytests/unit/states/test_chocolatey.py @@ -1,6 +1,7 @@ """ Unit tests for chocolatey state """ + import logging import pytest diff --git a/tests/pytests/unit/states/test_consul.py b/tests/pytests/unit/states/test_consul.py index 02367458356..816278fa385 100644 --- a/tests/pytests/unit/states/test_consul.py +++ b/tests/pytests/unit/states/test_consul.py @@ -2,7 +2,6 @@ Test case for the consul state module """ - import logging import pytest diff --git a/tests/pytests/unit/states/test_debconfmod.py b/tests/pytests/unit/states/test_debconfmod.py index eae21c97535..3151e84275f 100644 --- a/tests/pytests/unit/states/test_debconfmod.py +++ b/tests/pytests/unit/states/test_debconfmod.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.debconfmod as debconfmod diff --git a/tests/pytests/unit/states/test_drac.py b/tests/pytests/unit/states/test_drac.py index 71f95396e25..57d60f9fdc7 100644 --- a/tests/pytests/unit/states/test_drac.py +++ b/tests/pytests/unit/states/test_drac.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.drac as drac diff --git a/tests/pytests/unit/states/test_elasticsearch.py b/tests/pytests/unit/states/test_elasticsearch.py index b3d55e1df41..89e84b1bb9f 100644 --- a/tests/pytests/unit/states/test_elasticsearch.py +++ b/tests/pytests/unit/states/test_elasticsearch.py @@ -1,6 +1,7 @@ """ :codeauthor: Lukas Raska """ + import pytest import salt.utils.dictdiffer as dictdiffer diff --git a/tests/pytests/unit/states/test_eselect.py b/tests/pytests/unit/states/test_eselect.py index 02eed1a319d..831514e376d 100644 --- a/tests/pytests/unit/states/test_eselect.py +++ b/tests/pytests/unit/states/test_eselect.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.eselect as eselect diff --git a/tests/pytests/unit/states/test_etcd_mod.py b/tests/pytests/unit/states/test_etcd_mod.py index e8fde7c48f1..17df492a1c0 100644 --- a/tests/pytests/unit/states/test_etcd_mod.py +++ b/tests/pytests/unit/states/test_etcd_mod.py @@ -9,7 +9,6 @@ :codeauthor: Caleb Beard """ - import pytest import salt.states.etcd_mod as etcd_state diff --git a/tests/pytests/unit/states/test_ethtool.py b/tests/pytests/unit/states/test_ethtool.py index c0f5267f811..dcf119fb417 100644 --- a/tests/pytests/unit/states/test_ethtool.py +++ b/tests/pytests/unit/states/test_ethtool.py @@ -51,9 +51,9 @@ def test_ethtool_pause(): with patch.dict(ethtool.__opts__, {"test": True}): expected["result"] = None expected["changes"] = {} - expected[ - "comment" - ] = "Device eth0 pause parameters are set to be updated:\nautoneg: off\nrx: off\ntx: off" + expected["comment"] = ( + "Device eth0 pause parameters are set to be updated:\nautoneg: off\nrx: off\ntx: off" + ) ret = ethtool.pause("eth0", autoneg=False, rx=False, tx=False) assert ret == expected mock_set.assert_not_called() diff --git a/tests/pytests/unit/states/test_gem.py b/tests/pytests/unit/states/test_gem.py index 6d3a7ac001d..ab054904593 100644 --- a/tests/pytests/unit/states/test_gem.py +++ b/tests/pytests/unit/states/test_gem.py @@ -2,7 +2,6 @@ Tests of salt.states.gem """ - import pytest import salt.states.gem as gem diff --git a/tests/pytests/unit/states/test_git.py b/tests/pytests/unit/states/test_git.py index 7410239bac1..b9e9f7b6460 100644 --- a/tests/pytests/unit/states/test_git.py +++ b/tests/pytests/unit/states/test_git.py @@ -4,7 +4,6 @@ :codeauthor: Erik Johnson """ - import logging import pytest diff --git a/tests/pytests/unit/states/test_gnomedesktop.py b/tests/pytests/unit/states/test_gnomedesktop.py index 0229e734592..fd089bdc5a5 100644 --- a/tests/pytests/unit/states/test_gnomedesktop.py +++ b/tests/pytests/unit/states/test_gnomedesktop.py @@ -4,7 +4,6 @@ Test cases for salt.states.gnomedesktop """ - import pytest import salt.states.gnomedesktop as gnomedesktop diff --git a/tests/pytests/unit/states/test_grains.py b/tests/pytests/unit/states/test_grains.py index 8015eaf9340..a2df4028244 100644 --- a/tests/pytests/unit/states/test_grains.py +++ b/tests/pytests/unit/states/test_grains.py @@ -1,6 +1,7 @@ """ unit tests for the grains state """ + import contextlib import os diff --git a/tests/pytests/unit/states/test_group.py b/tests/pytests/unit/states/test_group.py index fb13067b00e..f418bcbe789 100644 --- a/tests/pytests/unit/states/test_group.py +++ b/tests/pytests/unit/states/test_group.py @@ -6,8 +6,7 @@ from tests.support.mock import MagicMock, patch __context__ = {} -def ping(): - ... +def ping(): ... @pytest.fixture diff --git a/tests/pytests/unit/states/test_helm.py b/tests/pytests/unit/states/test_helm.py index d7d78432e17..9c91ab74f6c 100644 --- a/tests/pytests/unit/states/test_helm.py +++ b/tests/pytests/unit/states/test_helm.py @@ -2,7 +2,6 @@ Test cases for salt.modules.helm """ - import pytest import salt.states.helm as helm diff --git a/tests/pytests/unit/states/test_ini_manage.py b/tests/pytests/unit/states/test_ini_manage.py index 9f0217b5b40..0401b5761f3 100644 --- a/tests/pytests/unit/states/test_ini_manage.py +++ b/tests/pytests/unit/states/test_ini_manage.py @@ -2,7 +2,6 @@ Test cases for salt.states.ini_manage """ - import copy import os diff --git a/tests/pytests/unit/states/test_iptables.py b/tests/pytests/unit/states/test_iptables.py index cb372f99a64..19e8d6d4150 100644 --- a/tests/pytests/unit/states/test_iptables.py +++ b/tests/pytests/unit/states/test_iptables.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import pytest import salt.states.iptables as iptables diff --git a/tests/pytests/unit/states/test_kapacitor.py b/tests/pytests/unit/states/test_kapacitor.py index df748455541..172852f2744 100644 --- a/tests/pytests/unit/states/test_kapacitor.py +++ b/tests/pytests/unit/states/test_kapacitor.py @@ -2,7 +2,6 @@ Test cases for salt.states.kapacitor """ - import pytest import salt.states.kapacitor as kapacitor diff --git a/tests/pytests/unit/states/test_kernelpkg.py b/tests/pytests/unit/states/test_kernelpkg.py index 22b3cbf2db0..7aa35f6a556 100644 --- a/tests/pytests/unit/states/test_kernelpkg.py +++ b/tests/pytests/unit/states/test_kernelpkg.py @@ -2,7 +2,6 @@ Test cases for salt.states.kernelpkg """ - import pytest import salt.states.kernelpkg as kernelpkg diff --git a/tests/pytests/unit/states/test_kmod.py b/tests/pytests/unit/states/test_kmod.py index a4ec3dbc17c..c2b3e2e69d1 100644 --- a/tests/pytests/unit/states/test_kmod.py +++ b/tests/pytests/unit/states/test_kmod.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.kmod as kmod diff --git a/tests/pytests/unit/states/test_layman.py b/tests/pytests/unit/states/test_layman.py index ad3dec64b74..5de229c9f1a 100644 --- a/tests/pytests/unit/states/test_layman.py +++ b/tests/pytests/unit/states/test_layman.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.states.layman as layman diff --git a/tests/pytests/unit/states/test_ldap.py b/tests/pytests/unit/states/test_ldap.py index bf57549fd9c..99d0e36a36e 100644 --- a/tests/pytests/unit/states/test_ldap.py +++ b/tests/pytests/unit/states/test_ldap.py @@ -7,6 +7,7 @@ was an ugly second implementation. I'm leaving it for now, but this should really be gutted and replaced with something sensible. """ + import copy import logging @@ -239,20 +240,24 @@ def _test_helper(init_db, expected_ret, replace, delete_others=False): "changes", { dn: { - "old": { - attr: vals - for attr, vals in old[dn].items() - if vals != new.get(dn, {}).get(attr, ()) - } - if dn in old - else None, - "new": { - attr: vals - for attr, vals in new[dn].items() - if vals != old.get(dn, {}).get(attr, ()) - } - if dn in new - else None, + "old": ( + { + attr: vals + for attr, vals in old[dn].items() + if vals != new.get(dn, {}).get(attr, ()) + } + if dn in old + else None + ), + "new": ( + { + attr: vals + for attr, vals in new[dn].items() + if vals != old.get(dn, {}).get(attr, ()) + } + if dn in new + else None + ), } for dn in replace if old.get(dn, {}) != new.get(dn, {}) @@ -323,20 +328,24 @@ def _test_helper_add(db, expected_ret, add_items, delete_others=False): "changes", { dn: { - "old": { - attr: vals - for attr, vals in old[dn].items() - if vals != new.get(dn, {}).get(attr, ()) - } - if dn in old - else None, - "new": { - attr: vals - for attr, vals in new[dn].items() - if vals != old.get(dn, {}).get(attr, ()) - } - if dn in new - else None, + "old": ( + { + attr: vals + for attr, vals in old[dn].items() + if vals != new.get(dn, {}).get(attr, ()) + } + if dn in old + else None + ), + "new": ( + { + attr: vals + for attr, vals in new[dn].items() + if vals != old.get(dn, {}).get(attr, ()) + } + if dn in new + else None + ), } for dn in add_items if old.get(dn, {}) != new.get(dn, {}) diff --git a/tests/pytests/unit/states/test_libcloud_dns.py b/tests/pytests/unit/states/test_libcloud_dns.py index 230ecb940d1..92e87531213 100644 --- a/tests/pytests/unit/states/test_libcloud_dns.py +++ b/tests/pytests/unit/states/test_libcloud_dns.py @@ -2,7 +2,6 @@ :codeauthor: Anthony Shaw """ - import pytest import salt.states.libcloud_dns as libcloud_dns diff --git a/tests/pytests/unit/states/test_mount.py b/tests/pytests/unit/states/test_mount.py index 5e4d5274e85..3772cbcfdf0 100644 --- a/tests/pytests/unit/states/test_mount.py +++ b/tests/pytests/unit/states/test_mount.py @@ -1359,9 +1359,9 @@ def test_bind_mount_copy_active_opts(mount_name): ), ): with patch.dict(mount.__opts__, {"test": True}): - ret[ - "comment" - ] = "Remount would be forced because options (nodev,noexec,nosuid) changed" + ret["comment"] = ( + "Remount would be forced because options (nodev,noexec,nosuid) changed" + ) result = mount.mounted( name=name, device=device, diff --git a/tests/pytests/unit/states/test_pip.py b/tests/pytests/unit/states/test_pip.py index 1a71be86ac1..1c5cda4fe14 100644 --- a/tests/pytests/unit/states/test_pip.py +++ b/tests/pytests/unit/states/test_pip.py @@ -1,6 +1,7 @@ """ :codeauthor: Eric Graham """ + import logging import pytest diff --git a/tests/pytests/unit/states/test_ports.py b/tests/pytests/unit/states/test_ports.py index 3c1bded928a..6642392f4e1 100644 --- a/tests/pytests/unit/states/test_ports.py +++ b/tests/pytests/unit/states/test_ports.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import os import pytest diff --git a/tests/pytests/unit/states/test_sysfs.py b/tests/pytests/unit/states/test_sysfs.py index 030af223155..76aca32fda2 100644 --- a/tests/pytests/unit/states/test_sysfs.py +++ b/tests/pytests/unit/states/test_sysfs.py @@ -1,6 +1,7 @@ """ :codeauthor: Piter Punk """ + import pytest import salt.states.sysfs as sysfs diff --git a/tests/pytests/unit/states/test_virtualenv_mod.py b/tests/pytests/unit/states/test_virtualenv_mod.py index 5c2e33b85d0..d614050202e 100644 --- a/tests/pytests/unit/states/test_virtualenv_mod.py +++ b/tests/pytests/unit/states/test_virtualenv_mod.py @@ -4,7 +4,6 @@ Test cases for salt.states.virtualenv_mod """ - import os import pytest diff --git a/tests/pytests/unit/states/test_webutil.py b/tests/pytests/unit/states/test_webutil.py index d8a10f2d7a0..de8041e9770 100644 --- a/tests/pytests/unit/states/test_webutil.py +++ b/tests/pytests/unit/states/test_webutil.py @@ -2,7 +2,6 @@ :codeauthor: Alexander Pyatkin """ - import pytest import salt.states.webutil as htpasswd diff --git a/tests/pytests/unit/states/test_win_lgpo.py b/tests/pytests/unit/states/test_win_lgpo.py index 438b5c38689..cd898843986 100644 --- a/tests/pytests/unit/states/test_win_lgpo.py +++ b/tests/pytests/unit/states/test_win_lgpo.py @@ -1,6 +1,7 @@ """ :codeauthor: Shane Lee """ + import copy import pytest diff --git a/tests/pytests/unit/states/test_win_wua.py b/tests/pytests/unit/states/test_win_wua.py index 51e1d9ef987..cc6e169b0f4 100644 --- a/tests/pytests/unit/states/test_win_wua.py +++ b/tests/pytests/unit/states/test_win_wua.py @@ -1,6 +1,7 @@ """ Test the win_wua state module """ + from collections import namedtuple import pytest @@ -337,7 +338,9 @@ def test_installed(update_records, update_records_identity): ) patch_opts = patch.dict(win_wua.__opts__, {"test": False}) - with patch_winapi_com, patch_dispatch, patch_wua, patch_update_collection, patch_opts: + with ( + patch_winapi_com + ), patch_dispatch, patch_wua, patch_update_collection, patch_opts: expected = { "changes": { "installed": { @@ -433,7 +436,9 @@ def test_installed_test_mode(update_records, update_records_identity): ) patch_opts = patch.dict(win_wua.__opts__, {"test": True}) - with patch_winapi_com, patch_dispatch, patch_wua, patch_update_collection, patch_opts: + with ( + patch_winapi_com + ), patch_dispatch, patch_wua, patch_update_collection, patch_opts: expected = { "changes": {}, "comment": "Updates will be installed:", @@ -493,7 +498,9 @@ def test_installed_already_installed(update_records, update_records_identity): ) patch_opts = patch.dict(win_wua.__opts__, {"test": True}) - with patch_winapi_com, patch_dispatch, patch_wua, patch_update_collection, patch_opts: + with ( + patch_winapi_com + ), patch_dispatch, patch_wua, patch_update_collection, patch_opts: expected = { "changes": {}, "comment": "Updates already installed: KB4052623", @@ -593,7 +600,9 @@ def test_removed(update_records, update_records_identity): ) patch_opts = patch.dict(win_wua.__opts__, {"test": False}) - with patch_winapi_com, patch_dispatch, patch_wua, patch_update_collection, patch_opts: + with ( + patch_winapi_com + ), patch_dispatch, patch_wua, patch_update_collection, patch_opts: expected = { "changes": { "removed": { @@ -658,7 +667,9 @@ def test_removed_test_mode(update_records, update_records_identity): ) patch_opts = patch.dict(win_wua.__opts__, {"test": True}) - with patch_winapi_com, patch_dispatch, patch_wua, patch_update_collection, patch_opts: + with ( + patch_winapi_com + ), patch_dispatch, patch_wua, patch_update_collection, patch_opts: expected = { "changes": {}, "comment": "Updates will be removed:", diff --git a/tests/pytests/unit/states/test_xmpp.py b/tests/pytests/unit/states/test_xmpp.py index bec7224cdf1..fe672be884a 100644 --- a/tests/pytests/unit/states/test_xmpp.py +++ b/tests/pytests/unit/states/test_xmpp.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import pytest import salt.states.xmpp as xmpp diff --git a/tests/pytests/unit/states/virt/test_domain.py b/tests/pytests/unit/states/virt/test_domain.py index 091dc5ccce2..c2ddebc7374 100644 --- a/tests/pytests/unit/states/virt/test_domain.py +++ b/tests/pytests/unit/states/virt/test_domain.py @@ -165,7 +165,11 @@ def test_defined_update(test): "initrd": "/root/f8-i386-initrd", "cmdline": "console=ttyS0 ks=http://example.com/f8-i386/os/", } - assert virt.defined("myvm", cpu=2, boot=boot,) == { + assert virt.defined( + "myvm", + cpu=2, + boot=boot, + ) == { "name": "myvm", "changes": {"myvm": {"definition": True, "cpu": True}}, "result": True if not test else None, @@ -262,9 +266,11 @@ def test_running_no_change(test, running): "name": "myvm", "result": True, "changes": {"myvm": {"started": True}} if running == "shutdown" else {}, - "comment": "Domain myvm started" - if running == "shutdown" - else "Domain myvm exists and is running", + "comment": ( + "Domain myvm started" + if running == "shutdown" + else "Domain myvm exists and is running" + ), } if running == "shutdown" and not test: start_mock.assert_called() @@ -426,9 +432,11 @@ def test_running_update(test, running): "name": "myvm", "changes": {"myvm": changes}, "result": True if not test else None, - "comment": "Domain myvm updated" - if running == "running" - else "Domain myvm updated and started", + "comment": ( + "Domain myvm updated" + if running == "running" + else "Domain myvm updated and started" + ), } if running == "shutdown" and not test: start_mock.assert_called() diff --git a/tests/pytests/unit/states/zabbix/test_action.py b/tests/pytests/unit/states/zabbix/test_action.py index 57da6be2684..e12a92fb10d 100644 --- a/tests/pytests/unit/states/zabbix/test_action.py +++ b/tests/pytests/unit/states/zabbix/test_action.py @@ -193,10 +193,10 @@ def test_present_exists(input_params, existing_obj): }, ): ret["result"] = True - ret[ - "comment" - ] = 'Zabbix Action "{}" already exists and corresponds to a definition.'.format( - name + ret["comment"] = ( + 'Zabbix Action "{}" already exists and corresponds to a definition.'.format( + name + ) ) assert zabbix_action.present(name, {}) == ret diff --git a/tests/pytests/unit/states/zabbix/test_valuemap.py b/tests/pytests/unit/states/zabbix/test_valuemap.py index bc589d7bc92..348c00d9011 100644 --- a/tests/pytests/unit/states/zabbix/test_valuemap.py +++ b/tests/pytests/unit/states/zabbix/test_valuemap.py @@ -127,10 +127,10 @@ def test_present_exists(input_params, existing_obj): }, ): ret["result"] = True - ret[ - "comment" - ] = 'Zabbix Value map "{}" already exists and corresponds to a definition.'.format( - name + ret["comment"] = ( + 'Zabbix Value map "{}" already exists and corresponds to a definition.'.format( + name + ) ) assert zabbix_valuemap.present(name, {}) == ret diff --git a/tests/pytests/unit/test_acl.py b/tests/pytests/unit/test_acl.py index e5788fb846d..6c75b8902d1 100644 --- a/tests/pytests/unit/test_acl.py +++ b/tests/pytests/unit/test_acl.py @@ -2,7 +2,6 @@ Unit tests for salt.acl.ClientACL """ - import pytest from salt import acl diff --git a/tests/pytests/unit/test_config.py b/tests/pytests/unit/test_config.py index cb343cb75eb..7437c8214ed 100644 --- a/tests/pytests/unit/test_config.py +++ b/tests/pytests/unit/test_config.py @@ -4,6 +4,7 @@ tests.pytests.unit.test_config Unit tests for salt's config modulet """ + import salt.config diff --git a/tests/pytests/unit/test_fileclient.py b/tests/pytests/unit/test_fileclient.py index d11f5ac2521..dee9d7901bd 100644 --- a/tests/pytests/unit/test_fileclient.py +++ b/tests/pytests/unit/test_fileclient.py @@ -1,6 +1,7 @@ """ Unit tests for salt.fileclient """ + import salt.config import salt.fileclient as fileclient from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/test_log.py b/tests/pytests/unit/test_log.py index 83d2e9e2cda..3eeee546faf 100644 --- a/tests/pytests/unit/test_log.py +++ b/tests/pytests/unit/test_log.py @@ -8,7 +8,6 @@ Test salt's "hacked" logging """ - import io import logging diff --git a/tests/pytests/unit/test_syspaths.py b/tests/pytests/unit/test_syspaths.py index 0ecb4789a61..66a0bc07596 100644 --- a/tests/pytests/unit/test_syspaths.py +++ b/tests/pytests/unit/test_syspaths.py @@ -4,6 +4,7 @@ tests.pytests.unit.test_syspaths Unit tests for salt's syspaths module """ + import pytest import salt.syspaths diff --git a/tests/pytests/unit/test_version.py b/tests/pytests/unit/test_version.py index 1cb94c619ca..4192cd505b9 100644 --- a/tests/pytests/unit/test_version.py +++ b/tests/pytests/unit/test_version.py @@ -4,6 +4,7 @@ tests.pytests.unit.test_version Test salt's regex git describe version parsing """ + import re import pytest diff --git a/tests/pytests/unit/transport/test_base.py b/tests/pytests/unit/transport/test_base.py index da5a6fa2615..939c2c7ce7d 100644 --- a/tests/pytests/unit/transport/test_base.py +++ b/tests/pytests/unit/transport/test_base.py @@ -1,6 +1,7 @@ """ Unit tests for salt.transport.base. """ + import pytest import salt.transport.base diff --git a/tests/pytests/unit/utils/jinja/conftest.py b/tests/pytests/unit/utils/jinja/conftest.py index 0b77a4fb2f7..4007bfd6ea1 100644 --- a/tests/pytests/unit/utils/jinja/conftest.py +++ b/tests/pytests/unit/utils/jinja/conftest.py @@ -1,6 +1,7 @@ """ Tests for salt.utils.jinja """ + import pytest diff --git a/tests/pytests/unit/utils/jinja/test_jinja.py b/tests/pytests/unit/utils/jinja/test_jinja.py index de8df6067f5..9e1b33c2ff0 100644 --- a/tests/pytests/unit/utils/jinja/test_jinja.py +++ b/tests/pytests/unit/utils/jinja/test_jinja.py @@ -1,6 +1,7 @@ """ Tests for salt.utils.jinja """ + import salt.utils.dateutils # pylint: disable=unused-import from salt.utils.jinja import Markup, indent, tojson diff --git a/tests/pytests/unit/utils/scheduler/conftest.py b/tests/pytests/unit/utils/scheduler/conftest.py index e74b67091bf..a1c997b1234 100644 --- a/tests/pytests/unit/utils/scheduler/conftest.py +++ b/tests/pytests/unit/utils/scheduler/conftest.py @@ -3,7 +3,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import copy import logging diff --git a/tests/pytests/unit/utils/templates/test_jinja.py b/tests/pytests/unit/utils/templates/test_jinja.py index 6d47e6b80d3..99856f65054 100644 --- a/tests/pytests/unit/utils/templates/test_jinja.py +++ b/tests/pytests/unit/utils/templates/test_jinja.py @@ -1,6 +1,7 @@ """ Tests for salt.utils.templates """ + import re from collections import OrderedDict diff --git a/tests/pytests/unit/utils/templates/test_wrap_tmpl_func.py b/tests/pytests/unit/utils/templates/test_wrap_tmpl_func.py index 9ab74f0377d..a868e9e8996 100644 --- a/tests/pytests/unit/utils/templates/test_wrap_tmpl_func.py +++ b/tests/pytests/unit/utils/templates/test_wrap_tmpl_func.py @@ -1,6 +1,7 @@ """ Unit tests for salt.utils.templates.py """ + import logging from pathlib import PurePath, PurePosixPath diff --git a/tests/pytests/unit/utils/test_aws.py b/tests/pytests/unit/utils/test_aws.py index c4e32e369a9..22597ffcd8b 100644 --- a/tests/pytests/unit/utils/test_aws.py +++ b/tests/pytests/unit/utils/test_aws.py @@ -4,6 +4,7 @@ Test the salt aws functions """ + import io import os import time diff --git a/tests/pytests/unit/utils/test_cloud.py b/tests/pytests/unit/utils/test_cloud.py index 7edce2000af..88acbee39ad 100644 --- a/tests/pytests/unit/utils/test_cloud.py +++ b/tests/pytests/unit/utils/test_cloud.py @@ -6,7 +6,6 @@ """ - import os import string import tempfile diff --git a/tests/pytests/unit/utils/test_compat.py b/tests/pytests/unit/utils/test_compat.py index b86dea94296..0dacd615eb9 100644 --- a/tests/pytests/unit/utils/test_compat.py +++ b/tests/pytests/unit/utils/test_compat.py @@ -1,6 +1,7 @@ """ Unit tests for salt.utils.compat.py """ + import pytest import salt.utils.compat diff --git a/tests/pytests/unit/utils/test_crypt.py b/tests/pytests/unit/utils/test_crypt.py index 9a7b35f3d2b..ccf2cfbf46e 100644 --- a/tests/pytests/unit/utils/test_crypt.py +++ b/tests/pytests/unit/utils/test_crypt.py @@ -1,6 +1,7 @@ """ Unit tests for salt.utils.crypt.py """ + import pytest import salt.utils.crypt diff --git a/tests/pytests/unit/utils/test_data.py b/tests/pytests/unit/utils/test_data.py index e6a6cdd6185..ee85b0d0a62 100644 --- a/tests/pytests/unit/utils/test_data.py +++ b/tests/pytests/unit/utils/test_data.py @@ -1,6 +1,7 @@ """ Tests for salt.utils.data """ + import builtins import logging diff --git a/tests/pytests/unit/utils/test_files.py b/tests/pytests/unit/utils/test_files.py index ded95093cd2..3f711259cce 100644 --- a/tests/pytests/unit/utils/test_files.py +++ b/tests/pytests/unit/utils/test_files.py @@ -2,7 +2,6 @@ Unit Tests for functions located in salt/utils/files.py """ - import copy import io import os diff --git a/tests/pytests/unit/utils/test_nacl.py b/tests/pytests/unit/utils/test_nacl.py index 77f40d6fbf9..a498efcf6f8 100644 --- a/tests/pytests/unit/utils/test_nacl.py +++ b/tests/pytests/unit/utils/test_nacl.py @@ -1,6 +1,7 @@ """ Unit tests for the salt.utils.nacl module """ + import os import pytest diff --git a/tests/pytests/unit/utils/test_rsax931.py b/tests/pytests/unit/utils/test_rsax931.py index 39bdb7cac30..0cdc1aa1e67 100644 --- a/tests/pytests/unit/utils/test_rsax931.py +++ b/tests/pytests/unit/utils/test_rsax931.py @@ -1,6 +1,7 @@ """ Test the RSA ANSI X9.31 signer and verifier """ + import ctypes import ctypes.util import fnmatch diff --git a/tests/pytests/unit/utils/test_x509.py b/tests/pytests/unit/utils/test_x509.py index f13ac97fb33..ab7384ffde2 100644 --- a/tests/pytests/unit/utils/test_x509.py +++ b/tests/pytests/unit/utils/test_x509.py @@ -1472,9 +1472,11 @@ def test_parse_general_names_rejects_invalid(inpt): ) def test_get_dn(inpt, expected): expected_parsed = [ - cx509.RelativeDistinguishedName({x}) - if not isinstance(x, cx509.RelativeDistinguishedName) - else x + ( + cx509.RelativeDistinguishedName({x}) + if not isinstance(x, cx509.RelativeDistinguishedName) + else x + ) for x in expected ] res = x509._get_dn(inpt) diff --git a/tests/pytests/unit/utils/verify/test_clean_path_link.py b/tests/pytests/unit/utils/verify/test_clean_path_link.py index 8af20f5550a..23857ca1c51 100644 --- a/tests/pytests/unit/utils/verify/test_clean_path_link.py +++ b/tests/pytests/unit/utils/verify/test_clean_path_link.py @@ -1,6 +1,7 @@ """ Ensure salt.utils.clean_path works with symlinked directories and files """ + import ctypes import pytest diff --git a/tests/pytests/unit/utils/verify/test_verify.py b/tests/pytests/unit/utils/verify/test_verify.py index 5dcb90b0857..60171523cb4 100644 --- a/tests/pytests/unit/utils/verify/test_verify.py +++ b/tests/pytests/unit/utils/verify/test_verify.py @@ -257,9 +257,11 @@ def test_max_open_files(caplog): logmsg_chk.format( newmax, mof_test, - mof_test - newmax - if sys.platform.startswith("win") - else mof_h - newmax, + ( + mof_test - newmax + if sys.platform.startswith("win") + else mof_h - newmax + ), ) in caplog.messages ) @@ -279,9 +281,11 @@ def test_max_open_files(caplog): logmsg_crash.format( newmax, mof_test, - mof_test - newmax - if sys.platform.startswith("win") - else mof_h - newmax, + ( + mof_test - newmax + if sys.platform.startswith("win") + else mof_h - newmax + ), ) in caplog.messages ) diff --git a/tests/support/cli_scripts.py b/tests/support/cli_scripts.py index ee18d6856a0..58e54c6ec56 100644 --- a/tests/support/cli_scripts.py +++ b/tests/support/cli_scripts.py @@ -5,7 +5,6 @@ Code to generate Salt CLI scripts for test runs """ - import logging import os diff --git a/tests/support/events.py b/tests/support/events.py index 6a8de36a005..4abd116aeb2 100644 --- a/tests/support/events.py +++ b/tests/support/events.py @@ -3,7 +3,6 @@ ~~~~~~~~~~~~~~~~~~~~ """ - import multiprocessing import os import time diff --git a/tests/support/helpers.py b/tests/support/helpers.py index f3a73090fa7..455c5b747aa 100644 --- a/tests/support/helpers.py +++ b/tests/support/helpers.py @@ -8,6 +8,7 @@ Test support helpers """ + import base64 import builtins import errno diff --git a/tests/support/kernelpkg.py b/tests/support/kernelpkg.py index eada8d931d1..49c1efa5d3a 100644 --- a/tests/support/kernelpkg.py +++ b/tests/support/kernelpkg.py @@ -4,6 +4,7 @@ :maturity: develop .. versionadded:: 2018.3.0 """ + # pylint: disable=invalid-name,no-member diff --git a/tests/support/mixins.py b/tests/support/mixins.py index 53f7e75108b..9560d2d792c 100644 --- a/tests/support/mixins.py +++ b/tests/support/mixins.py @@ -287,9 +287,9 @@ class SaltClientTestCaseMixin(AdaptedConfigurationTestCaseMixin): mopts = self.get_config( self._salt_client_config_file_name_, from_scratch=True ) - RUNTIME_VARS.RUNTIME_CONFIGS[ - "runtime_client" - ] = salt.client.get_local_client(mopts=mopts) + RUNTIME_VARS.RUNTIME_CONFIGS["runtime_client"] = ( + salt.client.get_local_client(mopts=mopts) + ) return RUNTIME_VARS.RUNTIME_CONFIGS["runtime_client"] diff --git a/tests/support/mock.py b/tests/support/mock.py index c050d0bf4e6..79b44083188 100644 --- a/tests/support/mock.py +++ b/tests/support/mock.py @@ -11,6 +11,7 @@ Note: mock >= 2.0.0 required since unittest.mock does not have MagicMock.assert_called in Python < 3.6. """ + # pylint: disable=unused-import,function-redefined,blacklisted-module,blacklisted-external-module diff --git a/tests/support/napalm.py b/tests/support/napalm.py index 58bc45bfb18..bb096189403 100644 --- a/tests/support/napalm.py +++ b/tests/support/napalm.py @@ -4,7 +4,6 @@ Base classes for napalm unit tests :codeauthor: :email:`Anthony Shaw ` """ - from functools import wraps from salt.utils.immutabletypes import freeze diff --git a/tests/support/pytest/helpers.py b/tests/support/pytest/helpers.py index e6752ee7070..5667687e808 100644 --- a/tests/support/pytest/helpers.py +++ b/tests/support/pytest/helpers.py @@ -4,6 +4,7 @@ PyTest helpers functions """ + import logging import os import pathlib diff --git a/tests/support/pytest/loader.py b/tests/support/pytest/loader.py index 2ac99459c2a..7403894d011 100644 --- a/tests/support/pytest/loader.py +++ b/tests/support/pytest/loader.py @@ -4,6 +4,7 @@ Salt's Loader PyTest Mock Support """ + import logging import sys import types diff --git a/tests/support/runtests.py b/tests/support/runtests.py index ce5c9644cd3..046c20bd01f 100644 --- a/tests/support/runtests.py +++ b/tests/support/runtests.py @@ -192,12 +192,16 @@ RUNTIME_VARS = RuntimeVars( TMP_BASEENV_PILLAR_TREE=paths.TMP_PILLAR_TREE, TMP_PRODENV_STATE_TREE=paths.TMP_PRODENV_STATE_TREE, TMP_PRODENV_PILLAR_TREE=paths.TMP_PRODENV_PILLAR_TREE, - SHELL_TRUE_PATH=salt.utils.path.which("true") - if not salt.utils.platform.is_windows() - else "cmd /c exit 0 > nul", - SHELL_FALSE_PATH=salt.utils.path.which("false") - if not salt.utils.platform.is_windows() - else "cmd /c exit 1 > nul", + SHELL_TRUE_PATH=( + salt.utils.path.which("true") + if not salt.utils.platform.is_windows() + else "cmd /c exit 0 > nul" + ), + SHELL_FALSE_PATH=( + salt.utils.path.which("false") + if not salt.utils.platform.is_windows() + else "cmd /c exit 1 > nul" + ), RUNNING_TESTS_USER=this_user(), RUNTIME_CONFIGS={}, CODE_DIR=paths.CODE_DIR, diff --git a/tests/support/unit.py b/tests/support/unit.py index 419e287b92f..7e2aefb43aa 100644 --- a/tests/support/unit.py +++ b/tests/support/unit.py @@ -18,6 +18,7 @@ .. _`unittest2`: https://pypi.python.org/pypi/unittest2 """ + # pylint: disable=unused-import,blacklisted-module,deprecated-method diff --git a/tests/support/xmlunit.py b/tests/support/xmlunit.py index 940bbfe66ae..5b959799cc0 100644 --- a/tests/support/xmlunit.py +++ b/tests/support/xmlunit.py @@ -9,6 +9,7 @@ XML Unit Tests """ + # pylint: disable=wrong-import-order,wrong-import-position diff --git a/tests/support/zfs.py b/tests/support/zfs.py index 31fabe3d059..b9631ac1b6c 100644 --- a/tests/support/zfs.py +++ b/tests/support/zfs.py @@ -5,7 +5,6 @@ ZFS related unit test data structures """ - import salt.utils.zfs from tests.support.mock import MagicMock, patch diff --git a/tests/unit/ext/test_ipaddress.py b/tests/unit/ext/test_ipaddress.py index 474d05192fc..d884ba3d2df 100644 --- a/tests/unit/ext/test_ipaddress.py +++ b/tests/unit/ext/test_ipaddress.py @@ -265,7 +265,7 @@ class AddressTestCase_v4(BaseTestCase, CommonTestMixin_v4): ("s", "1.2.3.42"), ("", "1.2.3.42"), ] - for (fmt, txt) in v4_pairs: + for fmt, txt in v4_pairs: self.assertEqual(txt, format(v4, fmt)) def test_network_passed_as_address(self): @@ -402,7 +402,7 @@ class AddressTestCase_v6(BaseTestCase, CommonTestMixin_v6): ("", "::102:32a"), ] - for (fmt, txt) in v6_pairs: + for fmt, txt in v6_pairs: self.assertEqual(txt, format(v6, fmt)) def test_network_passed_as_address(self): diff --git a/tests/unit/modules/nxos/nxos_n36k.py b/tests/unit/modules/nxos/nxos_n36k.py index c6e0879665f..3721337158b 100644 --- a/tests/unit/modules/nxos/nxos_n36k.py +++ b/tests/unit/modules/nxos/nxos_n36k.py @@ -19,7 +19,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N36KPlatform(NXOSPlatform): - """Cisco Systems N36K Platform Unit Test Object""" chassis = "Nexus3000 N3K-C36180YC-R Chassis" diff --git a/tests/unit/modules/nxos/nxos_n3k.py b/tests/unit/modules/nxos/nxos_n3k.py index 9436978273f..0210f26caee 100644 --- a/tests/unit/modules/nxos/nxos_n3k.py +++ b/tests/unit/modules/nxos/nxos_n3k.py @@ -19,7 +19,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N3KPlatform(NXOSPlatform): - """Cisco Systems N3K Platform Unit Test Object""" chassis = "Nexus 3172 Chassis" diff --git a/tests/unit/modules/nxos/nxos_n5k.py b/tests/unit/modules/nxos/nxos_n5k.py index b5f21f2e691..ccaf838658a 100644 --- a/tests/unit/modules/nxos/nxos_n5k.py +++ b/tests/unit/modules/nxos/nxos_n5k.py @@ -19,7 +19,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N5KPlatform(NXOSPlatform): - """Cisco Systems N5K Platform Unit Test Object""" chassis = "cisco Nexus 5672UP 16G-FC Chassis" diff --git a/tests/unit/modules/nxos/nxos_n7k.py b/tests/unit/modules/nxos/nxos_n7k.py index 18018748c66..ec7b84768c3 100644 --- a/tests/unit/modules/nxos/nxos_n7k.py +++ b/tests/unit/modules/nxos/nxos_n7k.py @@ -19,7 +19,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N7KPlatform(NXOSPlatform): - """Cisco Systems N7K Platform Unit Test Object""" chassis = "Nexus7000 C7010 (10 Slot) Chassis" diff --git a/tests/unit/modules/nxos/nxos_n93k.py b/tests/unit/modules/nxos/nxos_n93k.py index a495da3da05..15517fa524e 100644 --- a/tests/unit/modules/nxos/nxos_n93k.py +++ b/tests/unit/modules/nxos/nxos_n93k.py @@ -19,7 +19,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N93KPlatform(NXOSPlatform): - """Cisco Systems N93K Platform Unit Test Object""" chassis = "Nexus9000 C9396PX Chassis" diff --git a/tests/unit/modules/nxos/nxos_n93klxc.py b/tests/unit/modules/nxos/nxos_n93klxc.py index 4f45e3650a9..6cb91a819da 100644 --- a/tests/unit/modules/nxos/nxos_n93klxc.py +++ b/tests/unit/modules/nxos/nxos_n93klxc.py @@ -19,7 +19,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N93KLXCPlatform(NXOSPlatform): - """Cisco Systems N93K (boot mode lxc) Platform Unit Test Object""" chassis = "Nexus9000 C9396PX (LXC) Chassis" diff --git a/tests/unit/modules/nxos/nxos_n95k.py b/tests/unit/modules/nxos/nxos_n95k.py index c249f5e0bb7..1e3146affa6 100644 --- a/tests/unit/modules/nxos/nxos_n95k.py +++ b/tests/unit/modules/nxos/nxos_n95k.py @@ -21,7 +21,6 @@ from tests.unit.modules.nxos.nxos_platform import NXOSPlatform class N95KPlatform(NXOSPlatform): - """Cisco Systems N9K Platform Unit Test Object""" chassis = "Nexus9000 C9508 (8 Slot) Chassis" diff --git a/tests/unit/modules/nxos/nxos_platform.py b/tests/unit/modules/nxos/nxos_platform.py index 02cc2736523..22d8c8dc036 100644 --- a/tests/unit/modules/nxos/nxos_platform.py +++ b/tests/unit/modules/nxos/nxos_platform.py @@ -25,7 +25,6 @@ from string import Template class NXOSPlatform: - """Cisco Systems Base Platform Unit Test Object""" chassis = "Unknown NXOS Chassis" @@ -106,7 +105,6 @@ Module Image Running-Version(pri:alt) New-Versi install_all_non_disruptive_success = None def __init__(self, *args, **kwargs): - """ ckimage - current kickstart image cimage - current system image @@ -163,14 +161,12 @@ Module Image Running-Version(pri:alt) New-Versi @staticmethod def templatize(template, values): - """Substitute variables in template with their corresponding values""" return Template(template).substitute(values) @staticmethod def version_from_image(image): - """Given a NXOS image named image decompose to appropriate image version""" ver = None diff --git a/tests/unit/modules/test_boto3_elasticsearch.py b/tests/unit/modules/test_boto3_elasticsearch.py index 0e60a9e0746..4c3156042bf 100644 --- a/tests/unit/modules/test_boto3_elasticsearch.py +++ b/tests/unit/modules/test_boto3_elasticsearch.py @@ -1,6 +1,7 @@ """ Tests for salt.modules.boto3_elasticsearch """ + import datetime import random import string diff --git a/tests/unit/modules/test_boto3_route53.py b/tests/unit/modules/test_boto3_route53.py index 5e7332fbb35..eb19cd5e6c9 100644 --- a/tests/unit/modules/test_boto3_route53.py +++ b/tests/unit/modules/test_boto3_route53.py @@ -1,6 +1,7 @@ """ Tests for salt.modules.boto3_route53 """ + import random import string diff --git a/tests/unit/modules/test_bsd_shadow.py b/tests/unit/modules/test_bsd_shadow.py index b1ea906f7fd..bf659624e3e 100644 --- a/tests/unit/modules/test_bsd_shadow.py +++ b/tests/unit/modules/test_bsd_shadow.py @@ -12,6 +12,7 @@ from tests.support.unit import TestCase shadow = pytest.importorskip("salt.modules.bsd_shadow") + # Although bsd_shadow runs on NetBSD and OpenBSD as well, the mocks are # currently only designed for FreeBSD. @pytest.mark.skip_unless_on_freebsd diff --git a/tests/unit/modules/test_freezer.py b/tests/unit/modules/test_freezer.py index 436ec4b7446..aaa542d0e4a 100644 --- a/tests/unit/modules/test_freezer.py +++ b/tests/unit/modules/test_freezer.py @@ -3,7 +3,6 @@ :platform: Linux """ - import salt.modules.freezer as freezer from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_influxdb08mod.py b/tests/unit/modules/test_influxdb08mod.py index d58d99da138..79cf8542d87 100644 --- a/tests/unit/modules/test_influxdb08mod.py +++ b/tests/unit/modules/test_influxdb08mod.py @@ -2,7 +2,6 @@ :codeauthor: Rupesh Tare """ - import salt.modules.influxdb08mod as influx08 from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase diff --git a/tests/unit/modules/test_kernelpkg_linux_apt.py b/tests/unit/modules/test_kernelpkg_linux_apt.py index 92f40f89767..5d6693ec2aa 100644 --- a/tests/unit/modules/test_kernelpkg_linux_apt.py +++ b/tests/unit/modules/test_kernelpkg_linux_apt.py @@ -4,6 +4,7 @@ :maturity: develop .. versionadded:: 2018.3.0 """ + # pylint: disable=invalid-name,no-member import re diff --git a/tests/unit/modules/test_kernelpkg_linux_yum.py b/tests/unit/modules/test_kernelpkg_linux_yum.py index 4005a4897d7..310f1adf362 100644 --- a/tests/unit/modules/test_kernelpkg_linux_yum.py +++ b/tests/unit/modules/test_kernelpkg_linux_yum.py @@ -4,6 +4,7 @@ :maturity: develop .. versionadded:: 2018.3.0 """ + # pylint: disable=invalid-name,no-member import pytest diff --git a/tests/unit/modules/test_kubernetesmod.py b/tests/unit/modules/test_kubernetesmod.py index 4d38d63bb51..049ed53663f 100644 --- a/tests/unit/modules/test_kubernetesmod.py +++ b/tests/unit/modules/test_kubernetesmod.py @@ -1,6 +1,7 @@ """ :codeauthor: Jochen Breuer """ + # pylint: disable=no-value-for-parameter import os from contextlib import contextmanager diff --git a/tests/unit/modules/test_libcloud_compute.py b/tests/unit/modules/test_libcloud_compute.py index a95a64c1bad..15893fefe3b 100644 --- a/tests/unit/modules/test_libcloud_compute.py +++ b/tests/unit/modules/test_libcloud_compute.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`Anthony Shaw ` """ + import logging import pytest diff --git a/tests/unit/modules/test_libcloud_dns.py b/tests/unit/modules/test_libcloud_dns.py index 87416c98199..77c64fa1ed2 100644 --- a/tests/unit/modules/test_libcloud_dns.py +++ b/tests/unit/modules/test_libcloud_dns.py @@ -1,6 +1,7 @@ """ :codeauthor: Anthony Shaw """ + import pytest import salt.modules.libcloud_dns as libcloud_dns diff --git a/tests/unit/modules/test_libcloud_loadbalancer.py b/tests/unit/modules/test_libcloud_loadbalancer.py index 02ae019759c..69b8ae26117 100644 --- a/tests/unit/modules/test_libcloud_loadbalancer.py +++ b/tests/unit/modules/test_libcloud_loadbalancer.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`Anthony Shaw ` """ + import pytest import salt.modules.libcloud_loadbalancer as libcloud_loadbalancer diff --git a/tests/unit/modules/test_libcloud_storage.py b/tests/unit/modules/test_libcloud_storage.py index 8f7fd069782..9347e2571c2 100644 --- a/tests/unit/modules/test_libcloud_storage.py +++ b/tests/unit/modules/test_libcloud_storage.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`Anthony Shaw ` """ + import pytest import salt.modules.libcloud_storage as libcloud_storage diff --git a/tests/unit/modules/test_localemod.py b/tests/unit/modules/test_localemod.py index 83496de3dfd..f378792acef 100644 --- a/tests/unit/modules/test_localemod.py +++ b/tests/unit/modules/test_localemod.py @@ -1,6 +1,7 @@ """ :codeauthor: Rupesh Tare """ + import pytest import salt.modules.localemod as localemod diff --git a/tests/unit/modules/test_memcached.py b/tests/unit/modules/test_memcached.py index b62986f2317..f51c9fb8e8d 100644 --- a/tests/unit/modules/test_memcached.py +++ b/tests/unit/modules/test_memcached.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.memcached as memcached from salt.exceptions import CommandExecutionError, SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/unit/modules/test_napalm_probes.py b/tests/unit/modules/test_napalm_probes.py index 2ebda0dc84a..c7527142924 100644 --- a/tests/unit/modules/test_napalm_probes.py +++ b/tests/unit/modules/test_napalm_probes.py @@ -2,7 +2,6 @@ :codeauthor: :email:`Anthony Shaw ` """ - import salt.modules.napalm_probes as napalm_probes import tests.support.napalm as napalm_test_support from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_napalm_yang_mod.py b/tests/unit/modules/test_napalm_yang_mod.py index 9d711b04ca3..6e5f848fb10 100644 --- a/tests/unit/modules/test_napalm_yang_mod.py +++ b/tests/unit/modules/test_napalm_yang_mod.py @@ -2,7 +2,6 @@ :codeauthor: :email:`Anthony Shaw ` """ - import salt.modules.napalm_network as napalm_network import salt.modules.napalm_yang_mod as napalm_yang_mod import tests.support.napalm as napalm_test_support diff --git a/tests/unit/modules/test_netbox.py b/tests/unit/modules/test_netbox.py index a2257068b75..45958e677fb 100644 --- a/tests/unit/modules/test_netbox.py +++ b/tests/unit/modules/test_netbox.py @@ -1,6 +1,7 @@ """ :codeauthor: :email:`Zach Moody ` """ + import pytest import salt.modules.netbox as netbox diff --git a/tests/unit/modules/test_netscaler.py b/tests/unit/modules/test_netscaler.py index 46b195ec297..d320f0fbe5a 100644 --- a/tests/unit/modules/test_netscaler.py +++ b/tests/unit/modules/test_netscaler.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.netscaler as netscaler from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/modules/test_neutron.py b/tests/unit/modules/test_neutron.py index 7fed7bcc121..c6fb5b38445 100644 --- a/tests/unit/modules/test_neutron.py +++ b/tests/unit/modules/test_neutron.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.neutron as neutron from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock diff --git a/tests/unit/modules/test_nova.py b/tests/unit/modules/test_nova.py index f9cb3db9490..47fa1d3742d 100644 --- a/tests/unit/modules/test_nova.py +++ b/tests/unit/modules/test_nova.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import salt.modules.nova as nova from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/modules/test_nxos.py b/tests/unit/modules/test_nxos.py index 7610abadab0..cedf1e707ff 100644 --- a/tests/unit/modules/test_nxos.py +++ b/tests/unit/modules/test_nxos.py @@ -45,7 +45,6 @@ from tests.unit.modules.nxos.nxos_show_run import ( class NxosTestCase(TestCase, LoaderModuleMockMixin): - """Test cases for salt.modules.nxos""" COPY_RS = "copy running-config startup-config" @@ -58,14 +57,12 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): @staticmethod def test_check_virtual(): - """UT: nxos module:check_virtual method - return value""" result = nxos_module.__virtual__() assert "nxos" in result def test_ping_proxy(self): - """UT: nxos module:ping method - proxy""" with patch("salt.utils.platform.is_proxy", return_value=True, autospec=True): with patch.dict( @@ -75,7 +72,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertTrue(result) def test_ping_native_minion(self): - """UT: nxos module:ping method - proxy""" with patch("salt.utils.platform.is_proxy", return_value=False, autospec=True): @@ -86,7 +82,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertTrue(result) def test_check_password_return_none(self): - """UT: nxos module:check_password method - return None""" username = "admin" @@ -97,7 +92,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertIsNone(result) def test_check_password_password_nxos_comment(self): - """UT: nxos module:check_password method - password_line has '!'""" username = "admin" @@ -112,7 +106,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): reason="compatible crypt method for fake data not available", ) def test_check_password_password_encrypted_false(self): - """UT: nxos module:check_password method - password is not encrypted""" username = "salt_test" @@ -127,7 +120,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertTrue(result) def test_check_password_password_encrypted_true(self): - """UT: nxos module:check_password method - password is encrypted""" username = "salt_test" @@ -142,7 +134,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertTrue(result) def test_check_password_password_encrypted_true_negative(self): - """UT: nxos module:check_password method - password is not encrypted""" username = "salt_test" @@ -155,7 +146,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertFalse(result) def test_check_role_true(self): - """UT: nxos module:check_role method - Role configured""" username = "salt_test" @@ -166,7 +156,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertTrue(result) def test_check_role_false(self): - """UT: nxos module:check_role method - Role not configured""" username = "salt_test" @@ -177,7 +166,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertFalse(result) def test_cmd_any_function(self): - """UT: nxos module:cmd method - check_role function""" with patch.dict( @@ -198,7 +186,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertTrue(result) def test_cmd_function_absent(self): - """UT: nxos module:cmd method - non existent function""" result = nxos_module.cmd( @@ -207,7 +194,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertFalse(result) def test_find_single_match(self): - """UT: nxos module:test_find method - Find single match in running config""" find_pattern = "^vrf context testing$" @@ -220,7 +206,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertIn(find_string, result) def test_find_multiple_matches(self): - """UT: nxos module:test_find method - Find multiple matches in running config""" find_pattern = "^no logging.*$" @@ -234,7 +219,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(len(result), 7) def test_get_roles_user_not_configured(self): - """UT: nxos module:get_roles method - User not configured""" username = "salt_does_not_exist" @@ -245,7 +229,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, []) def test_get_roles_user_configured(self): - """UT: nxos module:get_roles method - User configured""" username = "salt_test" @@ -260,7 +243,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result.sort(), expected_result.sort()) def test_get_roles_user_configured_no_role(self): - """UT: nxos module:get_roles method - User configured no roles""" username = "salt_test" @@ -271,7 +253,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, []) def test_get_user_configured(self): - """UT: nxos module:get_user method - User configured""" username = "salt_test" @@ -286,7 +267,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_grains(self): - """UT: nxos module:grains method""" nxos_module.DEVICE_DETAILS["grains_cache"] = {} @@ -316,7 +296,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_grains) def test_grains_get_cache(self): - """UT: nxos module:grains method""" expected_grains = { @@ -346,7 +325,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_grains) def test_grains_refresh(self): - """UT: nxos module:grains_refresh method""" expected_grains = { @@ -368,7 +346,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_grains) def test_system_info(self): - """UT: nxos module:system_info method""" expected_grains = { @@ -397,7 +374,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_grains) def test_sendline_invalid_method(self): - """UT: nxos module:sendline method - invalid method""" command = "show version" @@ -409,7 +385,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertIn("INPUT ERROR", result) def test_sendline_valid_method_proxy(self): - """UT: nxos module:sendline method - valid method over proxy""" command = "show version" @@ -424,7 +399,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertIn(n9k_show_ver, result) def test_sendline_valid_method_nxapi_uds(self): - """UT: nxos module:sendline method - valid method over nxapi uds""" command = "show version" @@ -440,7 +414,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertIn(n9k_show_ver, result) def test_show_raw_text_invalid(self): - """UT: nxos module:show method - invalid argument""" command = "show version" @@ -450,7 +423,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertIn("INPUT ERROR", result) def test_show_raw_text_true(self): - """UT: nxos module:show method - raw_test true""" command = "show version" @@ -463,7 +435,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, n9k_show_ver) def test_show_raw_text_true_multiple_commands(self): - """UT: nxos module:show method - raw_test true multiple commands""" command = "show bgp sessions ; show processes" @@ -475,7 +446,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, data) def test_show_nxapi(self): - """UT: nxos module:show method - nxapi returns info as list""" command = "show version; show interface eth1/1" @@ -491,7 +461,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result[1], n9k_show_ver_int_list[1]) def test_show_nxapi_structured(self): - """UT: nxos module:show method - nxapi returns info as list""" command = "show version; show interface eth1/1" @@ -507,7 +476,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result[1], n9k_show_ver_int_list_structured[1]) def test_show_run(self): - """UT: nxos module:show_run method""" expected_output = n9k_show_running_config_list[0] @@ -518,7 +486,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_show_ver(self): - """UT: nxos module:show_ver method""" expected_output = n9k_show_ver_list[0] @@ -529,7 +496,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_add_config(self): - """UT: nxos module:add_config method""" expected_output = "COMMAND_LIST: feature bgp" @@ -541,7 +507,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_config_commands(self): - """UT: nxos module:config method - Using commands arg""" commands = ["no feature ospf", ["no feature ospf"]] @@ -573,7 +538,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_config_commands_template_none(self): - """UT: nxos module:config method - Template engine is None""" commands = ["no feature ospf", ["no feature ospf"]] @@ -605,7 +569,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_config_commands_string(self): - """UT: nxos module:config method - Using commands arg and output is string""" commands = "no feature ospf" @@ -636,7 +599,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_config_file(self): - """UT: nxos module:config method - Using config_file arg""" config_file = "salt://bgp_config.txt" @@ -676,7 +638,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_config_file_error1(self): - """UT: nxos module:config method - Error file not found""" config_file = "salt://bgp_config.txt" @@ -704,7 +665,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): nxos_module.config(config_file=config_file) def test_config_nxos_error_ssh(self): - """UT: nxos module:config method - nxos device error over ssh transport""" commands = ["feature bgp", "router bgp 57"] @@ -740,7 +700,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, expected_output) def test_commands_error(self): - """UT: nxos module:config method - Mandatory arg commands not specified""" commands = None @@ -768,7 +727,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): nxos_module.config(commands=commands) def test_config_file_error2(self): - """UT: nxos module:config method - Mandatory arg config_file not specified""" config_file = None @@ -796,7 +754,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): nxos_module.config(config_file=config_file) def test_delete_config(self): - """UT: nxos module:delete_config method""" for lines in ["feature bgp", ["feature bgp"]]: @@ -806,7 +763,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, nxos_module.config.return_value) def test_remove_user(self): - """UT: nxos module:remove_user method""" with patch("salt.modules.nxos.config", autospec=True): @@ -815,7 +771,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, nxos_module.config.return_value) def test_replace(self): - """UT: nxos module:replace method""" old_value = "feature bgp" @@ -837,7 +792,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result["new"], ["feature ospf"]) def test_replace_full_match_true(self): - """UT: nxos module:replace method - full match true""" old_value = "feature bgp" @@ -859,7 +813,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result["new"], ["feature ospf"]) def test_replace_no_match(self): - """UT: nxos module:replace method - no match""" old_value = "feature does_not_exist" @@ -881,7 +834,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result["new"], []) def test_save_running_config(self): - """UT: nxos module:save_running_config method""" with patch( @@ -891,7 +843,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, save_running_config) def test_set_password_enc_false_cs_none(self): - """UT: nxos module:set_password method - encrypted False, crypt_salt None""" username = "devops" @@ -916,7 +867,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual("password_set", result) def test_set_password_enc_false_cs_set(self): - """UT: nxos module:set_password method - encrypted False, crypt_salt set""" username = "devops" @@ -944,7 +894,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual("password_set", result) def test_set_password_enc_true(self): - """UT: nxos module:set_password method - encrypted True""" username = "devops" @@ -968,7 +917,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual("password_set", result) def test_set_password_role_none(self): - """UT: nxos module:set_password method - role none""" username = "devops" @@ -993,7 +941,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual("password_set", result) def test_set_password_blowfish_crypt(self): - """UT: nxos module:set_password method - role none""" with self.assertRaises(SaltInvocationError): @@ -1002,7 +949,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): ) def test_set_role(self): - """UT: nxos module:save_running_config method""" username = "salt_test" @@ -1013,7 +959,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, set_role) def test_unset_role(self): - """UT: nxos module:save_running_config method""" username = "salt_test" @@ -1024,7 +969,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, unset_role) def test_configure_device(self): - """UT: nxos module:_configure_device method""" with patch("salt.utils.platform.is_proxy", autospec=True, return_value=True): @@ -1043,7 +987,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, "configured") def test_nxapi_config(self): - """UT: nxos module:_nxapi_config method""" mock_cmd = MagicMock(return_value={"nxos": {"save_config": False}}) @@ -1057,7 +1000,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, [["show version"], "router_data"]) def test_nxapi_config_failure(self): - """UT: nxos module:_nxapi_config method""" side_effect = ["Failure", "saved_data"] @@ -1073,7 +1015,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, [["show bad_command"], "Failure"]) def test_nxapi_request_proxy(self): - """UT: nxos module:_nxapi_request method - proxy""" with patch("salt.utils.platform.is_proxy", autospec=True, return_value=True): @@ -1087,7 +1028,6 @@ class NxosTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(result, "router_data") def test_nxapi_request_no_proxy(self): - """UT: nxos module:_nxapi_request method - no proxy""" with patch("salt.utils.platform.is_proxy", autospec=True, return_value=False): diff --git a/tests/unit/modules/test_nxos_upgrade.py b/tests/unit/modules/test_nxos_upgrade.py index 1b6be938ef4..1c0c5013caf 100644 --- a/tests/unit/modules/test_nxos_upgrade.py +++ b/tests/unit/modules/test_nxos_upgrade.py @@ -35,14 +35,12 @@ from tests.unit.modules.nxos.nxos_n95k import N95KPlatform class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): - """Test cases for salt.modules.nxos_upgrade""" platform_list = None @staticmethod def assert_platform_upgrade(condition, platform): - """Assert platform upgrade condition and display appropriate chassis & images upon assertion failure""" assert bool(condition), "{}: Upgrade {} -> {}".format( @@ -50,7 +48,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): ) def setup_loader_modules(self): - """Define list of platforms for Unit Test""" self.platform_list = [ @@ -81,7 +78,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): @staticmethod def test_check_upgrade_impact_input_validation(): - """UT: nxos_upgrade module:check_upgrade_impact method - input validation""" result = nxos_upgrade.check_upgrade_impact("dummy-platform-image.bin", issu=1) @@ -89,14 +85,12 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): @staticmethod def test_upgrade_input_validation(): - """UT: nxos_upgrade module:upgrade method - input validation""" result = nxos_upgrade.upgrade("dummy-platform-image.bin", issu=1) assert "Input Error" in result def test_check_upgrade_impact_backend_processing_error_500(self): - """UT: nxos_upgrade module:check_upgrade_impact method - error HTTP code 500""" for platform in self.platform_list: @@ -116,7 +110,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_check_upgrade_impact_internal_server_error_400_invalid_command(self): - """UT: nxos_upgrade module:check_upgrade_impact method - invalid command error HTTP code 400""" for platform in self.platform_list: @@ -134,7 +127,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_check_upgrade_impact_internal_server_error_400_in_progress(self): - """UT: nxos_upgrade module:check_upgrade_impact method - in-progress error HTTP code 400""" for platform in self.platform_list: @@ -152,7 +144,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_check_upgrade_impact_internal_server_error_500(self): - """UT: nxos_upgrade module:check_upgrade_impact method - internal server error HTTP code 500""" for platform in self.platform_list: @@ -176,7 +167,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_check_upgrade_impact_non_disruptive_success(self): - """UT: nxos_upgrade module:check_upgrade_impact method - non-disruptive success""" for platform in self.platform_list: @@ -197,7 +187,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(result["module_data"], platform) def test_check_upgrade_impact_disruptive_success(self): - """UT: nxos_upgrade module:check_upgrade_impact method - disruptive success""" for platform in self.platform_list: @@ -225,7 +214,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(result["module_data"], platform) def test_upgrade_show_install_all_impact_no_module_data(self): - """UT: nxos_upgrade module: upgrade method - no module data""" for platform in self.platform_list: @@ -245,7 +233,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): ) def test_upgrade_invalid_command(self): - """UT: nxos_upgrade module:upgrade method - invalid command""" for platform in self.platform_list: @@ -259,7 +246,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_upgrade_install_in_progress(self): - """UT: nxos_upgrade module:upgrade method - in-progress""" for platform in self.platform_list: @@ -277,7 +263,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_upgrade_install_in_progress_terminal_dont_ask(self): - """UT: nxos_upgrade module:upgrade method - in-progress (terminal don't-ask)""" for platform in self.platform_list: @@ -298,7 +283,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_upgrade_install_in_progress_sans_terminal_dont_ask(self): - """UT: nxos_upgrade module:upgrade method - in-progress (sans terminal don't-ask)""" for platform in self.platform_list: @@ -316,7 +300,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_upgrade_internal_server_error_500(self): - """UT: nxos_upgrade module:upgrade method - internal server error 500""" for platform in self.platform_list: @@ -337,7 +320,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_upgrade_install_all_disruptive(self): - """UT: nxos_upgrade module:upgrade method - install all disruptive""" for platform in self.platform_list: @@ -367,7 +349,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): ) def test_upgrade_install_all_non_disruptive(self): - """UT: nxos_upgrade module:upgrade method - install all non-disruptive""" for platform in self.platform_list: @@ -390,7 +371,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(result["succeeded"], platform) def test_upgrade_CommandExecutionError_Exception(self): - """UT: nxos_upgrade module:upgrade method - raise CommandExecutionError exception #1""" for platform in self.platform_list: @@ -418,7 +398,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(not result["succeeded"], platform) def test_upgrade_CommandExecutionError_Exception2(self): - """UT: nxos_upgrade module:upgrade method - raise CommandExecutionError exception #2""" for platform in self.platform_list: @@ -454,7 +433,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(result["succeeded"], platform) def test_upgrade_NxosError_Exception(self): - """UT: nxos_upgrade module:upgrade method - raise NxosError exception""" for platform in self.platform_list: @@ -485,7 +463,6 @@ class NxosUpgradeTestCase(TestCase, LoaderModuleMockMixin): self.assert_platform_upgrade(result["succeeded"], platform) def test_upgrade_NxosError_Exception2(self): - """UT: nxos_upgrade module:upgrade method - raise NxosError exception #2""" for platform in self.platform_list: diff --git a/tests/unit/modules/test_openstack_config.py b/tests/unit/modules/test_openstack_config.py index 56976992c21..d014547160d 100644 --- a/tests/unit/modules/test_openstack_config.py +++ b/tests/unit/modules/test_openstack_config.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.openstack_config as openstack_config from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_opkg.py b/tests/unit/modules/test_opkg.py index d1df495db4b..6242f5fa31a 100644 --- a/tests/unit/modules/test_opkg.py +++ b/tests/unit/modules/test_opkg.py @@ -51,9 +51,9 @@ class OpkgTestCase(TestCase, LoaderModuleMockMixin): @classmethod def tearDownClass(cls): - cls.opkg_vim_info = ( - cls.opkg_vim_files - ) = cls.installed = cls.removed = cls.packages = None + cls.opkg_vim_info = cls.opkg_vim_files = cls.installed = cls.removed = ( + cls.packages + ) = None def setup_loader_modules(self): # pylint: disable=no-self-use """ diff --git a/tests/unit/modules/test_parted_partition.py b/tests/unit/modules/test_parted_partition.py index b164569c0c4..72fdded4af0 100644 --- a/tests/unit/modules/test_parted_partition.py +++ b/tests/unit/modules/test_parted_partition.py @@ -6,7 +6,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import salt.modules.parted_partition as parted from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_rh_ip.py b/tests/unit/modules/test_rh_ip.py index d061978ae35..0a38a24f942 100644 --- a/tests/unit/modules/test_rh_ip.py +++ b/tests/unit/modules/test_rh_ip.py @@ -791,9 +791,7 @@ class RhipTestCase(TestCase, LoaderModuleMockMixin): "lacp_rate={}".format( "1" if lacp_rate == "fast" - else "0" - if lacp_rate == "slow" - else lacp_rate + else "0" if lacp_rate == "slow" else lacp_rate ), "miimon=100", "mode=4", diff --git a/tests/unit/modules/test_snapper.py b/tests/unit/modules/test_snapper.py index 0729ad9a1ef..2ca4250e642 100644 --- a/tests/unit/modules/test_snapper.py +++ b/tests/unit/modules/test_snapper.py @@ -4,6 +4,7 @@ Unit tests for the Snapper module :codeauthor: Duncan Mac-Vicar P. :codeauthor: Pablo Suárez Hernández """ + import pytest import salt.modules.snapper as snapper diff --git a/tests/unit/modules/test_sqlite3.py b/tests/unit/modules/test_sqlite3.py index 1b534e7d963..8b69855dcce 100644 --- a/tests/unit/modules/test_sqlite3.py +++ b/tests/unit/modules/test_sqlite3.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.sqlite3 as sqlite3 from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase diff --git a/tests/unit/modules/test_supervisord.py b/tests/unit/modules/test_supervisord.py index 1d4ce112f27..8bcae14288e 100644 --- a/tests/unit/modules/test_supervisord.py +++ b/tests/unit/modules/test_supervisord.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.supervisord as supervisord from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_sysmod.py b/tests/unit/modules/test_sysmod.py index 125f17d8606..79711787084 100644 --- a/tests/unit/modules/test_sysmod.py +++ b/tests/unit/modules/test_sysmod.py @@ -2,7 +2,6 @@ :codeauthor: Jayesh Kariya """ - import salt.modules.sysmod as sysmod from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import patch diff --git a/tests/unit/modules/test_systemd_service.py b/tests/unit/modules/test_systemd_service.py index f07773925fe..5e3715726cc 100644 --- a/tests/unit/modules/test_systemd_service.py +++ b/tests/unit/modules/test_systemd_service.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import os import pytest diff --git a/tests/unit/modules/test_twilio_notify.py b/tests/unit/modules/test_twilio_notify.py index 682cb7f7711..4785e4a974d 100644 --- a/tests/unit/modules/test_twilio_notify.py +++ b/tests/unit/modules/test_twilio_notify.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.twilio_notify as twilio_notify diff --git a/tests/unit/modules/test_useradd.py b/tests/unit/modules/test_useradd.py index bc7903dd5bb..533e3644b3e 100644 --- a/tests/unit/modules/test_useradd.py +++ b/tests/unit/modules/test_useradd.py @@ -1,6 +1,7 @@ """ :codeauthor: Jayesh Kariya """ + import pytest import salt.modules.useradd as useradd diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py index 2fee41f8bd9..374429c7733 100644 --- a/tests/unit/modules/test_virt.py +++ b/tests/unit/modules/test_virt.py @@ -1831,18 +1831,22 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): ret = virt._diff_disk_lists(old_disks, new_disks) self.assertEqual( [ - disk.find("source").get("file") - if disk.find("source") is not None - else None + ( + disk.find("source").get("file") + if disk.find("source") is not None + else None + ) for disk in ret["unchanged"] ], [], ) self.assertEqual( [ - disk.find("source").get("file") - if disk.find("source") is not None - else None + ( + disk.find("source").get("file") + if disk.find("source") is not None + else None + ) for disk in ret["new"] ], ["/path/to/img3.qcow2", "/path/to/img0.qcow2", "/path/to/img4.qcow2", None], @@ -1853,9 +1857,11 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): ) self.assertEqual( [ - disk.find("source").get("file") - if disk.find("source") is not None - else None + ( + disk.find("source").get("file") + if disk.find("source") is not None + else None + ) for disk in ret["sorted"] ], ["/path/to/img3.qcow2", "/path/to/img0.qcow2", "/path/to/img4.qcow2", None], @@ -1863,9 +1869,11 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): self.assertEqual(ret["new"][1].find("target").get("bus"), "virtio") self.assertEqual( [ - disk.find("source").get("file") - if disk.find("source") is not None - else None + ( + disk.find("source").get("file") + if disk.find("source") is not None + else None + ) for disk in ret["deleted"] ], [ @@ -3501,9 +3509,7 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): }, virt.update("vm_with_memtune_param", mem=memtune_new_val), ) - self.assertEqual( - domain_mock.setMemoryFlags.call_args[0][0], int(2.5 * 1024**2) - ) + self.assertEqual(domain_mock.setMemoryFlags.call_args[0][0], int(2.5 * 1024**2)) setxml = ET.fromstring(define_mock.call_args[0][0]) self.assertEqual( @@ -3569,9 +3575,7 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): }, virt.update("vm_with_memtune_param", mem=max_swap_none), ) - self.assertEqual( - domain_mock.setMemoryFlags.call_args[0][0], int(2.5 * 1024**2) - ) + self.assertEqual(domain_mock.setMemoryFlags.call_args[0][0], int(2.5 * 1024**2)) setxml = ET.fromstring(define_mock.call_args[0][0]) self.assertEqual( diff --git a/tests/unit/modules/test_vsphere.py b/tests/unit/modules/test_vsphere.py index 7dcb13e4d30..1bb61e8e4e7 100644 --- a/tests/unit/modules/test_vsphere.py +++ b/tests/unit/modules/test_vsphere.py @@ -4,6 +4,7 @@ Tests for functions in salt.modules.vsphere """ + import pytest import salt.modules.vsphere as vsphere diff --git a/tests/unit/modules/test_win_system.py b/tests/unit/modules/test_win_system.py index 9a217c93d0e..ea73661dc39 100644 --- a/tests/unit/modules/test_win_system.py +++ b/tests/unit/modules/test_win_system.py @@ -633,6 +633,7 @@ class WinSystemTestCase(TestCase, LoaderModuleMockMixin): the WMI Class Win32_Processor. Older versions of Windows are missing this property """ + # Create a mock processor class that does not have the # NumberOfCoresEnabled property class MockWMIProcessor: diff --git a/tests/unit/modules/test_zypperpkg.py b/tests/unit/modules/test_zypperpkg.py index 22137a2544f..4a8ec916f5b 100644 --- a/tests/unit/modules/test_zypperpkg.py +++ b/tests/unit/modules/test_zypperpkg.py @@ -2,7 +2,6 @@ :codeauthor: Bo Maryniuk """ - import configparser import errno import io diff --git a/tests/unit/states/test_group.py b/tests/unit/states/test_group.py index b9bf3434e72..eaa1c61cf8f 100644 --- a/tests/unit/states/test_group.py +++ b/tests/unit/states/test_group.py @@ -2,7 +2,6 @@ :codeauthor: Rahul Handay """ - import salt.states.group as group from salt.utils.odict import OrderedDict from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/states/test_module.py b/tests/unit/states/test_module.py index a705bd30285..0543ff87824 100644 --- a/tests/unit/states/test_module.py +++ b/tests/unit/states/test_module.py @@ -2,7 +2,6 @@ :codeauthor: Nicole Thomas (nicole@saltstack.com) """ - import logging from inspect import ArgSpec diff --git a/tests/unit/states/test_syslog_ng.py b/tests/unit/states/test_syslog_ng.py index f367df58b17..132d95ad903 100644 --- a/tests/unit/states/test_syslog_ng.py +++ b/tests/unit/states/test_syslog_ng.py @@ -2,7 +2,6 @@ Test module for syslog_ng state """ - import os import re import tempfile diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 5cc58c273d0..08b5684a1d7 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -1,6 +1,7 @@ """ Unit tests for salt.config """ + import logging import os import textwrap diff --git a/tests/unit/test_zypp_plugins.py b/tests/unit/test_zypp_plugins.py index 64bc86b49d3..2bfbeab15c9 100644 --- a/tests/unit/test_zypp_plugins.py +++ b/tests/unit/test_zypp_plugins.py @@ -1,6 +1,7 @@ """ :codeauthor: Bo Maryniuk """ + import imp # pylint: disable=deprecated-module import os diff --git a/tests/unit/transport/test_ipc.py b/tests/unit/transport/test_ipc.py index 4a159ea8efb..91ad57d312b 100644 --- a/tests/unit/transport/test_ipc.py +++ b/tests/unit/transport/test_ipc.py @@ -1,6 +1,7 @@ """ :codeauthor: Mike Place """ + import errno import logging import os diff --git a/tests/unit/utils/test_color.py b/tests/unit/utils/test_color.py index b80b2e4eaf1..741db780a23 100644 --- a/tests/unit/utils/test_color.py +++ b/tests/unit/utils/test_color.py @@ -2,7 +2,6 @@ Unit tests for salt.utils.color.py """ - import salt.utils.color from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_decorators.py b/tests/unit/utils/test_decorators.py index 21992ccacc4..e3be199a028 100644 --- a/tests/unit/utils/test_decorators.py +++ b/tests/unit/utils/test_decorators.py @@ -3,7 +3,6 @@ unit.utils.decorators_test """ - import inspect import salt.utils.decorators as decorators diff --git a/tests/unit/utils/test_doc.py b/tests/unit/utils/test_doc.py index 62be2d15880..31088ac0831 100644 --- a/tests/unit/utils/test_doc.py +++ b/tests/unit/utils/test_doc.py @@ -2,7 +2,6 @@ Unit Tests for functions located in salt.utils.doc.py. """ - import salt.utils.doc from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_environment.py b/tests/unit/utils/test_environment.py index d36de65a33d..54972226994 100644 --- a/tests/unit/utils/test_environment.py +++ b/tests/unit/utils/test_environment.py @@ -1,6 +1,7 @@ """ Test case for utils/__init__.py """ + import salt.utils.environment from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_extend.py b/tests/unit/utils/test_extend.py index d96f588decc..94a9a92ca51 100644 --- a/tests/unit/utils/test_extend.py +++ b/tests/unit/utils/test_extend.py @@ -4,6 +4,7 @@ Test the salt extend script, leave templates/test alone to keep this working! """ + import os import shutil from datetime import date diff --git a/tests/unit/utils/test_filebuffer.py b/tests/unit/utils/test_filebuffer.py index b88a2f4fc56..5f0fc0f3fdb 100644 --- a/tests/unit/utils/test_filebuffer.py +++ b/tests/unit/utils/test_filebuffer.py @@ -6,7 +6,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - import os from salt.utils.filebuffer import BufferedReader, InvalidFileMode diff --git a/tests/unit/utils/test_immutabletypes.py b/tests/unit/utils/test_immutabletypes.py index 745f9b933ed..28afcaac698 100644 --- a/tests/unit/utils/test_immutabletypes.py +++ b/tests/unit/utils/test_immutabletypes.py @@ -8,7 +8,6 @@ Test salt.utils.immutabletypes """ - import salt.utils.immutabletypes as immutabletypes from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_jid.py b/tests/unit/utils/test_jid.py index f6749228304..1409334c33f 100644 --- a/tests/unit/utils/test_jid.py +++ b/tests/unit/utils/test_jid.py @@ -2,7 +2,6 @@ Tests for salt.utils.jid """ - import datetime import os diff --git a/tests/unit/utils/test_job.py b/tests/unit/utils/test_job.py index 3d25719ade3..2e824e02351 100644 --- a/tests/unit/utils/test_job.py +++ b/tests/unit/utils/test_job.py @@ -2,7 +2,6 @@ unit tests for salt.utils.job """ - import salt.minion import salt.utils.job as job from tests.support.mock import patch diff --git a/tests/unit/utils/test_mac_utils.py b/tests/unit/utils/test_mac_utils.py index 9de2b56a844..609c939cd8d 100644 --- a/tests/unit/utils/test_mac_utils.py +++ b/tests/unit/utils/test_mac_utils.py @@ -1,6 +1,7 @@ """ mac_utils tests """ + import os import plistlib import subprocess diff --git a/tests/unit/utils/test_msgpack.py b/tests/unit/utils/test_msgpack.py index 4c41d212d47..90ad80d235f 100644 --- a/tests/unit/utils/test_msgpack.py +++ b/tests/unit/utils/test_msgpack.py @@ -1,6 +1,7 @@ """ Test the MessagePack utility """ + import inspect import os import pprint diff --git a/tests/unit/utils/test_proxy.py b/tests/unit/utils/test_proxy.py index 1c9a34ede31..a2ea8a6b660 100644 --- a/tests/unit/utils/test_proxy.py +++ b/tests/unit/utils/test_proxy.py @@ -3,7 +3,6 @@ :codeauthor: :email:`Gareth J. Greenaway ` """ - import salt.utils.proxy from tests.support.mock import patch from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_roster_matcher.py b/tests/unit/utils/test_roster_matcher.py index d49bc29f1de..b3ce554c837 100644 --- a/tests/unit/utils/test_roster_matcher.py +++ b/tests/unit/utils/test_roster_matcher.py @@ -1,6 +1,7 @@ """ Test generic roster matching utility. """ + import os import pytest diff --git a/tests/unit/utils/test_sdb.py b/tests/unit/utils/test_sdb.py index 87886cbc521..614a7173481 100644 --- a/tests/unit/utils/test_sdb.py +++ b/tests/unit/utils/test_sdb.py @@ -2,7 +2,6 @@ :codeauthor: :email:`Vernon Cole ` """ - import os import salt.utils.sdb as sdb diff --git a/tests/unit/utils/test_state.py b/tests/unit/utils/test_state.py index 1b533e494f2..cae261d2052 100644 --- a/tests/unit/utils/test_state.py +++ b/tests/unit/utils/test_state.py @@ -2,7 +2,6 @@ Unit Tests for functions located in salt.utils.state.py. """ - import copy import textwrap diff --git a/tests/unit/utils/test_thin.py b/tests/unit/utils/test_thin.py index 28f26824118..f5a8d384d3a 100644 --- a/tests/unit/utils/test_thin.py +++ b/tests/unit/utils/test_thin.py @@ -1395,7 +1395,7 @@ class SSHThinTestCase(TestCase): thin_dir = venv.venv_dir / "thin" thin_archive = thin_dir / "thin.tgz" tar = tarfile.open(str(thin_archive)) - tar.extractall(str(thin_dir)) + tar.extractall(str(thin_dir)) # nosec tar.close() ret = venv.run( venv.venv_python, diff --git a/tests/unit/utils/test_vmware.py b/tests/unit/utils/test_vmware.py index 5294897c023..697171a067c 100644 --- a/tests/unit/utils/test_vmware.py +++ b/tests/unit/utils/test_vmware.py @@ -3701,9 +3701,9 @@ class GetLicenseAssignmentManagerTestCase(TestCase): def setUp(self): self.mock_si = MagicMock() self.mock_lic_assign_mgr = MagicMock() - type( - self.mock_si.content.licenseManager - ).licenseAssignmentManager = PropertyMock(return_value=self.mock_lic_assign_mgr) + type(self.mock_si.content.licenseManager).licenseAssignmentManager = ( + PropertyMock(return_value=self.mock_lic_assign_mgr) + ) def tearDown(self): for attr in ("mock_si", "mock_lic_assign_mgr"): @@ -3712,9 +3712,9 @@ class GetLicenseAssignmentManagerTestCase(TestCase): def test_raise_no_permission(self): exc = vim.fault.NoPermission() exc.privilegeId = "Fake privilege" - type( - self.mock_si.content.licenseManager - ).licenseAssignmentManager = PropertyMock(side_effect=exc) + type(self.mock_si.content.licenseManager).licenseAssignmentManager = ( + PropertyMock(side_effect=exc) + ) with self.assertRaises(VMwareApiError) as excinfo: salt.utils.vmware.get_license_assignment_manager(self.mock_si) self.assertEqual( @@ -3725,9 +3725,9 @@ class GetLicenseAssignmentManagerTestCase(TestCase): def test_raise_vim_fault(self): exc = vim.fault.VimFault() exc.msg = "VimFault msg" - type( - self.mock_si.content.licenseManager - ).licenseAssignmentManager = PropertyMock(side_effect=exc) + type(self.mock_si.content.licenseManager).licenseAssignmentManager = ( + PropertyMock(side_effect=exc) + ) with self.assertRaises(VMwareApiError) as excinfo: salt.utils.vmware.get_license_assignment_manager(self.mock_si) self.assertEqual(excinfo.exception.strerror, "VimFault msg") @@ -3735,17 +3735,17 @@ class GetLicenseAssignmentManagerTestCase(TestCase): def test_raise_runtime_fault(self): exc = vmodl.RuntimeFault() exc.msg = "RuntimeFault msg" - type( - self.mock_si.content.licenseManager - ).licenseAssignmentManager = PropertyMock(side_effect=exc) + type(self.mock_si.content.licenseManager).licenseAssignmentManager = ( + PropertyMock(side_effect=exc) + ) with self.assertRaises(VMwareRuntimeError) as excinfo: salt.utils.vmware.get_license_assignment_manager(self.mock_si) self.assertEqual(excinfo.exception.strerror, "RuntimeFault msg") def test_empty_license_assignment_manager(self): - type( - self.mock_si.content.licenseManager - ).licenseAssignmentManager = PropertyMock(return_value=None) + type(self.mock_si.content.licenseManager).licenseAssignmentManager = ( + PropertyMock(return_value=None) + ) with self.assertRaises(VMwareObjectRetrievalError) as excinfo: salt.utils.vmware.get_license_assignment_manager(self.mock_si) self.assertEqual( diff --git a/tests/unit/utils/test_vsan.py b/tests/unit/utils/test_vsan.py index 8231776d694..fe2cd6cf5c9 100644 --- a/tests/unit/utils/test_vsan.py +++ b/tests/unit/utils/test_vsan.py @@ -3,6 +3,7 @@ Tests functions in salt.utils.vsan """ + import logging import pytest diff --git a/tests/unit/utils/test_win_chcp.py b/tests/unit/utils/test_win_chcp.py index 7fa0f0c35a8..b93e38f6b92 100644 --- a/tests/unit/utils/test_win_chcp.py +++ b/tests/unit/utils/test_win_chcp.py @@ -1,6 +1,7 @@ """ Test win_chcp """ + import pytest from salt.exceptions import CodePageError diff --git a/tests/unit/utils/test_xmlutil.py b/tests/unit/utils/test_xmlutil.py index d9a4ae5cc0c..4170cd80ffe 100644 --- a/tests/unit/utils/test_xmlutil.py +++ b/tests/unit/utils/test_xmlutil.py @@ -2,6 +2,7 @@ tests.unit.xmlutil_test ~~~~~~~~~~~~~~~~~~~~ """ + import xml.etree.ElementTree as ET import salt.utils.xmlutil as xml diff --git a/tests/unit/utils/test_yamlencoding.py b/tests/unit/utils/test_yamlencoding.py index 179b7067cd1..6e0876cbe83 100644 --- a/tests/unit/utils/test_yamlencoding.py +++ b/tests/unit/utils/test_yamlencoding.py @@ -2,7 +2,6 @@ Tests for salt.utils.yamlencoding """ - import salt.utils.yaml import salt.utils.yamlencoding from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_zeromq.py b/tests/unit/utils/test_zeromq.py index 1dcd69af997..fdb4faaaeb1 100644 --- a/tests/unit/utils/test_zeromq.py +++ b/tests/unit/utils/test_zeromq.py @@ -1,6 +1,7 @@ """ Test salt.utils.zeromq """ + import pytest import zmq diff --git a/tests/unit/utils/test_zfs.py b/tests/unit/utils/test_zfs.py index 253710f94fe..cdde04336de 100644 --- a/tests/unit/utils/test_zfs.py +++ b/tests/unit/utils/test_zfs.py @@ -9,7 +9,6 @@ Tests for the zfs utils library .. versionadded:: 2018.3.1 """ - import salt.utils.zfs as zfs from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch diff --git a/tools/changelog.py b/tools/changelog.py index 99c81c40082..ab6a4e79de6 100644 --- a/tools/changelog.py +++ b/tools/changelog.py @@ -1,6 +1,7 @@ """ These commands are used manage Salt's changelog. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/ci.py b/tools/ci.py index 695adbc1204..f2126b7fa9a 100644 --- a/tools/ci.py +++ b/tools/ci.py @@ -1,6 +1,7 @@ """ These commands are used in the CI pipeline. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/docs.py b/tools/docs.py index b36e676d974..6e5ad281c12 100644 --- a/tools/docs.py +++ b/tools/docs.py @@ -1,6 +1,7 @@ """ These commands are used to generate Salt's manpages. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/pkg/__init__.py b/tools/pkg/__init__.py index 38bf0090ba5..7797c78df56 100644 --- a/tools/pkg/__init__.py +++ b/tools/pkg/__init__.py @@ -1,6 +1,7 @@ """ These commands are used to build Salt packages. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations @@ -62,7 +63,7 @@ class Recompress: d_targz = tempd.joinpath(targz.name) with tarfile.open(d_tar, "w|") as wfile: with tarfile.open(targz, "r:gz") as rfile: - rfile.extractall(d_src) + rfile.extractall(d_src) # nosec extracted_dir = next(pathlib.Path(d_src).iterdir()) for name in sorted(extracted_dir.rglob("*")): wfile.add( diff --git a/tools/pkg/build.py b/tools/pkg/build.py index 0aeb26da774..b6b18ba09a6 100644 --- a/tools/pkg/build.py +++ b/tools/pkg/build.py @@ -1,6 +1,7 @@ """ These commands are used to build the salt onedir and system packages. """ + # pylint: disable=resource-leakage,broad-except from __future__ import annotations @@ -230,7 +231,7 @@ def macos( ctx.info(f"Extracting the onedir artifact to {build_root}") with tarfile.open(str(onedir_artifact)) as tarball: with ctx.chdir(onedir_artifact.parent): - tarball.extractall(path=build_root) + tarball.extractall(path=build_root) # nosec else: ctx.info("Building package without an existing onedir") @@ -360,7 +361,7 @@ def windows( unzip_dir = checkout / "pkg" / "windows" ctx.info(f"Unzipping the onedir artifact to {unzip_dir}") with zipfile.ZipFile(onedir_artifact, mode="r") as archive: - archive.extractall(unzip_dir) + archive.extractall(unzip_dir) # nosec move_dir = unzip_dir / "salt" build_env = unzip_dir / "buildenv" diff --git a/tools/pkg/repo/__init__.py b/tools/pkg/repo/__init__.py index ed1bbf6574e..025529866b2 100644 --- a/tools/pkg/repo/__init__.py +++ b/tools/pkg/repo/__init__.py @@ -1,6 +1,7 @@ """ These commands are used to build the package repository files. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/pkg/repo/create.py b/tools/pkg/repo/create.py index 65133d1d63a..f13a8fc1917 100644 --- a/tools/pkg/repo/create.py +++ b/tools/pkg/repo/create.py @@ -1,6 +1,7 @@ """ These commands are used to build the package repository files. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/pkg/repo/publish.py b/tools/pkg/repo/publish.py index d31bb8a1487..108ba7ec379 100644 --- a/tools/pkg/repo/publish.py +++ b/tools/pkg/repo/publish.py @@ -1,6 +1,7 @@ """ These commands are used to build the package repository files. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/precommit/__init__.py b/tools/precommit/__init__.py index c10eadeb479..2bffffbb2ec 100644 --- a/tools/precommit/__init__.py +++ b/tools/precommit/__init__.py @@ -1,6 +1,7 @@ """ These commands, and sub-commands, are used by pre-commit. """ + from ptscripts import command_group import tools.utils diff --git a/tools/precommit/changelog.py b/tools/precommit/changelog.py index 99e3afbf116..027636e50de 100644 --- a/tools/precommit/changelog.py +++ b/tools/precommit/changelog.py @@ -1,6 +1,7 @@ """ These commands are used to validate changelog entries """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/precommit/docs.py b/tools/precommit/docs.py index a549a6cecf3..0c00844c407 100644 --- a/tools/precommit/docs.py +++ b/tools/precommit/docs.py @@ -1,6 +1,7 @@ """ Check salt code base for for missing or wrong docs """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/precommit/docstrings.py b/tools/precommit/docstrings.py index 29a7e0eb4e0..b26f8b1a954 100644 --- a/tools/precommit/docstrings.py +++ b/tools/precommit/docstrings.py @@ -1,6 +1,7 @@ """ Check salt code base for for missing or wrong docstrings. """ + # Skip mypy checks since it will follow into Salt which doesn't yet have proper types defined # mypy: ignore-errors # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated diff --git a/tools/precommit/filemap.py b/tools/precommit/filemap.py index 96a662fa7e7..7870375f299 100644 --- a/tools/precommit/filemap.py +++ b/tools/precommit/filemap.py @@ -1,6 +1,7 @@ """ `tests/filename_map.yml` validity checks """ + import pathlib import re diff --git a/tools/precommit/workflows.py b/tools/precommit/workflows.py index 290d9f70847..d08567dca9c 100644 --- a/tools/precommit/workflows.py +++ b/tools/precommit/workflows.py @@ -1,6 +1,7 @@ """ These commands are used for our GitHub Actions workflows. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/release.py b/tools/release.py index 6a1893e5b27..db58f2fa6fa 100644 --- a/tools/release.py +++ b/tools/release.py @@ -1,6 +1,7 @@ """ These commands are used to release Salt. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/testsuite/__init__.py b/tools/testsuite/__init__.py index 25a16c7a278..27ebe572465 100644 --- a/tools/testsuite/__init__.py +++ b/tools/testsuite/__init__.py @@ -1,6 +1,7 @@ """ These commands are related to the test suite. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/testsuite/download.py b/tools/testsuite/download.py index 4e4832c798c..8c5572b07e2 100644 --- a/tools/testsuite/download.py +++ b/tools/testsuite/download.py @@ -1,6 +1,7 @@ """ These commands are related to downloading test suite CI artifacts. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations diff --git a/tools/vm.py b/tools/vm.py index eed42eeebc6..85aed8e0afd 100644 --- a/tools/vm.py +++ b/tools/vm.py @@ -2,6 +2,7 @@ These commands are used to create/destroy VMs, sync the local checkout to the VM and to run commands on the VM. """ + # pylint: disable=resource-leakage,broad-except,3rd-party-module-not-gated from __future__ import annotations From 03ad4c63372a60267ea35c989930841bf1cc68cf Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 27 Feb 2024 11:08:46 +0000 Subject: [PATCH 33/34] Update code to be Py3.7+ to reduce merge forward conflicts --- .gitignore | 1 + .pre-commit-config.yaml | 4 +- doc/_ext/saltdomain.py | 12 +- noxfile.py | 28 +- salt/__init__.py | 2 +- salt/_logging/impl.py | 18 +- salt/auth/__init__.py | 12 +- salt/auth/django.py | 2 +- salt/auth/ldap.py | 12 +- salt/auth/pam.py | 7 +- salt/beacons/__init__.py | 36 +- salt/beacons/btmp.py | 2 +- salt/beacons/diskusage.py | 2 +- salt/beacons/inotify.py | 4 +- salt/beacons/napalm_beacon.py | 2 +- salt/beacons/salt_monitor.py | 10 +- salt/beacons/salt_proxy.py | 4 +- salt/beacons/sensehat.py | 4 +- salt/beacons/sh.py | 2 +- salt/beacons/smartos_imgadm.py | 4 +- salt/beacons/smartos_vmadm.py | 4 +- salt/beacons/status.py | 6 +- salt/beacons/wtmp.py | 2 +- salt/cache/__init__.py | 16 +- salt/cache/consul.py | 36 +- salt/cache/etcd_cache.py | 38 +- salt/cache/localfs.py | 24 +- salt/cache/mysql_cache.py | 6 +- salt/cache/redis_cache.py | 2 +- salt/channel/client.py | 4 +- salt/channel/server.py | 4 +- salt/cli/batch.py | 2 +- salt/cli/caller.py | 16 +- salt/cli/salt.py | 24 +- salt/client/__init__.py | 40 +- salt/client/mixins.py | 6 +- salt/client/netapi.py | 2 +- salt/client/ssh/shell.py | 45 +- salt/client/ssh/wrapper/__init__.py | 14 +- salt/client/ssh/wrapper/config.py | 4 +- salt/client/ssh/wrapper/cp.py | 2 +- salt/cloud/__init__.py | 72 ++- salt/cloud/clouds/aliyun.py | 18 +- salt/cloud/clouds/azurearm.py | 20 +- salt/cloud/clouds/clc.py | 2 +- salt/cloud/clouds/cloudstack.py | 12 +- salt/cloud/clouds/digitalocean.py | 22 +- salt/cloud/clouds/ec2.py | 70 ++- salt/cloud/clouds/gce.py | 26 +- salt/cloud/clouds/gogrid.py | 6 +- salt/cloud/clouds/hetzner.py | 42 +- salt/cloud/clouds/joyent.py | 28 +- salt/cloud/clouds/libvirt.py | 30 +- salt/cloud/clouds/linode.py | 78 ++-- salt/cloud/clouds/lxc.py | 22 +- salt/cloud/clouds/msazure.py | 6 +- salt/cloud/clouds/oneandone.py | 22 +- salt/cloud/clouds/opennebula.py | 44 +- salt/cloud/clouds/openstack.py | 6 +- salt/cloud/clouds/packet.py | 14 +- salt/cloud/clouds/parallels.py | 24 +- salt/cloud/clouds/profitbricks.py | 24 +- salt/cloud/clouds/proxmox.py | 34 +- salt/cloud/clouds/qingcloud.py | 22 +- salt/cloud/clouds/saltify.py | 8 +- salt/cloud/clouds/scaleway.py | 12 +- salt/cloud/clouds/softlayer.py | 10 +- salt/cloud/clouds/softlayer_hw.py | 10 +- salt/cloud/clouds/tencentcloud.py | 30 +- salt/cloud/clouds/vagrant.py | 12 +- salt/cloud/clouds/virtualbox.py | 6 +- salt/cloud/clouds/vmware.py | 44 +- salt/cloud/clouds/xen.py | 20 +- salt/cloud/libcloudfuncs.py | 20 +- salt/config/__init__.py | 18 +- salt/config/schemas/common.py | 2 +- salt/crypt.py | 6 +- salt/daemons/__init__.py | 2 +- salt/daemons/masterapi.py | 14 +- salt/defaults/__init__.py | 4 +- salt/engines/__init__.py | 6 +- salt/engines/ircbot.py | 18 +- salt/engines/libvirt_events.py | 10 +- salt/engines/napalm_syslog.py | 2 +- salt/engines/script.py | 2 +- salt/engines/slack.py | 6 +- salt/exceptions.py | 2 +- salt/executors/docker.py | 2 +- salt/executors/sudo.py | 2 +- salt/fileclient.py | 26 +- salt/fileserver/__init__.py | 42 +- salt/fileserver/hgfs.py | 20 +- salt/fileserver/roots.py | 8 +- salt/fileserver/svnfs.py | 6 +- salt/grains/core.py | 104 ++--- salt/grains/disks.py | 6 +- salt/grains/lvm.py | 10 +- salt/grains/mdata.py | 4 +- salt/grains/metadata.py | 2 +- salt/key.py | 16 +- salt/loader/__init__.py | 6 +- salt/loader/lazy.py | 26 +- salt/log_handlers/fluent_mod.py | 8 +- salt/log_handlers/logstash_mod.py | 4 +- salt/log_handlers/sentry_mod.py | 2 +- salt/master.py | 18 +- salt/matchers/compound_match.py | 2 +- salt/matchers/ipcidr_match.py | 2 +- salt/matchers/list_match.py | 2 +- salt/metaproxy/deltaproxy.py | 38 +- salt/metaproxy/proxy.py | 36 +- salt/minion.py | 46 +- salt/modules/acme.py | 42 +- salt/modules/aix_group.py | 12 +- salt/modules/aix_shadow.py | 4 +- salt/modules/aixpkg.py | 30 +- salt/modules/aliases.py | 4 +- salt/modules/alternatives.py | 2 +- salt/modules/ansiblegate.py | 51 +-- salt/modules/apache.py | 42 +- salt/modules/apf.py | 8 +- salt/modules/apkpkg.py | 2 +- salt/modules/aptly.py | 34 +- salt/modules/aptpkg.py | 72 ++- salt/modules/archive.py | 54 +-- salt/modules/arista_pyeapi.py | 4 +- salt/modules/artifactory.py | 2 +- salt/modules/at.py | 14 +- salt/modules/at_solaris.py | 22 +- salt/modules/augeas_cfg.py | 12 +- salt/modules/aws_sqs.py | 6 +- salt/modules/azurearm_compute.py | 6 +- salt/modules/azurearm_dns.py | 12 +- salt/modules/azurearm_network.py | 96 ++-- salt/modules/azurearm_resource.py | 30 +- salt/modules/bamboohr.py | 8 +- salt/modules/baredoc.py | 4 +- salt/modules/bcache.py | 50 +-- salt/modules/beacons.py | 46 +- salt/modules/bigip.py | 72 ++- salt/modules/bluez_bluetooth.py | 18 +- salt/modules/boto3_elasticache.py | 72 ++- salt/modules/boto_apigateway.py | 20 +- salt/modules/boto_asg.py | 16 +- salt/modules/boto_cfn.py | 10 +- salt/modules/boto_cloudfront.py | 2 +- salt/modules/boto_cloudtrail.py | 2 +- salt/modules/boto_cloudwatch_event.py | 8 +- salt/modules/boto_cognitoidentity.py | 2 +- salt/modules/boto_datapipeline.py | 2 +- salt/modules/boto_ec2.py | 16 +- salt/modules/boto_elasticache.py | 36 +- salt/modules/boto_elasticsearch_domain.py | 4 +- salt/modules/boto_elb.py | 4 +- salt/modules/boto_iam.py | 2 +- salt/modules/boto_iot.py | 4 +- salt/modules/boto_kinesis.py | 2 +- salt/modules/boto_lambda.py | 8 +- salt/modules/boto_rds.py | 44 +- salt/modules/boto_route53.py | 8 +- salt/modules/boto_s3_bucket.py | 2 +- salt/modules/boto_secgroup.py | 6 +- salt/modules/boto_sns.py | 4 +- salt/modules/boto_vpc.py | 110 ++--- salt/modules/bridge.py | 56 +-- salt/modules/bsd_shadow.py | 6 +- salt/modules/btrfs.py | 94 ++-- salt/modules/cabal.py | 6 +- salt/modules/capirca_acl.py | 14 +- salt/modules/cassandra_cql.py | 36 +- salt/modules/chef.py | 10 +- salt/modules/chronos.py | 6 +- salt/modules/chroot.py | 4 +- salt/modules/cimc.py | 22 +- salt/modules/ciscoconfparse_mod.py | 2 +- salt/modules/cmdmod.py | 114 +++-- salt/modules/composer.py | 4 +- salt/modules/config.py | 4 +- salt/modules/consul.py | 94 ++-- salt/modules/cp.py | 2 +- salt/modules/cpan.py | 4 +- salt/modules/cron.py | 8 +- salt/modules/cryptdev.py | 10 +- salt/modules/csf.py | 46 +- salt/modules/cyg.py | 16 +- salt/modules/daemontools.py | 16 +- salt/modules/datadog_api.py | 2 +- salt/modules/ddns.py | 18 +- salt/modules/deb_apache.py | 40 +- salt/modules/debconfmod.py | 6 +- salt/modules/debian_ip.py | 33 +- salt/modules/debian_service.py | 6 +- salt/modules/debuild_pkgbuild.py | 60 ++- salt/modules/devinfo.py | 4 +- salt/modules/devmap.py | 4 +- salt/modules/dig.py | 16 +- salt/modules/disk.py | 56 ++- salt/modules/djangomod.py | 18 +- salt/modules/dnsmasq.py | 10 +- salt/modules/dnsutil.py | 14 +- salt/modules/dockercompose.py | 66 ++- salt/modules/dpkg_lowpkg.py | 14 +- salt/modules/drac.py | 22 +- salt/modules/dracr.py | 54 ++- salt/modules/ebuildpkg.py | 32 +- salt/modules/eselect.py | 2 +- salt/modules/ethtool.py | 6 +- salt/modules/extfs.py | 16 +- salt/modules/file.py | 300 ++++++------- salt/modules/firewalld.py | 66 +-- salt/modules/freebsd_sysctl.py | 16 +- salt/modules/freebsd_update.py | 2 +- salt/modules/freebsdkmod.py | 6 +- salt/modules/freebsdpkg.py | 6 +- salt/modules/freebsdports.py | 20 +- salt/modules/freebsdservice.py | 42 +- salt/modules/freezer.py | 4 +- salt/modules/genesis.py | 86 ++-- salt/modules/gentoolkitmod.py | 8 +- salt/modules/git.py | 56 +-- salt/modules/github.py | 8 +- salt/modules/glassfish.py | 16 +- salt/modules/glusterfs.py | 64 ++- salt/modules/gnomedesktop.py | 6 +- salt/modules/gpg.py | 16 +- salt/modules/grains.py | 10 +- salt/modules/groupadd.py | 10 +- salt/modules/grub_legacy.py | 6 +- salt/modules/guestfs.py | 6 +- salt/modules/haproxyconn.py | 4 +- salt/modules/hashutil.py | 6 +- salt/modules/heat.py | 46 +- salt/modules/hg.py | 22 +- salt/modules/highstate_doc.py | 26 +- salt/modules/hosts.py | 2 +- salt/modules/icinga2.py | 20 +- salt/modules/ifttt.py | 2 +- salt/modules/ilo.py | 8 +- salt/modules/incron.py | 14 +- salt/modules/influxdbmod.py | 6 +- salt/modules/infoblox.py | 10 +- salt/modules/ini_manage.py | 12 +- salt/modules/inspectlib/collector.py | 8 +- salt/modules/inspectlib/kiwiproc.py | 6 +- salt/modules/inspectlib/query.py | 14 +- salt/modules/inspector.py | 2 +- salt/modules/iosconfig.py | 2 +- salt/modules/ipmi.py | 8 +- salt/modules/ipset.py | 24 +- salt/modules/iwtools.py | 8 +- salt/modules/jboss7.py | 38 +- salt/modules/jboss7_cli.py | 4 +- salt/modules/jenkinsmod.py | 42 +- salt/modules/junos.py | 82 ++-- salt/modules/k8s.py | 52 +-- salt/modules/kapacitor.py | 24 +- salt/modules/kerberos.py | 18 +- salt/modules/kernelpkg_linux_apt.py | 18 +- salt/modules/kernelpkg_linux_yum.py | 6 +- salt/modules/keyboard.py | 12 +- salt/modules/keystone.py | 46 +- salt/modules/keystoneng.py | 2 +- salt/modules/keystore.py | 4 +- salt/modules/kmod.py | 10 +- salt/modules/kubeadm.py | 44 +- salt/modules/kubernetesmod.py | 16 +- salt/modules/launchctl_service.py | 6 +- salt/modules/layman.py | 6 +- salt/modules/ldap3.py | 6 +- salt/modules/ldapmod.py | 8 +- salt/modules/libcloud_compute.py | 2 +- salt/modules/linux_acl.py | 12 +- salt/modules/linux_ip.py | 6 +- salt/modules/linux_lvm.py | 58 +-- salt/modules/linux_service.py | 2 +- salt/modules/linux_shadow.py | 2 +- salt/modules/linux_sysctl.py | 16 +- salt/modules/localemod.py | 26 +- salt/modules/locate.py | 8 +- salt/modules/logadm.py | 12 +- salt/modules/logrotate.py | 10 +- salt/modules/lvs.py | 18 +- salt/modules/lxd.py | 76 ++-- salt/modules/mac_assistive.py | 16 +- salt/modules/mac_brew_pkg.py | 18 +- salt/modules/mac_desktop.py | 4 +- salt/modules/mac_group.py | 12 +- salt/modules/mac_pkgutil.py | 8 +- salt/modules/mac_portspkg.py | 4 +- salt/modules/mac_shadow.py | 42 +- salt/modules/mac_softwareupdate.py | 4 +- salt/modules/mac_sysctl.py | 14 +- salt/modules/mac_timezone.py | 12 +- salt/modules/mac_user.py | 42 +- salt/modules/mac_xattr.py | 28 +- salt/modules/macdefaults.py | 6 +- salt/modules/makeconf.py | 14 +- salt/modules/marathon.py | 14 +- salt/modules/mdadm_raid.py | 12 +- salt/modules/mdata.py | 10 +- salt/modules/memcached.py | 10 +- salt/modules/minion.py | 4 +- salt/modules/modjk.py | 32 +- salt/modules/mongodb.py | 8 +- salt/modules/monit.py | 10 +- salt/modules/mount.py | 110 +++-- salt/modules/mssql.py | 80 ++-- salt/modules/munin.py | 4 +- salt/modules/mysql.py | 78 ++-- salt/modules/nagios.py | 4 +- salt/modules/nagios_rpc.py | 2 +- salt/modules/namecheap_domains.py | 2 +- salt/modules/napalm_formula.py | 2 +- salt/modules/napalm_mod.py | 22 +- salt/modules/napalm_network.py | 46 +- salt/modules/netbox.py | 4 +- salt/modules/netbsd_sysctl.py | 16 +- salt/modules/netbsdservice.py | 28 +- salt/modules/netmiko_mod.py | 4 +- salt/modules/netscaler.py | 2 +- salt/modules/network.py | 30 +- salt/modules/nexus.py | 12 +- salt/modules/nfs3.py | 4 +- salt/modules/nftables.py | 64 ++- salt/modules/nginx.py | 10 +- salt/modules/nilrt_ip.py | 98 ++--- salt/modules/npm.py | 14 +- salt/modules/nspawn.py | 90 ++-- salt/modules/nxos.py | 22 +- salt/modules/nxos_api.py | 6 +- salt/modules/nxos_upgrade.py | 12 +- salt/modules/omapi.py | 4 +- salt/modules/openbsd_sysctl.py | 10 +- salt/modules/openbsdpkg.py | 12 +- salt/modules/openbsdrcctl_service.py | 36 +- salt/modules/openbsdservice.py | 12 +- salt/modules/openvswitch.py | 40 +- salt/modules/opkg.py | 24 +- salt/modules/osquery.py | 12 +- salt/modules/pacmanpkg.py | 6 +- salt/modules/pagerduty_util.py | 10 +- salt/modules/pam.py | 2 +- salt/modules/panos.py | 54 +-- salt/modules/parallels.py | 12 +- salt/modules/parted_partition.py | 38 +- salt/modules/pcs.py | 8 +- salt/modules/pdbedit.py | 2 +- salt/modules/pecl.py | 6 +- salt/modules/peeringdb.py | 4 +- salt/modules/pf.py | 22 +- salt/modules/pillar.py | 12 +- salt/modules/pip.py | 52 +-- salt/modules/pkg_resource.py | 4 +- salt/modules/pkgin.py | 10 +- salt/modules/pkgng.py | 38 +- salt/modules/pkgutil.py | 4 +- salt/modules/portage_config.py | 6 +- salt/modules/postfix.py | 30 +- salt/modules/poudriere.py | 50 +-- salt/modules/powerpath.py | 4 +- salt/modules/proxy.py | 12 +- salt/modules/ps.py | 2 +- salt/modules/publish.py | 6 +- salt/modules/puppet.py | 24 +- salt/modules/purefb.py | 2 +- salt/modules/pw_group.py | 14 +- salt/modules/pw_user.py | 18 +- salt/modules/pyenv.py | 26 +- salt/modules/qemu_img.py | 2 +- salt/modules/qemu_nbd.py | 12 +- salt/modules/quota.py | 8 +- salt/modules/rabbitmq.py | 20 +- salt/modules/rallydev.py | 2 +- salt/modules/random_org.py | 12 +- salt/modules/rbac_solaris.py | 6 +- salt/modules/rbenv.py | 8 +- salt/modules/rdp.py | 4 +- salt/modules/reg.py | 4 +- salt/modules/restartcheck.py | 20 +- salt/modules/restconf.py | 2 +- salt/modules/ret.py | 8 +- salt/modules/rh_ip.py | 28 +- salt/modules/rh_service.py | 46 +- salt/modules/riak.py | 6 +- salt/modules/rpm_lowpkg.py | 12 +- salt/modules/rpmbuild_pkgbuild.py | 26 +- salt/modules/rsync.py | 18 +- salt/modules/runit.py | 12 +- salt/modules/rvm.py | 6 +- salt/modules/s6.py | 14 +- salt/modules/salt_proxy.py | 22 +- salt/modules/saltcheck.py | 30 +- salt/modules/saltcloudmod.py | 2 +- salt/modules/saltutil.py | 24 +- salt/modules/schedule.py | 96 ++-- salt/modules/scsi.py | 8 +- salt/modules/seed.py | 8 +- salt/modules/selinux.py | 32 +- salt/modules/sensors.py | 2 +- salt/modules/serverdensity_device.py | 20 +- salt/modules/servicenow.py | 2 +- salt/modules/slack_notify.py | 2 +- salt/modules/slackware_service.py | 18 +- salt/modules/slsutil.py | 8 +- salt/modules/smartos_imgadm.py | 22 +- salt/modules/smartos_nictagadm.py | 22 +- salt/modules/smartos_virt.py | 10 +- salt/modules/smartos_vmadm.py | 66 +-- salt/modules/smbios.py | 6 +- salt/modules/smf_service.py | 24 +- salt/modules/smtp.py | 2 +- salt/modules/snapper.py | 24 +- salt/modules/solaris_fmadm.py | 18 +- salt/modules/solaris_group.py | 6 +- salt/modules/solaris_shadow.py | 12 +- salt/modules/solaris_user.py | 14 +- salt/modules/solarisipspkg.py | 8 +- salt/modules/solarispkg.py | 22 +- salt/modules/solr.py | 32 +- salt/modules/solrcloud.py | 14 +- salt/modules/splunk_search.py | 2 +- salt/modules/ssh.py | 32 +- salt/modules/state.py | 26 +- salt/modules/status.py | 22 +- salt/modules/supervisord.py | 14 +- salt/modules/suse_apache.py | 8 +- salt/modules/suse_ip.py | 30 +- salt/modules/sysbench.py | 10 +- salt/modules/sysfs.py | 2 +- salt/modules/syslog_ng.py | 24 +- salt/modules/system.py | 12 +- salt/modules/systemd_service.py | 6 +- salt/modules/telegram.py | 2 +- salt/modules/telemetry.py | 19 +- salt/modules/test.py | 4 +- salt/modules/testinframod.py | 2 +- salt/modules/textfsm_mod.py | 2 +- salt/modules/timezone.py | 44 +- salt/modules/tls.py | 168 ++++--- salt/modules/tomcat.py | 18 +- salt/modules/transactional_update.py | 8 +- salt/modules/tuned.py | 4 +- salt/modules/udev.py | 2 +- salt/modules/upstart_service.py | 18 +- salt/modules/uptime.py | 20 +- salt/modules/useradd.py | 6 +- salt/modules/uwsgi.py | 2 +- salt/modules/vagrant.py | 36 +- salt/modules/vault.py | 16 +- salt/modules/vboxmanage.py | 76 ++-- salt/modules/victorops.py | 4 +- salt/modules/virtualenv_mod.py | 16 +- salt/modules/vmctl.py | 10 +- salt/modules/vsphere.py | 152 +++---- salt/modules/webutil.py | 4 +- salt/modules/win_certutil.py | 14 +- salt/modules/win_dacl.py | 14 +- salt/modules/win_disk.py | 12 +- salt/modules/win_dism.py | 58 +-- salt/modules/win_dns_client.py | 2 +- salt/modules/win_dsc.py | 54 ++- salt/modules/win_event.py | 4 +- salt/modules/win_file.py | 74 ++-- salt/modules/win_firewall.py | 24 +- salt/modules/win_iis.py | 196 ++++----- salt/modules/win_ip.py | 34 +- salt/modules/win_lgpo.py | 60 ++- salt/modules/win_lgpo_reg.py | 14 +- salt/modules/win_license.py | 2 +- salt/modules/win_network.py | 4 +- salt/modules/win_pkg.py | 98 ++--- salt/modules/win_pki.py | 40 +- salt/modules/win_powercfg.py | 4 +- salt/modules/win_psget.py | 22 +- salt/modules/win_servermanager.py | 10 +- salt/modules/win_service.py | 42 +- salt/modules/win_shortcut.py | 18 +- salt/modules/win_smtp_server.py | 8 +- salt/modules/win_snmp.py | 6 +- salt/modules/win_system.py | 22 +- salt/modules/win_timezone.py | 6 +- salt/modules/win_useradd.py | 18 +- salt/modules/win_wua.py | 4 +- salt/modules/win_wusa.py | 18 +- salt/modules/winrepo.py | 10 +- salt/modules/wordpress.py | 14 +- salt/modules/x509.py | 12 +- salt/modules/xbpspkg.py | 6 +- salt/modules/xfs.py | 36 +- salt/modules/yumpkg.py | 98 ++--- salt/modules/zabbix.py | 14 +- salt/modules/zcbuildout.py | 18 +- salt/modules/zenoss.py | 2 +- salt/modules/zoneadm.py | 48 +- salt/modules/zonecfg.py | 30 +- salt/modules/zypperpkg.py | 50 +-- salt/netapi/__init__.py | 2 +- salt/netapi/rest_cherrypy/app.py | 14 +- salt/netapi/rest_tornado/__init__.py | 4 +- salt/netapi/rest_tornado/saltnado.py | 6 +- salt/netapi/rest_wsgi.py | 2 +- salt/output/__init__.py | 2 +- salt/output/highstate.py | 12 +- salt/output/key.py | 2 +- salt/output/profile.py | 4 +- salt/output/table_out.py | 2 +- salt/output/txt.py | 6 +- salt/output/virt_query.py | 8 +- salt/pillar/__init__.py | 12 +- salt/pillar/azureblob.py | 2 +- salt/pillar/django_orm.py | 6 +- salt/pillar/ec2_pillar.py | 4 +- salt/pillar/hiera.py | 4 +- salt/pillar/http_json.py | 2 +- salt/pillar/http_yaml.py | 2 +- salt/pillar/libvirt.py | 10 +- salt/pillar/makostack.py | 8 +- salt/pillar/netbox.py | 2 +- salt/pillar/puppet.py | 4 +- salt/pillar/reclass_adapter.py | 2 +- salt/pillar/s3.py | 2 +- salt/pillar/stack.py | 12 +- salt/pillar/vault.py | 2 +- salt/platform/win.py | 18 +- salt/proxy/chronos.py | 2 +- salt/proxy/docker.py | 2 +- salt/proxy/dummy.py | 4 +- salt/proxy/marathon.py | 2 +- salt/proxy/napalm.py | 2 +- salt/queues/pgjsonb_queue.py | 24 +- salt/queues/sqlite_queue.py | 28 +- salt/renderers/jinja.py | 6 +- salt/renderers/py.py | 4 +- salt/renderers/pyobjects.py | 8 +- salt/renderers/stateconf.py | 6 +- salt/returners/__init__.py | 8 +- salt/returners/carbon_return.py | 4 +- salt/returners/couchdb_return.py | 2 +- salt/returners/elasticsearch_return.py | 10 +- salt/returners/influxdb_return.py | 6 +- salt/returners/local_cache.py | 4 +- salt/returners/mattermost_returner.py | 4 +- salt/returners/memcache_return.py | 12 +- salt/returners/multi_returner.py | 18 +- salt/returners/odbc.py | 4 +- salt/returners/postgres.py | 4 +- salt/returners/redis_return.py | 14 +- salt/returners/sentry_return.py | 6 +- salt/returners/slack_webhook_return.py | 12 +- salt/returners/smtp_return.py | 4 +- salt/returners/zabbix_return.py | 2 +- salt/roster/__init__.py | 8 +- salt/roster/cache.py | 6 +- salt/roster/dir.py | 6 +- salt/roster/sshconfig.py | 4 +- salt/roster/sshknownhosts.py | 4 +- salt/runner.py | 8 +- salt/runners/asam.py | 20 +- salt/runners/bgp.py | 4 +- salt/runners/cache.py | 2 +- salt/runners/ddns.py | 30 +- salt/runners/digicertapi.py | 32 +- salt/runners/f5.py | 26 +- salt/runners/jobs.py | 30 +- salt/runners/launchd.py | 2 +- salt/runners/lxc.py | 10 +- salt/runners/manage.py | 12 +- salt/runners/mattermost.py | 4 +- salt/runners/net.py | 26 +- salt/runners/network.py | 4 +- salt/runners/pkg.py | 2 +- salt/runners/queue.py | 26 +- salt/runners/salt.py | 6 +- salt/runners/smartos_vmadm.py | 8 +- salt/runners/spacewalk.py | 16 +- salt/runners/test.py | 4 +- salt/runners/vault.py | 8 +- salt/runners/venafiapi.py | 8 +- salt/runners/virt.py | 58 ++- salt/runners/vistara.py | 8 +- salt/runners/winrepo.py | 2 +- salt/scripts.py | 8 +- salt/sdb/sqlite3.py | 8 +- salt/sdb/vault.py | 6 +- salt/serializers/configparser.py | 2 +- salt/serializers/yamlex.py | 2 +- salt/spm/__init__.py | 88 ++-- salt/spm/pkgdb/sqlite3.py | 2 +- salt/spm/pkgfiles/local.py | 24 +- salt/state.py | 58 ++- salt/states/acme.py | 6 +- salt/states/alias.py | 16 +- salt/states/alternatives.py | 20 +- salt/states/ansiblegate.py | 16 +- salt/states/apache_conf.py | 16 +- salt/states/apache_module.py | 16 +- salt/states/apache_site.py | 16 +- salt/states/aptpkg.py | 8 +- salt/states/archive.py | 42 +- salt/states/at.py | 8 +- salt/states/augeas.py | 6 +- salt/states/aws_sqs.py | 8 +- salt/states/azurearm_compute.py | 20 +- salt/states/azurearm_dns.py | 40 +- salt/states/azurearm_network.py | 188 ++++---- salt/states/azurearm_resource.py | 60 +-- salt/states/beacon.py | 26 +- salt/states/bigip.py | 4 +- salt/states/blockdev.py | 24 +- salt/states/boto3_elasticache.py | 76 ++-- salt/states/boto3_elasticsearch.py | 24 +- salt/states/boto3_route53.py | 4 +- salt/states/boto3_sns.py | 21 +- salt/states/boto_apigateway.py | 104 +++-- salt/states/boto_asg.py | 4 +- salt/states/boto_cfn.py | 18 +- salt/states/boto_cloudfront.py | 8 +- salt/states/boto_cloudtrail.py | 20 +- salt/states/boto_cloudwatch_alarm.py | 20 +- salt/states/boto_cloudwatch_event.py | 12 +- salt/states/boto_cognitoidentity.py | 10 +- salt/states/boto_datapipeline.py | 12 +- salt/states/boto_dynamodb.py | 44 +- salt/states/boto_ec2.py | 70 ++- salt/states/boto_elasticache.py | 38 +- salt/states/boto_elasticsearch_domain.py | 18 +- salt/states/boto_elb.py | 124 +++--- salt/states/boto_elbv2.py | 42 +- salt/states/boto_iam.py | 170 ++++---- salt/states/boto_iam_role.py | 42 +- salt/states/boto_iot.py | 46 +- salt/states/boto_kinesis.py | 24 +- salt/states/boto_kms.py | 8 +- salt/states/boto_lambda.py | 44 +- salt/states/boto_rds.py | 56 +-- salt/states/boto_route53.py | 34 +- salt/states/boto_s3.py | 12 +- salt/states/boto_s3_bucket.py | 30 +- salt/states/boto_secgroup.py | 46 +- salt/states/boto_sns.py | 14 +- salt/states/boto_sqs.py | 12 +- salt/states/boto_vpc.py | 74 ++-- salt/states/bower.py | 28 +- salt/states/btrfs.py | 38 +- salt/states/cabal.py | 14 +- salt/states/chronos_job.py | 14 +- salt/states/cloud.py | 52 +-- salt/states/cmd.py | 26 +- salt/states/composer.py | 18 +- salt/states/consul.py | 4 +- salt/states/cron.py | 60 +-- salt/states/cryptdev.py | 8 +- salt/states/csf.py | 8 +- salt/states/cyg.py | 4 +- salt/states/ddns.py | 6 +- salt/states/debconfmod.py | 2 +- salt/states/dellchassis.py | 8 +- salt/states/disk.py | 4 +- salt/states/docker_container.py | 70 ++- salt/states/docker_image.py | 20 +- salt/states/docker_network.py | 26 +- salt/states/docker_volume.py | 14 +- salt/states/drac.py | 16 +- salt/states/dvs.py | 18 +- salt/states/elasticsearch.py | 54 ++- salt/states/elasticsearch_index.py | 14 +- salt/states/elasticsearch_index_template.py | 8 +- salt/states/eselect.py | 4 +- salt/states/esxcluster.py | 22 +- salt/states/esxdatacenter.py | 6 +- salt/states/esxi.py | 110 +++-- salt/states/esxvm.py | 12 +- salt/states/etcd_mod.py | 2 +- salt/states/ethtool.py | 32 +- salt/states/file.py | 410 ++++++++---------- salt/states/firewalld.py | 82 ++-- salt/states/gem.py | 6 +- salt/states/github.py | 108 +++-- salt/states/glance_image.py | 4 +- salt/states/glassfish.py | 24 +- salt/states/glusterfs.py | 34 +- salt/states/gnomedesktop.py | 12 +- salt/states/gpg.py | 18 +- salt/states/grafana.py | 22 +- salt/states/grafana4_dashboard.py | 14 +- salt/states/grafana4_datasource.py | 16 +- salt/states/grafana4_org.py | 18 +- salt/states/grafana4_user.py | 18 +- salt/states/grafana_dashboard.py | 18 +- salt/states/grafana_datasource.py | 10 +- salt/states/grains.py | 62 ++- salt/states/group.py | 16 +- salt/states/heat.py | 16 +- salt/states/helm.py | 8 +- salt/states/hg.py | 16 +- salt/states/highstate_doc.py | 2 +- salt/states/host.py | 36 +- salt/states/http.py | 22 +- salt/states/icinga2.py | 30 +- salt/states/idem.py | 6 +- salt/states/ifttt.py | 4 +- salt/states/incron.py | 20 +- salt/states/influxdb08_database.py | 12 +- salt/states/influxdb08_user.py | 16 +- salt/states/influxdb_continuous_query.py | 16 +- salt/states/influxdb_database.py | 14 +- salt/states/influxdb_retention_policy.py | 22 +- salt/states/influxdb_user.py | 24 +- salt/states/infoblox_host_record.py | 2 +- salt/states/infoblox_range.py | 4 +- salt/states/ini_manage.py | 36 +- salt/states/ipmi.py | 6 +- salt/states/ipset.py | 14 +- salt/states/iptables.py | 2 +- salt/states/jboss7.py | 6 +- salt/states/jenkins.py | 10 +- salt/states/kapacitor.py | 2 +- salt/states/keyboard.py | 12 +- salt/states/keystone.py | 122 +++--- salt/states/keystone_domain.py | 6 +- salt/states/keystore.py | 4 +- salt/states/kmod.py | 16 +- salt/states/kubernetes.py | 44 +- salt/states/layman.py | 18 +- salt/states/libcloud_dns.py | 2 +- salt/states/linux_acl.py | 12 +- salt/states/locale.py | 18 +- salt/states/logadm.py | 4 +- salt/states/logrotate.py | 6 +- salt/states/loop.py | 10 +- salt/states/lvm.py | 68 +-- salt/states/lvs_service.py | 16 +- salt/states/lxc.py | 54 +-- salt/states/lxd.py | 12 +- salt/states/lxd_container.py | 68 +-- salt/states/lxd_image.py | 20 +- salt/states/lxd_profile.py | 14 +- salt/states/mac_assistive.py | 4 +- salt/states/mac_keychain.py | 14 +- salt/states/macdefaults.py | 12 +- salt/states/macpackage.py | 14 +- salt/states/makeconf.py | 6 +- salt/states/marathon_app.py | 20 +- salt/states/mdadm_raid.py | 32 +- salt/states/memcached.py | 20 +- salt/states/modjk.py | 6 +- salt/states/modjk_worker.py | 4 +- salt/states/module.py | 12 +- salt/states/mongodb_database.py | 4 +- salt/states/mongodb_user.py | 18 +- salt/states/monit.py | 16 +- salt/states/mount.py | 62 ++- salt/states/mssql_database.py | 16 +- salt/states/mssql_login.py | 18 +- salt/states/mssql_role.py | 14 +- salt/states/mssql_user.py | 18 +- salt/states/msteams.py | 6 +- salt/states/mysql_database.py | 22 +- salt/states/mysql_grants.py | 12 +- salt/states/mysql_query.py | 16 +- salt/states/mysql_user.py | 28 +- salt/states/netconfig.py | 16 +- salt/states/netntp.py | 8 +- salt/states/netsnmp.py | 2 +- salt/states/netusers.py | 2 +- salt/states/network.py | 36 +- salt/states/neutron_network.py | 2 +- salt/states/neutron_secgroup_rule.py | 2 +- salt/states/nfs_export.py | 12 +- salt/states/nftables.py | 6 +- salt/states/npm.py | 24 +- salt/states/nxos.py | 4 +- salt/states/nxos_upgrade.py | 4 +- salt/states/openstack_config.py | 2 +- salt/states/openvswitch_bridge.py | 20 +- salt/states/openvswitch_port.py | 28 +- salt/states/pagerduty.py | 4 +- salt/states/pagerduty_escalation_policy.py | 6 +- salt/states/pagerduty_schedule.py | 2 +- salt/states/pagerduty_service.py | 2 +- salt/states/panos.py | 60 +-- salt/states/pbm.py | 14 +- salt/states/pcs.py | 50 +-- salt/states/pdbedit.py | 2 +- salt/states/pecl.py | 18 +- salt/states/pip_state.py | 26 +- salt/states/pkg.py | 116 ++--- salt/states/pkgbuild.py | 2 +- salt/states/pkgrepo.py | 22 +- salt/states/ports.py | 20 +- salt/states/postgres_cluster.py | 6 +- salt/states/postgres_database.py | 22 +- salt/states/postgres_extension.py | 16 +- salt/states/postgres_group.py | 20 +- salt/states/postgres_initdb.py | 8 +- salt/states/postgres_language.py | 16 +- salt/states/postgres_schema.py | 4 +- salt/states/postgres_tablespace.py | 18 +- salt/states/postgres_user.py | 22 +- salt/states/powerpath.py | 8 +- salt/states/process.py | 2 +- salt/states/proxy.py | 6 +- salt/states/pushover.py | 8 +- salt/states/pyenv.py | 8 +- salt/states/pyrax_queues.py | 12 +- salt/states/quota.py | 10 +- salt/states/rabbitmq_cluster.py | 6 +- salt/states/rabbitmq_plugin.py | 20 +- salt/states/rabbitmq_policy.py | 12 +- salt/states/rabbitmq_upstream.py | 20 +- salt/states/rabbitmq_user.py | 36 +- salt/states/rabbitmq_vhost.py | 8 +- salt/states/rbac_solaris.py | 4 +- salt/states/rbenv.py | 12 +- salt/states/redismod.py | 12 +- salt/states/rsync.py | 2 +- salt/states/rvm.py | 6 +- salt/states/salt_proxy.py | 2 +- salt/states/saltmod.py | 10 +- salt/states/saltutil.py | 10 +- salt/states/schedule.py | 18 +- salt/states/selinux.py | 56 +-- salt/states/service.py | 75 ++-- salt/states/slack.py | 4 +- salt/states/smartos.py | 107 +++-- salt/states/smtp.py | 4 +- salt/states/snapper.py | 4 +- salt/states/solrcloud.py | 14 +- salt/states/splunk.py | 22 +- salt/states/splunk_search.py | 14 +- salt/states/ssh_known_hosts.py | 14 +- salt/states/status.py | 8 +- salt/states/statuspage.py | 18 +- salt/states/supervisord.py | 34 +- salt/states/svn.py | 14 +- salt/states/sysctl.py | 8 +- salt/states/sysfs.py | 12 +- salt/states/sysrc.py | 14 +- salt/states/telemetry_alert.py | 10 +- salt/states/test.py | 6 +- salt/states/testinframod.py | 2 +- salt/states/timezone.py | 14 +- salt/states/tls.py | 4 +- salt/states/tomcat.py | 8 +- salt/states/trafficserver.py | 6 +- salt/states/tuned.py | 8 +- salt/states/uptime.py | 4 +- salt/states/user.py | 34 +- salt/states/vagrant.py | 10 +- salt/states/vault.py | 12 +- salt/states/victorops.py | 2 +- salt/states/virt.py | 70 ++- salt/states/virtualenv_mod.py | 22 +- salt/states/webutil.py | 6 +- salt/states/win_certutil.py | 28 +- salt/states/win_dism.py | 44 +- salt/states/win_dns_client.py | 10 +- salt/states/win_firewall.py | 12 +- salt/states/win_iis.py | 72 +-- salt/states/win_lgpo.py | 4 +- salt/states/win_lgpo_reg.py | 4 +- salt/states/win_network.py | 18 +- salt/states/win_path.py | 20 +- salt/states/win_pki.py | 4 +- salt/states/win_powercfg.py | 12 +- salt/states/win_servermanager.py | 14 +- salt/states/win_shortcut.py | 12 +- salt/states/win_smtp_server.py | 2 +- salt/states/win_snmp.py | 6 +- salt/states/win_system.py | 40 +- salt/states/win_wusa.py | 16 +- salt/states/winrepo.py | 4 +- salt/states/wordpress.py | 28 +- salt/states/x509.py | 16 +- salt/states/xml.py | 8 +- salt/states/xmpp.py | 8 +- salt/states/zabbix_action.py | 28 +- salt/states/zabbix_host.py | 46 +- salt/states/zabbix_hostgroup.py | 20 +- salt/states/zabbix_mediatype.py | 40 +- salt/states/zabbix_template.py | 44 +- salt/states/zabbix_user.py | 30 +- salt/states/zabbix_usergroup.py | 22 +- salt/states/zabbix_usermacro.py | 36 +- salt/states/zabbix_valuemap.py | 28 +- salt/states/zenoss.py | 14 +- salt/states/zfs.py | 74 ++-- salt/states/zk_concurrency.py | 6 +- salt/states/zone.py | 84 ++-- salt/states/zookeeper.py | 28 +- salt/states/zpool.py | 10 +- salt/template.py | 4 +- salt/thorium/__init__.py | 6 +- salt/thorium/calc.py | 2 +- salt/thorium/check.py | 26 +- salt/tokens/localfs.py | 2 +- salt/tops/reclass_adapter.py | 8 +- salt/transport/base.py | 4 +- salt/transport/zeromq.py | 2 +- salt/utils/asynchronous.py | 2 +- salt/utils/atomicfile.py | 2 +- salt/utils/aws.py | 22 +- salt/utils/azurearm.py | 12 +- salt/utils/boto3mod.py | 10 +- salt/utils/botomod.py | 8 +- salt/utils/cache.py | 4 +- salt/utils/color.py | 2 +- salt/utils/configcomparer.py | 10 +- salt/utils/crypt.py | 6 +- salt/utils/dateutils.py | 6 +- salt/utils/debug.py | 8 +- salt/utils/decorators/__init__.py | 14 +- salt/utils/decorators/path.py | 4 +- salt/utils/decorators/state.py | 4 +- salt/utils/dockermod/translate/container.py | 18 +- salt/utils/dockermod/translate/helpers.py | 16 +- salt/utils/etcd_util.py | 18 +- salt/utils/event.py | 26 +- salt/utils/extend.py | 12 +- salt/utils/extmods.py | 8 +- salt/utils/files.py | 24 +- salt/utils/find.py | 28 +- salt/utils/fsutils.py | 2 +- salt/utils/functools.py | 2 +- salt/utils/gitfs.py | 54 ++- salt/utils/github.py | 2 +- salt/utils/hashutils.py | 4 +- salt/utils/immutabletypes.py | 6 +- salt/utils/jid.py | 4 +- salt/utils/job.py | 26 +- salt/utils/kickstart.py | 2 +- salt/utils/lazy.py | 2 +- salt/utils/mac_utils.py | 6 +- salt/utils/mako.py | 2 +- salt/utils/master.py | 14 +- salt/utils/mattermost.py | 2 +- salt/utils/memcached.py | 2 +- salt/utils/minion.py | 2 +- salt/utils/minions.py | 22 +- salt/utils/nacl.py | 24 +- salt/utils/nb_popen.py | 8 +- salt/utils/network.py | 30 +- salt/utils/nxos.py | 16 +- salt/utils/openstack/nova.py | 30 +- salt/utils/oset.py | 12 +- salt/utils/pagerduty.py | 2 +- salt/utils/parsers.py | 50 +-- salt/utils/path.py | 2 +- salt/utils/pbm.py | 20 +- salt/utils/pkg/rpm.py | 4 +- salt/utils/pkg/win.py | 18 +- salt/utils/powershell.py | 6 +- salt/utils/process.py | 8 +- salt/utils/profile.py | 8 +- salt/utils/pushover.py | 4 +- salt/utils/pycrypto.py | 4 +- salt/utils/pydsl.py | 12 +- salt/utils/pyobjects.py | 6 +- salt/utils/roster_matcher.py | 2 +- salt/utils/s3.py | 22 +- salt/utils/saltclass.py | 4 +- salt/utils/schedule.py | 6 +- salt/utils/schema.py | 18 +- salt/utils/slack.py | 2 +- salt/utils/smb.py | 2 +- salt/utils/ssdp.py | 6 +- salt/utils/ssh.py | 2 +- salt/utils/stringutils.py | 14 +- salt/utils/templates.py | 20 +- salt/utils/textformat.py | 2 +- salt/utils/thin.py | 14 +- salt/utils/timed_subprocess.py | 2 +- salt/utils/url.py | 10 +- salt/utils/user.py | 6 +- salt/utils/validate/net.py | 2 +- salt/utils/vault.py | 18 +- salt/utils/verify.py | 20 +- salt/utils/versions.py | 10 +- salt/utils/virt.py | 2 +- salt/utils/virtualbox.py | 4 +- salt/utils/vmware.py | 148 +++---- salt/utils/vsan.py | 22 +- salt/utils/vt.py | 16 +- salt/utils/vt_helper.py | 2 +- salt/utils/win_chcp.py | 8 +- salt/utils/win_dacl.py | 88 ++-- salt/utils/win_dotnet.py | 4 +- salt/utils/win_functions.py | 6 +- salt/utils/win_lgpo_auditpol.py | 18 +- salt/utils/win_lgpo_netsh.py | 56 +-- salt/utils/win_lgpo_reg.py | 12 +- salt/utils/win_pdh.py | 2 +- salt/utils/win_service.py | 8 +- salt/utils/win_update.py | 14 +- salt/utils/xmlutil.py | 10 +- salt/utils/yamlloader.py | 6 +- salt/utils/yamlloader_old.py | 6 +- salt/utils/zfs.py | 6 +- salt/wheel/config.py | 2 +- salt/wheel/file_roots.py | 6 +- salt/wheel/pillar_roots.py | 4 +- scripts/suse/yum/plugins/yumnotify.py | 4 +- setup.py | 10 +- tests/buildpackage.py | 28 +- tests/committer_parser.py | 10 +- tests/conftest.py | 22 +- tests/eventlisten.py | 2 +- tests/integration/cli/test_custom_module.py | 2 +- .../cloud/clouds/test_digitalocean.py | 18 +- .../cloud/clouds/test_dimensiondata.py | 8 +- tests/integration/cloud/clouds/test_ec2.py | 6 +- tests/integration/cloud/clouds/test_gce.py | 6 +- tests/integration/cloud/clouds/test_gogrid.py | 2 +- .../integration/cloud/clouds/test_msazure.py | 6 +- .../cloud/clouds/test_openstack.py | 2 +- .../cloud/clouds/test_profitbricks.py | 16 +- .../cloud/clouds/test_tencentcloud.py | 12 +- .../cloud/clouds/test_virtualbox.py | 10 +- tests/integration/cloud/clouds/test_vmware.py | 10 +- .../integration/cloud/clouds/test_vultrpy.py | 8 +- .../cloud/helpers/cloud_test_base.py | 4 +- tests/integration/cloud/helpers/virtualbox.py | 10 +- tests/integration/cloud/test_cloud.py | 2 +- .../integration/externalapi/test_venafiapi.py | 2 +- .../file/base/_modules/runtests_decorators.py | 4 +- tests/integration/minion/test_timeout.py | 6 +- tests/integration/modules/test_boto_sns.py | 2 +- tests/integration/modules/test_cmdmod.py | 12 +- tests/integration/modules/test_cp.py | 8 +- tests/integration/modules/test_git.py | 32 +- tests/integration/modules/test_groupadd.py | 2 +- .../integration/modules/test_linux_shadow.py | 2 +- tests/integration/modules/test_lxc.py | 4 +- tests/integration/modules/test_mine.py | 16 +- tests/integration/modules/test_mysql.py | 14 +- tests/integration/modules/test_ssh.py | 24 +- tests/integration/pillar/test_git_pillar.py | 6 +- .../runners/test_runner_returns.py | 2 +- tests/integration/shell/test_spm.py | 10 +- tests/integration/ssh/test_state.py | 2 +- tests/integration/states/test_archive.py | 2 +- tests/integration/states/test_boto_sns.py | 16 +- tests/integration/states/test_git.py | 34 +- tests/integration/states/test_host.py | 2 +- tests/integration/states/test_reg.py | 28 +- tests/integration/states/test_ssh_auth.py | 12 +- .../states/test_ssh_known_hosts.py | 10 +- tests/integration/states/test_x509.py | 20 +- tests/integration/utils/test_win_runas.py | 26 +- tests/minionswarm.py | 10 +- tests/pytests/conftest.py | 10 +- tests/pytests/functional/cache/helpers.py | 2 +- .../pytests/functional/channel/test_server.py | 2 +- tests/pytests/functional/cli/test_salt.py | 2 +- .../pytests/functional/cli/test_salt_run_.py | 2 +- tests/pytests/functional/conftest.py | 2 +- .../loader/test_loaded_base_name.py | 2 +- .../log_handlers/test_logstash_mod.py | 4 +- .../functional/modules/cmd/test_powershell.py | 4 +- .../functional/modules/cmd/test_runas.py | 4 +- .../functional/modules/file/test_replace.py | 4 +- .../functional/modules/file/test_rmdir.py | 14 +- .../functional/modules/file/test_symlink.py | 2 +- .../modules/state/requisites/test_mixed.py | 12 +- .../modules/state/requisites/test_require.py | 2 +- .../modules/state/requisites/test_watch.py | 32 +- .../functional/modules/state/test_state.py | 6 +- .../pytests/functional/modules/test_aptpkg.py | 14 +- .../functional/modules/test_archive.py | 8 +- .../functional/modules/test_etcd_mod.py | 27 +- .../functional/modules/test_network.py | 4 +- tests/pytests/functional/modules/test_opkg.py | 2 +- tests/pytests/functional/modules/test_pip.py | 4 +- tests/pytests/functional/modules/test_pkg.py | 24 +- .../functional/modules/test_service.py | 2 +- .../pytests/functional/modules/test_system.py | 4 +- .../pytests/functional/modules/test_vault.py | 22 +- .../functional/modules/test_win_dsc.py | 4 +- .../functional/modules/test_win_shortcut.py | 8 +- .../win_lgpo/test_audit_settings_module.py | 2 +- .../netapi/rest_cherrypy/test_auth.py | 2 +- .../test_external_auth_syntax.py | 20 +- .../netapi/rest_tornado/test_auth_handler.py | 6 +- .../rest_tornado/test_auth_handler_pam.py | 6 +- .../rest_tornado/test_base_api_handler.py | 4 +- .../rest_tornado/test_external_auth_syntax.py | 20 +- .../rest_tornado/test_websockets_handler.py | 10 +- tests/pytests/functional/pillar/test_gpg.py | 6 +- tests/pytests/functional/sdb/test_etcd_db.py | 9 +- .../functional/states/cmd/test_runas.py | 4 +- .../functional/states/file/test_append.py | 2 +- .../states/file/test_blockreplace.py | 4 +- .../functional/states/file/test_cached.py | 8 +- .../functional/states/file/test_managed.py | 26 +- .../functional/states/file/test_patch.py | 4 +- .../functional/states/file/test_pruned.py | 16 +- .../functional/states/file/test_recurse.py | 8 +- .../functional/states/file/test_replace.py | 18 +- .../functional/states/file/test_symlink.py | 2 +- .../functional/states/rabbitmq/conftest.py | 6 +- .../pytests/functional/states/test_archive.py | 10 +- .../states/test_docker_container.py | 26 +- .../functional/states/test_docker_network.py | 12 +- .../functional/states/test_etcd_mod.py | 40 +- tests/pytests/functional/states/test_file.py | 10 +- tests/pytests/functional/states/test_npm.py | 2 +- .../functional/states/test_pip_state.py | 18 +- tests/pytests/functional/states/test_pkg.py | 25 +- tests/pytests/functional/states/test_reg.py | 20 +- .../pytests/functional/states/test_service.py | 2 +- tests/pytests/functional/states/test_svn.py | 2 +- tests/pytests/functional/states/test_user.py | 4 +- .../functional/states/test_virtualenv_mod.py | 6 +- .../functional/states/test_zookeeper.py | 4 +- .../win_lgpo/test_audit_settings_state.py | 2 +- tests/pytests/functional/test_payload.py | 4 +- .../functional/transport/ipc/test_client.py | 2 +- .../transport/ipc/test_pub_server_channel.py | 8 +- .../functional/transport/server/conftest.py | 6 +- .../transport/server/test_req_channel.py | 2 +- .../functools/test_namespaced_function.py | 2 +- .../functional/utils/test_etcd_util.py | 261 ++++++----- tests/pytests/functional/utils/test_jinja.py | 4 +- .../functional/utils/win_dacl/test_reg.py | 2 +- .../test_multiple_processes_logging.py | 2 +- tests/pytests/integration/cli/test_batch.py | 6 +- tests/pytests/integration/cli/test_matcher.py | 22 +- tests/pytests/integration/cli/test_salt.py | 2 +- .../pytests/integration/cli/test_salt_call.py | 8 +- .../integration/cli/test_salt_deltaproxy.py | 20 +- .../pytests/integration/cli/test_salt_key.py | 4 +- .../integration/master/test_clear_funcs.py | 6 +- .../integration/minion/test_job_return.py | 4 +- .../pytests/integration/minion/test_reauth.py | 4 +- .../integration/minion/test_return_retries.py | 4 +- .../modules/state/test_state_test.py | 4 +- .../pytests/integration/modules/test_file.py | 2 +- .../pytests/integration/modules/test_jinja.py | 2 +- .../integration/modules/test_pillar.py | 2 +- tests/pytests/integration/modules/test_pip.py | 6 +- .../modules/test_rpmbuild_pkgbuild.py | 8 +- .../pytests/integration/modules/test_state.py | 8 +- .../pytests/integration/modules/test_virt.py | 6 +- .../netapi/rest_cherrypy/test_arg_kwarg.py | 4 +- .../netapi/rest_cherrypy/test_auth.py | 2 +- .../rest_tornado/test_jobs_api_handler.py | 2 +- .../rest_tornado/test_minions_api_handler.py | 4 +- .../integration/netapi/test_ssh_client.py | 22 +- tests/pytests/integration/proxy/conftest.py | 8 +- .../integration/renderers/test_jinja.py | 4 +- .../runners/state/orchestrate/test_events.py | 8 +- tests/pytests/integration/sdb/test_vault.py | 51 +-- .../integration/ssh/test_jinja_mods.py | 2 +- .../ssh/test_pillar_compilation.py | 6 +- .../integration/states/test_ansiblegate.py | 2 +- tests/pytests/integration/states/test_file.py | 47 +- tests/pytests/integration/states/test_idem.py | 2 +- .../integration/utils/test_templates.py | 4 +- .../integration/wheel/test_pillar_roots.py | 4 +- .../pkg/integration/test_multi_minion.py | 30 +- tests/pytests/pkg/integration/test_pip.py | 20 +- .../pkg/integration/test_pip_upgrade.py | 10 +- tests/pytests/pkg/integration/test_version.py | 3 +- tests/pytests/scenarios/blackout/conftest.py | 2 +- tests/pytests/scenarios/compat/conftest.py | 2 +- .../failover/multimaster/conftest.py | 10 +- .../multimaster/test_failover_master.py | 18 +- .../multimaster/beacons/test_inotify.py | 2 +- .../pytests/scenarios/multimaster/conftest.py | 10 +- .../scenarios/multimaster/test_multimaster.py | 4 +- .../multimaster/test_offline_master.py | 4 +- .../pytests/scenarios/performance/conftest.py | 4 +- tests/pytests/scenarios/setup/test_man.py | 2 +- tests/pytests/unit/beacons/test_btmp.py | 2 +- tests/pytests/unit/beacons/test_inotify.py | 4 +- tests/pytests/unit/beacons/test_wtmp.py | 2 +- tests/pytests/unit/cli/test_daemons.py | 8 +- tests/pytests/unit/client/ssh/test_shell.py | 4 +- tests/pytests/unit/client/ssh/test_single.py | 4 +- .../pytests/unit/cloud/clouds/test_proxmox.py | 10 +- tests/pytests/unit/config/schemas/test_ssh.py | 14 +- .../unit/crypt/test_crypt_cryptodome.py | 6 +- .../pytests/unit/crypt/test_crypt_m2crypto.py | 42 +- .../unit/daemons/masterapi/test_auto_key.py | 6 +- tests/pytests/unit/engines/test_engines.py | 2 +- .../unit/fileclient/test_fileclient.py | 2 +- .../unit/fileclient/test_fileclient_cache.py | 14 +- .../fileserver/gitfs/test_gitfs_config.py | 2 +- tests/pytests/unit/grains/test_core.py | 20 +- .../modules/file/test_file_block_replace.py | 22 +- .../unit/modules/file/test_file_chattr.py | 2 +- .../unit/modules/file/test_file_check.py | 4 +- .../unit/modules/file/test_file_grep.py | 4 +- .../unit/modules/file/test_file_line.py | 4 +- .../unit/modules/file/test_file_module.py | 2 +- .../unit/modules/file/test_file_selinux.py | 2 +- .../pytests/unit/modules/napalm/test_route.py | 2 +- .../pytests/unit/modules/state/test_state.py | 22 +- tests/pytests/unit/modules/test_aixpkg.py | 36 +- .../pytests/unit/modules/test_ansiblegate.py | 7 +- tests/pytests/unit/modules/test_beacons.py | 4 +- .../unit/modules/test_cassandra_cql.py | 2 +- tests/pytests/unit/modules/test_chroot.py | 6 +- tests/pytests/unit/modules/test_consul.py | 16 +- tests/pytests/unit/modules/test_disk.py | 4 +- tests/pytests/unit/modules/test_genesis.py | 7 +- tests/pytests/unit/modules/test_glusterfs.py | 2 +- tests/pytests/unit/modules/test_ini_manage.py | 2 +- tests/pytests/unit/modules/test_introspect.py | 8 +- tests/pytests/unit/modules/test_iptables.py | 4 +- tests/pytests/unit/modules/test_junos.py | 4 +- tests/pytests/unit/modules/test_kmod.py | 4 +- tests/pytests/unit/modules/test_linux_lvm.py | 2 +- .../unit/modules/test_mac_assistive.py | 2 +- tests/pytests/unit/modules/test_match.py | 2 +- tests/pytests/unit/modules/test_mine.py | 2 +- tests/pytests/unit/modules/test_mysql.py | 2 +- .../unit/modules/test_openbsdrcctl_service.py | 24 +- tests/pytests/unit/modules/test_openscap.py | 10 +- tests/pytests/unit/modules/test_pacmanpkg.py | 4 +- tests/pytests/unit/modules/test_parallels.py | 4 +- tests/pytests/unit/modules/test_pip.py | 2 +- tests/pytests/unit/modules/test_poudriere.py | 6 +- tests/pytests/unit/modules/test_reg.py | 6 +- .../pytests/unit/modules/test_restartcheck.py | 8 +- tests/pytests/unit/modules/test_status.py | 2 +- tests/pytests/unit/modules/test_suse_ip.py | 8 +- tests/pytests/unit/modules/test_syslog_ng.py | 2 +- tests/pytests/unit/modules/test_tls.py | 16 +- tests/pytests/unit/modules/test_uwsgi.py | 2 +- tests/pytests/unit/modules/test_vagrant.py | 4 +- tests/pytests/unit/modules/test_win_iis.py | 2 +- tests/pytests/unit/modules/test_win_pkg.py | 4 +- tests/pytests/unit/modules/test_yumpkg.py | 2 +- tests/pytests/unit/modules/virt/conftest.py | 8 +- .../pytests/unit/modules/virt/test_domain.py | 7 +- .../modules/win_lgpo/test__policy_info.py | 2 +- .../modules/win_lgpo/test_admx_policies.py | 2 +- .../modules/win_lgpo/test_secedit_policy.py | 2 +- .../unit/pillar/test_http_json_pillar.py | 8 +- .../unit/pillar/test_http_yaml_pillar.py | 4 +- tests/pytests/unit/pillar/test_mysql.py | 12 +- tests/pytests/unit/pillar/test_s3.py | 6 +- tests/pytests/unit/pillar/test_saltclass.py | 2 +- .../returners/test_slack_webhook_return.py | 12 +- .../unit/returners/test_syslog_return.py | 2 +- tests/pytests/unit/roster/test_dir.py | 4 +- tests/pytests/unit/runners/test_fileserver.py | 2 +- tests/pytests/unit/runners/test_saltutil.py | 4 +- .../pytests/unit/runners/vault/test_vault.py | 2 +- .../unit/serializers/test_serializers.py | 2 +- .../pytests/unit/state/test_state_compiler.py | 4 +- tests/pytests/unit/states/apache/test_conf.py | 12 +- .../pytests/unit/states/apache/test_module.py | 12 +- tests/pytests/unit/states/apache/test_site.py | 12 +- tests/pytests/unit/states/file/test_absent.py | 16 +- .../pytests/unit/states/file/test_comment.py | 12 +- tests/pytests/unit/states/file/test_copy.py | 10 +- .../unit/states/file/test_directory.py | 14 +- .../unit/states/file/test_filestate.py | 36 +- .../pytests/unit/states/file/test_hardlink.py | 34 +- .../pytests/unit/states/file/test_managed.py | 14 +- .../pytests/unit/states/file/test_prepend.py | 6 +- .../states/file/test_private_functions.py | 6 +- tests/pytests/unit/states/file/test_pruned.py | 6 +- tests/pytests/unit/states/file/test_rename.py | 14 +- .../pytests/unit/states/file/test_selinux.py | 2 +- .../pytests/unit/states/file/test_symlink.py | 28 +- tests/pytests/unit/states/file/test_tidied.py | 30 +- .../unit/states/mysql/test_database.py | 14 +- tests/pytests/unit/states/mysql/test_query.py | 2 +- .../unit/states/postgresql/test_cluster.py | 20 +- .../unit/states/postgresql/test_database.py | 8 +- .../unit/states/postgresql/test_initdb.py | 8 +- .../unit/states/postgresql/test_language.py | 16 +- .../unit/states/rabbitmq/test_vhost.py | 2 +- .../unit/states/saltmod/test_function.py | 6 +- tests/pytests/unit/states/test_alias.py | 16 +- .../pytests/unit/states/test_alternatives.py | 26 +- tests/pytests/unit/states/test_aptpkg.py | 2 +- tests/pytests/unit/states/test_archive.py | 4 +- tests/pytests/unit/states/test_at.py | 4 +- tests/pytests/unit/states/test_aws_sqs.py | 8 +- tests/pytests/unit/states/test_blockdev.py | 10 +- .../unit/states/test_boto_cloudfront.py | 6 +- .../unit/states/test_boto_cloudwatch_alarm.py | 2 +- .../pytests/unit/states/test_boto_dynamodb.py | 8 +- tests/pytests/unit/states/test_boto_ec2.py | 10 +- .../unit/states/test_boto_elasticache.py | 12 +- tests/pytests/unit/states/test_boto_elb.py | 6 +- .../pytests/unit/states/test_boto_iam_role.py | 2 +- .../pytests/unit/states/test_boto_kinesis.py | 12 +- .../pytests/unit/states/test_boto_route53.py | 10 +- tests/pytests/unit/states/test_boto_sns.py | 12 +- tests/pytests/unit/states/test_boto_sqs.py | 6 +- tests/pytests/unit/states/test_cloud.py | 46 +- tests/pytests/unit/states/test_ddns.py | 6 +- tests/pytests/unit/states/test_drac.py | 8 +- tests/pytests/unit/states/test_eselect.py | 2 +- tests/pytests/unit/states/test_file.py | 4 +- tests/pytests/unit/states/test_glusterfs.py | 34 +- tests/pytests/unit/states/test_grafana.py | 2 +- tests/pytests/unit/states/test_host.py | 57 +-- tests/pytests/unit/states/test_incron.py | 18 +- .../unit/states/test_influxdb08_database.py | 16 +- .../unit/states/test_influxdb08_user.py | 16 +- tests/pytests/unit/states/test_keyboard.py | 12 +- tests/pytests/unit/states/test_keystone.py | 52 +-- tests/pytests/unit/states/test_kmod.py | 12 +- tests/pytests/unit/states/test_kubernetes.py | 4 +- tests/pytests/unit/states/test_layman.py | 8 +- tests/pytests/unit/states/test_linux_acl.py | 12 +- tests/pytests/unit/states/test_lvm.py | 44 +- tests/pytests/unit/states/test_lxc.py | 18 +- tests/pytests/unit/states/test_makeconf.py | 4 +- .../unit/states/test_mongodb_database.py | 6 +- .../pytests/unit/states/test_mongodb_user.py | 10 +- tests/pytests/unit/states/test_mount.py | 26 +- tests/pytests/unit/states/test_npm.py | 12 +- tests/pytests/unit/states/test_pagerduty.py | 4 +- tests/pytests/unit/states/test_pdbedit.py | 2 +- tests/pytests/unit/states/test_pecl.py | 4 +- tests/pytests/unit/states/test_pkg.py | 6 +- tests/pytests/unit/states/test_ports.py | 2 +- tests/pytests/unit/states/test_powerpath.py | 4 +- .../pytests/unit/states/test_pyrax_queues.py | 2 +- tests/pytests/unit/states/test_rbenv.py | 18 +- tests/pytests/unit/states/test_saltutil.py | 2 +- tests/pytests/unit/states/test_selinux.py | 2 +- tests/pytests/unit/states/test_service.py | 8 +- tests/pytests/unit/states/test_slack.py | 4 +- tests/pytests/unit/states/test_smartos.py | 7 +- .../pytests/unit/states/test_splunk_search.py | 8 +- tests/pytests/unit/states/test_ssh_auth.py | 2 +- .../unit/states/test_ssh_known_hosts.py | 2 +- tests/pytests/unit/states/test_supervisord.py | 2 +- tests/pytests/unit/states/test_sysctl.py | 14 +- tests/pytests/unit/states/test_sysfs.py | 12 +- tests/pytests/unit/states/test_win_path.py | 28 +- tests/pytests/unit/states/test_win_wusa.py | 32 +- tests/pytests/unit/states/test_xml.py | 8 +- .../pytests/unit/states/zabbix/test_action.py | 22 +- .../unit/states/zabbix/test_template.py | 22 +- .../unit/states/zabbix/test_valuemap.py | 22 +- tests/pytests/unit/test_ext_importers.py | 5 +- tests/pytests/unit/test_log.py | 8 +- tests/pytests/unit/tokens/test_localfs.py | 2 +- tests/pytests/unit/transport/test_zeromq.py | 61 ++- .../unit/utils/event/test_event_return.py | 2 +- .../utils/jinja/test_custom_extensions.py | 10 +- .../unit/utils/parsers/test_log_parsers.py | 18 +- .../utils/templates/test_wrap_tmpl_func.py | 2 +- tests/pytests/unit/utils/test_cache.py | 6 +- tests/pytests/unit/utils/test_cloud.py | 34 +- tests/pytests/unit/utils/test_files.py | 2 +- tests/pytests/unit/utils/test_gitfs.py | 4 +- tests/pytests/unit/utils/test_http.py | 2 +- tests/pytests/unit/utils/test_nacl.py | 4 +- tests/pytests/unit/utils/test_pycrypto.py | 8 +- tests/pytests/unit/utils/test_stringutils.py | 34 +- tests/pytests/unit/utils/test_versions.py | 8 +- tests/pytests/unit/utils/test_win_reg.py | 12 +- .../unit/utils/verify/test_clean_path_link.py | 4 +- .../unit/utils/win_lgpo/test_auditpol.py | 2 +- tests/support/case.py | 22 +- tests/support/gitfs.py | 12 +- tests/support/helpers.py | 24 +- tests/support/mixins.py | 22 +- tests/support/mock.py | 4 +- tests/support/netapi.py | 6 +- tests/support/pytest/etcd.py | 4 +- tests/support/pytest/helpers.py | 14 +- tests/support/pytest/loader.py | 8 +- tests/support/pytest/mysql.py | 14 +- tests/support/pytest/transport.py | 4 +- tests/support/sminion.py | 2 +- tests/support/virt.py | 8 +- tests/support/win_installer.py | 6 +- tests/unit/modules/test_boto_apigateway.py | 94 ++-- tests/unit/modules/test_boto_route53.py | 2 +- tests/unit/modules/test_boto_secgroup.py | 2 +- tests/unit/modules/test_boto_vpc.py | 23 +- tests/unit/modules/test_cron.py | 10 +- tests/unit/modules/test_heat.py | 2 +- tests/unit/modules/test_k8s.py | 56 ++- .../unit/modules/test_kernelpkg_linux_apt.py | 5 +- .../unit/modules/test_kernelpkg_linux_yum.py | 2 +- tests/unit/modules/test_linux_acl.py | 2 +- tests/unit/modules/test_localemod.py | 4 +- tests/unit/modules/test_napalm_probes.py | 2 +- tests/unit/modules/test_rh_ip.py | 12 +- tests/unit/modules/test_ssh.py | 16 +- tests/unit/modules/test_sysmod.py | 6 +- tests/unit/modules/test_virt.py | 22 +- tests/unit/modules/test_virtualenv_mod.py | 2 +- tests/unit/modules/test_vsphere.py | 6 +- tests/unit/modules/test_win_wusa.py | 8 +- tests/unit/modules/test_zcbuildout.py | 26 +- tests/unit/modules/test_zypperpkg.py | 10 +- .../unit/states/test_boto_cognitoidentity.py | 46 +- tests/unit/states/test_boto_vpc.py | 16 +- tests/unit/states/test_ipset.py | 14 +- tests/unit/states/test_module.py | 34 +- tests/unit/test_auth.py | 2 +- tests/unit/test_config.py | 66 ++- tests/unit/test_mock.py | 6 +- tests/unit/test_zypp_plugins.py | 2 +- tests/unit/transport/test_tcp.py | 8 +- tests/unit/utils/test_botomod.py | 4 +- tests/unit/utils/test_dns.py | 8 +- tests/unit/utils/test_dockermod.py | 16 +- tests/unit/utils/test_jid.py | 4 +- tests/unit/utils/test_json.py | 2 +- tests/unit/utils/test_pbm.py | 2 +- tests/unit/utils/test_process.py | 6 +- tests/unit/utils/test_schema.py | 90 ++-- tests/unit/utils/test_ssdp.py | 25 +- tests/unit/utils/test_state.py | 12 +- tests/unit/utils/test_systemd.py | 8 +- tests/unit/utils/test_thin.py | 20 +- tests/unit/utils/test_vt.py | 6 +- tests/unit/utils/test_win_service.py | 4 +- tests/unit/utils/test_win_system.py | 4 +- tools/precommit/docs.py | 9 +- 1424 files changed, 11463 insertions(+), 12874 deletions(-) diff --git a/.gitignore b/.gitignore index 7561cae50f2..63b49a64487 100644 --- a/.gitignore +++ b/.gitignore @@ -121,6 +121,7 @@ Session.vim # Nox requirements archives nox.*.tar.bzip2 +nox.*.tar.gz nox.*.tar.xz # Debian packages diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9067d37d074..7389a5d5b8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1625,8 +1625,8 @@ repos: rev: v3.15.1 hooks: - id: pyupgrade - name: Drop six usage and Py2 support - args: [--py3-plus, --keep-mock] + name: Upgrade code to Py3.7+ + args: [--py37-plus, --keep-mock] exclude: > (?x)^( salt/client/ssh/ssh_py_shim.py diff --git a/doc/_ext/saltdomain.py b/doc/_ext/saltdomain.py index 9810ae4c31a..03ad25cb93c 100644 --- a/doc/_ext/saltdomain.py +++ b/doc/_ext/saltdomain.py @@ -53,7 +53,7 @@ class LiterateCoding(Directive): comment; False designates code. """ comment_char = "#" # TODO: move this into a directive option - comment = re.compile(r"^\s*{}[ \n]".format(comment_char)) + comment = re.compile(rf"^\s*{comment_char}[ \n]") section_test = lambda val: bool(comment.match(val)) sections = [] @@ -136,7 +136,7 @@ class LiterateFormula(LiterateCoding): formulas_dirs = config.formulas_dirs fpath = sls_path.replace(".", "/") - name_options = ("{}.sls".format(fpath), os.path.join(fpath, "init.sls")) + name_options = (f"{fpath}.sls", os.path.join(fpath, "init.sls")) paths = [ os.path.join(fdir, fname) @@ -151,7 +151,7 @@ class LiterateFormula(LiterateCoding): except OSError: pass - raise OSError("Could not find sls file '{}'".format(sls_path)) + raise OSError(f"Could not find sls file '{sls_path}'") class CurrentFormula(Directive): @@ -196,7 +196,7 @@ class Formula(Directive): targetnode = nodes.target("", "", ids=["module-" + formname], ismod=True) self.state.document.note_explicit_target(targetnode) - indextext = "{}-formula)".format(formname) + indextext = f"{formname}-formula)" inode = addnodes.index( entries=[("single", indextext, "module-" + formname, "")] ) @@ -221,9 +221,9 @@ class State(Directive): formula = env.temp_data.get("salt:formula") - indextext = "{1} ({0}-formula)".format(formula, statename) + indextext = f"{statename} ({formula}-formula)" inode = addnodes.index( - entries=[("single", indextext, "module-{}".format(statename), "")] + entries=[("single", indextext, f"module-{statename}", "")] ) return [targetnode, inode] diff --git a/noxfile.py b/noxfile.py index 05de53de6f6..16433437f5f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -107,7 +107,7 @@ def session_warn(session, message): try: session.warn(message) except AttributeError: - session.log("WARNING: {}".format(message)) + session.log(f"WARNING: {message}") def session_run_always(session, *command, **kwargs): @@ -132,15 +132,15 @@ def session_run_always(session, *command, **kwargs): def find_session_runner(session, name, python_version, onedir=False, **kwargs): if onedir: - name += "-onedir-{}".format(ONEDIR_PYTHON_PATH) + name += f"-onedir-{ONEDIR_PYTHON_PATH}" else: - name += "-{}".format(python_version) + name += f"-{python_version}" for s, _ in session._runner.manifest.list_all_sessions(): if name not in s.signatures: continue for signature in s.signatures: for key, value in kwargs.items(): - param = "{}={!r}".format(key, value) + param = f"{key}={value!r}" if param not in signature: break else: @@ -211,7 +211,7 @@ def _get_pip_requirements_file(session, crypto=None, requirements_type="ci"): ) if os.path.exists(_requirements_file): return _requirements_file - session.error("Could not find a windows requirements file for {}".format(pydir)) + session.error(f"Could not find a windows requirements file for {pydir}") elif IS_DARWIN: if crypto is None: _requirements_file = os.path.join( @@ -224,7 +224,7 @@ def _get_pip_requirements_file(session, crypto=None, requirements_type="ci"): ) if os.path.exists(_requirements_file): return _requirements_file - session.error("Could not find a darwin requirements file for {}".format(pydir)) + session.error(f"Could not find a darwin requirements file for {pydir}") elif IS_FREEBSD: if crypto is None: _requirements_file = os.path.join( @@ -237,7 +237,7 @@ def _get_pip_requirements_file(session, crypto=None, requirements_type="ci"): ) if os.path.exists(_requirements_file): return _requirements_file - session.error("Could not find a freebsd requirements file for {}".format(pydir)) + session.error(f"Could not find a freebsd requirements file for {pydir}") else: if crypto is None: _requirements_file = os.path.join( @@ -250,7 +250,7 @@ def _get_pip_requirements_file(session, crypto=None, requirements_type="ci"): ) if os.path.exists(_requirements_file): return _requirements_file - session.error("Could not find a linux requirements file for {}".format(pydir)) + session.error(f"Could not find a linux requirements file for {pydir}") def _upgrade_pip_setuptools_and_wheel(session, upgrade=True): @@ -569,7 +569,7 @@ def test_parametrized(session, coverage, transport, crypto): session.install(*install_command, silent=PIP_INSTALL_SILENT) cmd_args = [ - "--transport={}".format(transport), + f"--transport={transport}", ] + session.posargs _pytest(session, coverage=coverage, cmd_args=cmd_args) @@ -1014,7 +1014,7 @@ def _pytest(session, coverage, cmd_args, env=None, on_rerun=False): if arg == "--log-file" or arg.startswith("--log-file="): break else: - args.append("--log-file={}".format(RUNTESTS_LOGFILE)) + args.append(f"--log-file={RUNTESTS_LOGFILE}") args.extend(cmd_args) if PRINT_SYSTEM_INFO_ONLY and "--sys-info-and-exit" not in args: @@ -1487,7 +1487,7 @@ def _lint(session, rcfile, flags, paths, upgrade_setuptools_and_pip=True): ] session.install(*install_command, silent=PIP_INSTALL_SILENT) - cmd_args = ["pylint", "--rcfile={}".format(rcfile)] + list(flags) + list(paths) + cmd_args = ["pylint", f"--rcfile={rcfile}"] + list(flags) + list(paths) cmd_kwargs = {"env": {"PYTHONUNBUFFERED": "1"}} session.run(*cmd_args, **cmd_kwargs) @@ -1528,8 +1528,8 @@ def lint(session): """ Run PyLint against Salt and it's test suite. """ - session.notify("lint-salt-{}".format(session.python)) - session.notify("lint-tests-{}".format(session.python)) + session.notify(f"lint-salt-{session.python}") + session.notify(f"lint-tests-{session.python}") @nox.session(python="3", name="lint-salt") @@ -1593,7 +1593,7 @@ def docs(session, compress, update, clean): """ Build Salt's Documentation """ - session.notify("docs-html-{}(compress={})".format(session.python, compress)) + session.notify(f"docs-html-{session.python}(compress={compress})") session.notify( find_session_runner( session, diff --git a/salt/__init__.py b/salt/__init__.py index 409ccabb2c3..17535b986a4 100644 --- a/salt/__init__.py +++ b/salt/__init__.py @@ -22,7 +22,7 @@ class TornadoImporter: def create_module(self, spec): if USE_VENDORED_TORNADO: - mod = importlib.import_module("salt.ext.{}".format(spec.name)) + mod = importlib.import_module(f"salt.ext.{spec.name}") else: # pragma: no cover # Remove 'salt.ext.' from the module mod = importlib.import_module(spec.name[9:]) diff --git a/salt/_logging/impl.py b/salt/_logging/impl.py index 9ffa5320301..832c72b4769 100644 --- a/salt/_logging/impl.py +++ b/salt/_logging/impl.py @@ -108,9 +108,9 @@ DFLT_LOG_FMT_LOGFILE = "%(asctime)s,%(msecs)03d [%(name)-17s:%(lineno)-4d][%(lev class SaltLogRecord(logging.LogRecord): def __init__(self, *args, **kwargs): logging.LogRecord.__init__(self, *args, **kwargs) - self.bracketname = "[{:<17}]".format(str(self.name)) - self.bracketlevel = "[{:<8}]".format(str(self.levelname)) - self.bracketprocess = "[{:>5}]".format(str(self.process)) + self.bracketname = f"[{str(self.name):<17}]" + self.bracketlevel = f"[{str(self.levelname):<8}]" + self.bracketprocess = f"[{str(self.process):>5}]" class SaltColorLogRecord(SaltLogRecord): @@ -124,11 +124,11 @@ class SaltColorLogRecord(SaltLogRecord): self.colorname = "{}[{:<17}]{}".format( LOG_COLORS["name"], str(self.name), reset ) - self.colorlevel = "{}[{:<8}]{}".format(clevel, str(self.levelname), reset) + self.colorlevel = f"{clevel}[{str(self.levelname):<8}]{reset}" self.colorprocess = "{}[{:>5}]{}".format( LOG_COLORS["process"], str(self.process), reset ) - self.colormsg = "{}{}{}".format(cmsg, self.getMessage(), reset) + self.colormsg = f"{cmsg}{self.getMessage()}{reset}" def get_log_record_factory(): @@ -726,7 +726,7 @@ def setup_logfile_handler( syslog_opts["address"] = str(path.resolve().parent) except OSError as exc: raise LoggingRuntimeError( - "Failed to setup the Syslog logging handler: {}".format(exc) + f"Failed to setup the Syslog logging handler: {exc}" ) from exc elif parsed_log_path.path: # In case of udp or tcp with a facility specified @@ -736,7 +736,7 @@ def setup_logfile_handler( # Logging facilities start with LOG_ if this is not the case # fail right now! raise LoggingRuntimeError( - "The syslog facility '{}' is not known".format(facility_name) + f"The syslog facility '{facility_name}' is not known" ) else: # This is the case of udp or tcp without a facility specified @@ -747,7 +747,7 @@ def setup_logfile_handler( # This python syslog version does not know about the user provided # facility name raise LoggingRuntimeError( - "The syslog facility '{}' is not known".format(facility_name) + f"The syslog facility '{facility_name}' is not known" ) syslog_opts["facility"] = facility @@ -767,7 +767,7 @@ def setup_logfile_handler( handler = SysLogHandler(**syslog_opts) except OSError as exc: raise LoggingRuntimeError( - "Failed to setup the Syslog logging handler: {}".format(exc) + f"Failed to setup the Syslog logging handler: {exc}" ) from exc else: # make sure, the logging directory exists and attempt to create it if necessary diff --git a/salt/auth/__init__.py b/salt/auth/__init__.py index df2eebe4f85..019c9822963 100644 --- a/salt/auth/__init__.py +++ b/salt/auth/__init__.py @@ -137,7 +137,7 @@ class LoadAuth: mod = self.opts["eauth_acl_module"] if not mod: mod = load["eauth"] - fstr = "{}.acl".format(mod) + fstr = f"{mod}.acl" if fstr not in self.auth: return None fcall = salt.utils.args.format_call( @@ -474,7 +474,7 @@ class LoadAuth: msg = 'Authentication failure of type "user" occurred' if not auth_ret: # auth_ret can be a boolean or the effective user id if show_username: - msg = "{} for user {}.".format(msg, username) + msg = f"{msg} for user {username}." ret["error"] = {"name": "UserAuthenticationError", "message": msg} return ret @@ -535,7 +535,7 @@ class Resolver: if not eauth: print("External authentication system has not been specified") return ret - fstr = "{}.auth".format(eauth) + fstr = f"{eauth}.auth" if fstr not in self.auth: print( 'The specified external authentication system "{}" is not available'.format( @@ -554,14 +554,14 @@ class Resolver: if arg in self.opts: ret[arg] = self.opts[arg] elif arg.startswith("pass"): - ret[arg] = getpass.getpass("{}: ".format(arg)) + ret[arg] = getpass.getpass(f"{arg}: ") else: - ret[arg] = input("{}: ".format(arg)) + ret[arg] = input(f"{arg}: ") for kwarg, default in list(args["kwargs"].items()): if kwarg in self.opts: ret["kwarg"] = self.opts[kwarg] else: - ret[kwarg] = input("{} [{}]: ".format(kwarg, default)) + ret[kwarg] = input(f"{kwarg} [{default}]: ") # Use current user if empty if "username" in ret and not ret["username"]: diff --git a/salt/auth/django.py b/salt/auth/django.py index 0b810b83510..d11fa438f30 100644 --- a/salt/auth/django.py +++ b/salt/auth/django.py @@ -111,7 +111,7 @@ def __django_auth_setup(): django_module_name, globals(), locals(), "SaltExternalAuthModel" ) # pylint: enable=possibly-unused-variable - DJANGO_AUTH_CLASS_str = "django_auth_module.{}".format(django_model_name) + DJANGO_AUTH_CLASS_str = f"django_auth_module.{django_model_name}" DJANGO_AUTH_CLASS = eval(DJANGO_AUTH_CLASS_str) # pylint: disable=W0123 diff --git a/salt/auth/ldap.py b/salt/auth/ldap.py index 604f06c3d20..a3c952ce678 100644 --- a/salt/auth/ldap.py +++ b/salt/auth/ldap.py @@ -54,15 +54,15 @@ def _config(key, mandatory=True, opts=None): """ try: if opts: - value = opts["auth.ldap.{}".format(key)] + value = opts[f"auth.ldap.{key}"] else: - value = __opts__["auth.ldap.{}".format(key)] + value = __opts__[f"auth.ldap.{key}"] except KeyError: try: - value = __defopts__["auth.ldap.{}".format(key)] + value = __defopts__[f"auth.ldap.{key}"] except KeyError: if mandatory: - msg = "missing auth.ldap.{} in master config".format(key) + msg = f"missing auth.ldap.{key} in master config" raise SaltInvocationError(msg) return False return value @@ -120,13 +120,13 @@ class _LDAPConnection: schema = "ldaps" if tls else "ldap" if self.uri == "": - self.uri = "{}://{}:{}".format(schema, self.server, self.port) + self.uri = f"{schema}://{self.server}:{self.port}" try: if no_verify: ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) - self.ldap = ldap.initialize("{}".format(self.uri)) + self.ldap = ldap.initialize(f"{self.uri}") self.ldap.protocol_version = 3 # ldap.VERSION3 self.ldap.set_option(ldap.OPT_REFERRALS, 0) # Needed for AD diff --git a/salt/auth/pam.py b/salt/auth/pam.py index 12af29bbdb8..6e179deb7c6 100644 --- a/salt/auth/pam.py +++ b/salt/auth/pam.py @@ -104,7 +104,7 @@ class PamMessage(Structure): ] def __repr__(self): - return "".format(self.msg_style, self.msg) + return f"" class PamResponse(Structure): @@ -118,7 +118,7 @@ class PamResponse(Structure): ] def __repr__(self): - return "".format(self.resp_retcode, self.resp) + return f"" CONV_FUNC = CFUNCTYPE( @@ -236,8 +236,7 @@ def authenticate(username, password): ret = subprocess.run( [str(pyexe), str(pyfile)], env=env, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, ) if ret.returncode == 0: diff --git a/salt/beacons/__init__.py b/salt/beacons/__init__.py index a1e3da3ac51..5fe72327fbf 100644 --- a/salt/beacons/__init__.py +++ b/salt/beacons/__init__.py @@ -75,7 +75,7 @@ class Beacon: # Run the validate function if it's available, # otherwise there is a warning about it being missing - validate_str = "{}.validate".format(beacon_name) + validate_str = f"{beacon_name}.validate" if validate_str in self.beacons: valid, vcomment = self.beacons[validate_str](b_config[mod]) @@ -96,7 +96,7 @@ class Beacon: continue b_config[mod].append({"_beacon_name": mod}) - fun_str = "{}.beacon".format(beacon_name) + fun_str = f"{beacon_name}.beacon" if fun_str in self.beacons: runonce = self._determine_beacon_config( current_beacon_config, "run_once" @@ -125,7 +125,7 @@ class Beacon: if re.match("state.*", job["fun"]): is_running = True if is_running: - close_str = "{}.close".format(beacon_name) + close_str = f"{beacon_name}.close" if close_str in self.beacons: log.info("Closing beacon %s. State run in progress.", mod) self.beacons[close_str](b_config[mod]) @@ -140,7 +140,7 @@ class Beacon: try: raw = self.beacons[fun_str](b_config[mod]) except: # pylint: disable=bare-except - error = "{}".format(sys.exc_info()[1]) + error = f"{sys.exc_info()[1]}" log.error("Unable to start %s beacon, %s", mod, error) # send beacon error event tag = "salt/beacon/{}/{}/".format(self.opts["id"], mod) @@ -309,7 +309,7 @@ class Beacon: """ beacon_name = next(item.get("beacon_module", name) for item in beacon_data) - validate_str = "{}.validate".format(beacon_name) + validate_str = f"{beacon_name}.validate" # Run the validate function if it's available, # otherwise there is a warning about it being missing if validate_str in self.beacons: @@ -348,9 +348,9 @@ class Beacon: complete = False else: if name in self.opts["beacons"]: - comment = "Updating settings for beacon item: {}".format(name) + comment = f"Updating settings for beacon item: {name}" else: - comment = "Added new beacon item: {}".format(name) + comment = f"Added new beacon item: {name}" complete = True self.opts["beacons"].update(data) @@ -376,12 +376,10 @@ class Beacon: data[name] = beacon_data if name in self._get_beacons(include_opts=False): - comment = ( - "Cannot modify beacon item {}, it is configured in pillar.".format(name) - ) + comment = f"Cannot modify beacon item {name}, it is configured in pillar." complete = False else: - comment = "Updating settings for beacon item: {}".format(name) + comment = f"Updating settings for beacon item: {name}" complete = True self.opts["beacons"].update(data) @@ -403,16 +401,14 @@ class Beacon: """ if name in self._get_beacons(include_opts=False): - comment = ( - "Cannot delete beacon item {}, it is configured in pillar.".format(name) - ) + comment = f"Cannot delete beacon item {name}, it is configured in pillar." complete = False else: if name in self.opts["beacons"]: del self.opts["beacons"][name] - comment = "Deleting beacon item: {}".format(name) + comment = f"Deleting beacon item: {name}" else: - comment = "Beacon item {} not found.".format(name) + comment = f"Beacon item {name} not found." complete = True # Fire the complete event back along with updated list of beacons @@ -466,13 +462,11 @@ class Beacon: """ if name in self._get_beacons(include_opts=False): - comment = ( - "Cannot enable beacon item {}, it is configured in pillar.".format(name) - ) + comment = f"Cannot enable beacon item {name}, it is configured in pillar." complete = False else: self._update_enabled(name, True) - comment = "Enabling beacon item {}".format(name) + comment = f"Enabling beacon item {name}" complete = True # Fire the complete event back along with updated list of beacons @@ -502,7 +496,7 @@ class Beacon: complete = False else: self._update_enabled(name, False) - comment = "Disabling beacon item {}".format(name) + comment = f"Disabling beacon item {name}" complete = True # Fire the complete event back along with updated list of beacons diff --git a/salt/beacons/btmp.py b/salt/beacons/btmp.py index f980a3ff4e1..a5d10f997fc 100644 --- a/salt/beacons/btmp.py +++ b/salt/beacons/btmp.py @@ -130,7 +130,7 @@ except ImportError: def __virtual__(): if os.path.isfile(BTMP): return __virtualname__ - err_msg = "{} does not exist.".format(BTMP) + err_msg = f"{BTMP} does not exist." log.error("Unable to load %s beacon: %s", __virtualname__, err_msg) return False, err_msg diff --git a/salt/beacons/diskusage.py b/salt/beacons/diskusage.py index eab69786902..da904cfa520 100644 --- a/salt/beacons/diskusage.py +++ b/salt/beacons/diskusage.py @@ -95,7 +95,7 @@ def beacon(config): # if our mount doesn't end with a $, insert one. mount_re = mount if not mount.endswith("$"): - mount_re = "{}$".format(mount) + mount_re = f"{mount}$" if salt.utils.platform.is_windows(): # mount_re comes in formatted with a $ at the end diff --git a/salt/beacons/inotify.py b/salt/beacons/inotify.py index 283b84fdc73..3b11322319b 100644 --- a/salt/beacons/inotify.py +++ b/salt/beacons/inotify.py @@ -68,7 +68,7 @@ def _get_notifier(config): Check the context for the notifier and construct it if not present """ beacon_name = config.get("_beacon_name", "inotify") - notifier = "{}.notifier".format(beacon_name) + notifier = f"{beacon_name}.notifier" if notifier not in __context__: __context__["inotify.queue"] = collections.deque() wm = pyinotify.WatchManager() @@ -353,7 +353,7 @@ def beacon(config): def close(config): config = salt.utils.beacons.list_to_dict(config) beacon_name = config.get("_beacon_name", "inotify") - notifier = "{}.notifier".format(beacon_name) + notifier = f"{beacon_name}.notifier" if notifier in __context__: __context__[notifier].stop() del __context__[notifier] diff --git a/salt/beacons/napalm_beacon.py b/salt/beacons/napalm_beacon.py index 122d56edb75..e1c97415bf8 100644 --- a/salt/beacons/napalm_beacon.py +++ b/salt/beacons/napalm_beacon.py @@ -298,7 +298,7 @@ def validate(config): " dictionary".format(fun), ) if fun not in __salt__: - return False, "Execution function {} is not availabe!".format(fun) + return False, f"Execution function {fun} is not availabe!" return True, "Valid configuration for the napal beacon!" diff --git a/salt/beacons/salt_monitor.py b/salt/beacons/salt_monitor.py index d389976ae2a..d8d580edbb3 100644 --- a/salt/beacons/salt_monitor.py +++ b/salt/beacons/salt_monitor.py @@ -45,7 +45,7 @@ def validate(config): # a simple str is taking as the single function with no args / kwargs fun = config["salt_fun"] if fun not in __salt__: - return False, "{} not in __salt__".format(fun) + return False, f"{fun} not in __salt__" else: for entry in config["salt_fun"]: if isinstance(entry, dict): @@ -56,7 +56,7 @@ def validate(config): if not isinstance(args_kwargs_dict[key], list): return ( False, - "args key for fun {} must be list".format(fun), + f"args key for fun {fun} must be list", ) elif key == "kwargs": if not isinstance(args_kwargs_dict[key], list): @@ -70,19 +70,19 @@ def validate(config): if not isinstance(key_value, dict): return ( False, - "{} is not a key / value pair".format(key_value), + f"{key_value} is not a key / value pair", ) else: return ( False, - "key {} not allowed under fun {}".format(key, fun), + f"key {key} not allowed under fun {fun}", ) else: # entry must be function itself fun = entry if fun not in __salt__: - return False, "{} not in __salt__".format(fun) + return False, f"{fun} not in __salt__" return True, "valid config" diff --git a/salt/beacons/salt_proxy.py b/salt/beacons/salt_proxy.py index 1eebc4103b9..2ec7c47d2a5 100644 --- a/salt/beacons/salt_proxy.py +++ b/salt/beacons/salt_proxy.py @@ -23,9 +23,9 @@ def _run_proxy_processes(proxies): result = {} if not __salt__["salt_proxy.is_running"](proxy)["result"]: __salt__["salt_proxy.configure_proxy"](proxy, start=True) - result[proxy] = "Proxy {} was started".format(proxy) + result[proxy] = f"Proxy {proxy} was started" else: - msg = "Proxy {} is already running".format(proxy) + msg = f"Proxy {proxy} is already running" result[proxy] = msg log.debug(msg) ret.append(result) diff --git a/salt/beacons/sensehat.py b/salt/beacons/sensehat.py index 6e3c29f4d36..a6b4c912a18 100644 --- a/salt/beacons/sensehat.py +++ b/salt/beacons/sensehat.py @@ -73,7 +73,7 @@ def beacon(config): config = salt.utils.beacons.list_to_dict(config) for sensor in config.get("sensors", {}): - sensor_function = "sensehat.get_{}".format(sensor) + sensor_function = f"sensehat.get_{sensor}" if sensor_function not in __salt__: log.error("No sensor for meassuring %s. Skipping.", sensor) continue @@ -95,6 +95,6 @@ def beacon(config): current_value = __salt__[sensor_function]() if not sensor_min <= current_value <= sensor_max: - ret.append({"tag": "sensehat/{}".format(sensor), sensor: current_value}) + ret.append({"tag": f"sensehat/{sensor}", sensor: current_value}) return ret diff --git a/salt/beacons/sh.py b/salt/beacons/sh.py index 8141b5a1a95..57ef43bca9c 100644 --- a/salt/beacons/sh.py +++ b/salt/beacons/sh.py @@ -73,7 +73,7 @@ def beacon(config): __context__[pkey] = {} for pid in track_pids: if pid not in __context__[pkey]: - cmd = ["strace", "-f", "-e", "execve", "-p", "{}".format(pid)] + cmd = ["strace", "-f", "-e", "execve", "-p", f"{pid}"] __context__[pkey][pid] = {} __context__[pkey][pid]["vt"] = salt.utils.vt.Terminal( cmd, diff --git a/salt/beacons/smartos_imgadm.py b/salt/beacons/smartos_imgadm.py index f1e3e83df3b..665168c0e3f 100644 --- a/salt/beacons/smartos_imgadm.py +++ b/salt/beacons/smartos_imgadm.py @@ -80,7 +80,7 @@ def beacon(config): for uuid in current_images: event = {} if uuid not in IMGADM_STATE["images"]: - event["tag"] = "imported/{}".format(uuid) + event["tag"] = f"imported/{uuid}" for label in current_images[uuid]: event[label] = current_images[uuid][label] @@ -91,7 +91,7 @@ def beacon(config): for uuid in IMGADM_STATE["images"]: event = {} if uuid not in current_images: - event["tag"] = "deleted/{}".format(uuid) + event["tag"] = f"deleted/{uuid}" for label in IMGADM_STATE["images"][uuid]: event[label] = IMGADM_STATE["images"][uuid][label] diff --git a/salt/beacons/smartos_vmadm.py b/salt/beacons/smartos_vmadm.py index 1dae2430b1b..7cdb8806a18 100644 --- a/salt/beacons/smartos_vmadm.py +++ b/salt/beacons/smartos_vmadm.py @@ -83,7 +83,7 @@ def beacon(config): for uuid in current_vms: event = {} if uuid not in VMADM_STATE["vms"]: - event["tag"] = "created/{}".format(uuid) + event["tag"] = f"created/{uuid}" for label in current_vms[uuid]: if label == "state": continue @@ -96,7 +96,7 @@ def beacon(config): for uuid in VMADM_STATE["vms"]: event = {} if uuid not in current_vms: - event["tag"] = "deleted/{}".format(uuid) + event["tag"] = f"deleted/{uuid}" for label in VMADM_STATE["vms"][uuid]: if label == "state": continue diff --git a/salt/beacons/status.py b/salt/beacons/status.py index 9492d339691..8c1210e7dbc 100644 --- a/salt/beacons/status.py +++ b/salt/beacons/status.py @@ -143,7 +143,7 @@ def beacon(config): for func in entry: ret[func] = {} try: - data = __salt__["status.{}".format(func)]() + data = __salt__[f"status.{func}"]() except salt.exceptions.CommandExecutionError as exc: log.debug( "Status beacon attempted to process function %s " @@ -166,8 +166,6 @@ def beacon(config): except TypeError: ret[func][item] = data[int(item)] except KeyError as exc: - ret[func] = ( - "Status beacon is incorrectly configured: {}".format(exc) - ) + ret[func] = f"Status beacon is incorrectly configured: {exc}" return [{"tag": ctime, "data": ret}] diff --git a/salt/beacons/wtmp.py b/salt/beacons/wtmp.py index c8ac6cfc379..a9f1b09281a 100644 --- a/salt/beacons/wtmp.py +++ b/salt/beacons/wtmp.py @@ -159,7 +159,7 @@ except ImportError: def __virtual__(): if os.path.isfile(WTMP): return __virtualname__ - err_msg = "{} does not exist.".format(WTMP) + err_msg = f"{WTMP} does not exist." log.error("Unable to load %s beacon: %s", __virtualname__, err_msg) return False, err_msg diff --git a/salt/cache/__init__.py b/salt/cache/__init__.py index 71fafc6d286..fb2ecdc62f1 100644 --- a/salt/cache/__init__.py +++ b/salt/cache/__init__.py @@ -69,7 +69,7 @@ class Cache: def __lazy_init(self): self._modules = salt.loader.cache(self.opts) - fun = "{}.init_kwargs".format(self.driver) + fun = f"{self.driver}.init_kwargs" if fun in self.modules: self._kwargs = self.modules[fun](self._kwargs) else: @@ -140,7 +140,7 @@ class Cache: Raises an exception if cache driver detected an error accessing data in the cache backend (auth, permissions, etc). """ - fun = "{}.store".format(self.driver) + fun = f"{self.driver}.store" return self.modules[fun](bank, key, data, **self._kwargs) def fetch(self, bank, key): @@ -164,7 +164,7 @@ class Cache: Raises an exception if cache driver detected an error accessing data in the cache backend (auth, permissions, etc). """ - fun = "{}.fetch".format(self.driver) + fun = f"{self.driver}.fetch" return self.modules[fun](bank, key, **self._kwargs) def updated(self, bank, key): @@ -188,7 +188,7 @@ class Cache: Raises an exception if cache driver detected an error accessing data in the cache backend (auth, permissions, etc). """ - fun = "{}.updated".format(self.driver) + fun = f"{self.driver}.updated" return self.modules[fun](bank, key, **self._kwargs) def flush(self, bank, key=None): @@ -209,7 +209,7 @@ class Cache: Raises an exception if cache driver detected an error accessing data in the cache backend (auth, permissions, etc). """ - fun = "{}.flush".format(self.driver) + fun = f"{self.driver}.flush" return self.modules[fun](bank, key=key, **self._kwargs) def list(self, bank): @@ -228,7 +228,7 @@ class Cache: Raises an exception if cache driver detected an error accessing data in the cache backend (auth, permissions, etc). """ - fun = "{}.list".format(self.driver) + fun = f"{self.driver}.list" return self.modules[fun](bank, **self._kwargs) def contains(self, bank, key=None): @@ -253,7 +253,7 @@ class Cache: Raises an exception if cache driver detected an error accessing data in the cache backend (auth, permissions, etc). """ - fun = "{}.contains".format(self.driver) + fun = f"{self.driver}.contains" return self.modules[fun](bank, key, **self._kwargs) @@ -288,7 +288,7 @@ class MemCache(Cache): break def _get_storage_id(self): - fun = "{}.storage_id".format(self.driver) + fun = f"{self.driver}.storage_id" if fun in self.modules: return self.modules[fun](self.kwargs) else: diff --git a/salt/cache/consul.py b/salt/cache/consul.py index 547e2fe4e2d..61af6cc5149 100644 --- a/salt/cache/consul.py +++ b/salt/cache/consul.py @@ -119,33 +119,29 @@ def store(bank, key, data): """ Store a key value. """ - c_key = "{}/{}".format(bank, key) - tstamp_key = "{}/{}{}".format(bank, key, _tstamp_suffix) + c_key = f"{bank}/{key}" + tstamp_key = f"{bank}/{key}{_tstamp_suffix}" try: c_data = salt.payload.dumps(data) api.kv.put(c_key, c_data) api.kv.put(tstamp_key, salt.payload.dumps(int(time.time()))) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error writing the key, {}: {}".format(c_key, exc) - ) + raise SaltCacheError(f"There was an error writing the key, {c_key}: {exc}") def fetch(bank, key): """ Fetch a key value. """ - c_key = "{}/{}".format(bank, key) + c_key = f"{bank}/{key}" try: _, value = api.kv.get(c_key) if value is None: return {} return salt.payload.loads(value["Value"]) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error reading the key, {}: {}".format(c_key, exc) - ) + raise SaltCacheError(f"There was an error reading the key, {c_key}: {exc}") def flush(bank, key=None): @@ -156,16 +152,14 @@ def flush(bank, key=None): c_key = bank tstamp_key = None else: - c_key = "{}/{}".format(bank, key) - tstamp_key = "{}/{}{}".format(bank, key, _tstamp_suffix) + c_key = f"{bank}/{key}" + tstamp_key = f"{bank}/{key}{_tstamp_suffix}" try: if tstamp_key: api.kv.delete(tstamp_key) return api.kv.delete(c_key, recurse=key is None) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error removing the key, {}: {}".format(c_key, exc) - ) + raise SaltCacheError(f"There was an error removing the key, {c_key}: {exc}") def list_(bank): @@ -175,9 +169,7 @@ def list_(bank): try: _, keys = api.kv.get(bank + "/", keys=True, separator="/") except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - 'There was an error getting the key "{}": {}'.format(bank, exc) - ) + raise SaltCacheError(f'There was an error getting the key "{bank}": {exc}') if keys is None: keys = [] else: @@ -198,9 +190,7 @@ def contains(bank, key): c_key = "{}/{}".format(bank, key or "") _, value = api.kv.get(c_key, keys=True) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error getting the key, {}: {}".format(c_key, exc) - ) + raise SaltCacheError(f"There was an error getting the key, {c_key}: {exc}") return value is not None @@ -209,13 +199,11 @@ def updated(bank, key): Return the Unix Epoch timestamp of when the key was last updated. Return None if key is not found. """ - c_key = "{}/{}{}".format(bank, key, _tstamp_suffix) + c_key = f"{bank}/{key}{_tstamp_suffix}" try: _, value = api.kv.get(c_key) if value is None: return None return salt.payload.loads(value["Value"]) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error reading the key, {}: {}".format(c_key, exc) - ) + raise SaltCacheError(f"There was an error reading the key, {c_key}: {exc}") diff --git a/salt/cache/etcd_cache.py b/salt/cache/etcd_cache.py index c1a111bd4f9..36c23f8131c 100644 --- a/salt/cache/etcd_cache.py +++ b/salt/cache/etcd_cache.py @@ -141,16 +141,14 @@ def store(bank, key, data): Store a key value. """ _init_client() - etcd_key = "{}/{}/{}".format(path_prefix, bank, key) - etcd_tstamp_key = "{}/{}/{}".format(path_prefix, bank, key + _tstamp_suffix) + etcd_key = f"{path_prefix}/{bank}/{key}" + etcd_tstamp_key = f"{path_prefix}/{bank}/{key + _tstamp_suffix}" try: value = salt.payload.dumps(data) client.write(etcd_key, base64.b64encode(value)) client.write(etcd_tstamp_key, int(time.time())) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error writing the key, {}: {}".format(etcd_key, exc) - ) + raise SaltCacheError(f"There was an error writing the key, {etcd_key}: {exc}") def fetch(bank, key): @@ -158,16 +156,14 @@ def fetch(bank, key): Fetch a key value. """ _init_client() - etcd_key = "{}/{}/{}".format(path_prefix, bank, key) + etcd_key = f"{path_prefix}/{bank}/{key}" try: value = client.read(etcd_key).value return salt.payload.loads(base64.b64decode(value)) except etcd.EtcdKeyNotFound: return {} except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error reading the key, {}: {}".format(etcd_key, exc) - ) + raise SaltCacheError(f"There was an error reading the key, {etcd_key}: {exc}") def flush(bank, key=None): @@ -176,11 +172,11 @@ def flush(bank, key=None): """ _init_client() if key is None: - etcd_key = "{}/{}".format(path_prefix, bank) + etcd_key = f"{path_prefix}/{bank}" tstamp_key = None else: - etcd_key = "{}/{}/{}".format(path_prefix, bank, key) - tstamp_key = "{}/{}/{}".format(path_prefix, bank, key + _tstamp_suffix) + etcd_key = f"{path_prefix}/{bank}/{key}" + tstamp_key = f"{path_prefix}/{bank}/{key + _tstamp_suffix}" try: client.read(etcd_key) except etcd.EtcdKeyNotFound: @@ -190,9 +186,7 @@ def flush(bank, key=None): client.delete(tstamp_key) client.delete(etcd_key, recursive=True) except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error removing the key, {}: {}".format(etcd_key, exc) - ) + raise SaltCacheError(f"There was an error removing the key, {etcd_key}: {exc}") def _walk(r): @@ -218,14 +212,14 @@ def ls(bank): bank. """ _init_client() - path = "{}/{}".format(path_prefix, bank) + path = f"{path_prefix}/{bank}" try: return _walk(client.read(path)) except etcd.EtcdKeyNotFound: return [] except Exception as exc: # pylint: disable=broad-except raise SaltCacheError( - 'There was an error getting the key "{}": {}'.format(bank, exc) + f'There was an error getting the key "{bank}": {exc}' ) from exc @@ -242,9 +236,7 @@ def contains(bank, key): except etcd.EtcdKeyNotFound: return False except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error getting the key, {}: {}".format(etcd_key, exc) - ) + raise SaltCacheError(f"There was an error getting the key, {etcd_key}: {exc}") def updated(bank, key): @@ -252,13 +244,11 @@ def updated(bank, key): Return Unix Epoch based timestamp of when the bank/key was updated. """ _init_client() - tstamp_key = "{}/{}/{}".format(path_prefix, bank, key + _tstamp_suffix) + tstamp_key = f"{path_prefix}/{bank}/{key + _tstamp_suffix}" try: value = client.read(tstamp_key).value return int(value) except etcd.EtcdKeyNotFound: return None except Exception as exc: # pylint: disable=broad-except - raise SaltCacheError( - "There was an error reading the key, {}: {}".format(tstamp_key, exc) - ) + raise SaltCacheError(f"There was an error reading the key, {tstamp_key}: {exc}") diff --git a/salt/cache/localfs.py b/salt/cache/localfs.py index df2f3ac4727..4ac5ecec062 100644 --- a/salt/cache/localfs.py +++ b/salt/cache/localfs.py @@ -51,10 +51,10 @@ def store(bank, key, data, cachedir): except OSError as exc: if exc.errno != errno.EEXIST: raise SaltCacheError( - "The cache directory, {}, could not be created: {}".format(base, exc) + f"The cache directory, {base}, could not be created: {exc}" ) - outfile = os.path.join(base, "{}.p".format(key)) + outfile = os.path.join(base, f"{key}.p") tmpfh, tmpfname = tempfile.mkstemp(dir=base) os.close(tmpfh) try: @@ -64,7 +64,7 @@ def store(bank, key, data, cachedir): salt.utils.atomicfile.atomic_rename(tmpfname, outfile) except OSError as exc: raise SaltCacheError( - "There was an error writing the cache file, {}: {}".format(base, exc) + f"There was an error writing the cache file, {base}: {exc}" ) @@ -73,7 +73,7 @@ def fetch(bank, key, cachedir): Fetch information from a file. """ inkey = False - key_file = os.path.join(cachedir, os.path.normpath(bank), "{}.p".format(key)) + key_file = os.path.join(cachedir, os.path.normpath(bank), f"{key}.p") if not os.path.isfile(key_file): # The bank includes the full filename, and the key is inside the file key_file = os.path.join(cachedir, os.path.normpath(bank) + ".p") @@ -90,7 +90,7 @@ def fetch(bank, key, cachedir): return salt.payload.load(fh_) except OSError as exc: raise SaltCacheError( - 'There was an error reading the cache file "{}": {}'.format(key_file, exc) + f'There was an error reading the cache file "{key_file}": {exc}' ) @@ -98,7 +98,7 @@ def updated(bank, key, cachedir): """ Return the epoch of the mtime for this cache file """ - key_file = os.path.join(cachedir, os.path.normpath(bank), "{}.p".format(key)) + key_file = os.path.join(cachedir, os.path.normpath(bank), f"{key}.p") if not os.path.isfile(key_file): log.warning('Cache file "%s" does not exist', key_file) return None @@ -106,7 +106,7 @@ def updated(bank, key, cachedir): return int(os.path.getmtime(key_file)) except OSError as exc: raise SaltCacheError( - 'There was an error reading the mtime for "{}": {}'.format(key_file, exc) + f'There was an error reading the mtime for "{key_file}": {exc}' ) @@ -124,12 +124,12 @@ def flush(bank, key=None, cachedir=None): return False shutil.rmtree(target) else: - target = os.path.join(cachedir, os.path.normpath(bank), "{}.p".format(key)) + target = os.path.join(cachedir, os.path.normpath(bank), f"{key}.p") if not os.path.isfile(target): return False os.remove(target) except OSError as exc: - raise SaltCacheError('There was an error removing "{}": {}'.format(target, exc)) + raise SaltCacheError(f'There was an error removing "{target}": {exc}') return True @@ -143,9 +143,7 @@ def list_(bank, cachedir): try: items = os.listdir(base) except OSError as exc: - raise SaltCacheError( - 'There was an error accessing directory "{}": {}'.format(base, exc) - ) + raise SaltCacheError(f'There was an error accessing directory "{base}": {exc}') ret = [] for item in items: if item.endswith(".p"): @@ -163,5 +161,5 @@ def contains(bank, key, cachedir): base = os.path.join(cachedir, os.path.normpath(bank)) return os.path.isdir(base) else: - keyfile = os.path.join(cachedir, os.path.normpath(bank), "{}.p".format(key)) + keyfile = os.path.join(cachedir, os.path.normpath(bank), f"{key}.p") return os.path.isfile(keyfile) diff --git a/salt/cache/mysql_cache.py b/salt/cache/mysql_cache.py index 8342ec77f16..229d8f3ae9f 100644 --- a/salt/cache/mysql_cache.py +++ b/salt/cache/mysql_cache.py @@ -144,9 +144,7 @@ def run_query(conn, query, args=None, retries=3): if len(query) > 150: query = query[:150] + "<...>" raise SaltCacheError( - "Error running {}{}: {}".format( - query, "- args: {}".format(args) if args else "", e - ) + "Error running {}{}: {}".format(query, f"- args: {args}" if args else "", e) ) @@ -266,7 +264,7 @@ def store(bank, key, data): cur, cnt = run_query(__context__.get("mysql_client"), query, args=args) cur.close() if cnt not in (1, 2): - raise SaltCacheError("Error storing {} {} returned {}".format(bank, key, cnt)) + raise SaltCacheError(f"Error storing {bank} {key} returned {cnt}") def fetch(bank, key): diff --git a/salt/cache/redis_cache.py b/salt/cache/redis_cache.py index 754bba71f0a..5584d118ba7 100644 --- a/salt/cache/redis_cache.py +++ b/salt/cache/redis_cache.py @@ -351,7 +351,7 @@ def _get_banks_to_remove(redis_server, bank, path=""): A simple tree traversal algorithm that builds the list of banks to remove, starting from an arbitrary node in the tree. """ - current_path = bank if not path else "{path}/{bank}".format(path=path, bank=bank) + current_path = bank if not path else f"{path}/{bank}" bank_paths_to_remove = [current_path] # as you got here, you'll be removed diff --git a/salt/channel/client.py b/salt/channel/client.py index 0360af34658..310804c84cf 100644 --- a/salt/channel/client.py +++ b/salt/channel/client.py @@ -143,7 +143,7 @@ class AsyncReqChannel: auth, timeout=REQUEST_CHANNEL_TIMEOUT, tries=REQUEST_CHANNEL_TRIES, - **kwargs + **kwargs, ): self.opts = dict(opts) self.transport = transport @@ -446,7 +446,7 @@ class AsyncPubChannel: except Exception as exc: # pylint: disable=broad-except if "-|RETRY|-" not in str(exc): raise salt.exceptions.SaltClientError( - "Unable to sign_in to master: {}".format(exc) + f"Unable to sign_in to master: {exc}" ) # TODO: better error message def close(self): diff --git a/salt/channel/server.py b/salt/channel/server.py index 47b8f96c0d8..14d3da30125 100644 --- a/salt/channel/server.py +++ b/salt/channel/server.py @@ -144,9 +144,7 @@ class ReqServerChannel: raise salt.ext.tornado.gen.Return("bad load: id contains a null byte") except TypeError: log.error("Payload contains non-string id: %s", payload) - raise salt.ext.tornado.gen.Return( - "bad load: id {} is not a string".format(id_) - ) + raise salt.ext.tornado.gen.Return(f"bad load: id {id_} is not a string") version = 0 if "version" in payload: diff --git a/salt/cli/batch.py b/salt/cli/batch.py index ca1f464a8d4..2e43b0ee22b 100644 --- a/salt/cli/batch.py +++ b/salt/cli/batch.py @@ -191,7 +191,7 @@ class Batch: if next_: if not self.quiet: salt.utils.stringutils.print_cli( - "\nExecuting run on {}\n".format(sorted(next_)) + f"\nExecuting run on {sorted(next_)}\n" ) # create a new iterator for this batch of minions return_value = self.opts.get("return", self.opts.get("ret", "")) diff --git a/salt/cli/caller.py b/salt/cli/caller.py index ce2b8edfd4e..ffc39356ba9 100644 --- a/salt/cli/caller.py +++ b/salt/cli/caller.py @@ -75,7 +75,7 @@ class BaseCaller: docs[name] = func.__doc__ for name in sorted(docs): if name.startswith(self.opts.get("fun", "")): - salt.utils.stringutils.print_cli("{}:\n{}\n".format(name, docs[name])) + salt.utils.stringutils.print_cli(f"{name}:\n{docs[name]}\n") def print_grains(self): """ @@ -130,7 +130,7 @@ class BaseCaller: salt.minion.get_proc_dir(self.opts["cachedir"]), ret["jid"] ) if fun not in self.minion.functions: - docs = self.minion.functions["sys.doc"]("{}*".format(fun)) + docs = self.minion.functions["sys.doc"](f"{fun}*") if docs: docs[fun] = self.minion.functions.missing_fun_string(fun) ret["out"] = "nested" @@ -194,20 +194,16 @@ class BaseCaller: executors = [executors] try: for name in executors: - fname = "{}.execute".format(name) + fname = f"{name}.execute" if fname not in self.minion.executors: - raise SaltInvocationError( - "Executor '{}' is not available".format(name) - ) + raise SaltInvocationError(f"Executor '{name}' is not available") ret["return"] = self.minion.executors[fname]( self.opts, data, func, args, kwargs ) if ret["return"] is not None: break except TypeError as exc: - sys.stderr.write( - "\nPassed invalid arguments: {}.\n\nUsage:\n".format(exc) - ) + sys.stderr.write(f"\nPassed invalid arguments: {exc}.\n\nUsage:\n") salt.utils.stringutils.print_cli(func.__doc__) active_level = LOG_LEVELS.get( self.opts["log_level"].lower(), logging.ERROR @@ -272,7 +268,7 @@ class BaseCaller: continue try: ret["success"] = True - self.minion.returners["{}.returner".format(returner)](ret) + self.minion.returners[f"{returner}.returner"](ret) except Exception: # pylint: disable=broad-except pass diff --git a/salt/cli/salt.py b/salt/cli/salt.py index f90057f668e..9c28e5de3d6 100644 --- a/salt/cli/salt.py +++ b/salt/cli/salt.py @@ -44,7 +44,7 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser): auto_reconnect=True, ) except SaltClientError as exc: - self.exit(2, "{}\n".format(exc)) + self.exit(2, f"{exc}\n") return if self.options.batch or self.options.static: @@ -146,9 +146,7 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser): if self.config["async"]: jid = self.local_client.cmd_async(**kwargs) - salt.utils.stringutils.print_cli( - "Executed command with job ID: {}".format(jid) - ) + salt.utils.stringutils.print_cli(f"Executed command with job ID: {jid}") return # local will be None when there was an error @@ -337,16 +335,14 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser): salt.utils.stringutils.print_cli("Summary") salt.utils.stringutils.print_cli("-------------------------------------------") salt.utils.stringutils.print_cli( - "# of minions targeted: {}".format(return_counter + not_return_counter) + f"# of minions targeted: {return_counter + not_return_counter}" + ) + salt.utils.stringutils.print_cli(f"# of minions returned: {return_counter}") + salt.utils.stringutils.print_cli( + f"# of minions that did not return: {not_return_counter}" ) salt.utils.stringutils.print_cli( - "# of minions returned: {}".format(return_counter) - ) - salt.utils.stringutils.print_cli( - "# of minions that did not return: {}".format(not_return_counter) - ) - salt.utils.stringutils.print_cli( - "# of minions with errors: {}".format(len(failed_minions)) + f"# of minions with errors: {len(failed_minions)}" ) if self.options.verbose: if not_connected_minions: @@ -449,7 +445,7 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser): if not ret: self.exit(2, "No minions found to gather docs from\n") if isinstance(ret, str): - self.exit(2, "{}\n".format(ret)) + self.exit(2, f"{ret}\n") for host in ret: if isinstance(ret[host], str) and ( ret[host].startswith("Minion did not return") @@ -464,6 +460,6 @@ class SaltCMD(salt.utils.parsers.SaltCMDOptionParser): salt.output.display_output({fun: docs[fun]}, "nested", self.config) else: for fun in sorted(docs): - salt.utils.stringutils.print_cli("{}:".format(fun)) + salt.utils.stringutils.print_cli(f"{fun}:") salt.utils.stringutils.print_cli(docs[fun]) salt.utils.stringutils.print_cli("") diff --git a/salt/client/__init__.py b/salt/client/__init__.py index cfda90d5782..6bd6bf5bf59 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -245,7 +245,7 @@ class LocalClient: # The username may contain '\' if it is in Windows # 'DOMAIN\username' format. Fix this for the keyfile path. key_user = key_user.replace("\\", "_") - keyfile = os.path.join(self.opts["cachedir"], ".{}_key".format(key_user)) + keyfile = os.path.join(self.opts["cachedir"], f".{key_user}_key") try: # Make sure all key parent directories are accessible salt.utils.verify.check_path_traversal( @@ -265,7 +265,7 @@ class LocalClient: try: return range_.expand(tgt) except seco.range.RangeException as err: - print("Range server exception: {}".format(err)) + print(f"Range server exception: {err}") return [] def _get_timeout(self, timeout): @@ -1053,11 +1053,11 @@ class LocalClient: :returns: all of the information for the JID """ if verbose: - msg = "Executing job with jid {}".format(jid) + msg = f"Executing job with jid {jid}" print(msg) print("-" * len(msg) + "\n") elif show_jid: - print("jid: {}".format(jid)) + print(f"jid: {jid}") if timeout is None: timeout = self.opts["timeout"] fret = {} @@ -1163,11 +1163,9 @@ class LocalClient: # iterator for this job's return if self.opts["order_masters"]: # If we are a MoM, we need to gather expected minions from downstreams masters. - ret_iter = self.get_returns_no_block( - "(salt/job|syndic/.*)/{}".format(jid), "regex" - ) + ret_iter = self.get_returns_no_block(f"(salt/job|syndic/.*)/{jid}", "regex") else: - ret_iter = self.get_returns_no_block("salt/job/{}".format(jid)) + ret_iter = self.get_returns_no_block(f"salt/job/{jid}") # iterator for the info of this job jinfo_iter = [] # open event jids that need to be un-subscribed from later @@ -1547,11 +1545,11 @@ class LocalClient: log.trace("entered - function get_cli_static_event_returns()") minions = set(minions) if verbose: - msg = "Executing job with jid {}".format(jid) + msg = f"Executing job with jid {jid}" print(msg) print("-" * len(msg) + "\n") elif show_jid: - print("jid: {}".format(jid)) + print(f"jid: {jid}") if timeout is None: timeout = self.opts["timeout"] @@ -1581,7 +1579,7 @@ class LocalClient: time_left = timeout_at - int(time.time()) # Wait 0 == forever, use a minimum of 1s wait = max(1, time_left) - jid_tag = "salt/job/{}".format(jid) + jid_tag = f"salt/job/{jid}" raw = self.event.get_event( wait, jid_tag, auto_reconnect=self.auto_reconnect ) @@ -1641,11 +1639,11 @@ class LocalClient: log.trace("func get_cli_event_returns()") if verbose: - msg = "Executing job with jid {}".format(jid) + msg = f"Executing job with jid {jid}" print(msg) print("-" * len(msg) + "\n") elif show_jid: - print("jid: {}".format(jid)) + print(f"jid: {jid}") # lazy load the connected minions connected_minions = None @@ -1684,7 +1682,7 @@ class LocalClient: if ( self.opts["minion_data_cache"] and salt.cache.factory(self.opts).contains( - "minions/{}".format(id_), "data" + f"minions/{id_}", "data" ) and connected_minions and id_ not in connected_minions @@ -1775,9 +1773,7 @@ class LocalClient: """ if ng not in self.opts["nodegroups"]: conf_file = self.opts.get("conf_file", "the master config file") - raise SaltInvocationError( - "Node group {} unavailable in {}".format(ng, conf_file) - ) + raise SaltInvocationError(f"Node group {ng} unavailable in {conf_file}") return salt.utils.minions.nodegroup_comp(ng, self.opts["nodegroups"]) def _prep_pub(self, tgt, fun, arg, tgt_type, ret, jid, timeout, **kwargs): @@ -2062,8 +2058,8 @@ class LocalClient: def _clean_up_subscriptions(self, job_id): if self.opts.get("order_masters"): - self.event.unsubscribe("syndic/.*/{}".format(job_id), "regex") - self.event.unsubscribe("salt/job/{}".format(job_id)) + self.event.unsubscribe(f"syndic/.*/{job_id}", "regex") + self.event.unsubscribe(f"salt/job/{job_id}") def destroy(self): if self.event is not None: @@ -2122,7 +2118,7 @@ class FunctionWrapper(dict): """ args = list(args) for _key, _val in kwargs.items(): - args.append("{}={}".format(_key, _val)) + args.append(f"{_key}={_val}") return self.local.cmd(self.minion, key, args) return func @@ -2272,9 +2268,9 @@ class ProxyCaller: if isinstance(executors, str): executors = [executors] for name in executors: - fname = "{}.execute".format(name) + fname = f"{name}.execute" if fname not in self.sminion.executors: - raise SaltInvocationError("Executor '{}' is not available".format(name)) + raise SaltInvocationError(f"Executor '{name}' is not available") return_data = self.sminion.executors[fname]( self.opts, data, func, args, kwargs ) diff --git a/salt/client/mixins.py b/salt/client/mixins.py index 6e05e86d342..1e40e85c712 100644 --- a/salt/client/mixins.py +++ b/salt/client/mixins.py @@ -273,7 +273,7 @@ class SyncClientMixin(ClientStateMixin): return True try: - return self.opts["{}_returns".format(class_name)] + return self.opts[f"{class_name}_returns"] except KeyError: # No such option, assume this isn't one we care about gating and # just return True. @@ -300,7 +300,7 @@ class SyncClientMixin(ClientStateMixin): tag = low.get("__tag__", salt.utils.event.tagify(jid, prefix=self.tag_prefix)) data = { - "fun": "{}.{}".format(self.client, fun), + "fun": f"{self.client}.{fun}", "jid": jid, "user": low.get("__user__", "UNKNOWN"), } @@ -523,7 +523,7 @@ class AsyncClientMixin(ClientStateMixin): tag, jid, daemonize=True, - full_return=False + full_return=False, ): """ Run this method in a multiprocess target to execute the function diff --git a/salt/client/netapi.py b/salt/client/netapi.py index 6d0dc73b854..27029af85a3 100644 --- a/salt/client/netapi.py +++ b/salt/client/netapi.py @@ -48,7 +48,7 @@ class NetapiClient: for fun in self.netapi: if fun.endswith(".start"): - name = "RunNetapi({})".format(self.netapi[fun].__module__) + name = f"RunNetapi({self.netapi[fun].__module__})" log.info("Starting %s", name) self.process_manager.add_process( RunNetapi, args=(self.opts, fun), name=name diff --git a/salt/client/ssh/shell.py b/salt/client/ssh/shell.py index 2df328ed1f5..5d93cdeb801 100644 --- a/salt/client/ssh/shell.py +++ b/salt/client/ssh/shell.py @@ -129,26 +129,26 @@ class Shell: options.append("PasswordAuthentication=no") if self.opts.get("_ssh_version", (0,)) > (4, 9): options.append("GSSAPIAuthentication=no") - options.append("ConnectTimeout={}".format(self.timeout)) + options.append(f"ConnectTimeout={self.timeout}") if self.opts.get("ignore_host_keys"): options.append("StrictHostKeyChecking=no") if self.opts.get("no_host_keys"): options.extend(["StrictHostKeyChecking=no", "UserKnownHostsFile=/dev/null"]) known_hosts = self.opts.get("known_hosts_file") if known_hosts and os.path.isfile(known_hosts): - options.append("UserKnownHostsFile={}".format(known_hosts)) + options.append(f"UserKnownHostsFile={known_hosts}") if self.port: - options.append("Port={}".format(self.port)) + options.append(f"Port={self.port}") if self.priv and self.priv != "agent-forwarding": - options.append("IdentityFile={}".format(self.priv)) + options.append(f"IdentityFile={self.priv}") if self.user: - options.append("User={}".format(self.user)) + options.append(f"User={self.user}") if self.identities_only: options.append("IdentitiesOnly=yes") ret = [] for option in options: - ret.append("-o {} ".format(option)) + ret.append(f"-o {option} ") return "".join(ret) def _passwd_opts(self): @@ -164,7 +164,7 @@ class Shell: ] if self.opts["_ssh_version"] > (4, 9): options.append("GSSAPIAuthentication=no") - options.append("ConnectTimeout={}".format(self.timeout)) + options.append(f"ConnectTimeout={self.timeout}") if self.opts.get("ignore_host_keys"): options.append("StrictHostKeyChecking=no") if self.opts.get("no_host_keys"): @@ -183,19 +183,19 @@ class Shell: ] ) if self.port: - options.append("Port={}".format(self.port)) + options.append(f"Port={self.port}") if self.user: - options.append("User={}".format(self.user)) + options.append(f"User={self.user}") if self.identities_only: options.append("IdentitiesOnly=yes") ret = [] for option in options: - ret.append("-o {} ".format(option)) + ret.append(f"-o {option} ") return "".join(ret) def _ssh_opts(self): - return " ".join(["-o {}".format(opt) for opt in self.ssh_options]) + return " ".join([f"-o {opt}" for opt in self.ssh_options]) def _copy_id_str_old(self): """ @@ -206,7 +206,7 @@ class Shell: # passwords containing '$' return "{} {} '{} -p {} {} {}@{}'".format( "ssh-copy-id", - "-i {}.pub".format(self.priv), + f"-i {self.priv}.pub", self._passwd_opts(), self.port, self._ssh_opts(), @@ -225,7 +225,7 @@ class Shell: # passwords containing '$' return "{} {} {} -p {} {} {}@{}".format( "ssh-copy-id", - "-i {}.pub".format(self.priv), + f"-i {self.priv}.pub", self._passwd_opts(), self.port, self._ssh_opts(), @@ -261,10 +261,7 @@ class Shell: if ssh != "scp" and self.remote_port_forwards: command.append( " ".join( - [ - "-R {}".format(item) - for item in self.remote_port_forwards.split(",") - ] + [f"-R {item}" for item in self.remote_port_forwards.split(",")] ) ) if self.ssh_options: @@ -306,7 +303,7 @@ class Shell: rcode = None cmd = self._cmd_str(cmd) - logmsg = "Executing non-blocking command: {}".format(cmd) + logmsg = f"Executing non-blocking command: {cmd}" if self.passwd: logmsg = logmsg.replace(self.passwd, ("*" * 6)) log.debug(logmsg) @@ -325,7 +322,7 @@ class Shell: """ cmd = self._cmd_str(cmd) - logmsg = "Executing command: {}".format(cmd) + logmsg = f"Executing command: {cmd}" if self.passwd: logmsg = logmsg.replace(self.passwd, ("*" * 6)) if 'decode("base64")' in logmsg or "base64.b64decode(" in logmsg: @@ -342,17 +339,17 @@ class Shell: scp a file or files to a remote system """ if makedirs: - self.exec_cmd("mkdir -p {}".format(os.path.dirname(remote))) + self.exec_cmd(f"mkdir -p {os.path.dirname(remote)}") # scp needs [ 1: for driver in drivers: - providers.add("{}:{}".format(alias, driver)) + providers.add(f"{alias}:{driver}") continue providers.add(alias) return providers @@ -609,7 +609,7 @@ class Cloud: pmap = {} for alias, drivers in self.opts["providers"].items(): for driver, details in drivers.items(): - fun = "{}.{}".format(driver, query) + fun = f"{driver}.{query}" if fun not in self.clouds: log.error("Public cloud provider %s is not available", driver) continue @@ -659,11 +659,11 @@ class Cloud: # for minimum information, Otherwise still use query param. if ( opts.get("selected_query_option") is None - and "{}.list_nodes_min".format(driver) in self.clouds + and f"{driver}.list_nodes_min" in self.clouds ): this_query = "list_nodes_min" - fun = "{}.{}".format(driver, this_query) + fun = f"{driver}.{this_query}" if fun not in self.clouds: log.error("Public cloud provider %s is not available", driver) continue @@ -771,7 +771,7 @@ class Cloud: provider_by_driver[name][alias] = data for driver, providers_data in provider_by_driver.items(): - fun = "{}.optimize_providers".format(driver) + fun = f"{driver}.optimize_providers" if fun not in self.clouds: log.debug("The '%s' cloud driver is unable to be optimized.", driver) @@ -801,7 +801,7 @@ class Cloud: return data for alias, driver in lookups: - fun = "{}.avail_locations".format(driver) + fun = f"{driver}.avail_locations" if fun not in self.clouds: # The capability to gather locations is not supported by this # cloud module @@ -842,7 +842,7 @@ class Cloud: return data for alias, driver in lookups: - fun = "{}.avail_images".format(driver) + fun = f"{driver}.avail_images" if fun not in self.clouds: # The capability to gather images is not supported by this # cloud module @@ -882,7 +882,7 @@ class Cloud: return data for alias, driver in lookups: - fun = "{}.avail_sizes".format(driver) + fun = f"{driver}.avail_sizes" if fun not in self.clouds: # The capability to gather sizes is not supported by this # cloud module @@ -1017,7 +1017,7 @@ class Cloud: else: log.info("Destroying in non-parallel mode.") for alias, driver, name in vms_to_destroy: - fun = "{}.destroy".format(driver) + fun = f"{driver}.destroy" with salt.utils.context.func_globals_inject( self.clouds[fun], __active_provider_name__=":".join([alias, driver]) ): @@ -1050,7 +1050,7 @@ class Cloud: key_file = os.path.join( self.opts["pki_dir"], "minions", minion_dict.get("id", name) ) - globbed_key_file = glob.glob("{}.*".format(key_file)) + globbed_key_file = glob.glob(f"{key_file}.*") if not os.path.isfile(key_file) and not globbed_key_file: # There's no such key file!? It might have been renamed @@ -1090,25 +1090,25 @@ class Cloud: ) while True: for idx, filename in enumerate(globbed_key_file): - print(" {}: {}".format(idx, os.path.basename(filename))) + print(f" {idx}: {os.path.basename(filename)}") selection = input("Which minion key should be deleted(number)? ") try: selection = int(selection) except ValueError: - print("'{}' is not a valid selection.".format(selection)) + print(f"'{selection}' is not a valid selection.") try: filename = os.path.basename(globbed_key_file.pop(selection)) except Exception: # pylint: disable=broad-except continue - delete = input("Delete '{}'? [Y/n]? ".format(filename)) + delete = input(f"Delete '{filename}'? [Y/n]? ") if delete == "" or delete.lower().startswith("y"): salt.utils.cloud.remove_key(self.opts["pki_dir"], filename) - print("Deleted '{}'".format(filename)) + print(f"Deleted '{filename}'") break - print("Did not delete '{}'".format(filename)) + print(f"Did not delete '{filename}'") break if names and not processed: @@ -1138,7 +1138,7 @@ class Cloud: if node in names: acts[prov].append(node) for prov, names_ in acts.items(): - fun = "{}.reboot".format(prov) + fun = f"{prov}.reboot" for name in names_: ret.append({name: self.clouds[fun](name)}) @@ -1155,7 +1155,7 @@ class Cloud: ) alias, driver = vm_["provider"].split(":") - fun = "{}.create".format(driver) + fun = f"{driver}.create" if fun not in self.clouds: log.error( "Creating '%s' using '%s' as the provider " @@ -1220,7 +1220,7 @@ class Cloud: try: alias, driver = vm_["provider"].split(":") - func = "{}.create".format(driver) + func = f"{driver}.create" with salt.utils.context.func_globals_inject( self.clouds[fun], __active_provider_name__=":".join([alias, driver]) ): @@ -1357,7 +1357,7 @@ class Cloud: handle them """ if profile not in self.opts["profiles"]: - msg = "Profile {} is not defined".format(profile) + msg = f"Profile {profile} is not defined" log.error(msg) return {"Error": msg} @@ -1396,7 +1396,7 @@ class Cloud: if name in vms: prov = vms[name]["provider"] driv = vms[name]["driver"] - msg = "{} already exists under {}:{}".format(name, prov, driv) + msg = f"{name} already exists under {prov}:{driv}" log.error(msg) ret[name] = {"Error": msg} continue @@ -1542,14 +1542,12 @@ class Cloud: raise SaltCloudSystemExit( "More than one results matched '{}'. Please specify one of: {}".format( prov, - ", ".join( - ["{}:{}".format(alias, driver) for (alias, driver) in matches] - ), + ", ".join([f"{alias}:{driver}" for (alias, driver) in matches]), ) ) alias, driver = matches.pop() - fun = "{}.{}".format(driver, func) + fun = f"{driver}.{func}" if fun not in self.clouds: raise SaltCloudSystemExit( "The '{}' cloud provider alias, for the '{}' driver, does " @@ -1573,7 +1571,7 @@ class Cloud: """ for alias, drivers in self.opts["providers"].copy().items(): for driver in drivers.copy(): - fun = "{}.get_configured_provider".format(driver) + fun = f"{driver}.get_configured_provider" if fun not in self.clouds: # Mis-configured provider that got removed? log.warning( @@ -1898,7 +1896,7 @@ class Map(Cloud): "The required profile, '{}', defined in the map " "does not exist. The defined nodes, {}, will not " "be created.".format( - profile_name, ", ".join("'{}'".format(node) for node in nodes) + profile_name, ", ".join(f"'{node}'" for node in nodes) ) ) log.error(msg) @@ -1931,7 +1929,7 @@ class Map(Cloud): # Update profile data with the map overrides for setting in ("grains", "master", "minion", "volumes", "requires"): - deprecated = "map_{}".format(setting) + deprecated = f"map_{setting}" if deprecated in overrides: log.warning( "The use of '%s' on the '%s' mapping has " diff --git a/salt/cloud/clouds/aliyun.py b/salt/cloud/clouds/aliyun.py index 30a3cf593a8..f7109ec8754 100644 --- a/salt/cloud/clouds/aliyun.py +++ b/salt/cloud/clouds/aliyun.py @@ -412,9 +412,7 @@ def get_image(vm_): if vm_image and str(vm_image) in images: return images[vm_image]["ImageId"] - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def get_securitygroup(vm_): @@ -432,7 +430,7 @@ def get_securitygroup(vm_): if securitygroup and str(securitygroup) in sgs: return sgs[securitygroup]["SecurityGroupId"] raise SaltCloudNotFound( - "The specified security group, '{}', could not be found.".format(securitygroup) + f"The specified security group, '{securitygroup}', could not be found." ) @@ -451,9 +449,7 @@ def get_size(vm_): if vm_size and str(vm_size) in sizes: return sizes[vm_size]["InstanceTypeId"] - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def __get_location(vm_): @@ -471,7 +467,7 @@ def __get_location(vm_): if vm_location and str(vm_location) in locations: return locations[vm_location]["RegionId"] raise SaltCloudNotFound( - "The specified location, '{}', could not be found.".format(vm_location) + f"The specified location, '{vm_location}', could not be found." ) @@ -920,7 +916,7 @@ def _get_node(name): ) # Just a little delay between attempts... time.sleep(0.5) - raise SaltCloudNotFound("The specified instance {} not found".format(name)) + raise SaltCloudNotFound(f"The specified instance {name} not found") def show_image(kwargs, call=None): @@ -982,7 +978,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1001,7 +997,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/azurearm.py b/salt/cloud/clouds/azurearm.py index de93ac18a73..1f2895ca4fa 100644 --- a/salt/cloud/clouds/azurearm.py +++ b/salt/cloud/clouds/azurearm.py @@ -836,7 +836,7 @@ def create_network_interface(call=None, kwargs=None): NetworkInterfaceIPConfiguration( name="{}-ip".format(kwargs["iface_name"]), subnet=subnet_obj, - **ip_kwargs + **ip_kwargs, ) ] break @@ -999,7 +999,7 @@ def request_instance(vm_, kwargs=None): if not win_installer and ssh_publickeyfile_contents is not None: sshpublickey = SshPublicKey( key_data=ssh_publickeyfile_contents, - path="/home/{}/.ssh/authorized_keys".format(vm_username), + path=f"/home/{vm_username}/.ssh/authorized_keys", ) sshconfiguration = SshConfiguration( public_keys=[sshpublickey], @@ -1620,7 +1620,7 @@ def _get_cloud_environment(): cloud_env = getattr(cloud_env_module, cloud_environment or "AZURE_PUBLIC_CLOUD") except (AttributeError, ImportError): raise SaltCloudSystemExit( - "The azure {} cloud environment is not available.".format(cloud_environment) + f"The azure {cloud_environment} cloud environment is not available." ) return cloud_env @@ -1911,7 +1911,7 @@ def create_or_update_vmextension( except CloudError as exc: salt.utils.azurearm.log_cloud_error( "compute", - "Error attempting to create the VM extension: {}".format(exc.message), + f"Error attempting to create the VM extension: {exc.message}", ) ret = {"error": exc.message} @@ -1959,9 +1959,9 @@ def stop(name, call=None): ret = {"error": exc.message} if not ret: salt.utils.azurearm.log_cloud_error( - "compute", "Unable to find virtual machine with name: {}".format(name) + "compute", f"Unable to find virtual machine with name: {name}" ) - ret = {"error": "Unable to find virtual machine with name: {}".format(name)} + ret = {"error": f"Unable to find virtual machine with name: {name}"} else: try: instance = compconn.virtual_machines.deallocate( @@ -1972,7 +1972,7 @@ def stop(name, call=None): ret = vm_result.as_dict() except CloudError as exc: salt.utils.azurearm.log_cloud_error( - "compute", "Error attempting to stop {}: {}".format(name, exc.message) + "compute", f"Error attempting to stop {name}: {exc.message}" ) ret = {"error": exc.message} @@ -2022,9 +2022,9 @@ def start(name, call=None): ret = {"error": exc.message} if not ret: salt.utils.azurearm.log_cloud_error( - "compute", "Unable to find virtual machine with name: {}".format(name) + "compute", f"Unable to find virtual machine with name: {name}" ) - ret = {"error": "Unable to find virtual machine with name: {}".format(name)} + ret = {"error": f"Unable to find virtual machine with name: {name}"} else: try: instance = compconn.virtual_machines.start( @@ -2036,7 +2036,7 @@ def start(name, call=None): except CloudError as exc: salt.utils.azurearm.log_cloud_error( "compute", - "Error attempting to start {}: {}".format(name, exc.message), + f"Error attempting to start {name}: {exc.message}", ) ret = {"error": exc.message} diff --git a/salt/cloud/clouds/clc.py b/salt/cloud/clouds/clc.py index 88ed72b1295..b7d8cbd3a4a 100644 --- a/salt/cloud/clouds/clc.py +++ b/salt/cloud/clouds/clc.py @@ -421,7 +421,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "waiting for ssh", - "salt/cloud/{}/waiting_for_ssh".format(name), + f"salt/cloud/{name}/waiting_for_ssh", sock_dir=__opts__["sock_dir"], args={"ip_address": vm_["ssh_host"]}, transport=__opts__["transport"], diff --git a/salt/cloud/clouds/cloudstack.py b/salt/cloud/clouds/cloudstack.py index ebf301e4ebf..ff526aa82e0 100644 --- a/salt/cloud/clouds/cloudstack.py +++ b/salt/cloud/clouds/cloudstack.py @@ -474,7 +474,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", sock_dir=__opts__["sock_dir"], args={"name": name}, ) @@ -499,7 +499,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "detaching volume", - "salt/cloud/{}/detaching".format(volume.name), + f"salt/cloud/{volume.name}/detaching", sock_dir=__opts__["sock_dir"], args={"name": volume.name}, ) @@ -510,7 +510,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "detached volume", - "salt/cloud/{}/detached".format(volume.name), + f"salt/cloud/{volume.name}/detached", sock_dir=__opts__["sock_dir"], args={"name": volume.name}, ) @@ -519,7 +519,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroying volume", - "salt/cloud/{}/destroying".format(volume.name), + f"salt/cloud/{volume.name}/destroying", sock_dir=__opts__["sock_dir"], args={"name": volume.name}, ) @@ -530,7 +530,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroyed volume", - "salt/cloud/{}/destroyed".format(volume.name), + f"salt/cloud/{volume.name}/destroyed", sock_dir=__opts__["sock_dir"], args={"name": volume.name}, ) @@ -545,7 +545,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", sock_dir=__opts__["sock_dir"], args={"name": name}, ) diff --git a/salt/cloud/clouds/digitalocean.py b/salt/cloud/clouds/digitalocean.py index 7f843f22ab1..6929195c9dd 100644 --- a/salt/cloud/clouds/digitalocean.py +++ b/salt/cloud/clouds/digitalocean.py @@ -223,9 +223,7 @@ def get_image(vm_): if images[image]["slug"] is not None: return images[image]["slug"] return int(images[image]["id"]) - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def get_size(vm_): @@ -239,9 +237,7 @@ def get_size(vm_): for size in sizes: if vm_size.lower() == sizes[size]["slug"]: return sizes[size]["slug"] - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def get_location(vm_): @@ -257,7 +253,7 @@ def get_location(vm_): if vm_location in (locations[location]["name"], locations[location]["slug"]): return locations[location]["slug"] raise SaltCloudNotFound( - "The specified location, '{}', could not be found.".format(vm_location) + f"The specified location, '{vm_location}', could not be found." ) @@ -333,7 +329,7 @@ def create(vm_): if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined key_filename '{}' does not exist".format(key_filename) + f"The defined key_filename '{key_filename}' does not exist" ) if not __opts__.get("ssh_agent", False) and key_filename is None: @@ -616,10 +612,10 @@ def query( ) ) - path = "{}/{}/".format(base_path, method) + path = f"{base_path}/{method}/" if droplet_id: - path += "{}/".format(droplet_id) + path += f"{droplet_id}/" if command: path += command @@ -875,7 +871,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -912,7 +908,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -987,7 +983,7 @@ def destroy_dns_records(fqdn): ret = query( method="domains", droplet_id=domain, - command="records/{}".format(id_), + command=f"records/{id_}", http_method="delete", ) except SaltCloudSystemExit: diff --git a/salt/cloud/clouds/ec2.py b/salt/cloud/clouds/ec2.py index 9cba9cd52b3..91e9eddd6b2 100644 --- a/salt/cloud/clouds/ec2.py +++ b/salt/cloud/clouds/ec2.py @@ -296,11 +296,9 @@ def query( location = get_location() if not requesturl: - endpoint = provider.get( - "endpoint", "ec2.{}.{}".format(location, service_url) - ) + endpoint = provider.get("endpoint", f"ec2.{location}.{service_url}") - requesturl = "https://{}/".format(endpoint) + requesturl = f"https://{endpoint}/" endpoint = urllib.parse.urlparse(requesturl).netloc endpoint_path = urllib.parse.urlparse(requesturl).path else: @@ -1480,7 +1478,7 @@ def _create_eni_if_necessary(interface, vm_): eni_desc = result[1] if not eni_desc or not eni_desc.get("networkInterfaceId"): - raise SaltCloudException("Failed to create interface: {}".format(result)) + raise SaltCloudException(f"Failed to create interface: {result}") eni_id = eni_desc.get("networkInterfaceId") log.debug("Created network interface %s inst %s", eni_id, interface["DeviceIndex"]) @@ -1751,11 +1749,11 @@ def _param_from_config(key, data): if isinstance(data, dict): for k, v in data.items(): - param.update(_param_from_config("{}.{}".format(key, k), v)) + param.update(_param_from_config(f"{key}.{k}", v)) elif isinstance(data, list) or isinstance(data, tuple): for idx, conf_item in enumerate(data): - prefix = "{}.{}".format(key, idx) + prefix = f"{key}.{idx}" param.update(_param_from_config(prefix, conf_item)) else: @@ -1870,7 +1868,7 @@ def request_instance(vm_=None, call=None): params[spot_prefix + "SecurityGroup.1"] = ex_securitygroup else: for counter, sg_ in enumerate(ex_securitygroup): - params[spot_prefix + "SecurityGroup.{}".format(counter)] = sg_ + params[spot_prefix + f"SecurityGroup.{counter}"] = sg_ ex_iam_profile = iam_profile(vm_) if ex_iam_profile: @@ -1905,7 +1903,7 @@ def request_instance(vm_=None, call=None): params[spot_prefix + "SecurityGroupId.1"] = ex_securitygroupid else: for counter, sg_ in enumerate(ex_securitygroupid): - params[spot_prefix + "SecurityGroupId.{}".format(counter)] = sg_ + params[spot_prefix + f"SecurityGroupId.{counter}"] = sg_ placementgroup_ = get_placementgroup(vm_) if placementgroup_ is not None: @@ -2044,9 +2042,9 @@ def request_instance(vm_=None, call=None): else: dev_index = len(dev_list) # Add the device name in since it wasn't already there - params[ - "{}BlockDeviceMapping.{}.DeviceName".format(spot_prefix, dev_index) - ] = rd_name + params[f"{spot_prefix}BlockDeviceMapping.{dev_index}.DeviceName"] = ( + rd_name + ) # Set the termination value termination_key = "{}BlockDeviceMapping.{}.Ebs.DeleteOnTermination".format( @@ -2509,7 +2507,7 @@ def wait_for_instance( for line in comps[0].splitlines(): if not line: continue - keys += "\n{} {}".format(ip_address, line) + keys += f"\n{ip_address} {line}" with salt.utils.files.fopen(known_hosts_file, "a") as fp_: fp_.write(salt.utils.stringutils.to_str(keys)) @@ -2563,7 +2561,7 @@ def _validate_key_path_and_mode(key_filename): if not os.path.exists(key_filename): raise SaltCloudSystemExit( - "The EC2 key file '{}' does not exist.\n".format(key_filename) + f"The EC2 key file '{key_filename}' does not exist.\n" ) key_mode = stat.S_IMODE(os.stat(key_filename).st_mode) @@ -2752,7 +2750,7 @@ def create(vm_=None, call=None): __utils__["cloud.fire_event"]( "event", "setting tags", - "salt/cloud/spot_request_{}/tagging".format(sir_id), + f"salt/cloud/spot_request_{sir_id}/tagging", args={"tags": spot_request_tags}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2924,7 +2922,7 @@ def create(vm_=None, call=None): __utils__["cloud.fire_event"]( "event", "setting tags", - "salt/cloud/block_volume_{}/tagging".format(str(volid)), + f"salt/cloud/block_volume_{str(volid)}/tagging", args={"tags": tags}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -3054,7 +3052,7 @@ def stop(name, call=None): __utils__["cloud.fire_event"]( "event", "stopping instance", - "salt/cloud/{}/stopping".format(name), + f"salt/cloud/{name}/stopping", args={"name": name, "instance_id": instance_id}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -3088,7 +3086,7 @@ def start(name, call=None): __utils__["cloud.fire_event"]( "event", "starting instance", - "salt/cloud/{}/starting".format(name), + f"salt/cloud/{name}/starting", args={"name": name, "instance_id": instance_id}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -3163,8 +3161,8 @@ def set_tags( tags = kwargs for idx, (tag_k, tag_v) in enumerate(tags.items()): - params["Tag.{}.Key".format(idx)] = tag_k - params["Tag.{}.Value".format(idx)] = tag_v + params[f"Tag.{idx}.Key"] = tag_k + params[f"Tag.{idx}.Value"] = tag_v attempts = 0 while attempts < aws.AWS_MAX_RETRIES: @@ -3210,7 +3208,7 @@ def set_tags( return settags - raise SaltCloudSystemExit("Failed to set tags on {}!".format(name)) + raise SaltCloudSystemExit(f"Failed to set tags on {name}!") def get_tags( @@ -3292,7 +3290,7 @@ def del_tags( params = {"Action": "DeleteTags", "ResourceId.1": instance_id} for idx, tag in enumerate(kwargs["tags"].split(",")): - params["Tag.{}.Key".format(idx)] = tag + params[f"Tag.{idx}.Key"] = tag aws.query( params, @@ -3356,7 +3354,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name, "instance_id": instance_id}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -3377,7 +3375,7 @@ def destroy(name, call=None): "rename_on_destroy", get_configured_provider(), __opts__, search_global=False ) if rename_on_destroy is not False: - newname = "{}-DEL{}".format(name, uuid.uuid4().hex) + newname = f"{name}-DEL{uuid.uuid4().hex}" rename(name, kwargs={"newname": newname}, call="action") log.info( "Machine will be identified as %s until it has been cleaned up.", newname @@ -3410,7 +3408,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name, "instance_id": instance_id}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -4056,8 +4054,8 @@ def _toggle_delvol( if volume_id is not None and volume_id != item["ebs"]["volumeId"]: continue - params["BlockDeviceMapping.{}.DeviceName".format(idx)] = device_name - params["BlockDeviceMapping.{}.Ebs.DeleteOnTermination".format(idx)] = value + params[f"BlockDeviceMapping.{idx}.DeviceName"] = device_name + params[f"BlockDeviceMapping.{idx}.Ebs.DeleteOnTermination"] = value aws.query( params, @@ -4477,7 +4475,7 @@ def describe_volumes(kwargs=None, call=None): if "volume_id" in kwargs: volume_id = kwargs["volume_id"].split(",") for volume_index, volume_id in enumerate(volume_id): - params["VolumeId.{}".format(volume_index)] = volume_id + params[f"VolumeId.{volume_index}"] = volume_id log.debug(params) @@ -4796,17 +4794,17 @@ def describe_snapshots(kwargs=None, call=None): if "snapshot_id" in kwargs: snapshot_ids = kwargs["snapshot_id"].split(",") for snapshot_index, snapshot_id in enumerate(snapshot_ids): - params["SnapshotId.{}".format(snapshot_index)] = snapshot_id + params[f"SnapshotId.{snapshot_index}"] = snapshot_id if "owner" in kwargs: owners = kwargs["owner"].split(",") for owner_index, owner in enumerate(owners): - params["Owner.{}".format(owner_index)] = owner + params[f"Owner.{owner_index}"] = owner if "restorable_by" in kwargs: restorable_bys = kwargs["restorable_by"].split(",") for restorable_by_index, restorable_by in enumerate(restorable_bys): - params["RestorableBy.{}".format(restorable_by_index)] = restorable_by + params[f"RestorableBy.{restorable_by_index}"] = restorable_by log.debug(params) @@ -5013,11 +5011,11 @@ def _parse_pricing(url, name): "storageGiB", "USD", ): - price_js = price_js.replace(keyword, '"{}"'.format(keyword)) + price_js = price_js.replace(keyword, f'"{keyword}"') for keyword in ("region", "price", "size"): - price_js = price_js.replace(keyword, '"{}"'.format(keyword)) - price_js = price_js.replace('"{}"s'.format(keyword), '"{}s"'.format(keyword)) + price_js = price_js.replace(keyword, f'"{keyword}"') + price_js = price_js.replace(f'"{keyword}"s', f'"{keyword}s"') price_js = price_js.replace('""', '"') @@ -5031,7 +5029,7 @@ def _parse_pricing(url, name): sizes[size["size"]] = size regions[region["region"]] = sizes - outfile = os.path.join(__opts__["cachedir"], "ec2-pricing-{}.p".format(name)) + outfile = os.path.join(__opts__["cachedir"], f"ec2-pricing-{name}.p") with salt.utils.files.fopen(outfile, "w") as fho: salt.utils.msgpack.dump(regions, fho) @@ -5093,7 +5091,7 @@ def show_pricing(kwargs=None, call=None): else: name = "linux" - pricefile = os.path.join(__opts__["cachedir"], "ec2-pricing-{}.p".format(name)) + pricefile = os.path.join(__opts__["cachedir"], f"ec2-pricing-{name}.p") if not os.path.isfile(pricefile): update_pricing({"type": name}, "function") diff --git a/salt/cloud/clouds/gce.py b/salt/cloud/clouds/gce.py index 8e2d8618476..f5b16897fa0 100644 --- a/salt/cloud/clouds/gce.py +++ b/salt/cloud/clouds/gce.py @@ -186,7 +186,7 @@ def get_conn(): "service_account_private_key", provider, __opts__ ) gce = driver(email, private_key, project=project) - gce.connection.user_agent_append("{}/{}".format(_UA_PRODUCT, _UA_VERSION)) + gce.connection.user_agent_append(f"{_UA_PRODUCT}/{_UA_VERSION}") return gce @@ -544,7 +544,7 @@ def _parse_allow(allow): pairs = p.split(":") if pairs[0].lower() not in ["tcp", "udp", "icmp"]: raise SaltCloudSystemExit( - "Unsupported protocol {}. Must be tcp, udp, or icmp.".format(pairs[0]) + f"Unsupported protocol {pairs[0]}. Must be tcp, udp, or icmp." ) if len(pairs) == 1 or pairs[0].lower() == "icmp": seen_protos[pairs[0]] = [] @@ -2014,7 +2014,7 @@ def reboot(vm_name, call=None): __utils__["cloud.fire_event"]( "event", "reboot instance", - "salt/cloud/{}/rebooting".format(vm_name), + f"salt/cloud/{vm_name}/rebooting", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2025,7 +2025,7 @@ def reboot(vm_name, call=None): __utils__["cloud.fire_event"]( "event", "reboot instance", - "salt/cloud/{}/rebooted".format(vm_name), + f"salt/cloud/{vm_name}/rebooted", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2056,7 +2056,7 @@ def start(vm_name, call=None): __utils__["cloud.fire_event"]( "event", "start instance", - "salt/cloud/{}/starting".format(vm_name), + f"salt/cloud/{vm_name}/starting", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2067,7 +2067,7 @@ def start(vm_name, call=None): __utils__["cloud.fire_event"]( "event", "start instance", - "salt/cloud/{}/started".format(vm_name), + f"salt/cloud/{vm_name}/started", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2096,7 +2096,7 @@ def stop(vm_name, call=None): __utils__["cloud.fire_event"]( "event", "stop instance", - "salt/cloud/{}/stopping".format(vm_name), + f"salt/cloud/{vm_name}/stopping", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2107,7 +2107,7 @@ def stop(vm_name, call=None): __utils__["cloud.fire_event"]( "event", "stop instance", - "salt/cloud/{}/stopped".format(vm_name), + f"salt/cloud/{vm_name}/stopped", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2145,12 +2145,12 @@ def destroy(vm_name, call=None): exc, exc_info_on_loglevel=logging.DEBUG, ) - raise SaltCloudSystemExit("Could not find instance {}.".format(vm_name)) + raise SaltCloudSystemExit(f"Could not find instance {vm_name}.") __utils__["cloud.fire_event"]( "event", "delete instance", - "salt/cloud/{}/deleting".format(vm_name), + f"salt/cloud/{vm_name}/deleting", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2186,11 +2186,11 @@ def destroy(vm_name, call=None): exc, exc_info_on_loglevel=logging.DEBUG, ) - raise SaltCloudSystemExit("Could not destroy instance {}.".format(vm_name)) + raise SaltCloudSystemExit(f"Could not destroy instance {vm_name}.") __utils__["cloud.fire_event"]( "event", "delete instance", - "salt/cloud/{}/deleted".format(vm_name), + f"salt/cloud/{vm_name}/deleted", args={"name": vm_name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2279,7 +2279,7 @@ def create_attach_volumes(name, kwargs, call=None): letter = ord("a") - 1 for idx, volume in enumerate(volumes): - volume_name = "{}-sd{}".format(name, chr(letter + 2 + idx)) + volume_name = f"{name}-sd{chr(letter + 2 + idx)}" volume_dict = { "disk_name": volume_name, diff --git a/salt/cloud/clouds/gogrid.py b/salt/cloud/clouds/gogrid.py index a2457b48ca4..1a28f837459 100644 --- a/salt/cloud/clouds/gogrid.py +++ b/salt/cloud/clouds/gogrid.py @@ -417,7 +417,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -428,7 +428,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -536,7 +536,7 @@ def _query( path += action if command: - path += "/{}".format(command) + path += f"/{command}" log.debug("GoGrid URL: %s", path) diff --git a/salt/cloud/clouds/hetzner.py b/salt/cloud/clouds/hetzner.py index 48bf8610c18..f8f34ad6d85 100644 --- a/salt/cloud/clouds/hetzner.py +++ b/salt/cloud/clouds/hetzner.py @@ -470,22 +470,22 @@ def start(name, call=None, wait=True): client = _connect_client() server = client.servers.get_by_name(name) if server is None: - return "Instance {} doesn't exist.".format(name) + return f"Instance {name} doesn't exist." server.power_on() if wait and not wait_until(name, "running"): - return "Instance {} doesn't start.".format(name) + return f"Instance {name} doesn't start." __utils__["cloud.fire_event"]( "event", "started instance", - "salt/cloud/{}/started".format(name), + f"salt/cloud/{name}/started", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], ) - return {"Started": "{} was started.".format(name)} + return {"Started": f"{name} was started."} def stop(name, call=None, wait=True): @@ -504,22 +504,22 @@ def stop(name, call=None, wait=True): client = _connect_client() server = client.servers.get_by_name(name) if server is None: - return "Instance {} doesn't exist.".format(name) + return f"Instance {name} doesn't exist." server.power_off() if wait and not wait_until(name, "off"): - return "Instance {} doesn't stop.".format(name) + return f"Instance {name} doesn't stop." __utils__["cloud.fire_event"]( "event", "stopped instance", - "salt/cloud/{}/stopped".format(name), + f"salt/cloud/{name}/stopped", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], ) - return {"Stopped": "{} was stopped.".format(name)} + return {"Stopped": f"{name} was stopped."} def reboot(name, call=None, wait=True): @@ -540,14 +540,14 @@ def reboot(name, call=None, wait=True): client = _connect_client() server = client.servers.get_by_name(name) if server is None: - return "Instance {} doesn't exist.".format(name) + return f"Instance {name} doesn't exist." server.reboot() if wait and not wait_until(name, "running"): - return "Instance {} doesn't start.".format(name) + return f"Instance {name} doesn't start." - return {"Rebooted": "{} was rebooted.".format(name)} + return {"Rebooted": f"{name} was rebooted."} def destroy(name, call=None): @@ -568,12 +568,12 @@ def destroy(name, call=None): client = _connect_client() server = client.servers.get_by_name(name) if server is None: - return "Instance {} doesn't exist.".format(name) + return f"Instance {name} doesn't exist." __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -583,14 +583,14 @@ def destroy(name, call=None): if node["state"] == "running": stop(name, call="action", wait=False) if not wait_until(name, "off"): - return {"Error": "Unable to destroy {}, command timed out".format(name)} + return {"Error": f"Unable to destroy {name}, command timed out"} server.delete() __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -603,7 +603,7 @@ def destroy(name, call=None): __opts__, ) - return {"Destroyed": "{} was destroyed.".format(name)} + return {"Destroyed": f"{name} was destroyed."} def resize(name, kwargs, call=None): @@ -624,7 +624,7 @@ def resize(name, kwargs, call=None): client = _connect_client() server = client.servers.get_by_name(name) if server is None: - return "Instance {} doesn't exist.".format(name) + return f"Instance {name} doesn't exist." # Check the configuration size = kwargs.get("size", None) @@ -638,7 +638,7 @@ def resize(name, kwargs, call=None): __utils__["cloud.fire_event"]( "event", "resizing instance", - "salt/cloud/{}/resizing".format(name), + f"salt/cloud/{name}/resizing", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -648,17 +648,17 @@ def resize(name, kwargs, call=None): if node["state"] == "running": stop(name, call="action", wait=False) if not wait_until(name, "off"): - return {"Error": "Unable to resize {}, command timed out".format(name)} + return {"Error": f"Unable to resize {name}, command timed out"} server.change_type(server_type, kwargs.get("upgrade_disk", False)) __utils__["cloud.fire_event"]( "event", "resizing instance", - "salt/cloud/{}/resized".format(name), + f"salt/cloud/{name}/resized", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], ) - return {"Resized": "{} was resized.".format(name)} + return {"Resized": f"{name} was resized."} diff --git a/salt/cloud/clouds/joyent.py b/salt/cloud/clouds/joyent.py index 0da4a4a5e64..403e2ffab92 100644 --- a/salt/cloud/clouds/joyent.py +++ b/salt/cloud/clouds/joyent.py @@ -161,9 +161,7 @@ def get_image(vm_): images[vm_image]["name"] = images[vm_image]["id"] return images[vm_image] - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def get_size(vm_): @@ -178,9 +176,7 @@ def get_size(vm_): if vm_size and str(vm_size) in sizes: return sizes[vm_size] - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def query_instance(vm_=None, call=None): @@ -375,11 +371,11 @@ def create_node(**kwargs): if metadata is not None: for key, value in metadata.items(): - create_data["metadata.{}".format(key)] = value + create_data[f"metadata.{key}"] = value if tag is not None: for key, value in tag.items(): - create_data["tag.{}".format(key)] = value + create_data[f"tag.{key}"] = value if firewall_enabled is not None: create_data["firewall_enabled"] = firewall_enabled @@ -419,7 +415,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -435,7 +431,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -920,11 +916,11 @@ def avail_images(call=None): get_configured_provider(), __opts__, search_global=False, - default="{}{}/{}/images".format(DEFAULT_LOCATION, JOYENT_API_HOST_SUFFIX, user), + default=f"{DEFAULT_LOCATION}{JOYENT_API_HOST_SUFFIX}/{user}/images", ) if not img_url.startswith("http://") and not img_url.startswith("https://"): - img_url = "{}://{}".format(_get_proto(), img_url) + img_url = f"{_get_proto()}://{img_url}" rcode, data = query(command="my/images", method="GET") log.debug(data) @@ -1077,7 +1073,7 @@ def get_location_path( :param location: joyent data center location :return: url """ - return "{}://{}{}".format(_get_proto(), location, api_host_suffix) + return f"{_get_proto()}://{location}{api_host_suffix}" def query(action=None, command=None, args=None, method="GET", location=None, data=None): @@ -1151,7 +1147,7 @@ def query(action=None, command=None, args=None, method="GET", location=None, dat path += action if command: - path += "/{}".format(command) + path += f"/{command}" log.debug("User: '%s' on PATH: %s", user, path) @@ -1174,9 +1170,9 @@ def query(action=None, command=None, args=None, method="GET", location=None, dat signed = base64.b64encode(signed) user_arr = user.split("/") if len(user_arr) == 1: - keyid = "/{}/keys/{}".format(user_arr[0], ssh_keyname) + keyid = f"/{user_arr[0]}/keys/{ssh_keyname}" elif len(user_arr) == 2: - keyid = "/{}/users/{}/keys/{}".format(user_arr[0], user_arr[1], ssh_keyname) + keyid = f"/{user_arr[0]}/users/{user_arr[1]}/keys/{ssh_keyname}" else: log.error("Malformed user string") diff --git a/salt/cloud/clouds/libvirt.py b/salt/cloud/clouds/libvirt.py index 59affa6b94b..366e1871e1f 100644 --- a/salt/cloud/clouds/libvirt.py +++ b/salt/cloud/clouds/libvirt.py @@ -332,7 +332,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args=__utils__["cloud.filter_event"]( "creating", vm_, ["name", "profile", "provider", "driver"] ), @@ -345,7 +345,7 @@ def create(vm_): ) if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined key_filename '{}' does not exist".format(key_filename) + f"The defined key_filename '{key_filename}' does not exist" ) vm_["key_filename"] = key_filename # wait_for_instance requires private_key @@ -374,7 +374,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "requesting instance", - "salt/cloud/{}/requesting".format(name), + f"salt/cloud/{name}/requesting", args={ "kwargs": __utils__["cloud.filter_event"]( "requesting", kwargs, list(kwargs) @@ -392,7 +392,7 @@ def create(vm_): description_elem = ElementTree.Element("description") domain_xml.insert(0, description_elem) description = domain_xml.find("./description") - description.text = "Cloned from {}".format(base) + description.text = f"Cloned from {base}" domain_xml.remove(domain_xml.find("./uuid")) for iface_xml in domain_xml.findall("./devices/interface"): @@ -426,9 +426,7 @@ def create(vm_): # see if there is a path element that needs rewriting if source_element and "path" in source_element.attrib: path = source_element.attrib["path"] - new_path = path.replace( - "/domain-{}/".format(base), "/domain-{}/".format(name) - ) + new_path = path.replace(f"/domain-{base}/", f"/domain-{name}/") log.debug("Rewriting agent socket path to %s", new_path) source_element.attrib["path"] = new_path @@ -471,7 +469,7 @@ def create(vm_): disk.find("./source").attrib["file"] = new_volume.path() else: raise SaltCloudExecutionFailure( - "Disk type '{}' not supported".format(disk_type) + f"Disk type '{disk_type}' not supported" ) clone_xml = salt.utils.stringutils.to_str(ElementTree.tostring(domain_xml)) @@ -515,7 +513,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args=__utils__["cloud.filter_event"]( "created", vm_, ["name", "profile", "provider", "driver"] ), @@ -617,15 +615,15 @@ def destroy(name, call=None): pass if not found: - return "{} doesn't exist and can't be deleted".format(name) + return f"{name} doesn't exist and can't be deleted" if len(found) > 1: - return "{} doesn't identify a unique machine leaving things".format(name) + return f"{name} doesn't identify a unique machine leaving things" __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -636,7 +634,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -718,15 +716,15 @@ def find_pool_and_volume(conn, path): for v in sp.listAllVolumes(): if v.path() == path: return sp, v - raise SaltCloudNotFound("Could not find volume for path {}".format(path)) + raise SaltCloudNotFound(f"Could not find volume for path {path}") def generate_new_name(orig_name): if "." not in orig_name: - return "{}-{}".format(orig_name, uuid.uuid1()) + return f"{orig_name}-{uuid.uuid1()}" name, ext = orig_name.rsplit(".", 1) - return "{}-{}.{}".format(name, uuid.uuid1(), ext) + return f"{name}-{uuid.uuid1()}.{ext}" def get_domain_volumes(conn, domain): diff --git a/salt/cloud/clouds/linode.py b/salt/cloud/clouds/linode.py index 99850b3936a..7eefa9a9d67 100644 --- a/salt/cloud/clouds/linode.py +++ b/salt/cloud/clouds/linode.py @@ -339,7 +339,7 @@ def _get_ssh_keys(vm_): key_files = _get_ssh_key_files(vm_) for file in map(lambda file: Path(file).resolve(), key_files): if not (file.exists() or file.is_file()): - raise SaltCloudSystemExit("Invalid SSH key file: {}".format(str(file))) + raise SaltCloudSystemExit(f"Invalid SSH key file: {str(file)}") ssh_keys.add(file.read_text()) return list(ssh_keys) @@ -513,11 +513,11 @@ class LinodeAPIv4(LinodeAPI): if headers is None: headers = {} - headers["Authorization"] = "Bearer {}".format(api_key) + headers["Authorization"] = f"Bearer {api_key}" headers["Content-Type"] = "application/json" headers["User-Agent"] = "salt-cloud-linode" - url = "https://api.linode.com/{}{}".format(api_version, path) + url = f"https://api.linode.com/{api_version}{path}" decode = method != "DELETE" result = None @@ -578,7 +578,7 @@ class LinodeAPIv4(LinodeAPI): # If the response is not valid JSON or the error was not included, propagate the # human readable status representation. raise SaltCloudSystemExit( - "Linode API error occurred: {}".format(err_response.reason) + f"Linode API error occurred: {err_response.reason}" ) if decode: return self._get_response_json(result) @@ -623,7 +623,7 @@ class LinodeAPIv4(LinodeAPI): ) response = self._query( - "/linode/instances/{}/boot".format(linode_id), + f"/linode/instances/{linode_id}/boot", method="POST", data={"config_id": config_id}, ) @@ -656,7 +656,7 @@ class LinodeAPIv4(LinodeAPI): ) return self._query( - "/linode/instances/{}/clone".format(linode_id), + f"/linode/instances/{linode_id}/clone", method="POST", data={"region": location, "type": size}, ) @@ -688,7 +688,7 @@ class LinodeAPIv4(LinodeAPI): } return self._query( - "/linode/instances/{}/configs".format(linode_id), + f"/linode/instances/{linode_id}/configs", method="POST", data={"label": name, "devices": devices}, ) @@ -702,7 +702,7 @@ class LinodeAPIv4(LinodeAPI): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args=__utils__["cloud.filter_event"]( "creating", vm_, ["name", "profile", "provider", "driver"] ), @@ -795,7 +795,7 @@ class LinodeAPIv4(LinodeAPI): __utils__["cloud.fire_event"]( "event", "waiting for ssh", - "salt/cloud/{}/waiting_for_ssh".format(name), + f"salt/cloud/{name}/waiting_for_ssh", sock_dir=__opts__["sock_dir"], args={"ip_address": vm_["ssh_host"]}, transport=__opts__["transport"], @@ -810,7 +810,7 @@ class LinodeAPIv4(LinodeAPI): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args=__utils__["cloud.filter_event"]( "created", vm_, ["name", "profile", "provider", "driver"] ), @@ -824,7 +824,7 @@ class LinodeAPIv4(LinodeAPI): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -838,7 +838,7 @@ class LinodeAPIv4(LinodeAPI): instance = self._get_linode_by_name(name) linode_id = instance.get("id", None) - self._query("/linode/instances/{}".format(linode_id), method="DELETE") + self._query(f"/linode/instances/{linode_id}", method="DELETE") def get_config_id(self, kwargs=None): name = kwargs.get("name", None) @@ -853,7 +853,7 @@ class LinodeAPIv4(LinodeAPI): if linode_id is None: linode_id = self.get_linode(kwargs=kwargs).get("id", None) - response = self._query("/linode/instances/{}/configs".format(linode_id)) + response = self._query(f"/linode/instances/{linode_id}/configs") configs = response.get("data", []) return {"config_id": configs[0]["id"]} @@ -879,7 +879,7 @@ class LinodeAPIv4(LinodeAPI): instance = self._get_linode_by_name(name) linode_id = instance.get("id", None) - self._query("/linode/instances/{}/reboot".format(linode_id), method="POST") + self._query(f"/linode/instances/{linode_id}/reboot", method="POST") return self._wait_for_linode_status(linode_id, "running") def show_instance(self, name): @@ -939,7 +939,7 @@ class LinodeAPIv4(LinodeAPI): "msg": "Machine already running", } - self._query("/linode/instances/{}/boot".format(linode_id), method="POST") + self._query(f"/linode/instances/{linode_id}/boot", method="POST") self._wait_for_linode_status(linode_id, "running") return { @@ -960,13 +960,13 @@ class LinodeAPIv4(LinodeAPI): "msg": "Machine already stopped", } - self._query("/linode/instances/{}/shutdown".format(linode_id), method="POST") + self._query(f"/linode/instances/{linode_id}/shutdown", method="POST") self._wait_for_linode_status(linode_id, "offline") return {"success": True, "state": "Stopped", "action": "stop"} def _get_linode_by_id(self, linode_id): - return self._query("/linode/instances/{}".format(linode_id)) + return self._query(f"/linode/instances/{linode_id}") def _get_linode_by_name(self, name): result = self._query("/linode/instances") @@ -976,9 +976,7 @@ class LinodeAPIv4(LinodeAPI): if instance["label"] == name: return instance - raise SaltCloudNotFound( - "The specified name, {}, could not be found.".format(name) - ) + raise SaltCloudNotFound(f"The specified name, {name}, could not be found.") def _list_linodes(self, full=False): result = self._query("/linode/instances") @@ -1005,7 +1003,7 @@ class LinodeAPIv4(LinodeAPI): return ret def _get_linode_type(self, linode_type): - return self._query("/linode/types/{}".format(linode_type)) + return self._query(f"/linode/types/{linode_type}") def _get_ips(self, linode_id): instance = self._get_linode_by_id(linode_id) @@ -1049,15 +1047,13 @@ class LinodeAPIv4(LinodeAPI): time.sleep(poll_interval / 1000) log.info("retrying: polling for %s...", description) else: - raise SaltCloudException( - "timed out: polling for {}".format(description) - ) + raise SaltCloudException(f"timed out: polling for {description}") def _wait_for_entity_status( self, getter, status, entity_name="item", identifier="some", timeout=None ): return self._poll( - "{} (id={}) status to be '{}'".format(entity_name, identifier, status), + f"{entity_name} (id={identifier}) status to be '{status}'", getter, lambda item: item.get("status") == status, timeout=timeout, @@ -1126,8 +1122,8 @@ class LinodeAPIv4(LinodeAPI): return True return self._poll( - "event {} to be '{}'".format(event_id, status), - lambda: self._query("/account/events/{}".format(event_id)), + f"event {event_id} to be '{status}'", + lambda: self._query(f"/account/events/{event_id}"), condition, timeout=timeout, ) @@ -1170,7 +1166,7 @@ class LinodeAPIv3(LinodeAPI): if "api_key" not in args.keys(): args["api_key"] = apikey if action and "api_action" not in args.keys(): - args["api_action"] = "{}.{}".format(action, command) + args["api_action"] = f"{action}.{command}" if header_dict is None: header_dict = {} if method != "POST": @@ -1266,7 +1262,7 @@ class LinodeAPIv3(LinodeAPI): if status == "1": raise SaltCloudSystemExit( "Cannot boot Linode {0}. " - + "Linode {} is already running.".format(linode_item) + + f"Linode {linode_item} is already running." ) # Boot the VM and get the JobID from Linode @@ -1311,7 +1307,7 @@ class LinodeAPIv3(LinodeAPI): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args=__utils__["cloud.filter_event"]( "creating", vm_, ["name", "profile", "provider", "driver"] ), @@ -1348,7 +1344,7 @@ class LinodeAPIv3(LinodeAPI): kwargs = { "clonefrom": clonefrom_name, - "image": "Clone of {}".format(clonefrom_name), + "image": f"Clone of {clonefrom_name}", } if size is None: @@ -1412,7 +1408,7 @@ class LinodeAPIv3(LinodeAPI): __utils__["cloud.fire_event"]( "event", "requesting instance", - "salt/cloud/{}/requesting".format(name), + f"salt/cloud/{name}/requesting", args=__utils__["cloud.filter_event"]( "requesting", vm_, ["name", "profile", "provider", "driver"] ), @@ -1505,7 +1501,7 @@ class LinodeAPIv3(LinodeAPI): __utils__["cloud.fire_event"]( "event", "waiting for ssh", - "salt/cloud/{}/waiting_for_ssh".format(name), + f"salt/cloud/{name}/waiting_for_ssh", sock_dir=__opts__["sock_dir"], args={"ip_address": vm_["ssh_host"]}, transport=__opts__["transport"], @@ -1522,7 +1518,7 @@ class LinodeAPIv3(LinodeAPI): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args=__utils__["cloud.filter_event"]( "created", vm_, ["name", "profile", "provider", "driver"] ), @@ -1560,9 +1556,9 @@ class LinodeAPIv3(LinodeAPI): instance = self._get_linode_by_name(name) linode_id = instance.get("id", None) - disklist = "{},{}".format(root_disk_id, swap_disk_id) + disklist = f"{root_disk_id},{swap_disk_id}" if data_disk_id is not None: - disklist = "{},{},{}".format(root_disk_id, swap_disk_id, data_disk_id) + disklist = f"{root_disk_id},{swap_disk_id},{data_disk_id}" config_args = { "LinodeID": int(linode_id), @@ -1663,7 +1659,7 @@ class LinodeAPIv3(LinodeAPI): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1678,7 +1674,7 @@ class LinodeAPIv3(LinodeAPI): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1732,7 +1728,7 @@ class LinodeAPIv3(LinodeAPI): plan_type = "Nanode" plan_size = plan_size / 1024 - new_label = "{} {}GB".format(plan_type, plan_size) + new_label = f"{plan_type} {plan_size}GB" if new_label not in sizes: raise SaltCloudException( @@ -2052,9 +2048,7 @@ class LinodeAPIv3(LinodeAPI): if name == node["LABEL"]: return node - raise SaltCloudNotFound( - "The specified name, {}, could not be found.".format(name) - ) + raise SaltCloudNotFound(f"The specified name, {name}, could not be found.") def _get_linode_by_id(self, linode_id): result = self._query("linode", "list", args={"LinodeID": linode_id}) diff --git a/salt/cloud/clouds/lxc.py b/salt/cloud/clouds/lxc.py index da293dca66a..ced89e587bb 100644 --- a/salt/cloud/clouds/lxc.py +++ b/salt/cloud/clouds/lxc.py @@ -179,7 +179,7 @@ def _salt(fun, *args, **kw): ping_retries += 1 log.error("%s unreachable, retrying", target) if not ping: - raise SaltCloudSystemExit("Target {} unreachable".format(target)) + raise SaltCloudSystemExit(f"Target {target} unreachable") jid = conn.cmd_async(tgt=target, fun=fun, arg=args, kwarg=kw, **rkwargs) cret = conn.cmd( tgt=target, fun="saltutil.find_job", arg=[jid], timeout=10, **kwargs @@ -224,9 +224,7 @@ def _salt(fun, *args, **kw): time.sleep(0.5) try: if "is not available." in ret: - raise SaltCloudSystemExit( - "module/function {} is not available".format(fun) - ) + raise SaltCloudSystemExit(f"module/function {fun} is not available") except SaltCloudSystemExit: # pylint: disable=try-except-raise raise except TypeError: @@ -367,12 +365,12 @@ def destroy(vm_, call=None): ) if not get_configured_provider(): return - ret = {"comment": "{} was not found".format(vm_), "result": False} + ret = {"comment": f"{vm_} was not found", "result": False} if _salt("lxc.info", vm_, path=path): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(vm_), + f"salt/cloud/{vm_}/destroying", args={"name": vm_, "instance_id": vm_}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -380,11 +378,11 @@ def destroy(vm_, call=None): cret = _salt("lxc.destroy", vm_, stop=True, path=path) ret["result"] = cret["result"] if ret["result"]: - ret["comment"] = "{} was destroyed".format(vm_) + ret["comment"] = f"{vm_} was destroyed" __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(vm_), + f"salt/cloud/{vm_}/destroyed", args={"name": vm_, "instance_id": vm_}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -506,14 +504,14 @@ def get_configured_provider(vm_=None): matched = False # --list-images level if img_provider: - tgt = "provider: {}".format(img_provider) + tgt = f"provider: {img_provider}" if dalias == img_provider: data = get_provider(img_provider) matched = True # providers are set in configuration if not data and "profile" not in __opts__ and arg_providers: for name in arg_providers: - tgt = "provider: {}".format(name) + tgt = f"provider: {name}" if dalias == name: data = get_provider(name) if data: @@ -523,13 +521,13 @@ def get_configured_provider(vm_=None): elif "profile" in __opts__: curprof = __opts__["profile"] profs = __opts__["profiles"] - tgt = "profile: {}".format(curprof) + tgt = f"profile: {curprof}" if ( curprof in profs and profs[curprof]["provider"] == _get_active_provider_name() ): prov, cdriver = profs[curprof]["provider"].split(":") - tgt += " provider: {}".format(prov) + tgt += f" provider: {prov}" data = get_provider(prov) matched = True # fallback if we have only __active_provider_name__ diff --git a/salt/cloud/clouds/msazure.py b/salt/cloud/clouds/msazure.py index fef62f07a70..92fbf7f9bc6 100644 --- a/salt/cloud/clouds/msazure.py +++ b/salt/cloud/clouds/msazure.py @@ -853,7 +853,7 @@ def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True): kwargs["service_name"], kwargs["deployment_name"], kwargs["role_name"], - **volume + **volume, ) log.debug(attach) @@ -954,7 +954,7 @@ def create_attach_volumes(name, kwargs, call=None, wait_to_finish=True): kwargs["service_name"], kwargs["deployment_name"], kwargs["role_name"], - **volume + **volume, ) _wait_for_async(conn, result.request_id) @@ -1031,7 +1031,7 @@ def destroy(name, conn=None, call=None, kwargs=None): result = conn.delete_deployment(service_name, service_name) except AzureConflictHttpError as exc: log.error(exc.message) - raise SaltCloudSystemExit("{}: {}".format(name, exc.message)) + raise SaltCloudSystemExit(f"{name}: {exc.message}") delete_type = "delete_deployment" _wait_for_async(conn, result.request_id) ret[name] = { diff --git a/salt/cloud/clouds/oneandone.py b/salt/cloud/clouds/oneandone.py index 7ddb50d3aba..6028e4f53e0 100644 --- a/salt/cloud/clouds/oneandone.py +++ b/salt/cloud/clouds/oneandone.py @@ -193,9 +193,7 @@ def get_size(vm_): if size: return size - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def get_image(vm_): @@ -211,9 +209,7 @@ def get_image(vm_): if vm_image and vm_image in (images[key]["id"], images[key]["name"]): return images[key] - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def avail_locations(conn=None, call=None): @@ -735,7 +731,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -749,7 +745,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -846,7 +842,7 @@ def get_key_filename(vm_): key_filename = os.path.expanduser(key_filename) if not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined ssh_private_key '{}' does not exist".format(key_filename) + f"The defined ssh_private_key '{key_filename}' does not exist" ) return key_filename @@ -897,11 +893,9 @@ def _wait_for_completion(conn, wait_timeout, server_id): if server_state == "powered_on": return elif server_state == "failed": - raise Exception("Server creation failed for {}".format(server_id)) + raise Exception(f"Server creation failed for {server_id}") elif server_state in ("active", "enabled", "deploying", "configuring"): continue else: - raise Exception("Unknown server state {}".format(server_state)) - raise Exception( - "Timed out waiting for server create completion for {}".format(server_id) - ) + raise Exception(f"Unknown server state {server_state}") + raise Exception(f"Timed out waiting for server create completion for {server_id}") diff --git a/salt/cloud/clouds/opennebula.py b/salt/cloud/clouds/opennebula.py index 71f9372a594..7fa1428f834 100644 --- a/salt/cloud/clouds/opennebula.py +++ b/salt/cloud/clouds/opennebula.py @@ -558,7 +558,7 @@ def get_cluster_id(kwargs=None, call=None): try: ret = list_clusters()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The cluster '{}' could not be found".format(name)) + raise SaltCloudSystemExit(f"The cluster '{name}' could not be found") return ret @@ -590,7 +590,7 @@ def get_datastore_id(kwargs=None, call=None): try: ret = list_datastores()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The datastore '{}' could not be found.".format(name)) + raise SaltCloudSystemExit(f"The datastore '{name}' could not be found.") return ret @@ -622,7 +622,7 @@ def get_host_id(kwargs=None, call=None): try: ret = avail_locations()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The host '{}' could not be found".format(name)) + raise SaltCloudSystemExit(f"The host '{name}' could not be found") return ret @@ -641,9 +641,7 @@ def get_image(vm_): for image in images: if vm_image in (images[image]["name"], images[image]["id"]): return images[image]["id"] - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def get_image_id(kwargs=None, call=None): @@ -673,7 +671,7 @@ def get_image_id(kwargs=None, call=None): try: ret = avail_images()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The image '{}' could not be found".format(name)) + raise SaltCloudSystemExit(f"The image '{name}' could not be found") return ret @@ -697,7 +695,7 @@ def get_location(vm_): if vm_location in (locations[location]["name"], locations[location]["id"]): return locations[location]["id"] raise SaltCloudNotFound( - "The specified location, '{}', could not be found.".format(vm_location) + f"The specified location, '{vm_location}', could not be found." ) @@ -728,9 +726,7 @@ def get_secgroup_id(kwargs=None, call=None): try: ret = list_security_groups()[name]["id"] except KeyError: - raise SaltCloudSystemExit( - "The security group '{}' could not be found.".format(name) - ) + raise SaltCloudSystemExit(f"The security group '{name}' could not be found.") return ret @@ -761,7 +757,7 @@ def get_template_image(kwargs=None, call=None): ret = list_templates()[name]["template"]["disk"]["image"] except KeyError: raise SaltCloudSystemExit( - "The image for template '{}' could not be found.".format(name) + f"The image for template '{name}' could not be found." ) return ret @@ -794,7 +790,7 @@ def get_template_id(kwargs=None, call=None): try: ret = list_templates()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The template '{}' could not be found.".format(name)) + raise SaltCloudSystemExit(f"The template '{name}' could not be found.") return ret @@ -816,7 +812,7 @@ def get_template(vm_): return list_templates()[vm_template]["id"] except KeyError: raise SaltCloudNotFound( - "The specified template, '{}', could not be found.".format(vm_template) + f"The specified template, '{vm_template}', could not be found." ) @@ -847,7 +843,7 @@ def get_vm_id(kwargs=None, call=None): try: ret = list_nodes()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The VM '{}' could not be found.".format(name)) + raise SaltCloudSystemExit(f"The VM '{name}' could not be found.") return ret @@ -879,7 +875,7 @@ def get_vn_id(kwargs=None, call=None): try: ret = list_vns()[name]["id"] except KeyError: - raise SaltCloudSystemExit("The VN '{}' could not be found.".format(name)) + raise SaltCloudSystemExit(f"The VN '{name}' could not be found.") return ret @@ -895,9 +891,7 @@ def _get_device_template(disk, disk_info, template=None): def _require_disk_opts(*args): for arg in args: if arg not in disk_info: - raise SaltCloudSystemExit( - "The disk {} requires a {} argument".format(disk, arg) - ) + raise SaltCloudSystemExit(f"The disk {disk} requires a {arg} argument") _require_disk_opts("disk_type", "size") @@ -919,12 +913,12 @@ def _get_device_template(disk, disk_info, template=None): if disk_type == "volatile": _require_disk_opts("type") v_type = disk_info["type"] - temp = "DISK=[TYPE={}, SIZE={}]".format(v_type, size) + temp = f"DISK=[TYPE={v_type}, SIZE={size}]" if v_type == "fs": _require_disk_opts("format") format = disk_info["format"] - temp = "DISK=[TYPE={}, SIZE={}, FORMAT={}]".format(v_type, size, format) + temp = f"DISK=[TYPE={v_type}, SIZE={size}, FORMAT={format}]" return temp # TODO add persistant disk_type @@ -1101,7 +1095,7 @@ def create(vm_): ) if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined key_filename '{}' does not exist".format(key_filename) + f"The defined key_filename '{key_filename}' does not exist" ) if fqdn: @@ -1178,7 +1172,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], ) @@ -1192,7 +1186,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], ) @@ -4474,7 +4468,7 @@ def _get_xml(xml_str): except etree.XMLSyntaxError as err: # opennebula returned invalid XML, which could be an error message, so # log it - raise SaltCloudSystemExit("opennebula returned: {}".format(xml_str)) + raise SaltCloudSystemExit(f"opennebula returned: {xml_str}") return xml_data diff --git a/salt/cloud/clouds/openstack.py b/salt/cloud/clouds/openstack.py index 0a8b8d7e1b2..8dfbf1c341c 100644 --- a/salt/cloud/clouds/openstack.py +++ b/salt/cloud/clouds/openstack.py @@ -737,7 +737,7 @@ def create(vm_): ) if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined ssh_key_file '{}' does not exist".format(key_filename) + f"The defined ssh_key_file '{key_filename}' does not exist" ) vm_["key_filename"] = key_filename @@ -846,7 +846,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -863,7 +863,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/packet.py b/salt/cloud/clouds/packet.py index 1c6217bf4f7..0e1b65bed0c 100644 --- a/salt/cloud/clouds/packet.py +++ b/salt/cloud/clouds/packet.py @@ -242,9 +242,7 @@ def _wait_for_status(status_type, object_id, status=None, timeout=500, quiet=Tru manager = packet.Manager(auth_token=vm_["token"]) for i in range(0, iterations): - get_object = getattr( - manager, "get_{status_type}".format(status_type=status_type) - ) + get_object = getattr(manager, f"get_{status_type}") obj = get_object(object_id) if obj.state == status: @@ -340,7 +338,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args=__utils__["cloud.filter_event"]( "creating", vm_, ["name", "profile", "provider", "driver"] ), @@ -413,7 +411,7 @@ def create(vm_): volume = manager.create_volume( vm_["project_id"], - "{}_storage".format(name), + f"{name}_storage", vm_.get("storage_tier"), vm_.get("storage_size"), vm_.get("location"), @@ -441,7 +439,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args=__utils__["cloud.filter_event"]( "created", vm_, ["name", "profile", "provider", "driver"] ), @@ -580,7 +578,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -606,7 +604,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/parallels.py b/salt/cloud/clouds/parallels.py index 4b65ddd9c8a..a5e6ca0fff7 100644 --- a/salt/cloud/clouds/parallels.py +++ b/salt/cloud/clouds/parallels.py @@ -310,11 +310,11 @@ def create(vm_): name = vm_["name"] if not wait_until(name, "CREATED"): - return {"Error": "Unable to start {}, command timed out".format(name)} + return {"Error": f"Unable to start {name}, command timed out"} start(vm_["name"], call="action") if not wait_until(name, "STARTED"): - return {"Error": "Unable to start {}, command timed out".format(name)} + return {"Error": f"Unable to start {name}, command timed out"} def __query_node_data(vm_name): data = show_instance(vm_name, call="action") @@ -391,7 +391,7 @@ def query(action=None, command=None, args=None, method="GET", data=None): path += action if command: - path += "/{}".format(command) + path += f"/{command}" if not type(args, dict): args = {} @@ -404,7 +404,7 @@ def query(action=None, command=None, args=None, method="GET", data=None): if args: params = urllib.parse.urlencode(args) - req = urllib.request.Request(url="{}?{}".format(path, params), **kwargs) + req = urllib.request.Request(url=f"{path}?{params}", **kwargs) else: req = urllib.request.Request(url=path, **kwargs) @@ -526,7 +526,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -536,7 +536,7 @@ def destroy(name, call=None): if node["state"] == "STARTED": stop(name, call="action") if not wait_until(name, "STOPPED"): - return {"Error": "Unable to destroy {}, command timed out".format(name)} + return {"Error": f"Unable to destroy {name}, command timed out"} data = query(action="ve", command=name, method="DELETE") @@ -546,7 +546,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -557,7 +557,7 @@ def destroy(name, call=None): name, _get_active_provider_name().split(":")[0], __opts__ ) - return {"Destroyed": "{} was destroyed.".format(name)} + return {"Destroyed": f"{name} was destroyed."} def start(name, call=None): @@ -575,12 +575,12 @@ def start(name, call=None): "The show_instance action must be called with -a or --action." ) - data = query(action="ve", command="{}/start".format(name), method="PUT") + data = query(action="ve", command=f"{name}/start", method="PUT") if "error" in data: return data["error"] - return {"Started": "{} was started.".format(name)} + return {"Started": f"{name} was started."} def stop(name, call=None): @@ -598,9 +598,9 @@ def stop(name, call=None): "The show_instance action must be called with -a or --action." ) - data = query(action="ve", command="{}/stop".format(name), method="PUT") + data = query(action="ve", command=f"{name}/stop", method="PUT") if "error" in data: return data["error"] - return {"Stopped": "{} was stopped.".format(name)} + return {"Stopped": f"{name} was stopped."} diff --git a/salt/cloud/clouds/profitbricks.py b/salt/cloud/clouds/profitbricks.py index 72f1b362551..a8a9351a717 100644 --- a/salt/cloud/clouds/profitbricks.py +++ b/salt/cloud/clouds/profitbricks.py @@ -328,9 +328,7 @@ def get_size(vm_): combinations = (str(sizes[size]["id"]), str(size)) if vm_size and str(vm_size) in combinations: return sizes[size] - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def get_datacenter_id(): @@ -415,7 +413,7 @@ def get_datacenter(conn): return item raise SaltCloudNotFound( - "The specified datacenter '{}' could not be found.".format(datacenter_id) + f"The specified datacenter '{datacenter_id}' could not be found." ) @@ -488,9 +486,7 @@ def get_image(vm_): if vm_image and vm_image in (images[key]["id"], images[key]["name"]): return images[key] - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def list_datacenters(conn=None, call=None): @@ -725,7 +721,7 @@ def get_public_keys(vm_): key_filename = os.path.expanduser(key_filename) if not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined ssh_public_key '{}' does not exist".format(key_filename) + f"The defined ssh_public_key '{key_filename}' does not exist" ) ssh_keys = [] with salt.utils.files.fopen(key_filename) as rfh: @@ -746,7 +742,7 @@ def get_key_filename(vm_): key_filename = os.path.expanduser(key_filename) if not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined ssh_private_key '{}' does not exist".format(key_filename) + f"The defined ssh_private_key '{key_filename}' does not exist" ) return key_filename @@ -941,7 +937,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -972,7 +968,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1142,9 +1138,7 @@ def _get_data_volumes(vm_): # Verify the required 'disk_size' property is present in the cloud # profile config if "disk_size" not in volumes[key].keys(): - raise SaltCloudConfigError( - "The volume '{}' is missing 'disk_size'".format(key) - ) + raise SaltCloudConfigError(f"The volume '{key}' is missing 'disk_size'") # Use 'HDD' if no 'disk_type' property is present in cloud profile if "disk_type" not in volumes[key].keys(): volumes[key]["disk_type"] = "HDD" @@ -1187,7 +1181,7 @@ def _get_firewall_rules(firewall_rules): # profile config if "protocol" not in firewall_rules[key].keys(): raise SaltCloudConfigError( - "The firewall rule '{}' is missing 'protocol'".format(key) + f"The firewall rule '{key}' is missing 'protocol'" ) ret.append( FirewallRule( diff --git a/salt/cloud/clouds/proxmox.py b/salt/cloud/clouds/proxmox.py index 61340f0928f..82fe04f004e 100644 --- a/salt/cloud/clouds/proxmox.py +++ b/salt/cloud/clouds/proxmox.py @@ -135,7 +135,7 @@ def _authenticate(): ) connect_data = {"username": username, "password": passwd} - full_url = "https://{}:{}/api2/json/access/ticket".format(url, port) + full_url = f"https://{url}:{port}/api2/json/access/ticket" response = requests.post( full_url, verify=verify_ssl, data=connect_data, timeout=120 @@ -155,7 +155,7 @@ def query(conn_type, option, post_data=None): log.debug("Not authenticated yet, doing that now..") _authenticate() - full_url = "https://{}:{}/api2/json/{}".format(url, port, option) + full_url = f"https://{url}:{port}/api2/json/{option}" log.debug("%s: %s (%s)", conn_type, full_url, post_data) @@ -450,9 +450,7 @@ def avail_images(call=None, location="local"): ret = {} for host_name, host_details in avail_locations().items(): - for item in query( - "get", "nodes/{}/storage/{}/content".format(host_name, location) - ): + for item in query("get", f"nodes/{host_name}/storage/{location}/content"): ret[item["volid"]] = item return ret @@ -559,7 +557,7 @@ def _dictionary_to_stringlist(input_dict): setting1=value1,setting2=value2 """ - return ",".join("{}={}".format(k, input_dict[k]) for k in sorted(input_dict.keys())) + return ",".join(f"{k}={input_dict[k]}" for k in sorted(input_dict.keys())) def _reconfigure_clone(vm_, vmid): @@ -715,7 +713,7 @@ def create(vm_): # wait until the vm has been created so we can start it if not wait_for_created(data["upid"], timeout=300): - return {"Error": "Unable to create {}, command timed out".format(name)} + return {"Error": f"Unable to create {name}, command timed out"} if vm_.get("clone") is True: _reconfigure_clone(vm_, vmid) @@ -728,7 +726,7 @@ def create(vm_): # Wait until the VM has fully started log.debug('Waiting for state "running" for vm %s on %s', vmid, host) if not wait_for_state(vmid, "running"): - return {"Error": "Unable to start {}, command timed out".format(name)} + return {"Error": f"Unable to start {name}, command timed out"} if agent_get_ip is True: try: @@ -868,7 +866,7 @@ def _import_api(): Load this json content into global variable "api" """ global api - full_url = "https://{}:{}/pve-docs/api-viewer/apidoc.js".format(url, port) + full_url = f"https://{url}:{port}/pve-docs/api-viewer/apidoc.js" returned_data = requests.get(full_url, verify=verify_ssl, timeout=120) re_filter = re.compile(" (?:pveapi|apiSchema) = (.*)^;", re.DOTALL | re.MULTILINE) @@ -1102,12 +1100,12 @@ def get_vmconfig(vmid, node=None, node_type="openvz"): if node is None: # We need to figure out which node this VM is on. for host_name, host_details in avail_locations().items(): - for item in query("get", "nodes/{}/{}".format(host_name, node_type)): + for item in query("get", f"nodes/{host_name}/{node_type}"): if item["vmid"] == vmid: node = host_name # If we reached this point, we have all the information we need - data = query("get", "nodes/{}/{}/{}/config".format(node, node_type, vmid)) + data = query("get", f"nodes/{node}/{node_type}/{vmid}/config") return data @@ -1179,7 +1177,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1193,7 +1191,7 @@ def destroy(name, call=None): # wait until stopped if not wait_for_state(vmobj["vmid"], "stopped"): - return {"Error": "Unable to stop {}, command timed out".format(name)} + return {"Error": f"Unable to stop {name}, command timed out"} # required to wait a bit here, otherwise the VM is sometimes # still locked and destroy fails. @@ -1203,7 +1201,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1213,7 +1211,7 @@ def destroy(name, call=None): name, _get_active_provider_name().split(":")[0], __opts__ ) - return {"Destroyed": "{} was destroyed.".format(name)} + return {"Destroyed": f"{name} was destroyed."} def set_vm_status(status, name=None, vmid=None): @@ -1302,7 +1300,7 @@ def start(name, vmid=None, call=None): # xxx: TBD: Check here whether the status was actually changed to 'started' - return {"Started": "{} was started.".format(name)} + return {"Started": f"{name} was started."} def stop(name, vmid=None, call=None): @@ -1324,7 +1322,7 @@ def stop(name, vmid=None, call=None): # xxx: TBD: Check here whether the status was actually changed to 'stopped' - return {"Stopped": "{} was stopped.".format(name)} + return {"Stopped": f"{name} was stopped."} def shutdown(name=None, vmid=None, call=None): @@ -1348,4 +1346,4 @@ def shutdown(name=None, vmid=None, call=None): # xxx: TBD: Check here whether the status was actually changed to 'stopped' - return {"Shutdown": "{} was shutdown.".format(name)} + return {"Shutdown": f"{name} was shutdown."} diff --git a/salt/cloud/clouds/qingcloud.py b/salt/cloud/clouds/qingcloud.py index fd2f179b758..6c3bda925e4 100644 --- a/salt/cloud/clouds/qingcloud.py +++ b/salt/cloud/clouds/qingcloud.py @@ -108,7 +108,7 @@ def _compute_signature(parameters, access_key_secret, method, path): """ parameters["signature_method"] = "HmacSHA256" - string_to_sign = "{}\n{}\n".format(method.upper(), path) + string_to_sign = f"{method.upper()}\n{path}\n" keys = sorted(parameters.keys()) pairs = [] @@ -166,9 +166,9 @@ def query(params=None): for sk, sv in value[i - 1].items(): if isinstance(sv, dict) or isinstance(sv, list): sv = salt.utils.json.dumps(sv, separators=(",", ":")) - real_parameters["{}.{}.{}".format(key, i, sk)] = sv + real_parameters[f"{key}.{i}.{sk}"] = sv else: - real_parameters["{}.{}".format(key, i)] = value[i - 1] + real_parameters[f"{key}.{i}"] = value[i - 1] else: real_parameters[key] = value @@ -252,7 +252,7 @@ def _get_location(vm_=None): return vm_location raise SaltCloudNotFound( - "The specified location, '{}', could not be found.".format(vm_location) + f"The specified location, '{vm_location}', could not be found." ) @@ -320,9 +320,7 @@ def _get_image(vm_): if vm_image in images: return vm_image - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def show_image(kwargs, call=None): @@ -442,9 +440,7 @@ def _get_size(vm_): if vm_size in sizes: return vm_size - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def _show_normalized_node(full_node): @@ -626,7 +622,7 @@ def show_instance(instance_id, call=None, kwargs=None): if items["total_count"] == 0: raise SaltCloudNotFound( - "The specified instance, '{}', could not be found.".format(instance_id) + f"The specified instance, '{instance_id}', could not be found." ) full_node = items["instance_set"][0] @@ -878,7 +874,7 @@ def destroy(instance_id, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -894,7 +890,7 @@ def destroy(instance_id, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/saltify.py b/salt/cloud/clouds/saltify.py index 451478a5552..d3430935fc0 100644 --- a/salt/cloud/clouds/saltify.py +++ b/salt/cloud/clouds/saltify.py @@ -289,7 +289,7 @@ def create(vm_): if ssh_host: log.info("trying to ping %s", ssh_host) count = "n" if salt.utils.platform.is_windows() else "c" - cmd = "ping -{} 1 {}".format(count, ssh_host) + cmd = f"ping -{count} 1 {ssh_host}" good_ping = local.cmd(wol_host, "cmd.retcode", [cmd]) == 0 if good_ping: log.info("successful ping.") @@ -464,7 +464,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=opts["sock_dir"], transport=opts["transport"], @@ -510,13 +510,13 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=opts["sock_dir"], transport=opts["transport"], ) - return {"Destroyed": "{} was destroyed.".format(name)} + return {"Destroyed": f"{name} was destroyed."} def reboot(name, call=None): diff --git a/salt/cloud/clouds/scaleway.py b/salt/cloud/clouds/scaleway.py index 9b412181c01..d261e50360f 100644 --- a/salt/cloud/clouds/scaleway.py +++ b/salt/cloud/clouds/scaleway.py @@ -160,7 +160,7 @@ def get_image(server_): if server_image in (images[image]["name"], images[image]["id"]): return images[image]["id"] raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(server_image) + f"The specified image, '{server_image}', could not be found." ) @@ -225,7 +225,7 @@ def create(server_): if key_filename is not None and not os.path.isfile(key_filename): raise SaltCloudConfigError( - "The defined key_filename '{}' does not exist".format(key_filename) + f"The defined key_filename '{key_filename}' does not exist" ) ssh_password = config.get_cloud_config_value("ssh_password", server_, __opts__) @@ -346,10 +346,10 @@ def query( ) ) - path = "{}/{}/".format(base_path, method) + path = f"{base_path}/{method}/" if server_id: - path += "{}/".format(server_id) + path += f"{server_id}/" if command: path += command @@ -439,7 +439,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -457,7 +457,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/softlayer.py b/salt/cloud/clouds/softlayer.py index 5c6892227ef..c0f282f84ed 100644 --- a/salt/cloud/clouds/softlayer.py +++ b/salt/cloud/clouds/softlayer.py @@ -269,7 +269,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args=__utils__["cloud.filter_event"]( "creating", vm_, ["name", "profile", "provider", "driver"] ), @@ -395,7 +395,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "requesting instance", - "salt/cloud/{}/requesting".format(name), + f"salt/cloud/{name}/requesting", args={ "kwargs": __utils__["cloud.filter_event"]( "requesting", kwargs, list(kwargs) @@ -513,7 +513,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args=__utils__["cloud.filter_event"]( "created", vm_, ["name", "profile", "provider", "driver"] ), @@ -620,7 +620,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -633,7 +633,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/softlayer_hw.py b/salt/cloud/clouds/softlayer_hw.py index 2cfd2fbf38c..f8a92f8a8a8 100644 --- a/salt/cloud/clouds/softlayer_hw.py +++ b/salt/cloud/clouds/softlayer_hw.py @@ -241,7 +241,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args=__utils__["cloud.filter_event"]( "creating", vm_, ["name", "profile", "provider", "driver"] ), @@ -311,7 +311,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "requesting instance", - "salt/cloud/{}/requesting".format(name), + f"salt/cloud/{name}/requesting", args={ "kwargs": __utils__["cloud.filter_event"]( "requesting", kwargs, list(kwargs) @@ -406,7 +406,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args=__utils__["cloud.filter_event"]( "created", vm_, ["name", "profile", "provider", "driver"] ), @@ -514,7 +514,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -535,7 +535,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/tencentcloud.py b/salt/cloud/clouds/tencentcloud.py index b2903b9380a..374f4a3247b 100644 --- a/salt/cloud/clouds/tencentcloud.py +++ b/salt/cloud/clouds/tencentcloud.py @@ -123,7 +123,7 @@ def get_provider_client(name=None): elif name == "vpc_client": client = vpc_client.VpcClient(crd, region, cpf) else: - raise SaltCloudSystemExit("Client name {} is not supported".format(name)) + raise SaltCloudSystemExit(f"Client name {name} is not supported") return client @@ -206,11 +206,11 @@ def avail_sizes(call=None): ret[typeConfig.InstanceType] = { "Zone": typeConfig.Zone, "InstanceFamily": typeConfig.InstanceFamily, - "Memory": "{}GB".format(typeConfig.Memory), - "CPU": "{}-Core".format(typeConfig.CPU), + "Memory": f"{typeConfig.Memory}GB", + "CPU": f"{typeConfig.CPU}-Core", } if typeConfig.GPU: - ret[typeConfig.InstanceType]["GPU"] = "{}-Core".format(typeConfig.GPU) + ret[typeConfig.InstanceType]["GPU"] = f"{typeConfig.GPU}-Core" return ret @@ -714,7 +714,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -730,7 +730,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -782,9 +782,7 @@ def show_image(kwargs, call=None): resp = client.DescribeImages(req) if not resp.ImageSet: - raise SaltCloudNotFound( - "The specified image '{}' could not be found.".format(image) - ) + raise SaltCloudNotFound(f"The specified image '{image}' could not be found.") ret = {} for image in resp.ImageSet: @@ -794,7 +792,7 @@ def show_image(kwargs, call=None): "ImageSource": image.ImageSource, "Platform": image.Platform, "Architecture": image.Architecture, - "ImageSize": "{}GB".format(image.ImageSize), + "ImageSize": f"{image.ImageSize}GB", "ImageState": image.ImageState, } @@ -893,7 +891,7 @@ def _get_node(name): ) time.sleep(0.5) - raise SaltCloudNotFound("Failed to get instance info {}".format(name)) + raise SaltCloudNotFound(f"Failed to get instance info {name}") def _get_nodes(): @@ -940,7 +938,7 @@ def _get_images(image_type): "ImageSource": image.ImageSource, "Platform": image.Platform, "Architecture": image.Architecture, - "ImageSize": "{}GB".format(image.ImageSize), + "ImageSize": f"{image.ImageSize}GB", } return ret @@ -958,9 +956,7 @@ def __get_image(vm_): if vm_image in images: return vm_image - raise SaltCloudNotFound( - "The specified image '{}' could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image '{vm_image}' could not be found.") def __get_size(vm_): @@ -975,9 +971,7 @@ def __get_size(vm_): if vm_size in sizes: return vm_size - raise SaltCloudNotFound( - "The specified size '{}' could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size '{vm_size}' could not be found.") def __get_securitygroups(vm_): diff --git a/salt/cloud/clouds/vagrant.py b/salt/cloud/clouds/vagrant.py index 836ea44badd..ac9119b70d9 100644 --- a/salt/cloud/clouds/vagrant.py +++ b/salt/cloud/clouds/vagrant.py @@ -256,7 +256,7 @@ def create(vm_): vm_.setdefault("ssh_port", ret["ssh_port"]) except (KeyError, TypeError): raise SaltInvocationError( - "Insufficient SSH addressing information for {}".format(name) + f"Insufficient SSH addressing information for {name}" ) log.info( @@ -300,7 +300,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=opts["sock_dir"], transport=opts["transport"], @@ -317,7 +317,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=opts["sock_dir"], transport=opts["transport"], @@ -328,11 +328,11 @@ def destroy(name, call=None): name, _get_active_provider_name().split(":")[0], opts ) - return {"Destroyed": "{} was destroyed.".format(name)} + return {"Destroyed": f"{name} was destroyed."} else: - return {"Error": "Error destroying {}".format(name)} + return {"Error": f"Error destroying {name}"} else: - return {"Error": "No response from {}. Cannot destroy.".format(name)} + return {"Error": f"No response from {name}. Cannot destroy."} # noinspection PyTypeChecker diff --git a/salt/cloud/clouds/virtualbox.py b/salt/cloud/clouds/virtualbox.py index 58b8ecd0242..0f7c169cef6 100644 --- a/salt/cloud/clouds/virtualbox.py +++ b/salt/cloud/clouds/virtualbox.py @@ -368,12 +368,12 @@ def destroy(name, call=None): """ log.info("Attempting to delete instance %s", name) if not vb_machine_exists(name): - return "{} doesn't exist and can't be deleted".format(name) + return f"{name} doesn't exist and can't be deleted" __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -384,7 +384,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/cloud/clouds/vmware.py b/salt/cloud/clouds/vmware.py index f6d8cbcef6c..91b1f1b3d25 100644 --- a/salt/cloud/clouds/vmware.py +++ b/salt/cloud/clouds/vmware.py @@ -306,7 +306,7 @@ def _add_new_hard_disk_helper( disk_spec.device.key = random_key disk_spec.device.deviceInfo = vim.Description() disk_spec.device.deviceInfo.label = disk_label - disk_spec.device.deviceInfo.summary = "{} GB".format(size_gb) + disk_spec.device.deviceInfo.summary = f"{size_gb} GB" disk_spec.device.backing = vim.vm.device.VirtualDisk.FlatVer2BackingInfo() disk_spec.device.backing.thinProvisioned = thin_provision @@ -662,7 +662,7 @@ def _set_cd_or_dvd_backing_type(drive, device_type, mode, iso_path): if datastore_ref: drive.backing.datastore = datastore_ref - drive.deviceInfo.summary = "ISO {}".format(iso_path) + drive.deviceInfo.summary = f"ISO {iso_path}" elif device_type == "client_device": if mode == "passthrough": @@ -917,7 +917,7 @@ def _manage_devices(devices, vm=None, container_ref=None, new_vm_name=None): else None ) if bus_sharing and bus_sharing in ["virtual", "physical", "no"]: - bus_sharing = "{}Sharing".format(bus_sharing) + bus_sharing = f"{bus_sharing}Sharing" if bus_sharing != device.sharedBus: # Only edit the SCSI controller if bus_sharing is different scsi_spec = _edit_existing_scsi_controller( @@ -1327,7 +1327,7 @@ def _format_instance_info_select(vm, selection): if "size" in selection: cpu = defaultto(vm, "config.hardware.numCPU") ram = "{} MB".format(defaultto(vm, "config.hardware.memoryMB")) - vm_select_info["size"] = "cpu: {}\nram: {}".format(cpu, ram) + vm_select_info["size"] = f"cpu: {cpu}\nram: {ram}" vm_select_info["size_dict"] = { "cpu": cpu, "memory": ram, @@ -1610,7 +1610,7 @@ def _format_instance_info(vm): if "config.guestFullName" in vm else "N/A" ), - "size": "cpu: {}\nram: {}".format(cpu, ram), + "size": f"cpu: {cpu}\nram: {ram}", "size_dict": {"cpu": cpu, "memory": ram}, "state": ( str(vm["summary.runtime.powerState"]) @@ -1642,7 +1642,7 @@ def _format_instance_info(vm): def _get_snapshots(snapshot_list, current_snapshot=None, parent_snapshot_path=""): snapshots = {} for snapshot in snapshot_list: - snapshot_path = "{}/{}".format(parent_snapshot_path, snapshot.name) + snapshot_path = f"{parent_snapshot_path}/{snapshot.name}" snapshots[snapshot_path] = { "name": snapshot.name, "description": snapshot.description, @@ -1777,7 +1777,7 @@ def test_vcenter_connection(kwargs=None, call=None): # Get the service instance object _get_si() except Exception as exc: # pylint: disable=broad-except - return "failed to connect: {}".format(exc) + return f"failed to connect: {exc}" return "connection successful" @@ -2027,7 +2027,7 @@ def list_nodes(kwargs=None, call=None): if "config.guestFullName" in vm else "N/A" ), - "size": "cpu: {}\nram: {}".format(cpu, ram), + "size": f"cpu: {cpu}\nram: {ram}", "size_dict": {"cpu": cpu, "memory": ram}, "state": ( str(vm["summary.runtime.powerState"]) @@ -2684,7 +2684,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -2730,7 +2730,7 @@ def destroy(name, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -3135,7 +3135,7 @@ def create(vm_): ) if not datastore_ref: raise SaltCloudSystemExit( - "Specified datastore: '{}' does not exist".format(datastore) + f"Specified datastore: '{datastore}' does not exist" ) if host: @@ -3151,7 +3151,7 @@ def create(vm_): # If the hardware version is specified and if it is different from the current # hardware version, then schedule a hardware version upgrade if hardware_version and object_ref is not None: - hardware_version = "vmx-{:02}".format(hardware_version) + hardware_version = f"vmx-{hardware_version:02}" if hardware_version != object_ref.config.version: log.debug( "Scheduling hardware version upgrade from %s to %s", @@ -3181,7 +3181,7 @@ def create(vm_): elif memory_unit.lower() == "gb": memory_mb = int(float(memory_num) * 1024.0) else: - err_msg = "Invalid memory type specified: '{}'".format(memory_unit) + err_msg = f"Invalid memory type specified: '{memory_unit}'" log.error(err_msg) return {"Error": err_msg} except (TypeError, ValueError): @@ -3629,7 +3629,7 @@ def rescan_hba(kwargs=None, call=None): if hba: log.info("Rescanning HBA %s on host %s", hba, host_name) host_ref.configManager.storageSystem.RescanHba(hba) - ret = "rescanned HBA {}".format(hba) + ret = f"rescanned HBA {hba}" else: log.info("Rescanning all HBAs on host %s", host_name) host_ref.configManager.storageSystem.RescanAllHba() @@ -3907,7 +3907,7 @@ def list_hbas(kwargs=None, call=None): if hba_type and hba_type not in ["parallel", "block", "iscsi", "fibre"]: raise SaltCloudSystemExit( - "Specified hba type {} currently not supported.".format(hba_type) + f"Specified hba type {hba_type} currently not supported." ) host_list = salt.utils.vmware.get_mors_with_properties( @@ -4280,10 +4280,10 @@ def revert_to_snapshot(name, kwargs=None, call=None): task = vm_ref.RevertToCurrentSnapshot(suppressPowerOn=suppress_power_on) else: log.debug("Reverting VM %s to snapshot %s", name, snapshot_name) - msg = "reverted to snapshot {}".format(snapshot_name) + msg = f"reverted to snapshot {snapshot_name}" snapshot_ref = _get_snapshot_ref_by_name(vm_ref, snapshot_name) if snapshot_ref is None: - return "specified snapshot '{}' does not exist".format(snapshot_name) + return f"specified snapshot '{snapshot_name}' does not exist" task = snapshot_ref.snapshot.Revert(suppressPowerOn=suppress_power_on) salt.utils.vmware.wait_for_task(task, name, "revert to snapshot", 5, "info") @@ -4421,7 +4421,7 @@ def convert_to_template(name, kwargs=None, call=None): vm_ref = salt.utils.vmware.get_mor_by_property(_get_si(), vim.VirtualMachine, name) if vm_ref.config.template: - raise SaltCloudSystemExit("{} already a template".format(name)) + raise SaltCloudSystemExit(f"{name} already a template") try: vm_ref.MarkAsTemplate() @@ -4435,7 +4435,7 @@ def convert_to_template(name, kwargs=None, call=None): ) return "failed to convert to teamplate" - return "{} converted to template".format(name) + return f"{name} converted to template" def add_host(kwargs=None, call=None): @@ -4557,7 +4557,7 @@ def add_host(kwargs=None, call=None): ("echo", "-n"), stdout=subprocess.PIPE, stderr=subprocess.PIPE ) p2 = subprocess.Popen( - ("openssl", "s_client", "-connect", "{}:443".format(host_name)), + ("openssl", "s_client", "-connect", f"{host_name}:443"), stdin=p1.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE, @@ -4587,12 +4587,12 @@ def add_host(kwargs=None, call=None): try: if cluster_name: task = cluster_ref.AddHost(spec=spec, asConnected=True) - ret = "added host system to cluster {}".format(cluster_name) + ret = f"added host system to cluster {cluster_name}" if datacenter_name: task = datacenter_ref.hostFolder.AddStandaloneHost( spec=spec, addConnected=True ) - ret = "added host system to datacenter {}".format(datacenter_name) + ret = f"added host system to datacenter {datacenter_name}" salt.utils.vmware.wait_for_task(task, host_name, "add host system", 5, "info") except Exception as exc: # pylint: disable=broad-except if isinstance(exc, vim.fault.SSLVerifyFault): diff --git a/salt/cloud/clouds/xen.py b/salt/cloud/clouds/xen.py index 878f74f2a7a..810ff460227 100644 --- a/salt/cloud/clouds/xen.py +++ b/salt/cloud/clouds/xen.py @@ -124,7 +124,7 @@ def _get_session(): Get a connection to the XenServer host """ api_version = "1.0" - originator = "salt_cloud_{}_driver".format(__virtualname__) + originator = f"salt_cloud_{__virtualname__}_driver" url = config.get_cloud_config_value( "url", get_configured_provider(), __opts__, search_global=False ) @@ -550,7 +550,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "starting create", - "salt/cloud/{}/creating".format(name), + f"salt/cloud/{name}/creating", args={"name": name, "profile": vm_["profile"], "provider": vm_["driver"]}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -580,7 +580,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "requesting instance", - "salt/cloud/{}/requesting".format(name), + f"salt/cloud/{name}/requesting", sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], ) @@ -623,7 +623,7 @@ def create(vm_): __utils__["cloud.fire_event"]( "event", "created instance", - "salt/cloud/{}/created".format(name), + f"salt/cloud/{name}/created", args={"name": name, "profile": vm_["profile"], "provider": vm_["driver"]}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -923,7 +923,7 @@ def reboot(name, call=None, session=None): _run_async_task(task, session) return show_instance(name) else: - return "{} is not running to be rebooted".format(name) + return f"{name} is not running to be rebooted" def _get_vm(name=None, session=None): @@ -984,7 +984,7 @@ def destroy(name=None, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1009,7 +1009,7 @@ def destroy(name=None, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -1134,7 +1134,7 @@ def vif_list(name, call=None, kwargs=None): x = 0 for vif in vifs: vif_record = session.xenapi.VIF.get_record(vif) - data["vif-{}".format(x)] = vif_record + data[f"vif-{x}"] = vif_record x += 1 ret[name] = data return ret @@ -1168,7 +1168,7 @@ def vbd_list(name=None, call=None): x = 0 for vbd in vbds: vbd_record = session.xenapi.VBD.get_record(vbd) - data["vbd-{}".format(x)] = vbd_record + data[f"vbd-{x}"] = vbd_record x += 1 ret = data return ret @@ -1219,7 +1219,7 @@ def destroy_vm_vdis(name=None, session=None, call=None): vdi_record = session.xenapi.VDI.get_record(vbd_record["VDI"]) if "iso" not in vdi_record["name_label"]: session.xenapi.VDI.destroy(vbd_record["VDI"]) - ret["vdi-{}".format(x)] = vdi_record["name_label"] + ret[f"vdi-{x}"] = vdi_record["name_label"] x += 1 return ret diff --git a/salt/cloud/libcloudfuncs.py b/salt/cloud/libcloudfuncs.py index cee5ea724f9..2165e3ee442 100644 --- a/salt/cloud/libcloudfuncs.py +++ b/salt/cloud/libcloudfuncs.py @@ -61,7 +61,7 @@ def check_libcloud_version(reqver=LIBCLOUD_MINIMAL_VERSION, why=None): ) ) if why: - errormsg += " for {}".format(why) + errormsg += f" for {why}" errormsg += ". Please upgrade." raise ImportError(errormsg) @@ -186,7 +186,7 @@ def get_location(conn, vm_): return img raise SaltCloudNotFound( - "The specified location, '{}', could not be found.".format(vm_location) + f"The specified location, '{vm_location}', could not be found." ) @@ -204,9 +204,7 @@ def get_image(conn, vm_): if vm_image and vm_image in (img_id, img_name): return img - raise SaltCloudNotFound( - "The specified image, '{}', could not be found.".format(vm_image) - ) + raise SaltCloudNotFound(f"The specified image, '{vm_image}', could not be found.") def get_size(conn, vm_): @@ -224,9 +222,7 @@ def get_size(conn, vm_): str(size.name), ): return size - raise SaltCloudNotFound( - "The specified size, '{}', could not be found.".format(vm_size) - ) + raise SaltCloudNotFound(f"The specified size, '{vm_size}', could not be found.") def script(vm_): @@ -257,7 +253,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroying instance", - "salt/cloud/{}/destroying".format(name), + f"salt/cloud/{name}/destroying", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -296,7 +292,7 @@ def destroy(name, conn=None, call=None): __utils__["cloud.fire_event"]( "event", "destroyed instance", - "salt/cloud/{}/destroyed".format(name), + f"salt/cloud/{name}/destroyed", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], @@ -338,8 +334,8 @@ def reboot(name, conn=None): # Fire reboot action __utils__["cloud.fire_event"]( "event", - "{} has been rebooted".format(name), - "salt/cloud/{}/rebooting".format(name), + f"{name} has been rebooted", + f"salt/cloud/{name}/rebooting", args={"name": name}, sock_dir=__opts__["sock_dir"], transport=__opts__["transport"], diff --git a/salt/config/__init__.py b/salt/config/__init__.py index d94a690e8b9..a3e5a8bfdb7 100644 --- a/salt/config/__init__.py +++ b/salt/config/__init__.py @@ -2026,7 +2026,7 @@ def _read_conf_file(path): try: conf_opts = salt.utils.yaml.safe_load(conf_file) or {} except salt.utils.yaml.YAMLError as err: - message = "Error parsing configuration file: {} - {}".format(path, err) + message = f"Error parsing configuration file: {path} - {err}" log.error(message) if path.endswith("_schedule.conf"): # Create empty dictionary of config options @@ -2123,7 +2123,7 @@ def load_config(path, env_var, default_path=None, exit_on_config_errors=True): # If the configuration file is missing, attempt to copy the template, # after removing the first header line. if not os.path.isfile(path): - template = "{}.template".format(path) + template = f"{path}.template" if os.path.isfile(template): log.debug("Writing %s based on %s", path, template) with salt.utils.files.fopen(path, "w") as out: @@ -2800,7 +2800,7 @@ def apply_cloud_config(overrides, defaults=None): if alias not in config["providers"]: config["providers"][alias] = {} - detail["provider"] = "{}:{}".format(alias, driver) + detail["provider"] = f"{alias}:{driver}" config["providers"][alias][driver] = detail elif isinstance(details, dict): if "driver" not in details: @@ -2817,7 +2817,7 @@ def apply_cloud_config(overrides, defaults=None): if alias not in config["providers"]: config["providers"][alias] = {} - details["provider"] = "{}:{}".format(alias, driver) + details["provider"] = f"{alias}:{driver}" config["providers"][alias][driver] = details # Migrate old configuration @@ -3088,7 +3088,7 @@ def apply_cloud_providers_config(overrides, defaults=None): for entry in val: if "driver" not in entry: - entry["driver"] = "-only-extendable-{}".format(ext_count) + entry["driver"] = f"-only-extendable-{ext_count}" ext_count += 1 if key not in providers: @@ -3131,7 +3131,7 @@ def apply_cloud_providers_config(overrides, defaults=None): details["driver"], provider_alias, alias, provider ) ) - details["extends"] = "{}:{}".format(alias, provider) + details["extends"] = f"{alias}:{provider}" # change provider details '-only-extendable-' to extended # provider name details["driver"] = provider @@ -3152,10 +3152,10 @@ def apply_cloud_providers_config(overrides, defaults=None): ) else: if driver in providers.get(extends): - details["extends"] = "{}:{}".format(extends, driver) + details["extends"] = f"{extends}:{driver}" elif "-only-extendable-" in providers.get(extends): details["extends"] = "{}:{}".format( - extends, "-only-extendable-{}".format(ext_count) + extends, f"-only-extendable-{ext_count}" ) else: # We're still not aware of what we're trying to extend @@ -3869,7 +3869,7 @@ def _update_discovery_config(opts): for key in opts["discovery"]: if key not in discovery_config: raise salt.exceptions.SaltConfigurationError( - "Unknown discovery option: {}".format(key) + f"Unknown discovery option: {key}" ) if opts.get("__role") != "minion": for key in ["attempts", "pause", "match"]: diff --git a/salt/config/schemas/common.py b/salt/config/schemas/common.py index df136d537ea..d0ba546883d 100644 --- a/salt/config/schemas/common.py +++ b/salt/config/schemas/common.py @@ -25,7 +25,7 @@ class DefaultIncludeConfig(StringItem): description = __doc__ def __init__(self, default=None, pattern=None, **kwargs): - default = "{}/*.conf".format(self.__confd_directory__) + default = f"{self.__confd_directory__}/*.conf" pattern = r"(?:.*)/\*\.conf" super().__init__(default=default, pattern=pattern, **kwargs) diff --git a/salt/crypt.py b/salt/crypt.py index 5eba9ef5077..976cb027c92 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -128,8 +128,8 @@ def gen_keys(keydir, keyname, keysize, user=None, passphrase=None): :return: Path on the filesystem to the RSA private key """ base = os.path.join(keydir, keyname) - priv = "{}.pem".format(base) - pub = "{}.pub".format(base) + priv = f"{base}.pem" + pub = f"{base}.pub" if HAS_M2: gen = RSA.gen_key(keysize, 65537, lambda: None) @@ -449,7 +449,7 @@ class MasterKeys(dict): try: key = get_rsa_key(path, passphrase) except key_error as e: - message = "Unable to read key: {}; passphrase may be incorrect".format(path) + message = f"Unable to read key: {path}; passphrase may be incorrect" log.error(message) raise MasterExit(message) log.debug("Loaded %s key: %s", name, path) diff --git a/salt/daemons/__init__.py b/salt/daemons/__init__.py index f044f827b44..cb3b7c99c31 100644 --- a/salt/daemons/__init__.py +++ b/salt/daemons/__init__.py @@ -140,7 +140,7 @@ def extract_masters(opts, masters="master", port=None, raise_if_empty=True): entries = opts.get(masters, []) if not entries: - emsg = "Invalid or missing opts['{}'].".format(masters) + emsg = f"Invalid or missing opts['{masters}']." log.error(emsg) if raise_if_empty: raise ValueError(emsg) diff --git a/salt/daemons/masterapi.py b/salt/daemons/masterapi.py index 020bfb03198..82a3b1224aa 100644 --- a/salt/daemons/masterapi.py +++ b/salt/daemons/masterapi.py @@ -88,7 +88,7 @@ def clean_fsbackend(opts): # Clear remote fileserver backend caches so they get recreated for backend in ("git", "hg", "svn"): if backend in opts["fileserver_backend"]: - env_cache = os.path.join(opts["cachedir"], "{}fs".format(backend), "envs.p") + env_cache = os.path.join(opts["cachedir"], f"{backend}fs", "envs.p") if os.path.isfile(env_cache): log.debug("Clearing %sfs env cache", backend) try: @@ -99,7 +99,7 @@ def clean_fsbackend(opts): ) file_lists_dir = os.path.join( - opts["cachedir"], "file_lists", "{}fs".format(backend) + opts["cachedir"], "file_lists", f"{backend}fs" ) try: file_lists_caches = os.listdir(file_lists_dir) @@ -177,7 +177,7 @@ def mk_key(opts, user): opts["cachedir"], ".{}_key".format(user.replace("\\", "_")) ) else: - keyfile = os.path.join(opts["cachedir"], ".{}_key".format(user)) + keyfile = os.path.join(opts["cachedir"], f".{user}_key") if os.path.exists(keyfile): log.debug("Removing stale keyfile: %s", keyfile) @@ -589,7 +589,7 @@ class RemoteFuncs: minions = _res["minions"] minion_side_acl = {} # Cache minion-side ACL for minion in minions: - mine_data = self.cache.fetch("minions/{}".format(minion), "mine") + mine_data = self.cache.fetch(f"minions/{minion}", "mine") if not isinstance(mine_data, dict): continue for function in functions_allowed: @@ -616,7 +616,7 @@ class RemoteFuncs: continue salt.utils.dictupdate.set_dict_key_value( minion_side_acl, - "{}:{}".format(minion, function), + f"{minion}:{function}", get_minion, ) if salt.utils.mine.minion_side_acl_denied( @@ -1176,7 +1176,7 @@ class LocalFuncs: fun = load.pop("fun") tag = salt.utils.event.tagify(jid, prefix="wheel") data = { - "fun": "wheel.{}".format(fun), + "fun": f"wheel.{fun}", "jid": jid, "tag": tag, "user": username, @@ -1260,7 +1260,7 @@ class LocalFuncs: # Setup authorization list variable and error information auth_list = auth_check.get("auth_list", []) error = auth_check.get("error") - err_msg = 'Authentication failure of type "{}" occurred.'.format(auth_type) + err_msg = f'Authentication failure of type "{auth_type}" occurred.' if error: # Authentication error occurred: do not continue. diff --git a/salt/defaults/__init__.py b/salt/defaults/__init__.py index 35bdf162a02..5ebdb694a58 100644 --- a/salt/defaults/__init__.py +++ b/salt/defaults/__init__.py @@ -45,8 +45,8 @@ class _Constant: def __repr__(self): if self.value: - return "".format(self.name, self.value) - return "".format(self.name) + return f"" + return f"" # Default delimiter for multi-level traversal in targeting diff --git a/salt/engines/__init__.py b/salt/engines/__init__.py index d7dc6befa90..11baafb2b86 100644 --- a/salt/engines/__init__.py +++ b/salt/engines/__init__.py @@ -48,13 +48,13 @@ def start_engines(opts, proc_mgr, proxy=None): engine_name = engine del engine_opts["engine_module"] else: - fun = "{}.start".format(engine) + fun = f"{engine}.start" if fun in engines: start_func = engines[fun] if engine_name: - name = "Engine({}, name={})".format(start_func.__module__, engine_name) + name = f"Engine({start_func.__module__}, name={engine_name})" else: - name = "Engine({})".format(start_func.__module__) + name = f"Engine({start_func.__module__})" log.info("Starting %s", name) proc_mgr.add_process( Engine, diff --git a/salt/engines/ircbot.py b/salt/engines/ircbot.py index 1dab78dbbc5..8549caeb056 100644 --- a/salt/engines/ircbot.py +++ b/salt/engines/ircbot.py @@ -173,16 +173,16 @@ class IRCClient: event.source, nick, user, host, event.code, channel, command, line ) if (self._allow_nick(nick) or self._allow_host(host)) and hasattr( - self, "_command_{}".format(command) + self, f"_command_{command}" ): - getattr(self, "_command_{}".format(command))(privevent) + getattr(self, f"_command_{command}")(privevent) def _command_echo(self, event): - message = "PRIVMSG {} :{}".format(event.channel, event.line) + message = f"PRIVMSG {event.channel} :{event.line}" self.send_message(message) def _command_ping(self, event): - message = "PRIVMSG {} :{}: pong".format(event.channel, event.nick) + message = f"PRIVMSG {event.channel} :{event.nick}: pong" self.send_message(message) def _command_event(self, event): @@ -210,7 +210,7 @@ class IRCClient: payload = {"data": []} fire("salt/engines/ircbot/" + tag, payload) - message = "PRIVMSG {} :{}: TaDa!".format(event.channel, event.nick) + message = f"PRIVMSG {event.channel} :{event.nick}: TaDa!" self.send_message(message) def _message(self, raw): @@ -219,7 +219,7 @@ class IRCClient: if event.code == "PING": salt.ext.tornado.ioloop.IOLoop.current().spawn_callback( - self.send_message, "PONG {}".format(event.line) + self.send_message, f"PONG {event.line}" ) elif event.code == "PRIVMSG": salt.ext.tornado.ioloop.IOLoop.current().spawn_callback( @@ -230,13 +230,13 @@ class IRCClient: def join_channel(self, channel): if not channel.startswith("#"): channel = "#" + channel - self.send_message("JOIN {}".format(channel)) + self.send_message(f"JOIN {channel}") def on_connect(self): logging.info("on_connect") if self.sasl is True: self.send_message("CAP REQ :sasl") - self.send_message("NICK {}".format(self.nick)) + self.send_message(f"NICK {self.nick}") self.send_message("USER saltstack 0 * :saltstack") if self.password: if self.sasl is True: @@ -244,7 +244,7 @@ class IRCClient: "{0}\x00{0}\x00{1}".format(self.username, self.password).encode() ) self.send_message("AUTHENTICATE PLAIN") - self.send_message("AUTHENTICATE {}".format(authstring)) + self.send_message(f"AUTHENTICATE {authstring}") self.send_message("CAP END") else: self.send_message( diff --git a/salt/engines/libvirt_events.py b/salt/engines/libvirt_events.py index 3b77515f408..f09a298dc47 100644 --- a/salt/engines/libvirt_events.py +++ b/salt/engines/libvirt_events.py @@ -189,7 +189,7 @@ def _get_domain_event_detail(event, detail): if event_name == "unknown": return event_name, "unknown" - prefix = "VIR_DOMAIN_EVENT_{}_".format(event_name.upper()) + prefix = f"VIR_DOMAIN_EVENT_{event_name.upper()}_" detail_name = _get_libvirt_enum_string(prefix, detail) return event_name, detail_name @@ -333,9 +333,7 @@ def _domain_event_graphics_cb( transform address structure into event data piece """ return { - "family": _get_libvirt_enum_string( - "{}_ADDRESS_".format(prefix), addr["family"] - ), + "family": _get_libvirt_enum_string(f"{prefix}_ADDRESS_", addr["family"]), "node": addr["node"], "service": addr["service"], } @@ -680,14 +678,14 @@ def _register_callback(cnx, tag_prefix, obj, event, real_id): """ libvirt_name = real_id if real_id is None: - libvirt_name = "VIR_{}_EVENT_ID_{}".format(obj, event).upper() + libvirt_name = f"VIR_{obj}_EVENT_ID_{event}".upper() if not hasattr(libvirt, libvirt_name): log.warning('Skipping "%s/%s" events: libvirt too old', obj, event) return None libvirt_id = getattr(libvirt, libvirt_name) - callback_name = "_{}_event_{}_cb".format(obj, event) + callback_name = f"_{obj}_event_{event}_cb" callback = globals().get(callback_name, None) if callback is None: log.error("Missing function %s in engine", callback_name) diff --git a/salt/engines/napalm_syslog.py b/salt/engines/napalm_syslog.py index 3956a2836fd..e64f3c6b54b 100644 --- a/salt/engines/napalm_syslog.py +++ b/salt/engines/napalm_syslog.py @@ -209,7 +209,7 @@ def _zmq(address, port, **kwargs): socket = context.socket(zmq.SUB) if salt.utils.network.is_ipv6(address): socket.ipv6 = True - socket.connect("tcp://{addr}:{port}".format(addr=address, port=port)) + socket.connect(f"tcp://{address}:{port}") socket.setsockopt(zmq.SUBSCRIBE, b"") return socket.recv diff --git a/salt/engines/script.py b/salt/engines/script.py index 67277b14d5f..7b0e750d449 100644 --- a/salt/engines/script.py +++ b/salt/engines/script.py @@ -59,7 +59,7 @@ def _get_serializer(output): return getattr(serializers, output) except AttributeError: raise CommandExecutionError( - "Unknown serializer `{}` found for output option".format(output) + f"Unknown serializer `{output}` found for output option" ) diff --git a/salt/engines/slack.py b/salt/engines/slack.py index 93f75f8cd4e..27351d0fe4c 100644 --- a/salt/engines/slack.py +++ b/salt/engines/slack.py @@ -747,7 +747,7 @@ class SlackClient: results = {} for jid in outstanding_jids: # results[jid] = runner.cmd('jobs.lookup_jid', [jid]) - if self.master_minion.returners["{}.get_jid".format(source)](jid): + if self.master_minion.returners[f"{source}.get_jid"](jid): job_result = runner.cmd("jobs.list_job", [jid]) jid_result = job_result.get("Result", {}) jid_function = job_result.get("Function", {}) @@ -838,7 +838,7 @@ class SlackClient: channel.send_message(return_prefix) ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime("%Y%m%d%H%M%S%f") - filename = "salt-results-{}.yaml".format(st) + filename = f"salt-results-{st}.yaml" r = self.sc.api_call( "files.upload", channels=channel.id, @@ -944,4 +944,4 @@ def start( ) client.run_commands_from_slack_async(message_generator, fire_all, tag, control) except Exception: # pylint: disable=broad-except - raise Exception("{}".format(traceback.format_exc())) + raise Exception(f"{traceback.format_exc()}") diff --git a/salt/exceptions.py b/salt/exceptions.py index e351584bc03..57a6175de2d 100644 --- a/salt/exceptions.py +++ b/salt/exceptions.py @@ -284,7 +284,7 @@ class SaltRenderError(SaltException): self.buffer = buf self.context = "" if trace: - exc_str += "\n{}\n".format(trace) + exc_str += f"\n{trace}\n" if self.line_num and self.buffer: # Avoid circular import import salt.utils.templates diff --git a/salt/executors/docker.py b/salt/executors/docker.py index ebecae60c97..8c08fcf7ce0 100644 --- a/salt/executors/docker.py +++ b/salt/executors/docker.py @@ -22,7 +22,7 @@ def __virtual__(): "Docker executor is only meant to be used with Docker Proxy Minions", ) if __opts__.get("proxy", {}).get("proxytype") != __virtualname__: - return False, "Proxytype does not match: {}".format(__virtualname__) + return False, f"Proxytype does not match: {__virtualname__}" return True diff --git a/salt/executors/sudo.py b/salt/executors/sudo.py index 4d5a2fd71aa..799e77f5486 100644 --- a/salt/executors/sudo.py +++ b/salt/executors/sudo.py @@ -64,7 +64,7 @@ def execute(opts, data, func, args, kwargs): for arg in args: cmd.append(shlex.quote(str(arg))) for key in kwargs: - cmd.append(shlex.quote("{}={}".format(key, kwargs[key]))) + cmd.append(shlex.quote(f"{key}={kwargs[key]}")) cmd_ret = __salt__["cmd.run_all"](cmd, use_vt=True, python_shell=False) diff --git a/salt/fileclient.py b/salt/fileclient.py index 77e107830dd..fad1da72ece 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -107,7 +107,7 @@ class Client: Make sure that this path is intended for the salt master and trim it """ if not path.startswith("salt://"): - raise MinionError("Unsupported path: {}".format(path)) + raise MinionError(f"Unsupported path: {path}") file_path, saltenv = salt.utils.url.parse(path) return file_path @@ -273,7 +273,7 @@ class Client: for fn_ in self.file_list_emptydirs(saltenv): fn_ = salt.utils.data.decode(fn_) if fn_.startswith(path): - minion_dir = "{}/{}".format(dest, fn_) + minion_dir = f"{dest}/{fn_}" if not os.path.isdir(minion_dir): os.makedirs(minion_dir) ret.append(minion_dir) @@ -438,7 +438,7 @@ class Client: ret.append( self.get_file( salt.utils.url.create(fn_), - "{}/{}".format(dest, minion_relpath), + f"{dest}/{minion_relpath}", True, saltenv, gzip, @@ -457,7 +457,7 @@ class Client: # Remove the leading directories from path to derive # the relative path on the minion. minion_relpath = fn_[len(prefix) :].lstrip("/") - minion_mkdir = "{}/{}".format(dest, minion_relpath) + minion_mkdir = f"{dest}/{minion_relpath}" if not os.path.isdir(minion_mkdir): os.makedirs(minion_mkdir) ret.append(minion_mkdir) @@ -508,9 +508,7 @@ class Client: if url_scheme in ("file", ""): # Local filesystem if not os.path.isabs(url_path): - raise CommandExecutionError( - "Path '{}' is not absolute".format(url_path) - ) + raise CommandExecutionError(f"Path '{url_path}' is not absolute") if dest is None: with salt.utils.files.fopen(url_path, "rb") as fp_: data = fp_.read() @@ -584,9 +582,7 @@ class Client: ) return dest except Exception as exc: # pylint: disable=broad-except - raise MinionError( - "Could not fetch from {}. Exception: {}".format(url, exc) - ) + raise MinionError(f"Could not fetch from {url}. Exception: {exc}") if url_data.scheme == "ftp": try: ftp = ftplib.FTP() # nosec @@ -597,7 +593,7 @@ class Client: ftp.login(url_data.username, url_data.password) remote_file_path = url_data.path.lstrip("/") with salt.utils.files.fopen(dest, "wb") as fp_: - ftp.retrbinary("RETR {}".format(remote_file_path), fp_.write) + ftp.retrbinary(f"RETR {remote_file_path}", fp_.write) ftp.quit() return dest except Exception as exc: # pylint: disable=broad-except @@ -631,7 +627,7 @@ class Client: swift_conn.get_object(url_data.netloc, url_data.path[1:], dest) return dest except Exception: # pylint: disable=broad-except - raise MinionError("Could not fetch from {}".format(url)) + raise MinionError(f"Could not fetch from {url}") get_kwargs = {} if url_data.username is not None and url_data.scheme in ("http", "https"): @@ -654,7 +650,7 @@ class Client: fixed_url = url destfp = None - dest_etag = "{}.etag".format(dest) + dest_etag = f"{dest}.etag" try: # Tornado calls streaming_callback on redirect response bodies. # But we need streaming to support fetching large files (> RAM @@ -768,7 +764,7 @@ class Client: result.append(chunk) else: - dest_tmp = "{}.part".format(dest) + dest_tmp = f"{dest}.part" # We need an open filehandle to use in the on_chunk callback, # that's why we're not using a with clause here. # pylint: disable=resource-leakage @@ -830,7 +826,7 @@ class Client: ) ) except urllib.error.URLError as exc: - raise MinionError("Error reading {}: {}".format(url, exc.reason)) + raise MinionError(f"Error reading {url}: {exc.reason}") finally: if destfp is not None: destfp.close() diff --git a/salt/fileserver/__init__.py b/salt/fileserver/__init__.py index f6a1c6cdc8b..fe4b3b8e496 100644 --- a/salt/fileserver/__init__.py +++ b/salt/fileserver/__init__.py @@ -320,9 +320,9 @@ def clear_lock(clear_func, role, remote=None, lock_type="update"): Returns the return data from ``clear_func``. """ - msg = "Clearing {} lock for {} remotes".format(lock_type, role) + msg = f"Clearing {lock_type} lock for {role} remotes" if remote: - msg += " matching {}".format(remote) + msg += f" matching {remote}" log.debug(msg) return clear_func(remote=remote, lock_type=lock_type) @@ -375,12 +375,12 @@ class Fileserver: # Only subtracting backends from enabled ones ret = self.opts["fileserver_backend"] for sub in back: - if "{}.envs".format(sub[1:]) in server_funcs: + if f"{sub[1:]}.envs" in server_funcs: ret.remove(sub[1:]) return ret for sub in back: - if "{}.envs".format(sub) in server_funcs: + if f"{sub}.envs" in server_funcs: ret.append(sub) return ret @@ -408,7 +408,7 @@ class Fileserver: cleared = [] errors = [] for fsb in back: - fstr = "{}.clear_cache".format(fsb) + fstr = f"{fsb}.clear_cache" if fstr in self.servers: log.debug("Clearing %s fileserver cache", fsb) failed = self.servers[fstr]() @@ -416,7 +416,7 @@ class Fileserver: errors.extend(failed) else: cleared.append( - "The {} fileserver cache was successfully cleared".format(fsb) + f"The {fsb} fileserver cache was successfully cleared" ) return cleared, errors @@ -430,17 +430,15 @@ class Fileserver: locked = [] errors = [] for fsb in back: - fstr = "{}.lock".format(fsb) + fstr = f"{fsb}.lock" if fstr in self.servers: - msg = "Setting update lock for {} remotes".format(fsb) + msg = f"Setting update lock for {fsb} remotes" if remote: if not isinstance(remote, str): - errors.append( - "Badly formatted remote pattern '{}'".format(remote) - ) + errors.append(f"Badly formatted remote pattern '{remote}'") continue else: - msg += " matching {}".format(remote) + msg += f" matching {remote}" log.debug(msg) good, bad = self.servers[fstr](remote=remote) locked.extend(good) @@ -463,7 +461,7 @@ class Fileserver: cleared = [] errors = [] for fsb in back: - fstr = "{}.clear_lock".format(fsb) + fstr = f"{fsb}.clear_lock" if fstr in self.servers: good, bad = clear_lock(self.servers[fstr], fsb, remote=remote) cleared.extend(good) @@ -477,7 +475,7 @@ class Fileserver: """ back = self.backends(back) for fsb in back: - fstr = "{}.update".format(fsb) + fstr = f"{fsb}.update" if fstr in self.servers: log.debug("Updating %s fileserver cache", fsb) self.servers[fstr](**kwargs) @@ -490,7 +488,7 @@ class Fileserver: back = self.backends(back) ret = {} for fsb in back: - fstr = "{}.update_intervals".format(fsb) + fstr = f"{fsb}.update_intervals" if fstr in self.servers: ret[fsb] = self.servers[fstr]() return ret @@ -504,7 +502,7 @@ class Fileserver: if sources: ret = {} for fsb in back: - fstr = "{}.envs".format(fsb) + fstr = f"{fsb}.envs" kwargs = ( {"ignore_cache": True} if "ignore_cache" in _argspec(self.servers[fstr]).args @@ -534,7 +532,7 @@ class Fileserver: """ back = self.backends(back) for fsb in back: - fstr = "{}.init".format(fsb) + fstr = f"{fsb}.init" if fstr in self.servers: self.servers[fstr]() @@ -596,7 +594,7 @@ class Fileserver: saltenv = str(saltenv) for fsb in back: - fstr = "{}.find_file".format(fsb) + fstr = f"{fsb}.find_file" if fstr in self.servers: fnd = self.servers[fstr](path, saltenv, **kwargs) if fnd.get("path"): @@ -766,7 +764,7 @@ class Fileserver: load["saltenv"] = str(load["saltenv"]) for fsb in self.backends(load.pop("fsbackend", None)): - fstr = "{}.file_list".format(fsb) + fstr = f"{fsb}.file_list" if fstr in self.servers: ret.update(self.servers[fstr](load)) # some *fs do not handle prefix. Ensure it is filtered @@ -791,7 +789,7 @@ class Fileserver: load["saltenv"] = str(load["saltenv"]) for fsb in self.backends(None): - fstr = "{}.file_list_emptydirs".format(fsb) + fstr = f"{fsb}.file_list_emptydirs" if fstr in self.servers: ret.update(self.servers[fstr](load)) # some *fs do not handle prefix. Ensure it is filtered @@ -816,7 +814,7 @@ class Fileserver: load["saltenv"] = str(load["saltenv"]) for fsb in self.backends(load.pop("fsbackend", None)): - fstr = "{}.dir_list".format(fsb) + fstr = f"{fsb}.dir_list" if fstr in self.servers: ret.update(self.servers[fstr](load)) # some *fs do not handle prefix. Ensure it is filtered @@ -841,7 +839,7 @@ class Fileserver: load["saltenv"] = str(load["saltenv"]) for fsb in self.backends(load.pop("fsbackend", None)): - symlstr = "{}.symlink_list".format(fsb) + symlstr = f"{fsb}.symlink_list" if symlstr in self.servers: ret = self.servers[symlstr](load) # some *fs do not handle prefix. Ensure it is filtered diff --git a/salt/fileserver/hgfs.py b/salt/fileserver/hgfs.py index c2c9f93ac5c..48d17557886 100644 --- a/salt/fileserver/hgfs.py +++ b/salt/fileserver/hgfs.py @@ -239,7 +239,7 @@ def init(): per_remote_defaults = {} for param in PER_REMOTE_OVERRIDES: - per_remote_defaults[param] = str(__opts__["hgfs_{}".format(param)]) + per_remote_defaults[param] = str(__opts__[f"hgfs_{param}"]) for remote in __opts__["hgfs_remotes"]: repo_conf = copy.deepcopy(per_remote_defaults) @@ -355,7 +355,7 @@ def init(): with salt.utils.files.fopen(hgconfpath, "w+") as hgconfig: hgconfig.write("[paths]\n") hgconfig.write( - salt.utils.stringutils.to_str("default = {}\n".format(repo_url)) + salt.utils.stringutils.to_str(f"default = {repo_url}\n") ) repo_conf.update( @@ -365,7 +365,7 @@ def init(): "hash": repo_hash, "cachedir": rp_, "lockfile": os.path.join( - __opts__["cachedir"], "hgfs", "{}.update.lk".format(repo_hash) + __opts__["cachedir"], "hgfs", f"{repo_hash}.update.lk" ), } ) @@ -379,7 +379,7 @@ def init(): try: with salt.utils.files.fopen(remote_map, "w+") as fp_: timestamp = datetime.now().strftime("%d %b %Y %H:%M:%S.%f") - fp_.write("# hgfs_remote map as of {}\n".format(timestamp)) + fp_.write(f"# hgfs_remote map as of {timestamp}\n") for repo in repos: fp_.write( salt.utils.stringutils.to_str( @@ -444,7 +444,7 @@ def clear_cache(): try: shutil.rmtree(rdir) except OSError as exc: - errors.append("Unable to delete {}: {}".format(rdir, exc)) + errors.append(f"Unable to delete {rdir}: {exc}") return errors @@ -694,14 +694,12 @@ def find_file(path, tgt_env="base", **kwargs): # pylint: disable=W0613 dest = os.path.join(__opts__["cachedir"], "hgfs/refs", tgt_env, path) hashes_glob = os.path.join( - __opts__["cachedir"], "hgfs/hash", tgt_env, "{}.hash.*".format(path) + __opts__["cachedir"], "hgfs/hash", tgt_env, f"{path}.hash.*" ) blobshadest = os.path.join( - __opts__["cachedir"], "hgfs/hash", tgt_env, "{}.hash.blob_sha1".format(path) - ) - lk_fn = os.path.join( - __opts__["cachedir"], "hgfs/hash", tgt_env, "{}.lk".format(path) + __opts__["cachedir"], "hgfs/hash", tgt_env, f"{path}.hash.blob_sha1" ) + lk_fn = os.path.join(__opts__["cachedir"], "hgfs/hash", tgt_env, f"{path}.lk") destdir = os.path.dirname(dest) hashdir = os.path.dirname(blobshadest) if not os.path.isdir(destdir): @@ -746,7 +744,7 @@ def find_file(path, tgt_env="base", **kwargs): # pylint: disable=W0613 return fnd try: repo["repo"].cat( - [salt.utils.stringutils.to_bytes("path:{}".format(repo_path))], + [salt.utils.stringutils.to_bytes(f"path:{repo_path}")], rev=ref[2], output=dest, ) diff --git a/salt/fileserver/roots.py b/salt/fileserver/roots.py index c79da1a616b..91536d737ce 100644 --- a/salt/fileserver/roots.py +++ b/salt/fileserver/roots.py @@ -219,9 +219,7 @@ def update(): os.makedirs(mtime_map_path_dir) with salt.utils.files.fopen(mtime_map_path, "wb") as fp_: for file_path, mtime in new_mtime_map.items(): - fp_.write( - salt.utils.stringutils.to_bytes("{}:{}\n".format(file_path, mtime)) - ) + fp_.write(salt.utils.stringutils.to_bytes(f"{file_path}:{mtime}\n")) if __opts__.get("fileserver_events", False): # if there is a change, fire an event @@ -349,11 +347,11 @@ def _file_lists(load, form): return [] list_cache = os.path.join( list_cachedir, - "{}.p".format(salt.utils.files.safe_filename_leaf(actual_saltenv)), + f"{salt.utils.files.safe_filename_leaf(actual_saltenv)}.p", ) w_lock = os.path.join( list_cachedir, - ".{}.w".format(salt.utils.files.safe_filename_leaf(actual_saltenv)), + f".{salt.utils.files.safe_filename_leaf(actual_saltenv)}.w", ) cache_match, refresh_cache, save_cache = salt.fileserver.check_file_list_cache( __opts__, form, list_cache, w_lock diff --git a/salt/fileserver/svnfs.py b/salt/fileserver/svnfs.py index b8582ff716c..8e13ec99353 100644 --- a/salt/fileserver/svnfs.py +++ b/salt/fileserver/svnfs.py @@ -136,7 +136,7 @@ def init(): per_remote_defaults = {} for param in PER_REMOTE_OVERRIDES: - per_remote_defaults[param] = str(__opts__["svnfs_{}".format(param)]) + per_remote_defaults[param] = str(__opts__[f"svnfs_{param}"]) for remote in __opts__["svnfs_remotes"]: repo_conf = copy.deepcopy(per_remote_defaults) @@ -239,7 +239,7 @@ def init(): try: with salt.utils.files.fopen(remote_map, "w+") as fp_: timestamp = datetime.now().strftime("%d %b %Y %H:%M:%S.%f") - fp_.write("# svnfs_remote map as of {}\n".format(timestamp)) + fp_.write(f"# svnfs_remote map as of {timestamp}\n") for repo_conf in repos: fp_.write( salt.utils.stringutils.to_str( @@ -306,7 +306,7 @@ def clear_cache(): try: shutil.rmtree(rdir) except OSError as exc: - errors.append("Unable to delete {}: {}".format(rdir, exc)) + errors.append(f"Unable to delete {rdir}: {exc}") return errors diff --git a/salt/grains/core.py b/salt/grains/core.py index 8dbcec294a5..17a1d683eef 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -289,7 +289,7 @@ def _linux_gpu_data(): devs = [] try: - lspci_out = __salt__["cmd.run"]("{} -vmm".format(lspci)) + lspci_out = __salt__["cmd.run"](f"{lspci} -vmm") cur_dev = {} error = False @@ -363,7 +363,7 @@ def _netbsd_gpu_data(): for line in pcictl_out.splitlines(): for vendor in known_vendors: vendor_match = re.match( - r"[0-9:]+ ({}) (.+) \(VGA .+\)".format(vendor), line, re.IGNORECASE + rf"[0-9:]+ ({vendor}) (.+) \(VGA .+\)", line, re.IGNORECASE ) if vendor_match: gpus.append( @@ -425,18 +425,18 @@ def _bsd_cpudata(osdata): if sysctl: cmds.update( { - "num_cpus": "{} -n hw.ncpu".format(sysctl), - "cpuarch": "{} -n hw.machine".format(sysctl), - "cpu_model": "{} -n hw.model".format(sysctl), + "num_cpus": f"{sysctl} -n hw.ncpu", + "cpuarch": f"{sysctl} -n hw.machine", + "cpu_model": f"{sysctl} -n hw.model", } ) if arch and osdata["kernel"] == "OpenBSD": - cmds["cpuarch"] = "{} -s".format(arch) + cmds["cpuarch"] = f"{arch} -s" if osdata["kernel"] == "Darwin": - cmds["cpu_model"] = "{} -n machdep.cpu.brand_string".format(sysctl) - cmds["cpu_flags"] = "{} -n machdep.cpu.features".format(sysctl) + cmds["cpu_model"] = f"{sysctl} -n machdep.cpu.brand_string" + cmds["cpu_flags"] = f"{sysctl} -n machdep.cpu.features" grains = {k: __salt__["cmd.run"](v) for k, v in cmds.items()} @@ -521,7 +521,7 @@ def _aix_cpudata(): # pragma: no cover grains = {} cmd = salt.utils.path.which("prtconf") if cmd: - data = __salt__["cmd.run"]("{}".format(cmd)) + os.linesep + data = __salt__["cmd.run"](f"{cmd}") + os.linesep for dest, regstring in ( ("cpuarch", r"(?im)^\s*Processor\s+Type:\s+(\S+)"), ("cpu_flags", r"(?im)^\s*Processor\s+Version:\s+(\S+)"), @@ -567,9 +567,9 @@ def _osx_memdata(): sysctl = salt.utils.path.which("sysctl") if sysctl: - mem = __salt__["cmd.run"]("{} -n hw.memsize".format(sysctl)) + mem = __salt__["cmd.run"](f"{sysctl} -n hw.memsize") swap_total = ( - __salt__["cmd.run"]("{} -n vm.swapusage".format(sysctl)) + __salt__["cmd.run"](f"{sysctl} -n vm.swapusage") .split()[2] .replace(",", ".") ) @@ -594,20 +594,20 @@ def _bsd_memdata(osdata): sysctl = salt.utils.path.which("sysctl") if sysctl: - mem = __salt__["cmd.run"]("{} -n hw.physmem".format(sysctl)) + mem = __salt__["cmd.run"](f"{sysctl} -n hw.physmem") if osdata["kernel"] == "NetBSD" and mem.startswith("-"): - mem = __salt__["cmd.run"]("{} -n hw.physmem64".format(sysctl)) + mem = __salt__["cmd.run"](f"{sysctl} -n hw.physmem64") grains["mem_total"] = int(mem) // 1024 // 1024 if osdata["kernel"] in ["OpenBSD", "NetBSD"]: swapctl = salt.utils.path.which("swapctl") - swap_data = __salt__["cmd.run"]("{} -sk".format(swapctl)) + swap_data = __salt__["cmd.run"](f"{swapctl} -sk") if swap_data == "no swap devices configured": swap_total = 0 else: swap_total = swap_data.split(" ")[1] else: - swap_total = __salt__["cmd.run"]("{} -n vm.swap_total".format(sysctl)) + swap_total = __salt__["cmd.run"](f"{sysctl} -n vm.swap_total") grains["swap_total"] = int(swap_total) // 1024 // 1024 return grains @@ -625,7 +625,7 @@ def _sunos_memdata(): # pragma: no cover grains["mem_total"] = int(comps[2].strip()) swap_cmd = salt.utils.path.which("swap") - swap_data = __salt__["cmd.run"]("{} -s".format(swap_cmd)).split() + swap_data = __salt__["cmd.run"](f"{swap_cmd} -s").split() try: swap_avail = int(swap_data[-2][:-1]) swap_used = int(swap_data[-4][:-1]) @@ -653,7 +653,7 @@ def _aix_memdata(): # pragma: no cover swap_cmd = salt.utils.path.which("swap") if swap_cmd: - swap_data = __salt__["cmd.run"]("{} -s".format(swap_cmd)).split() + swap_data = __salt__["cmd.run"](f"{swap_cmd} -s").split() try: swap_total = (int(swap_data[-2]) + int(swap_data[-6])) * 4 except ValueError: @@ -706,7 +706,7 @@ def _aix_get_machine_id(): # pragma: no cover grains = {} cmd = salt.utils.path.which("lsattr") if cmd: - data = __salt__["cmd.run"]("{} -El sys0".format(cmd)) + os.linesep + data = __salt__["cmd.run"](f"{cmd} -El sys0") + os.linesep uuid_regexes = [re.compile(r"(?im)^\s*os_uuid\s+(\S+)\s+(.*)")] for regex in uuid_regexes: res = regex.search(data) @@ -1033,7 +1033,7 @@ def _virtual(osdata): subtype_cmd = "{} -c current get -H -o value {}-role".format( command, role ) - ret = __salt__["cmd.run"]("{}".format(subtype_cmd)) + ret = __salt__["cmd.run"](f"{subtype_cmd}") if ret == "true": roles.append(role) if roles: @@ -1179,14 +1179,14 @@ def _virtual(osdata): elif osdata["kernel"] == "FreeBSD": kenv = salt.utils.path.which("kenv") if kenv: - product = __salt__["cmd.run"]("{} smbios.system.product".format(kenv)) - maker = __salt__["cmd.run"]("{} smbios.system.maker".format(kenv)) + product = __salt__["cmd.run"](f"{kenv} smbios.system.product") + maker = __salt__["cmd.run"](f"{kenv} smbios.system.maker") if product.startswith("VMware"): grains["virtual"] = "VMware" if product.startswith("VirtualBox"): grains["virtual"] = "VirtualBox" if maker.startswith("Xen"): - grains["virtual_subtype"] = "{} {}".format(maker, product) + grains["virtual_subtype"] = f"{maker} {product}" grains["virtual"] = "xen" if maker.startswith("Microsoft") and product.startswith("Virtual"): grains["virtual"] = "VirtualPC" @@ -1197,9 +1197,9 @@ def _virtual(osdata): if maker.startswith("Amazon EC2"): grains["virtual"] = "Nitro" if sysctl: - hv_vendor = __salt__["cmd.run"]("{} -n hw.hv_vendor".format(sysctl)) - model = __salt__["cmd.run"]("{} -n hw.model".format(sysctl)) - jail = __salt__["cmd.run"]("{} -n security.jail.jailed".format(sysctl)) + hv_vendor = __salt__["cmd.run"](f"{sysctl} -n hw.hv_vendor") + model = __salt__["cmd.run"](f"{sysctl} -n hw.model") + jail = __salt__["cmd.run"](f"{sysctl} -n security.jail.jailed") if "bhyve" in hv_vendor: grains["virtual"] = "bhyve" elif "QEMU Virtual CPU" in model: @@ -1215,22 +1215,19 @@ def _virtual(osdata): elif osdata["kernel"] == "NetBSD": if sysctl: if "QEMU Virtual CPU" in __salt__["cmd.run"]( - "{} -n machdep.cpu_brand".format(sysctl) + f"{sysctl} -n machdep.cpu_brand" ): grains["virtual"] = "kvm" elif "invalid" not in __salt__["cmd.run"]( - "{} -n machdep.xen.suspend".format(sysctl) + f"{sysctl} -n machdep.xen.suspend" ): grains["virtual"] = "Xen PV DomU" elif "VMware" in __salt__["cmd.run"]( - "{} -n machdep.dmi.system-vendor".format(sysctl) + f"{sysctl} -n machdep.dmi.system-vendor" ): grains["virtual"] = "VMware" # NetBSD has Xen dom0 support - elif ( - __salt__["cmd.run"]("{} -n machdep.idle-mechanism".format(sysctl)) - == "xen" - ): + elif __salt__["cmd.run"](f"{sysctl} -n machdep.idle-mechanism") == "xen": if os.path.isfile("/var/run/xenconsoled.pid"): grains["virtual_subtype"] = "Xen Dom0" elif osdata["kernel"] == "SunOS": @@ -1238,7 +1235,7 @@ def _virtual(osdata): # check the zonename here as fallback zonename = salt.utils.path.which("zonename") if zonename: - zone = __salt__["cmd.run"]("{}".format(zonename)) + zone = __salt__["cmd.run"](f"{zonename}") if zone != "global": grains["virtual"] = "zone" @@ -1267,7 +1264,7 @@ def _virtual(osdata): r".*Product Name: ([^\r\n]*).*", output, flags=re.DOTALL ) if product: - grains["virtual_subtype"] = "Amazon EC2 ({})".format(product[1]) + grains["virtual_subtype"] = f"Amazon EC2 ({product[1]})" elif re.match(r".*Version: [^\r\n]+\.amazon.*", output, flags=re.DOTALL): grains["virtual_subtype"] = "Amazon EC2" @@ -1299,9 +1296,7 @@ def _virtual_hv(osdata): try: version = {} for fn in ("major", "minor", "extra"): - with salt.utils.files.fopen( - "/sys/hypervisor/version/{}".format(fn), "r" - ) as fhr: + with salt.utils.files.fopen(f"/sys/hypervisor/version/{fn}", "r") as fhr: version[fn] = salt.utils.stringutils.to_unicode(fhr.read().strip()) grains["virtual_hv_version"] = "{}.{}{}".format( version["major"], version["minor"], version["extra"] @@ -1457,7 +1452,7 @@ def _windows_os_release_grain(caption, product_type): # ie: R2 if re.match(r"^R\d+$", item): release = item - os_release = "{}Server{}".format(version, release) + os_release = f"{version}Server{release}" else: for item in caption.split(" "): # If it's a number, decimal number, Thin or Vista, then it's the @@ -1703,7 +1698,7 @@ def _linux_devicetree_platform_data(): try: # /proc/device-tree should be used instead of /sys/firmware/devicetree/base # see https://github.com/torvalds/linux/blob/v5.13/Documentation/ABI/testing/sysfs-firmware-ofw#L14 - loc = "/proc/device-tree/{}".format(path) + loc = f"/proc/device-tree/{path}" if os.path.isfile(loc): with salt.utils.files.fopen(loc, mode="r") as f: return f.read().rstrip("\x00") # all strings are null-terminated @@ -1942,18 +1937,13 @@ def _linux_bin_exists(binary): """ for search_cmd in ("which", "type -ap"): try: - return __salt__["cmd.retcode"]("{} {}".format(search_cmd, binary)) == 0 + return __salt__["cmd.retcode"](f"{search_cmd} {binary}") == 0 except salt.exceptions.CommandExecutionError: pass try: return ( - len( - __salt__["cmd.run_all"]("whereis -b {}".format(binary))[ - "stdout" - ].split() - ) - > 1 + len(__salt__["cmd.run_all"](f"whereis -b {binary}")["stdout"].split()) > 1 ) except salt.exceptions.CommandExecutionError: return False @@ -1971,7 +1961,7 @@ def _parse_lsb_release(): pass else: # Adds lsb_distrib_{id,release,codename,description} - ret["lsb_{}".format(key.lower())] = value.rstrip() + ret[f"lsb_{key.lower()}"] = value.rstrip() except OSError as exc: log.trace("Failed to parse /etc/lsb-release: %s", exc) return ret @@ -2716,7 +2706,7 @@ def os_data(): osbuild = __salt__["cmd.run"]("sw_vers -buildVersion") grains["os"] = "MacOS" grains["os_family"] = "MacOS" - grains["osfullname"] = "{} {}".format(osname, osrelease) + grains["osfullname"] = f"{osname} {osrelease}" grains["osrelease"] = osrelease grains["osbuild"] = osbuild grains["init"] = "launchd" @@ -3257,7 +3247,7 @@ def _hw_data(osdata): "productname": "DeviceDesc", } for grain_name, cmd_key in hwdata.items(): - result = __salt__["cmd.run_all"]("fw_printenv {}".format(cmd_key)) + result = __salt__["cmd.run_all"](f"fw_printenv {cmd_key}") if result["retcode"] == 0: uboot_keyval = result["stdout"].split("=") grains[grain_name] = _clean_value(grain_name, uboot_keyval[1]) @@ -3277,7 +3267,7 @@ def _hw_data(osdata): "uuid": "smbios.system.uuid", } for key, val in fbsd_hwdata.items(): - value = __salt__["cmd.run"]("{} {}".format(kenv, val)) + value = __salt__["cmd.run"](f"{kenv} {val}") grains[key] = _clean_value(key, value) elif osdata["kernel"] == "OpenBSD": sysctl = salt.utils.path.which("sysctl") @@ -3289,7 +3279,7 @@ def _hw_data(osdata): "uuid": "hw.uuid", } for key, oid in hwdata.items(): - value = __salt__["cmd.run"]("{} -n {}".format(sysctl, oid)) + value = __salt__["cmd.run"](f"{sysctl} -n {oid}") if not value.endswith(" value is not available"): grains[key] = _clean_value(key, value) elif osdata["kernel"] == "NetBSD": @@ -3304,7 +3294,7 @@ def _hw_data(osdata): "uuid": "machdep.dmi.system-uuid", } for key, oid in nbsd_hwdata.items(): - result = __salt__["cmd.run_all"]("{} -n {}".format(sysctl, oid)) + result = __salt__["cmd.run_all"](f"{sysctl} -n {oid}") if result["retcode"] == 0: grains[key] = _clean_value(key, result["stdout"]) elif osdata["kernel"] == "Darwin": @@ -3312,7 +3302,7 @@ def _hw_data(osdata): sysctl = salt.utils.path.which("sysctl") hwdata = {"productname": "hw.model"} for key, oid in hwdata.items(): - value = __salt__["cmd.run"]("{} -b {}".format(sysctl, oid)) + value = __salt__["cmd.run"](f"{sysctl} -b {oid}") if not value.endswith(" is invalid"): grains[key] = _clean_value(key, value) elif osdata["kernel"] == "SunOS" and osdata["cpuarch"].startswith("sparc"): @@ -3326,7 +3316,7 @@ def _hw_data(osdata): ("/usr/sbin/virtinfo", "-a"), ): if salt.utils.path.which(cmd): # Also verifies that cmd is executable - data += __salt__["cmd.run"]("{} {}".format(cmd, args)) + data += __salt__["cmd.run"](f"{cmd} {args}") data += "\n" sn_regexes = [ @@ -3441,7 +3431,7 @@ def _hw_data(osdata): elif osdata["kernel"] == "AIX": cmd = salt.utils.path.which("prtconf") if cmd: - data = __salt__["cmd.run"]("{}".format(cmd)) + os.linesep + data = __salt__["cmd.run"](f"{cmd}") + os.linesep for dest, regstring in ( ("serialnumber", r"(?im)^\s*Machine\s+Serial\s+Number:\s+(\S+)"), ("systemfirmware", r"(?im)^\s*Firmware\s+Version:\s+(.*)"), @@ -3523,14 +3513,14 @@ def default_gateway(): for line in out.splitlines(): if line.startswith("default"): grains["ip_gw"] = True - grains["ip{}_gw".format(ip_version)] = True + grains[f"ip{ip_version}_gw"] = True try: via, gw_ip = line.split()[1:3] except ValueError: pass else: if via == "via": - grains["ip{}_gw".format(ip_version)] = gw_ip + grains[f"ip{ip_version}_gw"] = gw_ip break except Exception: # pylint: disable=broad-except continue diff --git a/salt/grains/disks.py b/salt/grains/disks.py index 1dfbeb737bb..f61ad6d6b34 100644 --- a/salt/grains/disks.py +++ b/salt/grains/disks.py @@ -91,14 +91,14 @@ def _freebsd_geom(): geom = salt.utils.path.which("geom") ret = {"disks": {}, "ssds": []} - devices = __salt__["cmd.run"]("{} disk list".format(geom)) + devices = __salt__["cmd.run"](f"{geom} disk list") devices = devices.split("\n\n") def parse_geom_attribs(device): tmp = {} for line in device.split("\n"): for attrib in _geom_attribs: - search = re.search(r"{}:\s(.*)".format(attrib), line) + search = re.search(rf"{attrib}:\s(.*)", line) if search: value = _datavalue( _geomconsts._datatypes.get(attrib), search.group(1) @@ -174,7 +174,7 @@ def _windows_disks(): info = line.split() if len(info) != 2 or not info[0].isdigit() or not info[1].isdigit(): continue - device = r"\\.\PhysicalDrive{}".format(info[0]) + device = rf"\\.\PhysicalDrive{info[0]}" mediatype = info[1] if mediatype == "3": log.trace("Device %s reports itself as an HDD", device) diff --git a/salt/grains/lvm.py b/salt/grains/lvm.py index 586b187ddb9..bb08de96e8b 100644 --- a/salt/grains/lvm.py +++ b/salt/grains/lvm.py @@ -33,14 +33,12 @@ def _linux_lvm(): ret = {} cmd = salt.utils.path.which("lvm") if cmd: - vgs = __salt__["cmd.run_all"]("{} vgs -o vg_name --noheadings".format(cmd)) + vgs = __salt__["cmd.run_all"](f"{cmd} vgs -o vg_name --noheadings") for vg in vgs["stdout"].splitlines(): vg = vg.strip() ret[vg] = [] - lvs = __salt__["cmd.run_all"]( - "{} lvs -o lv_name --noheadings {}".format(cmd, vg) - ) + lvs = __salt__["cmd.run_all"](f"{cmd} lvs -o lv_name --noheadings {vg}") for lv in lvs["stdout"].splitlines(): ret[vg].append(lv.strip()) @@ -52,11 +50,11 @@ def _linux_lvm(): def _aix_lvm(): ret = {} cmd = salt.utils.path.which("lsvg") - vgs = __salt__["cmd.run"]("{}".format(cmd)) + vgs = __salt__["cmd.run"](f"{cmd}") for vg in vgs.splitlines(): ret[vg] = [] - lvs = __salt__["cmd.run"]("{} -l {}".format(cmd, vg)) + lvs = __salt__["cmd.run"](f"{cmd} -l {vg}") for lvline in lvs.splitlines()[2:]: lv = lvline.split(" ", 1)[0] ret[vg].append(lv) diff --git a/salt/grains/mdata.py b/salt/grains/mdata.py index fe88f6ce2a6..009853bb7a3 100644 --- a/salt/grains/mdata.py +++ b/salt/grains/mdata.py @@ -62,7 +62,7 @@ def _user_mdata(mdata_list=None, mdata_get=None): log.warning("mdata-list returned an error, skipping mdata grains.") continue mdata_value = __salt__["cmd.run"]( - "{} {}".format(mdata_get, mdata_grain), ignore_retcode=True + f"{mdata_get} {mdata_grain}", ignore_retcode=True ) if not mdata_grain.startswith("sdc:"): @@ -108,7 +108,7 @@ def _sdc_mdata(mdata_list=None, mdata_get=None): for mdata_grain in sdc_text_keys + sdc_json_keys: mdata_value = __salt__["cmd.run"]( - "{} sdc:{}".format(mdata_get, mdata_grain), ignore_retcode=True + f"{mdata_get} sdc:{mdata_grain}", ignore_retcode=True ) if mdata_value.startswith("ERROR:"): log.warning( diff --git a/salt/grains/metadata.py b/salt/grains/metadata.py index d1dcd41643b..62166330472 100644 --- a/salt/grains/metadata.py +++ b/salt/grains/metadata.py @@ -24,7 +24,7 @@ import salt.utils.stringutils # metadata server information IP = "169.254.169.254" -HOST = "http://{}/".format(IP) +HOST = f"http://{IP}/" def __virtual__(): diff --git a/salt/key.py b/salt/key.py index b15b80eca3f..c2f0d97991c 100644 --- a/salt/key.py +++ b/salt/key.py @@ -177,7 +177,7 @@ class KeyCLI: if cmd in ("accept", "reject", "delete") and args is None: args = self.opts.get("match_dict", {}).get("minions") - fstr = "key.{}".format(cmd) + fstr = f"key.{cmd}" fun = self.client.functions[fstr] args, kwargs = self._get_args_kwargs(fun, args) @@ -230,7 +230,7 @@ class KeyCLI: stat_str = statuses[0] else: stat_str = "{} or {}".format(", ".join(statuses[:-1]), statuses[-1]) - msg = "The key glob '{}' does not match any {} keys.".format(match, stat_str) + msg = f"The key glob '{match}' does not match any {stat_str} keys." print(msg) def run(self): @@ -291,7 +291,7 @@ class KeyCLI: else: salt.output.display_output({"return": ret}, "key", opts=self.opts) except salt.exceptions.SaltException as exc: - ret = "{}".format(exc) + ret = f"{exc}" if not self.opts.get("quiet", False): salt.output.display_output(ret, "nested", self.opts) return ret @@ -311,7 +311,7 @@ class Key: self.opts = opts kind = self.opts.get("__role", "") # application kind if kind not in salt.utils.kinds.APPL_KINDS: - emsg = "Invalid application kind = '{}'.".format(kind) + emsg = f"Invalid application kind = '{kind}'." log.error(emsg) raise ValueError(emsg) self.event = salt.utils.event.get_event( @@ -377,7 +377,7 @@ class Key: # check given pub-key if pub: if not os.path.isfile(pub): - return "Public-key {} does not exist".format(pub) + return f"Public-key {pub} does not exist" # default to master.pub else: mpub = self.opts["pki_dir"] + "/" + "master.pub" @@ -387,7 +387,7 @@ class Key: # check given priv-key if priv: if not os.path.isfile(priv): - return "Private-key {} does not exist".format(priv) + return f"Private-key {priv} does not exist" # default to master_sign.pem else: mpriv = self.opts["pki_dir"] + "/" + "master_sign.pem" @@ -467,7 +467,7 @@ class Key: if clist: for minion in clist: if minion not in minions and minion not in preserve_minions: - cache.flush("{}/{}".format(self.ACC, minion)) + cache.flush(f"{self.ACC}/{minion}") def check_master(self): """ @@ -663,7 +663,7 @@ class Key: pass for keydir, key in invalid_keys: matches[keydir].remove(key) - sys.stderr.write("Unable to accept invalid key for {}.\n".format(key)) + sys.stderr.write(f"Unable to accept invalid key for {key}.\n") return self.name_match(match) if match is not None else self.dict_match(matches) def accept_all(self): diff --git a/salt/loader/__init__.py b/salt/loader/__init__.py index 388742589a6..160fe8e60d0 100644 --- a/salt/loader/__init__.py +++ b/salt/loader/__init__.py @@ -146,7 +146,7 @@ def _module_dirs( ext_type_types = [] if ext_dirs: if ext_type_dirs is None: - ext_type_dirs = "{}_dirs".format(tag) + ext_type_dirs = f"{tag}_dirs" if ext_type_dirs in opts: ext_type_types.extend(opts[ext_type_dirs]) if ext_type_dirs and load_extensions is True: @@ -246,7 +246,7 @@ def _module_dirs( cli_module_dirs.insert(0, maybe_dir) continue - maybe_dir = os.path.join(_dir, "_{}".format(ext_type)) + maybe_dir = os.path.join(_dir, f"_{ext_type}") if os.path.isdir(maybe_dir): cli_module_dirs.insert(0, maybe_dir) @@ -1246,7 +1246,7 @@ def grains(opts, force_refresh=False, proxy=None, context=None, loaded_base_name import salt.modules.cmdmod # Make sure cache file isn't read-only - salt.modules.cmdmod._run_quiet('attrib -R "{}"'.format(cfn)) + salt.modules.cmdmod._run_quiet(f'attrib -R "{cfn}"') with salt.utils.files.fopen(cfn, "w+b") as fp_: try: salt.payload.dump(grains_data, fp_) diff --git a/salt/loader/lazy.py b/salt/loader/lazy.py index f077d245248..a3b795a3757 100644 --- a/salt/loader/lazy.py +++ b/salt/loader/lazy.py @@ -162,7 +162,7 @@ class LoadedFunc: return ret def __repr__(self): - return "<{} name={!r}>".format(self.__class__.__name__, self.name) + return f"<{self.__class__.__name__} name={self.name!r}>" class LoadedMod: @@ -185,10 +185,10 @@ class LoadedMod: Run the wrapped function in the loader's context. """ try: - return self.loader["{}.{}".format(self.mod, name)] + return self.loader[f"{self.mod}.{name}"] except KeyError: raise AttributeError( - "No attribute by the name of {} was found on {}".format(name, self.mod) + f"No attribute by the name of {name} was found on {self.mod}" ) def __repr__(self): @@ -328,10 +328,10 @@ class LazyLoader(salt.utils.lazy.LazyDict): super().__init__() # late init the lazy loader # create all of the import namespaces - _generate_module("{}.int".format(self.loaded_base_name)) - _generate_module("{}.int.{}".format(self.loaded_base_name, tag)) - _generate_module("{}.ext".format(self.loaded_base_name)) - _generate_module("{}.ext.{}".format(self.loaded_base_name, tag)) + _generate_module(f"{self.loaded_base_name}.int") + _generate_module(f"{self.loaded_base_name}.int.{tag}") + _generate_module(f"{self.loaded_base_name}.ext") + _generate_module(f"{self.loaded_base_name}.ext.{tag}") def clean_modules(self): """ @@ -389,19 +389,19 @@ class LazyLoader(salt.utils.lazy.LazyDict): """ mod_name = function_name.split(".")[0] if mod_name in self.loaded_modules: - return "'{}' is not available.".format(function_name) + return f"'{function_name}' is not available." else: try: reason = self.missing_modules[mod_name] except KeyError: - return "'{}' is not available.".format(function_name) + return f"'{function_name}' is not available." else: if reason is not None: return "'{}' __virtual__ returned False: {}".format( mod_name, reason ) else: - return "'{}' __virtual__ returned False".format(mod_name) + return f"'{mod_name}' __virtual__ returned False" def _refresh_file_mapping(self): """ @@ -514,7 +514,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): for suffix in self.suffix_order: if "" == suffix: continue # Next suffix (__init__ must have a suffix) - init_file = "__init__{}".format(suffix) + init_file = f"__init__{suffix}" if init_file in subfiles: break else: @@ -1013,7 +1013,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): try: full_funcname = ".".join((tgt_mod, funcname)) except TypeError: - full_funcname = "{}.{}".format(tgt_mod, funcname) + full_funcname = f"{tgt_mod}.{funcname}" # Save many references for lookups # Careful not to overwrite existing (higher priority) functions if full_funcname not in self._dict: @@ -1040,7 +1040,7 @@ class LazyLoader(salt.utils.lazy.LazyDict): if not isinstance(key, str): raise KeyError("The key must be a string.") if "." not in key: - raise KeyError("The key '{}' should contain a '.'".format(key)) + raise KeyError(f"The key '{key}' should contain a '.'") mod_name, _ = key.split(".", 1) with self._lock: # It is possible that the key is in the dictionary after diff --git a/salt/log_handlers/fluent_mod.py b/salt/log_handlers/fluent_mod.py index 1086a926158..a23544ff871 100644 --- a/salt/log_handlers/fluent_mod.py +++ b/salt/log_handlers/fluent_mod.py @@ -181,7 +181,7 @@ class MessageFormatter(logging.Formatter): self.tags = tags self.msg_path = msg_path if msg_path else payload_type self.msg_type = msg_type if msg_type else payload_type - format_func = "format_{}_v{}".format(payload_type, version).replace(".", "_") + format_func = f"format_{payload_type}_v{version}".replace(".", "_") self.format = getattr(self, format_func) super().__init__(fmt=None, datefmt=None) @@ -236,7 +236,7 @@ class MessageFormatter(logging.Formatter): val = value else: val = repr(value) - message_dict.update({"{}".format(key): val}) + message_dict.update({f"{key}": val}) return message_dict def format_gelf_v1_1(self, record): @@ -286,7 +286,7 @@ class MessageFormatter(logging.Formatter): else: val = repr(value) # GELF spec require "non-standard" fields to be prefixed with '_' (underscore). - message_dict.update({"_{}".format(key): val}) + message_dict.update({f"_{key}": val}) return message_dict @@ -308,7 +308,7 @@ class MessageFormatter(logging.Formatter): "processName": record.processName, }, "@message": record.getMessage(), - "@source": "{}://{}/{}".format(self.msg_type, host, self.msg_path), + "@source": f"{self.msg_type}://{host}/{self.msg_path}", "@source_host": host, "@source_path": self.msg_path, "@tags": self.tags, diff --git a/salt/log_handlers/logstash_mod.py b/salt/log_handlers/logstash_mod.py index dcc54f5a68e..b3e30f83a99 100644 --- a/salt/log_handlers/logstash_mod.py +++ b/salt/log_handlers/logstash_mod.py @@ -265,7 +265,7 @@ class LogstashFormatter(logging.Formatter): self.msg_path = msg_path self.msg_type = msg_type self.version = version - self.format = getattr(self, "format_v{}".format(version)) + self.format = getattr(self, f"format_v{version}") super().__init__(fmt=None, datefmt=None) def formatTime(self, record, datefmt=None): @@ -286,7 +286,7 @@ class LogstashFormatter(logging.Formatter): "processName": record.processName, }, "@message": record.getMessage(), - "@source": "{}://{}/{}".format(self.msg_type, host, self.msg_path), + "@source": f"{self.msg_type}://{host}/{self.msg_path}", "@source_host": host, "@source_path": self.msg_path, "@tags": ["salt"], diff --git a/salt/log_handlers/sentry_mod.py b/salt/log_handlers/sentry_mod.py index c3a6209b1f1..a12366f9fcb 100644 --- a/salt/log_handlers/sentry_mod.py +++ b/salt/log_handlers/sentry_mod.py @@ -140,7 +140,7 @@ def setup_handlers(): transport_registry = TransportRegistry(default_transports) url = urlparse(dsn) if not transport_registry.supported_scheme(url.scheme): - raise ValueError("Unsupported Sentry DSN scheme: {}".format(url.scheme)) + raise ValueError(f"Unsupported Sentry DSN scheme: {url.scheme}") except ValueError as exc: log.info("Raven failed to parse the configuration provided DSN: %s", exc) diff --git a/salt/master.py b/salt/master.py index caea839427c..58386ff9db7 100644 --- a/salt/master.py +++ b/salt/master.py @@ -160,7 +160,7 @@ class SMaster: if "serial" in secret_map: secret_map["serial"].value = 0 if event: - event.fire_event({"rotate_{}_key".format(secret_key): True}, tag="key") + event.fire_event({f"rotate_{secret_key}_key": True}, tag="key") if opts.get("ping_on_rotate"): # Ping all minions to get them to pick up the new key @@ -401,7 +401,7 @@ class FileserverUpdate(salt.utils.process.SignalHandlingProcess): update_intervals = self.fileserver.update_intervals() self.buckets = {} for backend in self.fileserver.backends(): - fstr = "{}.update".format(backend) + fstr = f"{backend}.update" try: update_func = self.fileserver.servers[fstr] except KeyError: @@ -431,7 +431,7 @@ class FileserverUpdate(salt.utils.process.SignalHandlingProcess): # nothing to pass to the backend's update func, so we'll just # set the value to None. try: - interval_key = "{}_update_interval".format(backend) + interval_key = f"{backend}_update_interval" interval = self.opts[interval_key] except KeyError: interval = DEFAULT_INTERVAL @@ -608,7 +608,7 @@ class Master(SMaster): try: os.chdir("/") except OSError as err: - errors.append("Cannot change to root directory ({})".format(err)) + errors.append(f"Cannot change to root directory ({err})") if self.opts.get("fileserver_verify_config", True): # Avoid circular import @@ -626,7 +626,7 @@ class Master(SMaster): try: fileserver.init() except salt.exceptions.FileserverConfigError as exc: - critical_errors.append("{}".format(exc)) + critical_errors.append(f"{exc}") if not self.opts["fileserver_backend"]: errors.append("No fileserver backends are configured") @@ -773,7 +773,7 @@ class Master(SMaster): cls = _tmp.__getattribute__( # pylint: disable=unnecessary-dunder-call cls ) - name = "ExtProcess({})".format(cls.__qualname__) + name = f"ExtProcess({cls.__qualname__})" self.process_manager.add_process(cls, args=(self.opts,), name=name) except Exception: # pylint: disable=broad-except log.error("Error creating ext_processes process: %s", proc) @@ -913,7 +913,7 @@ class ReqServer(salt.utils.process.SignalHandlingProcess): # signal handlers with salt.utils.process.default_signals(signal.SIGINT, signal.SIGTERM): for ind in range(int(self.opts["worker_threads"])): - name = "MWorker-{}".format(ind) + name = f"MWorker-{ind}" self.process_manager.add_process( MWorker, args=(self.opts, self.master_key, self.key, req_channels), @@ -2123,7 +2123,7 @@ class ClearFuncs(TransportMethods): fun = clear_load.pop("fun") tag = tagify(jid, prefix="wheel") data = { - "fun": "wheel.{}".format(fun), + "fun": f"wheel.{fun}", "jid": jid, "tag": tag, "user": username, @@ -2226,7 +2226,7 @@ class ClearFuncs(TransportMethods): else: auth_list = auth_check.get("auth_list", []) - err_msg = 'Authentication failure of type "{}" occurred.'.format(auth_type) + err_msg = f'Authentication failure of type "{auth_type}" occurred.' if auth_check.get("error"): # Authentication error occurred: do not continue. diff --git a/salt/matchers/compound_match.py b/salt/matchers/compound_match.py index 2bce58f117a..04da7281e3e 100644 --- a/salt/matchers/compound_match.py +++ b/salt/matchers/compound_match.py @@ -111,7 +111,7 @@ def match(tgt, opts=None, minion_id=None): results.append( str( - __context__["matchers"]["{}_match.match".format(engine)]( + __context__["matchers"][f"{engine}_match.match"]( *engine_args, **engine_kwargs ) ) diff --git a/salt/matchers/ipcidr_match.py b/salt/matchers/ipcidr_match.py index 175dade0024..8cfbf4d3332 100644 --- a/salt/matchers/ipcidr_match.py +++ b/salt/matchers/ipcidr_match.py @@ -27,7 +27,7 @@ def match(tgt, opts=None, minion_id=None): except: # pylint: disable=bare-except log.error("Invalid IP/CIDR target: %s", tgt) return [] - proto = "ipv{}".format(tgt.version) + proto = f"ipv{tgt.version}" grains = opts["grains"] diff --git a/salt/matchers/list_match.py b/salt/matchers/list_match.py index 5b790666ee3..91520cbb13d 100644 --- a/salt/matchers/list_match.py +++ b/salt/matchers/list_match.py @@ -19,7 +19,7 @@ def match(tgt, opts=None, minion_id=None): try: if ( - ",{},".format(minion_id) in tgt + f",{minion_id}," in tgt or tgt.startswith(minion_id + ",") or tgt.endswith("," + minion_id) ): diff --git a/salt/metaproxy/deltaproxy.py b/salt/metaproxy/deltaproxy.py index 82c3c12598c..f77ccdcbd34 100644 --- a/salt/metaproxy/deltaproxy.py +++ b/salt/metaproxy/deltaproxy.py @@ -168,8 +168,8 @@ def post_master_init(self, master): salt.engines.start_engines, self.opts, self.process_manager, proxy=self.proxy ) - proxy_init_func_name = "{}.init".format(fq_proxyname) - proxy_shutdown_func_name = "{}.shutdown".format(fq_proxyname) + proxy_init_func_name = f"{fq_proxyname}.init" + proxy_shutdown_func_name = f"{fq_proxyname}.shutdown" if ( proxy_init_func_name not in self.proxy or proxy_shutdown_func_name not in self.proxy @@ -183,7 +183,7 @@ def post_master_init(self, master): raise SaltSystemExit(code=-1, msg=errmsg) self.module_executors = self.proxy.get( - "{}.module_executors".format(fq_proxyname), lambda: [] + f"{fq_proxyname}.module_executors", lambda: [] )() proxy_init_fn = self.proxy[proxy_init_func_name] proxy_init_fn(self.opts) @@ -626,7 +626,7 @@ def thread_return(cls, minion_instance, opts, data): # Reconfigure multiprocessing logging after daemonizing salt._logging.setup_logging() - salt.utils.process.appendproctitle("{}._thread_return".format(cls.__name__)) + salt.utils.process.appendproctitle(f"{cls.__name__}._thread_return") sdata = {"pid": os.getpid()} sdata.update(data) @@ -642,11 +642,9 @@ def thread_return(cls, minion_instance, opts, data): ) allow_missing_funcs = any( [ - minion_instance.executors["{}.allow_missing_func".format(executor)]( - function_name - ) + minion_instance.executors[f"{executor}.allow_missing_func"](function_name) for executor in executors - if "{}.allow_missing_func".format(executor) in minion_instance.executors + if f"{executor}.allow_missing_func" in minion_instance.executors ] ) if function_name in minion_instance.functions or allow_missing_funcs is True: @@ -703,11 +701,9 @@ def thread_return(cls, minion_instance, opts, data): log.debug("Executors list %s", executors) for name in executors: - fname = "{}.execute".format(name) + fname = f"{name}.execute" if fname not in minion_instance.executors: - raise SaltInvocationError( - "Executor '{}' is not available".format(name) - ) + raise SaltInvocationError(f"Executor '{name}' is not available") return_data = minion_instance.executors[fname]( opts, data, func, args, kwargs @@ -752,9 +748,9 @@ def thread_return(cls, minion_instance, opts, data): ret["retcode"] = retcode ret["success"] = retcode == salt.defaults.exitcodes.EX_OK except CommandNotFoundError as exc: - msg = 'Command required for "{}" not found'.format(function_name) + msg = f'Command required for "{function_name}" not found' log.debug(msg, exc_info=True) - ret["return"] = "{}: {}".format(msg, exc) + ret["return"] = f"{msg}: {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except CommandExecutionError as exc: @@ -764,7 +760,7 @@ def thread_return(cls, minion_instance, opts, data): exc, exc_info_on_loglevel=logging.DEBUG, ) - ret["return"] = "ERROR: {}".format(exc) + ret["return"] = f"ERROR: {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except SaltInvocationError as exc: @@ -774,7 +770,7 @@ def thread_return(cls, minion_instance, opts, data): exc, exc_info_on_loglevel=logging.DEBUG, ) - ret["return"] = 'ERROR executing "{}": {}'.format(function_name, exc) + ret["return"] = f'ERROR executing "{function_name}": {exc}' ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except TypeError as exc: @@ -791,11 +787,11 @@ def thread_return(cls, minion_instance, opts, data): salt.utils.error.fire_exception( salt.exceptions.MinionError(msg), opts, job=data ) - ret["return"] = "{}: {}".format(msg, traceback.format_exc()) + ret["return"] = f"{msg}: {traceback.format_exc()}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC else: - docs = minion_instance.functions["sys.doc"]("{}*".format(function_name)) + docs = minion_instance.functions["sys.doc"](f"{function_name}*") if docs: docs[function_name] = minion_instance.functions.missing_fun_string( function_name @@ -842,7 +838,7 @@ def thread_return(cls, minion_instance, opts, data): ret["id"] = opts["id"] for returner in set(data["ret"].split(",")): try: - returner_str = "{}.returner".format(returner) + returner_str = f"{returner}.returner" if returner_str in minion_instance.returners: minion_instance.returners[returner_str](ret) else: @@ -874,7 +870,7 @@ def thread_multi_return(cls, minion_instance, opts, data): # Reconfigure multiprocessing logging after daemonizing salt._logging.setup_logging() - salt.utils.process.appendproctitle("{}._thread_multi_return".format(cls.__name__)) + salt.utils.process.appendproctitle(f"{cls.__name__}._thread_multi_return") sdata = {"pid": os.getpid()} sdata.update(data) @@ -972,7 +968,7 @@ def thread_multi_return(cls, minion_instance, opts, data): for returner in set(data["ret"].split(",")): ret["id"] = opts["id"] try: - minion_instance.returners["{}.returner".format(returner)](ret) + minion_instance.returners[f"{returner}.returner"](ret) except Exception as exc: # pylint: disable=broad-except log.error("The return failed for job %s: %s", data["jid"], exc) diff --git a/salt/metaproxy/proxy.py b/salt/metaproxy/proxy.py index 04d4c02c75a..a9d51bb1958 100644 --- a/salt/metaproxy/proxy.py +++ b/salt/metaproxy/proxy.py @@ -166,8 +166,8 @@ def post_master_init(self, master): ) if ( - "{}.init".format(fq_proxyname) not in self.proxy - or "{}.shutdown".format(fq_proxyname) not in self.proxy + f"{fq_proxyname}.init" not in self.proxy + or f"{fq_proxyname}.shutdown" not in self.proxy ): errmsg = ( "Proxymodule {} is missing an init() or a shutdown() or both. ".format( @@ -180,7 +180,7 @@ def post_master_init(self, master): raise SaltSystemExit(code=-1, msg=errmsg) self.module_executors = self.proxy.get( - "{}.module_executors".format(fq_proxyname), lambda: [] + f"{fq_proxyname}.module_executors", lambda: [] )() proxy_init_fn = self.proxy[fq_proxyname + ".init"] proxy_init_fn(self.opts) @@ -375,7 +375,7 @@ def target(cls, minion_instance, opts, data, connected, creds_map): fq_proxyname = opts["proxy"]["proxytype"] minion_instance.module_executors = minion_instance.proxy.get( - "{}.module_executors".format(fq_proxyname), lambda: [] + f"{fq_proxyname}.module_executors", lambda: [] )() proxy_init_fn = minion_instance.proxy[fq_proxyname + ".init"] @@ -418,11 +418,9 @@ def thread_return(cls, minion_instance, opts, data): ) allow_missing_funcs = any( [ - minion_instance.executors["{}.allow_missing_func".format(executor)]( - function_name - ) + minion_instance.executors[f"{executor}.allow_missing_func"](function_name) for executor in executors - if "{}.allow_missing_func".format(executor) in minion_instance.executors + if f"{executor}.allow_missing_func" in minion_instance.executors ] ) if function_name in minion_instance.functions or allow_missing_funcs is True: @@ -477,11 +475,9 @@ def thread_return(cls, minion_instance, opts, data): log.trace("Executors list %s", executors) # pylint: disable=no-member for name in executors: - fname = "{}.execute".format(name) + fname = f"{name}.execute" if fname not in minion_instance.executors: - raise SaltInvocationError( - "Executor '{}' is not available".format(name) - ) + raise SaltInvocationError(f"Executor '{name}' is not available") return_data = minion_instance.executors[fname]( opts, data, func, args, kwargs ) @@ -525,9 +521,9 @@ def thread_return(cls, minion_instance, opts, data): ret["retcode"] = retcode ret["success"] = retcode == salt.defaults.exitcodes.EX_OK except CommandNotFoundError as exc: - msg = "Command required for '{}' not found".format(function_name) + msg = f"Command required for '{function_name}' not found" log.debug(msg, exc_info=True) - ret["return"] = "{}: {}".format(msg, exc) + ret["return"] = f"{msg}: {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except CommandExecutionError as exc: @@ -537,7 +533,7 @@ def thread_return(cls, minion_instance, opts, data): exc, exc_info_on_loglevel=logging.DEBUG, ) - ret["return"] = "ERROR: {}".format(exc) + ret["return"] = f"ERROR: {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except SaltInvocationError as exc: @@ -547,7 +543,7 @@ def thread_return(cls, minion_instance, opts, data): exc, exc_info_on_loglevel=logging.DEBUG, ) - ret["return"] = "ERROR executing '{}': {}".format(function_name, exc) + ret["return"] = f"ERROR executing '{function_name}': {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except TypeError as exc: @@ -564,11 +560,11 @@ def thread_return(cls, minion_instance, opts, data): salt.utils.error.fire_exception( salt.exceptions.MinionError(msg), opts, job=data ) - ret["return"] = "{}: {}".format(msg, traceback.format_exc()) + ret["return"] = f"{msg}: {traceback.format_exc()}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC else: - docs = minion_instance.functions["sys.doc"]("{}*".format(function_name)) + docs = minion_instance.functions["sys.doc"](f"{function_name}*") if docs: docs[function_name] = minion_instance.functions.missing_fun_string( function_name @@ -616,7 +612,7 @@ def thread_return(cls, minion_instance, opts, data): ret["id"] = opts["id"] for returner in set(data["ret"].split(",")): try: - returner_str = "{}.returner".format(returner) + returner_str = f"{returner}.returner" if returner_str in minion_instance.returners: minion_instance.returners[returner_str](ret) else: @@ -739,7 +735,7 @@ def thread_multi_return(cls, minion_instance, opts, data): for returner in set(data["ret"].split(",")): ret["id"] = opts["id"] try: - minion_instance.returners["{}.returner".format(returner)](ret) + minion_instance.returners[f"{returner}.returner"](ret) except Exception as exc: # pylint: disable=broad-except log.error("The return failed for job %s: %s", data["jid"], exc) diff --git a/salt/minion.py b/salt/minion.py index 61965b70aed..e6a9521766a 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -341,7 +341,7 @@ def load_args_and_kwargs(func, args, data=None, ignore_invalid=False): # **kwargs not in argspec and parsed argument name not in # list of positional arguments. This keyword argument is # invalid. - invalid_kwargs.append("{}={}".format(key, val)) + invalid_kwargs.append(f"{key}={val}") continue else: @@ -358,7 +358,7 @@ def load_args_and_kwargs(func, args, data=None, ignore_invalid=False): # list of positional arguments. This keyword argument is # invalid. for key, val in string_kwarg.items(): - invalid_kwargs.append("{}={}".format(key, val)) + invalid_kwargs.append(f"{key}={val}") else: _args.append(arg) @@ -368,7 +368,7 @@ def load_args_and_kwargs(func, args, data=None, ignore_invalid=False): if argspec.keywords and isinstance(data, dict): # this function accepts **kwargs, pack in the publish data for key, val in data.items(): - _kwargs["__pub_{}".format(key)] = val + _kwargs[f"__pub_{key}"] = val return _args, _kwargs @@ -413,7 +413,7 @@ def master_event(type, master=None): } if type == "alive" and master is not None: - return "{}_{}".format(event_map.get(type), master) + return f"{event_map.get(type)}_{master}" return event_map.get(type, None) @@ -1925,9 +1925,9 @@ class Minion(MinionBase): log.trace("Executors list %s", executors) # pylint: disable=no-member for name in executors: - fname = "{}.execute".format(name) + fname = f"{name}.execute" if fname not in self.executors: - raise SaltInvocationError("Executor '{}' is not available".format(name)) + raise SaltInvocationError(f"Executor '{name}' is not available") return_data = self.executors[fname](opts, data, func, args, kwargs) if return_data is not None: return return_data @@ -1943,7 +1943,7 @@ class Minion(MinionBase): minion_instance.gen_modules() fn_ = os.path.join(minion_instance.proc_dir, data["jid"]) - salt.utils.process.appendproctitle("{}._thread_return".format(cls.__name__)) + salt.utils.process.appendproctitle(f"{cls.__name__}._thread_return") sdata = {"pid": os.getpid()} sdata.update(data) @@ -1960,11 +1960,11 @@ class Minion(MinionBase): ) allow_missing_funcs = any( [ - minion_instance.executors["{}.allow_missing_func".format(executor)]( + minion_instance.executors[f"{executor}.allow_missing_func"]( function_name ) for executor in executors - if "{}.allow_missing_func".format(executor) in minion_instance.executors + if f"{executor}.allow_missing_func" in minion_instance.executors ] ) if function_name in minion_instance.functions or allow_missing_funcs is True: @@ -2010,9 +2010,9 @@ class Minion(MinionBase): ret["retcode"] = retcode ret["success"] = retcode == salt.defaults.exitcodes.EX_OK except CommandNotFoundError as exc: - msg = "Command required for '{}' not found".format(function_name) + msg = f"Command required for '{function_name}' not found" log.debug(msg, exc_info=True) - ret["return"] = "{}: {}".format(msg, exc) + ret["return"] = f"{msg}: {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except CommandExecutionError as exc: @@ -2022,7 +2022,7 @@ class Minion(MinionBase): exc, exc_info_on_loglevel=logging.DEBUG, ) - ret["return"] = "ERROR: {}".format(exc) + ret["return"] = f"ERROR: {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except SaltInvocationError as exc: @@ -2032,7 +2032,7 @@ class Minion(MinionBase): exc, exc_info_on_loglevel=logging.DEBUG, ) - ret["return"] = "ERROR executing '{}': {}".format(function_name, exc) + ret["return"] = f"ERROR executing '{function_name}': {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except SaltClientError as exc: @@ -2041,7 +2041,7 @@ class Minion(MinionBase): function_name, exc, ) - ret["return"] = "ERROR executing '{}': {}".format(function_name, exc) + ret["return"] = f"ERROR executing '{function_name}': {exc}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC except TypeError as exc: @@ -2064,11 +2064,11 @@ class Minion(MinionBase): salt.utils.error.fire_exception( salt.exceptions.MinionError(msg), opts, job=data ) - ret["return"] = "{}: {}".format(msg, traceback.format_exc()) + ret["return"] = f"{msg}: {traceback.format_exc()}" ret["out"] = "nested" ret["retcode"] = salt.defaults.exitcodes.EX_GENERIC else: - docs = minion_instance.functions["sys.doc"]("{}*".format(function_name)) + docs = minion_instance.functions["sys.doc"](f"{function_name}*") if docs: docs[function_name] = minion_instance.functions.missing_fun_string( function_name @@ -2120,7 +2120,7 @@ class Minion(MinionBase): ret["id"] = opts["id"] for returner in set(data["ret"].split(",")): try: - returner_str = "{}.returner".format(returner) + returner_str = f"{returner}.returner" if returner_str in minion_instance.returners: minion_instance.returners[returner_str](ret) else: @@ -2144,9 +2144,7 @@ class Minion(MinionBase): minion_instance.gen_modules() fn_ = os.path.join(minion_instance.proc_dir, data["jid"]) - salt.utils.process.appendproctitle( - "{}._thread_multi_return".format(cls.__name__) - ) + salt.utils.process.appendproctitle(f"{cls.__name__}._thread_multi_return") sdata = {"pid": os.getpid()} sdata.update(data) @@ -2225,7 +2223,7 @@ class Minion(MinionBase): for returner in set(data["ret"].split(",")): ret["id"] = opts["id"] try: - minion_instance.returners["{}.returner".format(returner)](ret) + minion_instance.returners[f"{returner}.returner"](ret) except Exception as exc: # pylint: disable=broad-except log.error("The return failed for job %s: %s", data["jid"], exc) @@ -4027,8 +4025,8 @@ class SProxyMinion(SMinion): self.proxy.reload_modules() if ( - "{}.init".format(fq_proxyname) not in self.proxy - or "{}.shutdown".format(fq_proxyname) not in self.proxy + f"{fq_proxyname}.init" not in self.proxy + or f"{fq_proxyname}.shutdown" not in self.proxy ): errmsg = ( "Proxymodule {} is missing an init() or a shutdown() or both. ".format( @@ -4041,7 +4039,7 @@ class SProxyMinion(SMinion): raise SaltSystemExit(code=salt.defaults.exitcodes.EX_GENERIC, msg=errmsg) self.module_executors = self.proxy.get( - "{}.module_executors".format(fq_proxyname), lambda: [] + f"{fq_proxyname}.module_executors", lambda: [] )() proxy_init_fn = self.proxy[fq_proxyname + ".init"] proxy_init_fn(self.opts) diff --git a/salt/modules/acme.py b/salt/modules/acme.py index 7952acc1aad..af87f48bf27 100644 --- a/salt/modules/acme.py +++ b/salt/modules/acme.py @@ -72,7 +72,7 @@ def _cert_file(name, cert_type): """ Return expected path of a Let's Encrypt live cert """ - return os.path.join(LE_LIVE, name, "{}.pem".format(cert_type)) + return os.path.join(LE_LIVE, name, f"{cert_type}.pem") def _expires(name): @@ -88,9 +88,9 @@ def _expires(name): expiry = __salt__["tls.cert_info"](cert_file).get("not_after", 0) # Cobble it together using the openssl binary else: - openssl_cmd = "openssl x509 -in {} -noout -enddate".format(cert_file) + openssl_cmd = f"openssl x509 -in {cert_file} -noout -enddate" # No %e format on my Linux'es here - strptime_sux_cmd = 'date --date="$({} | cut -d= -f2)" +%s'.format(openssl_cmd) + strptime_sux_cmd = f'date --date="$({openssl_cmd} | cut -d= -f2)" +%s' expiry = float(__salt__["cmd.shell"](strptime_sux_cmd, output_loglevel="quiet")) # expiry = datetime.datetime.strptime(expiry.split('=', 1)[-1], '%b %e %H:%M:%S %Y %Z') return datetime.datetime.fromtimestamp(expiry) @@ -195,10 +195,10 @@ def cert( cmd.append("--renew-by-default") renew = True if server: - cmd.append("--server {}".format(server)) + cmd.append(f"--server {server}") if certname: - cmd.append("--cert-name {}".format(certname)) + cmd.append(f"--cert-name {certname}") if test_cert: if server: @@ -211,41 +211,41 @@ def cert( if webroot: cmd.append("--authenticator webroot") if webroot is not True: - cmd.append("--webroot-path {}".format(webroot)) + cmd.append(f"--webroot-path {webroot}") elif dns_plugin in supported_dns_plugins: if dns_plugin == "cloudflare": cmd.append("--dns-cloudflare") - cmd.append("--dns-cloudflare-credentials {}".format(dns_plugin_credentials)) + cmd.append(f"--dns-cloudflare-credentials {dns_plugin_credentials}") else: return { "result": False, - "comment": "DNS plugin '{}' is not supported".format(dns_plugin), + "comment": f"DNS plugin '{dns_plugin}' is not supported", } else: cmd.append("--authenticator standalone") if email: - cmd.append("--email {}".format(email)) + cmd.append(f"--email {email}") if keysize: - cmd.append("--rsa-key-size {}".format(keysize)) + cmd.append(f"--rsa-key-size {keysize}") - cmd.append("--domains {}".format(name)) + cmd.append(f"--domains {name}") if aliases is not None: for dns in aliases: - cmd.append("--domains {}".format(dns)) + cmd.append(f"--domains {dns}") if preferred_challenges: - cmd.append("--preferred-challenges {}".format(preferred_challenges)) + cmd.append(f"--preferred-challenges {preferred_challenges}") if tls_sni_01_port: - cmd.append("--tls-sni-01-port {}".format(tls_sni_01_port)) + cmd.append(f"--tls-sni-01-port {tls_sni_01_port}") if tls_sni_01_address: - cmd.append("--tls-sni-01-address {}".format(tls_sni_01_address)) + cmd.append(f"--tls-sni-01-address {tls_sni_01_address}") if http_01_port: - cmd.append("--http-01-port {}".format(http_01_port)) + cmd.append(f"--http-01-port {http_01_port}") if http_01_address: - cmd.append("--http-01-address {}".format(http_01_address)) + cmd.append(f"--http-01-address {http_01_address}") res = __salt__["cmd.run_all"](" ".join(cmd)) @@ -269,13 +269,13 @@ def cert( } if "no action taken" in res["stdout"]: - comment = "Certificate {} unchanged".format(cert_file) + comment = f"Certificate {cert_file} unchanged" result = None elif renew: - comment = "Certificate {} renewed".format(certname) + comment = f"Certificate {certname} renewed" result = True else: - comment = "Certificate {} obtained".format(certname) + comment = f"Certificate {certname} obtained" result = True ret = { @@ -339,7 +339,7 @@ def info(name): cert_info = __salt__["x509.read_certificate"](cert_file) else: # Cobble it together using the openssl binary - openssl_cmd = "openssl x509 -in {} -noout -text".format(cert_file) + openssl_cmd = f"openssl x509 -in {cert_file} -noout -text" cert_info = {"text": __salt__["cmd.run"](openssl_cmd, output_loglevel="quiet")} return cert_info diff --git a/salt/modules/aix_group.py b/salt/modules/aix_group.py index ddbb452fcbf..b1e5f092e79 100644 --- a/salt/modules/aix_group.py +++ b/salt/modules/aix_group.py @@ -48,7 +48,7 @@ def add(name, gid=None, system=False, root=None, **kwargs): cmd += "-a " if gid: - cmd += "id={} ".format(gid) + cmd += f"id={gid} " cmd += name @@ -67,7 +67,7 @@ def delete(name): salt '*' group.delete foo """ - ret = __salt__["cmd.run_all"]("rmgroup {}".format(name), python_shell=False) + ret = __salt__["cmd.run_all"](f"rmgroup {name}", python_shell=False) return not ret["retcode"] @@ -129,7 +129,7 @@ def chgid(name, gid): pre_gid = __salt__["file.group_to_gid"](name) if gid == pre_gid: return True - cmd = "chgroup id={} {}".format(gid, name) + cmd = f"chgroup id={gid} {name}" __salt__["cmd.run"](cmd, python_shell=False) post_gid = __salt__["file.group_to_gid"](name) if post_gid != pre_gid: @@ -150,7 +150,7 @@ def adduser(name, username, root=None): Verifies if a valid username 'bar' as a member of an existing group 'foo', if not then adds it. """ - cmd = "chgrpmem -m + {} {}".format(username, name) + cmd = f"chgrpmem -m + {username} {name}" retcode = __salt__["cmd.retcode"](cmd, python_shell=False) @@ -173,7 +173,7 @@ def deluser(name, username, root=None): grp_info = __salt__["group.info"](name) try: if username in grp_info["members"]: - cmd = "chgrpmem -m - {} {}".format(username, name) + cmd = f"chgrpmem -m - {username} {name}" ret = __salt__["cmd.run"](cmd, python_shell=False) return not ret["retcode"] else: @@ -195,7 +195,7 @@ def members(name, members_list, root=None): Replaces a membership list for a local group 'foo'. foo:x:1234:user1,user2,user3,... """ - cmd = "chgrpmem -m = {} {}".format(members_list, name) + cmd = f"chgrpmem -m = {members_list} {name}" retcode = __salt__["cmd.retcode"](cmd, python_shell=False) return not retcode diff --git a/salt/modules/aix_shadow.py b/salt/modules/aix_shadow.py index 3282603e01f..e58f93180fe 100644 --- a/salt/modules/aix_shadow.py +++ b/salt/modules/aix_shadow.py @@ -39,7 +39,7 @@ def login_failures(user): salt shadow.login_failures ALL """ - cmd = "lsuser -a unsuccessful_login_count {}".format(user) + cmd = f"lsuser -a unsuccessful_login_count {user}" cmd += " | grep -E 'unsuccessful_login_count=([3-9]|[0-9][0-9]+)'" out = __salt__["cmd.run_all"](cmd, output_loglevel="trace", python_shell=True) @@ -63,7 +63,7 @@ def locked(user): salt shadow.locked ALL """ - cmd = "lsuser -a account_locked {}".format(user) + cmd = f"lsuser -a account_locked {user}" cmd += ' | grep "account_locked=true"' out = __salt__["cmd.run_all"](cmd, output_loglevel="trace", python_shell=True) diff --git a/salt/modules/aixpkg.py b/salt/modules/aixpkg.py index 25c0b2dbdfc..a77cff26788 100644 --- a/salt/modules/aixpkg.py +++ b/salt/modules/aixpkg.py @@ -184,7 +184,7 @@ def version(*names, **kwargs): for name in names: # AIX packaging includes info on filesets and rpms version_found = "" - cmd = "lslpp -Lq {}".format(name) + cmd = f"lslpp -Lq {name}" aix_info = __salt__["cmd.run_all"](cmd, python_shell=False) if 0 == aix_info["retcode"]: aix_info_list = aix_info["stdout"].split("\n") @@ -344,7 +344,7 @@ def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwa if refresh: cmdflags += "--refresh " - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"]( cmd, python_shell=False, @@ -360,7 +360,7 @@ def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwa else: cmdflags += "--assumeyes " - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"]( cmd, python_shell=False, @@ -378,7 +378,7 @@ def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwa if refresh: cmdflags += "--refresh " - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"]( cmd, python_shell=False, @@ -392,7 +392,7 @@ def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwa if test: cmdflags += "--test" - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"](cmd, python_shell=False) if "retcode" in out and not (0 == out["retcode"] or 100 == out["retcode"]): @@ -510,7 +510,7 @@ def remove(name=None, pkgs=None, **kwargs): libpathenv = {"LIBPATH": "/opt/freeware/lib:/usr/lib"} if pathlib.Path("/opt/freeware/bin/dnf").is_file(): cmdexe = "/opt/freeware/bin/dnf" - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"]( cmd, python_shell=False, @@ -519,7 +519,7 @@ def remove(name=None, pkgs=None, **kwargs): ) elif pathlib.Path("/opt/freeware/bin/yum").is_file(): cmdexe = "/opt/freeware/bin/yum" - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"]( cmd, python_shell=False, @@ -528,7 +528,7 @@ def remove(name=None, pkgs=None, **kwargs): ) elif pathlib.Path("/usr/bin/yum").is_file(): cmdexe = "/usr/bin/yum" - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"]( cmd, python_shell=False, @@ -538,7 +538,7 @@ def remove(name=None, pkgs=None, **kwargs): else: cmdexe = "/usr/bin/rpm" cmdflags = "-e" - cmd = "{} {} {}".format(cmdexe, cmdflags, target) + cmd = f"{cmdexe} {cmdflags} {target}" out = __salt__["cmd.run_all"](cmd, python_shell=False) else: cmd = ["/usr/sbin/installp", "-u", named] @@ -594,19 +594,19 @@ def latest_version(*names, **kwargs): libpathenv = {"LIBPATH": "/opt/freeware/lib:/usr/lib"} if pathlib.Path("/opt/freeware/bin/dnf").is_file(): cmdexe = "/opt/freeware/bin/dnf" - cmd = "{} check-update {}".format(cmdexe, name) + cmd = f"{cmdexe} check-update {name}" available_info = __salt__["cmd.run_all"]( cmd, python_shell=False, env=libpathenv, ignore_retcode=True ) elif pathlib.Path("/opt/freeware/bin/yum").is_file(): cmdexe = "/opt/freeware/bin/yum" - cmd = "{} check-update {}".format(cmdexe, name) + cmd = f"{cmdexe} check-update {name}" available_info = __salt__["cmd.run_all"]( cmd, python_shell=False, env=libpathenv, ignore_retcode=True ) elif pathlib.Path("/usr/bin/yum").is_file(): cmdexe = "/usr/bin/yum" - cmd = "{} check-update {}".format(cmdexe, name) + cmd = f"{cmdexe} check-update {name}" available_info = __salt__["cmd.run_all"]( cmd, python_shell=False, env=libpathenv, ignore_retcode=True ) @@ -683,19 +683,19 @@ def upgrade_available(name, **kwargs): libpathenv = {"LIBPATH": "/opt/freeware/lib:/usr/lib"} if pathlib.Path("/opt/freeware/bin/dnf").is_file(): cmdexe = "/opt/freeware/bin/dnf" - cmd = "{} check-update {}".format(cmdexe, name) + cmd = f"{cmdexe} check-update {name}" available_info = __salt__["cmd.run_all"]( cmd, python_shell=False, env=libpathenv, ignore_retcode=True ) elif pathlib.Path("/opt/freeware/bin/yum").is_file(): cmdexe = "/opt/freeware/bin/yum" - cmd = "{} check-update {}".format(cmdexe, name) + cmd = f"{cmdexe} check-update {name}" available_info = __salt__["cmd.run_all"]( cmd, python_shell=False, env=libpathenv, ignore_retcode=True ) elif pathlib.Path("/usr/bin/yum").is_file(): cmdexe = "/usr/bin/yum" - cmd = "{} check-update {}".format(cmdexe, name) + cmd = f"{cmdexe} check-update {name}" available_info = __salt__["cmd.run_all"]( cmd, python_shell=False, env=libpathenv, ignore_retcode=True ) diff --git a/salt/modules/aliases.py b/salt/modules/aliases.py index 01337791ffe..b006593767f 100644 --- a/salt/modules/aliases.py +++ b/salt/modules/aliases.py @@ -80,9 +80,9 @@ def __write_aliases_file(lines): if not line_comment: line_comment = "" if line_alias and line_target: - write_line = "{}: {}{}\n".format(line_alias, line_target, line_comment) + write_line = f"{line_alias}: {line_target}{line_comment}\n" else: - write_line = "{}\n".format(line_comment) + write_line = f"{line_comment}\n" write_line = write_line.encode(__salt_system_encoding__) out.write(write_line) diff --git a/salt/modules/alternatives.py b/salt/modules/alternatives.py index 64df8d78367..a71814b6ef1 100644 --- a/salt/modules/alternatives.py +++ b/salt/modules/alternatives.py @@ -241,5 +241,5 @@ def _read_link(name): Throws an OSError if the link does not exist """ - alt_link_path = "/etc/alternatives/{}".format(name) + alt_link_path = f"/etc/alternatives/{name}" return salt.utils.path.readlink(alt_link_path) diff --git a/salt/modules/ansiblegate.py b/salt/modules/ansiblegate.py index 2f60a7444fb..ec87aa9969c 100644 --- a/salt/modules/ansiblegate.py +++ b/salt/modules/ansiblegate.py @@ -101,17 +101,16 @@ def __virtual__(): proc = subprocess.run( [ansible_doc_bin, "--list", "--json", "--type=module"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=False, shell=False, - universal_newlines=True, + text=True, env=env, ) if proc.returncode != 0: return ( False, - "Failed to get the listing of ansible modules:\n{}".format(proc.stderr), + f"Failed to get the listing of ansible modules:\n{proc.stderr}", ) module_funcs = dir(sys.modules[__name__]) @@ -170,11 +169,10 @@ def help(module=None, *args): proc = subprocess.run( [ansible_doc_bin, "--json", "--type=module", module], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, check=True, shell=False, - universal_newlines=True, + text=True, env=env, ) data = salt.utils.json.loads(proc.stdout) @@ -240,7 +238,7 @@ def call(module, *args, **kwargs): _kwargs = {k: v for (k, v) in kwargs.items() if not k.startswith("__pub")} for key, value in _kwargs.items(): - module_args.append("{}={}".format(key, salt.utils.json.dumps(value))) + module_args.append(f"{key}={salt.utils.json.dumps(value)}") with NamedTemporaryFile(mode="w") as inventory: @@ -263,10 +261,9 @@ def call(module, *args, **kwargs): "-i", inventory.name, ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, timeout=__opts__.get("ansible_timeout", DEFAULT_TIMEOUT), - universal_newlines=True, + text=True, check=True, shell=False, env=env, @@ -367,15 +364,15 @@ def playbooks( if diff: command.append("--diff") if isinstance(extra_vars, dict): - command.append("--extra-vars='{}'".format(json.dumps(extra_vars))) + command.append(f"--extra-vars='{json.dumps(extra_vars)}'") elif isinstance(extra_vars, str) and extra_vars.startswith("@"): - command.append("--extra-vars={}".format(extra_vars)) + command.append(f"--extra-vars={extra_vars}") if flush_cache: command.append("--flush-cache") if inventory: - command.append("--inventory={}".format(inventory)) + command.append(f"--inventory={inventory}") if limit: - command.append("--limit={}".format(limit)) + command.append(f"--limit={limit}") if list_hosts: command.append("--list-hosts") if list_tags: @@ -383,25 +380,25 @@ def playbooks( if list_tasks: command.append("--list-tasks") if module_path: - command.append("--module-path={}".format(module_path)) + command.append(f"--module-path={module_path}") if skip_tags: - command.append("--skip-tags={}".format(skip_tags)) + command.append(f"--skip-tags={skip_tags}") if start_at_task: - command.append("--start-at-task={}".format(start_at_task)) + command.append(f"--start-at-task={start_at_task}") if syntax_check: command.append("--syntax-check") if tags: - command.append("--tags={}".format(tags)) + command.append(f"--tags={tags}") if playbook_kwargs: for key, value in playbook_kwargs.items(): key = key.replace("_", "-") if value is True: - command.append("--{}".format(key)) + command.append(f"--{key}") elif isinstance(value, str): - command.append("--{}={}".format(key, value)) + command.append(f"--{key}={value}") elif isinstance(value, dict): - command.append("--{}={}".format(key, json.dumps(value))) - command.append("--forks={}".format(forks)) + command.append(f"--{key}={json.dumps(value)}") + command.append(f"--forks={forks}") cmd_kwargs = { "env": { "ANSIBLE_STDOUT_CALLBACK": "json", @@ -540,12 +537,10 @@ def discover_playbooks( if path: if not os.path.isabs(path): raise CommandExecutionError( - "The given path is not an absolute path: {}".format(path) + f"The given path is not an absolute path: {path}" ) if not os.path.isdir(path): - raise CommandExecutionError( - "The given path is not a directory: {}".format(path) - ) + raise CommandExecutionError(f"The given path is not a directory: {path}") return { path: _explore_path(path, playbook_extension, hosts_filename, syntax_check) } @@ -599,7 +594,7 @@ def _explore_path(path, playbook_extension, hosts_filename, syntax_check): ) except Exception as exc: raise CommandExecutionError( - "There was an exception while discovering playbooks: {}".format(exc) + f"There was an exception while discovering playbooks: {exc}" ) # Run syntax check validation diff --git a/salt/modules/apache.py b/salt/modules/apache.py index d50ff3b17df..3d9fc41c618 100644 --- a/salt/modules/apache.py +++ b/salt/modules/apache.py @@ -60,7 +60,7 @@ def version(): salt '*' apache.version """ - cmd = "{} -v".format(_detect_os()) + cmd = f"{_detect_os()} -v" out = __salt__["cmd.run"](cmd).splitlines() ret = out[0].split(": ") return ret[1] @@ -76,7 +76,7 @@ def fullversion(): salt '*' apache.fullversion """ - cmd = "{} -V".format(_detect_os()) + cmd = f"{_detect_os()} -V" ret = {} ret["compiled_with"] = [] out = __salt__["cmd.run"](cmd).splitlines() @@ -105,7 +105,7 @@ def modules(): salt '*' apache.modules """ - cmd = "{} -M".format(_detect_os()) + cmd = f"{_detect_os()} -M" ret = {} ret["static"] = [] ret["shared"] = [] @@ -131,7 +131,7 @@ def servermods(): salt '*' apache.servermods """ - cmd = "{} -l".format(_detect_os()) + cmd = f"{_detect_os()} -l" ret = [] out = __salt__["cmd.run"](cmd).splitlines() for line in out: @@ -153,7 +153,7 @@ def directives(): salt '*' apache.directives """ - cmd = "{} -L".format(_detect_os()) + cmd = f"{_detect_os()} -L" ret = {} out = __salt__["cmd.run"](cmd) out = out.replace("\n\t", "\t") @@ -180,7 +180,7 @@ def vhosts(): salt -t 10 '*' apache.vhosts """ - cmd = "{} -S".format(_detect_os()) + cmd = f"{_detect_os()} -S" ret = {} namevhost = "" out = __salt__["cmd.run"](cmd) @@ -221,9 +221,9 @@ def signal(signal=None): return # Make sure you use the right arguments if signal in valid_signals: - arguments = " -k {}".format(signal) + arguments = f" -k {signal}" else: - arguments = " {}".format(signal) + arguments = f" {signal}" cmd = _detect_os() + arguments out = __salt__["cmd.run_all"](cmd) @@ -237,7 +237,7 @@ def signal(signal=None): ret = out["stdout"].strip() # No output for something like: apachectl graceful else: - ret = 'Command: "{}" completed successfully!'.format(cmd) + ret = f'Command: "{cmd}" completed successfully!' return ret @@ -326,14 +326,12 @@ def server_status(profile="default"): # Get configuration from pillar url = __salt__["config.get"]( - "apache.server-status:{}:url".format(profile), "http://localhost/server-status" - ) - user = __salt__["config.get"]("apache.server-status:{}:user".format(profile), "") - passwd = __salt__["config.get"]("apache.server-status:{}:pass".format(profile), "") - realm = __salt__["config.get"]("apache.server-status:{}:realm".format(profile), "") - timeout = __salt__["config.get"]( - "apache.server-status:{}:timeout".format(profile), 5 + f"apache.server-status:{profile}:url", "http://localhost/server-status" ) + user = __salt__["config.get"](f"apache.server-status:{profile}:user", "") + passwd = __salt__["config.get"](f"apache.server-status:{profile}:pass", "") + realm = __salt__["config.get"](f"apache.server-status:{profile}:realm", "") + timeout = __salt__["config.get"](f"apache.server-status:{profile}:timeout", 5) # create authentication handler if configuration exists if user and passwd: @@ -379,9 +377,9 @@ def _parse_config(conf, slot=None): ret = io.StringIO() if isinstance(conf, str): if slot: - print("{} {}".format(slot, conf), file=ret, end="") + print(f"{slot} {conf}", file=ret, end="") else: - print("{}".format(conf), file=ret, end="") + print(f"{conf}", file=ret, end="") elif isinstance(conf, list): is_section = False for item in conf: @@ -389,12 +387,12 @@ def _parse_config(conf, slot=None): is_section = True slot_this = str(item["this"]) if is_section: - print("<{} {}>".format(slot, slot_this), file=ret) + print(f"<{slot} {slot_this}>", file=ret) for item in conf: for key, val in item.items(): if key != "this": print(_parse_config(val, str(key)), file=ret) - print("".format(slot), file=ret) + print(f"", file=ret) else: for value in conf: print(_parse_config(value, str(slot)), file=ret) @@ -409,12 +407,12 @@ def _parse_config(conf, slot=None): for key, value in conf.items(): if key != "this": if isinstance(value, str): - print("{} {}".format(key, value), file=ret) + print(f"{key} {value}", file=ret) elif isinstance(value, list): print(_parse_config(value, key), file=ret) elif isinstance(value, dict): print(_parse_config(value, key), file=ret) - print("".format(slot), file=ret) + print(f"", file=ret) ret.seek(0) return ret.read() diff --git a/salt/modules/apf.py b/salt/modules/apf.py index 406f2c9d417..c7de7e47895 100644 --- a/salt/modules/apf.py +++ b/salt/modules/apf.py @@ -45,7 +45,7 @@ def __apf_cmd(cmd): msg = out["stdout"] else: msg = out["stderr"] - raise CommandExecutionError("apf failed: {}".format(msg)) + raise CommandExecutionError(f"apf failed: {msg}") return out["stdout"] @@ -140,7 +140,7 @@ def allow(ip, port=None): salt '*' apf.allow 127.0.0.1 """ if port is None: - return __apf_cmd("-a {}".format(ip)) + return __apf_cmd(f"-a {ip}") def deny(ip): @@ -153,7 +153,7 @@ def deny(ip): salt '*' apf.deny 1.2.3.4 """ - return __apf_cmd("-d {}".format(ip)) + return __apf_cmd(f"-d {ip}") def remove(ip): @@ -166,4 +166,4 @@ def remove(ip): salt '*' apf.remove 1.2.3.4 """ - return __apf_cmd("-u {}".format(ip)) + return __apf_cmd(f"-u {ip}") diff --git a/salt/modules/apkpkg.py b/salt/modules/apkpkg.py index 365c9e4c941..e1240d28d15 100644 --- a/salt/modules/apkpkg.py +++ b/salt/modules/apkpkg.py @@ -597,6 +597,6 @@ def owner(*paths, **kwargs): else: ret[path] = output.split("by ")[1].strip() else: - ret[path] = "Error running {}".format(cmd) + ret[path] = f"Error running {cmd}" return ret diff --git a/salt/modules/aptly.py b/salt/modules/aptly.py index a3409abfc3b..6a0a653b3ff 100644 --- a/salt/modules/aptly.py +++ b/salt/modules/aptly.py @@ -77,10 +77,10 @@ def _format_repo_args( for setting in settings: if settings[setting] is not None: - ret.append("-{}={}".format(setting, settings[setting])) + ret.append(f"-{setting}={settings[setting]}") if cached_uploaders_path: - ret.append("-uploaders-file={}".format(cached_uploaders_path)) + ret.append(f"-uploaders-file={cached_uploaders_path}") return ret @@ -97,7 +97,7 @@ def _validate_config(config_path): log.debug("Checking configuration file: %s", config_path) if not os.path.isfile(config_path): - message = "Unable to get configuration file: {}".format(config_path) + message = f"Unable to get configuration file: {config_path}" log.error(message) raise SaltInvocationError(message) @@ -119,7 +119,7 @@ def get_config(config_path=_DEFAULT_CONFIG_PATH): """ _validate_config(config_path) - cmd = ["config", "show", "-config={}".format(config_path)] + cmd = ["config", "show", f"-config={config_path}"] cmd_ret = _cmd_run(cmd) @@ -145,7 +145,7 @@ def list_repos(config_path=_DEFAULT_CONFIG_PATH, with_packages=False): _validate_config(config_path) ret = dict() - cmd = ["repo", "list", "-config={}".format(config_path), "-raw=true"] + cmd = ["repo", "list", f"-config={config_path}", "-raw=true"] cmd_ret = _cmd_run(cmd) repos = [line.strip() for line in cmd_ret.splitlines()] @@ -183,8 +183,8 @@ def get_repo(name, config_path=_DEFAULT_CONFIG_PATH, with_packages=False): cmd = [ "repo", "show", - "-config={}".format(config_path), - "-with-packages={}".format(with_packages), + f"-config={config_path}", + f"-with-packages={with_packages}", name, ] @@ -250,7 +250,7 @@ def new_repo( log.debug("Repository already exists: %s", name) return True - cmd = ["repo", "create", "-config={}".format(config_path)] + cmd = ["repo", "create", f"-config={config_path}"] repo_params = _format_repo_args( comment=comment, component=component, @@ -336,7 +336,7 @@ def set_repo( log.debug("Settings already have the desired values for repository: %s", name) return True - cmd = ["repo", "edit", "-config={}".format(config_path)] + cmd = ["repo", "edit", f"-config={config_path}"] repo_params = _format_repo_args( comment=comment, @@ -395,8 +395,8 @@ def delete_repo(name, config_path=_DEFAULT_CONFIG_PATH, force=False): cmd = [ "repo", "drop", - "-config={}".format(config_path), - "-force={}".format(force), + f"-config={config_path}", + f"-force={force}", name, ] @@ -427,7 +427,7 @@ def list_mirrors(config_path=_DEFAULT_CONFIG_PATH): """ _validate_config(config_path) - cmd = ["mirror", "list", "-config={}".format(config_path), "-raw=true"] + cmd = ["mirror", "list", f"-config={config_path}", "-raw=true"] cmd_ret = _cmd_run(cmd) ret = [line.strip() for line in cmd_ret.splitlines()] @@ -453,7 +453,7 @@ def list_published(config_path=_DEFAULT_CONFIG_PATH): """ _validate_config(config_path) - cmd = ["publish", "list", "-config={}".format(config_path), "-raw=true"] + cmd = ["publish", "list", f"-config={config_path}", "-raw=true"] cmd_ret = _cmd_run(cmd) ret = [line.strip() for line in cmd_ret.splitlines()] @@ -480,7 +480,7 @@ def list_snapshots(config_path=_DEFAULT_CONFIG_PATH, sort_by_time=False): """ _validate_config(config_path) - cmd = ["snapshot", "list", "-config={}".format(config_path), "-raw=true"] + cmd = ["snapshot", "list", f"-config={config_path}", "-raw=true"] if sort_by_time: cmd.append("-sort=time") @@ -518,8 +518,8 @@ def cleanup_db(config_path=_DEFAULT_CONFIG_PATH, dry_run=False): cmd = [ "db", "cleanup", - "-config={}".format(config_path), - "-dry-run={}".format(dry_run), + f"-config={config_path}", + f"-dry-run={dry_run}", "-verbose=true", ] @@ -533,7 +533,7 @@ def cleanup_db(config_path=_DEFAULT_CONFIG_PATH, dry_run=False): if current_block: match = re.search(list_pattern, line) if match: - package_type = "deleted_{}".format(current_block) + package_type = f"deleted_{current_block}" ret[package_type].append(match.group("package")) else: current_block = None diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index d143cdcee07..191587dcd85 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -205,10 +205,10 @@ if not HAS_APT: opts = _get_opts(self.line) if self.architectures: archs = ",".join(self.architectures) - opts["arch"]["full"] = "arch={}".format(archs) + opts["arch"]["full"] = f"arch={archs}" opts["arch"]["value"] = self.architectures if self.signedby: - opts["signedby"]["full"] = "signed-by={}".format(self.signedby) + opts["signedby"]["full"] = f"signed-by={self.signedby}" opts["signedby"]["value"] = self.signedby ordered_opts = [ @@ -224,7 +224,7 @@ if not HAS_APT: repo_line += [self.uri, self.dist, " ".join(self.comps)] if self.comment: - repo_line.append("#{}".format(self.comment)) + repo_line.append(f"#{self.comment}") return " ".join(repo_line) + "\n" def _parse_sources(self, line): @@ -287,7 +287,7 @@ if not HAS_APT: architectures = "arch={}".format(",".join(architectures)) opts_count.append(architectures) if signedby: - signedby = "signed-by={}".format(signedby) + signedby = f"signed-by={signedby}" opts_count.append(signedby) if len(opts_count) > 1: opts_line = "[" + " ".join(opts_count) + "]" @@ -350,7 +350,7 @@ def _reconstruct_ppa_name(owner_name, ppa_name): """ Stringify PPA name from args. """ - return "ppa:{}/{}".format(owner_name, ppa_name) + return f"ppa:{owner_name}/{ppa_name}" def _call_apt(args, scope=True, **kwargs): @@ -363,7 +363,7 @@ def _call_apt(args, scope=True, **kwargs): and salt.utils.systemd.has_scope(__context__) and __salt__["config.get"]("systemd.scope", True) ): - cmd.extend(["systemd-run", "--scope", "--description", '"{}"'.format(__name__)]) + cmd.extend(["systemd-run", "--scope", "--description", f'"{__name__}"']) cmd.extend(args) params = { @@ -473,7 +473,7 @@ def latest_version(*names, **kwargs): for name in names: ret[name] = "" pkgs = list_pkgs(versions_as_list=True) - repo = ["-o", "APT::Default-Release={}".format(fromrepo)] if fromrepo else None + repo = ["-o", f"APT::Default-Release={fromrepo}"] if fromrepo else None # Refresh before looking for the latest version available if refresh: @@ -941,7 +941,7 @@ def install( continue else: version_num = target - pkgstr = "{}={}".format(pkgname, version_num) + pkgstr = f"{pkgname}={version_num}" else: pkgstr = pkgpath @@ -1317,7 +1317,7 @@ def upgrade(refresh=True, dist_upgrade=False, **kwargs): ] for option in dpkg_options: cmd.append("-o") - cmd.append("DPkg::Options::={}".format(option)) + cmd.append(f"DPkg::Options::={option}") if kwargs.get("force_yes", False): cmd.append("--force-yes") @@ -1390,15 +1390,15 @@ def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613 state = get_selections(pattern=target, state="hold") if not state: - ret[target]["comment"] = "Package {} not currently held.".format(target) + ret[target]["comment"] = f"Package {target} not currently held." elif not salt.utils.data.is_true(state.get("hold", False)): if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) - ret[target]["comment"] = "Package {} is set to be held.".format(target) + ret[target]["comment"] = f"Package {target} is set to be held." else: result = set_selections(selection={"hold": [target]}) ret[target].update(changes=result[target], result=True) - ret[target]["comment"] = "Package {} is now being held.".format(target) + ret[target]["comment"] = f"Package {target} is now being held." else: ret[target].update(result=True) ret[target]["comment"] = "Package {} is already set to be held.".format( @@ -1455,7 +1455,7 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 state = get_selections(pattern=target) if not state: - ret[target]["comment"] = "Package {} does not have a state.".format(target) + ret[target]["comment"] = f"Package {target} does not have a state." elif salt.utils.data.is_true(state.get("hold", False)): if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) @@ -1551,7 +1551,7 @@ def list_pkgs( if __grains__.get("cpuarch", "") == "x86_64": osarch = __grains__.get("osarch", "") if arch != "all" and osarch == "amd64" and osarch != arch: - name += ":{}".format(arch) + name += f":{arch}" if cols: if ("install" in linetype or "hold" in linetype) and "installed" in status: __salt__["pkg_resource.add_pkg"](ret["installed"], name, version_num) @@ -1792,7 +1792,7 @@ def _consolidate_repo_sources(sources): Consolidate APT sources. """ if not isinstance(sources, SourcesList): - raise TypeError("'{}' not a '{}'".format(type(sources), SourcesList)) + raise TypeError(f"'{type(sources)}' not a '{SourcesList}'") consolidated = {} delete_files = set() @@ -1973,7 +1973,7 @@ def get_repo(repo, **kwargs): dist = __grains__["oscodename"] owner_name, ppa_name = repo[4:].split("/") if ppa_auth: - auth_info = "{}@".format(ppa_auth) + auth_info = f"{ppa_auth}@" repo = LP_PVT_SRC_FORMAT.format(auth_info, owner_name, ppa_name, dist) else: if HAS_SOFTWAREPROPERTIES: @@ -1986,7 +1986,7 @@ def get_repo(repo, **kwargs): repo = softwareproperties.ppa.expand_ppa_line(repo, dist)[0] except NameError as name_error: raise CommandExecutionError( - "Could not find ppa {}: {}".format(repo, name_error) + f"Could not find ppa {repo}: {name_error}" ) else: repo = LP_SRC_FORMAT.format(owner_name, ppa_name, dist) @@ -2005,7 +2005,7 @@ def get_repo(repo, **kwargs): ) except SyntaxError: raise CommandExecutionError( - "Error: repo '{}' is not a well formatted definition".format(repo) + f"Error: repo '{repo}' is not a well formatted definition" ) for source in repos.values(): @@ -2068,7 +2068,7 @@ def del_repo(repo, **kwargs): repo_entry = _split_repo_str(repo) except SyntaxError: raise SaltInvocationError( - "Error: repo '{}' not a well formatted definition".format(repo) + f"Error: repo '{repo}' not a well formatted definition" ) for source in repos: @@ -2130,9 +2130,7 @@ def del_repo(repo, **kwargs): refresh_db() return ret - raise CommandExecutionError( - "Repo {} doesn't exist in the sources.list(s)".format(repo) - ) + raise CommandExecutionError(f"Repo {repo} doesn't exist in the sources.list(s)") def _convert_if_int(value): @@ -2425,11 +2423,11 @@ def add_repo_key( else: cmd.extend(["adv", "--batch", "--keyserver", keyserver, "--recv", keyid]) elif keyid: - error_msg = "No keyserver specified for keyid: {}".format(keyid) + error_msg = f"No keyserver specified for keyid: {keyid}" raise SaltInvocationError(error_msg) else: raise TypeError( - "{}() takes at least 1 argument (0 given)".format(add_repo_key.__name__) + f"{add_repo_key.__name__}() takes at least 1 argument (0 given)" ) cmd_ret = _call_apt(cmd, **kwargs) @@ -2729,7 +2727,7 @@ def mod_repo(repo, saltenv="base", aptkey=True, **kwargs): repo = LP_SRC_FORMAT.format(owner_name, ppa_name, dist) else: raise CommandExecutionError( - 'cannot parse "ppa:" style repo definitions: {}'.format(repo) + f'cannot parse "ppa:" style repo definitions: {repo}' ) sources = SourcesList() @@ -2764,9 +2762,7 @@ def mod_repo(repo, saltenv="base", aptkey=True, **kwargs): f"Name {repo} is not valid. This must be the complete repo entry as seen in the sources file" ) except SyntaxError: - raise SyntaxError( - "Error: repo '{}' not a well formatted definition".format(repo) - ) + raise SyntaxError(f"Error: repo '{repo}' not a well formatted definition") full_comp_list = {comp.strip() for comp in repo_entry["comps"]} no_proxy = __salt__["config.option"]("no_proxy") @@ -2810,7 +2806,7 @@ def mod_repo(repo, saltenv="base", aptkey=True, **kwargs): "adv", "--batch", "--keyserver-options", - "http-proxy={}".format(http_proxy_url), + f"http-proxy={http_proxy_url}", "--keyserver", keyserver, "--logger-fd", @@ -2856,7 +2852,7 @@ def mod_repo(repo, saltenv="base", aptkey=True, **kwargs): key_url = kwargs["key_url"] fn_ = pathlib.Path(__salt__["cp.cache_file"](key_url, saltenv)) if not fn_: - raise CommandExecutionError("Error: file not found: {}".format(key_url)) + raise CommandExecutionError(f"Error: file not found: {key_url}") if kwargs["signedby"] and fn_.name != kwargs["signedby"].name: # override the signedby defined in the name with the @@ -2876,9 +2872,7 @@ def mod_repo(repo, saltenv="base", aptkey=True, **kwargs): cmd = ["apt-key", "add", str(fn_)] out = __salt__["cmd.run_stdout"](cmd, python_shell=False, **kwargs) if not out.upper().startswith("OK"): - raise CommandExecutionError( - "Error: failed to add key from {}".format(key_url) - ) + raise CommandExecutionError(f"Error: failed to add key from {key_url}") elif "key_text" in kwargs: key_text = kwargs["key_text"] @@ -2887,9 +2881,7 @@ def mod_repo(repo, saltenv="base", aptkey=True, **kwargs): cmd, stdin=key_text, python_shell=False, **kwargs ) if not out.upper().startswith("OK"): - raise CommandExecutionError( - "Error: failed to add key:\n{}".format(key_text) - ) + raise CommandExecutionError(f"Error: failed to add key:\n{key_text}") if "comps" in kwargs: kwargs["comps"] = [comp.strip() for comp in kwargs["comps"].split(",")] @@ -3236,7 +3228,7 @@ def set_selections(path=None, selection=None, clear=False, saltenv="base"): salt.utils.yaml.parser.ParserError, salt.utils.yaml.scanner.ScannerError, ) as exc: - raise SaltInvocationError("Improperly-formatted selection: {}".format(exc)) + raise SaltInvocationError(f"Improperly-formatted selection: {exc}") if path: path = __salt__["cp.cache_file"](path, saltenv) @@ -3272,7 +3264,7 @@ def set_selections(path=None, selection=None, clear=False, saltenv="base"): if _state == sel_revmap.get(_pkg): continue cmd = ["dpkg", "--set-selections"] - cmd_in = "{} {}".format(_pkg, _state) + cmd_in = f"{_pkg} {_state}" if not __opts__["test"]: result = _call_apt(cmd, scope=False, stdin=cmd_in) if result["retcode"] != 0: @@ -3468,9 +3460,9 @@ def _get_http_proxy_url(): # Set http_proxy_url for use in various internet facing actions...eg apt-key adv if host and port: if username and password: - http_proxy_url = "http://{}:{}@{}:{}".format(username, password, host, port) + http_proxy_url = f"http://{username}:{password}@{host}:{port}" else: - http_proxy_url = "http://{}:{}".format(host, port) + http_proxy_url = f"http://{host}:{port}" return http_proxy_url diff --git a/salt/modules/archive.py b/salt/modules/archive.py index e7be041bc66..9651cc406d8 100644 --- a/salt/modules/archive.py +++ b/salt/modules/archive.py @@ -207,7 +207,7 @@ def list_( stderr = cached.communicate()[1] if cached.returncode != 0: raise CommandExecutionError( - "Failed to decompress {}".format(name), + f"Failed to decompress {name}", info={"error": stderr}, ) else: @@ -290,7 +290,7 @@ def list_( files.remove(dirname) return list(dirs), files, links except zipfile.BadZipfile: - raise CommandExecutionError("{} is not a ZIP file".format(name)) + raise CommandExecutionError(f"{name} is not a ZIP file") def _list_rar(name, cached): """ @@ -335,7 +335,7 @@ def list_( name, saltenv, source_hash=source_hash, use_etag=use_etag ) if not cached: - raise CommandExecutionError("Failed to cache {}".format(name)) + raise CommandExecutionError(f"Failed to cache {name}") try: if strip_components: @@ -362,7 +362,7 @@ def list_( "'archive_format' argument." ) raise CommandExecutionError( - "Unsupported archive format '{}'".format(archive_format) + f"Unsupported archive format '{archive_format}'" ) if not archive_format: @@ -379,14 +379,12 @@ def list_( try: dirs, files, links = func(name, cached, *args) except OSError as exc: - raise CommandExecutionError( - "Failed to list contents of {}: {}".format(name, exc) - ) + raise CommandExecutionError(f"Failed to list contents of {name}: {exc}") except CommandExecutionError as exc: raise except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError( - "Uncaught exception '{}' when listing contents of {}".format(exc, name) + f"Uncaught exception '{exc}' when listing contents of {name}" ) if clean: @@ -549,10 +547,10 @@ def tar(options, tarfile, sources=None, dest=None, cwd=None, template=None, runa if options: cmd.extend(options.split()) - cmd.extend(["{}".format(tarfile)]) + cmd.extend([f"{tarfile}"]) cmd.extend(_expand_sources(sources)) if dest: - cmd.extend(["-C", "{}".format(dest)]) + cmd.extend(["-C", f"{dest}"]) return __salt__["cmd.run"]( cmd, cwd=cwd, template=template, runas=runas, python_shell=False @@ -591,7 +589,7 @@ def gzip(sourcefile, template=None, runas=None, options=None): cmd = ["gzip"] if options: cmd.append(options) - cmd.append("{}".format(sourcefile)) + cmd.append(f"{sourcefile}") return __salt__["cmd.run"]( cmd, template=template, runas=runas, python_shell=False @@ -630,7 +628,7 @@ def gunzip(gzipfile, template=None, runas=None, options=None): cmd = ["gunzip"] if options: cmd.append(options) - cmd.append("{}".format(gzipfile)) + cmd.append(f"{gzipfile}") return __salt__["cmd.run"]( cmd, template=template, runas=runas, python_shell=False @@ -696,7 +694,7 @@ def cmd_zip(zip_file, sources, template=None, cwd=None, runas=None): salt '*' archive.cmd_zip /tmp/zipfile.zip '/tmp/sourcefile*' """ cmd = ["zip", "-r"] - cmd.append("{}".format(zip_file)) + cmd.append(f"{zip_file}") cmd.extend(_expand_sources(sources)) return __salt__["cmd.run"]( cmd, cwd=cwd, template=template, runas=runas, python_shell=False @@ -771,7 +769,7 @@ def zip_(zip_file, sources, template=None, cwd=None, runas=None, zip64=False): egid = os.getegid() uinfo = __salt__["user.info"](runas) if not uinfo: - raise SaltInvocationError("User '{}' does not exist".format(runas)) + raise SaltInvocationError(f"User '{runas}' does not exist") zip_file, sources = _render_filenames(zip_file, sources, None, template) sources = _expand_sources(sources) @@ -846,7 +844,7 @@ def zip_(zip_file, sources, template=None, cwd=None, runas=None, zip64=False): ) else: raise CommandExecutionError( - "Exception encountered creating zipfile: {}".format(exc) + f"Exception encountered creating zipfile: {exc}" ) return archived_files @@ -940,7 +938,7 @@ def cmd_unzip( cmd.extend(["-P", password]) if options: cmd.extend(shlex.split(options)) - cmd.extend(["{}".format(zip_file), "-d", "{}".format(dest)]) + cmd.extend([f"{zip_file}", "-d", f"{dest}"]) if excludes is not None: cmd.append("-x") @@ -1058,7 +1056,7 @@ def unzip( egid = os.getegid() uinfo = __salt__["user.info"](runas) if not uinfo: - raise SaltInvocationError("User '{}' does not exist".format(runas)) + raise SaltInvocationError(f"User '{runas}' does not exist") zip_file, dest = _render_filenames(zip_file, dest, None, template) @@ -1119,9 +1117,7 @@ def unzip( os.setegid(egid) # Wait to raise the exception until euid/egid are restored to avoid # permission errors in writing to minion log. - raise CommandExecutionError( - "Exception encountered unpacking zipfile: {}".format(exc) - ) + raise CommandExecutionError(f"Exception encountered unpacking zipfile: {exc}") finally: # Restore the euid/egid if runas: @@ -1188,7 +1184,7 @@ def is_encrypted(name, clean=False, saltenv="base", source_hash=None, use_etag=F name, saltenv, source_hash=source_hash, use_etag=use_etag ) if not cached: - raise CommandExecutionError("Failed to cache {}".format(name)) + raise CommandExecutionError(f"Failed to cache {name}") archive_info = {"archive location": cached} try: @@ -1197,9 +1193,7 @@ def is_encrypted(name, clean=False, saltenv="base", source_hash=None, use_etag=F except RuntimeError: ret = True except zipfile.BadZipfile: - raise CommandExecutionError( - "{} is not a ZIP file".format(name), info=archive_info - ) + raise CommandExecutionError(f"{name} is not a ZIP file", info=archive_info) except Exception as exc: # pylint: disable=broad-except raise CommandExecutionError(exc, info=archive_info) else: @@ -1257,7 +1251,7 @@ def rar(rarfile, sources, template=None, cwd=None, runas=None): # Globbing for sources (2017.7.0 and later) salt '*' archive.rar /tmp/rarfile.rar '/tmp/sourcefile*' """ - cmd = ["rar", "a", "-idp", "{}".format(rarfile)] + cmd = ["rar", "a", "-idp", f"{rarfile}"] cmd.extend(_expand_sources(sources)) return __salt__["cmd.run"]( cmd, cwd=cwd, template=template, runas=runas, python_shell=False @@ -1303,12 +1297,12 @@ def unrar(rarfile, dest, excludes=None, template=None, runas=None, trim_output=F salt.utils.path.which_bin(("unrar", "rar")), "x", "-idp", - "{}".format(rarfile), + f"{rarfile}", ] if excludes is not None: for exclude in excludes: - cmd.extend(["-x", "{}".format(exclude)]) - cmd.append("{}".format(dest)) + cmd.extend(["-x", f"{exclude}"]) + cmd.append(f"{dest}") files = __salt__["cmd.run"]( cmd, template=template, runas=runas, python_shell=False ).splitlines() @@ -1328,7 +1322,7 @@ def _render_filenames(filenames, zip_file, saltenv, template): # render the path as a template using path_template_engine as the engine if template not in salt.utils.templates.TEMPLATE_REGISTRY: raise CommandExecutionError( - "Attempted to render file paths with unavailable engine {}".format(template) + f"Attempted to render file paths with unavailable engine {template}" ) kwargs = {} @@ -1377,6 +1371,6 @@ def _trim_files(files, trim_output): and len(files) > count ): files = files[:count] - files.append("List trimmed after {} files.".format(count)) + files.append(f"List trimmed after {count} files.") return files diff --git a/salt/modules/arista_pyeapi.py b/salt/modules/arista_pyeapi.py index 1dbd27fd872..9e9abb1a973 100644 --- a/salt/modules/arista_pyeapi.py +++ b/salt/modules/arista_pyeapi.py @@ -398,7 +398,7 @@ def config( context=None, defaults=None, saltenv="base", - **kwargs + **kwargs, ): """ Configures the node with the specified commands. @@ -509,7 +509,7 @@ def config( if config_file: file_str = __salt__["cp.get_file_str"](config_file, saltenv=saltenv) if file_str is False: - raise CommandExecutionError("Source file {} not found".format(config_file)) + raise CommandExecutionError(f"Source file {config_file} not found") log.debug("Fetched from %s", config_file) log.debug(file_str) elif commands: diff --git a/salt/modules/artifactory.py b/salt/modules/artifactory.py index 7eaf9c72458..0f5f8e000ec 100644 --- a/salt/modules/artifactory.py +++ b/salt/modules/artifactory.py @@ -732,7 +732,7 @@ def __save_artifact(artifact_url, target_file, headers): local_file.write(salt.utils.stringutils.to_bytes(f.read())) result["status"] = True result["comment"] = __append_comment( - "Artifact downloaded from URL: {}".format(artifact_url), + f"Artifact downloaded from URL: {artifact_url}", result["comment"], ) result["changes"]["downloaded_file"] = target_file diff --git a/salt/modules/at.py b/salt/modules/at.py index 9c646dfb2e8..449e0f79523 100644 --- a/salt/modules/at.py +++ b/salt/modules/at.py @@ -48,7 +48,7 @@ def _cmd(binary, *args): """ binary = salt.utils.path.which(binary) if not binary: - raise CommandNotFoundError("{}: command not found".format(binary)) + raise CommandNotFoundError(f"{binary}: command not found") cmd = [binary] + list(args) return __salt__["cmd.run_stdout"]([binary] + list(args), python_shell=False) @@ -307,7 +307,7 @@ def atc(jobid): if output is None: return "'at.atc' is not available." elif output == "": - return {"error": "invalid job id '{}'".format(jobid)} + return {"error": f"invalid job id '{jobid}'"} return output @@ -327,7 +327,7 @@ def _atq(**kwargs): month = kwargs.get("month", None) year = kwargs.get("year", None) if year and len(str(year)) == 2: - year = "20{}".format(year) + year = f"20{year}" jobinfo = atq()["jobs"] if not jobinfo: @@ -351,28 +351,28 @@ def _atq(**kwargs): if not hour: pass - elif "{:02d}".format(int(hour)) == job["time"].split(":")[0]: + elif f"{int(hour):02d}" == job["time"].split(":")[0]: pass else: continue if not minute: pass - elif "{:02d}".format(int(minute)) == job["time"].split(":")[1]: + elif f"{int(minute):02d}" == job["time"].split(":")[1]: pass else: continue if not day: pass - elif "{:02d}".format(int(day)) == job["date"].split("-")[2]: + elif f"{int(day):02d}" == job["date"].split("-")[2]: pass else: continue if not month: pass - elif "{:02d}".format(int(month)) == job["date"].split("-")[1]: + elif f"{int(month):02d}" == job["date"].split("-")[1]: pass else: continue diff --git a/salt/modules/at_solaris.py b/salt/modules/at_solaris.py index ee8e2e67b35..bebc6118c72 100644 --- a/salt/modules/at_solaris.py +++ b/salt/modules/at_solaris.py @@ -95,7 +95,7 @@ def atq(tag=None): job = str(job) # search for any tags - atjob_file = "/var/spool/cron/atjobs/{job}".format(job=job) + atjob_file = f"/var/spool/cron/atjobs/{job}" if __salt__["file.file_exists"](atjob_file): with salt.utils.files.fopen(atjob_file, "r") as atjob: for line in atjob: @@ -162,7 +162,7 @@ def atrm(*args): # call atrm for each job in ret['jobs']['removed'] for job in ret["jobs"]["removed"]: - res_job = __salt__["cmd.run_all"]("atrm {job}".format(job=job)) + res_job = __salt__["cmd.run_all"](f"atrm {job}") if res_job["retcode"] > 0: if "failed" not in ret["jobs"]: ret["jobs"]["failed"] = {} @@ -205,9 +205,7 @@ def at(*args, **kwargs): # pylint: disable=C0103 cmd_kwargs = {"stdin": stdin, "python_shell": False} if "runas" in kwargs: cmd_kwargs["runas"] = kwargs["runas"] - res = __salt__["cmd.run_all"]( - 'at "{timespec}"'.format(timespec=args[0]), **cmd_kwargs - ) + res = __salt__["cmd.run_all"](f'at "{args[0]}"', **cmd_kwargs) # verify job creation if res["retcode"] > 0: @@ -233,14 +231,14 @@ def atc(jobid): salt '*' at.atc """ - atjob_file = "/var/spool/cron/atjobs/{job}".format(job=jobid) + atjob_file = f"/var/spool/cron/atjobs/{jobid}" if __salt__["file.file_exists"](atjob_file): with salt.utils.files.fopen(atjob_file, "r") as rfh: return "".join( [salt.utils.stringutils.to_unicode(x) for x in rfh.readlines()] ) else: - return {"error": "invalid job id '{}'".format(jobid)} + return {"error": f"invalid job id '{jobid}'"} def _atq(**kwargs): @@ -258,7 +256,7 @@ def _atq(**kwargs): month = kwargs.get("month", None) year = kwargs.get("year", None) if year and len(str(year)) == 2: - year = "20{}".format(year) + year = f"20{year}" jobinfo = atq()["jobs"] if not jobinfo: @@ -282,28 +280,28 @@ def _atq(**kwargs): if not hour: pass - elif "{:02d}".format(int(hour)) == job["time"].split(":")[0]: + elif f"{int(hour):02d}" == job["time"].split(":")[0]: pass else: continue if not minute: pass - elif "{:02d}".format(int(minute)) == job["time"].split(":")[1]: + elif f"{int(minute):02d}" == job["time"].split(":")[1]: pass else: continue if not day: pass - elif "{:02d}".format(int(day)) == job["date"].split("-")[2]: + elif f"{int(day):02d}" == job["date"].split("-")[2]: pass else: continue if not month: pass - elif "{:02d}".format(int(month)) == job["date"].split("-")[1]: + elif f"{int(month):02d}" == job["date"].split("-")[1]: pass else: continue diff --git a/salt/modules/augeas_cfg.py b/salt/modules/augeas_cfg.py index 6fd455235af..adc4fa22b21 100644 --- a/salt/modules/augeas_cfg.py +++ b/salt/modules/augeas_cfg.py @@ -190,7 +190,7 @@ def execute(context=None, lens=None, commands=(), load_path=None): cmd, arg = command.split(" ", 1) if cmd not in METHOD_MAP: - ret["error"] = "Command {} is not supported (yet)".format(cmd) + ret["error"] = f"Command {cmd} is not supported (yet)" return ret method = METHOD_MAP[cmd] @@ -199,7 +199,7 @@ def execute(context=None, lens=None, commands=(), load_path=None): parts = salt.utils.args.shlex_split(arg) if len(parts) not in nargs: - err = "{} takes {} args: {}".format(method, nargs, parts) + err = f"{method} takes {nargs} args: {parts}" raise ValueError(err) if method == "set": path = make_path(parts[0]) @@ -217,9 +217,7 @@ def execute(context=None, lens=None, commands=(), load_path=None): elif method == "insert": label, where, path = parts if where not in ("before", "after"): - raise ValueError( - 'Expected "before" or "after", not {}'.format(where) - ) + raise ValueError(f'Expected "before" or "after", not {where}') path = make_path(path) args = {"path": path, "label": label, "before": where == "before"} elif method == "remove": @@ -231,7 +229,7 @@ def execute(context=None, lens=None, commands=(), load_path=None): if "arg" not in locals(): arg = command ret["error"] = ( - "Invalid formatted command, see debug log for details: {}".format(arg) + f"Invalid formatted command, see debug log for details: {arg}" ) return ret @@ -374,7 +372,7 @@ def setvalue(*args): try: aug.set(target_path, str(value)) except ValueError as err: - ret["error"] = "Multiple values: {}".format(err) + ret["error"] = f"Multiple values: {err}" try: aug.save() diff --git a/salt/modules/aws_sqs.py b/salt/modules/aws_sqs.py index e85417faf1a..428f4062dad 100644 --- a/salt/modules/aws_sqs.py +++ b/salt/modules/aws_sqs.py @@ -23,7 +23,7 @@ def _region(region): """ Return the region argument. """ - return " --region {r}".format(r=region) + return f" --region {region}" def _run_aws(cmd, region, opts, user, **kwargs): @@ -49,7 +49,7 @@ def _run_aws(cmd, region, opts, user, **kwargs): if num: kwargs["max-number-of-messages"] = num - _formatted_args = ['--{} "{}"'.format(k, v) for k, v in kwargs.items()] + _formatted_args = [f'--{k} "{v}"' for k, v in kwargs.items()] cmd = "aws sqs {cmd} {args} {region} {out}".format( cmd=cmd, args=" ".join(_formatted_args), region=_region(region), out=_OUTPUT @@ -245,7 +245,7 @@ def delete_queue(name, region, opts=None, user=None): rtn = _run_aws("delete-queue", region=region, opts=opts, user=user, **delete) success = True err = "" - out = "{} deleted".format(name) + out = f"{name} deleted" else: out = "" diff --git a/salt/modules/azurearm_compute.py b/salt/modules/azurearm_compute.py index 61ff7f85b2f..4b29e657dd8 100644 --- a/salt/modules/azurearm_compute.py +++ b/salt/modules/azurearm_compute.py @@ -156,7 +156,7 @@ def availability_set_create_or_update( "compute", "AvailabilitySet", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -171,9 +171,7 @@ def availability_set_create_or_update( __utils__["azurearm.log_cloud_error"]("compute", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result diff --git a/salt/modules/azurearm_dns.py b/salt/modules/azurearm_dns.py index e503712f264..537a4f7608b 100644 --- a/salt/modules/azurearm_dns.py +++ b/salt/modules/azurearm_dns.py @@ -146,7 +146,7 @@ def record_set_create_or_update(name, zone_name, resource_group, record_type, ** "dns", "RecordSet", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -164,9 +164,7 @@ def record_set_create_or_update(name, zone_name, resource_group, record_type, ** __utils__["azurearm.log_cloud_error"]("dns", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -394,7 +392,7 @@ def zone_create_or_update(name, resource_group, **kwargs): try: zone_model = __utils__["azurearm.create_object_model"]("dns", "Zone", **kwargs) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -410,9 +408,7 @@ def zone_create_or_update(name, resource_group, **kwargs): __utils__["azurearm.log_cloud_error"]("dns", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result diff --git a/salt/modules/azurearm_network.py b/salt/modules/azurearm_network.py index c8e520c3cf2..e22c92359b8 100644 --- a/salt/modules/azurearm_network.py +++ b/salt/modules/azurearm_network.py @@ -216,7 +216,7 @@ def default_security_rule_get(name, security_group, resource_group, **kwargs): if default_rule["name"] == name: result = default_rule if not result: - result = {"error": "Unable to find {} in {}!".format(name, security_group)} + result = {"error": f"Unable to find {name} in {security_group}!"} except KeyError as exc: log.error("Unable to find %s in %s!", name, security_group) result = {"error": str(exc)} @@ -311,7 +311,7 @@ def security_rule_create_or_update( destination_address_prefixes=None, source_port_ranges=None, destination_port_ranges=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -398,7 +398,7 @@ def security_rule_create_or_update( # pylint: disable=eval-used if eval(params[0]): # pylint: disable=exec-used - exec("{} = None".format(params[1])) + exec(f"{params[1]} = None") netconn = __utils__["azurearm.get_client"]("network", **kwargs) @@ -419,10 +419,10 @@ def security_rule_create_or_update( destination_port_range=destination_port_range, destination_address_prefixes=destination_address_prefixes, destination_address_prefix=destination_address_prefix, - **kwargs + **kwargs, ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -439,9 +439,7 @@ def security_rule_create_or_update( __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -559,7 +557,7 @@ def network_security_group_create_or_update( "network", "NetworkSecurityGroup", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -575,9 +573,7 @@ def network_security_group_create_or_update( __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -817,7 +813,7 @@ def subnet_create_or_update( nsg = network_security_group_get( name=kwargs["network_security_group"], resource_group=resource_group, - **kwargs + **kwargs, ) if "error" not in nsg: kwargs["network_security_group"] = {"id": str(nsg["id"])} @@ -836,10 +832,10 @@ def subnet_create_or_update( "Subnet", address_prefix=address_prefix, resource_group=resource_group, - **kwargs + **kwargs, ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -856,9 +852,7 @@ def subnet_create_or_update( __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -1014,10 +1008,10 @@ def virtual_network_create_or_update(name, address_prefixes, resource_group, **k "VirtualNetwork", address_space=address_space, dhcp_options=dhcp_options, - **kwargs + **kwargs, ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -1033,9 +1027,7 @@ def virtual_network_create_or_update(name, address_prefixes, resource_group, **k __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -1238,7 +1230,7 @@ def load_balancer_create_or_update(name, resource_group, **kwargs): pub_ip = public_ip_address_get( name=kwargs["frontend_ip_configurations"][idx]["public_ip_address"], resource_group=resource_group, - **kwargs + **kwargs, ) if "error" not in pub_ip: kwargs["frontend_ip_configurations"][idx]["public_ip_address"] = { @@ -1252,7 +1244,7 @@ def load_balancer_create_or_update(name, resource_group, **kwargs): subnets = subnets_list( virtual_network=vnet, resource_group=resource_group, - **kwargs + **kwargs, ) if ( kwargs["frontend_ip_configurations"][idx]["subnet"] @@ -1364,7 +1356,7 @@ def load_balancer_create_or_update(name, resource_group, **kwargs): "network", "LoadBalancer", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -1380,9 +1372,7 @@ def load_balancer_create_or_update(name, resource_group, **kwargs): __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -1562,7 +1552,7 @@ def network_interface_create_or_update( nsg = network_security_group_get( name=kwargs["network_security_group"], resource_group=resource_group, - **kwargs + **kwargs, ) if "error" not in nsg: kwargs["network_security_group"] = {"id": str(nsg["id"])} @@ -1581,7 +1571,7 @@ def network_interface_create_or_update( name=subnet, virtual_network=virtual_network, resource_group=resource_group, - **kwargs + **kwargs, ) if "error" not in subnet: subnet = {"id": str(subnet["id"])} @@ -1607,7 +1597,7 @@ def network_interface_create_or_update( pub_ip = public_ip_address_get( name=ipconfig["public_ip_address"], resource_group=resource_group, - **kwargs + **kwargs, ) if "error" not in pub_ip: ipconfig["public_ip_address"] = {"id": str(pub_ip["id"])} @@ -1617,7 +1607,7 @@ def network_interface_create_or_update( "network", "NetworkInterface", ip_configurations=ip_configurations, **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -1633,9 +1623,7 @@ def network_interface_create_or_update( __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -2014,7 +2002,7 @@ def public_ip_address_create_or_update(name, resource_group, **kwargs): "network", "PublicIPAddress", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -2030,9 +2018,7 @@ def public_ip_address_create_or_update(name, resource_group, **kwargs): __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -2225,10 +2211,10 @@ def route_filter_rule_create_or_update( "RouteFilterRule", access=access, communities=communities, - **kwargs + **kwargs, ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -2248,9 +2234,7 @@ def route_filter_rule_create_or_update( __utils__["azurearm.log_cloud_error"]("network", message, **kwargs) result = {"error": message} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -2396,7 +2380,7 @@ def route_filter_create_or_update(name, resource_group, **kwargs): "network", "RouteFilter", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -2412,9 +2396,7 @@ def route_filter_create_or_update(name, resource_group, **kwargs): __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -2567,7 +2549,7 @@ def route_create_or_update( route_table, resource_group, next_hop_ip_address=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -2605,10 +2587,10 @@ def route_create_or_update( address_prefix=address_prefix, next_hop_type=next_hop_type, next_hop_ip_address=next_hop_ip_address, - **kwargs + **kwargs, ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -2625,9 +2607,7 @@ def route_create_or_update( __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -2773,7 +2753,7 @@ def route_table_create_or_update(name, resource_group, **kwargs): "network", "RouteTable", **kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -2789,9 +2769,7 @@ def route_table_create_or_update(name, resource_group, **kwargs): __utils__["azurearm.log_cloud_error"]("network", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result diff --git a/salt/modules/azurearm_resource.py b/salt/modules/azurearm_resource.py index b1b865a81d1..a1a24af4c82 100644 --- a/salt/modules/azurearm_resource.py +++ b/salt/modules/azurearm_resource.py @@ -414,7 +414,7 @@ def deployment_create_or_update( parameters_link=None, deploy_template=None, template_link=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -489,7 +489,7 @@ def deployment_create_or_update( "resource", "DeploymentProperties", **deploy_kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -511,9 +511,7 @@ def deployment_create_or_update( __utils__["azurearm.log_cloud_error"]("resource", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -592,7 +590,7 @@ def deployment_validate( parameters_link=None, deploy_template=None, template_link=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -668,7 +666,7 @@ def deployment_validate( "resource", "DeploymentProperties", **deploy_kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -686,9 +684,7 @@ def deployment_validate( __utils__["azurearm.log_cloud_error"]("resource", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result @@ -981,9 +977,7 @@ def policy_assignment_create(name, scope, definition_name, **kwargs): "resource.policy", "PolicyAssignment", **policy_kwargs ) except TypeError as exc: - result = { - "error": "The object model could not be built. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -995,9 +989,7 @@ def policy_assignment_create(name, scope, definition_name, **kwargs): __utils__["azurearm.log_cloud_error"]("resource", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} else: result = { "error": 'The policy definition named "{}" could not be found.'.format( @@ -1146,7 +1138,7 @@ def policy_definition_create_or_update( "resource.policy", "PolicyDefinition", **policy_kwargs ) except TypeError as exc: - result = {"error": "The object model could not be built. ({})".format(str(exc))} + result = {"error": f"The object model could not be built. ({str(exc)})"} return result try: @@ -1158,9 +1150,7 @@ def policy_definition_create_or_update( __utils__["azurearm.log_cloud_error"]("resource", str(exc), **kwargs) result = {"error": str(exc)} except SerializationError as exc: - result = { - "error": "The object model could not be parsed. ({})".format(str(exc)) - } + result = {"error": f"The object model could not be parsed. ({str(exc)})"} return result diff --git a/salt/modules/bamboohr.py b/salt/modules/bamboohr.py index 5cdd05bee8e..e1582ff9a3f 100644 --- a/salt/modules/bamboohr.py +++ b/salt/modules/bamboohr.py @@ -175,8 +175,8 @@ def update_employee(emp_id, key=None, value=None, items=None): xml_items = "" for pair in items: - xml_items += '{}'.format(pair, items[pair]) - xml_items = "{}".format(xml_items) + xml_items += f'{items[pair]}' + xml_items = f"{xml_items}" status, result = _query( action="employees", @@ -259,13 +259,13 @@ def _query(action=None, command=None, args=None, method="GET", data=None): The password can be any random text, so we chose Salty text. """ subdomain = __opts__.get("bamboohr", {}).get("subdomain", None) - path = "https://api.bamboohr.com/api/gateway.php/{}/v1/".format(subdomain) + path = f"https://api.bamboohr.com/api/gateway.php/{subdomain}/v1/" if action: path += action if command: - path += "/{}".format(command) + path += f"/{command}" log.debug("BambooHR URL: %s", path) diff --git a/salt/modules/baredoc.py b/salt/modules/baredoc.py index aa867102bd4..7513b546919 100644 --- a/salt/modules/baredoc.py +++ b/salt/modules/baredoc.py @@ -122,9 +122,9 @@ def _parse_module_docs(module_path, mod_name=None): function_name = v if mod_name and "." in mod_name: if function_name == mod_name.split(".")[1]: - ret["{}.{}".format(module_name, function_name)] = doc_string + ret[f"{module_name}.{function_name}"] = doc_string else: - ret["{}.{}".format(module_name, function_name)] = doc_string + ret[f"{module_name}.{function_name}"] = doc_string return salt.utils.doc.strip_rst(ret) diff --git a/salt/modules/bcache.py b/salt/modules/bcache.py index 7e69b45ad57..acd4fdbcd56 100644 --- a/salt/modules/bcache.py +++ b/salt/modules/bcache.py @@ -117,14 +117,14 @@ def attach_(dev=None): "attach", cache, "error", - "Error attaching {} to bcache {}".format(dev, cache), + f"Error attaching {dev} to bcache {cache}", ): return False return _wait( lambda: uuid(dev) == cache, "error", - "{} received attach to bcache {}, but did not comply".format(dev, cache), + f"{dev} received attach to bcache {cache}, but did not comply", ) @@ -153,12 +153,12 @@ def detach(dev=None): return res if res else None log.debug("Detaching %s", dev) - if not _bcsys(dev, "detach", "goaway", "error", "Error detaching {}".format(dev)): + if not _bcsys(dev, "detach", "goaway", "error", f"Error detaching {dev}"): return False return _wait( lambda: uuid(dev) is False, "error", - "{} received detach, but did not comply".format(dev), + f"{dev} received detach, but did not comply", 300, ) @@ -203,12 +203,12 @@ def stop(dev=None): """ if dev is not None: log.warning("Stopping %s, device will only reappear after reregistering!", dev) - if not _bcsys(dev, "stop", "goaway", "error", "Error stopping {}".format(dev)): + if not _bcsys(dev, "stop", "goaway", "error", f"Error stopping {dev}"): return False return _wait( lambda: _sysfs_attr(_bcpath(dev)) is False, "error", - "Device {} did not stop".format(dev), + f"Device {dev} did not stop", 300, ) else: @@ -271,19 +271,19 @@ def back_make(dev, cache_mode="writeback", force=False, attach=True, bucket_size if force: cmd += " --wipe-bcache" - if not _run_all(cmd, "error", "Error creating backing device {}: %s".format(dev)): + if not _run_all(cmd, "error", f"Error creating backing device {dev}: %s"): return False elif not _sysfs_attr( "fs/bcache/register", _devpath(dev), "error", - "Error registering backing device {}".format(dev), + f"Error registering backing device {dev}", ): return False elif not _wait( lambda: _sysfs_attr(_bcpath(dev)) is not False, "error", - "Backing device {} did not register".format(dev), + f"Backing device {dev} did not register", ): return False elif attach: @@ -370,25 +370,23 @@ def cache_make( ) # if wipe was incomplete & part layout remains the same, # this is one condition set where udev would make it accidentally popup again - if not _run_all( - cmd, "error", "Error creating bcache partitions on {}: %s".format(dev) - ): + if not _run_all(cmd, "error", f"Error creating bcache partitions on {dev}: %s"): return False - dev = "{}2".format(dev) + dev = f"{dev}2" # ---------------- Finally, create a cache ---------------- - cmd = "make-bcache --cache /dev/{} --block {} --wipe-bcache".format(dev, block_size) + cmd = f"make-bcache --cache /dev/{dev} --block {block_size} --wipe-bcache" # Actually bucket_size should always have a value, but for testing 0 is possible as well if bucket_size: - cmd += " --bucket {}".format(bucket_size) + cmd += f" --bucket {bucket_size}" - if not _run_all(cmd, "error", "Error creating cache {}: %s".format(dev)): + if not _run_all(cmd, "error", f"Error creating cache {dev}: %s"): return False elif not _wait( lambda: uuid() is not False, "error", - "Cache {} seemingly created OK, but FS did not activate".format(dev), + f"Cache {dev} seemingly created OK, but FS did not activate", ): return False @@ -430,7 +428,7 @@ def config_(dev=None, **kwargs): [spath, key], val, "warn", - "Failed to update {} with {}".format(os.path.join(spath, key), val), + f"Failed to update {os.path.join(spath, key)} with {val}", ) return endres > 0 else: @@ -470,7 +468,7 @@ def status(stats=False, config=False, internals=False, superblock=False, alldevs continue for spath, sdirs, _ in salt.utils.path.os_walk( - "/sys/block/{}".format(block), followlinks=False + f"/sys/block/{block}", followlinks=False ): if "bcache" in sdirs: bdevs.append(os.path.basename(spath)) @@ -514,7 +512,7 @@ def device(dev, stats=False, config=False, internals=False, superblock=False): result = {} if not _sysfs_attr( - _bcpath(dev), None, "error", "{} is not a bcache fo any kind".format(dev) + _bcpath(dev), None, "error", f"{dev} is not a bcache fo any kind" ): return False elif _bcsys(dev, "set"): @@ -632,9 +630,9 @@ def super_(dev): ret = {} res = _run_all( - "bcache-super-show {}".format(dev), + f"bcache-super-show {dev}", "error", - "Error reading superblock on {}: %s".format(dev), + f"Error reading superblock on {dev}: %s", ) if not res: return False @@ -992,18 +990,18 @@ def _wipe(dev): else: wiper = "blkdiscard" - wipe_failmsg = "Error wiping {}: %s".format(dev) + wipe_failmsg = f"Error wiping {dev}: %s" if wiper == "dd": blocks = 4 - cmd = "dd if=/dev/zero of=/dev/{} bs=1M count={}".format(dev, blocks) + cmd = f"dd if=/dev/zero of=/dev/{dev} bs=1M count={blocks}" endres += _run_all(cmd, "warn", wipe_failmsg) # Some stuff (GPT) writes stuff at the end of a dev as well - cmd += " seek={}".format((size / 1024**2) - blocks) + cmd += f" seek={(size / 1024**2) - blocks}" endres += _run_all(cmd, "warn", wipe_failmsg) elif wiper == "blkdiscard": - cmd = "blkdiscard /dev/{}".format(dev) + cmd = f"blkdiscard /dev/{dev}" endres += _run_all(cmd, "warn", wipe_failmsg) # TODO: fix annoying bug failing blkdiscard by trying to discard 1 sector past blkdev endres = 1 diff --git a/salt/modules/beacons.py b/salt/modules/beacons.py index 0a759fbd7e5..e482abcf235 100644 --- a/salt/modules/beacons.py +++ b/salt/modules/beacons.py @@ -138,10 +138,10 @@ def add(name, beacon_data, **kwargs): salt '*' beacons.add ps "[{'processes': {'salt-master': 'stopped', 'apache2': 'stopped'}}]" """ - ret = {"comment": "Failed to add beacon {}.".format(name), "result": False} + ret = {"comment": f"Failed to add beacon {name}.", "result": False} if name in list_(return_yaml=False, **kwargs): - ret["comment"] = "Beacon {} is already configured.".format(name) + ret["comment"] = f"Beacon {name} is already configured." ret["result"] = True return ret @@ -154,12 +154,12 @@ def add(name, beacon_data, **kwargs): beacon_name = name if beacon_name not in list_available(return_yaml=False, **kwargs): - ret["comment"] = 'Beacon "{}" is not available.'.format(beacon_name) + ret["comment"] = f'Beacon "{beacon_name}" is not available.' return ret if "test" in kwargs and kwargs["test"]: ret["result"] = True - ret["comment"] = "Beacon: {} would be added.".format(name) + ret["comment"] = f"Beacon: {name} would be added." else: try: # Attempt to load the beacon module so we have access to the validate function @@ -215,7 +215,7 @@ def add(name, beacon_data, **kwargs): [item in beacons[name] for item in beacon_data] ): ret["result"] = True - ret["comment"] = "Added beacon: {}.".format(name) + ret["comment"] = f"Added beacon: {name}." elif event_ret: ret["result"] = False ret["comment"] = event_ret["comment"] @@ -254,12 +254,12 @@ def modify(name, beacon_data, **kwargs): current_beacons = list_(return_yaml=False, **kwargs) if name not in current_beacons: - ret["comment"] = "Beacon {} is not configured.".format(name) + ret["comment"] = f"Beacon {name} is not configured." return ret if "test" in kwargs and kwargs["test"]: ret["result"] = True - ret["comment"] = "Beacon: {} would be modified.".format(name) + ret["comment"] = f"Beacon: {name} would be modified." else: try: # Attempt to load the beacon module so we have access to the validate function @@ -310,19 +310,17 @@ def modify(name, beacon_data, **kwargs): _new = beacon_data if _new == _current: - ret["comment"] = "Job {} in correct state".format(name) + ret["comment"] = f"Job {name} in correct state" return ret _current_lines = [] for _item in _current: _current_lines.extend( - ["{}:{}\n".format(key, value) for (key, value) in _item.items()] + [f"{key}:{value}\n" for (key, value) in _item.items()] ) _new_lines = [] for _item in _new: - _new_lines.extend( - ["{}:{}\n".format(key, value) for (key, value) in _item.items()] - ) + _new_lines.extend([f"{key}:{value}\n" for (key, value) in _item.items()]) _diff = difflib.unified_diff(_current_lines, _new_lines) ret["changes"] = {} @@ -345,7 +343,7 @@ def modify(name, beacon_data, **kwargs): beacons = event_ret["beacons"] if name in beacons and beacons[name] == beacon_data: ret["result"] = True - ret["comment"] = "Modified beacon: {}.".format(name) + ret["comment"] = f"Modified beacon: {name}." elif event_ret: ret["result"] = False ret["comment"] = event_ret["comment"] @@ -382,11 +380,11 @@ def delete(name, **kwargs): """ - ret = {"comment": "Failed to delete beacon {}.".format(name), "result": False} + ret = {"comment": f"Failed to delete beacon {name}.", "result": False} if "test" in kwargs and kwargs["test"]: ret["result"] = True - ret["comment"] = "Beacon: {} would be deleted.".format(name) + ret["comment"] = f"Beacon: {name} would be deleted." else: try: with salt.utils.event.get_event( @@ -404,7 +402,7 @@ def delete(name, **kwargs): beacons = event_ret["beacons"] if name not in beacons: ret["result"] = True - ret["comment"] = "Deleted beacon: {}.".format(name) + ret["comment"] = f"Deleted beacon: {name}." return ret elif event_ret: ret["result"] = False @@ -456,11 +454,9 @@ def save(**kwargs): try: with salt.utils.files.fopen(sfn, "w+") as fp_: fp_.write(yaml_out) - ret["comment"] = "Beacons saved to {}.".format(sfn) + ret["comment"] = f"Beacons saved to {sfn}." except OSError: - ret["comment"] = ( - "Unable to write to beacons file at {}. Check permissions.".format(sfn) - ) + ret["comment"] = f"Unable to write to beacons file at {sfn}. Check permissions." ret["result"] = False return ret @@ -603,11 +599,11 @@ def enable_beacon(name, **kwargs): return ret if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Beacon {} would be enabled.".format(name) + ret["comment"] = f"Beacon {name} would be enabled." else: _beacons = list_(return_yaml=False, **kwargs) if name not in _beacons: - ret["comment"] = "Beacon {} is not currently configured.".format(name) + ret["comment"] = f"Beacon {name} is not currently configured." ret["result"] = False return ret @@ -632,11 +628,11 @@ def enable_beacon(name, **kwargs): and beacon_config_dict["enabled"] ): ret["result"] = True - ret["comment"] = "Enabled beacon {} on minion.".format(name) + ret["comment"] = f"Enabled beacon {name} on minion." else: ret["result"] = False ret["comment"] = ( - "Failed to enable beacon {} on minion.".format(name) + f"Failed to enable beacon {name} on minion." ) elif event_ret: ret["result"] = False @@ -685,7 +681,7 @@ def disable_beacon(name, **kwargs): else: _beacons = list_(return_yaml=False, **kwargs) if name not in _beacons: - ret["comment"] = "Beacon {} is not currently configured.".format(name) + ret["comment"] = f"Beacon {name} is not currently configured." ret["result"] = False return ret diff --git a/salt/modules/bigip.py b/salt/modules/bigip.py index 219afea9726..6624b85c6f8 100644 --- a/salt/modules/bigip.py +++ b/salt/modules/bigip.py @@ -48,9 +48,7 @@ def _build_session(username, password, trans_label=None): if trans_label: # pull the trans id from the grain - trans_id = __salt__["grains.get"]( - "bigip_f5_trans:{label}".format(label=trans_label) - ) + trans_id = __salt__["grains.get"](f"bigip_f5_trans:{trans_label}") if trans_id: bigip.headers.update({"X-F5-REST-Coordination-Id": trans_id}) @@ -311,7 +309,7 @@ def list_transaction(hostname, username, password, label): bigip_session = _build_session(username, password) # pull the trans id from the grain - trans_id = __salt__["grains.get"]("bigip_f5_trans:{label}".format(label=label)) + trans_id = __salt__["grains.get"](f"bigip_f5_trans:{label}") if trans_id: @@ -319,7 +317,7 @@ def list_transaction(hostname, username, password, label): try: response = bigip_session.get( BIG_IP_URL_BASE.format(host=hostname) - + "/transaction/{trans_id}/commands".format(trans_id=trans_id) + + f"/transaction/{trans_id}/commands" ) return _load_response(response) except requests.exceptions.ConnectionError as e: @@ -356,7 +354,7 @@ def commit_transaction(hostname, username, password, label): bigip_session = _build_session(username, password) # pull the trans id from the grain - trans_id = __salt__["grains.get"]("bigip_f5_trans:{label}".format(label=label)) + trans_id = __salt__["grains.get"](f"bigip_f5_trans:{label}") if trans_id: @@ -366,8 +364,7 @@ def commit_transaction(hostname, username, password, label): # patch to REST to get trans id try: response = bigip_session.patch( - BIG_IP_URL_BASE.format(host=hostname) - + "/transaction/{trans_id}".format(trans_id=trans_id), + BIG_IP_URL_BASE.format(host=hostname) + f"/transaction/{trans_id}", data=salt.utils.json.dumps(payload), ) return _load_response(response) @@ -405,15 +402,14 @@ def delete_transaction(hostname, username, password, label): bigip_session = _build_session(username, password) # pull the trans id from the grain - trans_id = __salt__["grains.get"]("bigip_f5_trans:{label}".format(label=label)) + trans_id = __salt__["grains.get"](f"bigip_f5_trans:{label}") if trans_id: # patch to REST to get trans id try: response = bigip_session.delete( - BIG_IP_URL_BASE.format(host=hostname) - + "/transaction/{trans_id}".format(trans_id=trans_id) + BIG_IP_URL_BASE.format(host=hostname) + f"/transaction/{trans_id}" ) return _load_response(response) except requests.exceptions.ConnectionError as e: @@ -457,8 +453,7 @@ def list_node(hostname, username, password, name=None, trans_label=None): try: if name: response = bigip_session.get( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/node/{name}".format(name=name) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/node/{name}" ) else: response = bigip_session.get( @@ -593,8 +588,7 @@ def modify_node( # put to REST try: response = bigip_session.put( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/node/{name}".format(name=name), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/node/{name}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -632,7 +626,7 @@ def delete_node(hostname, username, password, name, trans_label=None): # delete to REST try: response = bigip_session.delete( - BIG_IP_URL_BASE.format(host=hostname) + "/ltm/node/{name}".format(name=name) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/node/{name}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -672,7 +666,7 @@ def list_pool(hostname, username, password, name=None): if name: response = bigip_session.get( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/pool/{name}/?expandSubcollections=true".format(name=name) + + f"/ltm/pool/{name}/?expandSubcollections=true" ) else: response = bigip_session.get( @@ -991,8 +985,7 @@ def modify_pool( # post to REST try: response = bigip_session.put( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/pool/{name}".format(name=name), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/pool/{name}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -1027,7 +1020,7 @@ def delete_pool(hostname, username, password, name): # delete to REST try: response = bigip_session.delete( - BIG_IP_URL_BASE.format(host=hostname) + "/ltm/pool/{name}".format(name=name) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/pool/{name}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -1098,8 +1091,7 @@ def replace_pool_members(hostname, username, password, name, members): # put to REST try: response = bigip_session.put( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/pool/{name}".format(name=name), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/pool/{name}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -1155,8 +1147,7 @@ def add_pool_member(hostname, username, password, name, member): # post to REST try: response = bigip_session.post( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/pool/{name}/members".format(name=name), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/pool/{name}/members", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -1254,7 +1245,7 @@ def modify_pool_member( try: response = bigip_session.put( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/pool/{name}/members/{member}".format(name=name, member=member), + + f"/ltm/pool/{name}/members/{member}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -1291,8 +1282,7 @@ def delete_pool_member(hostname, username, password, name, member): # delete to REST try: response = bigip_session.delete( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/pool/{name}/members/{member}".format(name=name, member=member) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/pool/{name}/members/{member}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -1332,7 +1322,7 @@ def list_virtual(hostname, username, password, name=None): if name: response = bigip_session.get( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/virtual/{name}/?expandSubcollections=true".format(name=name) + + f"/ltm/virtual/{name}/?expandSubcollections=true" ) else: response = bigip_session.get( @@ -1925,8 +1915,7 @@ def modify_virtual( # put to REST try: response = bigip_session.put( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/virtual/{name}".format(name=name), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/virtual/{name}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -1961,8 +1950,7 @@ def delete_virtual(hostname, username, password, name): # delete to REST try: response = bigip_session.delete( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/virtual/{name}".format(name=name) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/virtual/{name}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -2017,8 +2005,7 @@ def list_monitor( ) else: response = bigip_session.get( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/monitor/{type}".format(type=monitor_type) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/monitor/{monitor_type}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -2069,8 +2056,7 @@ def create_monitor(hostname, username, password, monitor_type, name, **kwargs): # post to REST try: response = bigip_session.post( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/monitor/{type}".format(type=monitor_type), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/monitor/{monitor_type}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -2123,7 +2109,7 @@ def modify_monitor(hostname, username, password, monitor_type, name, **kwargs): try: response = bigip_session.put( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/monitor/{type}/{name}".format(type=monitor_type, name=name), + + f"/ltm/monitor/{monitor_type}/{name}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -2162,7 +2148,7 @@ def delete_monitor(hostname, username, password, monitor_type, name): try: response = bigip_session.delete( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/monitor/{type}/{name}".format(type=monitor_type, name=name) + + f"/ltm/monitor/{monitor_type}/{name}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -2217,8 +2203,7 @@ def list_profile( ) else: response = bigip_session.get( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/profile/{type}".format(type=profile_type) + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/profile/{profile_type}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) @@ -2302,8 +2287,7 @@ def create_profile(hostname, username, password, profile_type, name, **kwargs): # post to REST try: response = bigip_session.post( - BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/profile/{type}".format(type=profile_type), + BIG_IP_URL_BASE.format(host=hostname) + f"/ltm/profile/{profile_type}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -2396,7 +2380,7 @@ def modify_profile(hostname, username, password, profile_type, name, **kwargs): try: response = bigip_session.put( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/profile/{type}/{name}".format(type=profile_type, name=name), + + f"/ltm/profile/{profile_type}/{name}", data=salt.utils.json.dumps(payload), ) except requests.exceptions.ConnectionError as e: @@ -2435,7 +2419,7 @@ def delete_profile(hostname, username, password, profile_type, name): try: response = bigip_session.delete( BIG_IP_URL_BASE.format(host=hostname) - + "/ltm/profile/{type}/{name}".format(type=profile_type, name=name) + + f"/ltm/profile/{profile_type}/{name}" ) except requests.exceptions.ConnectionError as e: return _load_connection_error(hostname, e) diff --git a/salt/modules/bluez_bluetooth.py b/salt/modules/bluez_bluetooth.py index 043c404bb73..1813e7014ef 100644 --- a/salt/modules/bluez_bluetooth.py +++ b/salt/modules/bluez_bluetooth.py @@ -81,7 +81,7 @@ def address_(): dev = comps[0] ret[dev] = { "device": dev, - "path": "/sys/class/bluetooth/{}".format(dev), + "path": f"/sys/class/bluetooth/{dev}", } if "BD Address" in line: comps = line.split() @@ -113,7 +113,7 @@ def power(dev, mode): else: state = "down" mode = "off" - cmd = "hciconfig {} {}".format(dev, state) + cmd = f"hciconfig {dev} {state}" __salt__["cmd.run"](cmd).splitlines() info = address_() if info[dev]["power"] == mode: @@ -134,9 +134,9 @@ def discoverable(dev): if dev not in address_(): raise CommandExecutionError("Invalid dev passed to bluetooth.discoverable") - cmd = "hciconfig {} iscan".format(dev) + cmd = f"hciconfig {dev} iscan" __salt__["cmd.run"](cmd).splitlines() - cmd = "hciconfig {}".format(dev) + cmd = f"hciconfig {dev}" out = __salt__["cmd.run"](cmd) if "UP RUNNING ISCAN" in out: return True @@ -156,9 +156,9 @@ def noscan(dev): if dev not in address_(): raise CommandExecutionError("Invalid dev passed to bluetooth.noscan") - cmd = "hciconfig {} noscan".format(dev) + cmd = f"hciconfig {dev} noscan" __salt__["cmd.run"](cmd).splitlines() - cmd = "hciconfig {}".format(dev) + cmd = f"hciconfig {dev}" out = __salt__["cmd.run"](cmd) if "SCAN" in out: return False @@ -195,7 +195,7 @@ def block(bdaddr): if not salt.utils.validate.net.mac(bdaddr): raise CommandExecutionError("Invalid BD address passed to bluetooth.block") - cmd = "hciconfig {} block".format(bdaddr) + cmd = f"hciconfig {bdaddr} block" __salt__["cmd.run"](cmd).splitlines() @@ -212,7 +212,7 @@ def unblock(bdaddr): if not salt.utils.validate.net.mac(bdaddr): raise CommandExecutionError("Invalid BD address passed to bluetooth.unblock") - cmd = "hciconfig {} unblock".format(bdaddr) + cmd = f"hciconfig {bdaddr} unblock" __salt__["cmd.run"](cmd).splitlines() @@ -268,7 +268,7 @@ def unpair(address): if not salt.utils.validate.net.mac(address): raise CommandExecutionError("Invalid BD address passed to bluetooth.unpair") - cmd = "bluez-test-device remove {}".format(address) + cmd = f"bluez-test-device remove {address}" out = __salt__["cmd.run"](cmd).splitlines() return out diff --git a/salt/modules/boto3_elasticache.py b/salt/modules/boto3_elasticache.py index 1e52ea25a2c..ec644d92ccb 100644 --- a/salt/modules/boto3_elasticache.py +++ b/salt/modules/boto3_elasticache.py @@ -107,7 +107,7 @@ def _describe_resource( key=None, keyid=None, profile=None, - **args + **args, ): if conn is None: conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) @@ -115,9 +115,7 @@ def _describe_resource( func = "describe_" + res_type + "s" f = getattr(conn, func) except (AttributeError, KeyError) as e: - raise SaltInvocationError( - "No function '{}()' found: {}".format(func, e.message) - ) + raise SaltInvocationError(f"No function '{func}()' found: {e.message}") # Undocumented, but you can't pass 'Marker' if searching for a specific resource... args.update({name_param: name} if name else {"Marker": ""}) args = {k: v for k, v in args.items() if not k.startswith("_")} @@ -140,7 +138,7 @@ def _delete_resource( key=None, keyid=None, profile=None, - **args + **args, ): """ Delete a generic Elasticache resource. @@ -171,9 +169,7 @@ def _delete_resource( func = "describe_" + res_type + "s" s = globals()[func] except (AttributeError, KeyError) as e: - raise SaltInvocationError( - "No function '{}()' found: {}".format(func, e.message) - ) + raise SaltInvocationError(f"No function '{func}()' found: {e.message}") try: f(**args) @@ -211,7 +207,7 @@ def _create_resource( key=None, keyid=None, profile=None, - **args + **args, ): try: wait = int(wait) @@ -239,9 +235,7 @@ def _create_resource( func = "describe_" + res_type + "s" s = globals()[func] except (AttributeError, KeyError) as e: - raise SaltInvocationError( - "No function '{}()' found: {}".format(func, e.message) - ) + raise SaltInvocationError(f"No function '{func}()' found: {e.message}") try: f(**args) if not wait: @@ -270,7 +264,7 @@ def _create_resource( ) return False except botocore.exceptions.ClientError as e: - msg = "Failed to create {} {}: {}".format(desc, name, e) + msg = f"Failed to create {desc} {name}: {e}" log.error(msg) return False @@ -287,7 +281,7 @@ def _modify_resource( key=None, keyid=None, profile=None, - **args + **args, ): try: wait = int(wait) @@ -315,9 +309,7 @@ def _modify_resource( func = "describe_" + res_type + "s" s = globals()[func] except (AttributeError, KeyError) as e: - raise SaltInvocationError( - "No function '{}()' found: {}".format(func, e.message) - ) + raise SaltInvocationError(f"No function '{func}()' found: {e.message}") try: f(**args) if not wait: @@ -346,7 +338,7 @@ def _modify_resource( ) return False except botocore.exceptions.ClientError as e: - msg = "Failed to modify {} {}: {}".format(desc, name, e) + msg = f"Failed to modify {desc} {name}: {e}" log.error(msg) return False @@ -374,7 +366,7 @@ def describe_cache_clusters( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -405,7 +397,7 @@ def create_cache_cluster( key=None, keyid=None, profile=None, - **args + **args, ): """ Create a cache cluster. @@ -442,7 +434,7 @@ def create_cache_cluster( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -454,7 +446,7 @@ def modify_cache_cluster( key=None, keyid=None, profile=None, - **args + **args, ): """ Update a cache cluster in place. @@ -496,7 +488,7 @@ def modify_cache_cluster( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -523,7 +515,7 @@ def delete_cache_cluster( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -578,7 +570,7 @@ def create_replication_group( key=None, keyid=None, profile=None, - **args + **args, ): """ Create a replication group. @@ -615,7 +607,7 @@ def create_replication_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -627,7 +619,7 @@ def modify_replication_group( key=None, keyid=None, profile=None, - **args + **args, ): """ Modify a replication group. @@ -661,7 +653,7 @@ def modify_replication_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -688,7 +680,7 @@ def delete_replication_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -783,13 +775,13 @@ def create_cache_subnet_group( ).get("subnets") if not sn: raise SaltInvocationError( - "Could not resolve Subnet Name {} to an ID.".format(subnet) + f"Could not resolve Subnet Name {subnet} to an ID." ) if len(sn) == 1: args["SubnetIds"] += [sn[0]["id"]] elif len(sn) > 1: raise CommandExecutionError( - "Subnet Name {} returned more than one ID.".format(subnet) + f"Subnet Name {subnet} returned more than one ID." ) args = {k: v for k, v in args.items() if not k.startswith("_")} return _create_resource( @@ -801,7 +793,7 @@ def create_cache_subnet_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -836,14 +828,14 @@ def modify_cache_subnet_group( args["SubnetIds"] += [sn[0]["id"]] elif len(sn) > 1: raise CommandExecutionError( - "Subnet Name {} returned more than one ID.".format(subnet) + f"Subnet Name {subnet} returned more than one ID." ) elif subnet.startswith("subnet-"): # Moderately safe assumption... :) Will be caught later if incorrect. args["SubnetIds"] += [subnet] else: raise SaltInvocationError( - "Could not resolve Subnet Name {} to an ID.".format(subnet) + f"Could not resolve Subnet Name {subnet} to an ID." ) args = {k: v for k, v in args.items() if not k.startswith("_")} return _modify_resource( @@ -855,7 +847,7 @@ def modify_cache_subnet_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -880,7 +872,7 @@ def delete_cache_subnet_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -948,7 +940,7 @@ def create_cache_security_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -973,7 +965,7 @@ def delete_cache_security_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -1264,7 +1256,7 @@ def create_cache_parameter_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) @@ -1289,5 +1281,5 @@ def delete_cache_parameter_group( key=key, keyid=keyid, profile=profile, - **args + **args, ) diff --git a/salt/modules/boto_apigateway.py b/salt/modules/boto_apigateway.py index c889f272648..ccaeb163ac5 100644 --- a/salt/modules/boto_apigateway.py +++ b/salt/modules/boto_apigateway.py @@ -132,7 +132,7 @@ def _convert_datetime_str(response): if response: return dict( [ - (k, "{}".format(v)) if isinstance(v, datetime.date) else (k, v) + (k, f"{v}") if isinstance(v, datetime.date) else (k, v) for k, v in response.items() ] ) @@ -379,9 +379,9 @@ def create_api_resources( conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) for path_part in path_parts: if current_path == "/": - current_path = "{}{}".format(current_path, path_part) + current_path = f"{current_path}{path_part}" else: - current_path = "{}/{}".format(current_path, path_part) + current_path = f"{current_path}/{path_part}" r = describe_api_resource( restApiId, current_path, @@ -432,7 +432,7 @@ def delete_api_resources( conn.delete_resource(restApiId=restApiId, resourceId=resource["id"]) return {"deleted": True} else: - return {"deleted": False, "error": "no resource found by {}".format(path)} + return {"deleted": False, "error": f"no resource found by {path}"} except ClientError as e: return {"created": False, "error": __utils__["boto3.get_error"](e)} @@ -896,12 +896,12 @@ def overwrite_api_stage_variables( for old_var in old_vars: if old_var not in variables: patch_ops.append( - dict(op="remove", path="/variables/{}".format(old_var), value="") + dict(op="remove", path=f"/variables/{old_var}", value="") ) for var, val in variables.items(): if var not in old_vars or old_vars[var] != val: patch_ops.append( - dict(op="replace", path="/variables/{}".format(var), value=val) + dict(op="replace", path=f"/variables/{var}", value=val) ) if patch_ops: @@ -1623,7 +1623,7 @@ def _get_role_arn(name, region=None, key=None, keyid=None, profile=None): region=region, key=key, keyid=keyid, profile=profile ) - return "arn:aws:iam::{}:role/{}".format(account_id, name) + return f"arn:aws:iam::{account_id}:role/{name}" def create_api_integration( @@ -1800,7 +1800,7 @@ def _validate_throttle(throttle): if throttle is not None: if not isinstance(throttle, dict): raise TypeError( - "throttle must be a dictionary, provided value: {}".format(throttle) + f"throttle must be a dictionary, provided value: {throttle}" ) @@ -1810,9 +1810,7 @@ def _validate_quota(quota): """ if quota is not None: if not isinstance(quota, dict): - raise TypeError( - "quota must be a dictionary, provided value: {}".format(quota) - ) + raise TypeError(f"quota must be a dictionary, provided value: {quota}") periods = ["DAY", "WEEK", "MONTH"] if "period" not in quota or quota["period"] not in periods: raise ValueError( diff --git a/salt/modules/boto_asg.py b/salt/modules/boto_asg.py index a3ff1619b78..9d915c34ddb 100644 --- a/salt/modules/boto_asg.py +++ b/salt/modules/boto_asg.py @@ -120,7 +120,7 @@ def exists(name, region=None, key=None, keyid=None, profile=None): if _conn: return True else: - msg = "The autoscale group does not exist in region {}".format(region) + msg = f"The autoscale group does not exist in region {region}" log.debug(msg) return False except boto.exception.BotoServerError as e: @@ -430,12 +430,12 @@ def update( key = tag.get("key") except KeyError: log.error("Tag missing key.") - return False, "Tag {} missing key".format(tag) + return False, f"Tag {tag} missing key" try: value = tag.get("value") except KeyError: log.error("Tag missing value.") - return False, "Tag {} missing value".format(tag) + return False, f"Tag {tag} missing value" propagate_at_launch = tag.get("propagate_at_launch", False) _tag = { "key": key, @@ -509,7 +509,7 @@ def update( retries -= 1 continue log.error(e) - msg = "Failed to update ASG {}".format(name) + msg = f"Failed to update ASG {name}" log.error(msg) return False, str(e) @@ -570,7 +570,7 @@ def delete(name, force=False, region=None, key=None, keyid=None, profile=None): while True: try: conn.delete_auto_scaling_group(name, force) - msg = "Deleted autoscale group {}.".format(name) + msg = f"Deleted autoscale group {name}." log.info(msg) return True except boto.exception.BotoServerError as e: @@ -580,7 +580,7 @@ def delete(name, force=False, region=None, key=None, keyid=None, profile=None): retries -= 1 continue log.error(e) - msg = "Failed to delete autoscale group {}".format(name) + msg = f"Failed to delete autoscale group {name}" log.error(msg) return False @@ -822,7 +822,7 @@ def create_launch_configuration( retries -= 1 continue log.error(e) - msg = "Failed to create LC {}".format(name) + msg = f"Failed to create LC {name}" log.error(msg) return False @@ -851,7 +851,7 @@ def delete_launch_configuration(name, region=None, key=None, keyid=None, profile retries -= 1 continue log.error(e) - msg = "Failed to delete LC {}".format(name) + msg = f"Failed to delete LC {name}" log.error(msg) return False diff --git a/salt/modules/boto_cfn.py b/salt/modules/boto_cfn.py index d02e82bc2b3..647bb185e42 100644 --- a/salt/modules/boto_cfn.py +++ b/salt/modules/boto_cfn.py @@ -185,7 +185,7 @@ def create( stack_policy_url, ) except BotoServerError as e: - msg = "Failed to create stack {}.\n{}".format(name, e) + msg = f"Failed to create stack {name}.\n{e}" log.error(msg) log.debug(e) return False @@ -245,7 +245,7 @@ def update_stack( log.debug("Updated result is : %s.", update) return update except BotoServerError as e: - msg = "Failed to update stack {}.".format(name) + msg = f"Failed to update stack {name}." log.debug(e) log.error(msg) return str(e) @@ -266,7 +266,7 @@ def delete(name, region=None, key=None, keyid=None, profile=None): try: return conn.delete_stack(name) except BotoServerError as e: - msg = "Failed to create stack {}.".format(name) + msg = f"Failed to create stack {name}." log.error(msg) log.debug(e) return str(e) @@ -290,7 +290,7 @@ def get_template(name, region=None, key=None, keyid=None, profile=None): return template except BotoServerError as e: log.debug(e) - msg = "Template {} does not exist".format(name) + msg = f"Template {name} does not exist" log.error(msg) return str(e) @@ -321,6 +321,6 @@ def validate_template( return conn.validate_template(template_body, template_url) except BotoServerError as e: log.debug(e) - msg = "Error while trying to validate template {}.".format(template_body) + msg = f"Error while trying to validate template {template_body}." log.error(msg) return str(e) diff --git a/salt/modules/boto_cloudfront.py b/salt/modules/boto_cloudfront.py index e9b72633ea4..33ac1b76652 100644 --- a/salt/modules/boto_cloudfront.py +++ b/salt/modules/boto_cloudfront.py @@ -256,7 +256,7 @@ def export_distributions(region=None, key=None, keyid=None, profile=None): {"config": config}, {"tags": tags}, ] - results["Manage CloudFront distribution {}".format(name)] = { + results[f"Manage CloudFront distribution {name}"] = { "boto_cloudfront.present": distribution_sls_data, } except botocore.exceptions.ClientError as exc: diff --git a/salt/modules/boto_cloudtrail.py b/salt/modules/boto_cloudtrail.py index 31d69846bee..0a789a86150 100644 --- a/salt/modules/boto_cloudtrail.py +++ b/salt/modules/boto_cloudtrail.py @@ -425,7 +425,7 @@ def _get_trail_arn(name, region=None, key=None, keyid=None, profile=None): region = profile["region"] if region is None: region = "us-east-1" - return "arn:aws:cloudtrail:{}:{}:trail/{}".format(region, account_id, name) + return f"arn:aws:cloudtrail:{region}:{account_id}:trail/{name}" def add_tags(Name, region=None, key=None, keyid=None, profile=None, **kwargs): diff --git a/salt/modules/boto_cloudwatch_event.py b/salt/modules/boto_cloudwatch_event.py index 1fd40f018bb..7729cf715b8 100644 --- a/salt/modules/boto_cloudwatch_event.py +++ b/salt/modules/boto_cloudwatch_event.py @@ -215,7 +215,7 @@ def describe(Name, region=None, key=None, keyid=None, profile=None): except ClientError as e: err = __utils__["boto3.get_error"](e) if e.response.get("Error", {}).get("Code") == "RuleNotFoundException": - return {"error": "Rule {} not found".format(Rule)} + return {"error": f"Rule {Rule} not found"} return {"error": __utils__["boto3.get_error"](e)} @@ -271,7 +271,7 @@ def list_targets(Rule, region=None, key=None, keyid=None, profile=None): except ClientError as e: err = __utils__["boto3.get_error"](e) if e.response.get("Error", {}).get("Code") == "RuleNotFoundException": - return {"error": "Rule {} not found".format(Rule)} + return {"error": f"Rule {Rule} not found"} return {"error": __utils__["boto3.get_error"](e)} @@ -300,7 +300,7 @@ def put_targets(Rule, Targets, region=None, key=None, keyid=None, profile=None): except ClientError as e: err = __utils__["boto3.get_error"](e) if e.response.get("Error", {}).get("Code") == "RuleNotFoundException": - return {"error": "Rule {} not found".format(Rule)} + return {"error": f"Rule {Rule} not found"} return {"error": __utils__["boto3.get_error"](e)} @@ -329,5 +329,5 @@ def remove_targets(Rule, Ids, region=None, key=None, keyid=None, profile=None): except ClientError as e: err = __utils__["boto3.get_error"](e) if e.response.get("Error", {}).get("Code") == "RuleNotFoundException": - return {"error": "Rule {} not found".format(Rule)} + return {"error": f"Rule {Rule} not found"} return {"error": __utils__["boto3.get_error"](e)} diff --git a/salt/modules/boto_cognitoidentity.py b/salt/modules/boto_cognitoidentity.py index f675c1682b0..37943d28c1f 100644 --- a/salt/modules/boto_cognitoidentity.py +++ b/salt/modules/boto_cognitoidentity.py @@ -365,7 +365,7 @@ def set_identity_pool_roles( if role_arn is None: return { "set": False, - "error": "invalid AuthenticatedRole {}".format(AuthenticatedRole), + "error": f"invalid AuthenticatedRole {AuthenticatedRole}", } AuthenticatedRole = role_arn diff --git a/salt/modules/boto_datapipeline.py b/salt/modules/boto_datapipeline.py index bdbcebaa16a..b2cc6ca773f 100644 --- a/salt/modules/boto_datapipeline.py +++ b/salt/modules/boto_datapipeline.py @@ -181,7 +181,7 @@ def pipeline_id_from_name(name, region=None, key=None, keyid=None, profile=None) if pipeline["name"] == name: r["result"] = pipeline["id"] return r - r["error"] = "No pipeline found with name={}".format(name) + r["error"] = f"No pipeline found with name={name}" return r diff --git a/salt/modules/boto_ec2.py b/salt/modules/boto_ec2.py index 7ece2dbe6d3..f5f8a7fd3e6 100644 --- a/salt/modules/boto_ec2.py +++ b/salt/modules/boto_ec2.py @@ -685,7 +685,7 @@ def find_instances( if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value if filters: filter_parameters["filters"].update(filters) @@ -810,7 +810,7 @@ def find_images( filter_parameters["filters"]["name"] = ami_name if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value images = conn.get_all_images(**filter_parameters) log.debug( "The filters criteria %s matched the following images:%s", @@ -1516,9 +1516,7 @@ def get_attribute( " command." ) if attribute not in attribute_list: - raise SaltInvocationError( - "Attribute must be one of: {}.".format(attribute_list) - ) + raise SaltInvocationError(f"Attribute must be one of: {attribute_list}.") try: if instance_name: instances = find_instances( @@ -1609,9 +1607,7 @@ def set_attribute( " command." ) if attribute not in attribute_list: - raise SaltInvocationError( - "Attribute must be one of: {}.".format(attribute_list) - ) + raise SaltInvocationError(f"Attribute must be one of: {attribute_list}.") try: if instance_name: instances = find_instances( @@ -1822,7 +1818,7 @@ def create_network_interface( ) vpc_id = vpc_id.get("vpc_id") if not vpc_id: - msg = "subnet_id {} does not map to a valid vpc id.".format(subnet_id) + msg = f"subnet_id {subnet_id} does not map to a valid vpc id." r["error"] = {"message": msg} return r _groups = __salt__["boto_secgroup.convert_to_group_ids"]( @@ -2231,7 +2227,7 @@ def set_volumes_tags( profile=profile, ) if not instance_id: - msg = "Couldn't resolve instance Name {} to an ID.".format(v) + msg = f"Couldn't resolve instance Name {v} to an ID." raise CommandExecutionError(msg) new_filters["attachment.instance_id"] = instance_id else: diff --git a/salt/modules/boto_elasticache.py b/salt/modules/boto_elasticache.py index 656182822bf..fdcec9d4962 100644 --- a/salt/modules/boto_elasticache.py +++ b/salt/modules/boto_elasticache.py @@ -157,7 +157,7 @@ def create_replication_group( if config["status"] == "available": return True except boto.exception.BotoServerError as e: - msg = "Failed to create replication group {}.".format(name) + msg = f"Failed to create replication group {name}." log.error(msg) log.debug(e) return {} @@ -179,12 +179,12 @@ def delete_replication_group(name, region=None, key=None, keyid=None, profile=No return False try: conn.delete_replication_group(name) - msg = "Deleted ElastiCache replication group {}.".format(name) + msg = f"Deleted ElastiCache replication group {name}." log.info(msg) return True except boto.exception.BotoServerError as e: log.debug(e) - msg = "Failed to delete ElastiCache replication group {}".format(name) + msg = f"Failed to delete ElastiCache replication group {name}" log.error(msg) return False @@ -208,7 +208,7 @@ def describe_replication_group( try: cc = conn.describe_replication_groups(name) except boto.exception.BotoServerError as e: - msg = "Failed to get config for cache cluster {}.".format(name) + msg = f"Failed to get config for cache cluster {name}." log.error(msg) log.debug(e) return {} @@ -278,7 +278,7 @@ def get_config(name, region=None, key=None, keyid=None, profile=None): try: cc = conn.describe_cache_clusters(name, show_cache_node_info=True) except boto.exception.BotoServerError as e: - msg = "Failed to get config for cache cluster {}.".format(name) + msg = f"Failed to get config for cache cluster {name}." log.error(msg) log.debug(e) return {} @@ -357,7 +357,7 @@ def get_node_host(name, region=None, key=None, keyid=None, profile=None): try: cc = conn.describe_cache_clusters(name, show_cache_node_info=True) except boto.exception.BotoServerError as e: - msg = "Failed to get config for cache cluster {}.".format(name) + msg = f"Failed to get config for cache cluster {name}." log.error(msg) log.debug(e) return {} @@ -384,7 +384,7 @@ def get_group_host(name, region=None, key=None, keyid=None, profile=None): try: cc = conn.describe_replication_groups(name) except boto.exception.BotoServerError as e: - msg = "Failed to get config for cache cluster {}.".format(name) + msg = f"Failed to get config for cache cluster {name}." log.error(msg) log.debug(e) return {} @@ -465,7 +465,7 @@ def subnet_group_exists( try: ec = conn.describe_cache_subnet_groups(cache_subnet_group_name=name) if not ec: - msg = "ElastiCache subnet group does not exist in region {}".format(region) + msg = f"ElastiCache subnet group does not exist in region {region}" log.debug(msg) return False return True @@ -516,14 +516,14 @@ def create_subnet_group( try: ec = conn.create_cache_subnet_group(name, description, subnet_ids) if not ec: - msg = "Failed to create ElastiCache subnet group {}".format(name) + msg = f"Failed to create ElastiCache subnet group {name}" log.error(msg) return False log.info("Created ElastiCache subnet group %s", name) return True except boto.exception.BotoServerError as e: log.debug(e) - msg = "Failed to create ElastiCache subnet group {}".format(name) + msg = f"Failed to create ElastiCache subnet group {name}" log.error(msg) return False @@ -545,12 +545,12 @@ def get_cache_subnet_group(name, region=None, key=None, keyid=None, profile=None csg = csg["DescribeCacheSubnetGroupsResponse"] csg = csg["DescribeCacheSubnetGroupsResult"]["CacheSubnetGroups"][0] except boto.exception.BotoServerError as e: - msg = "Failed to get cache subnet group {}.".format(name) + msg = f"Failed to get cache subnet group {name}." log.error(msg) log.debug(e) return False except (IndexError, TypeError, KeyError): - msg = "Failed to get cache subnet group {} (2).".format(name) + msg = f"Failed to get cache subnet group {name} (2)." log.error(msg) return False ret = {} @@ -590,12 +590,12 @@ def delete_subnet_group(name, region=None, key=None, keyid=None, profile=None): return False try: conn.delete_cache_subnet_group(name) - msg = "Deleted ElastiCache subnet group {}.".format(name) + msg = f"Deleted ElastiCache subnet group {name}." log.info(msg) return True except boto.exception.BotoServerError as e: log.debug(e) - msg = "Failed to delete ElastiCache subnet group {}".format(name) + msg = f"Failed to delete ElastiCache subnet group {name}" log.error(msg) return False @@ -666,7 +666,7 @@ def create( return True log.info("Created cache cluster %s.", name) except boto.exception.BotoServerError as e: - msg = "Failed to create cache cluster {}.".format(name) + msg = f"Failed to create cache cluster {name}." log.error(msg) log.debug(e) return False @@ -699,7 +699,7 @@ def delete(name, wait=False, region=None, key=None, keyid=None, profile=None): log.info("Deleted cache cluster %s.", name) return True except boto.exception.BotoServerError as e: - msg = "Failed to delete cache cluster {}.".format(name) + msg = f"Failed to delete cache cluster {name}." log.error(msg) log.debug(e) return False @@ -724,7 +724,7 @@ def create_cache_security_group( log.info("Created cache security group %s.", name) return True else: - msg = "Failed to create cache security group {}.".format(name) + msg = f"Failed to create cache security group {name}." log.error(msg) return False @@ -746,7 +746,7 @@ def delete_cache_security_group(name, region=None, key=None, keyid=None, profile log.info("Deleted cache security group %s.", name) return True else: - msg = "Failed to delete cache security group {}.".format(name) + msg = f"Failed to delete cache security group {name}." log.error(msg) return False diff --git a/salt/modules/boto_elasticsearch_domain.py b/salt/modules/boto_elasticsearch_domain.py index 5440435dc2d..ff11574685c 100644 --- a/salt/modules/boto_elasticsearch_domain.py +++ b/salt/modules/boto_elasticsearch_domain.py @@ -274,7 +274,7 @@ def create( except ValueError as e: return { "updated": False, - "error": "Error parsing {}: {}".format(k, e.message), + "error": f"Error parsing {k}: {e.message}", } kwargs[k] = val if "AccessPolicies" in kwargs: @@ -365,7 +365,7 @@ def update( except ValueError as e: return { "updated": False, - "error": "Error parsing {}: {}".format(k, e.message), + "error": f"Error parsing {k}: {e.message}", } call_args[k] = val if "AccessPolicies" in call_args: diff --git a/salt/modules/boto_elb.py b/salt/modules/boto_elb.py index a1aa8b16694..5c5d3c016b4 100644 --- a/salt/modules/boto_elb.py +++ b/salt/modules/boto_elb.py @@ -1102,9 +1102,9 @@ def _build_tag_param_list(params, tags): i = 1 for key in keys: value = tags[key] - params["Tags.member.{}.Key".format(i)] = key + params[f"Tags.member.{i}.Key"] = key if value is not None: - params["Tags.member.{}.Value".format(i)] = value + params[f"Tags.member.{i}.Value"] = value i += 1 diff --git a/salt/modules/boto_iam.py b/salt/modules/boto_iam.py index fc13002d5ab..54322e12eb5 100644 --- a/salt/modules/boto_iam.py +++ b/salt/modules/boto_iam.py @@ -1734,7 +1734,7 @@ def _get_policy_arn(name, region=None, key=None, keyid=None, profile=None): return name account_id = get_account_id(region=region, key=key, keyid=keyid, profile=profile) - return "arn:aws:iam::{}:policy/{}".format(account_id, name) + return f"arn:aws:iam::{account_id}:policy/{name}" def policy_exists(policy_name, region=None, key=None, keyid=None, profile=None): diff --git a/salt/modules/boto_iot.py b/salt/modules/boto_iot.py index b7b798487cb..7df25b47acf 100644 --- a/salt/modules/boto_iot.py +++ b/salt/modules/boto_iot.py @@ -149,7 +149,7 @@ def describe_thing_type(thingTypeName, region=None, key=None, keyid=None, profil for dtype in ("creationDate", "deprecationDate"): dval = thingTypeMetadata.get(dtype) if dval and isinstance(dval, datetime.date): - thingTypeMetadata[dtype] = "{}".format(dval) + thingTypeMetadata[dtype] = f"{dval}" return {"thing_type": res} else: return {"thing_type": None} @@ -916,7 +916,7 @@ def list_topic_rules( conn.list_topic_rules, marker_flag="nextToken", marker_arg="nextToken", - **kwargs + **kwargs, ): rules.extend(ret["rules"]) if not bool(rules): diff --git a/salt/modules/boto_kinesis.py b/salt/modules/boto_kinesis.py index 0c9e7b4b5eb..d2d999a733c 100644 --- a/salt/modules/boto_kinesis.py +++ b/salt/modules/boto_kinesis.py @@ -492,7 +492,7 @@ def reshard( # merge next_shard_id = _get_next_open_shard(stream_details, shard_id) if not next_shard_id: - r["error"] = "failed to find next shard after {}".format(shard_id) + r["error"] = f"failed to find next shard after {shard_id}" return r if force: log.debug( diff --git a/salt/modules/boto_lambda.py b/salt/modules/boto_lambda.py index 5a23660042e..87ef561c3c5 100644 --- a/salt/modules/boto_lambda.py +++ b/salt/modules/boto_lambda.py @@ -177,7 +177,7 @@ def _get_role_arn(name, region=None, key=None, keyid=None, profile=None): region = profile["region"] if region is None: region = "us-east-1" - return "arn:aws:iam::{}:role/{}".format(account_id, name) + return f"arn:aws:iam::{account_id}:role/{name}" def _filedata(infile): @@ -273,7 +273,7 @@ def create_function( dlZipFile = __salt__["cp.cache_file"](path=ZipFile) if dlZipFile is False: ret["result"] = False - ret["comment"] = "Failed to cache ZipFile `{}`.".format(ZipFile) + ret["comment"] = f"Failed to cache ZipFile `{ZipFile}`." return ret ZipFile = dlZipFile code = { @@ -314,7 +314,7 @@ def create_function( Timeout=Timeout, MemorySize=MemorySize, Publish=Publish, - **kwargs + **kwargs, ) except ClientError as e: if ( @@ -646,7 +646,7 @@ def add_permission( StatementId=StatementId, Action=Action, Principal=str(Principal), - **kwargs + **kwargs, ) return {"updated": True} except ClientError as e: diff --git a/salt/modules/boto_rds.py b/salt/modules/boto_rds.py index a241935a5e7..9c65ee737ea 100644 --- a/salt/modules/boto_rds.py +++ b/salt/modules/boto_rds.py @@ -295,9 +295,7 @@ def create( if wait_status: wait_stati = ["available", "modifying", "backing-up"] if wait_status not in wait_stati: - raise SaltInvocationError( - "wait_status can be one of: {}".format(wait_stati) - ) + raise SaltInvocationError(f"wait_status can be one of: {wait_stati}") if vpc_security_groups: v_tmp = __salt__["boto_secgroup.convert_to_group_ids"]( groups=vpc_security_groups, @@ -337,7 +335,7 @@ def create( if not wait_status: return { "created": True, - "message": "RDS instance {} created.".format(name), + "message": f"RDS instance {name} created.", } while True: @@ -409,14 +407,14 @@ def create_read_replica( if not res.get("exists"): return { "exists": bool(res), - "message": "RDS instance source {} does not exists.".format(source_name), + "message": f"RDS instance source {source_name} does not exists.", } res = __salt__["boto_rds.exists"](name, tags, region, key, keyid, profile) if res.get("exists"): return { "exists": bool(res), - "message": "RDS replica instance {} already exists.".format(name), + "message": f"RDS replica instance {name} already exists.", } try: @@ -445,7 +443,7 @@ def create_read_replica( Tags=taglist, DBSubnetGroupName=db_subnet_group_name, StorageType=storage_type, - **kwargs + **kwargs, ) return {"exists": bool(rds_replica)} @@ -536,12 +534,12 @@ def create_parameter_group( if not rds: return { "created": False, - "message": "Failed to create RDS parameter group {}".format(name), + "message": f"Failed to create RDS parameter group {name}", } return { "exists": bool(rds), - "message": "Created RDS parameter group {}".format(name), + "message": f"Created RDS parameter group {name}", } except ClientError as e: return {"error": __utils__["boto3.get_error"](e)} @@ -618,7 +616,7 @@ def update_parameter_group( if not res.get("exists"): return { "exists": bool(res), - "message": "RDS parameter group {} does not exist.".format(name), + "message": f"RDS parameter group {name} does not exist.", } param_list = [] @@ -663,7 +661,7 @@ def describe(name, tags=None, region=None, key=None, keyid=None, profile=None): if not res.get("exists"): return { "exists": bool(res), - "message": "RDS instance {} does not exist.".format(name), + "message": f"RDS instance {name} does not exist.", } try: @@ -868,7 +866,7 @@ def delete( if not wait_for_deletion: return { "deleted": bool(res), - "message": "Deleted RDS instance {}.".format(name), + "message": f"Deleted RDS instance {name}.", } start_time = time.time() @@ -884,7 +882,7 @@ def delete( if not res.get("exists"): return { "deleted": bool(res), - "message": "Deleted RDS instance {} completely.".format(name), + "message": f"Deleted RDS instance {name} completely.", } if time.time() - start_time > timeout: @@ -923,12 +921,12 @@ def delete_option_group(name, region=None, key=None, keyid=None, profile=None): if not res: return { "deleted": bool(res), - "message": "Failed to delete RDS option group {}.".format(name), + "message": f"Failed to delete RDS option group {name}.", } return { "deleted": bool(res), - "message": "Deleted RDS option group {}.".format(name), + "message": f"Deleted RDS option group {name}.", } except ClientError as e: return {"error": __utils__["boto3.get_error"](e)} @@ -953,7 +951,7 @@ def delete_parameter_group(name, region=None, key=None, keyid=None, profile=None r = conn.delete_db_parameter_group(DBParameterGroupName=name) return { "deleted": bool(r), - "message": "Deleted RDS parameter group {}.".format(name), + "message": f"Deleted RDS parameter group {name}.", } except ClientError as e: return {"error": __utils__["boto3.get_error"](e)} @@ -978,7 +976,7 @@ def delete_subnet_group(name, region=None, key=None, keyid=None, profile=None): r = conn.delete_db_subnet_group(DBSubnetGroupName=name) return { "deleted": bool(r), - "message": "Deleted RDS subnet group {}.".format(name), + "message": f"Deleted RDS subnet group {name}.", } except ClientError as e: return {"error": __utils__["boto3.get_error"](e)} @@ -1025,12 +1023,12 @@ def describe_parameter_group( if not info: return { "results": bool(info), - "message": "Failed to get RDS description for group {}.".format(name), + "message": f"Failed to get RDS description for group {name}.", } return { "results": bool(info), - "message": "Got RDS descrition for group {}.".format(name), + "message": f"Got RDS descrition for group {name}.", } except ClientError as e: return {"error": __utils__["boto3.get_error"](e)} @@ -1059,7 +1057,7 @@ def describe_parameters( if not res.get("exists"): return { "result": False, - "message": "Parameter group {} does not exist".format(name), + "message": f"Parameter group {name} does not exist", } try: @@ -1167,7 +1165,7 @@ def modify_db_instance( if not res.get("exists"): return { "modified": False, - "message": "RDS db instance {} does not exist.".format(name), + "message": f"RDS db instance {name} does not exist.", } try: @@ -1190,12 +1188,12 @@ def modify_db_instance( if not info: return { "modified": bool(info), - "message": "Failed to modify RDS db instance {}.".format(name), + "message": f"Failed to modify RDS db instance {name}.", } return { "modified": bool(info), - "message": "Modified RDS db instance {}.".format(name), + "message": f"Modified RDS db instance {name}.", "results": dict(info), } except ClientError as e: diff --git a/salt/modules/boto_route53.py b/salt/modules/boto_route53.py index ddacf0926b6..bee6cff4d3a 100644 --- a/salt/modules/boto_route53.py +++ b/salt/modules/boto_route53.py @@ -590,7 +590,7 @@ def get_record( else: _zone = conn.get_zone(zone) if not _zone: - msg = "Failed to retrieve zone {}".format(zone) + msg = f"Failed to retrieve zone {zone}" log.error(msg) return None _type = record_type.upper() @@ -699,7 +699,7 @@ def add_record( else: _zone = conn.get_zone(zone) if not _zone: - msg = "Failed to retrieve zone {}".format(zone) + msg = f"Failed to retrieve zone {zone}" log.error(msg) return False _type = record_type.upper() @@ -798,7 +798,7 @@ def update_record( else: _zone = conn.get_zone(zone) if not _zone: - msg = "Failed to retrieve zone {}".format(zone) + msg = f"Failed to retrieve zone {zone}" log.error(msg) return False _type = record_type.upper() @@ -887,7 +887,7 @@ def delete_record( else: _zone = conn.get_zone(zone) if not _zone: - msg = "Failed to retrieve zone {}".format(zone) + msg = f"Failed to retrieve zone {zone}" log.error(msg) return False _type = record_type.upper() diff --git a/salt/modules/boto_s3_bucket.py b/salt/modules/boto_s3_bucket.py index a696bd5d2ee..d461c320a76 100644 --- a/salt/modules/boto_s3_bucket.py +++ b/salt/modules/boto_s3_bucket.py @@ -774,7 +774,7 @@ def _get_role_arn(name, region=None, key=None, keyid=None, profile=None): region = profile["region"] if region is None: region = "us-east-1" - return "arn:aws:iam::{}:role/{}".format(account_id, name) + return f"arn:aws:iam::{account_id}:role/{name}" def put_replication( diff --git a/salt/modules/boto_secgroup.py b/salt/modules/boto_secgroup.py index 2f0feb03814..9ecdb782900 100644 --- a/salt/modules/boto_secgroup.py +++ b/salt/modules/boto_secgroup.py @@ -510,7 +510,7 @@ def create( log.info("Created security group %s.", name) return True else: - msg = "Failed to create security group {}.".format(name) + msg = f"Failed to create security group {name}." log.error(msg) return False @@ -553,7 +553,7 @@ def delete( log.info("Deleted security group %s with id %s.", group.name, group.id) return True else: - msg = "Failed to delete security group {}.".format(name) + msg = f"Failed to delete security group {name}." log.error(msg) return False else: @@ -777,7 +777,7 @@ def _find_vpcs( if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value vpcs = conn.get_all_vpcs(**filter_parameters) log.debug( diff --git a/salt/modules/boto_sns.py b/salt/modules/boto_sns.py index dc160896e7f..2814f56ea41 100644 --- a/salt/modules/boto_sns.py +++ b/salt/modules/boto_sns.py @@ -236,7 +236,7 @@ def get_arn(name, region=None, key=None, keyid=None, profile=None): account_id = __salt__["boto_iam.get_account_id"]( region=region, key=key, keyid=keyid, profile=profile ) - return "arn:aws:sns:{}:{}:{}".format(_get_region(region, profile), account_id, name) + return f"arn:aws:sns:{_get_region(region, profile)}:{account_id}:{name}" def _get_region(region=None, profile=None): @@ -253,7 +253,7 @@ def _get_region(region=None, profile=None): def _subscriptions_cache_key(name): - return "{}_{}_subscriptions".format(_cache_get_key(), name) + return f"{_cache_get_key()}_{name}_subscriptions" def _invalidate_cache(): diff --git a/salt/modules/boto_vpc.py b/salt/modules/boto_vpc.py index 9b06a7b3db7..289a7a2fb78 100644 --- a/salt/modules/boto_vpc.py +++ b/salt/modules/boto_vpc.py @@ -243,7 +243,7 @@ def _create_resource( key=None, keyid=None, profile=None, - **kwargs + **kwargs, ): """ Create a VPC resource. Returns the resource id if created, or False @@ -266,9 +266,7 @@ def _create_resource( ): return { "created": False, - "error": { - "message": "A {} named {} already exists.".format(resource, name) - }, + "error": {"message": f"A {resource} named {name} already exists."}, } r = create_resource(**kwargs) @@ -294,9 +292,9 @@ def _create_resource( return {"created": True, "id": r.id} else: if name: - e = "{} {} was not created.".format(resource, name) + e = f"{resource} {name} was not created." else: - e = "{} was not created.".format(resource) + e = f"{resource} was not created." log.warning(e) return {"created": False, "error": {"message": e}} except BotoServerError as e: @@ -311,7 +309,7 @@ def _delete_resource( key=None, keyid=None, profile=None, - **kwargs + **kwargs, ): """ Delete a VPC resource. Returns True if successful, otherwise False. @@ -338,9 +336,7 @@ def _delete_resource( if not resource_id: return { "deleted": False, - "error": { - "message": "{} {} does not exist.".format(resource, name) - }, + "error": {"message": f"{resource} {name} does not exist."}, } if delete_resource(resource_id, **kwargs): @@ -357,9 +353,9 @@ def _delete_resource( return {"deleted": True} else: if name: - e = "{} {} was not deleted.".format(resource, name) + e = f"{resource} {name} was not deleted." else: - e = "{} was not deleted.".format(resource) + e = f"{resource} was not deleted." return {"deleted": False, "error": {"message": e}} except BotoServerError as e: return {"deleted": False, "error": __utils__["boto.get_error"](e)} @@ -384,7 +380,7 @@ def _get_resource( conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) - f = "get_all_{}".format(resource) + f = f"get_all_{resource}" if not f.endswith("s"): f = f + "s" get_resources = getattr(conn, f) @@ -393,7 +389,7 @@ def _get_resource( if name: filter_parameters["filters"] = {"tag:Name": name} if resource_id: - filter_parameters["{}_ids".format(resource)] = resource_id + filter_parameters[f"{resource}_ids"] = resource_id try: r = get_resources(**filter_parameters) @@ -417,7 +413,7 @@ def _get_resource( return r[0] else: raise CommandExecutionError( - 'Found more than one {} named "{}"'.format(resource, name) + f'Found more than one {resource} named "{name}"' ) else: return None @@ -447,7 +443,7 @@ def _find_resources( conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) - f = "get_all_{}".format(resource) + f = f"get_all_{resource}" if not f.endswith("s"): f = f + "s" get_resources = getattr(conn, f) @@ -456,10 +452,10 @@ def _find_resources( if name: filter_parameters["filters"] = {"tag:Name": name} if resource_id: - filter_parameters["{}_ids".format(resource)] = resource_id + filter_parameters[f"{resource}_ids"] = resource_id if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value try: r = get_resources(**filter_parameters) @@ -601,7 +597,7 @@ def _find_vpcs( if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value vpcs = conn.get_all_vpcs(**filter_parameters) log.debug( @@ -868,7 +864,7 @@ def delete( if not vpc_id: return { "deleted": False, - "error": {"message": "VPC {} not found".format(vpc_name)}, + "error": {"message": f"VPC {vpc_name} not found"}, } if conn.delete_vpc(vpc_id): @@ -1013,7 +1009,7 @@ def describe_vpcs( if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value vpcs = conn.get_all_vpcs(**filter_parameters) @@ -1055,7 +1051,7 @@ def _find_subnets(subnet_name=None, vpc_id=None, cidr=None, tags=None, conn=None if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value subnets = conn.get_all_subnets(**filter_parameters) log.debug( @@ -1108,9 +1104,7 @@ def create_subnet( if not vpc_id: return { "created": False, - "error": { - "message": "VPC {} does not exist.".format(vpc_name or vpc_id) - }, + "error": {"message": f"VPC {vpc_name or vpc_id} does not exist."}, } except BotoServerError as e: return {"created": False, "error": __utils__["boto.get_error"](e)} @@ -1222,7 +1216,7 @@ def subnet_exists( filter_parameters["filters"]["cidr"] = cidr if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value if zones: filter_parameters["filters"]["availability_zone"] = zones @@ -1462,9 +1456,7 @@ def create_internet_gateway( if not vpc_id: return { "created": False, - "error": { - "message": "VPC {} does not exist.".format(vpc_name or vpc_id) - }, + "error": {"message": f"VPC {vpc_name or vpc_id} does not exist."}, } r = _create_resource( @@ -1622,7 +1614,7 @@ def _find_nat_gateways( conn3.describe_nat_gateways, marker_flag="NextToken", marker_arg="NextToken", - **filter_parameters + **filter_parameters, ): for gw in ret.get("NatGateways", []): if gw.get("State") in states: @@ -1769,9 +1761,7 @@ def create_nat_gateway( if not subnet_id: return { "created": False, - "error": { - "message": "Subnet {} does not exist.".format(subnet_name) - }, + "error": {"message": f"Subnet {subnet_name} does not exist."}, } else: if not _get_resource( @@ -1784,7 +1774,7 @@ def create_nat_gateway( ): return { "created": False, - "error": {"message": "Subnet {} does not exist.".format(subnet_id)}, + "error": {"message": f"Subnet {subnet_id} does not exist."}, } conn3 = _get_conn3(region=region, key=key, keyid=keyid, profile=profile) @@ -2035,9 +2025,7 @@ def create_dhcp_options( if not vpc_id: return { "created": False, - "error": { - "message": "VPC {} does not exist.".format(vpc_name or vpc_id) - }, + "error": {"message": f"VPC {vpc_name or vpc_id} does not exist."}, } r = _create_resource( @@ -2177,9 +2165,7 @@ def associate_dhcp_options_to_vpc( if not vpc_id: return { "associated": False, - "error": { - "message": "VPC {} does not exist.".format(vpc_name or vpc_id) - }, + "error": {"message": f"VPC {vpc_name or vpc_id} does not exist."}, } conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) @@ -2284,7 +2270,7 @@ def create_network_acl( if not vpc_id: return { "created": False, - "error": {"message": "VPC {} does not exist.".format(_id)}, + "error": {"message": f"VPC {_id} does not exist."}, } if all((subnet_id, subnet_name)): @@ -2298,7 +2284,7 @@ def create_network_acl( if not subnet_id: return { "created": False, - "error": {"message": "Subnet {} does not exist.".format(subnet_name)}, + "error": {"message": f"Subnet {subnet_name} does not exist."}, } elif subnet_id: if not _get_resource( @@ -2311,7 +2297,7 @@ def create_network_acl( ): return { "created": False, - "error": {"message": "Subnet {} does not exist.".format(subnet_id)}, + "error": {"message": f"Subnet {subnet_id} does not exist."}, } r = _create_resource( @@ -2468,9 +2454,7 @@ def associate_network_acl_to_subnet( if not network_acl_id: return { "associated": False, - "error": { - "message": "Network ACL {} does not exist.".format(network_acl_name) - }, + "error": {"message": f"Network ACL {network_acl_name} does not exist."}, } if subnet_name: subnet_id = _get_resource_id( @@ -2479,7 +2463,7 @@ def associate_network_acl_to_subnet( if not subnet_id: return { "associated": False, - "error": {"message": "Subnet {} does not exist.".format(subnet_name)}, + "error": {"message": f"Subnet {subnet_name} does not exist."}, } try: conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) @@ -2547,9 +2531,7 @@ def disassociate_network_acl( if not subnet_id: return { "disassociated": False, - "error": { - "message": "Subnet {} does not exist.".format(subnet_name) - }, + "error": {"message": f"Subnet {subnet_name} does not exist."}, } if vpc_name or vpc_id: @@ -2592,7 +2574,7 @@ def _create_network_acl_entry( for v in ("rule_number", "protocol", "rule_action", "cidr_block"): if locals()[v] is None: - raise SaltInvocationError("{} is required.".format(v)) + raise SaltInvocationError(f"{v} is required.") if network_acl_name: network_acl_id = _get_resource_id( @@ -2742,7 +2724,7 @@ def delete_network_acl_entry( for v in ("rule_number", "egress"): if locals()[v] is None: - raise SaltInvocationError("{} is required.".format(v)) + raise SaltInvocationError(f"{v} is required.") if network_acl_name: network_acl_id = _get_resource_id( @@ -2805,7 +2787,7 @@ def create_route_table( if not vpc_id: return { "created": False, - "error": {"message": "VPC {} does not exist.".format(vpc_name or vpc_id)}, + "error": {"message": f"VPC {vpc_name or vpc_id} does not exist."}, } return _create_resource( @@ -2941,7 +2923,7 @@ def route_exists( if tags: for tag_name, tag_value in tags.items(): - filter_parameters["filters"]["tag:{}".format(tag_name)] = tag_value + filter_parameters["filters"][f"tag:{tag_name}"] = tag_value route_tables = conn.get_all_route_tables(**filter_parameters) @@ -3013,7 +2995,7 @@ def associate_route_table( if not subnet_id: return { "associated": False, - "error": {"message": "Subnet {} does not exist.".format(subnet_name)}, + "error": {"message": f"Subnet {subnet_name} does not exist."}, } if all((route_table_id, route_table_name)): @@ -3032,9 +3014,7 @@ def associate_route_table( if not route_table_id: return { "associated": False, - "error": { - "message": "Route table {} does not exist.".format(route_table_name) - }, + "error": {"message": f"Route table {route_table_name} does not exist."}, } try: @@ -3484,7 +3464,7 @@ def describe_route_tables( if tags: for tag_name, tag_value in tags.items(): filter_parameters["Filters"].append( - {"Name": "tag:{}".format(tag_name), "Values": [tag_value]} + {"Name": f"tag:{tag_name}", "Values": [tag_value]} ) route_tables = conn3.describe_route_tables(**filter_parameters).get( @@ -3598,7 +3578,7 @@ def _maybe_name_route_table(conn, vpcid, vpc_name): log.warning("no default route table found") return - name = "{}-default-table".format(vpc_name) + name = f"{vpc_name}-default-table" _maybe_set_name_tag(name, default_table) log.debug("Default route table name was set to: %s on vpc %s", name, vpcid) @@ -3755,9 +3735,7 @@ def request_vpc_peering_connection( vpc_name=peer_vpc_name, region=region, key=key, keyid=keyid, profile=profile ) if not peer_vpc_id: - return { - "error": "Could not resolve VPC name {} to an ID".format(peer_vpc_name) - } + return {"error": f"Could not resolve VPC name {peer_vpc_name} to an ID"} peering_params = { "VpcId": requester_vpc_id, @@ -3778,7 +3756,7 @@ def request_vpc_peering_connection( vpc_peering = conn.create_vpc_peering_connection(**peering_params) peering = vpc_peering.get("VpcPeeringConnection", {}) peering_conn_id = peering.get("VpcPeeringConnectionId", "ERROR") - msg = "VPC peering {} requested.".format(peering_conn_id) + msg = f"VPC peering {peering_conn_id} requested." log.debug(msg) if name: @@ -3787,7 +3765,7 @@ def request_vpc_peering_connection( Resources=[peering_conn_id], Tags=[{"Key": "Name", "Value": name}] ) log.debug("Applied name tag to vpc peering connection") - msg += " With name {}.".format(name) + msg += f" With name {name}." return {"msg": msg} except botocore.exceptions.ClientError as err: @@ -3989,7 +3967,7 @@ def delete_vpc_peering_connection( conn_id = _vpc_peering_conn_id_for_name(conn_name, conn) if not conn_id: raise SaltInvocationError( - "Couldn't resolve VPC peering connection {} to an ID".format(conn_name) + f"Couldn't resolve VPC peering connection {conn_name} to an ID" ) try: log.debug("Trying to delete vpc peering connection") diff --git a/salt/modules/bridge.py b/salt/modules/bridge.py index edc9c9dc377..d3959693471 100644 --- a/salt/modules/bridge.py +++ b/salt/modules/bridge.py @@ -51,9 +51,9 @@ def _linux_brshow(br=None): brctl = _tool_path("brctl") if br: - cmd = "{} show {}".format(brctl, br) + cmd = f"{brctl} show {br}" else: - cmd = "{} show".format(brctl) + cmd = f"{brctl} show" brs = {} @@ -96,7 +96,7 @@ def _linux_bradd(br): Internal, creates the bridge """ brctl = _tool_path("brctl") - return __salt__["cmd.run"]("{} addbr {}".format(brctl, br), python_shell=False) + return __salt__["cmd.run"](f"{brctl} addbr {br}", python_shell=False) def _linux_brdel(br): @@ -104,7 +104,7 @@ def _linux_brdel(br): Internal, deletes the bridge """ brctl = _tool_path("brctl") - return __salt__["cmd.run"]("{} delbr {}".format(brctl, br), python_shell=False) + return __salt__["cmd.run"](f"{brctl} delbr {br}", python_shell=False) def _linux_addif(br, iface): @@ -112,9 +112,7 @@ def _linux_addif(br, iface): Internal, adds an interface to a bridge """ brctl = _tool_path("brctl") - return __salt__["cmd.run"]( - "{} addif {} {}".format(brctl, br, iface), python_shell=False - ) + return __salt__["cmd.run"](f"{brctl} addif {br} {iface}", python_shell=False) def _linux_delif(br, iface): @@ -122,9 +120,7 @@ def _linux_delif(br, iface): Internal, removes an interface from a bridge """ brctl = _tool_path("brctl") - return __salt__["cmd.run"]( - "{} delif {} {}".format(brctl, br, iface), python_shell=False - ) + return __salt__["cmd.run"](f"{brctl} delif {br} {iface}", python_shell=False) def _linux_stp(br, state): @@ -132,9 +128,7 @@ def _linux_stp(br, state): Internal, sets STP state """ brctl = _tool_path("brctl") - return __salt__["cmd.run"]( - "{} stp {} {}".format(brctl, br, state), python_shell=False - ) + return __salt__["cmd.run"](f"{brctl} stp {br} {state}", python_shell=False) def _bsd_brshow(br=None): @@ -151,14 +145,14 @@ def _bsd_brshow(br=None): if br: ifaces[br] = br else: - cmd = "{} -g bridge".format(ifconfig) + cmd = f"{ifconfig} -g bridge" for line in __salt__["cmd.run"](cmd, python_shell=False).splitlines(): ifaces[line] = line brs = {} for iface in ifaces: - cmd = "{} {}".format(ifconfig, iface) + cmd = f"{ifconfig} {iface}" for line in __salt__["cmd.run"](cmd, python_shell=False).splitlines(): brs[iface] = {"interfaces": [], "stp": "no"} line = line.lstrip() @@ -179,9 +173,9 @@ def _netbsd_brshow(br=None): brconfig = _tool_path("brconfig") if br: - cmd = "{} {}".format(brconfig, br) + cmd = f"{brconfig} {br}" else: - cmd = "{} -a".format(brconfig) + cmd = f"{brconfig} -a" brs = {} start_int = False @@ -219,21 +213,13 @@ def _bsd_bradd(br): if not br: return False - if ( - __salt__["cmd.retcode"]( - "{} {} create up".format(ifconfig, br), python_shell=False - ) - != 0 - ): + if __salt__["cmd.retcode"](f"{ifconfig} {br} create up", python_shell=False) != 0: return False # NetBSD is two cmds if kernel == "NetBSD": brconfig = _tool_path("brconfig") - if ( - __salt__["cmd.retcode"]("{} {} up".format(brconfig, br), python_shell=False) - != 0 - ): + if __salt__["cmd.retcode"](f"{brconfig} {br} up", python_shell=False) != 0: return False return True @@ -246,7 +232,7 @@ def _bsd_brdel(br): ifconfig = _tool_path("ifconfig") if not br: return False - return __salt__["cmd.run"]("{} {} destroy".format(ifconfig, br), python_shell=False) + return __salt__["cmd.run"](f"{ifconfig} {br} destroy", python_shell=False) def _bsd_addif(br, iface): @@ -264,9 +250,7 @@ def _bsd_addif(br, iface): if not br or not iface: return False - return __salt__["cmd.run"]( - "{} {} {} {}".format(cmd, br, brcmd, iface), python_shell=False - ) + return __salt__["cmd.run"](f"{cmd} {br} {brcmd} {iface}", python_shell=False) def _bsd_delif(br, iface): @@ -284,9 +268,7 @@ def _bsd_delif(br, iface): if not br or not iface: return False - return __salt__["cmd.run"]( - "{} {} {} {}".format(cmd, br, brcmd, iface), python_shell=False - ) + return __salt__["cmd.run"](f"{cmd} {br} {brcmd} {iface}", python_shell=False) def _bsd_stp(br, state, iface): @@ -303,9 +285,7 @@ def _bsd_stp(br, state, iface): if not br or not iface: return False - return __salt__["cmd.run"]( - "{} {} {} {}".format(cmd, br, state, iface), python_shell=False - ) + return __salt__["cmd.run"](f"{cmd} {br} {state} {iface}", python_shell=False) def _os_dispatch(func, *args, **kwargs): @@ -317,7 +297,7 @@ def _os_dispatch(func, *args, **kwargs): else: kernel = __grains__["kernel"].lower() - _os_func = getattr(sys.modules[__name__], "_{}_{}".format(kernel, func)) + _os_func = getattr(sys.modules[__name__], f"_{kernel}_{func}") if callable(_os_func): return _os_func(*args, **kwargs) diff --git a/salt/modules/bsd_shadow.py b/salt/modules/bsd_shadow.py index d3700df5d73..3af23b710f3 100644 --- a/salt/modules/bsd_shadow.py +++ b/salt/modules/bsd_shadow.py @@ -110,7 +110,7 @@ def info(name): if not isinstance(name, str): name = str(name) if ":" in name: - raise SaltInvocationError("Invalid username '{}'".format(name)) + raise SaltInvocationError(f"Invalid username '{name}'") if __salt__["cmd.has_exec"]("pw"): change, expire = __salt__["cmd.run_stdout"]( @@ -121,7 +121,7 @@ def info(name): with salt.utils.files.fopen("/etc/master.passwd", "r") as fp_: for line in fp_: line = salt.utils.stringutils.to_unicode(line) - if line.startswith("{}:".format(name)): + if line.startswith(f"{name}:"): key = line.split(":") change, expire = key[5:7] ret["passwd"] = str(key[1]) @@ -210,7 +210,7 @@ def del_password(name): salt '*' shadow.del_password username """ - cmd = "pw user mod {} -w none".format(name) + cmd = f"pw user mod {name} -w none" __salt__["cmd.run"](cmd, python_shell=False, output_loglevel="quiet") uinfo = info(name) return not uinfo["passwd"] diff --git a/salt/modules/btrfs.py b/salt/modules/btrfs.py index ba09acffa1c..e2e7328a9bf 100644 --- a/salt/modules/btrfs.py +++ b/salt/modules/btrfs.py @@ -85,7 +85,7 @@ def info(device): salt '*' btrfs.info /dev/sda1 """ - out = __salt__["cmd.run_all"]("btrfs filesystem show {}".format(device)) + out = __salt__["cmd.run_all"](f"btrfs filesystem show {device}") salt.utils.fsutils._verify_run(out) return _parse_btrfs_info(out["stdout"]) @@ -111,9 +111,7 @@ def _defragment_mountpoint(mountpoint): """ Defragment only one BTRFS mountpoint. """ - out = __salt__["cmd.run_all"]( - "btrfs filesystem defragment -f {}".format(mountpoint) - ) + out = __salt__["cmd.run_all"](f"btrfs filesystem defragment -f {mountpoint}") return { "mount_point": mountpoint, "passed": not out["stderr"], @@ -140,7 +138,7 @@ def defragment(path): is_device = salt.utils.fsutils._is_device(path) mounts = salt.utils.fsutils._get_mounts("btrfs") if is_device and not mounts.get(path): - raise CommandExecutionError('Device "{}" is not mounted'.format(path)) + raise CommandExecutionError(f'Device "{path}" is not mounted') result = [] if is_device: @@ -212,7 +210,7 @@ def _usage_overall(raw): subk = keyset[1].split("(") data[key] = subk[0].strip() subk = subk[1].replace(")", "").split(": ") - data["{}_{}".format(key, subk[0])] = subk[1] + data[f"{key}_{subk[0]}"] = subk[1] else: data[key] = keyset[1] @@ -266,7 +264,7 @@ def usage(path): salt '*' btrfs.usage /your/mountpoint """ - out = __salt__["cmd.run_all"]("btrfs filesystem usage {}".format(path)) + out = __salt__["cmd.run_all"](f"btrfs filesystem usage {path}") salt.utils.fsutils._verify_run(out) ret = {} @@ -320,9 +318,7 @@ def mkfs(*devices, **kwargs): mounts = salt.utils.fsutils._get_mounts("btrfs") for device in devices: if mounts.get(device): - raise CommandExecutionError( - 'Device "{}" should not be mounted'.format(device) - ) + raise CommandExecutionError(f'Device "{device}" should not be mounted') cmd = ["mkfs.btrfs"] @@ -335,9 +331,9 @@ def mkfs(*devices, **kwargs): cmd.append("-m single") else: if dto: - cmd.append("-d {}".format(dto)) + cmd.append(f"-d {dto}") if mto: - cmd.append("-m {}".format(mto)) + cmd.append(f"-m {mto}") for key, option in [ ("-l", "leafsize"), @@ -351,7 +347,7 @@ def mkfs(*devices, **kwargs): if option == "label" and option in kwargs: kwargs["label"] = "'{}'".format(kwargs["label"]) if kwargs.get(option): - cmd.append("{} {}".format(key, kwargs.get(option))) + cmd.append(f"{key} {kwargs.get(option)}") if kwargs.get("uuid"): cmd.append( @@ -396,12 +392,10 @@ def resize(mountpoint, size): if size == "max": if not salt.utils.fsutils._is_device(mountpoint): raise CommandExecutionError( - 'Mountpoint "{}" should be a valid device'.format(mountpoint) + f'Mountpoint "{mountpoint}" should be a valid device' ) if not salt.utils.fsutils._get_mounts("btrfs").get(mountpoint): - raise CommandExecutionError( - 'Device "{}" should be mounted'.format(mountpoint) - ) + raise CommandExecutionError(f'Device "{mountpoint}" should be mounted') elif ( len(size) < 3 or size[0] not in "-+" @@ -414,9 +408,7 @@ def resize(mountpoint, size): ) ) - out = __salt__["cmd.run_all"]( - "btrfs filesystem resize {} {}".format(size, mountpoint) - ) + out = __salt__["cmd.run_all"](f"btrfs filesystem resize {size} {mountpoint}") salt.utils.fsutils._verify_run(out) ret = {"log": out["stdout"]} @@ -444,7 +436,7 @@ def _fsck_ext(device): } return msgs.get( - __salt__["cmd.run_all"]("fsck -f -n {}".format(device))["retcode"], + __salt__["cmd.run_all"](f"fsck -f -n {device}")["retcode"], "Unknown error", ) @@ -475,7 +467,7 @@ def convert(device, permanent=False, keeplf=False): salt.utils.fsutils._verify_run(out) devices = salt.utils.fsutils._blkid_output(out["stdout"]) if not devices.get(device): - raise CommandExecutionError('The device "{}" was is not found.'.format(device)) + raise CommandExecutionError(f'The device "{device}" was is not found.') if not devices[device]["type"] in ["ext2", "ext3", "ext4"]: raise CommandExecutionError( @@ -506,7 +498,7 @@ documentation regarding this topic. """ ) - salt.utils.fsutils._verify_run(__salt__["cmd.run_all"]("umount {}".format(device))) + salt.utils.fsutils._verify_run(__salt__["cmd.run_all"](f"umount {device}")) ret = { "before": { @@ -516,11 +508,9 @@ documentation regarding this topic. } } + salt.utils.fsutils._verify_run(__salt__["cmd.run_all"](f"btrfs-convert {device}")) salt.utils.fsutils._verify_run( - __salt__["cmd.run_all"]("btrfs-convert {}".format(device)) - ) - salt.utils.fsutils._verify_run( - __salt__["cmd.run_all"]("mount {} {}".format(device, mountpoint)) + __salt__["cmd.run_all"](f"mount {device} {mountpoint}") ) # Refresh devices @@ -535,38 +525,34 @@ documentation regarding this topic. } # Post-migration procedures - image_path = "{}/ext2_saved".format(mountpoint) + image_path = f"{mountpoint}/ext2_saved" orig_fstype = ret["before"]["type"] if not os.path.exists(image_path): raise CommandExecutionError( - 'BTRFS migration went wrong: the image "{}" not found!'.format(image_path) + f'BTRFS migration went wrong: the image "{image_path}" not found!' ) if not permanent: - ret["after"]["{}_image".format(orig_fstype)] = image_path + ret["after"][f"{orig_fstype}_image"] = image_path image_info_proc = subprocess.run( - ["file", "{}/image".format(image_path)], check=True, stdout=subprocess.PIPE + ["file", f"{image_path}/image"], check=True, stdout=subprocess.PIPE ) - ret["after"][ - "{}_image_info".format(orig_fstype) - ] = image_info_proc.stdout.strip() + ret["after"][f"{orig_fstype}_image_info"] = image_info_proc.stdout.strip() else: - ret["after"]["{}_image".format(orig_fstype)] = "removed" - ret["after"]["{}_image_info".format(orig_fstype)] = "N/A" + ret["after"][f"{orig_fstype}_image"] = "removed" + ret["after"][f"{orig_fstype}_image_info"] = "N/A" salt.utils.fsutils._verify_run( - __salt__["cmd.run_all"]("btrfs subvolume delete {}".format(image_path)) + __salt__["cmd.run_all"](f"btrfs subvolume delete {image_path}") ) - out = __salt__["cmd.run_all"]("btrfs filesystem balance {}".format(mountpoint)) + out = __salt__["cmd.run_all"](f"btrfs filesystem balance {mountpoint}") salt.utils.fsutils._verify_run(out) ret["after"]["balance_log"] = out["stdout"] - lost_found = "{}/lost+found".format(mountpoint) + lost_found = f"{mountpoint}/lost+found" if os.path.exists(lost_found) and not keeplf: - salt.utils.fsutils._verify_run( - __salt__["cmd.run_all"]("rm -rf {}".format(lost_found)) - ) + salt.utils.fsutils._verify_run(__salt__["cmd.run_all"](f"rm -rf {lost_found}")) return ret @@ -579,7 +565,7 @@ def _restripe(mountpoint, direction, *devices, **kwargs): if salt.utils.fsutils._is_device(mountpoint): raise CommandExecutionError( - 'Mountpount expected, while device "{}" specified'.format(mountpoint) + f'Mountpount expected, while device "{mountpoint}" specified' ) mounted = False @@ -591,7 +577,7 @@ def _restripe(mountpoint, direction, *devices, **kwargs): if not mounted: raise CommandExecutionError( - 'No BTRFS device mounted on "{}" mountpoint'.format(mountpoint) + f'No BTRFS device mounted on "{mountpoint}" mountpoint' ) if not devices: @@ -600,9 +586,9 @@ def _restripe(mountpoint, direction, *devices, **kwargs): available_devices = __salt__["btrfs.devices"]() for device in devices: if device not in available_devices.keys(): - raise CommandExecutionError('Device "{}" is not recognized'.format(device)) + raise CommandExecutionError(f'Device "{device}" is not recognized') - cmd = ["btrfs device {}".format(direction)] + cmd = [f"btrfs device {direction}"] for device in devices: cmd.append(device) @@ -630,9 +616,7 @@ def _restripe(mountpoint, direction, *devices, **kwargs): ) ) else: - out = __salt__["cmd.run_all"]( - "btrfs filesystem balance {}".format(mountpoint) - ) + out = __salt__["cmd.run_all"](f"btrfs filesystem balance {mountpoint}") salt.utils.fsutils._verify_run(out) if out["stdout"]: fs_log.append(out["stdout"]) @@ -718,15 +702,13 @@ def properties(obj, type=None, set=None): "d", "device", ]: - raise CommandExecutionError( - 'Unknown property type: "{}" specified'.format(type) - ) + raise CommandExecutionError(f'Unknown property type: "{type}" specified') cmd = ["btrfs"] cmd.append("property") cmd.append(set and "set" or "list") if type: - cmd.append("-t{}".format(type)) + cmd.append(f"-t{type}") cmd.append(obj) if set: @@ -747,9 +729,9 @@ def properties(obj, type=None, set=None): ret = {} for prop, descr in _parse_proplist(out["stdout"]).items(): ret[prop] = {"description": descr} - value = __salt__["cmd.run_all"]( - "btrfs property get {} {}".format(obj, prop) - )["stdout"] + value = __salt__["cmd.run_all"](f"btrfs property get {obj} {prop}")[ + "stdout" + ] ret[prop]["value"] = value and value.split("=")[-1] or "N/A" return ret diff --git a/salt/modules/cabal.py b/salt/modules/cabal.py index 8b4426c1400..fb2ccb61c8c 100644 --- a/salt/modules/cabal.py +++ b/salt/modules/cabal.py @@ -85,7 +85,7 @@ def install(pkg=None, pkgs=None, user=None, install_global=False, env=None): cmd.append("--global") if pkg: - cmd.append('"{}"'.format(pkg)) + cmd.append(f'"{pkg}"') elif pkgs: cmd.append('"{}"'.format('" "'.join(pkgs))) @@ -125,7 +125,7 @@ def list_(pkg=None, user=None, installed=False, env=None): cmd.append("--installed") if pkg: - cmd.append('"{}"'.format(pkg)) + cmd.append(f'"{pkg}"') result = __salt__["cmd.run_all"](" ".join(cmd), runas=user, env=env) @@ -160,7 +160,7 @@ def uninstall(pkg, user=None, env=None): """ cmd = ["ghc-pkg unregister"] - cmd.append('"{}"'.format(pkg)) + cmd.append(f'"{pkg}"') result = __salt__["cmd.run_all"](" ".join(cmd), runas=user, env=env) diff --git a/salt/modules/capirca_acl.py b/salt/modules/capirca_acl.py index 82189e48ade..2678556a433 100644 --- a/salt/modules/capirca_acl.py +++ b/salt/modules/capirca_acl.py @@ -481,7 +481,7 @@ def _get_term_object( pillarenv=None, saltenv=None, merge_pillar=True, - **term_fields + **term_fields, ): """ Return an instance of the ``_Term`` class given the term options. @@ -558,7 +558,7 @@ def _get_policy_object( pillarenv=pillarenv, saltenv=saltenv, merge_pillar=merge_pillar, - **term_fields + **term_fields, ) filter_terms.append(term) policy_filters.append((header, filter_terms)) @@ -597,17 +597,15 @@ def _revision_tag( if "$Id:$" in line: if not revision_id: # if no explicit revision ID required continue # jump to next line, ignore this one - line = line.replace("$Id:$", "$Id: {rev_id} $".format(rev_id=revision_id)) + line = line.replace("$Id:$", f"$Id: {revision_id} $") if "$Revision:$" in line: if not revision_no: # if no explicit revision number required continue # jump to next line, ignore this one - line = line.replace( - "$Revision:$", "$Revision: {rev_no} $".format(rev_no=revision_no) - ) + line = line.replace("$Revision:$", f"$Revision: {revision_no} $") if "$Date:$" in line: if not revision_date: continue # jump - line = line.replace("$Date:$", "$Date: {ts} $".format(ts=timestamp)) + line = line.replace("$Date:$", f"$Date: {timestamp} $") new_text.append(line) return "\n".join(new_text) @@ -632,7 +630,7 @@ def get_term_config( revision_date_format="%Y/%m/%d", source_service=None, destination_service=None, - **term_fields + **term_fields, ): """ Return the configuration of a single policy term. diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index 4e5ddcee71b..38e42f42bd9 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -220,7 +220,7 @@ def _load_properties(property_name, config_option, set_default=False, default=No config_option, ) raise CommandExecutionError( - "ERROR: Cassandra {} cannot be empty.".format(config_option) + f"ERROR: Cassandra {config_option} cannot be empty." ) return loaded_property return property_name @@ -510,7 +510,7 @@ def cql_query( results = session.execute(query) except BaseException as e: log.error("Failed to execute query: %s\n reason: %s", query, e) - msg = "ERROR: Cassandra query failed: {} reason: {}".format(query, e) + msg = f"ERROR: Cassandra query failed: {query} reason: {e}" raise CommandExecutionError(msg) if results: @@ -543,7 +543,7 @@ def cql_query_with_prepare( load_balancing_policy=None, load_balancing_policy_args=None, ssl_options=None, - **kwargs + **kwargs, ): """ Run a query on a Cassandra cluster and return a dictionary. @@ -642,7 +642,7 @@ def cql_query_with_prepare( results = session.execute(bound_statement.bind(statement_arguments)) except BaseException as e: log.error("Failed to execute query: %s\n reason: %s", query, e) - msg = "ERROR: Cassandra query failed: {} reason: {}".format(query, e) + msg = f"ERROR: Cassandra query failed: {query} reason: {e}" raise CommandExecutionError(msg) if not asynchronous and results: @@ -919,13 +919,13 @@ def list_column_families( salt 'minion1' cassandra_cql.list_column_families keyspace=system """ - where_clause = "where keyspace_name = '{}'".format(keyspace) if keyspace else "" + where_clause = f"where keyspace_name = '{keyspace}'" if keyspace else "" query = { "2": "select columnfamily_name from system.schema_columnfamilies {};".format( where_clause ), - "3": "select column_name from system_schema.columns {};".format(where_clause), + "3": f"select column_name from system_schema.columns {where_clause};", } ret = {} @@ -1190,7 +1190,7 @@ def drop_keyspace( ssl_options=ssl_options, ) if existing_keyspace: - query = """drop keyspace {};""".format(keyspace) + query = f"""drop keyspace {keyspace};""" try: cql_query( query, @@ -1419,16 +1419,12 @@ def list_permissions( salt 'minion1' cassandra_cql.list_permissions username=joe resource=test_table resource_type=table \ permission=select contact_points=minion1 """ - keyspace_cql = ( - "{} {}".format(resource_type, resource) if resource else "all keyspaces" - ) - permission_cql = ( - "{} permission".format(permission) if permission else "all permissions" - ) - query = "list {} on {}".format(permission_cql, keyspace_cql) + keyspace_cql = f"{resource_type} {resource}" if resource else "all keyspaces" + permission_cql = f"{permission} permission" if permission else "all permissions" + query = f"list {permission_cql} on {keyspace_cql}" if username: - query = "{} of {}".format(query, username) + query = f"{query} of {username}" log.debug("Attempting to list permissions with query '%s'", query) @@ -1511,13 +1507,9 @@ def grant_permission( salt 'minion1' cassandra_cql.grant_permission username=joe resource=test_table resource_type=table \ permission=select contact_points=minion1 """ - permission_cql = ( - "grant {}".format(permission) if permission else "grant all permissions" - ) - resource_cql = ( - "on {} {}".format(resource_type, resource) if resource else "on all keyspaces" - ) - query = "{} {} to {}".format(permission_cql, resource_cql, username) + permission_cql = f"grant {permission}" if permission else "grant all permissions" + resource_cql = f"on {resource_type} {resource}" if resource else "on all keyspaces" + query = f"{permission_cql} {resource_cql} to {username}" log.debug("Attempting to grant permissions with query '%s'", query) try: diff --git a/salt/modules/chef.py b/salt/modules/chef.py index 57946400eb4..4568e0c9458 100644 --- a/salt/modules/chef.py +++ b/salt/modules/chef.py @@ -36,7 +36,7 @@ def _default_logfile(exe_name): logfile = logfile_tmp.name logfile_tmp.close() else: - logfile = salt.utils.path.join("/var/log", "{}.log".format(exe_name)) + logfile = salt.utils.path.join("/var/log", f"{exe_name}.log") return logfile @@ -116,7 +116,7 @@ def client(whyrun=False, localmode=False, logfile=None, **kwargs): "chef-client", "--no-color", "--once", - '--logfile "{}"'.format(logfile), + f'--logfile "{logfile}"', "--format doc", ] @@ -184,7 +184,7 @@ def solo(whyrun=False, logfile=None, **kwargs): args = [ "chef-solo", "--no-color", - '--logfile "{}"'.format(logfile), + f'--logfile "{logfile}"', "--format doc", ] @@ -199,9 +199,9 @@ def _exec_cmd(*args, **kwargs): # Compile the command arguments cmd_args = " ".join(args) cmd_kwargs = "".join( - [" --{} {}".format(k, v) for k, v in kwargs.items() if not k.startswith("__")] + [f" --{k} {v}" for k, v in kwargs.items() if not k.startswith("__")] ) - cmd_exec = "{}{}".format(cmd_args, cmd_kwargs) + cmd_exec = f"{cmd_args}{cmd_kwargs}" log.debug("Chef command: %s", cmd_exec) return __salt__["cmd.run_all"](cmd_exec, python_shell=False) diff --git a/salt/modules/chronos.py b/salt/modules/chronos.py index a76590cb4af..3bc35e06bf9 100644 --- a/salt/modules/chronos.py +++ b/salt/modules/chronos.py @@ -37,7 +37,7 @@ def _jobs(): Return the currently configured jobs. """ response = salt.utils.http.query( - "{}/scheduler/jobs".format(_base_url()), + f"{_base_url()}/scheduler/jobs", decode_type="json", decode=True, ) @@ -106,7 +106,7 @@ def update_job(name, config): data = salt.utils.json.dumps(config) try: response = salt.utils.http.query( - "{}/scheduler/iso8601".format(_base_url()), + f"{_base_url()}/scheduler/iso8601", method="POST", data=data, header_dict={"Content-Type": "application/json"}, @@ -129,7 +129,7 @@ def rm_job(name): salt chronos-minion-id chronos.rm_job my-job """ response = salt.utils.http.query( - "{}/scheduler/job/{}".format(_base_url(), name), + f"{_base_url()}/scheduler/job/{name}", method="DELETE", ) return True diff --git a/salt/modules/chroot.py b/salt/modules/chroot.py index 78c974cc196..5be402f1beb 100644 --- a/salt/modules/chroot.py +++ b/salt/modules/chroot.py @@ -171,7 +171,7 @@ def call(root, function, *args, **kwargs): safe_kwargs = salt.utils.args.clean_kwargs(**kwargs) salt_argv = ( [ - "python{}".format(sys.version_info[0]), + f"python{sys.version_info[0]}", os.path.join(chroot_path, "salt-call"), "--metadata", "--local", @@ -187,7 +187,7 @@ def call(root, function, *args, **kwargs): function, ] + list(args) - + ["{}={}".format(k, v) for (k, v) in safe_kwargs.items()] + + [f"{k}={v}" for (k, v) in safe_kwargs.items()] ) ret = __salt__["cmd.run_chroot"](root, [str(x) for x in salt_argv]) diff --git a/salt/modules/cimc.py b/salt/modules/cimc.py index 132b513c2aa..90eb2b34c6c 100644 --- a/salt/modules/cimc.py +++ b/salt/modules/cimc.py @@ -115,7 +115,7 @@ def create_user(uid=None, username=None, password=None, priv=None): "The privilege level must be specified." ) - dn = "sys/user-ext/user-{}".format(uid) + dn = f"sys/user-ext/user-{uid}" inconfig = """""".format( @@ -606,7 +606,7 @@ def mount_share( else: mount_options = "" - dn = "sys/svc-ext/vmedia-svc/vmmap-{}".format(name) + dn = f"sys/svc-ext/vmedia-svc/vmmap-{name}" inconfig = """""".format( @@ -712,7 +712,7 @@ def set_logging_levels(remote=None, local=None): if remote: if remote in logging_options: - query += ' remoteSeverity="{}"'.format(remote) + query += f' remoteSeverity="{remote}"' else: raise salt.exceptions.CommandExecutionError( "Remote Severity option is not valid." @@ -720,14 +720,14 @@ def set_logging_levels(remote=None, local=None): if local: if local in logging_options: - query += ' localSeverity="{}"'.format(local) + query += f' localSeverity="{local}"' else: raise salt.exceptions.CommandExecutionError( "Local Severity option is not valid." ) dn = "sys/svc-ext/syslog" - inconfig = """""".format(query) + inconfig = f"""""" ret = __proxy__["cimc.set_config_modify"](dn, inconfig, False) @@ -817,7 +817,7 @@ def set_power_configuration(policy=None, delayType=None, delayValue=None): if delayType == "fixed": query += ' delayType="fixed"' if delayValue: - query += ' delay="{}"'.format(delayValue) + query += f' delay="{delayValue}"' elif delayType == "random": query += ' delayType="random"' else: @@ -923,18 +923,18 @@ def set_user(uid=None, username=None, password=None, priv=None, status=None): raise salt.exceptions.CommandExecutionError("The user ID must be specified.") if status: - conf += ' accountStatus="{}"'.format(status) + conf += f' accountStatus="{status}"' if username: - conf += ' name="{}"'.format(username) + conf += f' name="{username}"' if priv: - conf += ' priv="{}"'.format(priv) + conf += f' priv="{priv}"' if password: - conf += ' pwd="{}"'.format(password) + conf += f' pwd="{password}"' - dn = "sys/user-ext/user-{}".format(uid) + dn = f"sys/user-ext/user-{uid}" inconfig = """""".format(uid, conf) diff --git a/salt/modules/ciscoconfparse_mod.py b/salt/modules/ciscoconfparse_mod.py index 56924691245..2be0a5f482e 100644 --- a/salt/modules/ciscoconfparse_mod.py +++ b/salt/modules/ciscoconfparse_mod.py @@ -58,7 +58,7 @@ def _get_ccp(config=None, config_path=None, saltenv="base"): if config_path: config = __salt__["cp.get_file_str"](config_path, saltenv=saltenv) if config is False: - raise SaltException("{} is not available".format(config_path)) + raise SaltException(f"{config_path} is not available") if isinstance(config, str): config = config.splitlines() ccp = ciscoconfparse.CiscoConfParse(config) diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py index 051143eb856..d603a69ba77 100644 --- a/salt/modules/cmdmod.py +++ b/salt/modules/cmdmod.py @@ -145,7 +145,7 @@ def _render_cmd(cmd, cwd, template, saltenv=None, pillarenv=None, pillar_overrid # render the path as a template using path_template_engine as the engine if template not in salt.utils.templates.TEMPLATE_REGISTRY: raise CommandExecutionError( - "Attempted to render file paths with unavailable engine {}".format(template) + f"Attempted to render file paths with unavailable engine {template}" ) kwargs = {} @@ -265,7 +265,7 @@ def _prep_powershell_cmd(shell, cmd, stack, encoded_cmd): # the shell in quotes in case there are # spaces in the paths. if salt.utils.platform.is_windows(): - shell = '"{}"'.format(shell) + shell = f'"{shell}"' # extract_stack() returns a list of tuples. # The last item in the list [-1] is the current method. @@ -277,9 +277,9 @@ def _prep_powershell_cmd(shell, cmd, stack, encoded_cmd): ) ) elif encoded_cmd: - cmd = "{} -NonInteractive -NoProfile -EncodedCommand {}".format(shell, cmd) + cmd = f"{shell} -NonInteractive -NoProfile -EncodedCommand {cmd}" else: - cmd = '{} -NonInteractive -NoProfile -Command "{}"'.format(shell, cmd) + cmd = f'{shell} -NonInteractive -NoProfile -Command "{cmd}"' return cmd @@ -318,7 +318,7 @@ def _run( success_stdout=None, success_stderr=None, windows_codepage=65001, - **kwargs + **kwargs, ): """ Do the DRY thing and only call subprocess.Popen() once @@ -368,7 +368,7 @@ def _run( change_windows_codepage = False if not salt.utils.platform.is_windows(): if not os.path.isfile(shell) or not os.access(shell, os.X_OK): - msg = "The shell {} is not available".format(shell) + msg = f"The shell {shell} is not available" raise CommandExecutionError(msg) elif use_vt: # Memozation so not much overhead raise CommandExecutionError("VT not available on windows") @@ -406,9 +406,7 @@ def _run( # checked if blacklisted if "__pub_jid" in kwargs: if not _check_avail(cmd): - raise CommandExecutionError( - 'The shell command "{}" is not permitted'.format(cmd) - ) + raise CommandExecutionError(f'The shell command "{cmd}" is not permitted') env = _parse_env(env) @@ -428,8 +426,8 @@ def _run( "'" if not isinstance(cmd, list) else "", _log_cmd(cmd), "'" if not isinstance(cmd, list) else "", - "as user '{}' ".format(runas) if runas else "", - "in group '{}' ".format(group) if group else "", + f"as user '{runas}' " if runas else "", + f"in group '{group}' " if group else "", cwd, ( ". Executing command in the background, no output will be logged." @@ -457,7 +455,7 @@ def _run( cmd = " ".join(map(_cmd_quote, cmd)) # Ensure directory is correct before running command - cmd = "cd -- {dir} && {{ {cmd}\n }}".format(dir=_cmd_quote(cwd), cmd=cmd) + cmd = f"cd -- {_cmd_quote(cwd)} && {{ {cmd}\n }}" # Ensure environment is correct for a newly logged-in user by running # the command under bash as a login shell @@ -474,7 +472,7 @@ def _run( # Ensure the login is simulated correctly (note: su runs sh, not bash, # which causes the environment to be initialised incorrectly, which is # fixed by the previous line of code) - cmd = "su -l {} -c {}".format(_cmd_quote(runas), _cmd_quote(cmd)) + cmd = f"su -l {_cmd_quote(runas)} -c {_cmd_quote(cmd)}" # Set runas to None, because if you try to run `su -l` after changing # user, su will prompt for the password of the user and cause salt to @@ -486,7 +484,7 @@ def _run( try: pwd.getpwnam(runas) except KeyError: - raise CommandExecutionError("User '{}' is not available".format(runas)) + raise CommandExecutionError(f"User '{runas}' is not available") if group: if salt.utils.platform.is_windows(): @@ -498,7 +496,7 @@ def _run( try: grp.getgrnam(group) except KeyError: - raise CommandExecutionError("Group '{}' is not available".format(runas)) + raise CommandExecutionError(f"Group '{runas}' is not available") else: use_sudo = True @@ -544,7 +542,7 @@ def _run( if not salt.utils.pkg.check_bundled(): if __grains__["os"] in ["FreeBSD"]: - env_cmd.extend(["{} -c {}".format(shell, sys.executable)]) + env_cmd.extend([f"{shell} -c {sys.executable}"]) else: env_cmd.extend([sys.executable]) else: @@ -558,11 +556,11 @@ def _run( ] ) else: - env_cmd.extend(["{} python {}".format(sys.executable, fp.name)]) + env_cmd.extend([f"{sys.executable} python {fp.name}"]) fp.write(py_code) shutil.chown(fp.name, runas) - msg = "env command: {}".format(env_cmd) + msg = f"env command: {env_cmd}" log.debug(log_callback(msg)) env_bytes, env_encoded_err = subprocess.Popen( env_cmd, @@ -609,7 +607,7 @@ def _run( # Fix some corner cases where shelling out to get the user's # environment returns the wrong home directory. - runas_home = os.path.expanduser("~{}".format(runas)) + runas_home = os.path.expanduser(f"~{runas}") if env_runas.get("HOME") != runas_home: env_runas["HOME"] = runas_home @@ -687,7 +685,7 @@ def _run( try: _umask = int(_umask, 8) except ValueError: - raise CommandExecutionError("Invalid umask: '{}'".format(umask)) + raise CommandExecutionError(f"Invalid umask: '{umask}'") else: _umask = None @@ -709,7 +707,7 @@ def _run( if not os.path.isabs(cwd) or not os.path.isdir(cwd): raise CommandExecutionError( - "Specified cwd '{}' either not absolute or does not exist".format(cwd) + f"Specified cwd '{cwd}' either not absolute or does not exist" ) if ( @@ -830,9 +828,9 @@ def _run( else: formatted_timeout = "" if timeout: - formatted_timeout = " (timeout: {}s)".format(timeout) + formatted_timeout = f" (timeout: {timeout}s)" if output_loglevel is not None: - msg = "Running {} in VT{}".format(cmd, formatted_timeout) + msg = f"Running {cmd} in VT{formatted_timeout}" log.debug(log_callback(msg)) stdout, stderr = "", "" now = time.time() @@ -877,7 +875,7 @@ def _run( ret["retcode"] = None break except KeyboardInterrupt: - ret["stderr"] = "SALT: User break\n{}".format(stderr) + ret["stderr"] = f"SALT: User break\n{stderr}" ret["retcode"] = 1 break except salt.utils.vt.TerminalException as exc: @@ -1065,7 +1063,7 @@ def run( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): r""" Execute the passed command and return the output as a string @@ -1332,7 +1330,7 @@ def run( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) log_callback = _check_cb(log_callback) @@ -1381,7 +1379,7 @@ def shell( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute the passed command and return the output as a string. @@ -1609,7 +1607,7 @@ def shell( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) @@ -1640,7 +1638,7 @@ def run_stdout( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute a command, and only return the standard out @@ -1841,7 +1839,7 @@ def run_stdout( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) return ret["stdout"] if not hide_output else "" @@ -1874,7 +1872,7 @@ def run_stderr( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute a command and only return the standard error @@ -2075,7 +2073,7 @@ def run_stderr( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) return ret["stderr"] if not hide_output else "" @@ -2110,7 +2108,7 @@ def run_all( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute the passed command and return a dict of return data @@ -2355,7 +2353,7 @@ def run_all( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) if hide_output: @@ -2387,7 +2385,7 @@ def retcode( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute a shell command and return the command's return code. @@ -2577,7 +2575,7 @@ def retcode( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) return ret["retcode"] @@ -2605,7 +2603,7 @@ def _retcode_quiet( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Helper for running commands quietly for minion startup. Returns same as @@ -2635,7 +2633,7 @@ def _retcode_quiet( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) @@ -2664,7 +2662,7 @@ def script( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Download a script from a remote location and execute the script locally. @@ -2937,7 +2935,7 @@ def script( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) _cleanup_tempfile(path) # If a temp working directory was created (Windows), let's remove that @@ -2972,7 +2970,7 @@ def script_retcode( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Download a script from a remote location and execute the script locally. @@ -3151,7 +3149,7 @@ def script_retcode( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, )["retcode"] @@ -3281,7 +3279,7 @@ def tty(device, echo=""): salt '*' cmd.tty pts3 'This is a test' """ if device.startswith("tty"): - teletype = "/dev/{}".format(device) + teletype = f"/dev/{device}" elif device.startswith("pts"): teletype = "/dev/{}".format(device.replace("pts", "pts/")) else: @@ -3289,9 +3287,9 @@ def tty(device, echo=""): try: with salt.utils.files.fopen(teletype, "wb") as tty_device: tty_device.write(salt.utils.stringutils.to_bytes(echo)) - return {"Success": "Message was successfully echoed to {}".format(teletype)} + return {"Success": f"Message was successfully echoed to {teletype}"} except OSError: - return {"Error": "Echoing to {} returned error".format(teletype)} + return {"Error": f"Echoing to {teletype} returned error"} def run_chroot( @@ -3322,7 +3320,7 @@ def run_chroot( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2014.7.0 @@ -3498,7 +3496,7 @@ def run_chroot( else: userspec = "" - cmd = "chroot {} {} {} -c {}".format(userspec, root, sh_, _cmd_quote(cmd)) + cmd = f"chroot {userspec} {root} {sh_} -c {_cmd_quote(cmd)}" run_func = __context__.pop("cmd.run_chroot.func", run_all) @@ -3711,7 +3709,7 @@ def shell_info(shell, list_modules=False): for reg_ver in pw_keys: install_data = salt.utils.win_reg.read_value( hive="HKEY_LOCAL_MACHINE", - key="Software\\Microsoft\\PowerShell\\{}".format(reg_ver), + key=f"Software\\Microsoft\\PowerShell\\{reg_ver}", vname="Install", ) if ( @@ -3862,7 +3860,7 @@ def powershell( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute the passed PowerShell command and return the output as a dictionary. @@ -4065,7 +4063,7 @@ def powershell( if salt.utils.versions.version_cmp(psversion, "2.0") == 1: cmd += " | ConvertTo-JSON" if depth is not None: - cmd += " -Depth {}".format(depth) + cmd += f" -Depth {depth}" # Put the whole command inside a try / catch block # Some errors in PowerShell are not "Terminating Errors" and will not be @@ -4078,7 +4076,7 @@ def powershell( # Convert the cmd to UTF-16LE without a BOM and base64 encode. # Just base64 encoding UTF-8 or including a BOM is not valid. log.debug("Encoding PowerShell command '%s'", cmd) - cmd = "$ProgressPreference='SilentlyContinue'; {}".format(cmd) + cmd = f"$ProgressPreference='SilentlyContinue'; {cmd}" cmd_utf16 = cmd.encode("utf-16-le") cmd = base64.standard_b64encode(cmd_utf16) cmd = salt.utils.stringutils.to_str(cmd) @@ -4112,7 +4110,7 @@ def powershell( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) # Sometimes Powershell returns an empty string, which isn't valid JSON @@ -4151,7 +4149,7 @@ def powershell_all( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Execute the passed PowerShell command and return a dictionary with a result @@ -4424,13 +4422,13 @@ def powershell_all( # Append PowerShell Object formatting cmd += " | ConvertTo-JSON" if depth is not None: - cmd += " -Depth {}".format(depth) + cmd += f" -Depth {depth}" if encode_cmd: # Convert the cmd to UTF-16LE without a BOM and base64 encode. # Just base64 encoding UTF-8 or including a BOM is not valid. log.debug("Encoding PowerShell command '%s'", cmd) - cmd = "$ProgressPreference='SilentlyContinue'; {}".format(cmd) + cmd = f"$ProgressPreference='SilentlyContinue'; {cmd}" cmd_utf16 = cmd.encode("utf-16-le") cmd = base64.standard_b64encode(cmd_utf16) cmd = salt.utils.stringutils.to_str(cmd) @@ -4464,7 +4462,7 @@ def powershell_all( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) stdoutput = response["stdout"] @@ -4520,7 +4518,7 @@ def run_bg( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): r""" .. versionadded:: 2016.3.0 @@ -4738,7 +4736,7 @@ def run_bg( success_retcodes=success_retcodes, success_stdout=success_stdout, success_stderr=success_stderr, - **kwargs + **kwargs, ) return {"pid": res["pid"]} diff --git a/salt/modules/composer.py b/salt/modules/composer.py index 7feb5d0f2ca..8e31c52a688 100644 --- a/salt/modules/composer.py +++ b/salt/modules/composer.py @@ -48,7 +48,7 @@ def did_composer_install(dir): salt '*' composer.did_composer_install /var/www/application """ - lockFile = "{}/vendor".format(dir) + lockFile = f"{dir}/vendor" if os.path.exists(lockFile): return True return False @@ -147,7 +147,7 @@ def _run_composer( # Don't need a dir for the 'selfupdate' action; all other actions do need a dir if directory is None and action != "selfupdate": raise SaltInvocationError( - "The 'directory' argument is required for composer.{}".format(action) + f"The 'directory' argument is required for composer.{action}" ) # Base Settings diff --git a/salt/modules/config.py b/salt/modules/config.py index 972a2e84c7c..044d7172c7c 100644 --- a/salt/modules/config.py +++ b/salt/modules/config.py @@ -522,10 +522,10 @@ def dot_vals(value): """ ret = {} for key, val in __pillar__.get("master", {}).items(): - if key.startswith("{}.".format(value)): + if key.startswith(f"{value}."): ret[key] = val for key, val in __opts__.items(): - if key.startswith("{}.".format(value)): + if key.startswith(f"{value}."): ret[key] = val return ret diff --git a/salt/modules/consul.py b/salt/modules/consul.py index 01f161e5fe2..a457569eb82 100644 --- a/salt/modules/consul.py +++ b/salt/modules/consul.py @@ -68,7 +68,7 @@ def _query( token = _get_token() headers = {"X-Consul-Token": token, "Content-Type": "application/json"} - base_url = urllib.parse.urljoin(consul_url, "{}/".format(api_version)) + base_url = urllib.parse.urljoin(consul_url, f"{api_version}/") url = urllib.parse.urljoin(base_url, function, False) if method == "GET": @@ -149,7 +149,7 @@ def list_(consul_url=None, token=None, key=None, **kwargs): query_params["recurse"] = "True" function = "kv/" else: - function = "kv/{}".format(key) + function = f"kv/{key}" query_params["keys"] = "True" query_params["separator"] = "/" @@ -203,7 +203,7 @@ def get(consul_url=None, key=None, token=None, recurse=False, decode=False, raw= raise SaltInvocationError('Required argument "key" is missing.') query_params = {} - function = "kv/{}".format(key) + function = f"kv/{key}" if recurse: query_params["recurse"] = "True" if raw: @@ -286,19 +286,17 @@ def put(consul_url=None, token=None, key=None, value=None, **kwargs): if "cas" in kwargs: if _current["res"]: if kwargs["cas"] == 0: - ret["message"] = "Key {} exists, index must be non-zero.".format(key) + ret["message"] = f"Key {key} exists, index must be non-zero." ret["res"] = False return ret if kwargs["cas"] != _current["data"]["ModifyIndex"]: - ret["message"] = "Key {} exists, but indexes do not match.".format(key) + ret["message"] = f"Key {key} exists, but indexes do not match." ret["res"] = False return ret query_params["cas"] = kwargs["cas"] else: - ret["message"] = ( - "Key {} does not exists, CAS argument can not be used.".format(key) - ) + ret["message"] = f"Key {key} does not exists, CAS argument can not be used." ret["res"] = False return ret @@ -316,7 +314,7 @@ def put(consul_url=None, token=None, key=None, value=None, **kwargs): if _current["data"]["Session"] == kwargs["release"]: query_params["release"] = kwargs["release"] else: - ret["message"] = "{} locked by another session.".format(key) + ret["message"] = f"{key} locked by another session." ret["res"] = False return ret @@ -327,7 +325,7 @@ def put(consul_url=None, token=None, key=None, value=None, **kwargs): log.error("Key {0} does not exist. Skipping release.") data = value - function = "kv/{}".format(key) + function = f"kv/{key}" method = "PUT" res = _query( consul_url=consul_url, @@ -340,10 +338,10 @@ def put(consul_url=None, token=None, key=None, value=None, **kwargs): if res["res"]: ret["res"] = True - ret["data"] = "Added key {} with value {}.".format(key, value) + ret["data"] = f"Added key {key} with value {value}." else: ret["res"] = False - ret["data"] = "Unable to add key {} with value {}.".format(key, value) + ret["data"] = f"Unable to add key {key} with value {value}." if "error" in res: ret["error"] = res["error"] return ret @@ -396,7 +394,7 @@ def delete(consul_url=None, token=None, key=None, **kwargs): ret["res"] = False return ret - function = "kv/{}".format(key) + function = f"kv/{key}" res = _query( consul_url=consul_url, token=token, @@ -407,10 +405,10 @@ def delete(consul_url=None, token=None, key=None, **kwargs): if res["res"]: ret["res"] = True - ret["message"] = "Deleted key {}.".format(key) + ret["message"] = f"Deleted key {key}." else: ret["res"] = False - ret["message"] = "Unable to delete key {}.".format(key) + ret["message"] = f"Unable to delete key {key}." if "error" in res: ret["error"] = res["error"] return ret @@ -635,7 +633,7 @@ def agent_join(consul_url=None, token=None, address=None, **kwargs): if "wan" in kwargs: query_params["wan"] = kwargs["wan"] - function = "agent/join/{}".format(address) + function = f"agent/join/{address}" res = _query( consul_url=consul_url, function=function, @@ -680,7 +678,7 @@ def agent_leave(consul_url=None, token=None, node=None): if not node: raise SaltInvocationError('Required argument "node" is missing.') - function = "agent/force-leave/{}".format(node) + function = f"agent/force-leave/{node}" res = _query( consul_url=consul_url, function=function, @@ -690,10 +688,10 @@ def agent_leave(consul_url=None, token=None, node=None): ) if res["res"]: ret["res"] = True - ret["message"] = "Node {} put in leave state.".format(node) + ret["message"] = f"Node {node} put in leave state." else: ret["res"] = False - ret["message"] = "Unable to change state for {}.".format(node) + ret["message"] = f"Unable to change state for {node}." return ret @@ -810,11 +808,11 @@ def agent_check_deregister(consul_url=None, token=None, checkid=None): if not checkid: raise SaltInvocationError('Required argument "checkid" is missing.') - function = "agent/check/deregister/{}".format(checkid) + function = f"agent/check/deregister/{checkid}" res = _query(consul_url=consul_url, function=function, token=token, method="GET") if res["res"]: ret["res"] = True - ret["message"] = "Check {} removed from agent.".format(checkid) + ret["message"] = f"Check {checkid} removed from agent." else: ret["res"] = False ret["message"] = "Unable to remove check from agent." @@ -855,7 +853,7 @@ def agent_check_pass(consul_url=None, token=None, checkid=None, **kwargs): if "note" in kwargs: query_params["note"] = kwargs["note"] - function = "agent/check/pass/{}".format(checkid) + function = f"agent/check/pass/{checkid}" res = _query( consul_url=consul_url, function=function, @@ -865,10 +863,10 @@ def agent_check_pass(consul_url=None, token=None, checkid=None, **kwargs): ) if res["res"]: ret["res"] = True - ret["message"] = "Check {} marked as passing.".format(checkid) + ret["message"] = f"Check {checkid} marked as passing." else: ret["res"] = False - ret["message"] = "Unable to update check {}.".format(checkid) + ret["message"] = f"Unable to update check {checkid}." return ret @@ -906,7 +904,7 @@ def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs): if "note" in kwargs: query_params["note"] = kwargs["note"] - function = "agent/check/warn/{}".format(checkid) + function = f"agent/check/warn/{checkid}" res = _query( consul_url=consul_url, function=function, @@ -916,10 +914,10 @@ def agent_check_warn(consul_url=None, token=None, checkid=None, **kwargs): ) if res["res"]: ret["res"] = True - ret["message"] = "Check {} marked as warning.".format(checkid) + ret["message"] = f"Check {checkid} marked as warning." else: ret["res"] = False - ret["message"] = "Unable to update check {}.".format(checkid) + ret["message"] = f"Unable to update check {checkid}." return ret @@ -957,7 +955,7 @@ def agent_check_fail(consul_url=None, token=None, checkid=None, **kwargs): if "note" in kwargs: query_params["note"] = kwargs["note"] - function = "agent/check/fail/{}".format(checkid) + function = f"agent/check/fail/{checkid}" res = _query( consul_url=consul_url, function=function, @@ -967,10 +965,10 @@ def agent_check_fail(consul_url=None, token=None, checkid=None, **kwargs): ) if res["res"]: ret["res"] = True - ret["message"] = "Check {} marked as critical.".format(checkid) + ret["message"] = f"Check {checkid} marked as critical." else: ret["res"] = False - ret["message"] = "Unable to update check {}.".format(checkid) + ret["message"] = f"Unable to update check {checkid}." return ret @@ -1114,16 +1112,16 @@ def agent_service_deregister(consul_url=None, token=None, serviceid=None): if not serviceid: raise SaltInvocationError('Required argument "serviceid" is missing.') - function = "agent/service/deregister/{}".format(serviceid) + function = f"agent/service/deregister/{serviceid}" res = _query( consul_url=consul_url, function=function, token=token, method="PUT", data=data ) if res["res"]: ret["res"] = True - ret["message"] = "Service {} removed from agent.".format(serviceid) + ret["message"] = f"Service {serviceid} removed from agent." else: ret["res"] = False - ret["message"] = "Unable to remove service {}.".format(serviceid) + ret["message"] = f"Unable to remove service {serviceid}." return ret @@ -1168,14 +1166,14 @@ def agent_service_maintenance(consul_url=None, token=None, serviceid=None, **kwa if "reason" in kwargs: query_params["reason"] = kwargs["reason"] - function = "agent/service/maintenance/{}".format(serviceid) + function = f"agent/service/maintenance/{serviceid}" res = _query( consul_url=consul_url, token=token, function=function, query_params=query_params ) if res["res"]: ret["res"] = True - ret["message"] = "Service {} set in maintenance mode.".format(serviceid) + ret["message"] = f"Service {serviceid} set in maintenance mode." else: ret["res"] = False ret["message"] = "Unable to set service {} to maintenance mode.".format( @@ -1255,7 +1253,7 @@ def session_create(consul_url=None, token=None, **kwargs): ret["message"] = ("TTL must be ", "between 0 and 3600.") ret["res"] = False return ret - data["TTL"] = "{}s".format(_ttl) + data["TTL"] = f"{_ttl}s" function = "session/create" res = _query( @@ -1351,7 +1349,7 @@ def session_destroy(consul_url=None, token=None, session=None, **kwargs): if "dc" in kwargs: query_params["dc"] = kwargs["dc"] - function = "session/destroy/{}".format(session) + function = f"session/destroy/{session}" res = _query( consul_url=consul_url, function=function, @@ -1361,10 +1359,10 @@ def session_destroy(consul_url=None, token=None, session=None, **kwargs): ) if res["res"]: ret["res"] = True - ret["message"] = "Destroyed Session {}.".format(session) + ret["message"] = f"Destroyed Session {session}." else: ret["res"] = False - ret["message"] = "Unable to destroy session {}.".format(session) + ret["message"] = f"Unable to destroy session {session}." return ret @@ -1402,7 +1400,7 @@ def session_info(consul_url=None, token=None, session=None, **kwargs): if "dc" in kwargs: query_params["dc"] = kwargs["dc"] - function = "session/info/{}".format(session) + function = f"session/info/{session}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -1770,7 +1768,7 @@ def catalog_service(consul_url=None, token=None, service=None, **kwargs): if "tag" in kwargs: query_params["tag"] = kwargs["tag"] - function = "catalog/service/{}".format(service) + function = f"catalog/service/{service}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -1810,7 +1808,7 @@ def catalog_node(consul_url=None, token=None, node=None, **kwargs): if "dc" in kwargs: query_params["dc"] = kwargs["dc"] - function = "catalog/node/{}".format(node) + function = f"catalog/node/{node}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -1850,7 +1848,7 @@ def health_node(consul_url=None, token=None, node=None, **kwargs): if "dc" in kwargs: query_params["dc"] = kwargs["dc"] - function = "health/node/{}".format(node) + function = f"health/node/{node}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -1890,7 +1888,7 @@ def health_checks(consul_url=None, token=None, service=None, **kwargs): if "dc" in kwargs: query_params["dc"] = kwargs["dc"] - function = "health/checks/{}".format(service) + function = f"health/checks/{service}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -1941,7 +1939,7 @@ def health_service(consul_url=None, token=None, service=None, **kwargs): if "passing" in kwargs: query_params["passing"] = kwargs["passing"] - function = "health/service/{}".format(service) + function = f"health/service/{service}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -1991,7 +1989,7 @@ def health_state(consul_url=None, token=None, state=None, **kwargs): ret["res"] = False return ret - function = "health/state/{}".format(state) + function = f"health/state/{state}" ret = _query( consul_url=consul_url, function=function, token=token, query_params=query_params ) @@ -2378,7 +2376,7 @@ def event_fire(consul_url=None, token=None, name=None, **kwargs): if "tag" in kwargs: query_params = kwargs["tag"] - function = "event/fire/{}".format(name) + function = f"event/fire/{name}" res = _query( consul_url=consul_url, token=token, @@ -2389,7 +2387,7 @@ def event_fire(consul_url=None, token=None, name=None, **kwargs): if res["res"]: ret["res"] = True - ret["message"] = "Event {} fired.".format(name) + ret["message"] = f"Event {name} fired." ret["data"] = res["data"] else: ret["res"] = False diff --git a/salt/modules/cp.py b/salt/modules/cp.py index 07554808386..25b0fcbae91 100644 --- a/salt/modules/cp.py +++ b/salt/modules/cp.py @@ -182,7 +182,7 @@ def _render_filenames(path, dest, saltenv, template, **kw): # render the path as a template using path_template_engine as the engine if template not in salt.utils.templates.TEMPLATE_REGISTRY: raise CommandExecutionError( - "Attempted to render file paths with unavailable engine {}".format(template) + f"Attempted to render file paths with unavailable engine {template}" ) kwargs = {} diff --git a/salt/modules/cpan.py b/salt/modules/cpan.py index b92f081d308..27b96d416eb 100644 --- a/salt/modules/cpan.py +++ b/salt/modules/cpan.py @@ -43,7 +43,7 @@ def install(module): old_info = show(module) - cmd = "cpan -i {}".format(module) + cmd = f"cpan -i {module}" out = __salt__["cmd.run"](cmd) if "don't know what it is" in out: @@ -153,7 +153,7 @@ def show(module): ret["name"] = module # This section parses out details from CPAN, if possible - cmd = "cpan -D {}".format(module) + cmd = f"cpan -D {module}" out = __salt__["cmd.run"](cmd).splitlines() mode = "skip" info = [] diff --git a/salt/modules/cron.py b/salt/modules/cron.py index dc0a229062c..660ca9c768d 100644 --- a/salt/modules/cron.py +++ b/salt/modules/cron.py @@ -113,7 +113,7 @@ def _render_tab(lst): """ ret = [] for pre in lst["pre"]: - ret.append("{}\n".format(pre)) + ret.append(f"{pre}\n") if ret: if ret[-1] != TAG: ret.append(TAG) @@ -170,10 +170,10 @@ def _get_cron_cmdstr(path, user=None): Returns a format string, to be used to build a crontab command. """ if user: - cmd = "crontab -u {}".format(user) + cmd = f"crontab -u {user}" else: cmd = "crontab" - return "{} {}".format(cmd, path) + return f"{cmd} {path}" def _check_instance_uid_match(user): @@ -343,7 +343,7 @@ def raw_cron(user): ).splitlines(True) # If Salt is running from root user it could modify any user's crontab elif _check_instance_uid_match("root"): - cmd = "crontab -u {} -l".format(user) + cmd = f"crontab -u {user} -l" # Preserve line endings lines = salt.utils.data.decode( __salt__["cmd.run_stdout"]( diff --git a/salt/modules/cryptdev.py b/salt/modules/cryptdev.py index ec195245ccb..77e84683aec 100644 --- a/salt/modules/cryptdev.py +++ b/salt/modules/cryptdev.py @@ -49,7 +49,7 @@ class _crypttab_entry: @classmethod def dict_from_line(cls, line, keys=crypttab_keys): if len(keys) != 4: - raise ValueError("Invalid key array: {}".format(keys)) + raise ValueError(f"Invalid key array: {keys}") if line.startswith("#"): raise cls.ParseError("Comment!") @@ -269,12 +269,12 @@ def set_crypttab( invalid_keys = filter(filterFn, match_on) - msg = 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) + msg = f'Unrecognized keys in match_on: "{invalid_keys}"' raise CommandExecutionError(msg) # parse file, use ret to cache status if not os.path.isfile(config): - raise CommandExecutionError('Bad config file "{}"'.format(config)) + raise CommandExecutionError(f'Bad config file "{config}"') try: with salt.utils.files.fopen(config, "r") as ifile: @@ -338,7 +338,7 @@ def open(name, device, keyfile): ) code = __salt__["cmd.retcode"]( - "cryptsetup open --key-file {} {} {}".format(keyfile, device, name) + f"cryptsetup open --key-file {keyfile} {device} {name}" ) return code == 0 @@ -353,5 +353,5 @@ def close(name): salt '*' cryptdev.close foo """ - code = __salt__["cmd.retcode"]("cryptsetup close {}".format(name)) + code = __salt__["cmd.retcode"](f"cryptsetup close {name}") return code == 0 diff --git a/salt/modules/csf.py b/salt/modules/csf.py index 63b3cb01ba6..0f7a27c365a 100644 --- a/salt/modules/csf.py +++ b/salt/modules/csf.py @@ -37,7 +37,7 @@ def _temp_exists(method, ip): def _exists_with_port(method, rule): - path = "/etc/csf/csf.{}".format(method) + path = f"/etc/csf/csf.{method}" return __salt__["file.contains"](path, rule) @@ -71,7 +71,7 @@ def exists( ip, port, proto, direction, port_origin, ip_origin, comment ) return _exists_with_port(method, rule) - exists = __salt__["cmd.run_all"]("egrep ^'{} +' /etc/csf/csf.{}".format(ip, method)) + exists = __salt__["cmd.run_all"](f"egrep ^'{ip} +' /etc/csf/csf.{method}") return not bool(exists["retcode"]) @@ -87,7 +87,7 @@ def __csf_cmd(cmd): ret = out["stdout"] else: ret = out["stderr"] - raise CommandExecutionError("csf failed: {}".format(ret)) + raise CommandExecutionError(f"csf failed: {ret}") else: ret = out["stdout"] return ret @@ -123,9 +123,9 @@ def _build_args(method, ip, comment): Returns the cmd args for csf basic allow/deny commands. """ opt = _get_opt(method) - args = "{} {}".format(opt, ip) + args = f"{opt} {ip}" if comment: - args += " {}".format(comment) + args += f" {comment}" return args @@ -178,7 +178,7 @@ def _build_port_rule(ip, port, proto, direction, port_origin, ip_origin, comment } rule = "{proto}|{direction}|{port_origin}={port}|{ip_origin}={ip}".format(**kwargs) if comment: - rule += " #{}".format(comment) + rule += f" #{comment}" return rule @@ -207,8 +207,8 @@ def _remove_access_rule_with_port( rule = rule.replace("|", "[|]") rule = rule.replace(".", "[.]") result = __salt__["file.replace"]( - "/etc/csf/csf.{}".format(method), - pattern="^{}(( +)?\\#.*)?$\n".format(rule), # pylint: disable=W1401 + f"/etc/csf/csf.{method}", + pattern=f"^{rule}(( +)?\\#.*)?$\n", # pylint: disable=W1401 repl="", ) @@ -233,7 +233,7 @@ def split_option(option): def get_option(option): - pattern = r'^{}(\ +)?\=(\ +)?".*"$'.format(option) # pylint: disable=W1401 + pattern = rf'^{option}(\ +)?\=(\ +)?".*"$' # pylint: disable=W1401 grep = __salt__["file.grep"]("/etc/csf/csf.conf", pattern, "-E") if "stdout" in grep and grep["stdout"]: line = grep["stdout"] @@ -247,8 +247,8 @@ def set_option(option, value): return {"error": "No such option exists in csf.conf"} result = __salt__["file.replace"]( "/etc/csf/csf.conf", - pattern=r'^{}(\ +)?\=(\ +)?".*"'.format(option), # pylint: disable=W1401 - repl='{} = "{}"'.format(option, value), + pattern=rf'^{option}(\ +)?\=(\ +)?".*"', # pylint: disable=W1401 + repl=f'{option} = "{value}"', ) return result @@ -279,9 +279,9 @@ def skip_nics(nics, ipv6=False): result = __salt__["file.replace"]( "/etc/csf/csf.conf", # pylint: disable=anomalous-backslash-in-string - pattern=r'^ETH{}_DEVICE_SKIP(\ +)?\=(\ +)?".*"'.format(ipv6), + pattern=rf'^ETH{ipv6}_DEVICE_SKIP(\ +)?\=(\ +)?".*"', # pylint: enable=anomalous-backslash-in-string - repl='ETH{}_DEVICE_SKIP = "{}"'.format(ipv6, nics_csv), + repl=f'ETH{ipv6}_DEVICE_SKIP = "{nics_csv}"', ) return result @@ -326,7 +326,7 @@ def _access_rule_with_port( ip_origin=ip_origin, comment=comment, ) - path = "/etc/csf/csf.{}".format(method) + path = f"/etc/csf/csf.{method}" results[direction] = __salt__["file.append"](path, rule) return results @@ -358,13 +358,13 @@ def _build_tmp_access_args(method, ip, ttl, port, direction, comment): Builds the cmd args for temporary access/deny opts. """ opt = _get_opt(method) - args = "{} {} {}".format(opt, ip, ttl) + args = f"{opt} {ip} {ttl}" if port: - args += " -p {}".format(port) + args += f" -p {port}" if direction: - args += " -d {}".format(direction) + args += f" -d {direction}" if comment: - args += " #{}".format(comment) + args += f" #{comment}" return args @@ -515,7 +515,7 @@ def deny( def remove_temp_rule(ip): opt = _get_opt("temprm") - args = "{} {}".format(opt, ip) + args = f"{opt} {ip}" return __csf_cmd(args) @@ -608,9 +608,9 @@ def allow_ports(ports, proto="tcp", direction="in"): result = __salt__["file.replace"]( "/etc/csf/csf.conf", # pylint: disable=anomalous-backslash-in-string - pattern=r'^{}_{}(\ +)?\=(\ +)?".*"$'.format(proto, direction), + pattern=rf'^{proto}_{direction}(\ +)?\=(\ +)?".*"$', # pylint: enable=anomalous-backslash-in-string - repl='{}_{} = "{}"'.format(proto, direction, ports_csv), + repl=f'{proto}_{direction} = "{ports_csv}"', ) results.append(result) @@ -635,7 +635,7 @@ def get_ports(proto="tcp", direction="in"): _validate_direction_and_proto(direction, proto) directions = build_directions(direction) for direction in directions: - option = "{}_{}".format(proto, direction) + option = f"{proto}_{direction}" results[direction] = _csf_to_list(option) return results @@ -701,7 +701,7 @@ def _toggle_testing(val): result = __salt__["file.replace"]( "/etc/csf/csf.conf", pattern=r'^TESTING(\ +)?\=(\ +)?".*"', # pylint: disable=W1401 - repl='TESTING = "{}"'.format(val), + repl=f'TESTING = "{val}"', ) return result diff --git a/salt/modules/cyg.py b/salt/modules/cyg.py index 9f7a61af59a..b76cbeb8010 100644 --- a/salt/modules/cyg.py +++ b/salt/modules/cyg.py @@ -45,7 +45,7 @@ def _get_cyg_dir(cyg_arch="x86_64"): elif cyg_arch == "x86": return "cygwin" - raise SaltInvocationError("Invalid architecture {arch}".format(arch=cyg_arch)) + raise SaltInvocationError(f"Invalid architecture {cyg_arch}") def _check_cygwin_installed(cyg_arch="x86_64"): @@ -129,9 +129,9 @@ def _run_silent_cygwin(cyg_arch="x86_64", args=None, mirrors=None): installation up and running. """ cyg_cache_dir = os.sep.join(["c:", "cygcache"]) - cyg_setup = "setup-{}.exe".format(cyg_arch) + cyg_setup = f"setup-{cyg_arch}.exe" cyg_setup_path = os.sep.join([cyg_cache_dir, cyg_setup]) - cyg_setup_source = "http://cygwin.com/{}".format(cyg_setup) + cyg_setup_source = f"http://cygwin.com/{cyg_setup}" # cyg_setup_source_hash = 'http://cygwin.com/{0}.sig'.format(cyg_setup) # until a hash gets published that we can verify the newest setup against @@ -147,15 +147,15 @@ def _run_silent_cygwin(cyg_arch="x86_64", args=None, mirrors=None): setup_command = cyg_setup_path options = [] - options.append("--local-package-dir {}".format(cyg_cache_dir)) + options.append(f"--local-package-dir {cyg_cache_dir}") if mirrors is None: mirrors = [{DEFAULT_MIRROR: DEFAULT_MIRROR_KEY}] for mirror in mirrors: for mirror_url, key in mirror.items(): - options.append("--site {}".format(mirror_url)) + options.append(f"--site {mirror_url}") if key: - options.append("--pubkey {}".format(key)) + options.append(f"--pubkey {key}") options.append("--no-desktop") options.append("--quiet-mode") options.append("--disable-buggy-antivirus") @@ -211,7 +211,7 @@ def install(packages=None, cyg_arch="x86_64", mirrors=None): args = [] # If we want to install packages if packages is not None: - args.append("--packages {pkgs}".format(pkgs=packages)) + args.append(f"--packages {packages}") # but we don't have cygwin installed yet if not _check_cygwin_installed(cyg_arch): # install just the base system @@ -240,7 +240,7 @@ def uninstall(packages, cyg_arch="x86_64", mirrors=None): """ args = [] if packages is not None: - args.append("--remove-packages {pkgs}".format(pkgs=packages)) + args.append(f"--remove-packages {packages}") LOG.debug("args: %s", args) if not _check_cygwin_installed(cyg_arch): LOG.debug("We're convinced cygwin isn't installed") diff --git a/salt/modules/daemontools.py b/salt/modules/daemontools.py index 84a9dc2eabf..7892cb561b8 100644 --- a/salt/modules/daemontools.py +++ b/salt/modules/daemontools.py @@ -44,7 +44,7 @@ def __virtual__(): BINS = frozenset(("svc", "supervise", "svok")) if all(salt.utils.path.which(b) for b in BINS) and SERVICE_DIR: return __virtualname__ - return (False, "Missing dependency: {}".format(BINS)) + return (False, f"Missing dependency: {BINS}") def _service_path(name): @@ -53,7 +53,7 @@ def _service_path(name): """ if not SERVICE_DIR: raise CommandExecutionError("Could not find service directory.") - return "{}/{}".format(SERVICE_DIR, name) + return f"{SERVICE_DIR}/{name}" # -- states.service compatible args @@ -67,8 +67,8 @@ def start(name): salt '*' daemontools.start """ - __salt__["file.remove"]("{}/down".format(_service_path(name))) - cmd = "svc -u {}".format(_service_path(name)) + __salt__["file.remove"](f"{_service_path(name)}/down") + cmd = f"svc -u {_service_path(name)}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -83,8 +83,8 @@ def stop(name): salt '*' daemontools.stop """ - __salt__["file.touch"]("{}/down".format(_service_path(name))) - cmd = "svc -d {}".format(_service_path(name)) + __salt__["file.touch"](f"{_service_path(name)}/down") + cmd = f"svc -d {_service_path(name)}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -98,7 +98,7 @@ def term(name): salt '*' daemontools.term """ - cmd = "svc -t {}".format(_service_path(name)) + cmd = f"svc -t {_service_path(name)}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -158,7 +158,7 @@ def status(name, sig=None): salt '*' daemontools.status """ - cmd = "svstat {}".format(_service_path(name)) + cmd = f"svstat {_service_path(name)}" out = __salt__["cmd.run_stdout"](cmd, python_shell=False) try: pid = re.search(r"\(pid (\d+)\)", out).group(1) diff --git a/salt/modules/datadog_api.py b/salt/modules/datadog_api.py index 7a18f903b45..ad775ef00dc 100644 --- a/salt/modules/datadog_api.py +++ b/salt/modules/datadog_api.py @@ -167,7 +167,7 @@ def cancel_downtime(api_key=None, app_key=None, scope=None, id=None): ret["comment"] = "Successfully cancelled downtime" else: ret["response"] = response.text - ret["comment"] = "Status Code: {}".format(response.status_code) + ret["comment"] = f"Status Code: {response.status_code}" return ret else: raise SaltInvocationError("One of id or scope must be specified") diff --git a/salt/modules/ddns.py b/salt/modules/ddns.py index 60bccff0719..54132ae21e0 100644 --- a/salt/modules/ddns.py +++ b/salt/modules/ddns.py @@ -62,7 +62,7 @@ def _config(name, key=None, **kwargs): if name in kwargs: value = kwargs[name] else: - value = __salt__["config.option"]("ddns.{}".format(key)) + value = __salt__["config.option"](f"ddns.{key}") if not value: value = None return value @@ -85,7 +85,7 @@ def add_host( replace=True, timeout=5, port=53, - **kwargs + **kwargs, ): """ Add, replace, or update the A and PTR (reverse) records for a host. @@ -100,7 +100,7 @@ def add_host( if res is False: return False - fqdn = "{}.{}.".format(name, zone) + fqdn = f"{name}.{zone}." parts = ip.split(".")[::-1] popped = [] @@ -130,7 +130,7 @@ def delete_host(zone, name, nameserver="127.0.0.1", timeout=5, port=53, **kwargs salt ns1 ddns.delete_host example.com host1 """ - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, "A") answer = dns.query.udp(request, nameserver, timeout, port) try: @@ -161,7 +161,7 @@ def delete_host(zone, name, nameserver="127.0.0.1", timeout=5, port=53, **kwargs nameserver=nameserver, timeout=timeout, port=port, - **kwargs + **kwargs, ) if ptr: res = True @@ -178,7 +178,7 @@ def update( timeout=5, replace=False, port=53, - **kwargs + **kwargs, ): """ Add, replace, or update a DNS record. @@ -197,7 +197,7 @@ def update( if name[-1:] == ".": fqdn = name else: - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, rdtype) answer = dns.query.udp(request, nameserver, timeout, port) @@ -240,7 +240,7 @@ def delete( nameserver="127.0.0.1", timeout=5, port=53, - **kwargs + **kwargs, ): """ Delete a DNS record. @@ -256,7 +256,7 @@ def delete( if name[-1:] == ".": fqdn = name else: - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, (rdtype or "ANY")) answer = dns.query.udp(request, nameserver, timeout, port) diff --git a/salt/modules/deb_apache.py b/salt/modules/deb_apache.py index 0266cbc72eb..ce257fd1515 100644 --- a/salt/modules/deb_apache.py +++ b/salt/modules/deb_apache.py @@ -59,12 +59,10 @@ def check_site_enabled(site): if site.endswith(".conf"): site_file = site else: - site_file = "{}.conf".format(site) - if os.path.islink("{}/{}".format(SITE_ENABLED_DIR, site_file)): + site_file = f"{site}.conf" + if os.path.islink(f"{SITE_ENABLED_DIR}/{site_file}"): return True - elif site == "default" and os.path.islink( - "{}/000-{}".format(SITE_ENABLED_DIR, site_file) - ): + elif site == "default" and os.path.islink(f"{SITE_ENABLED_DIR}/000-{site_file}"): return True else: return False @@ -95,9 +93,9 @@ def a2ensite(site): ret["Site"] = site if status == 1: - ret["Status"] = "Site {} Not found".format(site) + ret["Status"] = f"Site {site} Not found" elif status == 0: - ret["Status"] = "Site {} enabled".format(site) + ret["Status"] = f"Site {site} enabled" else: ret["Status"] = status @@ -129,9 +127,9 @@ def a2dissite(site): ret["Site"] = site if status == 256: - ret["Status"] = "Site {} Not found".format(site) + ret["Status"] = f"Site {site} Not found" elif status == 0: - ret["Status"] = "Site {} disabled".format(site) + ret["Status"] = f"Site {site} disabled" else: ret["Status"] = status @@ -156,8 +154,8 @@ def check_mod_enabled(mod): if mod.endswith(".load") or mod.endswith(".conf"): mod_file = mod else: - mod_file = "{}.load".format(mod) - return os.path.islink("/etc/apache2/mods-enabled/{}".format(mod_file)) + mod_file = f"{mod}.load" + return os.path.islink(f"/etc/apache2/mods-enabled/{mod_file}") def a2enmod(mod): @@ -185,9 +183,9 @@ def a2enmod(mod): ret["Mod"] = mod if status == 1: - ret["Status"] = "Mod {} Not found".format(mod) + ret["Status"] = f"Mod {mod} Not found" elif status == 0: - ret["Status"] = "Mod {} enabled".format(mod) + ret["Status"] = f"Mod {mod} enabled" else: ret["Status"] = status @@ -219,9 +217,9 @@ def a2dismod(mod): ret["Mod"] = mod if status == 256: - ret["Status"] = "Mod {} Not found".format(mod) + ret["Status"] = f"Mod {mod} Not found" elif status == 0: - ret["Status"] = "Mod {} disabled".format(mod) + ret["Status"] = f"Mod {mod} disabled" else: ret["Status"] = status @@ -247,8 +245,8 @@ def check_conf_enabled(conf): if conf.endswith(".conf"): conf_file = conf else: - conf_file = "{}.conf".format(conf) - return os.path.islink("/etc/apache2/conf-enabled/{}".format(conf_file)) + conf_file = f"{conf}.conf" + return os.path.islink(f"/etc/apache2/conf-enabled/{conf_file}") @salt.utils.decorators.path.which("a2enconf") @@ -279,9 +277,9 @@ def a2enconf(conf): ret["Conf"] = conf if status == 1: - ret["Status"] = "Conf {} Not found".format(conf) + ret["Status"] = f"Conf {conf} Not found" elif status == 0: - ret["Status"] = "Conf {} enabled".format(conf) + ret["Status"] = f"Conf {conf} enabled" else: ret["Status"] = status @@ -316,9 +314,9 @@ def a2disconf(conf): ret["Conf"] = conf if status == 256: - ret["Status"] = "Conf {} Not found".format(conf) + ret["Status"] = f"Conf {conf} Not found" elif status == 0: - ret["Status"] = "Conf {} disabled".format(conf) + ret["Status"] = f"Conf {conf} disabled" else: ret["Status"] = status diff --git a/salt/modules/debconfmod.py b/salt/modules/debconfmod.py index b4cd3a1934b..7f7644fb84b 100644 --- a/salt/modules/debconfmod.py +++ b/salt/modules/debconfmod.py @@ -106,7 +106,7 @@ def _set_file(path): """ Execute the set selections command for debconf """ - cmd = "debconf-set-selections {}".format(path) + cmd = f"debconf-set-selections {path}" __salt__["cmd.run_stdout"](cmd, python_shell=False) @@ -127,7 +127,7 @@ def set_(package, question, type, value, *extra): fd_, fname = salt.utils.files.mkstemp(prefix="salt-", close_fd=False) - line = "{} {} {} {}".format(package, question, type, value) + line = f"{package} {question} {type} {value}" os.write(fd_, salt.utils.stringutils.to_bytes(line)) os.close(fd_) @@ -169,7 +169,7 @@ def set_template(path, template, context, defaults, saltenv="base", **kwargs): saltenv=saltenv, context=context, defaults=defaults, - **kwargs + **kwargs, ) return set_file(path, saltenv, **kwargs) diff --git a/salt/modules/debian_ip.py b/salt/modules/debian_ip.py index 8c901488d10..9953b5c51ef 100644 --- a/salt/modules/debian_ip.py +++ b/salt/modules/debian_ip.py @@ -366,9 +366,9 @@ def __within2(value, within=None, errmsg=None, dtype=None): "__name__", hasattr(dtype, "__class__") and getattr(dtype.__class__, "name", dtype), ) - errmsg = "{} within '{}'".format(typename, within) + errmsg = f"{typename} within '{within}'" else: - errmsg = "within '{}'".format(within) + errmsg = f"within '{within}'" return (valid, _value, errmsg) @@ -387,7 +387,7 @@ def __space_delimited_list(value): return ( False, value, - "{} is not a valid space-delimited value.\n".format(value), + f"{value} is not a valid space-delimited value.\n", ) @@ -549,8 +549,7 @@ def _parse_interfaces(interface_files=None): # Add this later. if os.path.exists(_DEB_NETWORK_DIR): interface_files += [ - "{}/{}".format(_DEB_NETWORK_DIR, dir) - for dir in os.listdir(_DEB_NETWORK_DIR) + f"{_DEB_NETWORK_DIR}/{dir}" for dir in os.listdir(_DEB_NETWORK_DIR) ] if os.path.isfile(_DEB_NETWORK_FILE): @@ -690,7 +689,7 @@ def _filter_malformed_interfaces(*, adapters): if iface_name == "source": continue if "data" not in adapters[iface_name]: - msg = "Interface file malformed for interface: {}.".format(iface_name) + msg = f"Interface file malformed for interface: {iface_name}." log.error(msg) adapters.pop(iface_name) continue @@ -1198,7 +1197,7 @@ def _parse_bridge_opts(opts, iface): try: port, cost_or_prio = opts[opt].split() int(cost_or_prio) - config.update({opt: "{} {}".format(port, cost_or_prio)}) + config.update({opt: f"{port} {cost_or_prio}"}) except ValueError: _raise_error_iface(iface, opt, ["interface integer"]) @@ -1630,15 +1629,15 @@ def build_bond(iface, **settings): if "test" in settings and settings["test"]: return _read_temp(data) - _write_file(iface, data, _DEB_NETWORK_CONF_FILES, "{}.conf".format(iface)) - path = os.path.join(_DEB_NETWORK_CONF_FILES, "{}.conf".format(iface)) + _write_file(iface, data, _DEB_NETWORK_CONF_FILES, f"{iface}.conf") + path = os.path.join(_DEB_NETWORK_CONF_FILES, f"{iface}.conf") if deb_major == "5": for line_type in ("alias", "options"): cmd = [ "sed", "-i", "-e", - r"/^{}\s{}.*/d".format(line_type, iface), + rf"/^{line_type}\s{iface}.*/d", "/etc/modprobe.conf", ] __salt__["cmd.run"](cmd, python_shell=False) @@ -1782,7 +1781,7 @@ def get_bond(iface): salt '*' ip.get_bond bond0 """ - path = os.path.join(_DEB_NETWORK_CONF_FILES, "{}.conf".format(iface)) + path = os.path.join(_DEB_NETWORK_CONF_FILES, f"{iface}.conf") return _read_file(path) @@ -1888,10 +1887,10 @@ def get_routes(iface): salt '*' ip.get_routes eth0 """ - filename = os.path.join(_DEB_NETWORK_UP_DIR, "route-{}".format(iface)) + filename = os.path.join(_DEB_NETWORK_UP_DIR, f"route-{iface}") results = _read_file(filename) - filename = os.path.join(_DEB_NETWORK_DOWN_DIR, "route-{}".format(iface)) + filename = os.path.join(_DEB_NETWORK_DOWN_DIR, f"route-{iface}") results += _read_file(filename) return results @@ -2032,20 +2031,20 @@ def build_network_settings(**settings): for item in _read_file(_DEB_RESOLV_FILE): if domain_prog.match(item): - item = "domain {}".format(domainname) + item = f"domain {domainname}" elif search_prog.match(item): - item = "search {}".format(searchdomain) + item = f"search {searchdomain}" new_contents.append(item) # A domain line didn't exist so we'll add one in # with the new domainname if "domain" not in resolve: - new_contents.insert(0, "domain {}".format(domainname)) + new_contents.insert(0, f"domain {domainname}") # A search line didn't exist so we'll add one in # with the new search domain if "search" not in resolve: - new_contents.insert("domain" in resolve, "search {}".format(searchdomain)) + new_contents.insert("domain" in resolve, f"search {searchdomain}") new_resolv = "\n".join(new_contents) diff --git a/salt/modules/debian_service.py b/salt/modules/debian_service.py index 04c6cd5d37b..e11d9d18e7e 100644 --- a/salt/modules/debian_service.py +++ b/salt/modules/debian_service.py @@ -74,9 +74,9 @@ def get_enabled(): salt '*' service.get_enabled """ - prefix = "/etc/rc[S{}].d/S".format(_get_runlevel()) + prefix = f"/etc/rc[S{_get_runlevel()}].d/S" ret = set() - for line in [x.rsplit(os.sep, 1)[-1] for x in glob.glob("{}*".format(prefix))]: + for line in [x.rsplit(os.sep, 1)[-1] for x in glob.glob(f"{prefix}*")]: ret.add(re.split(r"\d+", line)[-1]) return sorted(ret) @@ -277,7 +277,7 @@ def disable(name, **kwargs): salt '*' service.disable """ - cmd = "update-rc.d {} disable".format(name) + cmd = f"update-rc.d {name} disable" return not __salt__["cmd.retcode"](cmd) diff --git a/salt/modules/debuild_pkgbuild.py b/salt/modules/debuild_pkgbuild.py index 21c2629332b..cc5217b7b72 100644 --- a/salt/modules/debuild_pkgbuild.py +++ b/salt/modules/debuild_pkgbuild.py @@ -90,9 +90,7 @@ def _check_repo_gpg_phrase_utils(): if __salt__["file.file_exists"](util_name): return True else: - raise CommandExecutionError( - "utility '{}' needs to be installed".format(util_name) - ) + raise CommandExecutionError(f"utility '{util_name}' needs to be installed") def _get_build_env(env): @@ -105,8 +103,8 @@ def _get_build_env(env): if not isinstance(env, dict): raise SaltInvocationError("'env' must be a Python dictionary") for key, value in env.items(): - env_override += "{}={}\n".format(key, value) - env_override += "export {}\n".format(key) + env_override += f"{key}={value}\n" + env_override += f"export {key}\n" return env_override @@ -139,7 +137,7 @@ def _get_repo_options_env(env): raise SaltInvocationError("'env' must be a Python dictionary") for key, value in env.items(): if key == "OPTIONS": - env_options += "{}\n".format(value) + env_options += f"{value}\n" return env_options @@ -194,7 +192,7 @@ def _get_repo_dists_env(env): if env is None: for key, value in dflts_dict.items(): if dflts_dict[key][0] == "M": - env_dists += "{}: {}\n".format(dflts_dict[key][1], dflts_dict[key][2]) + env_dists += f"{dflts_dict[key][1]}: {dflts_dict[key][2]}\n" if key == "CODENAME": codename = dflts_dict[key][2] return (codename, env_dists) @@ -210,15 +208,15 @@ def _get_repo_dists_env(env): if key == "CODENAME": codename = value if dflts_dict[key][0] != "I": - env_dists += "{}: {}\n".format(dflts_dict[key][1], value) + env_dists += f"{dflts_dict[key][1]}: {value}\n" else: - env_dists += "{}: {}\n".format(key, value) + env_dists += f"{key}: {value}\n" # ensure mandatories are included env_keys = list(env.keys()) for key in env_keys: if key in dflts_keys and dflts_dict[key][0] == "M" and key not in env_man_seen: - env_dists += "{}: {}\n".format(dflts_dict[key][1], dflts_dict[key][2]) + env_dists += f"{dflts_dict[key][1]}: {dflts_dict[key][2]}\n" if key == "CODENAME": codename = value @@ -256,7 +254,7 @@ def _create_pbuilders(env, runas="root"): Ensure the user has correct permissions to any files and directories which are to be utilized. """ - home = os.path.expanduser("~{}".format(runas)) + home = os.path.expanduser(f"~{runas}") pbuilderrc = os.path.join(home, ".pbuilderrc") if not os.path.isfile(pbuilderrc): raise SaltInvocationError("pbuilderrc environment is incorrectly setup") @@ -425,25 +423,25 @@ def make_src_pkg(dest_dir, spec, sources, env=None, saltenv="base", runas="root" debname_orig = debname + ".orig.tar.gz" abspath_debname = os.path.join(tree_base, debname) - cmd = "tar -xvzf {}".format(salttarball) + cmd = f"tar -xvzf {salttarball}" retrc = __salt__["cmd.retcode"](cmd, cwd=tree_base, runas=root_user) - cmd = "mv {} {}".format(salttar_name, debname) + cmd = f"mv {salttar_name} {debname}" retrc |= __salt__["cmd.retcode"](cmd, cwd=tree_base, runas=root_user) - cmd = "tar -cvzf {} {}".format(os.path.join(tree_base, debname_orig), debname) + cmd = f"tar -cvzf {os.path.join(tree_base, debname_orig)} {debname}" retrc |= __salt__["cmd.retcode"](cmd, cwd=tree_base, runas=root_user) - cmd = "rm -f {}".format(salttarball) + cmd = f"rm -f {salttarball}" retrc |= __salt__["cmd.retcode"](cmd, cwd=tree_base, runas=root_user, env=env) - cmd = "cp {} {}".format(spec_pathfile, abspath_debname) + cmd = f"cp {spec_pathfile} {abspath_debname}" retrc |= __salt__["cmd.retcode"](cmd, cwd=abspath_debname, runas=root_user) - cmd = "tar -xvJf {}".format(spec_pathfile) + cmd = f"tar -xvJf {spec_pathfile}" retrc |= __salt__["cmd.retcode"](cmd, cwd=abspath_debname, runas=root_user, env=env) - cmd = "rm -f {}".format(os.path.basename(spec_pathfile)) + cmd = f"rm -f {os.path.basename(spec_pathfile)}" retrc |= __salt__["cmd.retcode"](cmd, cwd=abspath_debname, runas=root_user) cmd = "debuild -S -uc -us -sa" retrc |= __salt__["cmd.retcode"]( cmd, cwd=abspath_debname, runas=root_user, python_shell=True, env=env ) - cmd = "rm -fR {}".format(abspath_debname) + cmd = f"rm -fR {abspath_debname}" retrc |= __salt__["cmd.retcode"](cmd, runas=root_user) if retrc != 0: raise SaltInvocationError( @@ -511,13 +509,13 @@ def build( # ensure pbuilder setup from runas if other than root if runas != root_user: - user_home = os.path.expanduser("~{}".format(runas)) + user_home = os.path.expanduser(f"~{runas}") root_home = os.path.expanduser("~root") - cmd = "cp {}/.pbuilderrc {}/".format(user_home, root_home) + cmd = f"cp {user_home}/.pbuilderrc {root_home}/" retrc = __salt__["cmd.retcode"]( cmd, runas=root_user, python_shell=True, env=env ) - cmd = "cp -R {}/.pbuilder-hooks {}/".format(user_home, root_home) + cmd = f"cp -R {user_home}/.pbuilder-hooks {root_home}/" retrc = __salt__["cmd.retcode"]( cmd, runas=root_user, python_shell=True, env=env ) @@ -539,7 +537,7 @@ def build( results_dir = "/var/cache/pbuilder/result" # ensure clean - cmd = "rm -fR {}".format(results_dir) + cmd = f"rm -fR {results_dir}" retrc |= __salt__["cmd.retcode"](cmd, runas=root_user, python_shell=True, env=env) # dscs should only contain salt orig and debian tarballs and dsc file @@ -558,7 +556,7 @@ def build( retrc |= __salt__["cmd.retcode"]( cmd, runas=root_user, python_shell=True, env=env ) - cmd = '/usr/sbin/pbuilder build --debbuildopts "-sa" {}'.format(dsc) + cmd = f'/usr/sbin/pbuilder build --debbuildopts "-sa" {dsc}' retrc |= __salt__["cmd.retcode"]( cmd, runas=root_user, python_shell=True, env=env ) @@ -711,15 +709,15 @@ def make_repo( phrase = "" # preset passphase and interaction with gpg-agent - gpg_info_file = "{}/gpg-agent-info-salt".format(gnupghome) - gpg_tty_info_file = "{}/gpg-tty-info-salt".format(gnupghome) + gpg_info_file = f"{gnupghome}/gpg-agent-info-salt" + gpg_tty_info_file = f"{gnupghome}/gpg-tty-info-salt" # if using older than gnupg 2.1, then env file exists older_gnupg = __salt__["file.file_exists"](gpg_info_file) if keyid is not None: with salt.utils.files.fopen(repoconfdist, "a") as fow: - fow.write(salt.utils.stringutils.to_str("SignWith: {}\n".format(keyid))) + fow.write(salt.utils.stringutils.to_str(f"SignWith: {keyid}\n")) # import_keys pkg_pub_key_file = "{}/{}".format( @@ -827,7 +825,7 @@ def make_repo( # sign_it_here if older_gnupg: if local_keyid is not None: - cmd = "debsign --re-sign -k {} {}".format(keyid, abs_file) + cmd = f"debsign --re-sign -k {keyid} {abs_file}" retrc |= __salt__["cmd.retcode"]( cmd, runas=runas, cwd=repodir, use_vt=True, env=env ) @@ -845,7 +843,7 @@ def make_repo( if local_keyid is not None: number_retries = timeout / interval times_looped = 0 - error_msg = "Failed to debsign file {}".format(abs_file) + error_msg = f"Failed to debsign file {abs_file}" if ( __grains__["os"] in ["Ubuntu"] and __grains__["osmajorrelease"] < 18 @@ -853,7 +851,7 @@ def make_repo( __grains__["os"] in ["Debian"] and __grains__["osmajorrelease"] <= 8 ): - cmd = "debsign --re-sign -k {} {}".format(keyid, abs_file) + cmd = f"debsign --re-sign -k {keyid} {abs_file}" try: proc = salt.utils.vt.Terminal( cmd, @@ -902,7 +900,7 @@ def make_repo( number_retries = timeout / interval times_looped = 0 - error_msg = "Failed to reprepro includedsc file {}".format(abs_file) + error_msg = f"Failed to reprepro includedsc file {abs_file}" cmd = ( "reprepro --ignore=wrongdistribution --component=main -Vb ." " includedsc {} {}".format(codename, abs_file) diff --git a/salt/modules/devinfo.py b/salt/modules/devinfo.py index d6c530aa2e2..ea9d3f5da67 100644 --- a/salt/modules/devinfo.py +++ b/salt/modules/devinfo.py @@ -293,7 +293,7 @@ def hwinfo(items=None, short=True, listmd=False, devices=None): cmd = ["hwinfo"] for item in items: - cmd.append("--{}".format(item)) + cmd.append(f"--{item}") if short: cmd.append("--short") @@ -302,7 +302,7 @@ def hwinfo(items=None, short=True, listmd=False, devices=None): cmd.append("--listmd") for device in devices: - cmd.append("--only {}".format(device)) + cmd.append(f"--only {device}") out = __salt__["cmd.run_stdout"](cmd) result["hwinfo"] = _hwinfo_parse(out, short) diff --git a/salt/modules/devmap.py b/salt/modules/devmap.py index 247d0293c2e..9f14ee6c9c8 100644 --- a/salt/modules/devmap.py +++ b/salt/modules/devmap.py @@ -30,7 +30,7 @@ def multipath_flush(device): salt '*' devmap.multipath_flush mpath1 """ if not os.path.exists(device): - return "{} does not exist".format(device) + return f"{device} does not exist" - cmd = "multipath -f {}".format(device) + cmd = f"multipath -f {device}" return __salt__["cmd.run"](cmd).splitlines() diff --git a/salt/modules/dig.py b/salt/modules/dig.py index a78e4875ded..79023236653 100644 --- a/salt/modules/dig.py +++ b/salt/modules/dig.py @@ -84,7 +84,7 @@ def A(host, nameserver=None): dig = ["dig", "+short", str(host), "A"] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) # In this case, 0 is not the same as False @@ -116,7 +116,7 @@ def PTR(host, nameserver=None): dig = ["dig", "+short", "-x", str(host)] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) # In this case, 0 is not the same as False @@ -145,7 +145,7 @@ def AAAA(host, nameserver=None): dig = ["dig", "+short", str(host), "AAAA"] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) # In this case, 0 is not the same as False @@ -175,7 +175,7 @@ def CNAME(host, nameserver=None): dig = ["dig", "+short", str(host), "CNAME"] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) # In this case, 0 is not the same as False @@ -204,7 +204,7 @@ def NS(domain, resolve=True, nameserver=None): dig = ["dig", "+short", str(domain), "NS"] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) # In this case, 0 is not the same as False @@ -243,7 +243,7 @@ def SPF(domain, record="SPF", nameserver=None): cmd = ["dig", "+short", str(domain), record] if nameserver is not None: - cmd.append("@{}".format(nameserver)) + cmd.append(f"@{nameserver}") result = __salt__["cmd.run_all"](cmd, python_shell=False) # In this case, 0 is not the same as False @@ -300,7 +300,7 @@ def MX(domain, resolve=False, nameserver=None): dig = ["dig", "+short", str(domain), "MX"] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) # In this case, 0 is not the same as False @@ -334,7 +334,7 @@ def TXT(host, nameserver=None): dig = ["dig", "+short", str(host), "TXT"] if nameserver is not None: - dig.append("@{}".format(nameserver)) + dig.append(f"@{nameserver}") cmd = __salt__["cmd.run_all"](dig, python_shell=False) diff --git a/salt/modules/disk.py b/salt/modules/disk.py index c7e5f905c07..8eea765a30f 100644 --- a/salt/modules/disk.py +++ b/salt/modules/disk.py @@ -71,7 +71,7 @@ def _clean_flags(args, caller): if flag in allowed: flags += flag else: - raise CommandExecutionError("Invalid flag passed to {}".format(caller)) + raise CommandExecutionError(f"Invalid flag passed to {caller}") return flags @@ -108,7 +108,7 @@ def usage(args=None): else: cmd = "df" if flags: - cmd += " -{}".format(flags) + cmd += f" -{flags}" ret = {} out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() oldline = None @@ -126,7 +126,7 @@ def usage(args=None): else: oldline = None while len(comps) >= 2 and not comps[1].isdigit(): - comps[0] = "{} {}".format(comps[0], comps[1]) + comps[0] = f"{comps[0]} {comps[1]}" comps.pop(1) if len(comps) < 2: continue @@ -172,7 +172,7 @@ def inodeusage(args=None): else: cmd = "df -iP" if flags: - cmd += " -{}".format(flags) + cmd += f" -{flags}" ret = {} out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() for line in out: @@ -239,7 +239,7 @@ def percent(args=None): continue comps = line.split() while len(comps) >= 2 and not comps[1].isdigit(): - comps[0] = "{} {}".format(comps[0], comps[1]) + comps[0] = f"{comps[0]} {comps[1]}" comps.pop(1) if len(comps) < 2: continue @@ -344,10 +344,10 @@ def tune(device, **kwargs): else: args.append("getro") if kwargs[key] == "True" or kwargs[key] is True: - opts += "--{} ".format(key) + opts += f"--{key} " else: - opts += "--{} {} ".format(switch, kwargs[key]) - cmd = "blockdev {}{}".format(opts, device) + opts += f"--{switch} {kwargs[key]} " + cmd = f"blockdev {opts}{device}" out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() return dump(device, args) @@ -363,7 +363,7 @@ def wipe(device): salt '*' disk.wipe /dev/sda1 """ - cmd = "wipefs -a {}".format(device) + cmd = f"wipefs -a {device}" try: out = __salt__["cmd.run_all"](cmd, python_shell=False) except subprocess.CalledProcessError as err: @@ -419,7 +419,7 @@ def resize2fs(device): salt '*' disk.resize2fs /dev/sda1 """ - cmd = "resize2fs {}".format(device) + cmd = f"resize2fs {device}" try: out = __salt__["cmd.run_all"](cmd, python_shell=False) except subprocess.CalledProcessError as err: @@ -486,10 +486,10 @@ def format_( if fs_type[:3] == "ext": cmd.extend(["-i", str(inode_size)]) elif fs_type == "xfs": - cmd.extend(["-i", "size={}".format(inode_size)]) + cmd.extend(["-i", f"size={inode_size}"]) if lazy_itable_init is not None: if fs_type[:3] == "ext": - cmd.extend(["-E", "lazy_itable_init={}".format(lazy_itable_init)]) + cmd.extend(["-E", f"lazy_itable_init={lazy_itable_init}"]) if fat is not None and fat in (12, 16, 32): if fs_type[-3:] == "fat": cmd.extend(["-F", fat]) @@ -523,9 +523,7 @@ def fstype(device): salt '*' disk.fstype /dev/sdX1 """ if salt.utils.path.which("lsblk"): - lsblk_out = __salt__["cmd.run"]( - "lsblk -o fstype {}".format(device) - ).splitlines() + lsblk_out = __salt__["cmd.run"](f"lsblk -o fstype {device}").splitlines() if len(lsblk_out) > 1: fs_type = lsblk_out[1].strip() if fs_type: @@ -535,15 +533,13 @@ def fstype(device): # the fstype was not set on the block device, so inspect the filesystem # itself for its type if __grains__["kernel"] == "AIX" and os.path.isfile("/usr/sysv/bin/df"): - df_out = __salt__["cmd.run"]( - "/usr/sysv/bin/df -n {}".format(device) - ).split() + df_out = __salt__["cmd.run"](f"/usr/sysv/bin/df -n {device}").split() if len(df_out) > 2: fs_type = df_out[2] if fs_type: return fs_type else: - df_out = __salt__["cmd.run"]("df -T {}".format(device)).splitlines() + df_out = __salt__["cmd.run"](f"df -T {device}").splitlines() if len(df_out) > 1: fs_type = df_out[1] if fs_type: @@ -559,7 +555,7 @@ def _hdparm(args, failhard=True): Fail hard when required return output when possible """ - cmd = "hdparm {}".format(args) + cmd = f"hdparm {args}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] != 0: msg = "{}: {}".format(cmd, result["stderr"]) @@ -598,9 +594,9 @@ def hdparms(disks, args=None): out = {} for disk in disks: if not disk.startswith("/dev"): - disk = "/dev/{}".format(disk) + disk = f"/dev/{disk}" disk_data = {} - for line in _hdparm("-{} {}".format(args, disk), False).splitlines(): + for line in _hdparm(f"-{args} {disk}", False).splitlines(): line = line.strip() if not line or line == disk + ":": continue @@ -700,7 +696,7 @@ def hpa(disks, size=None): if size <= 0: size = data["total"] - _hdparm("--yes-i-know-what-i-am-doing -Np{} {}".format(size, disk)) + _hdparm(f"--yes-i-know-what-i-am-doing -Np{size} {disk}") def smart_attributes(dev, attributes=None, values=None): @@ -726,7 +722,7 @@ def smart_attributes(dev, attributes=None, values=None): if not dev.startswith("/dev/"): dev = "/dev/" + dev - cmd = "smartctl --attributes {}".format(dev) + cmd = f"smartctl --attributes {dev}" smart_result = __salt__["cmd.run_all"](cmd, output_loglevel="quiet") if smart_result["retcode"] != 0: raise CommandExecutionError(smart_result["stderr"]) @@ -819,9 +815,9 @@ def _iostat_fbsd(interval, count, disks): Tested on FreeBSD, quite likely other BSD's only need small changes in cmd syntax """ if disks is None: - iostat_cmd = "iostat -xC -w {} -c {} ".format(interval, count) + iostat_cmd = f"iostat -xC -w {interval} -c {count} " elif isinstance(disks, str): - iostat_cmd = "iostat -x -w {} -c {} {}".format(interval, count, disks) + iostat_cmd = f"iostat -x -w {interval} -c {count} {disks}" else: iostat_cmd = "iostat -x -w {} -c {} {}".format(interval, count, " ".join(disks)) @@ -874,9 +870,9 @@ def _iostat_fbsd(interval, count, disks): def _iostat_linux(interval, count, disks): if disks is None: - iostat_cmd = "iostat -x {} {} ".format(interval, count) + iostat_cmd = f"iostat -x {interval} {count} " elif isinstance(disks, str): - iostat_cmd = "iostat -xd {} {} {}".format(interval, count, disks) + iostat_cmd = f"iostat -xd {interval} {count} {disks}" else: iostat_cmd = "iostat -xd {} {} {}".format(interval, count, " ".join(disks)) @@ -924,9 +920,9 @@ def _iostat_aix(interval, count, disks): log.debug("AIX disk iostat entry") if disks is None: - iostat_cmd = "iostat -dD {} {} ".format(interval, count) + iostat_cmd = f"iostat -dD {interval} {count} " elif isinstance(disks, str): - iostat_cmd = "iostat -dD {} {} {}".format(disks, interval, count) + iostat_cmd = f"iostat -dD {disks} {interval} {count}" else: iostat_cmd = "iostat -dD {} {} {}".format(" ".join(disks), interval, count) diff --git a/salt/modules/djangomod.py b/salt/modules/djangomod.py index 9047667e589..b66479f9a32 100644 --- a/salt/modules/djangomod.py +++ b/salt/modules/djangomod.py @@ -43,7 +43,7 @@ def command( env=None, runas=None, *args, - **kwargs + **kwargs, ): """ Run arbitrary django management command @@ -55,17 +55,17 @@ def command( salt '*' django.command """ dja = _get_django_admin(bin_env) - cmd = "{} {} --settings={}".format(dja, command, settings_module) + cmd = f"{dja} {command} --settings={settings_module}" if pythonpath: - cmd = "{} --pythonpath={}".format(cmd, pythonpath) + cmd = f"{cmd} --pythonpath={pythonpath}" for arg in args: - cmd = "{} --{}".format(cmd, arg) + cmd = f"{cmd} --{arg}" for key, value in kwargs.items(): if not key.startswith("__"): - cmd = "{} --{}={}".format(cmd, key, value) + cmd = f"{cmd} --{key}={value}" return __salt__["cmd.run"](cmd, env=env, runas=runas, python_shell=False) @@ -192,9 +192,9 @@ def migrate( args.append("noinput") if app_label and migration_name: - cmd = "migrate {} {}".format(app_label, migration_name) + cmd = f"migrate {app_label} {migration_name}" elif app_label: - cmd = "migrate {}".format(app_label) + cmd = f"migrate {app_label}" else: cmd = "migrate" @@ -239,7 +239,7 @@ def createsuperuser( env, runas, *args, - **kwargs + **kwargs, ) @@ -315,5 +315,5 @@ def collectstatic( env, runas, *args, - **kwargs + **kwargs, ) diff --git a/salt/modules/dnsmasq.py b/salt/modules/dnsmasq.py index af9c8b8ccba..5aec67f959f 100644 --- a/salt/modules/dnsmasq.py +++ b/salt/modules/dnsmasq.py @@ -113,13 +113,13 @@ def set_config(config_file="/etc/dnsmasq.conf", follow=True, **kwargs): for config in includes: __salt__["file.sed"]( path=config, - before="^{}=.*".format(key), - after="{}={}".format(key, kwargs[key]), + before=f"^{key}=.*", + after=f"{key}={kwargs[key]}", ) else: - __salt__["file.append"](config_file, "{}={}".format(key, kwargs[key])) + __salt__["file.append"](config_file, f"{key}={kwargs[key]}") else: - __salt__["file.append"](config_file, "{}={}".format(key, kwargs[key])) + __salt__["file.append"](config_file, f"{key}={kwargs[key]}") return ret_kwargs @@ -160,7 +160,7 @@ def _parse_dnamasq(filename): fileopts = {} if not os.path.isfile(filename): - raise CommandExecutionError("Error: No such file '{}'".format(filename)) + raise CommandExecutionError(f"Error: No such file '{filename}'") with salt.utils.files.fopen(filename, "r") as fp_: for line in fp_: diff --git a/salt/modules/dnsutil.py b/salt/modules/dnsutil.py index bc25f3d3386..5b677d777ee 100644 --- a/salt/modules/dnsutil.py +++ b/salt/modules/dnsutil.py @@ -74,13 +74,13 @@ def hosts_append(hostsfile="/etc/hosts", ip_addr=None, entries=None): host_list.remove(host) if not host_list: - return "No additional hosts were added to {}".format(hostsfile) + return f"No additional hosts were added to {hostsfile}" append_line = "\n{} {}".format(ip_addr, " ".join(host_list)) with salt.utils.files.fopen(hostsfile, "a") as fp_: fp_.write(salt.utils.stringutils.to_str(append_line)) - return "The following line was added to {}:{}".format(hostsfile, append_line) + return f"The following line was added to {hostsfile}:{append_line}" def hosts_remove(hostsfile="/etc/hosts", entries=None): @@ -103,7 +103,7 @@ def hosts_remove(hostsfile="/etc/hosts", entries=None): with salt.utils.files.fopen(hostsfile, "w") as out_file: for line in hosts.splitlines(): if not line or line.strip().startswith("#"): - out_file.write(salt.utils.stringutils.to_str("{}\n".format(line))) + out_file.write(salt.utils.stringutils.to_str(f"{line}\n")) continue comps = line.split() for host in host_list: @@ -149,7 +149,7 @@ def parse_zone(zonefile=None, zone=None): mode = "multi" multi = "" if mode == "multi": - multi += " {}".format(line) + multi += f" {line}" if ")" in line: mode = "single" line = multi.replace("(", "").replace(")", "") @@ -267,7 +267,7 @@ def A(host, nameserver=None): ] return addresses except socket.gaierror: - return "Unable to resolve {}".format(host) + return f"Unable to resolve {host}" return "This function requires dig, which is not currently available" @@ -299,7 +299,7 @@ def AAAA(host, nameserver=None): ] return addresses except socket.gaierror: - return "Unable to resolve {}".format(host) + return f"Unable to resolve {host}" return "This function requires dig, which is not currently available" @@ -394,7 +394,7 @@ def serial(zone="", update=False): grains = {} key = "dnsserial" if zone: - key += "_{}".format(zone) + key += f"_{zone}" stored = __salt__["grains.get"](key=key) present = time.strftime("%Y%m%d01") if not update: diff --git a/salt/modules/dockercompose.py b/salt/modules/dockercompose.py index 7ebdf2207e9..bb71049d9ea 100644 --- a/salt/modules/dockercompose.py +++ b/salt/modules/dockercompose.py @@ -200,7 +200,7 @@ def __read_docker_compose_file(file_path): """ if not os.path.isfile(file_path): return __standardize_result( - False, "Path {} is not present".format(file_path), None, None + False, f"Path {file_path} is not present", None, None ) try: with salt.utils.files.fopen(file_path, "r") as fl: @@ -209,12 +209,8 @@ def __read_docker_compose_file(file_path): for line in fl: result[file_name] += salt.utils.stringutils.to_unicode(line) except OSError: - return __standardize_result( - False, "Could not read {}".format(file_path), None, None - ) - return __standardize_result( - True, "Reading content of {}".format(file_path), result, None - ) + return __standardize_result(False, f"Could not read {file_path}", None, None) + return __standardize_result(True, f"Reading content of {file_path}", result, None) def __load_docker_compose(path): @@ -226,14 +222,12 @@ def __load_docker_compose(path): """ file_path = __get_docker_file_path(path) if file_path is None: - msg = "Could not find docker-compose file at {}".format(path) + msg = f"Could not find docker-compose file at {path}" return None, __standardize_result(False, msg, None, None) if not os.path.isfile(file_path): return ( None, - __standardize_result( - False, "Path {} is not present".format(file_path), None, None - ), + __standardize_result(False, f"Path {file_path} is not present", None, None), ) try: with salt.utils.files.fopen(file_path, "r") as fl: @@ -241,15 +235,13 @@ def __load_docker_compose(path): except OSError: return ( None, - __standardize_result( - False, "Could not read {}".format(file_path), None, None - ), + __standardize_result(False, f"Could not read {file_path}", None, None), ) except yaml.YAMLError as yerr: - msg = "Could not parse {} {}".format(file_path, yerr) + msg = f"Could not parse {file_path} {yerr}" return None, __standardize_result(False, msg, None, None) if not loaded: - msg = "Got empty compose file at {}".format(file_path) + msg = f"Got empty compose file at {file_path}" return None, __standardize_result(False, msg, None, None) if "services" not in loaded: loaded["services"] = {} @@ -269,7 +261,7 @@ def __dump_docker_compose(path, content, already_existed): dumped = yaml.safe_dump(content, indent=2, default_flow_style=False) return __write_docker_compose(path, dumped, already_existed) except TypeError as t_err: - msg = "Could not dump {} {}".format(content, t_err) + msg = f"Could not dump {content} {t_err}" return __standardize_result(False, msg, None, None) @@ -297,9 +289,7 @@ def __write_docker_compose(path, docker_compose, already_existed): with salt.utils.files.fopen(file_path, "w") as fl: fl.write(salt.utils.stringutils.to_str(docker_compose)) except OSError: - return __standardize_result( - False, "Could not write {}".format(file_path), None, None - ) + return __standardize_result(False, f"Could not write {file_path}", None, None) project = __load_project_from_file_path(file_path) if isinstance(project, dict): if not already_existed: @@ -317,7 +307,7 @@ def __load_project(path): """ file_path = __get_docker_file_path(path) if file_path is None: - msg = "Could not find docker-compose file at {}".format(path) + msg = f"Could not find docker-compose file at {path}" return __standardize_result(False, msg, None, None) return __load_project_from_file_path(file_path) @@ -359,13 +349,13 @@ def __load_compose_definitions(path, definition): try: loaded_definition = json.deserialize(definition) except json.DeserializationError as jerr: - msg = "Could not parse {} {}".format(definition, jerr) + msg = f"Could not parse {definition} {jerr}" return None, None, __standardize_result(False, msg, None, None) else: try: loaded_definition = yaml.load(definition) except yaml.YAMLError as yerr: - msg = "Could not parse {} {}".format(definition, yerr) + msg = f"Could not parse {definition} {yerr}" return None, None, __standardize_result(False, msg, None, None) return compose_result, loaded_definition, None @@ -398,8 +388,8 @@ def __handle_except(inst): """ return __standardize_result( False, - "Docker-compose command {} failed".format(inspect.stack()[1][3]), - "{}".format(inst), + f"Docker-compose command {inspect.stack()[1][3]} failed", + f"{inst}", None, ) @@ -444,9 +434,7 @@ def get(path): """ file_path = __get_docker_file_path(path) if file_path is None: - return __standardize_result( - False, "Path {} is not present".format(path), None, None - ) + return __standardize_result(False, f"Path {path} is not present", None, None) salt_result = __read_docker_compose_file(file_path) if not salt_result["status"]: return salt_result @@ -878,7 +866,7 @@ def ps(path): for container in containers: command = container.human_readable_command if len(command) > 30: - command = "{} ...".format(command[:26]) + command = f"{command[:26]} ..." result[container.name] = { "id": container.id, "name": container.name, @@ -958,13 +946,13 @@ def service_create(path, service_name, definition): return err services = compose_result["compose_content"]["services"] if service_name in services: - msg = "Service {} already exists".format(service_name) + msg = f"Service {service_name} already exists" return __standardize_result(False, msg, None, None) services[service_name] = loaded_definition return __dump_compose_file( path, compose_result, - "Service {} created".format(service_name), + f"Service {service_name} created", already_existed=True, ) @@ -995,13 +983,13 @@ def service_upsert(path, service_name, definition): return err services = compose_result["compose_content"]["services"] if service_name in services: - msg = "Service {} already exists".format(service_name) + msg = f"Service {service_name} already exists" return __standardize_result(False, msg, None, None) services[service_name] = loaded_definition return __dump_compose_file( path, compose_result, - "Service definition for {} is set".format(service_name), + f"Service definition for {service_name} is set", already_existed=True, ) @@ -1029,13 +1017,13 @@ def service_remove(path, service_name): services = compose_result["compose_content"]["services"] if service_name not in services: return __standardize_result( - False, "Service {} did not exists".format(service_name), None, None + False, f"Service {service_name} did not exists", None, None ) del services[service_name] return __dump_compose_file( path, compose_result, - "Service {} is removed from {}".format(service_name, path), + f"Service {service_name} is removed from {path}", already_existed=True, ) @@ -1065,20 +1053,20 @@ def service_set_tag(path, service_name, tag): services = compose_result["compose_content"]["services"] if service_name not in services: return __standardize_result( - False, "Service {} did not exists".format(service_name), None, None + False, f"Service {service_name} did not exists", None, None ) if "image" not in services[service_name]: return __standardize_result( False, - 'Service {} did not contain the variable "image"'.format(service_name), + f'Service {service_name} did not contain the variable "image"', None, None, ) image = services[service_name]["image"].split(":")[0] - services[service_name]["image"] = "{}:{}".format(image, tag) + services[service_name]["image"] = f"{image}:{tag}" return __dump_compose_file( path, compose_result, - 'Service {} is set to tag "{}"'.format(service_name, tag), + f'Service {service_name} is set to tag "{tag}"', already_existed=True, ) diff --git a/salt/modules/dpkg_lowpkg.py b/salt/modules/dpkg_lowpkg.py index eefd852c511..3a405862163 100644 --- a/salt/modules/dpkg_lowpkg.py +++ b/salt/modules/dpkg_lowpkg.py @@ -62,14 +62,14 @@ def bin_pkg_info(path, saltenv="base"): newpath = __salt__["cp.cache_file"](path, saltenv) if not newpath: raise CommandExecutionError( - "Unable to retrieve {} from saltenv '{}'".format(path, saltenv) + f"Unable to retrieve {path} from saltenv '{saltenv}'" ) path = newpath else: if not os.path.exists(path): - raise CommandExecutionError("{} does not exist on minion".format(path)) + raise CommandExecutionError(f"{path} does not exist on minion") elif not os.path.isabs(path): - raise SaltInvocationError("{} does not exist on minion".format(path)) + raise SaltInvocationError(f"{path} does not exist on minion") cmd = ["dpkg", "-I", path] result = __salt__["cmd.run_all"](cmd, output_loglevel="trace") @@ -99,7 +99,7 @@ def bin_pkg_info(path, saltenv="base"): osarch = __grains__.get("osarch", "") arch = ret["arch"] if arch != "all" and osarch == "amd64" and osarch != arch: - ret["name"] += ":{}".format(arch) + ret["name"] += f":{arch}" return ret @@ -120,7 +120,7 @@ def unpurge(*packages): ret = {} __salt__["cmd.run"]( ["dpkg", "--set-selections"], - stdin=r"\n".join(["{} install".format(x) for x in packages]), + stdin=r"\n".join([f"{x} install" for x in packages]), python_shell=False, output_loglevel="trace", ) @@ -317,7 +317,7 @@ def _get_pkg_license(pkg): :return: """ licenses = set() - cpr = "/usr/share/doc/{}/copyright".format(pkg) + cpr = f"/usr/share/doc/{pkg}/copyright" if os.path.exists(cpr): with salt.utils.files.fopen(cpr, errors="ignore") as fp_: for line in salt.utils.stringutils.to_unicode(fp_.read()).split(os.linesep): @@ -335,7 +335,7 @@ def _get_pkg_install_time(pkg): """ iso_time = None if pkg is not None: - location = "/var/lib/dpkg/info/{}.list".format(pkg) + location = f"/var/lib/dpkg/info/{pkg}.list" if os.path.exists(location): iso_time = ( datetime.datetime.utcfromtimestamp( diff --git a/salt/modules/drac.py b/salt/modules/drac.py index d752199fb7b..cb25d91f6a0 100644 --- a/salt/modules/drac.py +++ b/salt/modules/drac.py @@ -42,7 +42,7 @@ def __execute_cmd(command): """ Execute rac commands """ - cmd = __salt__["cmd.run_all"]("racadm {}".format(command)) + cmd = __salt__["cmd.run_all"](f"racadm {command}") if cmd["retcode"] != 0: log.warning("racadm return an exit code '%s'.", cmd["retcode"]) @@ -105,7 +105,7 @@ def nameservers(*ns): for i in range(1, len(ns) + 1): if not __execute_cmd( - "config -g cfgLanNetworking -o cfgDNSServer{} {}".format(i, ns[i - 1]) + f"config -g cfgLanNetworking -o cfgDNSServer{i} {ns[i - 1]}" ): return False @@ -127,7 +127,7 @@ def syslog(server, enable=True): """ if enable and __execute_cmd("config -g cfgRemoteHosts -o cfgRhostsSyslogEnable 1"): return __execute_cmd( - "config -g cfgRemoteHosts -o cfgRhostsSyslogServer1 {}".format(server) + f"config -g cfgRemoteHosts -o cfgRhostsSyslogServer1 {server}" ) return __execute_cmd("config -g cfgRemoteHosts -o cfgRhostsSyslogEnable 0") @@ -165,9 +165,7 @@ def list_users(): _username = "" for idx in range(1, 17): - cmd = __salt__["cmd.run_all"]( - "racadm getconfig -g cfgUserAdmin -i {}".format(idx) - ) + cmd = __salt__["cmd.run_all"](f"racadm getconfig -g cfgUserAdmin -i {idx}") if cmd["retcode"] != 0: log.warning("racadm return an exit code '%s'.", cmd["retcode"]) @@ -208,7 +206,7 @@ def delete_user(username, uid=None): if uid: return __execute_cmd( - 'config -g cfgUserAdmin -o cfgUserAdminUserName -i {} ""'.format(uid) + f'config -g cfgUserAdmin -o cfgUserAdminUserName -i {uid} ""' ) else: @@ -284,7 +282,7 @@ def create_user(username, password, permissions, users=None): # Create user accountvfirst if not __execute_cmd( - "config -g cfgUserAdmin -o cfgUserAdminUserName -i {} {}".format(uid, username) + f"config -g cfgUserAdmin -o cfgUserAdminUserName -i {uid} {username}" ): delete_user(username, uid) return False @@ -302,9 +300,7 @@ def create_user(username, password, permissions, users=None): return False # Enable users admin - if not __execute_cmd( - "config -g cfgUserAdmin -o cfgUserAdminEnable -i {} 1".format(uid) - ): + if not __execute_cmd(f"config -g cfgUserAdmin -o cfgUserAdminEnable -i {uid} 1"): delete_user(username, uid) return False @@ -378,7 +374,7 @@ def set_snmp(community): salt dell drac.set_snmp public """ return __execute_cmd( - "config -g cfgOobSnmp -o cfgOobSnmpAgentCommunity {}".format(community) + f"config -g cfgOobSnmp -o cfgOobSnmpAgentCommunity {community}" ) @@ -393,7 +389,7 @@ def set_network(ip, netmask, gateway): salt dell drac.set_network [DRAC IP] [NETMASK] [GATEWAY] salt dell drac.set_network 192.168.0.2 255.255.255.0 192.168.0.1 """ - return __execute_cmd("setniccfg -s {} {} {}".format(ip, netmask, gateway)) + return __execute_cmd(f"setniccfg -s {ip} {netmask} {gateway}") def server_reboot(): diff --git a/salt/modules/dracr.py b/salt/modules/dracr.py index bb3192c370f..31a939a9267 100644 --- a/salt/modules/dracr.py +++ b/salt/modules/dracr.py @@ -68,12 +68,12 @@ def __execute_cmd( if module.startswith("ALL_"): modswitch = "-a " + module[module.index("_") + 1 : len(module)].lower() else: - modswitch = "-m {}".format(module) + modswitch = f"-m {module}" else: modswitch = "" if not host: # This is a local call - cmd = __salt__["cmd.run_all"]("racadm {} {}".format(command, modswitch)) + cmd = __salt__["cmd.run_all"](f"racadm {command} {modswitch}") else: cmd = __salt__["cmd.run_all"]( "racadm -r {} -u {} -p {} {} {}".format( @@ -99,12 +99,12 @@ def __execute_ret( if module == "ALL": modswitch = "-a " else: - modswitch = "-m {}".format(module) + modswitch = f"-m {module}" else: modswitch = "" if not host: # This is a local call - cmd = __salt__["cmd.run_all"]("racadm {} {}".format(command, modswitch)) + cmd = __salt__["cmd.run_all"](f"racadm {command} {modswitch}") else: cmd = __salt__["cmd.run_all"]( "racadm -r {} -u {} -p {} {} {}".format( @@ -152,7 +152,7 @@ def get_dns_dracname(host=None, admin_username=None, admin_password=None): def set_dns_dracname(name, host=None, admin_username=None, admin_password=None): ret = __execute_ret( - "set iDRAC.NIC.DNSRacName {}".format(name), + f"set iDRAC.NIC.DNSRacName {name}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -255,7 +255,7 @@ def network_info(host=None, admin_username=None, admin_password=None, module=Non if module not in inv.get("switch") and module not in inv.get("server"): cmd = {} cmd["retcode"] = -1 - cmd["stdout"] = "No module {} found.".format(module) + cmd["stdout"] = f"No module {module} found." return cmd cmd = __execute_ret( @@ -292,7 +292,7 @@ def nameservers(ns, host=None, admin_username=None, admin_password=None, module= for i in range(1, len(ns) + 1): if not __execute_cmd( - "config -g cfgLanNetworking -o cfgDNSServer{} {}".format(i, ns[i - 1]), + f"config -g cfgLanNetworking -o cfgDNSServer{i} {ns[i - 1]}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -331,7 +331,7 @@ def syslog( module=None, ): return __execute_cmd( - "config -g cfgRemoteHosts -o cfgRhostsSyslogServer1 {}".format(server), + f"config -g cfgRemoteHosts -o cfgRhostsSyslogServer1 {server}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -385,7 +385,7 @@ def list_users(host=None, admin_username=None, admin_password=None, module=None) for idx in range(1, 17): cmd = __execute_ret( - "getconfig -g cfgUserAdmin -i {}".format(idx), + f"getconfig -g cfgUserAdmin -i {idx}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -433,7 +433,7 @@ def delete_user( if uid: return __execute_cmd( - "config -g cfgUserAdmin -o cfgUserAdminUserName -i {} ".format(uid), + f"config -g cfgUserAdmin -o cfgUserAdminUserName -i {uid} ", host=host, admin_username=admin_username, admin_password=admin_password, @@ -521,7 +521,7 @@ def deploy_password( on that then setting the password is much quicker. """ return __execute_cmd( - "deploy -u {} -p {}".format(username, password), + f"deploy -u {username} -p {password}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -544,7 +544,7 @@ def deploy_snmp(snmp, host=None, admin_username=None, admin_password=None, modul """ return __execute_cmd( - "deploy -v SNMPv2 {} ro".format(snmp), + f"deploy -v SNMPv2 {snmp} ro", host=host, admin_username=admin_username, admin_password=admin_password, @@ -598,7 +598,7 @@ def create_user( # Create user account first if not __execute_cmd( - "config -g cfgUserAdmin -o cfgUserAdminUserName -i {} {}".format(uid, username), + f"config -g cfgUserAdmin -o cfgUserAdminUserName -i {uid} {username}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -619,9 +619,7 @@ def create_user( return False # Enable users admin - if not __execute_cmd( - "config -g cfgUserAdmin -o cfgUserAdminEnable -i {} 1".format(uid) - ): + if not __execute_cmd(f"config -g cfgUserAdmin -o cfgUserAdminEnable -i {uid} 1"): delete_user(username, uid) return False @@ -702,7 +700,7 @@ def set_snmp(community, host=None, admin_username=None, admin_password=None): salt dell dracr.set_snmp public """ return __execute_cmd( - "config -g cfgOobSnmp -o cfgOobSnmpAgentCommunity {}".format(community), + f"config -g cfgOobSnmp -o cfgOobSnmpAgentCommunity {community}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -766,7 +764,7 @@ def server_power( """ return __execute_cmd( - "serveraction {}".format(status), + f"serveraction {status}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1088,7 +1086,7 @@ def set_slotname(slot, name, host=None, admin_username=None, admin_password=None """ return __execute_cmd( - "config -g cfgServerInfo -o cfgServerName -i {} {}".format(slot, name), + f"config -g cfgServerInfo -o cfgServerName -i {slot} {name}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1120,7 +1118,7 @@ def set_chassis_name(name, host=None, admin_username=None, admin_password=None): """ return __execute_cmd( - "setsysinfo -c chassisname {}".format(name), + f"setsysinfo -c chassisname {name}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1264,7 +1262,7 @@ def set_chassis_location(location, host=None, admin_username=None, admin_passwor """ return __execute_cmd( - "setsysinfo -c chassislocation {}".format(location), + f"setsysinfo -c chassislocation {location}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1367,7 +1365,7 @@ def set_general( cfg_sec, cfg_var, val, host=None, admin_username=None, admin_password=None ): return __execute_cmd( - "config -g {} -o {} {}".format(cfg_sec, cfg_var, val), + f"config -g {cfg_sec} -o {cfg_var} {val}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1376,7 +1374,7 @@ def set_general( def get_general(cfg_sec, cfg_var, host=None, admin_username=None, admin_password=None): ret = __execute_ret( - "getconfig -g {} -o {}".format(cfg_sec, cfg_var), + f"getconfig -g {cfg_sec} -o {cfg_var}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1457,7 +1455,7 @@ def _update_firmware(cmd, host=None, admin_username=None, admin_password=None): def bare_rac_cmd(cmd, host=None, admin_username=None, admin_password=None): ret = __execute_ret( - "{}".format(cmd), + f"{cmd}", host=host, admin_username=admin_username, admin_password=admin_password, @@ -1487,13 +1485,13 @@ def update_firmware(filename, host=None, admin_username=None, admin_password=Non """ if os.path.exists(filename): return _update_firmware( - "update -f {}".format(filename), + f"update -f {filename}", host=None, admin_username=None, admin_password=None, ) else: - raise CommandExecutionError("Unable to find firmware file {}".format(filename)) + raise CommandExecutionError(f"Unable to find firmware file {filename}") def update_firmware_nfs_or_cifs( @@ -1532,13 +1530,13 @@ def update_firmware_nfs_or_cifs( """ if os.path.exists(filename): return _update_firmware( - "update -f {} -l {}".format(filename, share), + f"update -f {filename} -l {share}", host=None, admin_username=None, admin_password=None, ) else: - raise CommandExecutionError("Unable to find firmware file {}".format(filename)) + raise CommandExecutionError(f"Unable to find firmware file {filename}") # def get_idrac_nic() diff --git a/salt/modules/ebuildpkg.py b/salt/modules/ebuildpkg.py index 1b268fa7476..31f1fc6d516 100644 --- a/salt/modules/ebuildpkg.py +++ b/salt/modules/ebuildpkg.py @@ -303,7 +303,7 @@ def _get_upgradable(backtrack=3): "--ask", "n", "--backtrack", - "{}".format(backtrack), + f"{backtrack}", "--pretend", "--update", "--newuse", @@ -549,7 +549,7 @@ def install( fromrepo=None, uses=None, binhost=None, - **kwargs + **kwargs, ): """ .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 @@ -682,9 +682,9 @@ def install( if not version_num: version_num = "" if slot is not None: - version_num += ":{}".format(slot) + version_num += f":{slot}" if fromrepo is not None: - version_num += "::{}".format(fromrepo) + version_num += f"::{fromrepo}" if uses is not None: version_num += "[{}]".format(",".join(uses)) pkg_params = {name: version_num} @@ -726,11 +726,11 @@ def install( # If no prefix characters were supplied and verstr contains a version, use '=' if len(verstr) > 0 and verstr[0] != ":" and verstr[0] != "[": prefix = prefix or "=" - target = "{}{}-{}".format(prefix, param, verstr) + target = f"{prefix}{param}-{verstr}" else: - target = "{}{}".format(param, verstr) + target = f"{param}{verstr}" else: - target = "{}".format(param) + target = f"{param}" if "[" in target: old = __salt__["portage_config.get_flags_from_package_conf"]( @@ -844,10 +844,10 @@ def update(pkg, slot=None, fromrepo=None, refresh=False, binhost=None, **kwargs) full_atom = pkg if slot is not None: - full_atom = "{}:{}".format(full_atom, slot) + full_atom = f"{full_atom}:{slot}" if fromrepo is not None: - full_atom = "{}::{}".format(full_atom, fromrepo) + full_atom = f"{full_atom}::{fromrepo}" if binhost == "try": bin_opts = ["-g"] @@ -952,7 +952,7 @@ def upgrade(refresh=True, binhost=None, backtrack=3, **kwargs): "n", "--quiet", "--backtrack", - "{}".format(backtrack), + f"{backtrack}", "--update", "--newuse", "--deep", @@ -1036,9 +1036,9 @@ def remove(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs): ): fullatom = name if slot is not None: - targets = ["{}:{}".format(fullatom, slot)] + targets = [f"{fullatom}:{slot}"] if fromrepo is not None: - targets = ["{}::{}".format(fullatom, fromrepo)] + targets = [f"{fullatom}::{fromrepo}"] targets = [fullatom] else: targets = [x for x in pkg_params if x in old] @@ -1167,9 +1167,9 @@ def depclean(name=None, slot=None, fromrepo=None, pkgs=None): ): fullatom = name if slot is not None: - targets = ["{}:{}".format(fullatom, slot)] + targets = [f"{fullatom}:{slot}"] if fromrepo is not None: - targets = ["{}::{}".format(fullatom, fromrepo)] + targets = [f"{fullatom}::{fromrepo}"] targets = [fullatom] else: targets = [x for x in pkg_params if x in old] @@ -1247,9 +1247,9 @@ def check_extra_requirements(pkgname, pkgver): # If no prefix characters were supplied and verstr contains a version, use '=' if verstr[0] != ":" and verstr[0] != "[": prefix = prefix or "=" - atom = "{}{}-{}".format(prefix, pkgname, verstr) + atom = f"{prefix}{pkgname}-{verstr}" else: - atom = "{}{}".format(pkgname, verstr) + atom = f"{pkgname}{verstr}" else: return True diff --git a/salt/modules/eselect.py b/salt/modules/eselect.py index 86c4d246a46..33a1e96709b 100644 --- a/salt/modules/eselect.py +++ b/salt/modules/eselect.py @@ -194,7 +194,7 @@ def set_target(module, target, module_parameter=None, action_parameter=None): salt '*' eselect.set_target kernel linux-3.17.5-gentoo """ if action_parameter: - action_parameter = "{} {}".format(action_parameter, target) + action_parameter = f"{action_parameter} {target}" else: action_parameter = target diff --git a/salt/modules/ethtool.py b/salt/modules/ethtool.py index 16f9c4a7b53..0fb0a16b98a 100644 --- a/salt/modules/ethtool.py +++ b/salt/modules/ethtool.py @@ -312,8 +312,8 @@ def _ethtool_command(devname, *args, **kwargs): if not ethtool: raise CommandExecutionError("Command 'ethtool' cannot be found") switches = " ".join(arg for arg in args) - params = " ".join("{} {}".format(key, val) for key, val in kwargs.items()) - cmd = "{} {} {} {}".format(ethtool, switches, devname, params).strip() + params = " ".join(f"{key} {val}" for key, val in kwargs.items()) + cmd = f"{ethtool} {switches} {devname} {params}".strip() ret = __salt__["cmd.run"](cmd, ignore_retcode=True).splitlines() if ret and ret[0].startswith("Cannot"): raise CommandExecutionError(ret[0]) @@ -336,7 +336,7 @@ def _validate_params(valid_params, kwargs): validated[key] = val if not validated: raise CommandExecutionError( - "None of the valid parameters were provided: {}".format(valid_params) + f"None of the valid parameters were provided: {valid_params}" ) return validated diff --git a/salt/modules/extfs.py b/salt/modules/extfs.py index 370e3066b46..5ceb16f3963 100644 --- a/salt/modules/extfs.py +++ b/salt/modules/extfs.py @@ -96,10 +96,10 @@ def mkfs(device, fs_type, **kwargs): if key in kwarg_map: opt = kwarg_map[key] if kwargs[key] == "True": - opts += "-{} ".format(opt) + opts += f"-{opt} " else: - opts += "-{} {} ".format(opt, kwargs[key]) - cmd = "mke2fs -F -t {} {}{}".format(fs_type, opts, device) + opts += f"-{opt} {kwargs[key]} " + cmd = f"mke2fs -F -t {fs_type} {opts}{device}" out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() ret = [] for line in out: @@ -183,10 +183,10 @@ def tune(device, **kwargs): if key in kwarg_map: opt = kwarg_map[key] if kwargs[key] == "True": - opts += "-{} ".format(opt) + opts += f"-{opt} " else: - opts += "-{} {} ".format(opt, kwargs[key]) - cmd = "tune2fs {}{}".format(opts, device) + opts += f"-{opt} {kwargs[key]} " + cmd = f"tune2fs {opts}{device}" out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() return out @@ -229,7 +229,7 @@ def dump(device, args=None): salt '*' extfs.dump /dev/sda1 """ - cmd = "dumpe2fs {}".format(device) + cmd = f"dumpe2fs {device}" if args: cmd = cmd + " -" + args ret = {"attributes": {}, "blocks": {}} @@ -264,7 +264,7 @@ def dump(device, args=None): line = line.replace("]", "") comps = line.split() blkgrp = comps[1] - group = "Group {}".format(blkgrp) + group = f"Group {blkgrp}" ret["blocks"][group] = {} ret["blocks"][group]["group"] = blkgrp ret["blocks"][group]["range"] = comps[3] diff --git a/salt/modules/file.py b/salt/modules/file.py index 68576d04391..09364804fe6 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -435,7 +435,7 @@ def set_mode(path, mode): if not mode: mode = "0" if not os.path.exists(path): - raise CommandExecutionError("{}: File not found".format(path)) + raise CommandExecutionError(f"{path}: File not found") try: os.chmod(path, int(mode, 8)) except Exception: # pylint: disable=broad-except @@ -678,14 +678,14 @@ def chattr(*files, **kwargs): cmd = ["chattr"] if operator == "add": - attrs = "+{}".format(attributes) + attrs = f"+{attributes}" elif operator == "remove": - attrs = "-{}".format(attributes) + attrs = f"-{attributes}" cmd.append(attrs) if flags is not None: - cmd.append("-{}".format(flags)) + cmd.append(f"-{flags}") if version is not None: cmd.extend(["-v", version]) @@ -828,12 +828,7 @@ def get_source_sum( "following are supported hash types and lengths: {}.".format( source_hash, ", ".join(salt.utils.files.VALID_PROTOS), - ", ".join( - [ - "{} ({})".format(HASHES_REVMAP[x], x) - for x in sorted(HASHES_REVMAP) - ] - ), + ", ".join([f"{HASHES_REVMAP[x]} ({x})" for x in sorted(HASHES_REVMAP)]), ) ) @@ -849,7 +844,7 @@ def get_source_sum( ) if not hash_fn: raise CommandExecutionError( - "Source hash file {} not found".format(source_hash) + f"Source hash file {source_hash} not found" ) else: if proto != "": @@ -879,7 +874,7 @@ def get_source_sum( _invalid_source_hash_format() except ValueError: # No hash type, try to figure out by hash length - if not re.match("^[{}]+$".format(string.hexdigits), source_hash): + if not re.match(f"^[{string.hexdigits}]+$", source_hash): _invalid_source_hash_format() ret["hsum"] = source_hash source_hash_len = len(source_hash) @@ -964,10 +959,7 @@ def check_hash(path, file_hash): file_hash, hash_len, ", ".join( - [ - "{} ({})".format(HASHES_REVMAP[x], x) - for x in sorted(HASHES_REVMAP) - ] + [f"{HASHES_REVMAP[x]} ({x})" for x in sorted(HASHES_REVMAP)] ), ) ) @@ -1097,7 +1089,7 @@ def find(path, *args, **kwargs): try: finder = salt.utils.find.Finder(kwargs) except ValueError as ex: - return "error: {}".format(ex) + return f"error: {ex}" ret = [ item @@ -1192,11 +1184,11 @@ def sed( options = options.replace("-r", "-E") cmd = ["sed"] - cmd.append("-i{}".format(backup) if backup else "-i") + cmd.append(f"-i{backup}" if backup else "-i") cmd.extend(salt.utils.args.shlex_split(options)) cmd.append( r"{limit}{negate_match}s/{before}/{after}/{flags}".format( - limit="/{}/ ".format(limit) if limit else "", + limit=f"/{limit}/ " if limit else "", negate_match="!" if negate_match else "", before=before, after=after, @@ -1240,9 +1232,9 @@ def sed_contains(path, text, limit="", flags="g"): cmd.extend(salt.utils.args.shlex_split(options)) cmd.append( r"{limit}s/{before}/$/{flags}".format( - limit="/{}/ ".format(limit) if limit else "", + limit=f"/{limit}/ " if limit else "", before=before, - flags="p{}".format(flags), + flags=f"p{flags}", ) ) cmd.append(path) @@ -1323,10 +1315,10 @@ def psed( # The pattern to replace with does not need to be escaped limit = _sed_esc(limit, escape_all) - shutil.copy2(path, "{}{}".format(path, backup)) + shutil.copy2(path, f"{path}{backup}") with salt.utils.files.fopen(path, "w") as ofile: - with salt.utils.files.fopen("{}{}".format(path, backup), "r") as ifile: + with salt.utils.files.fopen(f"{path}{backup}", "r") as ifile: if multi is True: for line in ifile.readline(): ofile.write( @@ -1509,12 +1501,12 @@ def comment_line(path, regex, char="#", cmnt=True, backup=".bak"): # Make sure the file exists if not os.path.isfile(path): - raise SaltInvocationError("File not found: {}".format(path)) + raise SaltInvocationError(f"File not found: {path}") # Make sure it is a text file if not __utils__["files.is_text"](path): raise SaltInvocationError( - "Cannot perform string replacements on a binary file: {}".format(path) + f"Cannot perform string replacements on a binary file: {path}" ) # First check the whole file, determine whether to make the replacement @@ -1536,14 +1528,12 @@ def comment_line(path, regex, char="#", cmnt=True, backup=".bak"): # Load lines into dictionaries, set found to True orig_file.append(line) if cmnt: - new_file.append("{}{}".format(char, line)) + new_file.append(f"{char}{line}") else: new_file.append(line.lstrip(char)) found = True except OSError as exc: - raise CommandExecutionError( - "Unable to open file '{}'. Exception: {}".format(path, exc) - ) + raise CommandExecutionError(f"Unable to open file '{path}'. Exception: {exc}") # We've searched the whole file. If we didn't find anything, return False if not found: @@ -1558,7 +1548,7 @@ def comment_line(path, regex, char="#", cmnt=True, backup=".bak"): try: temp_file = _mkstemp_copy(path=path, preserve_inode=False) except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") try: # Open the file in write mode @@ -1577,7 +1567,7 @@ def comment_line(path, regex, char="#", cmnt=True, backup=".bak"): if re.match(regex, line): # Write the new line if cmnt: - wline = "{}{}".format(char, line) + wline = f"{char}{line}" else: wline = line.lstrip(char) else: @@ -1593,13 +1583,13 @@ def comment_line(path, regex, char="#", cmnt=True, backup=".bak"): "Exception: {}".format(path, temp_file, exc) ) except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") if backup: # Move the backup file to the original directory - backup_name = "{}{}".format(path, backup) + backup_name = f"{path}{backup}" try: shutil.move(temp_file, backup_name) except OSError as exc: @@ -1686,9 +1676,7 @@ def _mkstemp_copy(path, preserve_inode=True): try: temp_file = salt.utils.files.mkstemp(prefix=salt.utils.files.TEMPFILE_PREFIX) except OSError as exc: - raise CommandExecutionError( - "Unable to create temp file. Exception: {}".format(exc) - ) + raise CommandExecutionError(f"Unable to create temp file. Exception: {exc}") # use `copy` to preserve the inode of the # original file, and thus preserve hardlinks # to the inode. otherwise, use `move` to @@ -1727,7 +1715,7 @@ def _regex_to_static(src, regex): compiled = re.compile(regex, re.DOTALL) src = [line for line in src if compiled.search(line) or line.count(regex)] except Exception as ex: # pylint: disable=broad-except - raise CommandExecutionError("{}: '{}'".format(_get_error_message(ex), regex)) + raise CommandExecutionError(f"{_get_error_message(ex)}: '{regex}'") return src @@ -1748,7 +1736,7 @@ def _assert_occurrence(probe, target, amount=1): if msg: raise CommandExecutionError( - 'Found {} expected occurrences in "{}" expression'.format(msg, target) + f'Found {msg} expected occurrences in "{target}" expression' ) return occ @@ -1859,7 +1847,7 @@ def _set_line( "Mode was not defined. How to process the file?" ) else: - raise CommandExecutionError("Unknown mode: {}".format(mode)) + raise CommandExecutionError(f"Unknown mode: {mode}") if mode != "delete" and content is None: raise CommandExecutionError("Content can only be empty if mode is delete") @@ -2235,7 +2223,7 @@ def line( if not os.path.isfile(path): if not quiet: raise CommandExecutionError( - 'File "{}" does not exists or is not a file.'.format(path) + f'File "{path}" does not exists or is not a file.' ) return False # No changes had happened @@ -2246,7 +2234,7 @@ def line( "Mode was not defined. How to process the file?" ) else: - raise CommandExecutionError('Unknown mode: "{}"'.format(mode)) + raise CommandExecutionError(f'Unknown mode: "{mode}"') # We've set the content to be empty in the function params but we want to make sure # it gets passed when needed. Feature #37092 @@ -2494,11 +2482,11 @@ def replace( if ignore_if_missing: return False else: - raise SaltInvocationError("File not found: {}".format(path)) + raise SaltInvocationError(f"File not found: {path}") if not __utils__["files.is_text"](path): raise SaltInvocationError( - "Cannot perform string replacements on a binary file: {}".format(path) + f"Cannot perform string replacements on a binary file: {path}" ) if search_only and (append_if_not_found or prepend_if_not_found): @@ -2577,7 +2565,7 @@ def replace( # content if it was pre/appended in a previous run. if re.search( salt.utils.stringutils.to_bytes( - "^{}($|(?=\r\n))".format(re.escape(content)) + f"^{re.escape(content)}($|(?=\r\n))" ), r_data, flags=re_flags, @@ -2595,9 +2583,7 @@ def replace( has_changes = False except OSError as exc: - raise CommandExecutionError( - "Unable to open file '{}'. Exception: {}".format(path, exc) - ) + raise CommandExecutionError(f"Unable to open file '{path}'. Exception: {exc}") finally: if r_data and isinstance(r_data, mmap.mmap): r_data.close() @@ -2608,7 +2594,7 @@ def replace( # Create a copy to read from and to use as a backup later temp_file = _mkstemp_copy(path=path, preserve_inode=preserve_inode) except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") r_data = None try: @@ -2636,12 +2622,12 @@ def replace( "Exception: {}".format(path, temp_file, exc) ) except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") finally: if r_data and isinstance(r_data, mmap.mmap): r_data.close() except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") if not found and (append_if_not_found or prepend_if_not_found): if not_found_content is None: @@ -2667,7 +2653,7 @@ def replace( # Create a copy to read from and for later use as a backup temp_file = _mkstemp_copy(path=path, preserve_inode=preserve_inode) except OSError as exc: - raise CommandExecutionError("Exception: {}".format(exc)) + raise CommandExecutionError(f"Exception: {exc}") # write new content in the file while avoiding partial reads try: fh_ = salt.utils.atomicfile.atomic_open(path, "wb") @@ -2679,7 +2665,7 @@ def replace( if backup and has_changes and not dry_run: # keep the backup only if it was requested # and only if there were any changes - backup_name = "{}{}".format(path, backup) + backup_name = f"{path}{backup}" try: shutil.move(temp_file, backup_name) except OSError as exc: @@ -2689,8 +2675,8 @@ def replace( "Exception: {}".format(path, temp_file, exc) ) if symlink: - symlink_backup = "{}{}".format(given_path, backup) - target_backup = "{}{}".format(target_path, backup) + symlink_backup = f"{given_path}{backup}" + target_backup = f"{target_path}{backup}" # Always clobber any existing symlink backup # to match the behaviour of the 'backup' option try: @@ -2709,7 +2695,7 @@ def replace( os.remove(temp_file) except OSError as exc: raise CommandExecutionError( - "Unable to delete temp file '{}'. Exception: {}".format(temp_file, exc) + f"Unable to delete temp file '{temp_file}'. Exception: {exc}" ) if not dry_run and not salt.utils.platform.is_windows(): @@ -2848,7 +2834,7 @@ def blockreplace( path = os.path.expanduser(path) if not os.path.exists(path): - raise SaltInvocationError("File not found: {}".format(path)) + raise SaltInvocationError(f"File not found: {path}") try: file_encoding = __utils__["files.get_encoding"](path) @@ -2858,7 +2844,7 @@ def blockreplace( if __utils__["files.is_binary"](path): if not file_encoding: raise SaltInvocationError( - "Cannot perform string replacements on a binary file: {}".format(path) + f"Cannot perform string replacements on a binary file: {path}" ) if insert_before_match or insert_after_match: @@ -2970,7 +2956,7 @@ def blockreplace( new_file.append(line) except OSError as exc: - raise CommandExecutionError("Failed to read from {}: {}".format(path, exc)) + raise CommandExecutionError(f"Failed to read from {path}: {exc}") finally: if linesep is None: # If the file was empty, we will not have set linesep yet. Assume @@ -3035,7 +3021,7 @@ def blockreplace( # backup old content if backup is not False: - backup_path = "{}{}".format(path, backup) + backup_path = f"{path}{backup}" shutil.copy2(path, backup_path) # copy2 does not preserve ownership if salt.utils.platform.is_windows(): @@ -3070,7 +3056,7 @@ def blockreplace( # backup old content if backup is not False: - backup_path = "{}{}".format(path, backup) + backup_path = f"{path}{backup}" shutil.copy2(path, backup_path) # copy2 does not preserve ownership if salt.utils.platform.is_windows(): @@ -3403,11 +3389,9 @@ def append(path, *args, **kwargs): # Append lines in text mode with salt.utils.files.fopen(path, "a") as ofile: for new_line in args: - ofile.write( - salt.utils.stringutils.to_str("{}{}".format(new_line, os.linesep)) - ) + ofile.write(salt.utils.stringutils.to_str(f"{new_line}{os.linesep}")) - return 'Wrote {} lines to "{}"'.format(len(args), path) + return f'Wrote {len(args)} lines to "{path}"' def prepend(path, *args, **kwargs): @@ -3461,12 +3445,12 @@ def prepend(path, *args, **kwargs): preface = [] for line in args: - preface.append("{}\n".format(line)) + preface.append(f"{line}\n") with salt.utils.files.fopen(path, "w") as ofile: contents = preface + contents ofile.write(salt.utils.stringutils.to_str("".join(contents))) - return 'Prepended {} lines to "{}"'.format(len(args), path) + return f'Prepended {len(args)} lines to "{path}"' def write(path, *args, **kwargs): @@ -3511,10 +3495,10 @@ def write(path, *args, **kwargs): contents = [] for line in args: - contents.append("{}\n".format(line)) + contents.append(f"{line}\n") with salt.utils.files.fopen(path, "w") as ofile: ofile.write(salt.utils.stringutils.to_str("".join(contents))) - return 'Wrote {} lines to "{}"'.format(len(contents), path) + return f'Wrote {len(contents)} lines to "{path}"' def touch(name, atime=None, mtime=None): @@ -3675,7 +3659,7 @@ def link(src, path): os.link(src, path) return True except OSError as E: - raise CommandExecutionError("Could not create '{}': {}".format(path, E)) + raise CommandExecutionError(f"Could not create '{path}': {E}") return False @@ -3745,7 +3729,7 @@ def symlink(src, path, force=False, atomic=False): path = os.path.expanduser(path) if not os.path.isabs(path): - raise SaltInvocationError("Link path must be absolute: {}".format(path)) + raise SaltInvocationError(f"Link path must be absolute: {path}") if os.path.islink(path): try: @@ -3758,11 +3742,11 @@ def symlink(src, path, force=False, atomic=False): pass if not force and not atomic: - msg = "Found existing symlink: {}".format(path) + msg = f"Found existing symlink: {path}" raise CommandExecutionError(msg) if os.path.exists(path) and not force and not atomic: - msg = "Existing path is not a symlink: {}".format(path) + msg = f"Existing path is not a symlink: {path}" raise CommandExecutionError(msg) if (os.path.islink(path) or os.path.exists(path)) and force and not atomic: @@ -3782,13 +3766,13 @@ def symlink(src, path, force=False, atomic=False): return True except OSError: os.remove(temp_link) - raise CommandExecutionError("Could not create '{}'".format(path)) + raise CommandExecutionError(f"Could not create '{path}'") try: os.symlink(src, path) return True except OSError: - raise CommandExecutionError("Could not create '{}'".format(path)) + raise CommandExecutionError(f"Could not create '{path}'") def rename(src, dst): @@ -3811,7 +3795,7 @@ def rename(src, dst): os.rename(src, dst) return True except OSError: - raise CommandExecutionError("Could not rename '{}' to '{}'".format(src, dst)) + raise CommandExecutionError(f"Could not rename '{src}' to '{dst}'") return False @@ -3849,7 +3833,7 @@ def copy(src, dst, recurse=False, remove_existing=False): raise SaltInvocationError("File path must be absolute.") if not os.path.exists(src): - raise CommandExecutionError("No such file or directory '{}'".format(src)) + raise CommandExecutionError(f"No such file or directory '{src}'") if not salt.utils.platform.is_windows(): pre_user = get_user(src) @@ -3872,7 +3856,7 @@ def copy(src, dst, recurse=False, remove_existing=False): else: shutil.copyfile(src, dst) except OSError: - raise CommandExecutionError("Could not copy '{}' to '{}'".format(src, dst)) + raise CommandExecutionError(f"Could not copy '{src}' to '{dst}'") if not salt.utils.platform.is_windows(): check_perms(dst, None, pre_user, pre_group, pre_mode) @@ -4014,10 +3998,10 @@ def readlink(path, canonicalize=False): path = os.path.expandvars(path) if not os.path.isabs(path): - raise SaltInvocationError("Path to link must be absolute: {}".format(path)) + raise SaltInvocationError(f"Path to link must be absolute: {path}") if not os.path.islink(path): - raise SaltInvocationError("A valid link was not specified: {}".format(path)) + raise SaltInvocationError(f"A valid link was not specified: {path}") if canonicalize: return os.path.realpath(path) @@ -4026,7 +4010,7 @@ def readlink(path, canonicalize=False): return salt.utils.path.readlink(path) except OSError as exc: if exc.errno == errno.EINVAL: - raise CommandExecutionError("Not a symbolic link: {}".format(path)) + raise CommandExecutionError(f"Not a symbolic link: {path}") raise CommandExecutionError(str(exc)) @@ -4090,7 +4074,7 @@ def statvfs(path): ) } except OSError: - raise CommandExecutionError("Could not statvfs '{}'".format(path)) + raise CommandExecutionError(f"Could not statvfs '{path}'") return False @@ -4118,7 +4102,7 @@ def stats(path, hash_type=None, follow_symlinks=True): # message in this exception. Any changes made to the message for this # exception will reflect the file.directory state as well, and will # likely require changes there. - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") else: if follow_symlinks: pstat = os.stat(path) @@ -4260,7 +4244,7 @@ def remove(path, **kwargs): path = os.path.expanduser(path) if not os.path.isabs(path): - raise SaltInvocationError("File path must be absolute: {}".format(path)) + raise SaltInvocationError(f"File path must be absolute: {path}") try: if os.path.islink(path) or (os.path.exists(path) and not os.path.isdir(path)): @@ -4270,7 +4254,7 @@ def remove(path, **kwargs): shutil.rmtree(path) return True except OSError as exc: - raise CommandExecutionError("Could not remove '{}': {}".format(path, exc)) + raise CommandExecutionError(f"Could not remove '{path}': {exc}") return False @@ -4352,7 +4336,7 @@ def get_selinux_context(path): if cmd_ret["retcode"] == 0: ret = cmd_ret["stdout"] else: - ret = "No selinux context information is available for {}".format(path) + ret = f"No selinux context information is available for {path}" return ret @@ -4388,9 +4372,7 @@ def set_selinux_context( ) if fcontext_result.get("retcode", None) != 0: # Problem setting fcontext policy - raise CommandExecutionError( - "Problem setting fcontext: {}".format(fcontext_result) - ) + raise CommandExecutionError(f"Problem setting fcontext: {fcontext_result}") cmd = ["chcon"] if user: @@ -4420,7 +4402,7 @@ def source_list(source, source_hash, saltenv): salt '*' file.source_list salt://http/httpd.conf '{hash_type: 'md5', 'hsum': }' base """ - contextkey = "{}_|-{}_|-{}".format(source, source_hash, saltenv) + contextkey = f"{source}_|-{source_hash}_|-{saltenv}" if contextkey in __context__: return __context__[contextkey] @@ -4700,12 +4682,12 @@ def get_managed( if parsed_scheme == "": parsed_path = sfn = source if not os.path.exists(sfn): - msg = "Local file source {} does not exist".format(sfn) + msg = f"Local file source {sfn} does not exist" return "", {}, msg elif parsed_scheme == "file": sfn = parsed_path if not os.path.exists(sfn): - msg = "Local file source {} does not exist".format(sfn) + msg = f"Local file source {sfn} does not exist" return "", {}, msg if parsed_scheme and parsed_scheme.lower() in string.ascii_lowercase: @@ -4718,7 +4700,7 @@ def get_managed( return ( "", {}, - "Source file {} not found in saltenv '{}'".format(source, saltenv), + f"Source file {source} not found in saltenv '{saltenv}'", ) elif not source_hash and unix_local_source: source_sum = _get_local_file_source_sum(parsed_path) @@ -4782,13 +4764,13 @@ def get_managed( # A 404 or other error code may raise an exception, catch it # and return a comment that will fail the calling state. _source = salt.utils.url.redact_http_basic_auth(source) - return "", {}, "Failed to cache {}: {}".format(_source, exc) + return "", {}, f"Failed to cache {_source}: {exc}" # If cache failed, sfn will be False, so do a truth check on sfn first # as invoking os.path.exists() on a bool raises a TypeError. if not sfn or not os.path.exists(sfn): _source = salt.utils.url.redact_http_basic_auth(source) - return sfn, {}, "Source file '{}' not found".format(_source) + return sfn, {}, f"Source file '{_source}' not found" if sfn == name: raise SaltInvocationError("Source file cannot be the same as destination") @@ -4817,7 +4799,7 @@ def get_managed( return ( sfn, {}, - "Specified template format {} is not supported".format(template), + f"Specified template format {template} is not supported", ) if data["result"]: @@ -4890,7 +4872,7 @@ def extract_hash( hash_type, ) hash_type = "" - hash_len_expr = "{},{}".format(min(HASHES_REVMAP), max(HASHES_REVMAP)) + hash_len_expr = f"{min(HASHES_REVMAP)},{max(HASHES_REVMAP)}" else: hash_len_expr = str(hash_len) @@ -5197,7 +5179,7 @@ def check_perms( ret["changes"]["user"] = user else: ret["result"] = False - ret["comment"].append("Failed to change user to {}".format(user)) + ret["comment"].append(f"Failed to change user to {user}") elif "cuser" in perms: ret["changes"]["user"] = user @@ -5213,7 +5195,7 @@ def check_perms( ret["changes"]["group"] = group else: ret["result"] = False - ret["comment"].append("Failed to change group to {}".format(group)) + ret["comment"].append(f"Failed to change group to {group}") elif "cgroup" in perms: ret["changes"]["group"] = group @@ -5226,7 +5208,7 @@ def check_perms( ret["changes"]["mode"] = mode else: ret["result"] = False - ret["comment"].append("Failed to change mode to {}".format(mode)) + ret["comment"].append(f"Failed to change mode to {mode}") elif "cmode" in perms: ret["changes"]["mode"] = mode @@ -5259,9 +5241,7 @@ def check_perms( cmp_attrs = _cmp_attrs(name, attrs) if any(attr for attr in cmp_attrs): ret["result"] = False - ret["comment"].append( - "Failed to change attributes to {}".format(attrs) - ) + ret["comment"].append(f"Failed to change attributes to {attrs}") changes["new"] = "".join(lsattr(name)[name]) else: changes["new"] = attrs @@ -5316,17 +5296,17 @@ def check_perms( selinux_change_new = "" selinux_change_orig = "" if requested_seuser: - selinux_change_new += "User: {} ".format(requested_seuser) - selinux_change_orig += "User: {} ".format(current_seuser) + selinux_change_new += f"User: {requested_seuser} " + selinux_change_orig += f"User: {current_seuser} " if requested_serole: - selinux_change_new += "Role: {} ".format(requested_serole) - selinux_change_orig += "Role: {} ".format(current_serole) + selinux_change_new += f"Role: {requested_serole} " + selinux_change_orig += f"Role: {current_serole} " if requested_setype: - selinux_change_new += "Type: {} ".format(requested_setype) - selinux_change_orig += "Type: {} ".format(current_setype) + selinux_change_new += f"Type: {requested_setype} " + selinux_change_orig += f"Type: {current_setype} " if requested_serange: - selinux_change_new += "Range: {} ".format(requested_serange) - selinux_change_orig += "Range: {} ".format(current_serange) + selinux_change_new += f"Range: {requested_serange} " + selinux_change_orig += f"Range: {current_serange} " if __opts__["test"]: ret["comment"] = "File {} selinux context to be updated".format( @@ -5366,9 +5346,7 @@ def check_perms( selinux_error = True if not selinux_error: - ret["comment"].append( - "The file {} is set to be changed".format(name) - ) + ret["comment"].append(f"The file {name} is set to be changed") if requested_seuser: if current_seuser != requested_seuser: @@ -5500,9 +5478,9 @@ def check_managed( if changes: log.info(changes) comments = ["The following values are set to be changed:\n"] - comments.extend("{}: {}\n".format(key, val) for key, val in changes.items()) + comments.extend(f"{key}: {val}\n" for key, val in changes.items()) return None, "".join(comments) - return True, "The file {} is in the correct state".format(name) + return True, f"The file {name} is in the correct state" def check_managed_changes( @@ -6150,7 +6128,7 @@ def manage_file( # File is not present, cache it sfn = __salt__["cp.cache_file"](source, saltenv, verify_ssl=verify_ssl) if not sfn: - return _error(ret, "Source file '{}' not found".format(source)) + return _error(ret, f"Source file '{source}' not found") htype = source_sum.get("hash_type", __opts__["hash_type"]) # Recalculate source sum now that file has been cached source_sum = {"hash_type": htype, "hsum": get_hash(sfn, form=htype)} @@ -6187,7 +6165,7 @@ def manage_file( source, saltenv, verify_ssl=verify_ssl, use_etag=use_etag ) if not sfn: - return _error(ret, "Source file '{}' not found".format(source)) + return _error(ret, f"Source file '{source}' not found") # If the downloaded file came from a non salt server or local # source, and we are not skipping checksum verification, then # verify that it matches the specified checksum. @@ -6229,7 +6207,7 @@ def manage_file( ) except OSError as io_error: __clean_tmp(sfn) - return _error(ret, "Failed to commit change: {}".format(io_error)) + return _error(ret, f"Failed to commit change: {io_error}") if contents is not None: # Write the static contents to a temporary file @@ -6260,7 +6238,7 @@ def manage_file( except CommandExecutionError as exc: ret.setdefault("warnings", []).append( - "Failed to detect changes to file: {}".format(exc.strerror) + f"Failed to detect changes to file: {exc.strerror}" ) differences = "" @@ -6277,7 +6255,7 @@ def manage_file( ) except OSError as io_error: __clean_tmp(tmp) - return _error(ret, "Failed to commit change: {}".format(io_error)) + return _error(ret, f"Failed to commit change: {io_error}") __clean_tmp(tmp) # Check for changing symlink to regular file here @@ -6285,7 +6263,7 @@ def manage_file( if not sfn: sfn = __salt__["cp.cache_file"](source, saltenv, verify_ssl=verify_ssl) if not sfn: - return _error(ret, "Source file '{}' not found".format(source)) + return _error(ret, f"Source file '{source}' not found") # If the downloaded file came from a non salt server source verify # that it matches the intended sum value if check_web_source_hash: @@ -6309,7 +6287,7 @@ def manage_file( ) except OSError as io_error: __clean_tmp(sfn) - return _error(ret, "Failed to commit change: {}".format(io_error)) + return _error(ret, f"Failed to commit change: {io_error}") ret["changes"]["diff"] = "Replace symbolic link with regular file" @@ -6343,7 +6321,7 @@ def manage_file( ) if ret["changes"]: - ret["comment"] = "File {} updated".format(salt.utils.data.decode(name)) + ret["comment"] = f"File {salt.utils.data.decode(name)} updated" elif not ret["changes"] and ret["result"]: ret["comment"] = "File {} is in the correct state".format( @@ -6361,7 +6339,7 @@ def manage_file( drive, _ = os.path.splitdrive(name) if drive and not os.path.exists(drive): __clean_tmp(sfn) - return _error(ret, "{} drive not present".format(drive)) + return _error(ret, f"{drive} drive not present") if dir_mode is None and mode is not None: # Add execute bit to each nonzero digit in the mode, if # dir_mode was not specified. Otherwise, any @@ -6394,7 +6372,7 @@ def manage_file( if not sfn: sfn = __salt__["cp.cache_file"](source, saltenv, verify_ssl=verify_ssl) if not sfn: - return _error(ret, "Source file '{}' not found".format(source)) + return _error(ret, f"Source file '{source}' not found") # If the downloaded file came from a non salt server source verify # that it matches the intended sum value if check_web_source_hash: @@ -6435,16 +6413,16 @@ def manage_file( if contents is None: if not __opts__["test"]: if touch(name): - ret["changes"]["new"] = "file {} created".format(name) + ret["changes"]["new"] = f"file {name} created" ret["comment"] = "Empty file" else: - return _error(ret, "Empty file {} not created".format(name)) + return _error(ret, f"Empty file {name} not created") else: if not __opts__["test"]: if touch(name): ret["changes"]["diff"] = "New file" else: - return _error(ret, "File {} not created".format(name)) + return _error(ret, f"File {name} not created") if contents is not None: # Write the static contents to a temporary file @@ -6577,12 +6555,12 @@ def makedirs_(path, user=None, group=None, mode=None): if os.path.isdir(dirname): # There's nothing for us to do - msg = "Directory '{}' already exists".format(dirname) + msg = f"Directory '{dirname}' already exists" log.debug(msg) return msg if os.path.exists(dirname): - msg = "The path '{}' already exists and is not a directory".format(dirname) + msg = f"The path '{dirname}' already exists and is not a directory" log.debug(msg) return msg @@ -6636,7 +6614,7 @@ def makedirs_perms(name, user=None, group=None, mode="0755"): if tail == os.curdir: # xxx/newdir/. exists if xxx/newdir exists return os.mkdir(name) - check_perms(name, None, user, group, int("{}".format(mode)) if mode else None) + check_perms(name, None, user, group, int(f"{mode}") if mode else None) def get_devmm(name): @@ -6706,7 +6684,7 @@ def mknod_chrdev(name, major, minor, user=None, group=None, mode="0660"): ) try: if __opts__["test"]: - ret["changes"] = {"new": "Character device {} created.".format(name)} + ret["changes"] = {"new": f"Character device {name} created."} ret["result"] = None else: if ( @@ -6717,7 +6695,7 @@ def mknod_chrdev(name, major, minor, user=None, group=None, mode="0660"): ) is None ): - ret["changes"] = {"new": "Character device {} created.".format(name)} + ret["changes"] = {"new": f"Character device {name} created."} ret["result"] = True except OSError as exc: # be happy it is already there....however, if you are trying to change the @@ -6725,9 +6703,9 @@ def mknod_chrdev(name, major, minor, user=None, group=None, mode="0660"): if exc.errno != errno.EEXIST: raise else: - ret["comment"] = "File {} exists and cannot be overwritten".format(name) + ret["comment"] = f"File {name} exists and cannot be overwritten" # quick pass at verifying the permissions of the newly created character device - check_perms(name, None, user, group, int("{}".format(mode)) if mode else None) + check_perms(name, None, user, group, int(f"{mode}") if mode else None) return ret @@ -6779,7 +6757,7 @@ def mknod_blkdev(name, major, minor, user=None, group=None, mode="0660"): ) try: if __opts__["test"]: - ret["changes"] = {"new": "Block device {} created.".format(name)} + ret["changes"] = {"new": f"Block device {name} created."} ret["result"] = None else: if ( @@ -6790,7 +6768,7 @@ def mknod_blkdev(name, major, minor, user=None, group=None, mode="0660"): ) is None ): - ret["changes"] = {"new": "Block device {} created.".format(name)} + ret["changes"] = {"new": f"Block device {name} created."} ret["result"] = True except OSError as exc: # be happy it is already there....however, if you are trying to change the @@ -6798,9 +6776,9 @@ def mknod_blkdev(name, major, minor, user=None, group=None, mode="0660"): if exc.errno != errno.EEXIST: raise else: - ret["comment"] = "File {} exists and cannot be overwritten".format(name) + ret["comment"] = f"File {name} exists and cannot be overwritten" # quick pass at verifying the permissions of the newly created block device - check_perms(name, None, user, group, int("{}".format(mode)) if mode else None) + check_perms(name, None, user, group, int(f"{mode}") if mode else None) return ret @@ -6846,20 +6824,20 @@ def mknod_fifo(name, user=None, group=None, mode="0660"): log.debug("Creating FIFO name: %s", name) try: if __opts__["test"]: - ret["changes"] = {"new": "Fifo pipe {} created.".format(name)} + ret["changes"] = {"new": f"Fifo pipe {name} created."} ret["result"] = None else: if os.mkfifo(name, int(str(mode).lstrip("0Oo"), 8)) is None: - ret["changes"] = {"new": "Fifo pipe {} created.".format(name)} + ret["changes"] = {"new": f"Fifo pipe {name} created."} ret["result"] = True except OSError as exc: # be happy it is already there if exc.errno != errno.EEXIST: raise else: - ret["comment"] = "File {} exists and cannot be overwritten".format(name) + ret["comment"] = f"File {name} exists and cannot be overwritten" # quick pass at verifying the permissions of the newly created fifo - check_perms(name, None, user, group, int("{}".format(mode)) if mode else None) + check_perms(name, None, user, group, int(f"{mode}") if mode else None) return ret @@ -6941,9 +6919,9 @@ def list_backups(path, limit=None): ]: if salt.utils.platform.is_windows(): # ':' is an illegal filesystem path character on Windows - strpfmt = "{}_%a_%b_%d_%H-%M-%S_%f_%Y".format(basename) + strpfmt = f"{basename}_%a_%b_%d_%H-%M-%S_%f_%Y" else: - strpfmt = "{}_%a_%b_%d_%H:%M:%S_%f_%Y".format(basename) + strpfmt = f"{basename}_%a_%b_%d_%H:%M:%S_%f_%Y" try: timestamp = datetime.datetime.strptime(fname, strpfmt) except ValueError: @@ -7019,7 +6997,7 @@ def list_backups_dir(path, limit=None): for x in sorted(ff): basename = x.split("_")[0] if i == basename: - strpfmt = "{}_%a_%b_%d_%H:%M:%S_%f_%Y".format(basename) + strpfmt = f"{basename}_%a_%b_%d_%H:%M:%S_%f_%Y" try: timestamp = datetime.datetime.strptime(x, strpfmt) except ValueError: @@ -7069,7 +7047,7 @@ def restore_backup(path, backup_id): # Note: This only supports minion backups, so this function will need to be # modified if/when master backups are implemented. - ret = {"result": False, "comment": "Invalid backup_id '{}'".format(backup_id)} + ret = {"result": False, "comment": f"Invalid backup_id '{backup_id}'"} try: if len(str(backup_id)) == len(str(int(backup_id))): backup = list_backups(path)[int(backup_id)] @@ -7078,7 +7056,7 @@ def restore_backup(path, backup_id): except ValueError: return ret except KeyError: - ret["comment"] = "backup_id '{}' does not exist for {}".format(backup_id, path) + ret["comment"] = f"backup_id '{backup_id}' does not exist for {path}" return ret salt.utils.files.backup_minion(path, _get_bkroot()) @@ -7128,7 +7106,7 @@ def delete_backup(path, backup_id): """ path = os.path.expanduser(path) - ret = {"result": False, "comment": "Invalid backup_id '{}'".format(backup_id)} + ret = {"result": False, "comment": f"Invalid backup_id '{backup_id}'"} try: if len(str(backup_id)) == len(str(int(backup_id))): backup = list_backups(path)[int(backup_id)] @@ -7137,7 +7115,7 @@ def delete_backup(path, backup_id): except ValueError: return ret except KeyError: - ret["comment"] = "backup_id '{}' does not exist for {}".format(backup_id, path) + ret["comment"] = f"backup_id '{backup_id}' does not exist for {path}" return ret try: @@ -7255,9 +7233,9 @@ def open_files(by_pid=False): # Then we look at the open files for each PID files = {} for pid in pids: - ppath = "/proc/{}".format(pid) + ppath = f"/proc/{pid}" try: - tids = os.listdir("{}/task".format(ppath)) + tids = os.listdir(f"{ppath}/task") except OSError: continue @@ -7269,17 +7247,17 @@ def open_files(by_pid=False): # except Exception: # pylint: disable=broad-except # pass - for fpath in os.listdir("{}/fd".format(ppath)): - fd_.append("{}/fd/{}".format(ppath, fpath)) + for fpath in os.listdir(f"{ppath}/fd"): + fd_.append(f"{ppath}/fd/{fpath}") for tid in tids: try: - fd_.append(os.path.realpath("{}/task/{}/exe".format(ppath, tid))) + fd_.append(os.path.realpath(f"{ppath}/task/{tid}/exe")) except OSError: continue - for tpath in os.listdir("{}/task/{}/fd".format(ppath, tid)): - fd_.append("{}/task/{}/fd/{}".format(ppath, tid, tpath)) + for tpath in os.listdir(f"{ppath}/task/{tid}/fd"): + fd_.append(f"{ppath}/task/{tid}/fd/{tpath}") fd_ = sorted(set(fd_)) @@ -7456,15 +7434,13 @@ def move(src, dst, disallow_copy_and_unlink=False): ret = { "result": True, - "comment": "'{}' moved to '{}'".format(src, dst), + "comment": f"'{src}' moved to '{dst}'", } try: shutil.move(src, dst) except OSError as exc: - raise CommandExecutionError( - "Unable to move '{}' to '{}': {}".format(src, dst, exc) - ) + raise CommandExecutionError(f"Unable to move '{src}' to '{dst}': {exc}") return ret diff --git a/salt/modules/firewalld.py b/salt/modules/firewalld.py index 2c5f35ea18b..878969d6d8b 100644 --- a/salt/modules/firewalld.py +++ b/salt/modules/firewalld.py @@ -39,7 +39,7 @@ def __firewall_cmd(cmd): msg = out["stdout"] else: msg = out["stderr"] - raise CommandExecutionError("firewall-cmd failed: {}".format(msg)) + raise CommandExecutionError(f"firewall-cmd failed: {msg}") return out["stdout"] @@ -48,7 +48,7 @@ def __mgmt(name, _type, action): Perform zone management """ # It's permanent because the 4 concerned functions need the permanent option, it's wrong without - cmd = "--{}-{}={} --permanent".format(action, _type, name) + cmd = f"--{action}-{_type}={name} --permanent" return __firewall_cmd(cmd) @@ -258,7 +258,7 @@ def set_default_zone(zone): salt '*' firewalld.set_default_zone damian """ - return __firewall_cmd("--set-default-zone={}".format(zone)) + return __firewall_cmd(f"--set-default-zone={zone}") def new_service(name, restart=True): @@ -332,7 +332,7 @@ def list_all(zone=None, permanent=True): salt '*' firewalld.list_all my_zone """ if zone: - cmd = "--zone={} --list-all".format(zone) + cmd = f"--zone={zone} --list-all" else: cmd = "--list-all" @@ -360,7 +360,7 @@ def list_services(zone=None, permanent=True): salt '*' firewalld.list_services my_zone """ if zone: - cmd = "--zone={} --list-services".format(zone) + cmd = f"--zone={zone} --list-services" else: cmd = "--list-services" @@ -387,9 +387,9 @@ def add_service(service, zone=None, permanent=True): salt '*' firewalld.add_service ssh my_zone """ if zone: - cmd = "--zone={} --add-service={}".format(zone, service) + cmd = f"--zone={zone} --add-service={service}" else: - cmd = "--add-service={}".format(service) + cmd = f"--add-service={service}" if permanent: cmd += " --permanent" @@ -415,9 +415,9 @@ def remove_service(service, zone=None, permanent=True): salt '*' firewalld.remove_service ssh dmz """ if zone: - cmd = "--zone={} --remove-service={}".format(zone, service) + cmd = f"--zone={zone} --remove-service={service}" else: - cmd = "--remove-service={}".format(service) + cmd = f"--remove-service={service}" if permanent: cmd += " --permanent" @@ -440,7 +440,7 @@ def add_service_port(service, port): if service not in get_services(permanent=True): raise CommandExecutionError("The service does not exist.") - cmd = "--permanent --service={} --add-port={}".format(service, port) + cmd = f"--permanent --service={service} --add-port={port}" return __firewall_cmd(cmd) @@ -459,7 +459,7 @@ def remove_service_port(service, port): if service not in get_services(permanent=True): raise CommandExecutionError("The service does not exist.") - cmd = "--permanent --service={} --remove-port={}".format(service, port) + cmd = f"--permanent --service={service} --remove-port={port}" return __firewall_cmd(cmd) @@ -475,7 +475,7 @@ def get_service_ports(service): salt '*' firewalld.get_service_ports zone """ - cmd = "--permanent --service={} --get-ports".format(service) + cmd = f"--permanent --service={service} --get-ports" return __firewall_cmd(cmd).split() @@ -491,7 +491,7 @@ def add_service_protocol(service, protocol): salt '*' firewalld.add_service_protocol zone ssh """ - cmd = "--permanent --service={} --add-protocol={}".format(service, protocol) + cmd = f"--permanent --service={service} --add-protocol={protocol}" return __firewall_cmd(cmd) @@ -507,7 +507,7 @@ def remove_service_protocol(service, protocol): salt '*' firewalld.remove_service_protocol zone ssh """ - cmd = "--permanent --service={} --remove-protocol={}".format(service, protocol) + cmd = f"--permanent --service={service} --remove-protocol={protocol}" return __firewall_cmd(cmd) @@ -523,7 +523,7 @@ def get_service_protocols(service): salt '*' firewalld.get_service_protocols zone """ - cmd = "--permanent --service={} --get-protocols".format(service) + cmd = f"--permanent --service={service} --get-protocols" return __firewall_cmd(cmd).split() @@ -566,7 +566,7 @@ def add_masquerade(zone=None, permanent=True): salt '*' firewalld.add_masquerade dmz """ if zone: - cmd = "--zone={} --add-masquerade".format(zone) + cmd = f"--zone={zone} --add-masquerade" else: cmd = "--add-masquerade" @@ -596,7 +596,7 @@ def remove_masquerade(zone=None, permanent=True): salt '*' firewalld.remove_masquerade dmz """ if zone: - cmd = "--zone={} --remove-masquerade".format(zone) + cmd = f"--zone={zone} --remove-masquerade" else: cmd = "--remove-masquerade" @@ -625,7 +625,7 @@ def add_port(zone, port, permanent=True, force_masquerade=False): if force_masquerade and not get_masquerade(zone): add_masquerade(zone) - cmd = "--zone={} --add-port={}".format(zone, port) + cmd = f"--zone={zone} --add-port={port}" if permanent: cmd += " --permanent" @@ -645,7 +645,7 @@ def remove_port(zone, port, permanent=True): salt '*' firewalld.remove_port internal 443/tcp """ - cmd = "--zone={} --remove-port={}".format(zone, port) + cmd = f"--zone={zone} --remove-port={port}" if permanent: cmd += " --permanent" @@ -665,7 +665,7 @@ def list_ports(zone, permanent=True): salt '*' firewalld.list_ports """ - cmd = "--zone={} --list-ports".format(zone) + cmd = f"--zone={zone} --list-ports" if permanent: cmd += " --permanent" @@ -740,7 +740,7 @@ def list_port_fwd(zone, permanent=True): """ ret = [] - cmd = "--zone={} --list-forward-ports".format(zone) + cmd = f"--zone={zone} --list-forward-ports" if permanent: cmd += " --permanent" @@ -780,7 +780,7 @@ def block_icmp(zone, icmp, permanent=True): log.info("ICMP block already exists") return "success" - cmd = "--zone={} --add-icmp-block={}".format(zone, icmp) + cmd = f"--zone={zone} --add-icmp-block={icmp}" if permanent: cmd += " --permanent" @@ -808,7 +808,7 @@ def allow_icmp(zone, icmp, permanent=True): log.info("ICMP Type is already permitted") return "success" - cmd = "--zone={} --remove-icmp-block={}".format(zone, icmp) + cmd = f"--zone={zone} --remove-icmp-block={icmp}" if permanent: cmd += " --permanent" @@ -828,7 +828,7 @@ def list_icmp_block(zone, permanent=True): salt '*' firewlld.list_icmp_block zone """ - cmd = "--zone={} --list-icmp-blocks".format(zone) + cmd = f"--zone={zone} --list-icmp-blocks" if permanent: cmd += " --permanent" @@ -863,7 +863,7 @@ def get_interfaces(zone, permanent=True): salt '*' firewalld.get_interfaces zone """ - cmd = "--zone={} --list-interfaces".format(zone) + cmd = f"--zone={zone} --list-interfaces" if permanent: cmd += " --permanent" @@ -886,7 +886,7 @@ def add_interface(zone, interface, permanent=True): if interface in get_interfaces(zone, permanent): log.info("Interface is already bound to zone.") - cmd = "--zone={} --add-interface={}".format(zone, interface) + cmd = f"--zone={zone} --add-interface={interface}" if permanent: cmd += " --permanent" @@ -909,7 +909,7 @@ def remove_interface(zone, interface, permanent=True): if interface not in get_interfaces(zone, permanent): log.info("Interface is not bound to zone.") - cmd = "--zone={} --remove-interface={}".format(zone, interface) + cmd = f"--zone={zone} --remove-interface={interface}" if permanent: cmd += " --permanent" @@ -929,7 +929,7 @@ def get_sources(zone, permanent=True): salt '*' firewalld.get_sources zone """ - cmd = "--zone={} --list-sources".format(zone) + cmd = f"--zone={zone} --list-sources" if permanent: cmd += " --permanent" @@ -952,7 +952,7 @@ def add_source(zone, source, permanent=True): if source in get_sources(zone, permanent): log.info("Source is already bound to zone.") - cmd = "--zone={} --add-source={}".format(zone, source) + cmd = f"--zone={zone} --add-source={source}" if permanent: cmd += " --permanent" @@ -975,7 +975,7 @@ def remove_source(zone, source, permanent=True): if source not in get_sources(zone, permanent): log.info("Source is not bound to zone.") - cmd = "--zone={} --remove-source={}".format(zone, source) + cmd = f"--zone={zone} --remove-source={source}" if permanent: cmd += " --permanent" @@ -995,7 +995,7 @@ def get_rich_rules(zone, permanent=True): salt '*' firewalld.get_rich_rules zone """ - cmd = "--zone={} --list-rich-rules".format(zone) + cmd = f"--zone={zone} --list-rich-rules" if permanent: cmd += " --permanent" @@ -1015,7 +1015,7 @@ def add_rich_rule(zone, rule, permanent=True): salt '*' firewalld.add_rich_rule zone 'rule' """ - cmd = "--zone={} --add-rich-rule='{}'".format(zone, rule) + cmd = f"--zone={zone} --add-rich-rule='{rule}'" if permanent: cmd += " --permanent" @@ -1035,7 +1035,7 @@ def remove_rich_rule(zone, rule, permanent=True): salt '*' firewalld.remove_rich_rule zone 'rule' """ - cmd = "--zone={} --remove-rich-rule='{}'".format(zone, rule) + cmd = f"--zone={zone} --remove-rich-rule='{rule}'" if permanent: cmd += " --permanent" diff --git a/salt/modules/freebsd_sysctl.py b/salt/modules/freebsd_sysctl.py index 6f809176f49..ad2a6ba3eaf 100644 --- a/salt/modules/freebsd_sysctl.py +++ b/salt/modules/freebsd_sysctl.py @@ -30,9 +30,9 @@ def __virtual__(): def _formatfor(name, value, config, tail=""): if config == "/boot/loader.conf": - return '{}="{}"{}'.format(name, value, tail) + return f'{name}="{value}"{tail}' else: - return "{}={}{}".format(name, value, tail) + return f"{name}={value}{tail}" def show(config_file=False): @@ -87,13 +87,13 @@ def show(config_file=False): out = __salt__["cmd.run"](cmd, output_loglevel="trace") value = None for line in out.splitlines(): - if any([line.startswith("{}.".format(root)) for root in roots]): + if any([line.startswith(f"{root}.") for root in roots]): if value is not None: ret[key] = "\n".join(value) (key, firstvalue) = line.split("=", 1) value = [firstvalue] elif value is not None: - value.append("{}".format(line)) + value.append(f"{line}") if value is not None: ret[key] = "\n".join(value) return ret @@ -109,7 +109,7 @@ def get(name): salt '*' sysctl.get hw.physmem """ - cmd = "sysctl -n {}".format(name) + cmd = f"sysctl -n {name}" out = __salt__["cmd.run"](cmd, python_shell=False) return out @@ -125,7 +125,7 @@ def assign(name, value): salt '*' sysctl.assign net.inet.icmp.icmplim 50 """ ret = {} - cmd = 'sysctl {}="{}"'.format(name, value) + cmd = f'sysctl {name}="{value}"' data = __salt__["cmd.run_all"](cmd, python_shell=False) if data["retcode"] != 0: @@ -153,7 +153,7 @@ def persist(name, value, config="/etc/sysctl.conf"): with salt.utils.files.fopen(config, "r") as ifile: for line in ifile: line = salt.utils.stringutils.to_unicode(line).rstrip("\n") - if not line.startswith("{}=".format(name)): + if not line.startswith(f"{name}="): nlines.append(line) continue else: @@ -176,7 +176,7 @@ def persist(name, value, config="/etc/sysctl.conf"): nlines.append(new_line) edited = True if not edited: - nlines.append("{}\n".format(_formatfor(name, value, config))) + nlines.append(f"{_formatfor(name, value, config)}\n") with salt.utils.files.fopen(config, "w+") as ofile: nlines = [salt.utils.stringutils.to_str(_l) + "\n" for _l in nlines] ofile.writelines(nlines) diff --git a/salt/modules/freebsd_update.py b/salt/modules/freebsd_update.py index 816c2b13e96..71904d7230c 100644 --- a/salt/modules/freebsd_update.py +++ b/salt/modules/freebsd_update.py @@ -194,7 +194,7 @@ def update(**kwargs): return ret if "stdout" in err_: stdout[mode] = err_["stdout"] - return "\n".join(["{}: {}".format(k, v) for (k, v) in stdout.items()]) + return "\n".join([f"{k}: {v}" for (k, v) in stdout.items()]) def ids(**kwargs): diff --git a/salt/modules/freebsdkmod.py b/salt/modules/freebsdkmod.py index 27793f758c6..db13306ceb5 100644 --- a/salt/modules/freebsdkmod.py +++ b/salt/modules/freebsdkmod.py @@ -201,7 +201,7 @@ def load(mod, persist=False): salt '*' kmod.load bhyve """ pre_mods = lsmod() - response = __salt__["cmd.run_all"]("kldload {}".format(mod), python_shell=False) + response = __salt__["cmd.run_all"](f"kldload {mod}", python_shell=False) if response["retcode"] == 0: post_mods = lsmod() mods = _new_mods(pre_mods, post_mods) @@ -217,7 +217,7 @@ def load(mod, persist=False): # It's compiled into the kernel return [None] else: - return "Module {} not found".format(mod) + return f"Module {mod} not found" def is_loaded(mod): @@ -254,7 +254,7 @@ def remove(mod, persist=False, comment=True): salt '*' kmod.remove vmm """ pre_mods = lsmod() - res = __salt__["cmd.run_all"]("kldunload {}".format(mod), python_shell=False) + res = __salt__["cmd.run_all"](f"kldunload {mod}", python_shell=False) if res["retcode"] == 0: post_mods = lsmod() mods = _rm_mods(pre_mods, post_mods) diff --git a/salt/modules/freebsdpkg.py b/salt/modules/freebsdpkg.py index 36de306b687..77ba7444cfa 100644 --- a/salt/modules/freebsdpkg.py +++ b/salt/modules/freebsdpkg.py @@ -175,20 +175,20 @@ def _match(names): cver = pkgs.get(name) if cver is not None: if len(cver) == 1: - matches.append("{}-{}".format(name, cver[0])) + matches.append(f"{name}-{cver[0]}") else: ambiguous.append(name) errors.append( "Ambiguous package '{}'. Full name/version required. " "Possible matches: {}".format( - name, ", ".join(["{}-{}".format(name, x) for x in cver]) + name, ", ".join([f"{name}-{x}" for x in cver]) ) ) # Find packages that did not match anything not_matched = set(names) - set(matches) - set(full_matches) - set(ambiguous) for name in not_matched: - errors.append("Package '{}' not found".format(name)) + errors.append(f"Package '{name}' not found") return matches + full_matches, errors diff --git a/salt/modules/freebsdports.py b/salt/modules/freebsdports.py index 3ab53e24f80..254212f0e16 100644 --- a/salt/modules/freebsdports.py +++ b/salt/modules/freebsdports.py @@ -59,13 +59,11 @@ def _check_portname(name): ports tree. """ if not isinstance(name, str) or "/" not in name: - raise SaltInvocationError( - "Invalid port name '{}' (category required)".format(name) - ) + raise SaltInvocationError(f"Invalid port name '{name}' (category required)") path = os.path.join("/usr/ports", name) if not os.path.isdir(path): - raise SaltInvocationError("Path '{}' does not exist".format(path)) + raise SaltInvocationError(f"Path '{path}' does not exist") return path @@ -109,7 +107,7 @@ def _write_options(name, configuration): try: os.makedirs(dirname) except OSError as exc: - raise CommandExecutionError("Unable to make {}: {}".format(dirname, exc)) + raise CommandExecutionError(f"Unable to make {dirname}: {exc}") with salt.utils.files.fopen(os.path.join(dirname, "options"), "w") as fp_: sorted_options = list(conf_ptr) @@ -270,7 +268,7 @@ def showconfig(name, default=False, dict_return=False): error = result if error: - msg = "Error running 'make showconfig' for {}: {}".format(name, error) + msg = f"Error running 'make showconfig' for {name}: {error}" log.error(msg) raise SaltInvocationError(msg) @@ -327,9 +325,7 @@ def config(name, reset=False, **kwargs): configuration = showconfig(name, dict_return=True) if not configuration: - raise CommandExecutionError( - "Unable to get port configuration for '{}'".format(name) - ) + raise CommandExecutionError(f"Unable to get port configuration for '{name}'") # Get top-level key for later reference pkg = next(iter(configuration)) @@ -345,7 +341,7 @@ def config(name, reset=False, **kwargs): ) ) - bad_vals = ["{}={}".format(x, y) for x, y in opts.items() if y not in ("on", "off")] + bad_vals = [f"{x}={y}" for x, y in opts.items() if y not in ("on", "off")] if bad_vals: raise SaltInvocationError( "The following key/value pairs are invalid: {}".format(", ".join(bad_vals)) @@ -396,8 +392,8 @@ def update(extract=False): except AttributeError: new_port_count = 0 - ret.append("Applied {} new patches".format(patch_count)) - ret.append("Fetched {} new ports or files".format(new_port_count)) + ret.append(f"Applied {patch_count} new patches") + ret.append(f"Fetched {new_port_count} new ports or files") if extract: result = __salt__["cmd.run_all"](_portsnap() + ["extract"], python_shell=False) diff --git a/salt/modules/freebsdservice.py b/salt/modules/freebsdservice.py index f053db695fe..a5fdc2cbad6 100644 --- a/salt/modules/freebsdservice.py +++ b/salt/modules/freebsdservice.py @@ -56,7 +56,7 @@ def _cmd(jail=None): jexec = salt.utils.path.which("jexec") if not jexec: raise CommandNotFoundError("'jexec' command not found") - service = "{} {} {}".format(jexec, jail, service) + service = f"{jexec} {jail} {service}" return service @@ -72,7 +72,7 @@ def _get_jail_path(jail): jls = salt.utils.path.which("jls") if not jls: raise CommandNotFoundError("'jls' command not found") - jails = __salt__["cmd.run_stdout"]("{} -n jid name path".format(jls)) + jails = __salt__["cmd.run_stdout"](f"{jls} -n jid name path") for j in jails.splitlines(): jid, jname, path = (x.split("=")[1].strip() for x in j.split()) if jid == jail or jname == jail: @@ -89,10 +89,10 @@ def _get_rcscript(name, jail=None): Support for jail (representing jid or jail name) keyword argument in kwargs """ - cmd = "{} -r".format(_cmd(jail)) + cmd = f"{_cmd(jail)} -r" prf = _get_jail_path(jail) if jail else "" for line in __salt__["cmd.run_stdout"](cmd, python_shell=False).splitlines(): - if line.endswith("{}{}".format(os.path.sep, name)): + if line.endswith(f"{os.path.sep}{name}"): return os.path.join(prf, line.lstrip(os.path.sep)) return None @@ -109,7 +109,7 @@ def _get_rcvar(name, jail=None): log.error("Service %s not found", name) return False - cmd = "{} {} rcvar".format(_cmd(jail), name) + cmd = f"{_cmd(jail)} {name} rcvar" for line in __salt__["cmd.run_stdout"](cmd, python_shell=False).splitlines(): if '_enable="' not in line: @@ -137,14 +137,14 @@ def get_enabled(jail=None): ret = [] service = _cmd(jail) prf = _get_jail_path(jail) if jail else "" - for svc in __salt__["cmd.run"]("{} -e".format(service)).splitlines(): + for svc in __salt__["cmd.run"](f"{service} -e").splitlines(): ret.append(os.path.basename(svc)) # This is workaround for bin/173454 bug for svc in get_all(jail): if svc in ret: continue - if not os.path.exists("{}/etc/rc.conf.d/{}".format(prf, svc)): + if not os.path.exists(f"{prf}/etc/rc.conf.d/{svc}"): continue if enabled(svc, jail=jail): ret.append(svc) @@ -199,13 +199,11 @@ def _switch(name, on, **kwargs): # pylint: disable=C0103 # pylint: disable=C01 config = kwargs.get( "config", - __salt__["config.option"]( - "service.config", default="{}/etc/rc.conf".format(chroot) - ), + __salt__["config.option"]("service.config", default=f"{chroot}/etc/rc.conf"), ) if not config: - rcdir = "{}/etc/rc.conf.d".format(chroot) + rcdir = f"{chroot}/etc/rc.conf.d" if not os.path.exists(rcdir) or not os.path.isdir(rcdir): log.error("%s not exists", rcdir) return False @@ -223,17 +221,17 @@ def _switch(name, on, **kwargs): # pylint: disable=C0103 # pylint: disable=C01 with salt.utils.files.fopen(config, "r") as ifile: for line in ifile: line = salt.utils.stringutils.to_unicode(line) - if not line.startswith("{}=".format(rcvar)): + if not line.startswith(f"{rcvar}="): nlines.append(line) continue rest = line[len(line.split()[0]) :] # keep comments etc - nlines.append('{}="{}"{}'.format(rcvar, val, rest)) + nlines.append(f'{rcvar}="{val}"{rest}') edited = True if not edited: # Ensure that the file ends in a \n if len(nlines) > 1 and nlines[-1][-1] != "\n": - nlines[-1] = "{}\n".format(nlines[-1]) - nlines.append('{}="{}"\n'.format(rcvar, val)) + nlines[-1] = f"{nlines[-1]}\n" + nlines.append(f'{rcvar}="{val}"\n') with salt.utils.files.fopen(config, "w") as ofile: nlines = [salt.utils.stringutils.to_str(_l) for _l in nlines] @@ -318,7 +316,7 @@ def enabled(name, **kwargs): log.error("Service %s not found", name) return False - cmd = "{} {} rcvar".format(_cmd(jail), name) + cmd = f"{_cmd(jail)} {name} rcvar" for line in __salt__["cmd.run_stdout"](cmd, python_shell=False).splitlines(): if '_enable="' not in line: @@ -395,7 +393,7 @@ def get_all(jail=None): """ ret = [] service = _cmd(jail) - for srv in __salt__["cmd.run"]("{} -l".format(service)).splitlines(): + for srv in __salt__["cmd.run"](f"{service} -l").splitlines(): if not srv.isupper(): ret.append(srv) return sorted(ret) @@ -415,7 +413,7 @@ def start(name, jail=None): salt '*' service.start """ - cmd = "{} {} onestart".format(_cmd(jail), name) + cmd = f"{_cmd(jail)} {name} onestart" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -433,7 +431,7 @@ def stop(name, jail=None): salt '*' service.stop """ - cmd = "{} {} onestop".format(_cmd(jail), name) + cmd = f"{_cmd(jail)} {name} onestop" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -451,7 +449,7 @@ def restart(name, jail=None): salt '*' service.restart """ - cmd = "{} {} onerestart".format(_cmd(jail), name) + cmd = f"{_cmd(jail)} {name} onerestart" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -469,7 +467,7 @@ def reload_(name, jail=None): salt '*' service.reload """ - cmd = "{} {} onereload".format(_cmd(jail), name) + cmd = f"{_cmd(jail)} {name} onereload" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -508,7 +506,7 @@ def status(name, sig=None, jail=None): services = [name] results = {} for service in services: - cmd = "{} {} onestatus".format(_cmd(jail), service) + cmd = f"{_cmd(jail)} {service} onestatus" results[service] = not __salt__["cmd.retcode"]( cmd, python_shell=False, ignore_retcode=True ) diff --git a/salt/modules/freezer.py b/salt/modules/freezer.py index 296a26bf5bb..329cff98c3e 100644 --- a/salt/modules/freezer.py +++ b/salt/modules/freezer.py @@ -49,8 +49,8 @@ def _paths(name=None): name = "freezer" if not name else name states_path = _states_path() return ( - os.path.join(states_path, "{}-pkgs.yml".format(name)), - os.path.join(states_path, "{}-reps.yml".format(name)), + os.path.join(states_path, f"{name}-pkgs.yml"), + os.path.join(states_path, f"{name}-reps.yml"), ) diff --git a/salt/modules/genesis.py b/salt/modules/genesis.py index 5c2be12388a..4b9dca2351a 100644 --- a/salt/modules/genesis.py +++ b/salt/modules/genesis.py @@ -153,18 +153,18 @@ def bootstrap( if not img_size: raise SaltInvocationError("An img_size must be specified for a sparse file") if not mount_dir: - mount_dir = "/opt/salt-genesis.{}".format(uuid.uuid4()) + mount_dir = f"/opt/salt-genesis.{uuid.uuid4()}" __salt__["file.mkdir"](mount_dir, "root", "root", "755") __salt__["cmd.run"](("fallocate", "-l", img_size, root), python_shell=False) _mkpart(root, fs_format, fs_opts, mount_dir) loop1 = __salt__["cmd.run"]("losetup -f") log.debug("First loop device is %s", loop1) - __salt__["cmd.run"]("losetup {} {}".format(loop1, root)) + __salt__["cmd.run"](f"losetup {loop1} {root}") loop2 = __salt__["cmd.run"]("losetup -f") log.debug("Second loop device is %s", loop2) start = str(2048 * 2048) - __salt__["cmd.run"]("losetup -o {} {} {}".format(start, loop2, loop1)) + __salt__["cmd.run"](f"losetup -o {start} {loop2} {loop1}") __salt__["mount.mount"](mount_dir, loop2) _populate_cache(platform, pkg_cache, mount_dir) @@ -206,13 +206,13 @@ def bootstrap( if img_format != "dir": blkinfo = __salt__["disk.blkid"](loop2) __salt__["file.replace"]( - "{}/boot/grub/grub.cfg".format(mount_dir), + f"{mount_dir}/boot/grub/grub.cfg", "ad4103fa-d940-47ca-8506-301d8071d467", # This seems to be the default blkinfo[loop2]["UUID"], ) __salt__["mount.umount"](root) - __salt__["cmd.run"]("losetup -d {}".format(loop2)) - __salt__["cmd.run"]("losetup -d {}".format(loop1)) + __salt__["cmd.run"](f"losetup -d {loop2}") + __salt__["cmd.run"](f"losetup -d {loop1}") __salt__["file.rmdir"](mount_dir) @@ -225,7 +225,7 @@ def _mkpart(root, fs_format, fs_opts, mount_dir): __salt__["partition.mklabel"](root, "msdos") loop1 = __salt__["cmd.run"]("losetup -f") log.debug("First loop device is %s", loop1) - __salt__["cmd.run"]("losetup {} {}".format(loop1, root)) + __salt__["cmd.run"](f"losetup {loop1} {root}") part_info = __salt__["partition.list"](loop1) start = str(2048 * 2048) + "B" end = part_info["info"]["size"] @@ -235,7 +235,7 @@ def _mkpart(root, fs_format, fs_opts, mount_dir): loop2 = __salt__["cmd.run"]("losetup -f") log.debug("Second loop device is %s", loop2) start = start.rstrip("B") - __salt__["cmd.run"]("losetup -o {} {} {}".format(start, loop2, loop1)) + __salt__["cmd.run"](f"losetup -o {start} {loop2} {loop1}") _mkfs(loop2, fs_format, fs_opts) __salt__["mount.mount"](mount_dir, loop2) __salt__["cmd.run"]( @@ -245,14 +245,14 @@ def _mkpart(root, fs_format, fs_opts, mount_dir): "--debug", "--no-floppy", "--modules=part_msdos linux", - "--boot-directory={}/boot".format(mount_dir), + f"--boot-directory={mount_dir}/boot", loop1, ), python_shell=False, ) __salt__["mount.umount"](mount_dir) - __salt__["cmd.run"]("losetup -d {}".format(loop2)) - __salt__["cmd.run"]("losetup -d {}".format(loop1)) + __salt__["cmd.run"](f"losetup -d {loop2}") + __salt__["cmd.run"](f"losetup -d {loop1}") return part_info @@ -284,7 +284,7 @@ def _populate_cache(platform, pkg_cache, mount_dir): return if platform == "pacman": - cache_dir = "{}/var/cache/pacman/pkg".format(mount_dir) + cache_dir = f"{mount_dir}/var/cache/pacman/pkg" __salt__["file.mkdir"](cache_dir, "root", "root", "755") __salt__["file.copy"](pkg_cache, cache_dir, recurse=True, remove_existing=True) @@ -361,14 +361,14 @@ def _bootstrap_yum( yum_args = [ "yum", "install", - "--installroot={}".format(shlex.quote(root)), + f"--installroot={shlex.quote(root)}", "-y", ] + pkgs __salt__["cmd.run"](yum_args, python_shell=False) if "epel-release" not in exclude_pkgs: __salt__["cmd.run"]( - ("rpm", "--root={}".format(shlex.quote(root)), "-Uvh", epel_url), + ("rpm", f"--root={shlex.quote(root)}", "-Uvh", epel_url), python_shell=False, ) @@ -462,9 +462,7 @@ def _bootstrap_deb( ), env=env, ) - __salt__["cmd.run"]( - "chroot {root} dpkg --configure -a".format(root=shlex.quote(root)), env=env - ) + __salt__["cmd.run"](f"chroot {shlex.quote(root)} dpkg --configure -a", env=env) def _bootstrap_pacman( @@ -519,25 +517,23 @@ def _bootstrap_pacman( pkgs.remove(pkg) if img_format != "dir": - __salt__["mount.mount"]("{}/proc".format(root), "/proc", fstype="", opts="bind") - __salt__["mount.mount"]("{}/dev".format(root), "/dev", fstype="", opts="bind") + __salt__["mount.mount"](f"{root}/proc", "/proc", fstype="", opts="bind") + __salt__["mount.mount"](f"{root}/dev", "/dev", fstype="", opts="bind") - __salt__["file.mkdir"]( - "{}/var/lib/pacman/local".format(root), "root", "root", "755" - ) + __salt__["file.mkdir"](f"{root}/var/lib/pacman/local", "root", "root", "755") pac_files = [rf for rf in os.listdir("/etc") if rf.startswith("pacman.")] for pac_file in pac_files: - __salt__["cmd.run"]("cp -r /etc/{} {}/etc".format(pac_file, shlex.quote(root))) + __salt__["cmd.run"](f"cp -r /etc/{pac_file} {shlex.quote(root)}/etc") __salt__["file.copy"]( - "/var/lib/pacman/sync", "{}/var/lib/pacman/sync".format(root), recurse=True + "/var/lib/pacman/sync", f"{root}/var/lib/pacman/sync", recurse=True ) pacman_args = ["pacman", "--noconfirm", "-r", shlex.quote(root), "-S"] + pkgs __salt__["cmd.run"](pacman_args, python_shell=False) if img_format != "dir": - __salt__["mount.umount"]("{}/proc".format(root)) - __salt__["mount.umount"]("{}/dev".format(root)) + __salt__["mount.umount"](f"{root}/proc") + __salt__["mount.umount"](f"{root}/dev") def _make_nodes(root): @@ -547,24 +543,24 @@ def _make_nodes(root): https://wiki.archlinux.org/index.php/Linux_Containers """ dirs = ( - ("{}/etc".format(root), "root", "root", "755"), - ("{}/dev".format(root), "root", "root", "755"), - ("{}/proc".format(root), "root", "root", "755"), - ("{}/dev/pts".format(root), "root", "root", "755"), - ("{}/dev/shm".format(root), "root", "root", "1755"), + (f"{root}/etc", "root", "root", "755"), + (f"{root}/dev", "root", "root", "755"), + (f"{root}/proc", "root", "root", "755"), + (f"{root}/dev/pts", "root", "root", "755"), + (f"{root}/dev/shm", "root", "root", "1755"), ) nodes = ( - ("{}/dev/null".format(root), "c", 1, 3, "root", "root", "666"), - ("{}/dev/zero".format(root), "c", 1, 5, "root", "root", "666"), - ("{}/dev/random".format(root), "c", 1, 8, "root", "root", "666"), - ("{}/dev/urandom".format(root), "c", 1, 9, "root", "root", "666"), - ("{}/dev/tty".format(root), "c", 5, 0, "root", "root", "666"), - ("{}/dev/tty0".format(root), "c", 4, 0, "root", "root", "666"), - ("{}/dev/console".format(root), "c", 5, 1, "root", "root", "600"), - ("{}/dev/full".format(root), "c", 1, 7, "root", "root", "666"), - ("{}/dev/initctl".format(root), "p", 0, 0, "root", "root", "600"), - ("{}/dev/ptmx".format(root), "c", 5, 2, "root", "root", "666"), + (f"{root}/dev/null", "c", 1, 3, "root", "root", "666"), + (f"{root}/dev/zero", "c", 1, 5, "root", "root", "666"), + (f"{root}/dev/random", "c", 1, 8, "root", "root", "666"), + (f"{root}/dev/urandom", "c", 1, 9, "root", "root", "666"), + (f"{root}/dev/tty", "c", 5, 0, "root", "root", "666"), + (f"{root}/dev/tty0", "c", 4, 0, "root", "root", "666"), + (f"{root}/dev/console", "c", 5, 1, "root", "root", "600"), + (f"{root}/dev/full", "c", 1, 7, "root", "root", "666"), + (f"{root}/dev/initctl", "p", 0, 0, "root", "root", "600"), + (f"{root}/dev/ptmx", "c", 5, 2, "root", "root", "666"), ) for path in dirs: @@ -636,9 +632,9 @@ def _tar(name, root, path=None, compress="bzip2"): compression, ext = _compress(compress) - tarfile = "{}/{}.tar.{}".format(path, name, ext) + tarfile = f"{path}/{name}.tar.{ext}" out = __salt__["archive.tar"]( - options="{}pcf".format(compression), + options=f"{compression}pcf", tarfile=tarfile, sources=".", dest=root, @@ -663,9 +659,9 @@ def _untar(name, dest=None, path=None, compress="bz2"): compression, ext = _compress(compress) - tarfile = "{}/{}.tar.{}".format(path, name, ext) + tarfile = f"{path}/{name}.tar.{ext}" out = __salt__["archive.tar"]( - options="{}xf".format(compression), + options=f"{compression}xf", tarfile=tarfile, dest=dest, ) diff --git a/salt/modules/gentoolkitmod.py b/salt/modules/gentoolkitmod.py index 19e7b45f6fa..da8f803a786 100644 --- a/salt/modules/gentoolkitmod.py +++ b/salt/modules/gentoolkitmod.py @@ -50,7 +50,7 @@ def revdep_rebuild(lib=None): """ cmd = "revdep-rebuild -i --quiet --no-progress" if lib is not None: - cmd += " --library={}".format(lib) + cmd += f" --library={lib}" return __salt__["cmd.retcode"](cmd, python_shell=False) == 0 @@ -62,7 +62,7 @@ def _pretty_size(size): while units and size >= 1000: size = size / 1024.0 units.pop() - return "{}{}".format(round(size, 1), units[-1]) + return f"{round(size, 1)}{units[-1]}" def _parse_exclude(exclude_file): @@ -137,7 +137,7 @@ def eclean_dist( try: exclude = _parse_exclude(exclude_file) except excludemod.ParseExcludeFileException as e: - ret = {e: "Invalid exclusion file: {}".format(exclude_file)} + ret = {e: f"Invalid exclusion file: {exclude_file}"} return ret if time_limit != 0: @@ -221,7 +221,7 @@ def eclean_pkg( try: exclude = _parse_exclude(exclude_file) except excludemod.ParseExcludeFileException as e: - ret = {e: "Invalid exclusion file: {}".format(exclude_file)} + ret = {e: f"Invalid exclusion file: {exclude_file}"} return ret if time_limit != 0: diff --git a/salt/modules/git.py b/salt/modules/git.py index 4af2e548de7..4e2d2d0c5bf 100644 --- a/salt/modules/git.py +++ b/salt/modules/git.py @@ -61,7 +61,7 @@ def _config_getter( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ Common code for config.get_* functions, builds and runs the git CLI command @@ -224,7 +224,7 @@ def _git_run( redirect_stderr=False, saltenv="base", output_encoding=None, - **kwargs + **kwargs, ): """ simple, throw an exception with the error message on an error return code. @@ -323,7 +323,7 @@ def _git_run( ignore_retcode=ignore_retcode, redirect_stderr=redirect_stderr, output_encoding=output_encoding, - **kwargs + **kwargs, ) finally: if tmp_ssh_wrapper: @@ -390,7 +390,7 @@ def _git_run( ignore_retcode=ignore_retcode, redirect_stderr=redirect_stderr, output_encoding=output_encoding, - **kwargs + **kwargs, ) if result["retcode"] == 0: @@ -403,7 +403,7 @@ def _git_run( ) err = result["stdout" if redirect_stderr else "stderr"] if err: - msg += ": {}".format(salt.utils.url.redact_http_basic_auth(err)) + msg += f": {salt.utils.url.redact_http_basic_auth(err)}" raise CommandExecutionError(msg) return result @@ -564,7 +564,7 @@ def archive( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionchanged:: 2015.8.0 @@ -1215,7 +1215,7 @@ def config_get( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ Get the value of a key in the git configuration file @@ -1293,7 +1293,7 @@ def config_get( password=password, ignore_retcode=ignore_retcode, output_encoding=output_encoding, - **kwargs + **kwargs, ) # git config --get exits with retcode of 1 when key does not exist @@ -1318,7 +1318,7 @@ def config_get_regexp( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): r""" .. versionadded:: 2015.8.0 @@ -1395,7 +1395,7 @@ def config_get_regexp( password=password, ignore_retcode=ignore_retcode, output_encoding=output_encoding, - **kwargs + **kwargs, ) # git config --get exits with retcode of 1 when key does not exist @@ -1425,7 +1425,7 @@ def config_set( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionchanged:: 2015.8.0 @@ -1574,7 +1574,7 @@ def config_set( cwd=cwd, ignore_retcode=ignore_retcode, output_encoding=output_encoding, - **{"all": True, "global": global_} + **{"all": True, "global": global_}, ) @@ -1586,7 +1586,7 @@ def config_unset( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2015.8.0 @@ -1695,9 +1695,9 @@ def config_unset( ) is None ): - raise CommandExecutionError("Key '{}' does not exist".format(key)) + raise CommandExecutionError(f"Key '{key}' does not exist") else: - msg = "Multiple values exist for key '{}'".format(key) + msg = f"Multiple values exist for key '{key}'" if value_regex is not None: msg += " and value_regex matches multiple values" raise CommandExecutionError(msg) @@ -2355,9 +2355,9 @@ def init( if bare: command.append("--bare") if template is not None: - command.append("--template={}".format(template)) + command.append(f"--template={template}") if separate_git_dir is not None: - command.append("--separate-git-dir={}".format(separate_git_dir)) + command.append(f"--separate-git-dir={separate_git_dir}") if shared is not None: if isinstance(shared, int) and not isinstance(shared, bool): shared = "0" + str(shared) @@ -2365,7 +2365,7 @@ def init( # Using lower here because booleans would be capitalized when # converted to a string. shared = str(shared).lower() - command.append("--shared={}".format(shared)) + command.append(f"--shared={shared}") command.extend(_format_opts(opts)) command.append(cwd) return _git_run( @@ -2814,7 +2814,7 @@ def list_worktrees( worktree_root = os.path.join(cwd, worktree_root) if not os.path.isdir(worktree_root): raise CommandExecutionError( - "Worktree admin directory {} not present".format(worktree_root) + f"Worktree admin directory {worktree_root} not present" ) def _read_file(path): @@ -3081,7 +3081,7 @@ def merge( identity=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ Interface to `git-merge(1)`_ @@ -3205,7 +3205,7 @@ def merge_base( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2015.8.0 @@ -3487,7 +3487,7 @@ def merge_tree( base = merge_base(cwd, refs=[ref1, ref2], output_encoding=output_encoding) except (SaltInvocationError, CommandExecutionError): raise CommandExecutionError( - "Unable to determine merge base for {} and {}".format(ref1, ref2) + f"Unable to determine merge base for {ref1} and {ref2}" ) command.extend([base, ref1, ref2]) return _git_run( @@ -3627,7 +3627,7 @@ def push( ignore_retcode=False, saltenv="base", output_encoding=None, - **kwargs + **kwargs, ): """ Interface to `git-push(1)`_ @@ -3927,7 +3927,7 @@ def remote_get( ) if remote not in all_remotes: raise CommandExecutionError( - "Remote '{}' not present in git checkout located at {}".format(remote, cwd) + f"Remote '{remote}' not present in git checkout located at {cwd}" ) return all_remotes[remote] @@ -3944,7 +3944,7 @@ def remote_refs( ignore_retcode=False, output_encoding=None, saltenv="base", - **kwargs + **kwargs, ): """ .. versionadded:: 2015.8.0 @@ -4850,7 +4850,7 @@ def submodule( ignore_retcode=False, saltenv="base", output_encoding=None, - **kwargs + **kwargs, ): """ .. versionchanged:: 2015.8.0 @@ -5290,7 +5290,7 @@ def worktree_add( password=None, ignore_retcode=False, output_encoding=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2015.8.0 @@ -5602,5 +5602,5 @@ def worktree_rm(cwd, user=None, output_encoding=None): try: salt.utils.files.rm_rf(cwd) except Exception as exc: # pylint: disable=broad-except - raise CommandExecutionError("Unable to remove {}: {}".format(cwd, exc)) + raise CommandExecutionError(f"Unable to remove {cwd}: {exc}") return True diff --git a/salt/modules/github.py b/salt/modules/github.py index d1c3d0e16b0..54b5b1d167a 100644 --- a/salt/modules/github.py +++ b/salt/modules/github.py @@ -118,7 +118,7 @@ def _get_members(organization, params=None): def _get_repos(profile, params=None, ignore_cache=False): # Use cache when no params are given org_name = _get_config_value(profile, "org_name") - key = "github.{}:repos".format(org_name) + key = f"github.{org_name}:repos" if key not in __context__ or ignore_cache or params is not None: org_name = _get_config_value(profile, "org_name") @@ -142,7 +142,7 @@ def _get_repos(profile, params=None, ignore_cache=False): next_result.append(repo) # Cache a copy of each repo for single lookups - repo_key = "github.{}:{}:repo_info".format(org_name, repo.name.lower()) + repo_key = f"github.{org_name}:{repo.name.lower()}:repo_info" __context__[repo_key] = _repo_to_dict(repo) __context__[key] = next_result @@ -170,7 +170,7 @@ def list_users(profile="github", ignore_cache=False): salt myminion github.list_users profile='my-github-profile' """ org_name = _get_config_value(profile, "org_name") - key = "github.{}:users".format(org_name) + key = f"github.{org_name}:users" if key not in __context__ or ignore_cache: client = _get_client(profile) organization = client.get_organization(org_name) @@ -1833,7 +1833,7 @@ def _query( url += action if command: - url += "/{}".format(command) + url += f"/{command}" log.debug("GitHub URL: %s", url) diff --git a/salt/modules/glassfish.py b/salt/modules/glassfish.py index 558db0809e5..f98e7009d29 100644 --- a/salt/modules/glassfish.py +++ b/salt/modules/glassfish.py @@ -70,9 +70,9 @@ def _get_url(ssl, url, port, path): Returns the URL of the endpoint """ if ssl: - return "https://{}:{}/management/domain/{}".format(url, port, path) + return f"https://{url}:{port}/management/domain/{path}" else: - return "http://{}:{}/management/domain/{}".format(url, port, path) + return f"http://{url}:{port}/management/domain/{path}" def _get_server(server): @@ -183,7 +183,7 @@ def _get_element_properties(name, element_type, server=None): Get an element's properties """ properties = {} - data = _api_get("{}/{}/property".format(element_type, name), server) + data = _api_get(f"{element_type}/{name}/property", server) # Get properties into a dict if any(data["extraProperties"]["properties"]): @@ -199,7 +199,7 @@ def _get_element(name, element_type, server=None, with_properties=True): """ element = {} name = urllib.parse.quote(name, safe="") - data = _api_get("{}/{}".format(element_type, name), server) + data = _api_get(f"{element_type}/{name}", server) # Format data, get properties if asked, and return the whole thing if any(data["extraProperties"]["entity"]): @@ -242,7 +242,7 @@ def _update_element(name, element_type, data, server=None): properties = [] for key, value in data["properties"].items(): properties.append({"name": key, "value": value}) - _api_post("{}/{}/property".format(element_type, name), properties, server) + _api_post(f"{element_type}/{name}/property", properties, server) del data["properties"] # If the element only contained properties @@ -255,10 +255,10 @@ def _update_element(name, element_type, data, server=None): update_data.update(data) else: __context__["retcode"] = salt.defaults.exitcodes.SALT_BUILD_FAIL - raise CommandExecutionError("Cannot update {}".format(name)) + raise CommandExecutionError(f"Cannot update {name}") # Finally, update the element - _api_post("{}/{}".format(element_type, name), _clean_data(update_data), server) + _api_post(f"{element_type}/{name}", _clean_data(update_data), server) return urllib.parse.unquote(name) @@ -694,4 +694,4 @@ def delete_system_properties(name, server=None): """ Delete a system property """ - _api_delete("system-properties/{}".format(name), None, server) + _api_delete(f"system-properties/{name}", None, server) diff --git a/salt/modules/glusterfs.py b/salt/modules/glusterfs.py index 5de5110df35..b1ba1e2cb8e 100644 --- a/salt/modules/glusterfs.py +++ b/salt/modules/glusterfs.py @@ -73,12 +73,10 @@ def _gluster_xml(cmd): 6, ): result = __salt__["cmd.run"]( - 'script -q -c "gluster --xml --mode=script"', stdin="{}\n\004".format(cmd) + 'script -q -c "gluster --xml --mode=script"', stdin=f"{cmd}\n\004" ) else: - result = __salt__["cmd.run"]( - "gluster --xml --mode=script", stdin="{}\n".format(cmd) - ) + result = __salt__["cmd.run"]("gluster --xml --mode=script", stdin=f"{cmd}\n") try: root = ET.fromstring(_gluster_output_cleanup(result)) @@ -206,9 +204,9 @@ def peer(name): """ if salt.utils.cloud.check_name(name, "a-zA-Z0-9._-"): - raise SaltInvocationError('Invalid characters in peer name "{}"'.format(name)) + raise SaltInvocationError(f'Invalid characters in peer name "{name}"') - cmd = "peer probe {}".format(name) + cmd = f"peer probe {name}" return _gluster(cmd) @@ -288,13 +286,9 @@ def create_volume( try: peer_name, path = brick.split(":") if not path.startswith("/"): - raise SaltInvocationError( - "Brick paths must start with / in {}".format(brick) - ) + raise SaltInvocationError(f"Brick paths must start with / in {brick}") except ValueError: - raise SaltInvocationError( - "Brick syntax is : got {}".format(brick) - ) + raise SaltInvocationError(f"Brick syntax is : got {brick}") # Validate arbiter config if arbiter and replica != 3: @@ -303,17 +297,17 @@ def create_volume( ) # Format creation call - cmd = "volume create {} ".format(name) + cmd = f"volume create {name} " if stripe: - cmd += "stripe {} ".format(stripe) + cmd += f"stripe {stripe} " if replica: - cmd += "replica {} ".format(replica) + cmd += f"replica {replica} " if arbiter: cmd += "arbiter 1 " if device_vg: cmd += "device vg " if transport != "tcp": - cmd += "transport {} ".format(transport) + cmd += f"transport {transport} " cmd += " ".join(bricks) if force: cmd += " force" @@ -358,7 +352,7 @@ def status(name): salt '*' glusterfs.status myvolume """ # Get volume status - root = _gluster_xml("volume status {}".format(name)) + root = _gluster_xml(f"volume status {name}") if not _gluster_ok(root): # Most probably non-existing volume, the error output is logged # This return value is easy to test and intuitive @@ -384,7 +378,7 @@ def status(name): hostname = node.find("hostname").text if hostname not in ("NFS Server", "Self-heal Daemon"): path = node.find("path").text - ret["bricks"]["{}:{}".format(hostname, path)] = etree_legacy_wrap(node) + ret["bricks"][f"{hostname}:{path}"] = etree_legacy_wrap(node) elif hostname == "NFS Server": peerid = node.find("peerid").text true_hostname = hostref[peerid] @@ -427,7 +421,7 @@ def info(name=None): bricks = {} for i, brick in enumerate(_iter(volume, "brick"), start=1): - brickkey = "brick{}".format(i) + brickkey = f"brick{i}" bricks[brickkey] = {"path": brick.text} for child in brick: if not child.tag == "name": @@ -461,9 +455,9 @@ def start_volume(name, force=False): salt '*' glusterfs.start mycluster """ - cmd = "volume start {}".format(name) + cmd = f"volume start {name}" if force: - cmd = "{} force".format(cmd) + cmd = f"{cmd} force" volinfo = info(name) if name not in volinfo: @@ -503,7 +497,7 @@ def stop_volume(name, force=False): log.warning("Attempt to stop already stopped volume %s", name) return True - cmd = "volume stop {}".format(name) + cmd = f"volume stop {name}" if force: cmd += " force" @@ -543,7 +537,7 @@ def delete_volume(target, stop=True): if not stop_volume(target, force=True): return False - cmd = "volume delete {}".format(target) + cmd = f"volume delete {target}" return _gluster(cmd) @@ -571,7 +565,7 @@ def add_volume_bricks(name, bricks): new_bricks = [] - cmd = "volume add-brick {}".format(name) + cmd = f"volume add-brick {name}" if isinstance(bricks, str): bricks = [bricks] @@ -588,7 +582,7 @@ def add_volume_bricks(name, bricks): if new_bricks: for brick in new_bricks: - cmd += " {}".format(brick) + cmd += f" {brick}" return _gluster(cmd) return True @@ -607,7 +601,7 @@ def enable_quota_volume(name): salt '*' glusterfs.enable_quota_volume """ - cmd = "volume quota {} enable".format(name) + cmd = f"volume quota {name} enable" if not _gluster(cmd): return False return True @@ -627,7 +621,7 @@ def disable_quota_volume(name): salt '*' glusterfs.disable_quota_volume """ - cmd = "volume quota {} disable".format(name) + cmd = f"volume quota {name} disable" if not _gluster(cmd): return False return True @@ -655,11 +649,11 @@ def set_quota_volume(name, path, size, enable_quota=False): salt '*' glusterfs.set_quota_volume enable_quota=True """ - cmd = "volume quota {}".format(name) + cmd = f"volume quota {name}" if path: - cmd += " limit-usage {}".format(path) + cmd += f" limit-usage {path}" if size: - cmd += " {}".format(size) + cmd += f" {size}" if enable_quota: if not enable_quota_volume(name): @@ -685,9 +679,9 @@ def unset_quota_volume(name, path): salt '*' glusterfs.unset_quota_volume """ - cmd = "volume quota {}".format(name) + cmd = f"volume quota {name}" if path: - cmd += " remove {}".format(path) + cmd += f" remove {path}" if not _gluster(cmd): return False @@ -707,7 +701,7 @@ def list_quota_volume(name): salt '*' glusterfs.list_quota_volume """ - cmd = "volume quota {}".format(name) + cmd = f"volume quota {name}" cmd += " list" root = _gluster_xml(cmd) @@ -738,7 +732,7 @@ def get_op_version(name): salt '*' glusterfs.get_op_version """ - cmd = "volume get {} cluster.op-version".format(name) + cmd = f"volume get {name} cluster.op-version" root = _gluster_xml(cmd) if not _gluster_ok(root): @@ -816,7 +810,7 @@ def set_op_version(version): salt '*' glusterfs.set_op_version """ - cmd = "volume set all cluster.op-version {}".format(version) + cmd = f"volume set all cluster.op-version {version}" root = _gluster_xml(cmd) if not _gluster_ok(root): diff --git a/salt/modules/gnomedesktop.py b/salt/modules/gnomedesktop.py index 2ae41dd1155..15553f5fe75 100644 --- a/salt/modules/gnomedesktop.py +++ b/salt/modules/gnomedesktop.py @@ -77,7 +77,7 @@ class _GSettings: cmd = self.gsetting_command + ["get", str(self.SCHEMA), str(self.KEY)] environ = {} - environ["XDG_RUNTIME_DIR"] = "/run/user/{}".format(uid) + environ["XDG_RUNTIME_DIR"] = f"/run/user/{uid}" result = __salt__["cmd.run_all"]( cmd, runas=user, env=environ, python_shell=False ) @@ -102,12 +102,12 @@ class _GSettings: log.info("User does not exist") result = {} result["retcode"] = 1 - result["stdout"] = "User {} does not exist".format(user) + result["stdout"] = f"User {user} does not exist" return result cmd = self.gsetting_command + ["set", self.SCHEMA, self.KEY, value] environ = {} - environ["XDG_RUNTIME_DIR"] = "/run/user/{}".format(uid) + environ["XDG_RUNTIME_DIR"] = f"/run/user/{uid}" result = __salt__["cmd.run_all"]( cmd, runas=user, env=environ, python_shell=False ) diff --git a/salt/modules/gpg.py b/salt/modules/gpg.py index 14949e993c4..5f890bce193 100644 --- a/salt/modules/gpg.py +++ b/salt/modules/gpg.py @@ -121,7 +121,7 @@ def _get_user_info(user=None): # if it doesn't exist then fall back to user Salt running as userinfo = _get_user_info() else: - raise SaltInvocationError("User {} does not exist".format(user)) + raise SaltInvocationError(f"User {user} does not exist") return userinfo @@ -583,11 +583,11 @@ def delete_key( else: if str(__delete_key(fingerprint, True, use_passphrase)) == "ok": # Delete the secret key - ret["message"] = "Secret key for {} deleted\n".format(fingerprint) + ret["message"] = f"Secret key for {fingerprint} deleted\n" # Delete the public key if str(__delete_key(fingerprint, False, use_passphrase)) == "ok": - ret["message"] += "Public key for {} deleted".format(fingerprint) + ret["message"] += f"Public key for {fingerprint} deleted" ret["res"] = True return ret else: @@ -985,12 +985,12 @@ def trust_key(keyid=None, fingerprint=None, trust_level=None, user=None): if key: if "fingerprint" not in key: ret["res"] = False - ret["message"] = "Fingerprint not found for keyid {}".format(keyid) + ret["message"] = f"Fingerprint not found for keyid {keyid}" return ret fingerprint = key["fingerprint"] else: ret["res"] = False - ret["message"] = "KeyID {} not in GPG keychain".format(keyid) + ret["message"] = f"KeyID {keyid} not in GPG keychain" return ret else: ret["res"] = False @@ -1000,7 +1000,7 @@ def trust_key(keyid=None, fingerprint=None, trust_level=None, user=None): if trust_level not in _VALID_TRUST_LEVELS: return "ERROR: Valid trust levels - {}".format(",".join(_VALID_TRUST_LEVELS)) - stdin = "{}:{}\n".format(fingerprint, NUM_TRUST_DICT[trust_level]) + stdin = f"{fingerprint}:{NUM_TRUST_DICT[trust_level]}\n" cmd = [_gpg(), "--import-ownertrust"] _user = user @@ -1290,7 +1290,7 @@ def encrypt( if result.ok: if not bare: if output: - ret["comment"] = "Encrypted data has been written to {}".format(output) + ret["comment"] = f"Encrypted data has been written to {output}" else: ret["comment"] = result.data else: @@ -1378,7 +1378,7 @@ def decrypt( if result.ok: if not bare: if output: - ret["comment"] = "Decrypted data has been written to {}".format(output) + ret["comment"] = f"Decrypted data has been written to {output}" else: ret["comment"] = result.data else: diff --git a/salt/modules/grains.py b/salt/modules/grains.py index d803a209549..c9f9d1481d5 100644 --- a/salt/modules/grains.py +++ b/salt/modules/grains.py @@ -264,7 +264,7 @@ def setvals(grains, destructive=False, refresh_pillar=True): try: grains = salt.utils.yaml.safe_load(fp_) except salt.utils.yaml.YAMLError as exc: - return "Unable to read existing grains file: {}".format(exc) + return f"Unable to read existing grains file: {exc}" if not isinstance(grains, dict): grains = {} for key, val in new_grains.items(): @@ -360,9 +360,9 @@ def append(key, val, convert=False, delimiter=DEFAULT_TARGET_DELIM): if not isinstance(grains, list): grains = [] if grains is None else [grains] if not isinstance(grains, list): - return "The key {} is not a valid list".format(key) + return f"The key {key} is not a valid list" if val in grains: - return "The val {} was already in the list {}".format(val, key) + return f"The val {val} was already in the list {key}" if isinstance(val, list): for item in val: grains.append(item) @@ -407,9 +407,9 @@ def remove(key, val, delimiter=DEFAULT_TARGET_DELIM): """ grains = get(key, [], delimiter) if not isinstance(grains, list): - return "The key {} is not a valid list".format(key) + return f"The key {key} is not a valid list" if val not in grains: - return "The val {} was not in the list {}".format(val, key) + return f"The val {val} was not in the list {key}" grains.remove(val) while delimiter in key: diff --git a/salt/modules/groupadd.py b/salt/modules/groupadd.py index bc0db925b18..0a30ec3df9c 100644 --- a/salt/modules/groupadd.py +++ b/salt/modules/groupadd.py @@ -48,7 +48,7 @@ def _which(cmd): """ _cmd = salt.utils.path.which(cmd) if not _cmd: - raise CommandExecutionError("Command '{}' cannot be found".format(cmd)) + raise CommandExecutionError(f"Command '{cmd}' cannot be found") return _cmd @@ -83,7 +83,7 @@ def add(name, gid=None, system=False, root=None, non_unique=False): """ cmd = [_which("groupadd")] if gid: - cmd.append("-g {}".format(gid)) + cmd.append(f"-g {gid}") if non_unique: cmd.append("-o") if system and __grains__["kernel"] != "OpenBSD": @@ -349,11 +349,11 @@ def deluser(name, username, root=None): retcode = __salt__["cmd.retcode"](cmd, python_shell=False) elif __grains__["kernel"] == "OpenBSD": out = __salt__["cmd.run_stdout"]( - "id -Gn {}".format(username), python_shell=False + f"id -Gn {username}", python_shell=False ) cmd = [_which("usermod"), "-S"] cmd.append(",".join([g for g in out.split() if g != str(name)])) - cmd.append("{}".format(username)) + cmd.append(f"{username}") retcode = __salt__["cmd.retcode"](cmd, python_shell=False) else: log.error("group.deluser is not yet supported on this platform") @@ -459,7 +459,7 @@ def _getgrnam(name, root=None): comps[2] = int(comps[2]) comps[3] = comps[3].split(",") if comps[3] else [] return grp.struct_group(comps) - raise KeyError("getgrnam(): name not found: {}".format(name)) + raise KeyError(f"getgrnam(): name not found: {name}") def _getgrall(root=None): diff --git a/salt/modules/grub_legacy.py b/salt/modules/grub_legacy.py index 7bb46f8be9a..08851e7954a 100644 --- a/salt/modules/grub_legacy.py +++ b/salt/modules/grub_legacy.py @@ -75,14 +75,14 @@ def conf(): if line.startswith("\n"): in_stanza = False if "title" in stanza: - stanza += "order {}".format(pos) + stanza += f"order {pos}" pos += 1 stanzas.append(stanza) stanza = "" continue if line.strip().startswith("title"): if in_stanza: - stanza += "order {}".format(pos) + stanza += f"order {pos}" pos += 1 stanzas.append(stanza) stanza = "" @@ -97,7 +97,7 @@ def conf(): if not line.endswith("\n"): line += "\n" stanza += line - stanza += "order {}".format(pos) + stanza += f"order {pos}" pos += 1 stanzas.append(stanza) except OSError as exc: diff --git a/salt/modules/guestfs.py b/salt/modules/guestfs.py index 2395bd2a1c3..e802eadc614 100644 --- a/salt/modules/guestfs.py +++ b/salt/modules/guestfs.py @@ -67,7 +67,7 @@ def mount(location, access="rw", root=None): log.info("Path already existing: %s", root) else: break - cmd = "guestmount -i -a {} --{} {}".format(location, access, root) + cmd = f"guestmount -i -a {location} --{access} {root}" __salt__["cmd.run"](cmd, python_shell=False) return root @@ -82,7 +82,7 @@ def umount(name, disk=None): salt '*' guestfs.umount /mountpoint disk=/srv/images/fedora.qcow """ - cmd = "guestunmount -q {}".format(name) + cmd = f"guestunmount -q {name}" __salt__["cmd.run"](cmd) # Wait at most 5s that the disk is no longuer used @@ -90,7 +90,7 @@ def umount(name, disk=None): while ( disk is not None and loops < 5 - and len(__salt__["cmd.run"]("lsof {}".format(disk)).splitlines()) != 0 + and len(__salt__["cmd.run"](f"lsof {disk}").splitlines()) != 0 ): loops = loops + 1 time.sleep(1) diff --git a/salt/modules/haproxyconn.py b/salt/modules/haproxyconn.py index a7b0e31b89b..712eb018d06 100644 --- a/salt/modules/haproxyconn.py +++ b/salt/modules/haproxyconn.py @@ -47,9 +47,9 @@ def _get_conn(socket=DEFAULT_SOCKET_URL): """ Get connection to haproxy socket. """ - assert os.path.exists(socket), "{} does not exist.".format(socket) + assert os.path.exists(socket), f"{socket} does not exist." issock = os.stat(socket).st_mode - assert stat.S_ISSOCK(issock), "{} is not a socket.".format(socket) + assert stat.S_ISSOCK(issock), f"{socket} is not a socket." ha_conn = haproxy.conn.HaPConn(socket) return ha_conn diff --git a/salt/modules/hashutil.py b/salt/modules/hashutil.py index cdddadc8d45..3517f2512ac 100644 --- a/salt/modules/hashutil.py +++ b/salt/modules/hashutil.py @@ -38,7 +38,7 @@ def digest(instr, checksum="md5"): if hash_func is None: raise salt.exceptions.CommandExecutionError( - "Hash func '{}' is not supported.".format(checksum) + f"Hash func '{checksum}' is not supported." ) return hash_func(instr) @@ -62,9 +62,7 @@ def digest_file(infile, checksum="md5"): salt '*' hashutil.digest_file /path/to/file """ if not __salt__["file.file_exists"](infile): - raise salt.exceptions.CommandExecutionError( - "File path '{}' not found.".format(infile) - ) + raise salt.exceptions.CommandExecutionError(f"File path '{infile}' not found.") with salt.utils.files.fopen(infile, "rb") as f: file_hash = __salt__["hashutil.digest"](f.read(), checksum) diff --git a/salt/modules/heat.py b/salt/modules/heat.py index c4ea3a5e9e1..5a86b2b1fec 100644 --- a/salt/modules/heat.py +++ b/salt/modules/heat.py @@ -212,7 +212,7 @@ def _parse_environment(env_str): for param in env: if param not in SECTIONS: - raise ValueError('environment has wrong section "{}"'.format(param)) + raise ValueError(f'environment has wrong section "{param}"') return env @@ -240,7 +240,7 @@ def _poll_for_events( Polling stack events """ if action: - stop_status = ("{}_FAILED".format(action), "{}_COMPLETE".format(action)) + stop_status = (f"{action}_FAILED", f"{action}_COMPLETE") def stop_check(a): return a in stop_status @@ -287,7 +287,7 @@ def _poll_for_events( time.sleep(poll_period) timeout_sec -= poll_period if timeout_sec <= 0: - stack_status = "{}_FAILED".format(action) + stack_status = f"{action}_FAILED" msg = "Timeout expired" return stack_status, msg @@ -360,7 +360,7 @@ def show_stack(name=None, profile=None): } ret["result"] = True except heatclient.exc.HTTPNotFound: - return {"result": False, "comment": "No stack {}".format(name)} + return {"result": False, "comment": f"No stack {name}"} return ret @@ -397,7 +397,7 @@ def delete_stack(name=None, poll=0, timeout=60, profile=None): h_client.stacks.delete(name) except heatclient.exc.HTTPNotFound: ret["result"] = False - ret["comment"] = "No stack {}".format(name) + ret["comment"] = f"No stack {name}" except heatclient.exc.HTTPForbidden as forbidden: log.exception(forbidden) ret["result"] = False @@ -411,19 +411,19 @@ def delete_stack(name=None, poll=0, timeout=60, profile=None): h_client, name, action="DELETE", poll_period=poll, timeout=timeout ) except heatclient.exc.CommandError: - ret["comment"] = "Deleted stack {}.".format(name) + ret["comment"] = f"Deleted stack {name}." return ret except Exception as ex: # pylint: disable=W0703 log.exception("Delete failed %s", ex) ret["result"] = False - ret["comment"] = "{}".format(ex) + ret["comment"] = f"{ex}" return ret if stack_status == "DELETE_FAILED": ret["result"] = False - ret["comment"] = "Deleted stack FAILED'{}'{}.".format(name, msg) + ret["comment"] = f"Deleted stack FAILED'{name}'{msg}." else: - ret["comment"] = "Deleted stack {}.".format(name) + ret["comment"] = f"Deleted stack {name}." return ret @@ -529,7 +529,7 @@ def create_stack( template = _parse_template(tpl) except ValueError as ex: ret["result"] = False - ret["comment"] = "Error parsing template {}".format(ex) + ret["comment"] = f"Error parsing template {ex}" else: ret["result"] = False ret["comment"] = "Can not open template: {} {}".format( @@ -548,7 +548,7 @@ def create_stack( except Exception as ex: # pylint: disable=W0703 log.exception("Template not valid %s", ex) ret["result"] = False - ret["comment"] = "Template not valid {}".format(ex) + ret["comment"] = f"Template not valid {ex}" return ret env = {} if environment: @@ -596,7 +596,7 @@ def create_stack( env = _parse_environment(env_str) except ValueError as ex: ret["result"] = False - ret["comment"] = "Error parsing template {}".format(ex) + ret["comment"] = f"Error parsing template {ex}" else: ret["result"] = False ret["comment"] = "Can not open environment: {}, {}".format( @@ -620,7 +620,7 @@ def create_stack( except Exception as ex: # pylint: disable=W0703 log.exception("Create failed %s", ex) ret["result"] = False - ret["comment"] = "{}".format(ex) + ret["comment"] = f"{ex}" return ret if poll > 0: stack_status, msg = _poll_for_events( @@ -628,9 +628,9 @@ def create_stack( ) if stack_status == "CREATE_FAILED": ret["result"] = False - ret["comment"] = "Created stack FAILED'{}'{}.".format(name, msg) + ret["comment"] = f"Created stack FAILED'{name}'{msg}." if ret["result"] is True: - ret["comment"] = "Created stack '{}'.".format(name) + ret["comment"] = f"Created stack '{name}'." return ret @@ -740,7 +740,7 @@ def update_stack( template = _parse_template(tpl) except ValueError as ex: ret["result"] = False - ret["comment"] = "Error parsing template {}".format(ex) + ret["comment"] = f"Error parsing template {ex}" else: ret["result"] = False ret["comment"] = "Can not open template: {} {}".format( @@ -759,7 +759,7 @@ def update_stack( except Exception as ex: # pylint: disable=W0703 log.exception("Template not valid %s", ex) ret["result"] = False - ret["comment"] = "Template not valid {}".format(ex) + ret["comment"] = f"Template not valid {ex}" return ret env = {} if environment: @@ -807,7 +807,7 @@ def update_stack( env = _parse_environment(env_str) except ValueError as ex: ret["result"] = False - ret["comment"] = "Error parsing template {}".format(ex) + ret["comment"] = f"Error parsing template {ex}" else: ret["result"] = False ret["comment"] = "Can not open environment: {}, {}".format( @@ -829,7 +829,7 @@ def update_stack( except Exception as ex: # pylint: disable=W0703 log.exception("Update failed %s", ex) ret["result"] = False - ret["comment"] = "Update failed {}".format(ex) + ret["comment"] = f"Update failed {ex}" return ret if poll > 0: @@ -838,9 +838,9 @@ def update_stack( ) if stack_status == "UPDATE_FAILED": ret["result"] = False - ret["comment"] = "Updated stack FAILED'{}'{}.".format(name, msg) + ret["comment"] = f"Updated stack FAILED'{name}'{msg}." if ret["result"] is True: - ret["comment"] = ("Updated stack '{}'.".format(name),) + ret["comment"] = (f"Updated stack '{name}'.",) return ret @@ -867,9 +867,9 @@ def template_stack(name=None, profile=None): try: get_template = h_client.stacks.template(name) except heatclient.exc.HTTPNotFound: - return {"result": False, "comment": "No stack with {}".format(name)} + return {"result": False, "comment": f"No stack with {name}"} except heatclient.exc.BadRequest: - return {"result": False, "comment": "Bad request fot stack {}".format(name)} + return {"result": False, "comment": f"Bad request fot stack {name}"} if "heat_template_version" in get_template: template = salt.utils.yaml.safe_dump(get_template) else: diff --git a/salt/modules/hg.py b/salt/modules/hg.py index 855fe2f2cfa..9e1d9de6be1 100644 --- a/salt/modules/hg.py +++ b/salt/modules/hg.py @@ -22,7 +22,7 @@ def __virtual__(): def _ssh_flag(identity_path): - return ["--ssh", "ssh -i {}".format(identity_path)] + return ["--ssh", f"ssh -i {identity_path}"] def revision(cwd, rev="tip", short=False, user=None): @@ -47,7 +47,7 @@ def revision(cwd, rev="tip", short=False, user=None): salt '*' hg.revision /path/to/repo mybranch """ - cmd = ["hg", "id", "-i", "--debug" if not short else "", "-r", "{}".format(rev)] + cmd = ["hg", "id", "-i", "--debug" if not short else "", "-r", f"{rev}"] result = __salt__["cmd.run_all"](cmd, cwd=cwd, runas=user, python_shell=False) @@ -80,7 +80,7 @@ def describe(cwd, rev="tip", user=None): "hg", "log", "-r", - "{}".format(rev), + f"{rev}", "--template", "'{{latesttag}}-{{latesttagdistance}}-{{node|short}}'", ] @@ -124,16 +124,16 @@ def archive(cwd, output, rev="tip", fmt=None, prefix=None, user=None): cmd = [ "hg", "archive", - "{}".format(output), + f"{output}", "--rev", - "{}".format(rev), + f"{rev}", ] if fmt: cmd.append("--type") - cmd.append("{}".format(fmt)) + cmd.append(f"{fmt}") if prefix: cmd.append("--prefix") - cmd.append('"{}"'.format(prefix)) + cmd.append(f'"{prefix}"') return __salt__["cmd.run"](cmd, cwd=cwd, runas=user, python_shell=False) @@ -204,7 +204,7 @@ def update(cwd, rev, force=False, user=None): salt devserver1 hg.update /path/to/repo somebranch """ - cmd = ["hg", "update", "{}".format(rev)] + cmd = ["hg", "update", f"{rev}"] if force: cmd.append("-C") @@ -244,10 +244,10 @@ def clone(cwd, repository, opts=None, user=None, identity=None): salt '*' hg.clone /path/to/repo https://bitbucket.org/birkenfeld/sphinx """ - cmd = ["hg", "clone", "{}".format(repository), "{}".format(cwd)] + cmd = ["hg", "clone", f"{repository}", f"{cwd}"] if opts: for opt in opts.split(): - cmd.append("{}".format(opt)) + cmd.append(f"{opt}") if identity: cmd.extend(_ssh_flag(identity)) @@ -284,7 +284,7 @@ def status(cwd, opts=None, user=None): cmd = ["hg", "status"] if opts: for opt in opts.split(): - cmd.append("{}".format(opt)) + cmd.append(f"{opt}") out = __salt__["cmd.run_stdout"](cmd, cwd=cwd, runas=user, python_shell=False) types = { "M": "modified", diff --git a/salt/modules/highstate_doc.py b/salt/modules/highstate_doc.py index 9f0b89bffbf..a91f77b2afb 100644 --- a/salt/modules/highstate_doc.py +++ b/salt/modules/highstate_doc.py @@ -388,7 +388,7 @@ def _get_config(**kwargs): "note": None, } if "__salt__" in globals(): - config_key = "{}.config".format(__virtualname__) + config_key = f"{__virtualname__}.config" config.update(__salt__["config.get"](config_key, {})) # pylint: disable=C0201 for k in set(config.keys()) & set(kwargs.keys()): @@ -437,7 +437,7 @@ def read_file(name): def render( jinja_template_text=None, jinja_template_function="highstate_doc.markdown_default_jinja_template", - **kwargs + **kwargs, ): """ Render highstate to a text format (default Markdown) @@ -573,13 +573,13 @@ def _format_markdown_system_file(filename, config): file_stats, whitelist=["user", "group", "mode", "uid", "gid", "size"] ) if y: - ret += "file stat {1}\n```\n{0}```\n".format(y, filename) + ret += f"file stat {filename}\n```\n{y}```\n" file_size = file_stats.get("size") if file_size <= config.get("max_render_file_size"): is_binary = True try: # TODO: this is linux only should find somthing portable - file_type = __salt__["cmd.shell"]("\\file -i '{}'".format(filename)) + file_type = __salt__["cmd.shell"](f"\\file -i '{filename}'") if "charset=binary" not in file_type: is_binary = False except Exception as ex: # pylint: disable=broad-except @@ -591,11 +591,11 @@ def _format_markdown_system_file(filename, config): with salt.utils.files.fopen(filename, "r") as f: file_data = salt.utils.stringutils.to_unicode(f.read()) file_data = _md_fix(file_data) - ret += "file data {1}\n```\n{0}\n```\n".format(file_data, filename) + ret += f"file data {filename}\n```\n{file_data}\n```\n" else: ret += "```\n{}\n```\n".format( "SKIPPED LARGE FILE!\nSet {}:max_render_file_size > {} to render.".format( - "{}.config".format(__virtualname__), file_size + f"{__virtualname__}.config", file_size ) ) return ret @@ -614,11 +614,11 @@ def _format_markdown_requisite(state, stateid, makelink=True): """ format requisite as a link users can click """ - fmt_id = "{}: {}".format(state, stateid) + fmt_id = f"{state}: {stateid}" if makelink: - return " * [{}](#{})\n".format(fmt_id, _format_markdown_link(fmt_id)) + return f" * [{fmt_id}](#{_format_markdown_link(fmt_id)})\n" else: - return " * `{}`\n".format(fmt_id) + return f" * `{fmt_id}`\n" def processor_markdown(lowstate_item, config, **kwargs): @@ -669,19 +669,19 @@ def processor_markdown(lowstate_item, config, **kwargs): if "source" in s: text = __salt__["cp.get_file_str"](s["source"]) if text: - details += "\n{}\n".format(text) + details += f"\n{text}\n" else: details += "\n{}\n".format("ERROR: opening {}".format(s["source"])) if state_function == "pkg.installed": pkgs = s.get("pkgs", s.get("name")) - details += "\n```\ninstall: {}\n```\n".format(pkgs) + details += f"\n```\ninstall: {pkgs}\n```\n" if state_function == "file.recurse": details += """recurse copy of files\n""" y = _state_data_to_yaml_string(s) if y: - details += "```\n{}\n```\n".format(y) + details += f"```\n{y}\n```\n" if "!doc_recurse" in id_full: findfiles = __salt__["file.find"](path=s.get("name"), type="f") if len(findfiles) < 10 or "!doc_recurse_force" in id_full: @@ -715,7 +715,7 @@ def processor_markdown(lowstate_item, config, **kwargs): if not details: y = _state_data_to_yaml_string(s) if y: - details += "```\n{}```\n".format(y) + details += f"```\n{y}```\n" r = { "vars": lowstate_item, diff --git a/salt/modules/hosts.py b/salt/modules/hosts.py index 83f60ab2050..267fe056ad5 100644 --- a/salt/modules/hosts.py +++ b/salt/modules/hosts.py @@ -58,7 +58,7 @@ def _list_hosts(): if not line: continue if line.startswith("#"): - ret.setdefault("comment-{}".format(count), []).append(line) + ret.setdefault(f"comment-{count}", []).append(line) count += 1 continue comment = None diff --git a/salt/modules/icinga2.py b/salt/modules/icinga2.py index e3e758d2259..391fb4abea7 100644 --- a/salt/modules/icinga2.py +++ b/salt/modules/icinga2.py @@ -70,9 +70,9 @@ def generate_cert(domain): "--cn", domain, "--key", - "{}{}.key".format(get_certs_path(), domain), + f"{get_certs_path()}{domain}.key", "--cert", - "{}{}.crt".format(get_certs_path(), domain), + f"{get_certs_path()}{domain}.crt", ], python_shell=False, ) @@ -99,11 +99,11 @@ def save_cert(domain, master): "pki", "save-cert", "--key", - "{}{}.key".format(get_certs_path(), domain), + f"{get_certs_path()}{domain}.key", "--cert", - "{}{}.cert".format(get_certs_path(), domain), + f"{get_certs_path()}{domain}.cert", "--trustedcert", - "{}trusted-master.crt".format(get_certs_path()), + f"{get_certs_path()}trusted-master.crt", "--host", master, ], @@ -139,13 +139,13 @@ def request_cert(domain, master, ticket, port): "--ticket", ticket, "--key", - "{}{}.key".format(get_certs_path(), domain), + f"{get_certs_path()}{domain}.key", "--cert", - "{}{}.crt".format(get_certs_path(), domain), + f"{get_certs_path()}{domain}.crt", "--trustedcert", - "{}trusted-master.crt".format(get_certs_path()), + f"{get_certs_path()}trusted-master.crt", "--ca", - "{}ca.crt".format(get_certs_path()), + f"{get_certs_path()}ca.crt", ], python_shell=False, ) @@ -181,7 +181,7 @@ def node_setup(domain, master, ticket): "--master_host", master, "--trustedcert", - "{}trusted-master.crt".format(get_certs_path()), + f"{get_certs_path()}trusted-master.crt", ], python_shell=False, ) diff --git a/salt/modules/ifttt.py b/salt/modules/ifttt.py index 248e059b87a..9126ab06b33 100644 --- a/salt/modules/ifttt.py +++ b/salt/modules/ifttt.py @@ -38,7 +38,7 @@ def _query(event=None, method="GET", args=None, header_dict=None, data=None): secret_key = __salt__["config.get"]("ifttt.secret_key") or __salt__["config.get"]( "ifttt:secret_key" ) - path = "https://maker.ifttt.com/trigger/{}/with/key/{}".format(event, secret_key) + path = f"https://maker.ifttt.com/trigger/{event}/with/key/{secret_key}" if header_dict is None: header_dict = {"Content-type": "application/json"} diff --git a/salt/modules/ilo.py b/salt/modules/ilo.py index c01e9da213c..c8d104fe797 100644 --- a/salt/modules/ilo.py +++ b/salt/modules/ilo.py @@ -47,7 +47,7 @@ def __execute_cmd(name, xml): tmpfilename = fh.name fh.write(xml) - cmd = __salt__["cmd.run_all"]("hponcfg -f {}".format(tmpfilename)) + cmd = __salt__["cmd.run_all"](f"hponcfg -f {tmpfilename}") # Clean up the temp file __salt__["file.remove"](tmpfilename) @@ -394,11 +394,7 @@ def create_user(name, password, *privileges): name, password, "\n".join( - [ - '<{} value="Y" />'.format(i.upper()) - for i in privileges - if i.upper() in _priv - ] + [f'<{i.upper()} value="Y" />' for i in privileges if i.upper() in _priv] ), ) diff --git a/salt/modules/incron.py b/salt/modules/incron.py index ad13c6de6e5..ad99b27aa3e 100644 --- a/salt/modules/incron.py +++ b/salt/modules/incron.py @@ -56,7 +56,7 @@ def _render_tab(lst): """ ret = [] for pre in lst["pre"]: - ret.append("{}\n".format(pre)) + ret.append(f"{pre}\n") for cron in lst["crons"]: ret.append( "{} {} {}\n".format( @@ -72,7 +72,7 @@ def _get_incron_cmdstr(path): """ Returns a format string, to be used to build an incrontab command. """ - return "incrontab {}".format(path) + return f"incrontab {path}" def write_incron_file(user, path): @@ -121,7 +121,7 @@ def _write_incron_lines(user, lines): with salt.utils.files.fopen(path, "wb") as fp_: fp_.writelines(salt.utils.data.encode(lines)) if user != "root": - __salt__["cmd.run"]("chown {} {}".format(user, path), python_shell=False) + __salt__["cmd.run"](f"chown {user} {path}", python_shell=False) ret = __salt__["cmd.run_all"]( _get_incron_cmdstr(path), runas=user, python_shell=False ) @@ -135,7 +135,7 @@ def _write_file(folder, filename, data): """ path = os.path.join(folder, filename) if not os.path.exists(folder): - msg = "{} cannot be written. {} does not exist".format(filename, folder) + msg = f"{filename} cannot be written. {folder} does not exist" log.error(msg) raise AttributeError(str(msg)) with salt.utils.files.fopen(path, "w") as fp_: @@ -180,7 +180,7 @@ def raw_incron(user): salt '*' incron.raw_incron root """ - cmd = "incrontab -l {}".format(user) + cmd = f"incrontab -l {user}" return __salt__["cmd.run_stdout"](cmd, rstrip=False, runas=user, python_shell=False) @@ -236,7 +236,7 @@ def set_job(user, path, mask, cmd): # Check for valid mask types for item in mask.split(","): if item not in _MASK_TYPES: - return "Invalid mask type: {}".format(item) + return f"Invalid mask type: {item}" updated = False arg_mask = mask.split(",") @@ -296,7 +296,7 @@ def rm_job(user, path, mask, cmd): # Check for valid mask types for item in mask.split(","): if item not in _MASK_TYPES: - return "Invalid mask type: {}".format(item) + return f"Invalid mask type: {item}" lst = list_tab(user) ret = "absent" diff --git a/salt/modules/influxdbmod.py b/salt/modules/influxdbmod.py index 4793e54c8be..c8c1689d5d4 100644 --- a/salt/modules/influxdbmod.py +++ b/salt/modules/influxdbmod.py @@ -66,7 +66,7 @@ def _client( influxdb_password=None, influxdb_host=None, influxdb_port=None, - **client_args + **client_args, ): if not influxdb_user: influxdb_user = __salt__["config.option"]("influxdb.user", "root") @@ -84,7 +84,7 @@ def _client( port=influxdb_port, username=influxdb_user, password=influxdb_password, - **client_args + **client_args, ) @@ -674,7 +674,7 @@ def drop_continuous_query(database, name, **client_args): """ client = _client(**client_args) - query = "DROP CONTINUOUS QUERY {} ON {}".format(name, database) + query = f"DROP CONTINUOUS QUERY {name} ON {database}" client.query(query) return True diff --git a/salt/modules/infoblox.py b/salt/modules/infoblox.py index a779b6322f9..14402e437d6 100644 --- a/salt/modules/infoblox.py +++ b/salt/modules/infoblox.py @@ -61,7 +61,7 @@ def _get_config(**api_opts): "api_key": "", } if "__salt__" in globals(): - config_key = "{}.config".format(__virtualname__) + config_key = f"{__virtualname__}.config" config.update(__salt__["config.get"](config_key, {})) # pylint: disable=C0201 for k in set(config.keys()) & set(api_opts.keys()): @@ -143,7 +143,7 @@ def update_object(objref, data, **api_opts): salt-call infoblox.update_object objref=[ref_of_object] data={} """ if "__opts__" in globals() and __opts__["test"]: - return {"Test": "Would attempt to update object: {}".format(objref)} + return {"Test": f"Would attempt to update object: {objref}"} infoblox = _get_infoblox(**api_opts) return infoblox.update_object(objref, data) @@ -159,7 +159,7 @@ def delete_object(objref, **api_opts): salt-call infoblox.delete_object objref=[ref_of_object] """ if "__opts__" in globals() and __opts__["test"]: - return {"Test": "Would attempt to delete object: {}".format(objref)} + return {"Test": f"Would attempt to delete object: {objref}"} infoblox = _get_infoblox(**api_opts) return infoblox.delete_object(objref) @@ -175,7 +175,7 @@ def create_object(object_type, data, **api_opts): salt-call infoblox.update_object object_type=record:host data={} """ if "__opts__" in globals() and __opts__["test"]: - return {"Test": "Would attempt to create object: {}".format(object_type)} + return {"Test": f"Would attempt to create object: {object_type}"} infoblox = _get_infoblox(**api_opts) return infoblox.create_object(object_type, data) @@ -186,7 +186,7 @@ def get_object( return_fields=None, max_results=None, ensure_none_or_one_result=False, - **api_opts + **api_opts, ): """ Get raw infoblox object. This is a low level api call. diff --git a/salt/modules/ini_manage.py b/salt/modules/ini_manage.py index 70ce447f5b0..f5aff8881e2 100644 --- a/salt/modules/ini_manage.py +++ b/salt/modules/ini_manage.py @@ -417,7 +417,7 @@ class _Section(OrderedDict): # Match comments com_match = COM_REGX.match(opt_str) if com_match: - name = "#comment{}".format(comment_count) + name = f"#comment{comment_count}" self.com = com_match.group(1) comment_count += 1 self.update({name: opt_str}) @@ -441,7 +441,7 @@ class _Section(OrderedDict): self.update({name: value}) continue # Anything remaining is a mystery. - name = "#unknown{}".format(unknown_count) + name = f"#unknown{unknown_count}" self.update({name: opt_str}) unknown_count += 1 @@ -512,7 +512,7 @@ class _Section(OrderedDict): for name, value in self.items(): # Handle Comment Lines if COM_REGX.match(name): - yield "{}{}".format(value, os.linesep) + yield f"{value}{os.linesep}" # Handle Sections elif isinstance(value, _Section): sections_dict.update({name: value}) @@ -521,7 +521,7 @@ class _Section(OrderedDict): else: yield "{}{}{}{}".format( name, - " {} ".format(self.sep) if self.sep != " " else self.sep, + f" {self.sep} " if self.sep != " " else self.sep, value, os.linesep, ) @@ -583,7 +583,7 @@ class _Ini(_Section): except OSError as exc: if __opts__["test"] is False: raise CommandExecutionError( - "Unable to open file '{}'. Exception: {}".format(self.name, exc) + f"Unable to open file '{self.name}'. Exception: {exc}" ) if not inicontents: return @@ -620,7 +620,7 @@ class _Ini(_Section): outfile.writelines(ini_gen_list) except OSError as exc: raise CommandExecutionError( - "Unable to write file '{}'. Exception: {}".format(self.name, exc) + f"Unable to write file '{self.name}'. Exception: {exc}" ) @staticmethod diff --git a/salt/modules/inspectlib/collector.py b/salt/modules/inspectlib/collector.py index 735f74d67de..d92646c9fc3 100644 --- a/salt/modules/inspectlib/collector.py +++ b/salt/modules/inspectlib/collector.py @@ -406,7 +406,7 @@ class Inspector(EnvLoader): all_links = list() for entry_path in [pth for pth in (allowed or os.listdir("/")) if pth]: if entry_path[0] != "/": - entry_path = "/{}".format(entry_path) + entry_path = f"/{entry_path}" if entry_path in ignored or os.path.islink(entry_path): continue e_files, e_dirs, e_links = self._get_all_files(entry_path, *ignored) @@ -490,7 +490,7 @@ class Inspector(EnvLoader): Take a snapshot of the system. """ if mode not in self.MODE: - raise InspectorSnapshotException("Unknown mode: '{}'".format(mode)) + raise InspectorSnapshotException(f"Unknown mode: '{mode}'") if is_alive(self.pidfile): raise CommandExecutionError("Inspection already in progress.") @@ -500,7 +500,7 @@ class Inspector(EnvLoader): subprocess.run( [ "nice", - "-{}".format(priority), + f"-{priority}", "python", __file__, os.path.dirname(self.pidfile), @@ -596,7 +596,7 @@ if __name__ == "__main__": with salt.utils.files.fopen( os.path.join(pidfile, EnvLoader.PID_FILE), "w" ) as fp_: - fp_.write("{}\n".format(pid)) + fp_.write(f"{pid}\n") sys.exit(0) except OSError as ex: sys.exit(1) diff --git a/salt/modules/inspectlib/kiwiproc.py b/salt/modules/inspectlib/kiwiproc.py index 321dfa8ff68..d3947ff5b00 100644 --- a/salt/modules/inspectlib/kiwiproc.py +++ b/salt/modules/inspectlib/kiwiproc.py @@ -247,11 +247,11 @@ class KiwiExporter: descr = etree.SubElement(node, "description") author = etree.SubElement(descr, "author") - author.text = "salt.modules.node on {}".format(hostname) + author.text = f"salt.modules.node on {hostname}" contact = etree.SubElement(descr, "contact") - contact.text = "root@{}".format(hostname) + contact.text = f"root@{hostname}" specs = etree.SubElement(descr, "specification") - specs.text = "Rebuild of {}, based on Salt inspection.".format(hostname) + specs.text = f"Rebuild of {hostname}, based on Salt inspection." return descr diff --git a/salt/modules/inspectlib/query.py b/salt/modules/inspectlib/query.py index 4ba5417a185..d7f06eae565 100644 --- a/salt/modules/inspectlib/query.py +++ b/salt/modules/inspectlib/query.py @@ -35,7 +35,7 @@ class SysInfo: def __init__(self, systype): if systype.lower() == "solaris": - raise SIException("Platform {} not (yet) supported.".format(systype)) + raise SIException(f"Platform {systype} not (yet) supported.") def _grain(self, grain): """ @@ -47,7 +47,7 @@ class SysInfo: """ Get a size of a disk. """ - out = __salt__["cmd.run_all"]("df {}".format(device)) + out = __salt__["cmd.run_all"](f"df {device}") if out["retcode"]: msg = "Disk size info error: {}".format(out["stderr"]) log.error(msg) @@ -464,13 +464,13 @@ class Query(EnvLoader): fmt = fmt.lower() if fmt == "b": - return "{} Bytes".format(size) + return f"{size} Bytes" elif fmt == "kb": - return "{} Kb".format(round((float(size) / 0x400), 2)) + return f"{round((float(size) / 0x400), 2)} Kb" elif fmt == "mb": - return "{} Mb".format(round((float(size) / 0x400 / 0x400), 2)) + return f"{round((float(size) / 0x400 / 0x400), 2)} Mb" elif fmt == "gb": - return "{} Gb".format(round((float(size) / 0x400 / 0x400 / 0x400), 2)) + return f"{round((float(size) / 0x400 / 0x400 / 0x400), 2)} Gb" filter = kwargs.get("filter") offset = kwargs.get("offset", 0) @@ -478,7 +478,7 @@ class Query(EnvLoader): timeformat = kwargs.get("time", "tz") if timeformat not in ["ticks", "tz"]: raise InspectorQueryException( - 'Unknown "{}" value for parameter "time"'.format(timeformat) + f'Unknown "{timeformat}" value for parameter "time"' ) def tfmt(param): diff --git a/salt/modules/inspector.py b/salt/modules/inspector.py index 02162cb564c..2d549e353a6 100644 --- a/salt/modules/inspector.py +++ b/salt/modules/inspector.py @@ -51,7 +51,7 @@ def _(module): import importlib - mod = importlib.import_module("salt.modules.inspectlib.{}".format(module)) + mod = importlib.import_module(f"salt.modules.inspectlib.{module}") mod.__grains__ = __grains__ mod.__pillar__ = __pillar__ mod.__salt__ = __salt__ diff --git a/salt/modules/iosconfig.py b/salt/modules/iosconfig.py index be0b58a5bd6..75d40756aee 100644 --- a/salt/modules/iosconfig.py +++ b/salt/modules/iosconfig.py @@ -166,7 +166,7 @@ def tree(config=None, path=None, with_tags=False, saltenv="base"): if path: config = __salt__["cp.get_file_str"](path, saltenv=saltenv) if config is False: - raise SaltException("{} is not available".format(path)) + raise SaltException(f"{path} is not available") config_lines = config.splitlines() return _parse_text_config(config_lines, with_tags=with_tags) diff --git a/salt/modules/ipmi.py b/salt/modules/ipmi.py index 3e5cf05723f..133b1161c6a 100644 --- a/salt/modules/ipmi.py +++ b/salt/modules/ipmi.py @@ -57,7 +57,7 @@ def _get_config(**kwargs): "api_login_timeout": 2, } if "__salt__" in globals(): - config_key = "{}.config".format(__virtualname__) + config_key = f"{__virtualname__}.config" config.update(__salt__["config.get"](config_key, {})) for k in set(config) & set(kwargs): config[k] = kwargs[k] @@ -197,7 +197,7 @@ def set_channel_access( access_mode="always", privilege_update_mode="non_volatile", privilege_level="administrator", - **kwargs + **kwargs, ): """ Set channel access @@ -387,7 +387,7 @@ def set_user_access( link_auth=True, ipmi_msg=True, privilege_level="administrator", - **kwargs + **kwargs, ): """ Set user access @@ -896,7 +896,7 @@ def create_user( link_auth=True, ipmi_msg=True, privilege_level="administrator", - **kwargs + **kwargs, ): """ create/ensure a user is created with provided settings. diff --git a/salt/modules/ipset.py b/salt/modules/ipset.py index 35401c11529..b666bd0957e 100644 --- a/salt/modules/ipset.py +++ b/salt/modules/ipset.py @@ -314,7 +314,7 @@ def new_set(name=None, set_type=None, family="ipv4", comment=False, **kwargs): # Check for required arguments for item in _CREATE_OPTIONS_REQUIRED[set_type]: if item not in kwargs: - return "Error: {} is a required argument".format(item) + return f"Error: {item} is a required argument" cmd = [_ipset_cmd(), "create", name, set_type] @@ -477,7 +477,7 @@ def add(name=None, entry=None, family="ipv4", **kwargs): setinfo = _find_set_info(name) if not setinfo: - return "Error: Set {} does not exist".format(name) + return f"Error: Set {name} does not exist" settype = setinfo["Type"] @@ -485,21 +485,21 @@ def add(name=None, entry=None, family="ipv4", **kwargs): if "timeout" in kwargs: if "timeout" not in setinfo["Header"]: - return "Error: Set {} not created with timeout support".format(name) + return f"Error: Set {name} not created with timeout support" if "packets" in kwargs or "bytes" in kwargs: if "counters" not in setinfo["Header"]: - return "Error: Set {} not created with counters support".format(name) + return f"Error: Set {name} not created with counters support" if "comment" in kwargs: if "comment" not in setinfo["Header"]: - return "Error: Set {} not created with comment support".format(name) + return f"Error: Set {name} not created with comment support" if "comment" not in entry: cmd = cmd + ["comment", f"{kwargs['comment']}"] if {"skbmark", "skbprio", "skbqueue"} & set(kwargs.keys()): if "skbinfo" not in setinfo["Header"]: - return "Error: Set {} not created with skbinfo support".format(name) + return f"Error: Set {name} not created with skbinfo support" for item in _ADD_OPTIONS[settype]: if item in kwargs: @@ -507,14 +507,14 @@ def add(name=None, entry=None, family="ipv4", **kwargs): current_members = _find_set_members(name) if entry in current_members: - return "Warn: Entry {} already exists in set {}".format(entry, name) + return f"Warn: Entry {entry} already exists in set {name}" # Using -exist to ensure entries are updated if the comment changes out = __salt__["cmd.run"](cmd, python_shell=False) if not out: return "Success" - return "Error: {}".format(out) + return f"Error: {out}" def delete(name=None, entry=None, family="ipv4", **kwargs): @@ -536,14 +536,14 @@ def delete(name=None, entry=None, family="ipv4", **kwargs): settype = _find_set_type(name) if not settype: - return "Error: Set {} does not exist".format(name) + return f"Error: Set {name} does not exist" cmd = [_ipset_cmd(), "del", name, entry] out = __salt__["cmd.run"](cmd, python_shell=False) if not out: return "Success" - return "Error: {}".format(out) + return f"Error: {out}" def check(name=None, entry=None, family="ipv4"): @@ -580,7 +580,7 @@ def check(name=None, entry=None, family="ipv4"): settype = _find_set_type(name) if not settype: - return "Error: Set {} does not exist".format(name) + return f"Error: Set {name} does not exist" current_members = _parse_members(settype, _find_set_members(name)) @@ -620,7 +620,7 @@ def test(name=None, entry=None, family="ipv4", **kwargs): settype = _find_set_type(name) if not settype: - return "Error: Set {} does not exist".format(name) + return f"Error: Set {name} does not exist" cmd = [_ipset_cmd(), "test", name, entry] out = __salt__["cmd.run_all"](cmd, python_shell=False) diff --git a/salt/modules/iwtools.py b/salt/modules/iwtools.py index 353fea5ea28..d22b16133f1 100644 --- a/salt/modules/iwtools.py +++ b/salt/modules/iwtools.py @@ -36,10 +36,10 @@ def scan(iface, style=None): if not _valid_iface(iface): raise SaltInvocationError("The interface specified is not valid") - out = __salt__["cmd.run"]("iwlist {} scan".format(iface)) + out = __salt__["cmd.run"](f"iwlist {iface} scan") if "Network is down" in out: - __salt__["cmd.run"]("ip link set {} up".format(iface)) - out = __salt__["cmd.run"]("iwlist {} scan".format(iface)) + __salt__["cmd.run"](f"ip link set {iface} up") + out = __salt__["cmd.run"](f"iwlist {iface} scan") ret = {} tmp = {} for line in out.splitlines(): @@ -101,7 +101,7 @@ def set_mode(iface, mode): ) ) __salt__["ip.down"](iface) - out = __salt__["cmd.run"]("iwconfig {} mode {}".format(iface, mode)) + out = __salt__["cmd.run"](f"iwconfig {iface} mode {mode}") __salt__["ip.up"](iface) return mode diff --git a/salt/modules/jboss7.py b/salt/modules/jboss7.py index e68621ced11..1651da7ea8f 100644 --- a/salt/modules/jboss7.py +++ b/salt/modules/jboss7.py @@ -90,7 +90,7 @@ def stop_server(jboss_config, host=None): if host is None: operation = ":shutdown" else: - operation = '/host="{host}"/:shutdown'.format(host=host) + operation = f'/host="{host}"/:shutdown' shutdown_result = __salt__["jboss7_cli.run_operation"]( jboss_config, operation, fail_on_error=False ) @@ -129,7 +129,7 @@ def reload_(jboss_config, host=None): if host is None: operation = ":reload" else: - operation = '/host="{host}"/:reload'.format(host=host) + operation = f'/host="{host}"/:reload' reload_result = __salt__["jboss7_cli.run_operation"]( jboss_config, operation, fail_on_error=False ) @@ -194,7 +194,7 @@ def create_datasource(jboss_config, name, datasource_properties, profile=None): ), ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation return __salt__["jboss7_cli.run_operation"]( jboss_config, operation, fail_on_error=False @@ -213,7 +213,7 @@ def __get_properties_assignment_string(datasource_properties, ds_resource_descri def __get_single_assignment_string(key, val, ds_attributes): - return "{}={}".format(key, __format_value(key, val, ds_attributes)) + return f"{key}={__format_value(key, val, ds_attributes)}" def __format_value(key, value, ds_attributes): @@ -227,18 +227,14 @@ def __format_value(key, value, ds_attributes): else: return "false" else: - raise Exception( - "Don't know how to convert {} to BOOLEAN type".format(value) - ) + raise Exception(f"Don't know how to convert {value} to BOOLEAN type") elif type_ == "INT": return str(value) elif type_ == "STRING": - return '"{}"'.format(value) + return f'"{value}"' else: - raise Exception( - "Don't know how to format value {} of type {}".format(value, type_) - ) + raise Exception(f"Don't know how to format value {value} of type {type_}") def update_datasource(jboss_config, name, new_properties, profile=None): @@ -315,7 +311,7 @@ def __get_datasource_resource_description(jboss_config, name, profile=None): ) ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation operation_result = __salt__["jboss7_cli.run_operation"](jboss_config, operation) if operation_result["outcome"]: return operation_result["result"] @@ -381,7 +377,7 @@ def create_simple_binding(jboss_config, binding_name, value, profile=None): ) ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation return __salt__["jboss7_cli.run_operation"](jboss_config, operation) @@ -418,7 +414,7 @@ def update_simple_binding(jboss_config, binding_name, value, profile=None): ) ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation return __salt__["jboss7_cli.run_operation"](jboss_config, operation) @@ -452,7 +448,7 @@ def __read_simple_binding(jboss_config, binding_name, profile=None): binding_name=binding_name ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation return __salt__["jboss7_cli.run_operation"](jboss_config, operation) @@ -474,7 +470,7 @@ def __update_datasource_property( value=__format_value(name, value, ds_attributes), ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation return __salt__["jboss7_cli.run_operation"]( jboss_config, operation, fail_on_error=False @@ -487,7 +483,7 @@ def __read_datasource(jboss_config, name, profile=None): name=name ) if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation operation_result = __salt__["jboss7_cli.run_operation"](jboss_config, operation) @@ -524,9 +520,9 @@ def remove_datasource(jboss_config, name, profile=None): profile, ) - operation = "/subsystem=datasources/data-source={name}:remove".format(name=name) + operation = f"/subsystem=datasources/data-source={name}:remove" if profile is not None: - operation = '/profile="{profile}"'.format(profile=profile) + operation + operation = f'/profile="{profile}"' + operation return __salt__["jboss7_cli.run_operation"]( jboss_config, operation, fail_on_error=False @@ -552,7 +548,7 @@ def deploy(jboss_config, source_file): "======================== MODULE FUNCTION: jboss7.deploy, source_file=%s", source_file, ) - command = "deploy {source_file} --force ".format(source_file=source_file) + command = f"deploy {source_file} --force " return __salt__["jboss7_cli.run_command"]( jboss_config, command, fail_on_error=False ) @@ -600,5 +596,5 @@ def undeploy(jboss_config, deployment): "======================== MODULE FUNCTION: jboss7.undeploy, deployment=%s", deployment, ) - command = "undeploy {deployment} ".format(deployment=deployment) + command = f"undeploy {deployment} " return __salt__["jboss7_cli.run_command"](jboss_config, command) diff --git a/salt/modules/jboss7_cli.py b/salt/modules/jboss7_cli.py index 183d32998f2..bd0d7111e8e 100644 --- a/salt/modules/jboss7_cli.py +++ b/salt/modules/jboss7_cli.py @@ -158,7 +158,7 @@ def _call_cli(jboss_config, command, retries=1): command_segments.append('--user="{}"'.format(jboss_config["cli_user"])) if "cli_password" in jboss_config.keys(): command_segments.append('--password="{}"'.format(jboss_config["cli_password"])) - command_segments.append('--command="{}"'.format(__escape_command(command))) + command_segments.append(f'--command="{__escape_command(command)}"') cli_script = " ".join(command_segments) cli_command_result = __salt__["cmd.run_all"](cli_script) @@ -336,7 +336,7 @@ def __process_tokens_internal(tokens, start_at=0): log.debug(" TYPE: EXPRESSION") is_expression = True else: - raise CommandExecutionError("Unknown token! Token: {}".format(token)) + raise CommandExecutionError(f"Unknown token! Token: {token}") token_no = token_no + 1 diff --git a/salt/modules/jenkinsmod.py b/salt/modules/jenkinsmod.py index 46308a2062f..3d504d9f5c8 100644 --- a/salt/modules/jenkinsmod.py +++ b/salt/modules/jenkinsmod.py @@ -108,7 +108,7 @@ def _retrieve_config_xml(config_xml, saltenv): ret = __salt__["cp.cache_file"](config_xml, saltenv) if not ret: - raise CommandExecutionError("Failed to retrieve {}".format(config_xml)) + raise CommandExecutionError(f"Failed to retrieve {config_xml}") return ret @@ -219,7 +219,7 @@ def get_job_info(name=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist") job_info = server.get_job_info(name) if job_info: @@ -248,14 +248,12 @@ def build_job(name=None, parameters=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist.".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist.") try: server.build_job(name, parameters) except jenkins.JenkinsException as err: - raise CommandExecutionError( - "Encountered error building job '{}': {}".format(name, err) - ) + raise CommandExecutionError(f"Encountered error building job '{name}': {err}") return True @@ -281,7 +279,7 @@ def create_job(name=None, config_xml=None, saltenv="base"): raise SaltInvocationError("Required parameter 'name' is missing") if job_exists(name): - raise CommandExecutionError("Job '{}' already exists".format(name)) + raise CommandExecutionError(f"Job '{name}' already exists") if not config_xml: config_xml = jenkins.EMPTY_CONFIG_XML @@ -295,9 +293,7 @@ def create_job(name=None, config_xml=None, saltenv="base"): try: server.create_job(name, config_xml) except jenkins.JenkinsException as err: - raise CommandExecutionError( - "Encountered error creating job '{}': {}".format(name, err) - ) + raise CommandExecutionError(f"Encountered error creating job '{name}': {err}") return config_xml @@ -334,9 +330,7 @@ def update_job(name=None, config_xml=None, saltenv="base"): try: server.reconfig_job(name, config_xml) except jenkins.JenkinsException as err: - raise CommandExecutionError( - "Encountered error updating job '{}': {}".format(name, err) - ) + raise CommandExecutionError(f"Encountered error updating job '{name}': {err}") return config_xml @@ -360,14 +354,12 @@ def delete_job(name=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist") try: server.delete_job(name) except jenkins.JenkinsException as err: - raise CommandExecutionError( - "Encountered error deleting job '{}': {}".format(name, err) - ) + raise CommandExecutionError(f"Encountered error deleting job '{name}': {err}") return True @@ -391,14 +383,12 @@ def enable_job(name=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist") try: server.enable_job(name) except jenkins.JenkinsException as err: - raise CommandExecutionError( - "Encountered error enabling job '{}': {}".format(name, err) - ) + raise CommandExecutionError(f"Encountered error enabling job '{name}': {err}") return True @@ -423,14 +413,12 @@ def disable_job(name=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist") try: server.disable_job(name) except jenkins.JenkinsException as err: - raise CommandExecutionError( - "Encountered error disabling job '{}': {}".format(name, err) - ) + raise CommandExecutionError(f"Encountered error disabling job '{name}': {err}") return True @@ -455,7 +443,7 @@ def job_status(name=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist") return server.get_job_info("empty")["buildable"] @@ -481,7 +469,7 @@ def get_job_config(name=None): server = _connect() if not job_exists(name): - raise CommandExecutionError("Job '{}' does not exist".format(name)) + raise CommandExecutionError(f"Job '{name}' does not exist") job_info = server.get_job_config(name) return job_info diff --git a/salt/modules/junos.py b/salt/modules/junos.py index e2afa164f78..f368f28cd36 100644 --- a/salt/modules/junos.py +++ b/salt/modules/junos.py @@ -255,7 +255,7 @@ def facts_refresh(): try: conn.facts_refresh() except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Execution failed due to "{}"'.format(exception) + ret["message"] = f'Execution failed due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -286,7 +286,7 @@ def facts(): ret["facts"] = __proxy__["junos.get_serialized_facts"]() ret["out"] = True except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not display facts due to "{}"'.format(exception) + ret["message"] = f'Could not display facts due to "{exception}"' ret["out"] = False _restart_connection() @@ -362,7 +362,7 @@ def rpc(cmd=None, dest=None, **kwargs): try: filter_reply = etree.XML(op["filter"]) except etree.XMLSyntaxError as ex: - ret["message"] = "Invalid filter: {}".format(str(ex)) + ret["message"] = f"Invalid filter: {str(ex)}" ret["out"] = False return ret @@ -372,7 +372,7 @@ def rpc(cmd=None, dest=None, **kwargs): try: reply = getattr(conn.rpc, cmd.replace("-", "_"))(filter_reply, options=op) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'RPC execution failed due to "{}"'.format(exception) + ret["message"] = f'RPC execution failed due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -386,7 +386,7 @@ def rpc(cmd=None, dest=None, **kwargs): try: reply = getattr(conn.rpc, cmd.replace("-", "_"))({"format": format_}, **op) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'RPC execution failed due to "{}"'.format(exception) + ret["message"] = f'RPC execution failed due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -453,7 +453,7 @@ def set_hostname(hostname=None, **kwargs): # Added to recent versions of JunOs # Use text format instead - set_string = "set system host-name {}".format(hostname) + set_string = f"set system host-name {hostname}" try: conn.cu.load(set_string, format="set") except Exception as exception: # pylint: disable=broad-except @@ -467,7 +467,7 @@ def set_hostname(hostname=None, **kwargs): try: commit_ok = conn.cu.commit_check() except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not commit check due to error "{}"'.format(exception) + ret["message"] = f'Could not commit check due to error "{exception}"' ret["out"] = False _restart_connection() return ret @@ -560,7 +560,7 @@ def commit(**kwargs): try: commit_ok = conn.cu.commit_check() except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not perform commit check due to "{}"'.format(exception) + ret["message"] = f'Could not perform commit check due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -672,7 +672,7 @@ def rollback(**kwargs): try: ret["out"] = conn.cu.rollback(id_) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Rollback failed due to "{}"'.format(exception) + ret["message"] = f'Rollback failed due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -697,7 +697,7 @@ def rollback(**kwargs): try: commit_ok = conn.cu.commit_check() except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not commit check due to "{}"'.format(exception) + ret["message"] = f'Could not commit check due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -770,7 +770,7 @@ def diff(**kwargs): try: ret["message"] = conn.cu.diff(rb_id=id_) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not get diff with error "{}"'.format(exception) + ret["message"] = f'Could not get diff with error "{exception}"' ret["out"] = False _restart_connection() @@ -835,7 +835,7 @@ def ping(dest_ip=None, **kwargs): try: ret["message"] = jxmlease.parse(etree.tostring(conn.rpc.ping(**op))) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Execution failed due to "{}"'.format(exception) + ret["message"] = f'Execution failed due to "{exception}"' ret["out"] = False _restart_connection() @@ -892,7 +892,7 @@ def cli(command=None, **kwargs): try: result = conn.cli(command, format_, warning=False) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Execution failed due to "{}"'.format(exception) + ret["message"] = f'Execution failed due to "{exception}"' ret["out"] = False _restart_connection() return ret @@ -985,7 +985,7 @@ def shutdown(**kwargs): ret["message"] = "Successfully powered off/rebooted." ret["out"] = True except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not poweroff/reboot because "{}"'.format(exception) + ret["message"] = f'Could not poweroff/reboot because "{exception}"' ret["out"] = False _restart_connection() @@ -1154,7 +1154,7 @@ def install_config(path=None, **kwargs): cu.load(**op) except Exception as exception: # pylint: disable=broad-except ret["message"] = ( - 'Could not load configuration due to : "{}"'.format(exception) + f'Could not load configuration due to : "{exception}"' ) ret["format"] = op["format"] ret["out"] = False @@ -1249,12 +1249,12 @@ def install_config(path=None, **kwargs): fp.write(salt.utils.stringutils.to_str(config_diff)) except Exception as exception: # pylint: disable=broad-except ret["message"] = ( - "Could not write into diffs_file due to: '{}'".format(exception) + f"Could not write into diffs_file due to: '{exception}'" ) ret["out"] = False except ValueError as ex: - message = "install_config failed due to: {}".format(str(ex)) + message = f"install_config failed due to: {str(ex)}" log.error(message) ret["message"] = message ret["out"] = False @@ -1263,12 +1263,12 @@ def install_config(path=None, **kwargs): ret["message"] = ex.message ret["out"] = False except RpcTimeoutError as ex: - message = "install_config failed due to timeout error : {}".format(str(ex)) + message = f"install_config failed due to timeout error : {str(ex)}" log.error(message) ret["message"] = message ret["out"] = False except Exception as exc: # pylint: disable=broad-except - ret["message"] = "install_config failed due to exception: '{}'".format(exc) + ret["message"] = f"install_config failed due to exception: '{exc}'" ret["out"] = False return ret @@ -1299,7 +1299,7 @@ def zeroize(): conn.cli("request system zeroize") ret["message"] = "Completed zeroize and rebooted" except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not zeroize due to : "{}"'.format(exception) + ret["message"] = f'Could not zeroize due to : "{exception}"' ret["out"] = False _restart_connection() @@ -1429,7 +1429,7 @@ def install_os(path=None, **kwargs): image_path, progress=True, timeout=timeout, **op ) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Installation failed due to: "{}"'.format(exception) + ret["message"] = f'Installation failed due to: "{exception}"' ret["out"] = False __proxy__["junos.reboot_clear"]() _restart_connection() @@ -1440,7 +1440,7 @@ def install_os(path=None, **kwargs): path, progress=True, timeout=timeout, **op ) except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Installation failed due to: "{}"'.format(exception) + ret["message"] = f'Installation failed due to: "{exception}"' ret["out"] = False __proxy__["junos.reboot_clear"]() _restart_connection() @@ -1450,7 +1450,7 @@ def install_os(path=None, **kwargs): ret["out"] = True ret["message"] = "Installed the os." else: - ret["message"] = "Installation failed. Reason: {}".format(install_message) + ret["message"] = f"Installation failed. Reason: {install_message}" ret["out"] = False __proxy__["junos.reboot_clear"]() return ret @@ -1517,16 +1517,16 @@ def file_copy(src, dest): with HandleFileCopy(src) as fp: if fp is None: - ret["message"] = "Invalid source file path {}".format(src) + ret["message"] = f"Invalid source file path {src}" ret["out"] = False return ret try: with SCP(conn, progress=True) as scp: scp.put(fp, dest) - ret["message"] = "Successfully copied file from {} to {}".format(src, dest) + ret["message"] = f"Successfully copied file from {src} to {dest}" except Exception as exception: # pylint: disable=broad-except - ret["message"] = 'Could not copy file : "{}"'.format(exception) + ret["message"] = f'Could not copy file : "{exception}"' ret["out"] = False return ret @@ -1557,12 +1557,12 @@ def lock(): conn.cu.lock() ret["message"] = "Successfully locked the configuration." except RpcTimeoutError as exception: - ret["message"] = 'Could not gain lock due to : "{}"'.format(exception) + ret["message"] = f'Could not gain lock due to : "{exception}"' ret["out"] = False _restart_connection() except LockError as exception: - ret["message"] = 'Could not gain lock due to : "{}"'.format(exception) + ret["message"] = f'Could not gain lock due to : "{exception}"' ret["out"] = False return ret @@ -1767,7 +1767,7 @@ def commit_check(): conn.cu.commit_check() ret["message"] = "Commit check succeeded." except Exception as exception: # pylint: disable=broad-except - ret["message"] = "Commit check failed with {}".format(exception) + ret["message"] = f"Commit check failed with {exception}" ret["out"] = False _restart_connection() @@ -1844,9 +1844,9 @@ def get_table( pyez_tables_path = os.path.dirname(os.path.abspath(tables_dir.__file__)) try: if path is not None: - file_path = os.path.join(path, "{}".format(table_file)) + file_path = os.path.join(path, f"{table_file}") else: - file_path = os.path.join(pyez_tables_path, "{}".format(table_file)) + file_path = os.path.join(pyez_tables_path, f"{table_file}") with HandleFileCopy(file_path) as file_loc: if file_loc is None: @@ -1923,7 +1923,7 @@ def get_table( _restart_connection() return ret except Exception as err: # pylint: disable=broad-except - ret["message"] = "Uncaught exception - please report: {}".format(str(err)) + ret["message"] = f"Uncaught exception - please report: {str(err)}" ret["out"] = False _restart_connection() return ret @@ -2091,9 +2091,7 @@ def file_compare(file1, file2, **kwargs): # pragma: no cover if not junos_cli: return {"success": False, "message": "Cannot find Junos cli command"} - cliret = __salt__["cmd.run"]( - "{} file compare files {} {} ".format(junos_cli, file1, file2) - ) + cliret = __salt__["cmd.run"](f"{junos_cli} file compare files {file1} {file2} ") clilines = cliret.splitlines() for r in clilines: @@ -2147,7 +2145,7 @@ def fsentry_exists(dir, **kwargs): # pragma: no cover if not junos_cli: return {"success": False, "message": "Cannot find Junos cli command"} - ret = __salt__["cmd.run"]("{} file show {}".format(junos_cli, dir)) + ret = __salt__["cmd.run"](f"{junos_cli} file show {dir}") retlines = ret.splitlines() exists = True is_dir = False @@ -2168,7 +2166,7 @@ def _find_routing_engines(): if not junos_cli: return {"success": False, "message": "Cannot find Junos cli command"} - re_check = __salt__["cmd.run"]("{} show chassis routing-engine".format(junos_cli)) + re_check = __salt__["cmd.run"](f"{junos_cli} show chassis routing-engine") engine_present = True engine = {} @@ -2336,9 +2334,7 @@ def dir_copy(source, dest, force=False, **kwargs): # pragma: no cover target = dest + d status = fsentry_exists(target) if not status["exists"]: - ret = __salt__["cmd.run"]( - "{} file make-directory {}".format(junos_cli, target) - ) + ret = __salt__["cmd.run"](f"{junos_cli} file make-directory {target}") ret = ret_messages + ret else: ret_messages = ret_messages + "Directory " + target + " already exists.\n" @@ -2348,14 +2344,12 @@ def dir_copy(source, dest, force=False, **kwargs): # pragma: no cover comp_result = file_compare(f, target) if not comp_result["identical"] or force: - ret = __salt__["cmd.run"]( - "{} file copy {} {}".format(junos_cli, f, target) - ) + ret = __salt__["cmd.run"](f"{junos_cli} file copy {f} {target}") ret = ret_messages + ret else: ret_messages = ( ret_messages - + "Files {} and {} are identical, not copying.\n".format(f, target) + + f"Files {f} and {target} are identical, not copying.\n" ) return ret_messages diff --git a/salt/modules/k8s.py b/salt/modules/k8s.py index c62d1c79ebc..026cf6e1395 100644 --- a/salt/modules/k8s.py +++ b/salt/modules/k8s.py @@ -174,14 +174,14 @@ def _guess_node_id(node): def _get_labels(node, apiserver_url): """Get all labels from a kube node.""" # Prepare URL - url = "{}/api/v1/nodes/{}".format(apiserver_url, node) + url = f"{apiserver_url}/api/v1/nodes/{node}" # Make request ret = http.query(url) # Check requests status if "body" in ret: ret = salt.utils.json.loads(ret.get("body")) elif ret.get("status", 0) == 404: - return "Node {} doesn't exist".format(node) + return f"Node {node} doesn't exist" else: return ret # Get and return labels @@ -191,13 +191,13 @@ def _get_labels(node, apiserver_url): def _set_labels(node, apiserver_url, labels): """Replace labels dict by a new one""" # Prepare URL - url = "{}/api/v1/nodes/{}".format(apiserver_url, node) + url = f"{apiserver_url}/api/v1/nodes/{node}" # Prepare data data = [{"op": "replace", "path": "/metadata/labels", "value": labels}] # Make request ret = _kpatch(url, data) if ret.get("status") == 404: - return "Node {} doesn't exist".format(node) + return f"Node {node} doesn't exist" return ret @@ -264,9 +264,9 @@ def label_present(name, value, node=None, apiserver_url=None): # there is an update during operation, need to retry log.debug("Got 409, will try later") ret["changes"] = {} - ret["comment"] = "Could not create label {}, please retry".format(name) + ret["comment"] = f"Could not create label {name}, please retry" else: - ret["comment"] = "Label {} created".format(name) + ret["comment"] = f"Label {name} created" elif labels.get(name) != str(value): # This is a old label and we are going to edit it ret["changes"] = {name: str(value)} @@ -276,12 +276,12 @@ def label_present(name, value, node=None, apiserver_url=None): # there is an update during operation, need to retry log.debug("Got 409, will try later") ret["changes"] = {} - ret["comment"] = "Could not update label {}, please retry".format(name) + ret["comment"] = f"Could not update label {name}, please retry" else: - ret["comment"] = "Label {} updated".format(name) + ret["comment"] = f"Label {name} updated" else: # This is a old label and it has already the wanted value - ret["comment"] = "Label {} already set".format(name) + ret["comment"] = f"Label {name} already set" return ret @@ -316,7 +316,7 @@ def label_absent(name, node=None, apiserver_url=None): # Compare old labels and what we want if labels == old_labels: # Label already absent - ret["comment"] = "Label {} already absent".format(name) + ret["comment"] = f"Label {name} already absent" else: # Label needs to be delete res = _set_labels(node, apiserver_url, labels) @@ -324,10 +324,10 @@ def label_absent(name, node=None, apiserver_url=None): # there is an update during operation, need to retry log.debug("Got 409, will try later") ret["changes"] = {} - ret["comment"] = "Could not delete label {}, please retry".format(name) + ret["comment"] = f"Could not delete label {name}, please retry" else: ret["changes"] = {"deleted": name} - ret["comment"] = "Label {} absent".format(name) + ret["comment"] = f"Label {name} absent" return ret @@ -365,7 +365,7 @@ def label_folder_absent(name, node=None, apiserver_url=None): # Prepare a temp labels dict if labels == old_labels: # Label already absent - ret["comment"] = "Label folder {} already absent".format(folder) + ret["comment"] = f"Label folder {folder} already absent" else: # Label needs to be delete res = _set_labels(node, apiserver_url, labels) @@ -377,7 +377,7 @@ def label_folder_absent(name, node=None, apiserver_url=None): ) else: ret["changes"] = {"deleted": folder} - ret["comment"] = "Label folder {} absent".format(folder) + ret["comment"] = f"Label folder {folder} absent" return ret @@ -386,7 +386,7 @@ def label_folder_absent(name, node=None, apiserver_url=None): def _get_namespaces(apiserver_url, name=""): """Get namespace is namespace is defined otherwise return all namespaces""" # Prepare URL - url = "{}/api/v1/namespaces/{}".format(apiserver_url, name) + url = f"{apiserver_url}/api/v1/namespaces/{name}" # Make request ret = http.query(url) if ret.get("body"): @@ -398,7 +398,7 @@ def _get_namespaces(apiserver_url, name=""): def _create_namespace(namespace, apiserver_url): """create namespace on the defined k8s cluster""" # Prepare URL - url = "{}/api/v1/namespaces".format(apiserver_url) + url = f"{apiserver_url}/api/v1/namespaces" # Prepare data data = {"kind": "Namespace", "apiVersion": "v1", "metadata": {"name": namespace}} log.trace("namespace creation requests: %s", data) @@ -438,9 +438,9 @@ def create_namespace(name, apiserver_url=None): # This is a new namespace _create_namespace(name, apiserver_url) ret["changes"] = name - ret["comment"] = "Namespace {} created".format(name) + ret["comment"] = f"Namespace {name} created" else: - ret["comment"] = "Namespace {} already present".format(name) + ret["comment"] = f"Namespace {name} already present" return ret @@ -484,7 +484,7 @@ def get_namespaces(namespace="", apiserver_url=None): def _get_secrets(namespace, name, apiserver_url): """Get secrets of the namespace.""" # Prepare URL - url = "{}/api/v1/namespaces/{}/secrets/{}".format(apiserver_url, namespace, name) + url = f"{apiserver_url}/api/v1/namespaces/{namespace}/secrets/{name}" # Make request ret = http.query(url) if ret.get("body"): @@ -496,20 +496,20 @@ def _get_secrets(namespace, name, apiserver_url): def _update_secret(namespace, name, data, apiserver_url): """Replace secrets data by a new one""" # Prepare URL - url = "{}/api/v1/namespaces/{}/secrets/{}".format(apiserver_url, namespace, name) + url = f"{apiserver_url}/api/v1/namespaces/{namespace}/secrets/{name}" # Prepare data data = [{"op": "replace", "path": "/data", "value": data}] # Make request ret = _kpatch(url, data) if ret.get("status") == 404: - return "Node {} doesn't exist".format(url) + return f"Node {url} doesn't exist" return ret def _create_secret(namespace, name, data, apiserver_url): """create namespace on the defined k8s cluster""" # Prepare URL - url = "{}/api/v1/namespaces/{}/secrets".format(apiserver_url, namespace) + url = f"{apiserver_url}/api/v1/namespaces/{namespace}/secrets" # Prepare data request = { "apiVersion": "v1", @@ -738,7 +738,7 @@ def create_secret( return { "name": name, "result": False, - "comment": "Secret {} is already present".format(name), + "comment": f"Secret {name} is already present", "changes": {}, } @@ -755,7 +755,7 @@ def create_secret( if sname == encoded == "": ret[ "comment" - ] += "Source file {} is missing or name is incorrect\n".format(v) + ] += f"Source file {v} is missing or name is incorrect\n" if force: continue else: @@ -825,8 +825,8 @@ def delete_secret(namespace, name, apiserver_url=None, force=True): "changes": {}, } - url = "{}/api/v1/namespaces/{}/secrets/{}".format(apiserver_url, namespace, name) + url = f"{apiserver_url}/api/v1/namespaces/{namespace}/secrets/{name}" res = http.query(url, method="DELETE") if res.get("body"): - ret["comment"] = "Removed secret {} in {} namespace".format(name, namespace) + ret["comment"] = f"Removed secret {name} in {namespace} namespace" return ret diff --git a/salt/modules/kapacitor.py b/salt/modules/kapacitor.py index f3a47267a71..3cd8ff2ce9a 100644 --- a/salt/modules/kapacitor.py +++ b/salt/modules/kapacitor.py @@ -61,7 +61,7 @@ def _get_url(): host = __salt__["config.option"]("kapacitor.host", "localhost") port = __salt__["config.option"]("kapacitor.port", 9092) - return "{}://{}:{}".format(protocol, host, port) + return f"{protocol}://{host}:{port}" def get_task(name): @@ -80,9 +80,9 @@ def get_task(name): url = _get_url() if version() < "0.13": - task_url = "{}/task?name={}".format(url, name) + task_url = f"{url}/task?name={name}" else: - task_url = "{}/kapacitor/v1/tasks/{}?skip-format=true".format(url, name) + task_url = f"{url}/kapacitor/v1/tasks/{name}?skip-format=true" response = salt.utils.http.query(task_url, status=True) @@ -173,28 +173,28 @@ def define_task( return False if version() < "0.13": - cmd = "kapacitor define -name {}".format(name) + cmd = f"kapacitor define -name {name}" else: - cmd = "kapacitor define {}".format(name) + cmd = f"kapacitor define {name}" if tick_script.startswith("salt://"): tick_script = __salt__["cp.cache_file"](tick_script, __env__) - cmd += " -tick {}".format(tick_script) + cmd += f" -tick {tick_script}" if task_type: - cmd += " -type {}".format(task_type) + cmd += f" -type {task_type}" if not dbrps: dbrps = [] if database and retention_policy: - dbrp = "{}.{}".format(database, retention_policy) + dbrp = f"{database}.{retention_policy}" dbrps.append(dbrp) if dbrps: for dbrp in dbrps: - cmd += " -dbrp {}".format(dbrp) + cmd += f" -dbrp {dbrp}" return _run_cmd(cmd) @@ -212,7 +212,7 @@ def delete_task(name): salt '*' kapacitor.delete_task cpu """ - return _run_cmd("kapacitor delete tasks {}".format(name)) + return _run_cmd(f"kapacitor delete tasks {name}") def enable_task(name): @@ -228,7 +228,7 @@ def enable_task(name): salt '*' kapacitor.enable_task cpu """ - return _run_cmd("kapacitor enable {}".format(name)) + return _run_cmd(f"kapacitor enable {name}") def disable_task(name): @@ -244,4 +244,4 @@ def disable_task(name): salt '*' kapacitor.disable_task cpu """ - return _run_cmd("kapacitor disable {}".format(name)) + return _run_cmd(f"kapacitor disable {name}") diff --git a/salt/modules/kerberos.py b/salt/modules/kerberos.py index 30b0a356df0..e452b53b4b3 100644 --- a/salt/modules/kerberos.py +++ b/salt/modules/kerberos.py @@ -44,7 +44,7 @@ def __execute_kadmin(cmd): if __salt__["file.file_exists"](auth_keytab) and auth_principal: return __salt__["cmd.run_all"]( - 'kadmin -k -t {} -p {} -q "{}"'.format(auth_keytab, auth_principal, cmd) + f'kadmin -k -t {auth_keytab} -p {auth_principal} -q "{cmd}"' ) else: log.error("Unable to find kerberos keytab/principal") @@ -94,7 +94,7 @@ def get_principal(name): """ ret = {} - cmd = __execute_kadmin("get_principal {}".format(name)) + cmd = __execute_kadmin(f"get_principal {name}") if cmd["retcode"] != 0 or cmd["stderr"]: ret["comment"] = cmd["stderr"].splitlines()[-1] @@ -150,7 +150,7 @@ def get_policy(name): """ ret = {} - cmd = __execute_kadmin("get_policy {}".format(name)) + cmd = __execute_kadmin(f"get_policy {name}") if cmd["retcode"] != 0 or cmd["stderr"]: ret["comment"] = cmd["stderr"].splitlines()[-1] @@ -209,9 +209,9 @@ def create_principal(name, enctypes=None): krb_cmd = "addprinc -randkey" if enctypes: - krb_cmd += " -e {}".format(enctypes) + krb_cmd += f" -e {enctypes}" - krb_cmd += " {}".format(name) + krb_cmd += f" {name}" cmd = __execute_kadmin(krb_cmd) @@ -237,7 +237,7 @@ def delete_principal(name): """ ret = {} - cmd = __execute_kadmin("delprinc -force {}".format(name)) + cmd = __execute_kadmin(f"delprinc -force {name}") if cmd["retcode"] != 0 or cmd["stderr"]: ret["comment"] = cmd["stderr"].splitlines()[-1] @@ -260,12 +260,12 @@ def create_keytab(name, keytab, enctypes=None): """ ret = {} - krb_cmd = "ktadd -k {}".format(keytab) + krb_cmd = f"ktadd -k {keytab}" if enctypes: - krb_cmd += " -e {}".format(enctypes) + krb_cmd += f" -e {enctypes}" - krb_cmd += " {}".format(name) + krb_cmd += f" {name}" cmd = __execute_kadmin(krb_cmd) diff --git a/salt/modules/kernelpkg_linux_apt.py b/salt/modules/kernelpkg_linux_apt.py index fc8684d03fa..33cef3eaaa5 100644 --- a/salt/modules/kernelpkg_linux_apt.py +++ b/salt/modules/kernelpkg_linux_apt.py @@ -53,7 +53,7 @@ def list_installed(): salt '*' kernelpkg.list_installed """ - pkg_re = re.compile(r"^{}-[\d.-]+-{}$".format(_package_prefix(), _kernel_type())) + pkg_re = re.compile(rf"^{_package_prefix()}-[\d.-]+-{_kernel_type()}$") pkgs = __salt__["pkg.list_pkgs"](versions_as_list=True) if pkgs is None: pkgs = [] @@ -79,14 +79,12 @@ def latest_available(): salt '*' kernelpkg.latest_available """ - result = __salt__["pkg.latest_version"]( - "{}-{}".format(_package_prefix(), _kernel_type()) - ) + result = __salt__["pkg.latest_version"](f"{_package_prefix()}-{_kernel_type()}") if result == "": return latest_installed() version = re.match(r"^(\d+\.\d+\.\d+)\.(\d+)", result) - return "{}-{}-{}".format(version.group(1), version.group(2), _kernel_type()) + return f"{version.group(1)}-{version.group(2)}-{_kernel_type()}" def latest_installed(): @@ -152,9 +150,7 @@ def upgrade(reboot=False, at_time=None): chance to return, resulting in errors. A minimal delay (1 minute) is useful to ensure the result is delivered to the master. """ - result = __salt__["pkg.install"]( - name="{}-{}".format(_package_prefix(), latest_available()) - ) + result = __salt__["pkg.install"](name=f"{_package_prefix()}-{latest_available()}") _needs_reboot = needs_reboot() ret = { @@ -202,14 +198,12 @@ def remove(release): salt '*' kernelpkg.remove 4.4.0-70-generic """ if release not in list_installed(): - raise CommandExecutionError( - "Kernel release '{}' is not installed".format(release) - ) + raise CommandExecutionError(f"Kernel release '{release}' is not installed") if release == active(): raise CommandExecutionError("Active kernel cannot be removed") - target = "{}-{}".format(_package_prefix(), release) + target = f"{_package_prefix()}-{release}" log.info("Removing kernel package %s", target) __salt__["pkg.purge"](target) diff --git a/salt/modules/kernelpkg_linux_yum.py b/salt/modules/kernelpkg_linux_yum.py index a144a98811d..c37f8729174 100644 --- a/salt/modules/kernelpkg_linux_yum.py +++ b/salt/modules/kernelpkg_linux_yum.py @@ -199,14 +199,12 @@ def remove(release): salt '*' kernelpkg.remove 3.10.0-327.el7 """ if release not in list_installed(): - raise CommandExecutionError( - "Kernel release '{}' is not installed".format(release) - ) + raise CommandExecutionError(f"Kernel release '{release}' is not installed") if release == active(): raise CommandExecutionError("Active kernel cannot be removed") - target = "{}-{}".format(_package_name(), release) + target = f"{_package_name()}-{release}" log.info("Removing kernel package %s", target) old = __salt__["pkg.list_pkgs"]() diff --git a/salt/modules/keyboard.py b/salt/modules/keyboard.py index ed26c7362d2..7c15246ea95 100644 --- a/salt/modules/keyboard.py +++ b/salt/modules/keyboard.py @@ -63,19 +63,17 @@ def set_sys(layout): salt '*' keyboard.set_sys dvorak """ if salt.utils.path.which("localectl"): - __salt__["cmd.run"]("localectl set-keymap {}".format(layout)) + __salt__["cmd.run"](f"localectl set-keymap {layout}") elif "RedHat" in __grains__["os_family"]: __salt__["file.sed"]( - "/etc/sysconfig/keyboard", "^LAYOUT=.*", "LAYOUT={}".format(layout) + "/etc/sysconfig/keyboard", "^LAYOUT=.*", f"LAYOUT={layout}" ) elif "Debian" in __grains__["os_family"]: __salt__["file.sed"]( - "/etc/default/keyboard", "^XKBLAYOUT=.*", "XKBLAYOUT={}".format(layout) + "/etc/default/keyboard", "^XKBLAYOUT=.*", f"XKBLAYOUT={layout}" ) elif "Gentoo" in __grains__["os_family"]: - __salt__["file.sed"]( - "/etc/conf.d/keymaps", "^keymap=.*", "keymap={}".format(layout) - ) + __salt__["file.sed"]("/etc/conf.d/keymaps", "^keymap=.*", f"keymap={layout}") return layout @@ -104,6 +102,6 @@ def set_x(layout): salt '*' keyboard.set_x dvorak """ - cmd = "setxkbmap {}".format(layout) + cmd = f"setxkbmap {layout}" __salt__["cmd.run"](cmd) return layout diff --git a/salt/modules/keystone.py b/salt/modules/keystone.py index 9ca44b14337..898180b0c33 100644 --- a/salt/modules/keystone.py +++ b/salt/modules/keystone.py @@ -201,7 +201,7 @@ def ec2_credentials_create( tenant_id=None, tenant=None, profile=None, - **connection_args + **connection_args, ): """ Create EC2-compatible credentials for user per tenant @@ -262,7 +262,7 @@ def ec2_credentials_delete( if not user_id: return {"Error": "Could not resolve User ID"} kstone.ec2.delete(user_id, access_key) - return 'ec2 key "{}" deleted under user id "{}"'.format(access_key, user_id) + return f'ec2 key "{access_key}" deleted under user id "{user_id}"' def ec2_credentials_get( @@ -410,7 +410,7 @@ def endpoint_create( profile=None, url=None, interface=None, - **connection_args + **connection_args, ): """ Create an endpoint for an Openstack service @@ -483,7 +483,7 @@ def role_create(name, profile=None, **connection_args): kstone = auth(profile, **connection_args) if "Error" not in role_get(name=name, profile=profile, **connection_args): - return {"Error": 'Role "{}" already exists'.format(name)} + return {"Error": f'Role "{name}" already exists'} kstone.roles.create(name) return role_get(name=name, profile=profile, **connection_args) @@ -513,9 +513,9 @@ def role_delete(role_id=None, name=None, profile=None, **connection_args): role = kstone.roles.get(role_id) kstone.roles.delete(role) - ret = "Role ID {} deleted".format(role_id) + ret = f"Role ID {role_id} deleted" if name: - ret += " ({})".format(name) + ret += f" ({name})" return ret @@ -603,7 +603,7 @@ def service_delete(service_id=None, name=None, profile=None, **connection_args): "id" ] kstone.services.delete(service_id) - return 'Keystone service ID "{}" deleted'.format(service_id) + return f'Keystone service ID "{service_id}" deleted' def service_get(service_id=None, name=None, profile=None, **connection_args): @@ -736,10 +736,10 @@ def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args): if not tenant_id: return {"Error": "Unable to resolve tenant id"} getattr(kstone, _TENANTS, None).delete(tenant_id) - ret = "Tenant ID {} deleted".format(tenant_id) + ret = f"Tenant ID {tenant_id} deleted" if name: - ret += " ({})".format(name) + ret += f" ({name})" return ret @@ -898,7 +898,7 @@ def tenant_update( description=None, enabled=None, profile=None, - **connection_args + **connection_args, ): """ Update a tenant's information (keystone tenant-update) @@ -947,7 +947,7 @@ def project_update( description=None, enabled=None, profile=None, - **connection_args + **connection_args, ): """ Update a tenant's information (keystone project-update) @@ -990,7 +990,7 @@ def project_update( description=description, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) else: return False @@ -1065,7 +1065,7 @@ def user_get(user_id=None, name=None, profile=None, **connection_args): try: user = kstone.users.get(user_id) except keystoneclient.exceptions.NotFound: - msg = "Could not find user '{}'".format(user_id) + msg = f"Could not find user '{user_id}'" log.error(msg) return {"Error": msg} @@ -1091,7 +1091,7 @@ def user_create( profile=None, project_id=None, description=None, - **connection_args + **connection_args, ): """ Create a user (keystone user-create) @@ -1148,10 +1148,10 @@ def user_delete(user_id=None, name=None, profile=None, **connection_args): if not user_id: return {"Error": "Unable to resolve user id"} kstone.users.delete(user_id) - ret = "User ID {} deleted".format(user_id) + ret = f"User ID {user_id} deleted" if name: - ret += " ({})".format(name) + ret += f" ({name})" return ret @@ -1164,7 +1164,7 @@ def user_update( profile=None, project=None, description=None, - **connection_args + **connection_args, ): """ Update a user's information (keystone user-update) @@ -1230,7 +1230,7 @@ def user_update( if tenant_id: kstone.users.update_tenant(user_id, tenant_id) - ret = "Info updated for user ID {}".format(user_id) + ret = f"Info updated for user ID {user_id}" return ret @@ -1308,9 +1308,9 @@ def user_password_update( kstone.users.update(user=user_id, password=password) else: kstone.users.update_password(user=user_id, password=password) - ret = "Password updated for user ID {}".format(user_id) + ret = f"Password updated for user ID {user_id}" if name: - ret += " ({})".format(name) + ret += f" ({name})" return ret @@ -1324,7 +1324,7 @@ def user_role_add( profile=None, project_id=None, project_name=None, - **connection_args + **connection_args, ): """ Add role for user in tenant (keystone user-role-add) @@ -1395,7 +1395,7 @@ def user_role_remove( profile=None, project_id=None, project_name=None, - **connection_args + **connection_args, ): """ Remove role for user in tenant (keystone user-role-remove) @@ -1462,7 +1462,7 @@ def user_role_list( profile=None, project_id=None, project_name=None, - **connection_args + **connection_args, ): """ Return a list of available user_roles (keystone user-roles-list) diff --git a/salt/modules/keystoneng.py b/salt/modules/keystoneng.py index 1bec255d60e..9a4ea9a8b19 100644 --- a/salt/modules/keystoneng.py +++ b/salt/modules/keystoneng.py @@ -68,7 +68,7 @@ def get_entity(ent_type, **kwargs): Attempt to query Keystone for more information about an entity """ try: - func = "keystoneng.{}_get".format(ent_type) + func = f"keystoneng.{ent_type}_get" ent = __salt__[func](**kwargs) except OpenStackCloudException as e: # NOTE(SamYaple): If this error was something other than Forbidden we diff --git a/salt/modules/keystore.py b/salt/modules/keystore.py index 6a4b7b90bf2..4dc0fdfc65e 100644 --- a/salt/modules/keystore.py +++ b/salt/modules/keystore.py @@ -161,9 +161,7 @@ def add(name, keystore, passphrase, certificate, private_key=None): try: cert_string = __salt__["x509.get_pem_entry"](certificate) except SaltInvocationError: - raise SaltInvocationError( - "Invalid certificate file or string: {}".format(certificate) - ) + raise SaltInvocationError(f"Invalid certificate file or string: {certificate}") if private_key: # Accept PEM input format, but convert to DES for loading into new keystore diff --git a/salt/modules/kmod.py b/salt/modules/kmod.py index 108bc6cad82..997c25fc868 100644 --- a/salt/modules/kmod.py +++ b/salt/modules/kmod.py @@ -83,9 +83,7 @@ def _set_persistent_module(mod): return set() escape_mod = re.escape(mod) # If module is commented only uncomment it - if __salt__["file.search"]( - conf, "^#[\t ]*{}[\t ]*$".format(escape_mod), multiline=True - ): + if __salt__["file.search"](conf, f"^#[\t ]*{escape_mod}[\t ]*$", multiline=True): __salt__["file.uncomment"](conf, escape_mod) else: __salt__["file.append"](conf, mod) @@ -103,9 +101,9 @@ def _remove_persistent_module(mod, comment): return set() escape_mod = re.escape(mod) if comment: - __salt__["file.comment"](conf, "^[\t ]*{}[\t ]?".format(escape_mod)) + __salt__["file.comment"](conf, f"^[\t ]*{escape_mod}[\t ]?") else: - __salt__["file.sed"](conf, "^[\t ]*{}[\t ]?".format(escape_mod), "") + __salt__["file.sed"](conf, f"^[\t ]*{escape_mod}[\t ]?", "") return {mod_name} @@ -115,7 +113,7 @@ def _which(cmd): """ _cmd = salt.utils.path.which(cmd) if not _cmd: - raise CommandExecutionError("Command '{}' cannot be found".format(cmd)) + raise CommandExecutionError(f"Command '{cmd}' cannot be found") return _cmd diff --git a/salt/modules/kubeadm.py b/salt/modules/kubeadm.py index 7ffd59be831..5e339794933 100644 --- a/salt/modules/kubeadm.py +++ b/salt/modules/kubeadm.py @@ -139,7 +139,7 @@ def version(kubeconfig=None, rootfs=None): parameters = [("kubeconfig", kubeconfig), ("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) cmd.extend(["--output", "json"]) @@ -226,9 +226,9 @@ def token_create( for parameter, value in parameters: if value: if parameter in ("groups", "usages"): - cmd.extend(["--{}".format(parameter), json.dumps(value)]) + cmd.extend([f"--{parameter}", json.dumps(value)]) else: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -264,7 +264,7 @@ def token_delete(token, kubeconfig=None, rootfs=None): parameters = [("kubeconfig", kubeconfig), ("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return bool(_cmd(cmd)) @@ -295,7 +295,7 @@ def token_generate(kubeconfig=None, rootfs=None): parameters = [("kubeconfig", kubeconfig), ("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -325,7 +325,7 @@ def token_list(kubeconfig=None, rootfs=None): parameters = [("kubeconfig", kubeconfig), ("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) lines = _cmd(cmd).splitlines() @@ -368,7 +368,7 @@ def alpha_certs_renew(rootfs=None): parameters = [("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -430,7 +430,7 @@ def alpha_kubeconfig_user( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -469,7 +469,7 @@ def alpha_kubelet_config_download(kubeconfig=None, kubelet_version=None, rootfs= ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -520,7 +520,7 @@ def alpha_kubelet_config_enable_dynamic( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -574,7 +574,7 @@ def alpha_selfhosting_pivot( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -627,7 +627,7 @@ def config_images_list( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd).splitlines() @@ -685,7 +685,7 @@ def config_images_pull( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) prefix = "[config/images] Pulled " return [(line.replace(prefix, "")) for line in _cmd(cmd).splitlines()] @@ -729,7 +729,7 @@ def config_migrate(old_config, new_config=None, kubeconfig=None, rootfs=None): ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -769,7 +769,7 @@ def config_print_init_defaults(component_configs=None, kubeconfig=None, rootfs=N ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -809,7 +809,7 @@ def config_print_join_defaults(component_configs=None, kubeconfig=None, rootfs=N ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -843,7 +843,7 @@ def config_upload_from_file(config, kubeconfig=None, rootfs=None): parameters = [("kubeconfig", kubeconfig), ("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -940,7 +940,7 @@ def config_upload_from_flags( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -970,7 +970,7 @@ def config_view(kubeconfig=None, rootfs=None): parameters = [("kubeconfig", kubeconfig), ("rootfs", rootfs)] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -1132,7 +1132,7 @@ def init( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -1297,7 +1297,7 @@ def join( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) @@ -1364,7 +1364,7 @@ def reset( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) return _cmd(cmd) diff --git a/salt/modules/kubernetesmod.py b/salt/modules/kubernetesmod.py index d66120925d5..11e2ed8958c 100644 --- a/salt/modules/kubernetesmod.py +++ b/salt/modules/kubernetesmod.py @@ -1099,7 +1099,7 @@ def create_secret( source=None, template=None, saltenv="base", - **kwargs + **kwargs, ): """ Creates the kubernetes secret as defined by the user. @@ -1274,7 +1274,7 @@ def replace_service( old_service, saltenv, namespace="default", - **kwargs + **kwargs, ): """ Replaces an existing service with a new one defined by name and namespace, @@ -1324,7 +1324,7 @@ def replace_secret( template=None, saltenv="base", namespace="default", - **kwargs + **kwargs, ): """ Replaces an existing secret with a new one defined by name and namespace, @@ -1379,7 +1379,7 @@ def replace_configmap( template=None, saltenv="base", namespace="default", - **kwargs + **kwargs, ): """ Replaces an existing configmap with a new one defined by name and @@ -1446,7 +1446,7 @@ def __create_object_body( or src_obj["kind"] != kind ): raise CommandExecutionError( - "The source file should define only a {} object".format(kind) + f"The source file should define only a {kind} object" ) if "metadata" in src_obj: @@ -1467,7 +1467,7 @@ def __read_and_render_yaml_file(source, template, saltenv): """ sfn = __salt__["cp.cache_file"](source, saltenv) if not sfn: - raise CommandExecutionError("Source file '{}' not found".format(source)) + raise CommandExecutionError(f"Source file '{source}' not found") with salt.utils.files.fopen(sfn, "r") as src: contents = src.read() @@ -1496,9 +1496,7 @@ def __read_and_render_yaml_file(source, template, saltenv): contents = data["data"].encode("utf-8") else: - raise CommandExecutionError( - "Unknown template specified: {}".format(template) - ) + raise CommandExecutionError(f"Unknown template specified: {template}") return salt.utils.yaml.safe_load(contents) diff --git a/salt/modules/launchctl_service.py b/salt/modules/launchctl_service.py index b1d2ec5a639..65bc04aeb99 100644 --- a/salt/modules/launchctl_service.py +++ b/salt/modules/launchctl_service.py @@ -101,7 +101,7 @@ def _available_services(): except Exception: # pylint: disable=broad-except # If plistlib is unable to read the file we'll need to use # the system provided plutil program to do the conversion - cmd = '/usr/bin/plutil -convert xml1 -o - -- "{}"'.format(true_path) + cmd = f'/usr/bin/plutil -convert xml1 -o - -- "{true_path}"' plist_xml = __salt__["cmd.run_all"](cmd, python_shell=False)[ "stdout" ] @@ -173,9 +173,9 @@ def get_all(): def _get_launchctl_data(job_label, runas=None): if BEFORE_YOSEMITE: - cmd = "launchctl list -x {}".format(job_label) + cmd = f"launchctl list -x {job_label}" else: - cmd = "launchctl list {}".format(job_label) + cmd = f"launchctl list {job_label}" launchctl_data = __salt__["cmd.run_all"](cmd, python_shell=False, runas=runas) diff --git a/salt/modules/layman.py b/salt/modules/layman.py index 0b8474076b5..6b61c649208 100644 --- a/salt/modules/layman.py +++ b/salt/modules/layman.py @@ -48,7 +48,7 @@ def add(overlay): """ ret = list() old_overlays = list_local() - cmd = "layman --quietness=0 --add {}".format(overlay) + cmd = f"layman --quietness=0 --add {overlay}" add_attempt = __salt__["cmd.run_all"](cmd, python_shell=False, stdin="y") if add_attempt["retcode"] != 0: raise salt.exceptions.CommandExecutionError(add_attempt["stdout"]) @@ -82,7 +82,7 @@ def delete(overlay): """ ret = list() old_overlays = list_local() - cmd = "layman --quietness=0 --delete {}".format(overlay) + cmd = f"layman --quietness=0 --delete {overlay}" delete_attempt = __salt__["cmd.run_all"](cmd, python_shell=False) if delete_attempt["retcode"] != 0: raise salt.exceptions.CommandExecutionError(delete_attempt["stdout"]) @@ -114,7 +114,7 @@ def sync(overlay="ALL"): salt '*' layman.sync """ - cmd = "layman --quietness=0 --sync {}".format(overlay) + cmd = f"layman --quietness=0 --sync {overlay}" return __salt__["cmd.retcode"](cmd, python_shell=False) == 0 diff --git a/salt/modules/ldap3.py b/salt/modules/ldap3.py index 87836de7b6f..8261dc2f5f7 100644 --- a/salt/modules/ldap3.py +++ b/salt/modules/ldap3.py @@ -53,7 +53,7 @@ class LDAPError(Exception): def _convert_exception(e): """Convert an ldap backend exception to an LDAPError and raise it.""" - raise LDAPError("exception in ldap backend: {!r}".format(e), e) from e + raise LDAPError(f"exception in ldap backend: {e!r}", e) from e def _bind(l, bind=None): @@ -91,7 +91,7 @@ def _format_unicode_password(pwd): :returns: A unicode string """ - return '"{}"'.format(pwd).encode("utf-16-le") + return f'"{pwd}"'.encode("utf-16-le") class _connect_ctx: @@ -267,7 +267,7 @@ def connect(connect_spec=None): if backend_name not in available_backends: raise ValueError( "unsupported backend or required Python module" - + " unavailable: {}".format(backend_name) + + f" unavailable: {backend_name}" ) url = connect_spec.get("url", "ldapi:///") try: diff --git a/salt/modules/ldapmod.py b/salt/modules/ldapmod.py index ceac8cd5dc3..f611e1e287a 100644 --- a/salt/modules/ldapmod.py +++ b/salt/modules/ldapmod.py @@ -82,7 +82,7 @@ def _config(name, key=None, **kwargs): if name in kwargs: value = kwargs[name] else: - value = __salt__["config.option"]("ldap.{}".format(key)) + value = __salt__["config.option"](f"ldap.{key}") return salt.utils.data.decode(value, to_str=True) @@ -111,7 +111,7 @@ def search( dn=None, # pylint: disable=C0103 scope=None, attrs=None, - **kwargs + **kwargs, ): """ Run an arbitrary LDAP query and return the results. @@ -190,13 +190,13 @@ class _LDAPConnection: self.bindpw = bindpw if self.uri == "": - self.uri = "ldap://{}:{}".format(self.server, self.port) + self.uri = f"ldap://{self.server}:{self.port}" try: if no_verify: ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) - self.ldap = ldap.initialize("{}".format(self.uri)) + self.ldap = ldap.initialize(f"{self.uri}") self.ldap.protocol_version = 3 # ldap.VERSION3 self.ldap.set_option(ldap.OPT_REFERRALS, 0) # Needed for AD diff --git a/salt/modules/libcloud_compute.py b/salt/modules/libcloud_compute.py index b902055df36..038ebd3c58c 100644 --- a/salt/modules/libcloud_compute.py +++ b/salt/modules/libcloud_compute.py @@ -787,7 +787,7 @@ def _get_by_id(collection, id): if not matches: raise ValueError("Could not find a matching item") elif len(matches) > 1: - raise ValueError("The id matched {} items, not 1".format(len(matches))) + raise ValueError(f"The id matched {len(matches)} items, not 1") return matches[0] diff --git a/salt/modules/linux_acl.py b/salt/modules/linux_acl.py index e1fcf4a9c8f..ae121e9c1b7 100644 --- a/salt/modules/linux_acl.py +++ b/salt/modules/linux_acl.py @@ -69,7 +69,7 @@ def getfacl(*args, **kwargs): if recursive: cmd += " -R" for dentry in args: - cmd += ' "{}"'.format(dentry) + cmd += f' "{dentry}"' out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() dentry = "" for line in out: @@ -186,7 +186,7 @@ def wipefacls(*args, **kwargs): if recursive: cmd += " -R" for dentry in args: - cmd += ' "{}"'.format(dentry) + cmd += f' "{dentry}"' __salt__["cmd.run"](cmd, python_shell=False) return True @@ -233,10 +233,10 @@ def modfacl(acl_type, acl_name="", perms="", *args, **kwargs): cmd += " -m" - cmd = "{} {}:{}:{}".format(cmd, _acl_prefix(acl_type), acl_name, perms) + cmd = f"{cmd} {_acl_prefix(acl_type)}:{acl_name}:{perms}" for dentry in args: - cmd += ' "{}"'.format(dentry) + cmd += f' "{dentry}"' __salt__["cmd.run"](cmd, python_shell=False, raise_err=raise_err) return True @@ -265,9 +265,9 @@ def delfacl(acl_type, acl_name="", *args, **kwargs): cmd += " -x" - cmd = "{} {}:{}".format(cmd, _acl_prefix(acl_type), acl_name) + cmd = f"{cmd} {_acl_prefix(acl_type)}:{acl_name}" for dentry in args: - cmd += ' "{}"'.format(dentry) + cmd += f' "{dentry}"' __salt__["cmd.run"](cmd, python_shell=False) return True diff --git a/salt/modules/linux_ip.py b/salt/modules/linux_ip.py index 01cc0e285d5..a7f6e960da9 100644 --- a/salt/modules/linux_ip.py +++ b/salt/modules/linux_ip.py @@ -45,7 +45,7 @@ def down(iface, iface_type=None): """ # Slave devices are controlled by the master. if iface_type not in ["slave"]: - return __salt__["cmd.run"]("ip link set {} down".format(iface)) + return __salt__["cmd.run"](f"ip link set {iface} down") return None @@ -92,7 +92,7 @@ def _ip_ifaces(): at_ = comps[0] if len(comps) % 2 != 0: last = comps.pop() - comps[-1] += " {}".format(last) + comps[-1] += f" {last}" ifi = iter(comps) ret[if_][at_] = dict(list(zip(ifi, ifi))) else: @@ -114,7 +114,7 @@ def up(iface, iface_type=None): """ # Slave devices are controlled by the master. if iface_type not in ["slave"]: - return __salt__["cmd.run"]("ip link set {} up".format(iface)) + return __salt__["cmd.run"](f"ip link set {iface} up") return None diff --git a/salt/modules/linux_lvm.py b/salt/modules/linux_lvm.py index 03803497aa6..d53caa0e073 100644 --- a/salt/modules/linux_lvm.py +++ b/salt/modules/linux_lvm.py @@ -245,11 +245,11 @@ def pvcreate(devices, override=True, force=True, **kwargs): for device in devices: if not os.path.exists(device): - return "{} does not exist".format(device) + return f"{device} does not exist" if not pvdisplay(device, quiet=True): cmd.append(device) elif not override: - return 'Device "{}" is already an LVM physical volume.'.format(device) + return f'Device "{device}" is already an LVM physical volume.' if not cmd[2:]: # All specified devices are already LVM volumes @@ -270,9 +270,9 @@ def pvcreate(devices, override=True, force=True, **kwargs): no_parameter = "norestorefile" for var in kwargs: if kwargs[var] and var in valid: - cmd.extend(["--{}".format(var), kwargs[var]]) + cmd.extend([f"--{var}", kwargs[var]]) elif kwargs[var] and var in no_parameter: - cmd.append("--{}".format(var)) + cmd.append(f"--{var}") out = __salt__["cmd.run_all"](cmd, python_shell=False) if out.get("retcode"): @@ -281,7 +281,7 @@ def pvcreate(devices, override=True, force=True, **kwargs): # Verify pvcreate was successful for device in devices: if not pvdisplay(device): - return 'Device "{}" was not affected.'.format(device) + return f'Device "{device}" was not affected.' return True @@ -313,7 +313,7 @@ def pvremove(devices, override=True, force=True): if pvdisplay(device): cmd.append(device) elif not override: - return "{} is not a physical volume".format(device) + return f"{device} is not a physical volume" if not cmd[2:]: # Nothing to do @@ -326,7 +326,7 @@ def pvremove(devices, override=True, force=True): # Verify pvremove was successful for device in devices: if pvdisplay(device, quiet=True): - return 'Device "{}" was not affected.'.format(device) + return f'Device "{device}" was not affected.' return True @@ -371,14 +371,14 @@ def vgcreate(vgname, devices, force=False, **kwargs): ) for var in kwargs: if kwargs[var] and var in valid: - cmd.append("--{}".format(var)) + cmd.append(f"--{var}") cmd.append(kwargs[var]) cmd_ret = __salt__["cmd.run_all"](cmd, python_shell=False) if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Volume group "{}" successfully created'.format(vgname) + out = f'Volume group "{vgname}" successfully created' vgdata = vgdisplay(vgname) vgdata["Output from vgcreate"] = out @@ -415,7 +415,7 @@ def vgextend(vgname, devices, force=False): if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Volume group "{}" successfully extended'.format(vgname) + out = f'Volume group "{vgname}" successfully extended' vgdata = {"Output from vgextend": out} return vgdata @@ -431,7 +431,7 @@ def lvcreate( thinvolume=False, thinpool=False, force=False, - **kwargs + **kwargs, ): """ Create a new logical volume, with option for which physical volume to be used @@ -494,9 +494,9 @@ def lvcreate( if kwargs: for k, v in kwargs.items(): if k in no_parameter: - extra_arguments.append("--{}".format(k)) + extra_arguments.append(f"--{k}") elif k in valid: - extra_arguments.extend(["--{}".format(k), "{}".format(v)]) + extra_arguments.extend([f"--{k}", f"{v}"]) cmd = [salt.utils.path.which("lvcreate")] @@ -508,18 +508,18 @@ def lvcreate( cmd.extend(["-n", lvname]) if snapshot: - cmd.extend(["-s", "{}/{}".format(vgname, snapshot)]) + cmd.extend(["-s", f"{vgname}/{snapshot}"]) else: cmd.append(vgname) if size and thinvolume: - cmd.extend(["-V", "{}".format(size)]) + cmd.extend(["-V", f"{size}"]) elif extents and thinvolume: return "Error: Thin volume size cannot be specified as extents" elif size: - cmd.extend(["-L", "{}".format(size)]) + cmd.extend(["-L", f"{size}"]) elif extents: - cmd.extend(["-l", "{}".format(extents)]) + cmd.extend(["-l", f"{extents}"]) else: return "Error: Either size or extents must be specified" @@ -537,9 +537,9 @@ def lvcreate( if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Logical volume "{}" created.'.format(lvname) + out = f'Logical volume "{lvname}" created.' - lvdev = "/dev/{}/{}".format(vgname, lvname) + lvdev = f"/dev/{vgname}/{lvname}" lvdata = lvdisplay(lvdev) lvdata["Output from lvcreate"] = out return lvdata @@ -567,7 +567,7 @@ def vgremove(vgname, force=True): if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Volume group "{}" successfully removed'.format(vgname) + out = f'Volume group "{vgname}" successfully removed' return out @@ -581,7 +581,7 @@ def lvremove(lvname, vgname, force=True): salt '*' lvm.lvremove lvname vgname force=True """ - cmd = ["lvremove", "{}/{}".format(vgname, lvname)] + cmd = ["lvremove", f"{vgname}/{lvname}"] if force: cmd.append("--yes") @@ -592,7 +592,7 @@ def lvremove(lvname, vgname, force=True): if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Logical volume "{}" successfully removed'.format(lvname) + out = f'Logical volume "{lvname}" successfully removed' return out @@ -625,9 +625,9 @@ def lvresize(size=None, lvpath=None, extents=None, force=False, resizefs=False): cmd.append("--resizefs") if size: - cmd.extend(["-L", "{}".format(size)]) + cmd.extend(["-L", f"{size}"]) elif extents: - cmd.extend(["-l", "{}".format(extents)]) + cmd.extend(["-l", f"{extents}"]) else: log.error("Error: Either size or extents must be specified") return {} @@ -638,7 +638,7 @@ def lvresize(size=None, lvpath=None, extents=None, force=False, resizefs=False): if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Logical volume "{}" successfully resized.'.format(lvpath) + out = f'Logical volume "{lvpath}" successfully resized.' return {"Output from lvresize": out} @@ -671,9 +671,9 @@ def lvextend(size=None, lvpath=None, extents=None, force=False, resizefs=False): cmd.append("--resizefs") if size: - cmd.extend(["-L", "{}".format(size)]) + cmd.extend(["-L", f"{size}"]) elif extents: - cmd.extend(["-l", "{}".format(extents)]) + cmd.extend(["-l", f"{extents}"]) else: log.error("Error: Either size or extents must be specified") return {} @@ -684,7 +684,7 @@ def lvextend(size=None, lvpath=None, extents=None, force=False, resizefs=False): if cmd_ret.get("retcode"): out = cmd_ret.get("stderr").strip() else: - out = 'Logical volume "{}" successfully extended.'.format(lvpath) + out = f'Logical volume "{lvpath}" successfully extended.' return {"Output from lvextend": out} @@ -716,7 +716,7 @@ def pvresize(devices, override=True, force=True): if pvdisplay(device): cmd.append(device) elif not override: - return "{} is not a physical volume".format(device) + return f"{device} is not a physical volume" if not cmd[2:]: # Nothing to do diff --git a/salt/modules/linux_service.py b/salt/modules/linux_service.py index d26fc5a9799..4289fc6003f 100644 --- a/salt/modules/linux_service.py +++ b/salt/modules/linux_service.py @@ -43,7 +43,7 @@ def __virtual__(): return (False, "Non Linux OSes are not supported") init_grain = __grains__.get("init") if init_grain not in (None, "sysvinit", "unknown"): - return (False, "Minion is running {}".format(init_grain)) + return (False, f"Minion is running {init_grain}") elif __utils__["systemd.booted"](__context__): # Should have been caught by init grain check, but check just in case return (False, "Minion is running systemd") diff --git a/salt/modules/linux_shadow.py b/salt/modules/linux_shadow.py index aa149ac4c8e..09fe73fdb54 100644 --- a/salt/modules/linux_shadow.py +++ b/salt/modules/linux_shadow.py @@ -368,7 +368,7 @@ def set_password(name, password, use_usermod=False, root=None): # ALT Linux uses tcb to store password hashes. More information found # in manpage (http://docs.altlinux.org/manpages/tcb.5.html) if __grains__["os"] == "ALT": - s_file = "/etc/tcb/{}/shadow".format(name) + s_file = f"/etc/tcb/{name}/shadow" else: s_file = "/etc/shadow" if root: diff --git a/salt/modules/linux_sysctl.py b/salt/modules/linux_sysctl.py index fe63cb6c596..3cb77e36017 100644 --- a/salt/modules/linux_sysctl.py +++ b/salt/modules/linux_sysctl.py @@ -41,7 +41,7 @@ def _which(cmd): """ _cmd = salt.utils.path.which(cmd) if not _cmd: - raise CommandExecutionError("Command '{}' cannot be found".format(cmd)) + raise CommandExecutionError(f"Command '{cmd}' cannot be found") return _cmd @@ -137,13 +137,13 @@ def assign(name, value): tran_tab = name.translate("".maketrans("./", "/.")) - sysctl_file = "/proc/sys/{}".format(tran_tab) + sysctl_file = f"/proc/sys/{tran_tab}" if not os.path.exists(sysctl_file): - raise CommandExecutionError("sysctl {} does not exist".format(name)) + raise CommandExecutionError(f"sysctl {name} does not exist") ret = {} _sysctl = "{}".format(_which("sysctl")) - cmd = [_sysctl, "-w", "{}={}".format(name, value)] + cmd = [_sysctl, "-w", f"{name}={value}"] data = __salt__["cmd.run_all"](cmd, python_shell=False) out = data["stdout"] err = data["stderr"] @@ -151,14 +151,14 @@ def assign(name, value): # Example: # # sysctl -w net.ipv4.tcp_rmem="4096 87380 16777216" # net.ipv4.tcp_rmem = 4096 87380 16777216 - regex = re.compile(r"^{}\s+=\s+{}$".format(re.escape(name), re.escape(value))) + regex = re.compile(rf"^{re.escape(name)}\s+=\s+{re.escape(value)}$") if not regex.match(out) or "Invalid argument" in str(err): if data["retcode"] != 0 and err: error = err else: error = out - raise CommandExecutionError("sysctl -w failed: {}".format(error)) + raise CommandExecutionError(f"sysctl -w failed: {error}") new_name, new_value = out.split(" = ", 1) ret[new_name] = new_value return ret @@ -238,13 +238,13 @@ def persist(name, value, config=None): else: return "Already set" - nlines.append("{} = {}\n".format(name, value)) + nlines.append(f"{name} = {value}\n") edited = True continue else: nlines.append(line) if not edited: - nlines.append("{} = {}\n".format(name, value)) + nlines.append(f"{name} = {value}\n") try: with salt.utils.files.fopen(config, "wb") as _fh: _fh.writelines(salt.utils.data.encode(nlines)) diff --git a/salt/modules/localemod.py b/salt/modules/localemod.py index 8744535d1a1..e8cd9063ca3 100644 --- a/salt/modules/localemod.py +++ b/salt/modules/localemod.py @@ -109,11 +109,9 @@ def _localectl_set(locale=""): else _localectl_status().get("system_locale", {}) ) locale_params["LANG"] = str(locale) - args = " ".join( - ['{}="{}"'.format(k, v) for k, v in locale_params.items() if v is not None] - ) + args = " ".join([f'{k}="{v}"' for k, v in locale_params.items() if v is not None]) return not __salt__["cmd.retcode"]( - "localectl set-locale {}".format(args), python_shell=False + f"localectl set-locale {args}", python_shell=False ) @@ -204,7 +202,7 @@ def set_locale(locale): __salt__["file.replace"]( "/etc/sysconfig/language", "^RC_LANG=.*", - 'RC_LANG="{}"'.format(locale), + f'RC_LANG="{locale}"', append_if_not_found=True, ) elif "RedHat" in __grains__["os_family"]: @@ -213,7 +211,7 @@ def set_locale(locale): __salt__["file.replace"]( "/etc/sysconfig/i18n", "^LANG=.*", - 'LANG="{}"'.format(locale), + f'LANG="{locale}"', append_if_not_found=True, ) elif "Debian" in __grains__["os_family"]: @@ -227,11 +225,11 @@ def set_locale(locale): __salt__["file.replace"]( "/etc/default/locale", "^LANG=.*", - 'LANG="{}"'.format(locale), + f'LANG="{locale}"', append_if_not_found=True, ) elif "Gentoo" in __grains__["os_family"]: - cmd = "eselect --brief locale set {}".format(locale) + cmd = f"eselect --brief locale set {locale}" return __salt__["cmd.retcode"](cmd, python_shell=False) == 0 elif "Solaris" in __grains__["os_family"]: if locale not in __salt__["locale.list_avail"](): @@ -239,7 +237,7 @@ def set_locale(locale): __salt__["file.replace"]( "/etc/default/init", "^LANG=.*", - 'LANG="{}"'.format(locale), + f'LANG="{locale}"', append_if_not_found=True, ) else: @@ -319,9 +317,7 @@ def gen_locale(locale, **kwargs): if on_debian or on_gentoo: # file-based search search = "/usr/share/i18n/SUPPORTED" - valid = __salt__["file.search"]( - search, "^{}$".format(locale), flags=re.MULTILINE - ) + valid = __salt__["file.search"](search, f"^{locale}$", flags=re.MULTILINE) else: # directory-based search if on_suse: search = "/usr/share/locale" @@ -332,7 +328,7 @@ def gen_locale(locale, **kwargs): valid = locale_search_str in os.listdir(search) except OSError as ex: log.error(ex) - raise CommandExecutionError('Locale "{}" is not available.'.format(locale)) + raise CommandExecutionError(f'Locale "{locale}" is not available.') if not valid: log.error('The provided locale "%s" is not found in %s', locale, search) @@ -341,8 +337,8 @@ def gen_locale(locale, **kwargs): if os.path.exists("/etc/locale.gen"): __salt__["file.replace"]( "/etc/locale.gen", - r"^\s*#\s*{}\s*$".format(locale), - "{}\n".format(locale), + rf"^\s*#\s*{locale}\s*$", + f"{locale}\n", append_if_not_found=True, ) elif on_ubuntu: diff --git a/salt/modules/locate.py b/salt/modules/locate.py index fd4f2e3878c..aa8e1a2473c 100644 --- a/salt/modules/locate.py +++ b/salt/modules/locate.py @@ -111,13 +111,13 @@ def locate(pattern, database="", limit=0, **kwargs): if bool(kwargs[option]) is True and option in toggles: options += toggles[option] if options: - options = "-{}".format(options) + options = f"-{options}" if database: - options += " -d {}".format(database) + options += f" -d {database}" if limit > 0: - options += " -l {}".format(limit) + options += f" -l {limit}" if "regex" in kwargs and bool(kwargs["regex"]) is True: options += " --regex" - cmd = "locate {} {}".format(options, pattern) + cmd = f"locate {options} {pattern}" out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() return out diff --git a/salt/modules/logadm.py b/salt/modules/logadm.py index 677e12f705b..9f50803ba40 100644 --- a/salt/modules/logadm.py +++ b/salt/modules/logadm.py @@ -119,7 +119,7 @@ def _parse_options(entry, options, include_unset=True): if "additional_options" not in log_cfg: log_cfg["additional_options"] = [] if " " in options[index]: - log_cfg["dditional_options"] = "'{}'".format(options[index]) + log_cfg["dditional_options"] = f"'{options[index]}'" else: log_cfg["additional_options"].append(options[index]) @@ -172,7 +172,7 @@ def show_conf(conf_file=default_conf, name=None): if name and name in cfg: return {name: cfg[name]} elif name: - return {name: "not found in {}".format(conf_file)} + return {name: f"not found in {conf_file}"} else: return cfg @@ -212,7 +212,7 @@ def list_conf(conf_file=default_conf, log_file=None, include_unset=False): if log_file and log_file in cfg_parsed: return {log_file: cfg_parsed[log_file]} elif log_file: - return {log_file: "not found in {}".format(conf_file)} + return {log_file: f"not found in {conf_file}"} else: return cfg_parsed @@ -286,7 +286,7 @@ def rotate(name, pattern=None, conf_file=default_conf, **kwargs): ## build command log.debug("logadm.rotate - kwargs: %s", kwargs) - command = "logadm -f {}".format(conf_file) + command = f"logadm -f {conf_file}" for arg, val in kwargs.items(): if arg in option_toggles.values() and val: command = "{} {}".format( @@ -294,7 +294,7 @@ def rotate(name, pattern=None, conf_file=default_conf, **kwargs): _arg2opt(arg), ) elif arg in option_flags.values(): - command = "{} {} {}".format(command, _arg2opt(arg), shlex.quote(str(val))) + command = f"{command} {_arg2opt(arg)} {shlex.quote(str(val))}" elif arg != "log_file": log.warning("Unknown argument %s, don't know how to map this!", arg) if "log_file" in kwargs: @@ -329,7 +329,7 @@ def remove(name, conf_file=default_conf): salt '*' logadm.remove myapplog """ - command = "logadm -f {} -r {}".format(conf_file, name) + command = f"logadm -f {conf_file} -r {name}" result = __salt__["cmd.run_all"](command, python_shell=False) if result["retcode"] != 0: return dict( diff --git a/salt/modules/logrotate.py b/salt/modules/logrotate.py index 314fc607cfc..2e29876da81 100644 --- a/salt/modules/logrotate.py +++ b/salt/modules/logrotate.py @@ -211,7 +211,7 @@ def set_(key, value, setting=None, conf_file=_DEFAULT_CONF): "flags": 8, "backup": False, "path": conf_file, - "pattern": "^{}.*".format(key), + "pattern": f"^{key}.*", "show_changes": False, } @@ -232,7 +232,7 @@ def set_(key, value, setting=None, conf_file=_DEFAULT_CONF): if value is True: new_line = key elif value: - new_line = "{} {}".format(key, value) + new_line = f"{key} {value}" kwargs.update({"prepend_if_not_found": True}) else: @@ -259,7 +259,7 @@ def set_(key, value, setting=None, conf_file=_DEFAULT_CONF): kwargs.update( { - "pattern": "^{0}.*?{{.*?}}".format(key), + "pattern": f"^{key}.*?{{.*?}}", "flags": 24, "append_if_not_found": True, } @@ -279,5 +279,5 @@ def _dict_to_stanza(key, stanza): for skey in stanza: if stanza[skey] is True: stanza[skey] = "" - ret += " {} {}\n".format(skey, stanza[skey]) - return "{0} {{\n{1}}}".format(key, ret) + ret += f" {skey} {stanza[skey]}\n" + return f"{key} {{\n{ret}}}" diff --git a/salt/modules/lvs.py b/salt/modules/lvs.py index a5f2aec02ae..212a5c6f0fc 100644 --- a/salt/modules/lvs.py +++ b/salt/modules/lvs.py @@ -192,7 +192,7 @@ def add_server( server_address=None, packet_forward_method="dr", weight=1, - **kwargs + **kwargs, ): """ @@ -228,7 +228,7 @@ def add_server( server_address=server_address, packet_forward_method=packet_forward_method, weight=weight, - **kwargs + **kwargs, ), ) out = __salt__["cmd.run_all"](cmd, python_shell=False) @@ -247,7 +247,7 @@ def edit_server( server_address=None, packet_forward_method=None, weight=None, - **kwargs + **kwargs, ): """ @@ -283,7 +283,7 @@ def edit_server( server_address=server_address, packet_forward_method=packet_forward_method, weight=weight, - **kwargs + **kwargs, ), ) out = __salt__["cmd.run_all"](cmd, python_shell=False) @@ -347,7 +347,7 @@ def clear(): salt '*' lvs.clear """ - cmd = "{} -C".format(__detect_os()) + cmd = f"{__detect_os()} -C" out = __salt__["cmd.run_all"](cmd, python_shell=False) @@ -371,7 +371,7 @@ def get_rules(): salt '*' lvs.get_rules """ - cmd = "{} -S -n".format(__detect_os()) + cmd = f"{__detect_os()} -S -n" ret = __salt__["cmd.run"](cmd, python_shell=False) return ret @@ -395,7 +395,7 @@ def list_(protocol=None, service_address=None): _build_cmd(protocol=protocol, service_address=service_address), ) else: - cmd = "{} -L -n".format(__detect_os()) + cmd = f"{__detect_os()} -L -n" out = __salt__["cmd.run_all"](cmd, python_shell=False) # A non-zero return code means fail @@ -425,7 +425,7 @@ def zero(protocol=None, service_address=None): _build_cmd(protocol=protocol, service_address=service_address), ) else: - cmd = "{} -Z".format(__detect_os()) + cmd = f"{__detect_os()} -Z" out = __salt__["cmd.run_all"](cmd, python_shell=False) # A non-zero return code means fail @@ -482,7 +482,7 @@ def check_server(protocol=None, service_address=None, server_address=None, **kwa protocol=protocol, service_address=service_address, server_address=server_address, - **kwargs + **kwargs, ) ) # Exact match diff --git a/salt/modules/lxd.py b/salt/modules/lxd.py index fadaa98f27e..9ec22360862 100644 --- a/salt/modules/lxd.py +++ b/salt/modules/lxd.py @@ -180,31 +180,31 @@ def init( salt '*' lxd.init """ - cmd = 'lxd init --auto --storage-backend="{}"'.format(storage_backend) + cmd = f'lxd init --auto --storage-backend="{storage_backend}"' if trust_password is not None: - cmd = cmd + ' --trust-password="{}"'.format(trust_password) + cmd = cmd + f' --trust-password="{trust_password}"' if network_address is not None: - cmd = cmd + ' --network-address="{}"'.format(network_address) + cmd = cmd + f' --network-address="{network_address}"' if network_port is not None: - cmd = cmd + ' --network-port="{}"'.format(network_port) + cmd = cmd + f' --network-port="{network_port}"' if storage_create_device is not None: - cmd = cmd + ' --storage-create-device="{}"'.format(storage_create_device) + cmd = cmd + f' --storage-create-device="{storage_create_device}"' if storage_create_loop is not None: - cmd = cmd + ' --storage-create-loop="{}"'.format(storage_create_loop) + cmd = cmd + f' --storage-create-loop="{storage_create_loop}"' if storage_pool is not None: - cmd = cmd + ' --storage-pool="{}"'.format(storage_pool) + cmd = cmd + f' --storage-pool="{storage_pool}"' try: output = __salt__["cmd.run"](cmd) except ValueError as e: raise CommandExecutionError( - "Failed to call: '{}', error was: {}".format(cmd, str(e)), + f"Failed to call: '{cmd}', error was: {str(e)}", ) if "error:" in output: @@ -248,7 +248,7 @@ def config_set(key, value): output[output.index("error:") + 7 :], ) - return ('Config value "{}" successfully set.'.format(key),) + return (f'Config value "{key}" successfully set.',) @salt.utils.decorators.path.which("lxd") @@ -267,7 +267,7 @@ def config_get(key): salt '*' lxd.config_get core.https_address """ - cmd = 'lxc config get "{}"'.format(key) + cmd = f'lxc config get "{key}"' output = __salt__["cmd.run"](cmd) if "error:" in output: @@ -374,7 +374,7 @@ def pylxd_client_get(remote_addr=None, cert=None, key=None, verify_cert=True): verify=verify_cert, ) except pylxd.exceptions.ClientConnectionFailed: - raise CommandExecutionError("Failed to connect to '{}'".format(remote_addr)) + raise CommandExecutionError(f"Failed to connect to '{remote_addr}'") except TypeError as e: # Happens when the verification failed. @@ -742,7 +742,7 @@ def container_get( try: containers = [client.containers.get(name)] except pylxd.exceptions.LXDAPIException: - raise SaltInvocationError("Container '{}' not found".format(name)) + raise SaltInvocationError(f"Container '{name}' not found") if _raw: return containers[0] @@ -829,9 +829,7 @@ def container_rename( container = container_get(name, remote_addr, cert, key, verify_cert, _raw=True) if container.status_code == CONTAINER_STATUS_RUNNING: - raise SaltInvocationError( - "Can't rename the running container '{}'.".format(name) - ) + raise SaltInvocationError(f"Can't rename the running container '{name}'.") container.rename(newname, wait=True) return _pylxd_model_to_dict(container) @@ -874,7 +872,7 @@ def container_state(name=None, remote_addr=None, cert=None, key=None, verify_cer try: containers = [client.containers.get(name)] except pylxd.exceptions.LXDAPIException: - raise SaltInvocationError("Container '{}' not found".format(name)) + raise SaltInvocationError(f"Container '{name}' not found") states = [] for container in containers: @@ -1382,7 +1380,7 @@ def container_device_add( cert=None, key=None, verify_cert=True, - **kwargs + **kwargs, ): """ Add a container device @@ -1562,7 +1560,7 @@ def container_file_put( # and integer, handle it as if it where a octal representation. mode = str(mode) if not mode.startswith("0"): - mode = "0{}".format(mode) + mode = f"0{mode}" container = container_get(name, remote_addr, cert, key, verify_cert, _raw=True) @@ -1572,7 +1570,7 @@ def container_file_put( if src.find("://") >= 0: cached_file = __salt__["cp.cache_file"](src, saltenv=saltenv) if not cached_file: - raise SaltInvocationError("File '{}' not found".format(src)) + raise SaltInvocationError(f"File '{src}' not found") if not os.path.isabs(cached_file): raise SaltInvocationError("File path must be absolute.") src = cached_file @@ -1583,7 +1581,7 @@ def container_file_put( src = os.path.sep if not os.path.exists(src): - raise CommandExecutionError("No such file or directory '{}'".format(src)) + raise CommandExecutionError(f"No such file or directory '{src}'") if os.path.isdir(src) and not recursive: raise SaltInvocationError( @@ -1766,7 +1764,7 @@ def container_file_get( if mode is not None: mode = str(mode) if not mode.startswith("0"): - mode = "0{}".format(mode) + mode = f"0{mode}" container = container_get(name, remote_addr, cert, key, verify_cert, _raw=True) @@ -1787,9 +1785,7 @@ def container_file_get( else: dst_path = os.path.dirname(dst) if not os.path.isdir(dst_path): - raise CommandExecutionError( - "No such file or directory '{}'".format(dst_path) - ) + raise CommandExecutionError(f"No such file or directory '{dst_path}'") # Seems to be duplicate of line 1794, produces /path/file_name/file_name # dst = os.path.join(dst, os.path.basename(src)) @@ -2070,7 +2066,7 @@ def profile_get( try: profile = client.profiles.get(name) except pylxd.exceptions.LXDAPIException: - raise SaltInvocationError("Profile '{}' not found".format(name)) + raise SaltInvocationError(f"Profile '{name}' not found") if _raw: return profile @@ -2326,7 +2322,7 @@ def profile_device_set( cert=None, key=None, verify_cert=True, - **kwargs + **kwargs, ): """Set a profile device. @@ -2527,9 +2523,7 @@ def image_get( try: image = client.images.get(fingerprint) except pylxd.exceptions.LXDAPIException: - raise SaltInvocationError( - "Image with fingerprint '{}' not found".format(fingerprint) - ) + raise SaltInvocationError(f"Image with fingerprint '{fingerprint}' not found") if _raw: return image @@ -2585,7 +2579,7 @@ def image_get_by_alias( try: image = client.images.get_by_alias(alias) except pylxd.exceptions.LXDAPIException: - raise SaltInvocationError("Image with alias '{}' not found".format(alias)) + raise SaltInvocationError(f"Image with alias '{alias}' not found") if _raw: return image @@ -3457,7 +3451,7 @@ def sync_config_devices(obj, newconfig, newdevices, test=False): continue if not test: - config_changes[k] = 'Added config key "{}" = "{}"'.format(k, newconfig[k]) + config_changes[k] = f'Added config key "{k}" = "{newconfig[k]}"' obj.config[k] = newconfig[k] else: config_changes[k] = 'Would add config key "{}" = "{}"'.format( @@ -3484,10 +3478,10 @@ def sync_config_devices(obj, newconfig, newdevices, test=False): continue if not test: - devices_changes[k] = 'Removed device "{}"'.format(k) + devices_changes[k] = f'Removed device "{k}"' del obj.devices[k] else: - devices_changes[k] = 'Would remove device "{}"'.format(k) + devices_changes[k] = f'Would remove device "{k}"' # Changed devices for k, v in obj.devices.items(): @@ -3501,10 +3495,10 @@ def sync_config_devices(obj, newconfig, newdevices, test=False): if newdevices[k] != v: if not test: - devices_changes[k] = 'Changed device "{}"'.format(k) + devices_changes[k] = f'Changed device "{k}"' obj.devices[k] = newdevices[k] else: - devices_changes[k] = 'Would change device "{}"'.format(k) + devices_changes[k] = f'Would change device "{k}"' # New devices for k in ndk.difference(dk): @@ -3513,10 +3507,10 @@ def sync_config_devices(obj, newconfig, newdevices, test=False): continue if not test: - devices_changes[k] = 'Added device "{}"'.format(k) + devices_changes[k] = f'Added device "{k}"' obj.devices[k] = newdevices[k] else: - devices_changes[k] = 'Would add device "{}"'.format(k) + devices_changes[k] = f'Would add device "{k}"' if devices_changes: changes["devices"] = devices_changes @@ -3562,7 +3556,7 @@ def _set_property_dict_item(obj, prop, key, value): def _get_property_dict_item(obj, prop, key): attr = getattr(obj, prop) if key not in attr: - raise SaltInvocationError("'{}' doesn't exists".format(key)) + raise SaltInvocationError(f"'{key}' doesn't exists") return attr[key] @@ -3570,7 +3564,7 @@ def _get_property_dict_item(obj, prop, key): def _delete_property_dict_item(obj, prop, key): attr = getattr(obj, prop) if key not in attr: - raise SaltInvocationError("'{}' doesn't exists".format(key)) + raise SaltInvocationError(f"'{key}' doesn't exists") del attr[key] pylxd_save_object(obj) @@ -3594,7 +3588,7 @@ def _verify_image(image, remote_addr=None, cert=None, key=None, verify_cert=True except SaltInvocationError: image = image_get(name, remote_addr, cert, key, verify_cert, _raw=True) elif not hasattr(image, "fingerprint"): - raise SaltInvocationError("Invalid image '{}'".format(image)) + raise SaltInvocationError(f"Invalid image '{image}'") return image @@ -3633,7 +3627,7 @@ if HAS_PYLXD: if isinstance(mode, int): mode = oct(mode) elif not mode.startswith("0"): - mode = "0{}".format(mode) + mode = f"0{mode}" headers["X-LXD-mode"] = mode if uid is not None: headers["X-LXD-uid"] = str(uid) diff --git a/salt/modules/mac_assistive.py b/salt/modules/mac_assistive.py index e53c750bd7b..7a81fe87a5b 100644 --- a/salt/modules/mac_assistive.py +++ b/salt/modules/mac_assistive.py @@ -69,13 +69,13 @@ def install(app_id, enable=True, tries=3, wait=10): except sqlite3.Error as exc: if "attempt to write a readonly database" not in str(exc): raise CommandExecutionError( - "Error installing app({}): {}".format(app_id, exc) + f"Error installing app({app_id}): {exc}" ) elif num_tries < tries: num_tries += 1 else: raise CommandExecutionError( - "Error installing app({}): {}".format(app_id, exc) + f"Error installing app({app_id}): {exc}" ) time.sleep(wait) @@ -100,7 +100,7 @@ def installed(app_id): return db.installed(app_id) except sqlite3.Error as exc: raise CommandExecutionError( - "Error checking if app({}) is installed: {}".format(app_id, exc) + f"Error checking if app({app_id}) is installed: {exc}" ) @@ -129,7 +129,7 @@ def enable_(app_id, enabled=True): return db.disable(app_id) except sqlite3.Error as exc: raise CommandExecutionError( - "Error setting enable to {} on app({}): {}".format(enabled, app_id, exc) + f"Error setting enable to {enabled} on app({app_id}): {exc}" ) @@ -153,7 +153,7 @@ def enabled(app_id): return db.enabled(app_id) except sqlite3.Error as exc: raise CommandExecutionError( - "Error checking if app({}) is enabled: {}".format(app_id, exc) + f"Error checking if app({app_id}) is enabled: {exc}" ) @@ -175,9 +175,7 @@ def remove(app_id): try: return db.remove(app_id) except sqlite3.Error as exc: - raise CommandExecutionError( - "Error removing app({}): {}".format(app_id, exc) - ) + raise CommandExecutionError(f"Error removing app({app_id}): {exc}") class TccDB: @@ -205,7 +203,7 @@ class TccDB: self.ge_bigsur_and_later = True else: raise CommandExecutionError( - "TCC Database structure unknown for digest '{}'".format(digest) + f"TCC Database structure unknown for digest '{digest}'" ) def _get_client_type(self, app_id): diff --git a/salt/modules/mac_brew_pkg.py b/salt/modules/mac_brew_pkg.py index 26c47a7a5b8..21069a84c09 100644 --- a/salt/modules/mac_brew_pkg.py +++ b/salt/modules/mac_brew_pkg.py @@ -110,7 +110,7 @@ def _call_brew(*cmd, failhard=True): runas = user if user != __opts__["user"] else None _cmd = [] if runas: - _cmd = ["sudo -i -n -H -u {} -- ".format(runas)] + _cmd = [f"sudo -i -n -H -u {runas} -- "] _cmd = _cmd + [salt.utils.path.which("brew")] + list(cmd) _cmd = " ".join(_cmd) @@ -496,7 +496,7 @@ def list_upgrades(refresh=True, include_casks=False, **kwargs): # pylint: disab try: data = salt.utils.json.loads(res["stdout"]) except ValueError as err: - msg = 'unable to interpret output from "brew outdated": {}'.format(err) + msg = f'unable to interpret output from "brew outdated": {err}' log.error(msg) raise CommandExecutionError(msg) @@ -637,11 +637,11 @@ def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613 ret[target] = {"name": target, "changes": {}, "result": False, "comment": ""} if target not in installed: - ret[target]["comment"] = "Package {} does not have a state.".format(target) + ret[target]["comment"] = f"Package {target} does not have a state." elif target not in pinned: if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) - ret[target]["comment"] = "Package {} is set to be held.".format(target) + ret[target]["comment"] = f"Package {target} is set to be held." else: result = _pin(target) if result: @@ -652,7 +652,7 @@ def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613 ) else: ret[target].update(result=False) - ret[target]["comment"] = "Unable to hold package {}.".format(target) + ret[target]["comment"] = f"Unable to hold package {target}." else: ret[target].update(result=True) ret[target]["comment"] = "Package {} is already set to be held.".format( @@ -713,7 +713,7 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 ret[target] = {"name": target, "changes": {}, "result": False, "comment": ""} if target not in installed: - ret[target]["comment"] = "Package {} does not have a state.".format(target) + ret[target]["comment"] = f"Package {target} does not have a state." elif target in pinned: if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) @@ -725,9 +725,9 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 if result: changes = {"old": "hold", "new": "install"} ret[target].update(changes=changes, result=True) - ret[target]["comment"] = ( - "Package {} is no longer being held.".format(target) - ) + ret[target][ + "comment" + ] = f"Package {target} is no longer being held." else: ret[target].update(result=False) ret[target]["comment"] = "Unable to unhold package {}.".format( diff --git a/salt/modules/mac_desktop.py b/salt/modules/mac_desktop.py index eb58cf2888e..0c457080d28 100644 --- a/salt/modules/mac_desktop.py +++ b/salt/modules/mac_desktop.py @@ -48,7 +48,7 @@ def set_output_volume(volume): salt '*' desktop.set_output_volume """ - cmd = 'osascript -e "set volume output volume {}"'.format(volume) + cmd = f'osascript -e "set volume output volume {volume}"' call = __salt__["cmd.run_all"](cmd, output_loglevel="debug", python_shell=False) _check_cmd(call) @@ -125,6 +125,6 @@ def _check_cmd(call): if std_out: comment += std_out - raise CommandExecutionError("Error running command: {}".format(comment)) + raise CommandExecutionError(f"Error running command: {comment}") return call diff --git a/salt/modules/mac_group.py b/salt/modules/mac_group.py index 44b57f25909..0f4337cb2c3 100644 --- a/salt/modules/mac_group.py +++ b/salt/modules/mac_group.py @@ -58,7 +58,7 @@ def add(name, gid=None, **kwargs): ### NOTE: **kwargs isn't used here but needs to be included in this ### function for compatibility with the group.present state if info(name): - raise CommandExecutionError("Group '{}' already exists".format(name)) + raise CommandExecutionError(f"Group '{name}' already exists") if salt.utils.stringutils.contains_whitespace(name): raise SaltInvocationError("Group name cannot contain whitespace") if name.startswith("_"): @@ -72,7 +72,7 @@ def add(name, gid=None, **kwargs): # check if gid is already in use gid_list = _list_gids() if str(gid) in gid_list: - raise CommandExecutionError("gid '{}' already exists".format(gid)) + raise CommandExecutionError(f"gid '{gid}' already exists") cmd = ["dseditgroup", "-o", "create"] if gid: @@ -130,7 +130,7 @@ def adduser(group, name): Verifies if a valid username 'bar' as a member of an existing group 'foo', if not then adds it. """ - cmd = "dscl . -merge /Groups/{} GroupMembership {}".format(group, name) + cmd = f"dscl . -merge /Groups/{group} GroupMembership {name}" return __salt__["cmd.retcode"](cmd) == 0 @@ -149,7 +149,7 @@ def deluser(group, name): Removes a member user 'bar' from a group 'foo'. If group is not present then returns True. """ - cmd = "dscl . -delete /Groups/{} GroupMembership {}".format(group, name) + cmd = f"dscl . -delete /Groups/{group} GroupMembership {name}" return __salt__["cmd.retcode"](cmd) == 0 @@ -170,7 +170,7 @@ def members(name, members_list): retcode = 1 grp_info = __salt__["group.info"](name) if grp_info and name in grp_info["name"]: - cmd = "/usr/bin/dscl . -delete /Groups/{} GroupMembership".format(name) + cmd = f"/usr/bin/dscl . -delete /Groups/{name} GroupMembership" retcode = __salt__["cmd.retcode"](cmd) == 0 for user in members_list.split(","): cmd = "/usr/bin/dscl . -merge /Groups/{} GroupMembership {}".format( @@ -255,7 +255,7 @@ def chgid(name, gid): pre_gid = __salt__["file.group_to_gid"](name) pre_info = info(name) if not pre_info: - raise CommandExecutionError("Group '{}' does not exist".format(name)) + raise CommandExecutionError(f"Group '{name}' does not exist") if gid == pre_info["gid"]: return True cmd = ["dseditgroup", "-o", "edit", "-i", gid, name] diff --git a/salt/modules/mac_pkgutil.py b/salt/modules/mac_pkgutil.py index 538db2fcf61..63c4bd46b43 100644 --- a/salt/modules/mac_pkgutil.py +++ b/salt/modules/mac_pkgutil.py @@ -68,10 +68,10 @@ def _install_from_path(path): Internal function to install a package from the given path """ if not os.path.exists(path): - msg = "File not found: {}".format(path) + msg = f"File not found: {path}" raise SaltInvocationError(msg) - cmd = 'installer -pkg "{}" -target /'.format(path) + cmd = f'installer -pkg "{path}" -target /' return salt.utils.mac_utils.execute_return_success(cmd) @@ -97,7 +97,7 @@ def install(source, package_id): uri = urllib.parse.urlparse(source) if not uri.scheme == "": - msg = "Unsupported scheme for source uri: {}".format(uri.scheme) + msg = f"Unsupported scheme for source uri: {uri.scheme}" raise SaltInvocationError(msg) _install_from_path(source) @@ -125,6 +125,6 @@ def forget(package_id): salt '*' pkgutil.forget com.apple.pkg.gcc4.2Leo """ - cmd = "pkgutil --forget {}".format(package_id) + cmd = f"pkgutil --forget {package_id}" salt.utils.mac_utils.execute_return_success(cmd) return not is_installed(package_id) diff --git a/salt/modules/mac_portspkg.py b/salt/modules/mac_portspkg.py index 70cb23039fb..2113af467d3 100644 --- a/salt/modules/mac_portspkg.py +++ b/salt/modules/mac_portspkg.py @@ -62,7 +62,7 @@ def __virtual__(): def _list(query=""): - cmd = "port list {}".format(query) + cmd = f"port list {query}" out = salt.utils.mac_utils.execute_return_result(cmd) ret = {} @@ -178,7 +178,7 @@ def latest_version(*names, **kwargs): ): ret[key] = val else: - ret[key] = "{} (installed)".format(version(key)) + ret[key] = f"{version(key)} (installed)" return ret diff --git a/salt/modules/mac_shadow.py b/salt/modules/mac_shadow.py index d116f3e2077..c484d5db967 100644 --- a/salt/modules/mac_shadow.py +++ b/salt/modules/mac_shadow.py @@ -54,13 +54,13 @@ def _get_account_policy(name): :raises: CommandExecutionError on user not found or any other unknown error """ - cmd = "pwpolicy -u {} -getpolicy".format(name) + cmd = f"pwpolicy -u {name} -getpolicy" try: ret = salt.utils.mac_utils.execute_return_result(cmd) except CommandExecutionError as exc: - if "Error: user <{}> not found".format(name) in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + if f"Error: user <{name}> not found" in exc.strerror: + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") try: policy_list = ret.split("\n")[1].split(" ") @@ -86,14 +86,14 @@ def _set_account_policy(name, policy): :raises: CommandExecutionError on user not found or any other unknown error """ - cmd = 'pwpolicy -u {} -setpolicy "{}"'.format(name, policy) + cmd = f'pwpolicy -u {name} -setpolicy "{policy}"' try: return salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: - if "Error: user <{}> not found".format(name) in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + if f"Error: user <{name}> not found" in exc.strerror: + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") def _get_account_policy_data_value(name, key): @@ -109,7 +109,7 @@ def _get_account_policy_data_value(name, key): :raises: CommandExecutionError on user not found or any other unknown error """ - cmd = "dscl . -readpl /Users/{} accountPolicyData {}".format(name, key) + cmd = f"dscl . -readpl /Users/{name} accountPolicyData {key}" try: ret = salt.utils.mac_utils.execute_return_result(cmd) except CommandExecutionError as exc: @@ -117,7 +117,7 @@ def _get_account_policy_data_value(name, key): raise CommandExecutionError(f"User not found: {name}") if "eDSUnknownMatchType" in exc.strerror: raise CommandExecutionError(f"Value not found: {key}") - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + raise CommandExecutionError(f"Unknown error: {exc.strerror}") return ret @@ -327,7 +327,7 @@ def set_maxdays(name, days): """ minutes = days * 24 * 60 - _set_account_policy(name, "maxMinutesUntilChangePassword={}".format(minutes)) + _set_account_policy(name, f"maxMinutesUntilChangePassword={minutes}") return get_maxdays(name) == days @@ -441,7 +441,7 @@ def set_change(name, date): salt '*' shadow.set_change username 09/21/2016 """ - _set_account_policy(name, "usingExpirationDate=1 expirationDateGMT={}".format(date)) + _set_account_policy(name, f"usingExpirationDate=1 expirationDateGMT={date}") return get_change(name) == date @@ -492,9 +492,7 @@ def set_expire(name, date): salt '*' shadow.set_expire username 07/23/2015 """ - _set_account_policy( - name, "usingHardExpirationDate=1 hardExpireDateGMT={}".format(date) - ) + _set_account_policy(name, f"usingHardExpirationDate=1 hardExpireDateGMT={date}") return get_expire(name) == date @@ -542,16 +540,16 @@ def del_password(name): salt '*' shadow.del_password username """ # This removes the password - cmd = "dscl . -passwd /Users/{} ''".format(name) + cmd = f"dscl . -passwd /Users/{name} ''" try: salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "eDSUnknownNodeName" in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") # This is so it looks right in shadow.info - cmd = "dscl . -create /Users/{} Password '*'".format(name) + cmd = f"dscl . -create /Users/{name} Password '*'" salt.utils.mac_utils.execute_return_success(cmd) return info(name)["passwd"] == "*" @@ -578,12 +576,12 @@ def set_password(name, password): salt '*' mac_shadow.set_password macuser macpassword """ - cmd = "dscl . -passwd /Users/{} '{}'".format(name, password) + cmd = f"dscl . -passwd /Users/{name} '{password}'" try: salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "eDSUnknownNodeName" in exc.strerror: - raise CommandExecutionError("User not found: {}".format(name)) - raise CommandExecutionError("Unknown error: {}".format(exc.strerror)) + raise CommandExecutionError(f"User not found: {name}") + raise CommandExecutionError(f"Unknown error: {exc.strerror}") return True diff --git a/salt/modules/mac_softwareupdate.py b/salt/modules/mac_softwareupdate.py index 3cb894e258c..9ca40a2417d 100644 --- a/salt/modules/mac_softwareupdate.py +++ b/salt/modules/mac_softwareupdate.py @@ -311,7 +311,7 @@ def update(name): salt '*' softwareupdate.update """ if not update_available(name): - raise SaltInvocationError("Update not available: {}".format(name)) + raise SaltInvocationError(f"Update not available: {name}") cmd = ["softwareupdate", "--install", name] salt.utils.mac_utils.execute_return_success(cmd) @@ -390,7 +390,7 @@ def download(name): salt '*' softwareupdate.download """ if not update_available(name): - raise SaltInvocationError("Update not available: {}".format(name)) + raise SaltInvocationError(f"Update not available: {name}") if name in list_downloads(): return True diff --git a/salt/modules/mac_sysctl.py b/salt/modules/mac_sysctl.py index 9fe3cc60f03..16f67e09a3b 100644 --- a/salt/modules/mac_sysctl.py +++ b/salt/modules/mac_sysctl.py @@ -66,14 +66,14 @@ def show(config_file=False): # # Yes. That's two `kern.clockrate`. # - if any([line.startswith("{}.".format(root)) for root in roots]): + if any([line.startswith(f"{root}.") for root in roots]): comps = line.split(": " if ": " in line else " = ", 1) if len(comps) == 2: ret[comps[0]] = comps[1] else: ret[comps[0]] = "" elif comps[0]: - ret[comps[0]] += "{}\n".format(line) + ret[comps[0]] += f"{line}\n" else: continue return ret @@ -92,7 +92,7 @@ def get(name): salt '*' sysctl.get hw.physmem """ - cmd = "sysctl -n {}".format(name) + cmd = f"sysctl -n {name}" out = __salt__["cmd.run"](cmd, python_shell=False) return out @@ -114,7 +114,7 @@ def assign(name, value): salt '*' sysctl.assign net.inet.icmp.icmplim 50 """ ret = {} - cmd = 'sysctl -w {}="{}"'.format(name, value) + cmd = f'sysctl -w {name}="{value}"' data = __salt__["cmd.run_all"](cmd, python_shell=False) if data["retcode"] != 0: @@ -165,7 +165,7 @@ def persist(name, value, config="/etc/sysctl.conf", apply_change=False): with salt.utils.files.fopen(config, "r") as ifile: for line in ifile: line = salt.utils.stringutils.to_unicode(line) - if not line.startswith("{}=".format(name)): + if not line.startswith(f"{name}="): nlines.append(line) continue else: @@ -179,10 +179,10 @@ def persist(name, value, config="/etc/sysctl.conf", apply_change=False): rest = rest[len(rest_v) :] if rest_v == value: return "Already set" - nlines.append("{}={}\n".format(name, value)) + nlines.append(f"{name}={value}\n") edited = True if not edited: - nlines.append("{}={}\n".format(name, value)) + nlines.append(f"{name}={value}\n") nlines = [salt.utils.stringutils.to_str(_l) for _l in nlines] with salt.utils.files.fopen(config, "w+") as ofile: ofile.writelines(nlines) diff --git a/salt/modules/mac_timezone.py b/salt/modules/mac_timezone.py index 5703ab08784..26549c44882 100644 --- a/salt/modules/mac_timezone.py +++ b/salt/modules/mac_timezone.py @@ -53,7 +53,7 @@ def _get_date_time_format(dt_string): return dt_format except ValueError: continue - msg = "Invalid Date/Time Format: {}".format(dt_string) + msg = f"Invalid Date/Time Format: {dt_string}" raise SaltInvocationError(msg) @@ -237,11 +237,9 @@ def set_zone(time_zone): salt '*' timezone.set_zone America/Denver """ if time_zone not in list_zones(): - raise SaltInvocationError("Invalid Timezone: {}".format(time_zone)) + raise SaltInvocationError(f"Invalid Timezone: {time_zone}") - salt.utils.mac_utils.execute_return_success( - "systemsetup -settimezone {}".format(time_zone) - ) + salt.utils.mac_utils.execute_return_success(f"systemsetup -settimezone {time_zone}") return time_zone in get_zone() @@ -303,7 +301,7 @@ def set_using_network_time(enable): """ state = salt.utils.mac_utils.validate_enabled(enable) - cmd = "systemsetup -setusingnetworktime {}".format(state) + cmd = f"systemsetup -setusingnetworktime {state}" salt.utils.mac_utils.execute_return_success(cmd) return state == salt.utils.mac_utils.validate_enabled(get_using_network_time()) @@ -349,7 +347,7 @@ def set_time_server(time_server="time.apple.com"): salt '*' timezone.set_time_server time.acme.com """ - cmd = "systemsetup -setnetworktimeserver {}".format(time_server) + cmd = f"systemsetup -setnetworktimeserver {time_server}" salt.utils.mac_utils.execute_return_success(cmd) return time_server in get_time_server() diff --git a/salt/modules/mac_user.py b/salt/modules/mac_user.py index 7e4f1b25965..d5fd6e98665 100644 --- a/salt/modules/mac_user.py +++ b/salt/modules/mac_user.py @@ -79,7 +79,7 @@ def add( shell=None, fullname=None, createhome=True, - **kwargs + **kwargs, ): """ Add a user to the minion @@ -91,7 +91,7 @@ def add( salt '*' user.add name """ if info(name): - raise CommandExecutionError("User '{}' already exists".format(name)) + raise CommandExecutionError(f"User '{name}' already exists") if salt.utils.stringutils.contains_whitespace(name): raise SaltInvocationError("Username cannot contain whitespace") @@ -101,7 +101,7 @@ def add( if gid is None: gid = 20 # gid 20 == 'staff', the default group if home is None: - home = "/Users/{}".format(name) + home = f"/Users/{name}" if shell is None: shell = "/bin/bash" if fullname is None: @@ -112,7 +112,7 @@ def add( if not isinstance(gid, int): raise SaltInvocationError("gid must be an integer") - name_path = "/Users/{}".format(name) + name_path = f"/Users/{name}" _dscl([name_path, "UniqueID", uid]) _dscl([name_path, "PrimaryGroupID", gid]) _dscl([name_path, "UserShell", shell]) @@ -155,7 +155,7 @@ def delete(name, remove=False, force=False): # group membership is managed separately from users and an entry for the # user will persist even after the user is removed. chgroups(name, ()) - ret = _dscl(["/Users/{}".format(name)], ctype="delete")["retcode"] == 0 + ret = _dscl([f"/Users/{name}"], ctype="delete")["retcode"] == 0 if ret and remove: # remove home directory from filesystem __salt__["file.remove"](user_info["home"]) @@ -196,10 +196,10 @@ def chuid(name, uid): raise SaltInvocationError("uid must be an integer") pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if uid == pre_info["uid"]: return True - _dscl(["/Users/{}".format(name), "UniqueID", pre_info["uid"], uid], ctype="change") + _dscl([f"/Users/{name}", "UniqueID", pre_info["uid"], uid], ctype="change") # dscl buffers changes, sleep 1 second before checking if new value # matches desired value time.sleep(1) @@ -220,11 +220,11 @@ def chgid(name, gid): raise SaltInvocationError("gid must be an integer") pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if gid == pre_info["gid"]: return True _dscl( - ["/Users/{}".format(name), "PrimaryGroupID", pre_info["gid"], gid], + [f"/Users/{name}", "PrimaryGroupID", pre_info["gid"], gid], ctype="change", ) # dscl buffers changes, sleep 1 second before checking if new value @@ -245,11 +245,11 @@ def chshell(name, shell): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if shell == pre_info["shell"]: return True _dscl( - ["/Users/{}".format(name), "UserShell", pre_info["shell"], shell], + [f"/Users/{name}", "UserShell", pre_info["shell"], shell], ctype="change", ) # dscl buffers changes, sleep 1 second before checking if new value @@ -277,11 +277,11 @@ def chhome(name, home, **kwargs): pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if home == pre_info["home"]: return True _dscl( - ["/Users/{}".format(name), "NFSHomeDirectory", pre_info["home"], home], + [f"/Users/{name}", "NFSHomeDirectory", pre_info["home"], home], ctype="change", ) # dscl buffers changes, sleep 1 second before checking if new value @@ -303,12 +303,12 @@ def chfullname(name, fullname): fullname = salt.utils.data.decode(fullname) pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") pre_info["fullname"] = salt.utils.data.decode(pre_info["fullname"]) if fullname == pre_info["fullname"]: return True _dscl( - ["/Users/{}".format(name), "RealName", fullname], + [f"/Users/{name}", "RealName", fullname], # use a 'create' command, because a 'change' command would fail if # current fullname is an empty string. The 'create' will just overwrite # this field. @@ -346,7 +346,7 @@ def chgroups(name, groups, append=False): ### function for compatibility with the user.present state uinfo = info(name) if not uinfo: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if isinstance(groups, str): groups = groups.split(",") @@ -364,11 +364,11 @@ def chgroups(name, groups, append=False): return True # Add groups from which user is missing for group in desired - ugrps: - _dscl(["/Groups/{}".format(group), "GroupMembership", name], ctype="append") + _dscl([f"/Groups/{group}", "GroupMembership", name], ctype="append") if not append: # Remove from extra groups for group in ugrps - desired: - _dscl(["/Groups/{}".format(group), "GroupMembership", name], ctype="delete") + _dscl([f"/Groups/{group}", "GroupMembership", name], ctype="delete") time.sleep(1) return set(list_groups(name)) == desired @@ -472,11 +472,11 @@ def rename(name, new_name): """ current_info = info(name) if not current_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") new_info = info(new_name) if new_info: - raise CommandExecutionError("User '{}' already exists".format(new_name)) - _dscl(["/Users/{}".format(name), "RecordName", name, new_name], ctype="change") + raise CommandExecutionError(f"User '{new_name}' already exists") + _dscl([f"/Users/{name}", "RecordName", name, new_name], ctype="change") # dscl buffers changes, sleep 1 second before checking if new value # matches desired value time.sleep(1) diff --git a/salt/modules/mac_xattr.py b/salt/modules/mac_xattr.py index e2bbf1c503a..b7b742965a6 100644 --- a/salt/modules/mac_xattr.py +++ b/salt/modules/mac_xattr.py @@ -60,8 +60,8 @@ def list_(path, **kwargs): ret = salt.utils.mac_utils.execute_return_result(cmd) except CommandExecutionError as exc: if "No such file" in exc.strerror: - raise CommandExecutionError("File not found: {}".format(path)) - raise CommandExecutionError("Unknown Error: {}".format(exc.strerror)) + raise CommandExecutionError(f"File not found: {path}") + raise CommandExecutionError(f"Unknown Error: {exc.strerror}") if not ret: return {} @@ -115,10 +115,10 @@ def read(path, attribute, **kwargs): return exc.object.decode(errors="replace") except CommandExecutionError as exc: if "No such file" in exc.strerror: - raise CommandExecutionError("File not found: {}".format(path)) + raise CommandExecutionError(f"File not found: {path}") if "No such xattr" in exc.strerror: - raise CommandExecutionError("Attribute not found: {}".format(attribute)) - raise CommandExecutionError("Unknown Error: {}".format(exc.strerror)) + raise CommandExecutionError(f"Attribute not found: {attribute}") + raise CommandExecutionError(f"Unknown Error: {exc.strerror}") return ret @@ -161,8 +161,8 @@ def write(path, attribute, value, **kwargs): salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "No such file" in exc.strerror: - raise CommandExecutionError("File not found: {}".format(path)) - raise CommandExecutionError("Unknown Error: {}".format(exc.strerror)) + raise CommandExecutionError(f"File not found: {path}") + raise CommandExecutionError(f"Unknown Error: {exc.strerror}") return read(path, attribute, **{"hex": hex_}) == value @@ -188,15 +188,15 @@ def delete(path, attribute): salt '*' xattr.delete /path/to/file "com.test.attr" """ - cmd = 'xattr -d "{}" "{}"'.format(attribute, path) + cmd = f'xattr -d "{attribute}" "{path}"' try: salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "No such file" in exc.strerror: - raise CommandExecutionError("File not found: {}".format(path)) + raise CommandExecutionError(f"File not found: {path}") if "No such xattr" in exc.strerror: - raise CommandExecutionError("Attribute not found: {}".format(attribute)) - raise CommandExecutionError("Unknown Error: {}".format(exc.strerror)) + raise CommandExecutionError(f"Attribute not found: {attribute}") + raise CommandExecutionError(f"Unknown Error: {exc.strerror}") return attribute not in list_(path) @@ -217,12 +217,12 @@ def clear(path): salt '*' xattr.delete /path/to/file "com.test.attr" """ - cmd = 'xattr -c "{}"'.format(path) + cmd = f'xattr -c "{path}"' try: salt.utils.mac_utils.execute_return_success(cmd) except CommandExecutionError as exc: if "No such file" in exc.strerror: - raise CommandExecutionError("File not found: {}".format(path)) - raise CommandExecutionError("Unknown Error: {}".format(exc.strerror)) + raise CommandExecutionError(f"File not found: {path}") + raise CommandExecutionError(f"Unknown Error: {exc.strerror}") return list_(path) == {} diff --git a/salt/modules/macdefaults.py b/salt/modules/macdefaults.py index c805536fdd7..77f0e580afc 100644 --- a/salt/modules/macdefaults.py +++ b/salt/modules/macdefaults.py @@ -56,7 +56,7 @@ def write(domain, key, value, type="string", user=None): elif value is False: value = "FALSE" - cmd = 'defaults write "{}" "{}" -{} "{}"'.format(domain, key, type, value) + cmd = f'defaults write "{domain}" "{key}" -{type} "{value}"' return __salt__["cmd.run_all"](cmd, runas=user) @@ -82,7 +82,7 @@ def read(domain, key, user=None): The user to read the defaults as """ - cmd = 'defaults read "{}" "{}"'.format(domain, key) + cmd = f'defaults read "{domain}" "{key}"' return __salt__["cmd.run"](cmd, runas=user) @@ -108,5 +108,5 @@ def delete(domain, key, user=None): The user to delete the defaults with """ - cmd = 'defaults delete "{}" "{}"'.format(domain, key) + cmd = f'defaults delete "{domain}" "{key}"' return __salt__["cmd.run_all"](cmd, runas=user, output_loglevel="debug") diff --git a/salt/modules/makeconf.py b/salt/modules/makeconf.py index 446a72cfd31..b95d3b7bf23 100644 --- a/salt/modules/makeconf.py +++ b/salt/modules/makeconf.py @@ -42,7 +42,7 @@ def _add_var(var, value): """ makeconf = _get_makeconf() layman = "source /var/lib/layman/make.conf" - fullvar = '{}="{}"'.format(var, value) + fullvar = f'{var}="{value}"' if __salt__["file.contains"](makeconf, layman): # TODO perhaps make this a function in the file module? cmd = [ @@ -77,9 +77,7 @@ def set_var(var, value): # If var already in file, replace its value if old_value is not None: - __salt__["file.sed"]( - makeconf, "^{}=.*".format(var), '{}="{}"'.format(var, value) - ) + __salt__["file.sed"](makeconf, f"^{var}=.*", f'{var}="{value}"') else: _add_var(var, value) @@ -108,7 +106,7 @@ def remove_var(var): # If var is in file if old_value is not None: - __salt__["file.sed"](makeconf, "^{}=.*".format(var), "") + __salt__["file.sed"](makeconf, f"^{var}=.*", "") new_value = get_var(var) return {var: {"old": old_value, "new": new_value}} @@ -135,10 +133,8 @@ def append_var(var, value): # If var already in file, add to its value if old_value is not None: - appended_value = "{} {}".format(old_value, value) - __salt__["file.sed"]( - makeconf, "^{}=.*".format(var), '{}="{}"'.format(var, appended_value) - ) + appended_value = f"{old_value} {value}" + __salt__["file.sed"](makeconf, f"^{var}=.*", f'{var}="{appended_value}"') else: _add_var(var, value) diff --git a/salt/modules/marathon.py b/salt/modules/marathon.py index 04e910dd5fd..6c2c73b429a 100644 --- a/salt/modules/marathon.py +++ b/salt/modules/marathon.py @@ -43,7 +43,7 @@ def _app_id(app_id): Make sure the app_id is in the correct format. """ if app_id[0] != "/": - app_id = "/{}".format(app_id) + app_id = f"/{app_id}" return app_id @@ -58,7 +58,7 @@ def apps(): salt marathon-minion-id marathon.apps """ response = salt.utils.http.query( - "{}/v2/apps".format(_base_url()), + f"{_base_url()}/v2/apps", decode_type="json", decode=True, ) @@ -89,7 +89,7 @@ def app(id): salt marathon-minion-id marathon.app my-app """ response = salt.utils.http.query( - "{}/v2/apps/{}".format(_base_url(), id), + f"{_base_url()}/v2/apps/{id}", decode_type="json", decode=True, ) @@ -115,7 +115,7 @@ def update_app(id, config): data = salt.utils.json.dumps(config) try: response = salt.utils.http.query( - "{}/v2/apps/{}?force=true".format(_base_url(), id), + f"{_base_url()}/v2/apps/{id}?force=true", method="PUT", decode_type="json", decode=True, @@ -143,7 +143,7 @@ def rm_app(id): salt marathon-minion-id marathon.rm_app my-app """ response = salt.utils.http.query( - "{}/v2/apps/{}".format(_base_url(), id), + f"{_base_url()}/v2/apps/{id}", method="DELETE", decode_type="json", decode=True, @@ -162,7 +162,7 @@ def info(): salt marathon-minion-id marathon.info """ response = salt.utils.http.query( - "{}/v2/info".format(_base_url()), + f"{_base_url()}/v2/info", decode_type="json", decode=True, ) @@ -201,7 +201,7 @@ def restart_app(id, restart=False, force=True): return ret try: response = salt.utils.http.query( - "{}/v2/apps/{}/restart?force={}".format(_base_url(), _app_id(id), force), + f"{_base_url()}/v2/apps/{_app_id(id)}/restart?force={force}", method="POST", decode_type="json", decode=True, diff --git a/salt/modules/mdadm_raid.py b/salt/modules/mdadm_raid.py index 7333101cbaa..85e5d1e6247 100644 --- a/salt/modules/mdadm_raid.py +++ b/salt/modules/mdadm_raid.py @@ -143,7 +143,7 @@ def destroy(device): cfg_file = "/etc/mdadm.conf" try: - __salt__["file.replace"](cfg_file, "ARRAY {} .*".format(device), "") + __salt__["file.replace"](cfg_file, f"ARRAY {device} .*", "") except SaltInvocationError: pass @@ -230,7 +230,7 @@ def create(name, level, devices, metadata="default", test_mode=False, **kwargs): for key in kwargs: if not key.startswith("__"): - opts.append("--{}".format(key)) + opts.append(f"--{key}") if kwargs[key] is not True: opts.append(str(kwargs[key])) if key == "spare-devices": @@ -275,7 +275,7 @@ def save_config(): buggy_ubuntu_tags = ["name", "metadata"] for i, elem in enumerate(scan): for bad_tag in buggy_ubuntu_tags: - pattern = r"\s{}=\S+".format(re.escape(bad_tag)) + pattern = rf"\s{re.escape(bad_tag)}=\S+" pattern = re.compile(pattern, flags=re.I) scan[i] = re.sub(pattern, "", scan[i]) @@ -335,7 +335,7 @@ def assemble(name, devices, test_mode=False, **kwargs): opts = [] for key in kwargs: if not key.startswith("__"): - opts.append("--{}".format(key)) + opts.append(f"--{key}") if kwargs[key] is not True: opts.append(kwargs[key]) @@ -368,7 +368,7 @@ def examine(device, quiet=False): salt '*' raid.examine '/dev/sda1' """ res = __salt__["cmd.run_stdout"]( - "mdadm -Y -E {}".format(device), python_shell=False, ignore_retcode=quiet + f"mdadm -Y -E {device}", python_shell=False, ignore_retcode=quiet ) ret = {} @@ -390,7 +390,7 @@ def add(name, device): """ - cmd = "mdadm --manage {} --add {}".format(name, device) + cmd = f"mdadm --manage {name} --add {device}" if __salt__["cmd.retcode"](cmd) == 0: return True return False diff --git a/salt/modules/mdata.py b/salt/modules/mdata.py index 8075922a5ef..94415b7c39b 100644 --- a/salt/modules/mdata.py +++ b/salt/modules/mdata.py @@ -68,7 +68,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded on SmartOS zones".format(__virtualname__), + f"{__virtualname__} module can only be loaded on SmartOS zones", ) @@ -84,7 +84,7 @@ def list_(): """ mdata = _check_mdata_list() if mdata: - cmd = "{}".format(mdata) + cmd = f"{mdata}" return __salt__["cmd.run"](cmd, ignore_retcode=True).splitlines() return {} @@ -115,7 +115,7 @@ def get_(*keyname): for k in keyname: if mdata: - cmd = "{} {}".format(mdata, k) + cmd = f"{mdata} {k}" res = __salt__["cmd.run_all"](cmd, ignore_retcode=True) ret[k] = res["stdout"] if res["retcode"] == 0 else "" else: @@ -143,7 +143,7 @@ def put_(keyname, val): ret = {} if mdata: - cmd = "echo {2} | {0} {1}".format(mdata, keyname, val) + cmd = f"echo {val} | {mdata} {keyname}" ret = __salt__["cmd.run_all"](cmd, python_shell=True, ignore_retcode=True) return ret["retcode"] == 0 @@ -169,7 +169,7 @@ def delete_(*keyname): for k in keyname: if mdata and k in valid_keynames: - cmd = "{} {}".format(mdata, k) + cmd = f"{mdata} {k}" ret[k] = __salt__["cmd.run_all"](cmd, ignore_retcode=True)["retcode"] == 0 else: ret[k] = True diff --git a/salt/modules/memcached.py b/salt/modules/memcached.py index d8c2cf6d01b..4c6cc558e18 100644 --- a/salt/modules/memcached.py +++ b/salt/modules/memcached.py @@ -51,7 +51,7 @@ def _connect(host=DEFAULT_HOST, port=DEFAULT_PORT): values assigned to missing values. """ if str(port).isdigit(): - return memcache.Client(["{}:{}".format(host, port)], debug=0) + return memcache.Client([f"{host}:{port}"], debug=0) raise SaltInvocationError("port must be an integer") @@ -214,10 +214,10 @@ def increment(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT): cur = get(key) if cur is None: - raise CommandExecutionError("Key '{}' does not exist".format(key)) + raise CommandExecutionError(f"Key '{key}' does not exist") elif not isinstance(cur, int): raise CommandExecutionError( - "Value for key '{}' must be an integer to be incremented".format(key) + f"Value for key '{key}' must be an integer to be incremented" ) try: @@ -245,10 +245,10 @@ def decrement(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT): cur = get(key) if cur is None: - raise CommandExecutionError("Key '{}' does not exist".format(key)) + raise CommandExecutionError(f"Key '{key}' does not exist") elif not isinstance(cur, int): raise CommandExecutionError( - "Value for key '{}' must be an integer to be decremented".format(key) + f"Value for key '{key}' must be an integer to be decremented" ) try: diff --git a/salt/modules/minion.py b/salt/modules/minion.py index e93b2783c80..bed8f437f75 100644 --- a/salt/modules/minion.py +++ b/salt/modules/minion.py @@ -212,12 +212,12 @@ def restart(): restart_cmd = __salt__["config.get"]("minion_restart_command") if restart_cmd: comment.append("Using configuration minion_restart_command:") - comment.extend([" {}".format(arg) for arg in restart_cmd]) + comment.extend([f" {arg}" for arg in restart_cmd]) else: if "-d" in sys.argv: restart_cmd = sys.argv comment.append("Restart using process argv:") - comment.extend([" {}".format(arg) for arg in restart_cmd]) + comment.extend([f" {arg}" for arg in restart_cmd]) else: should_restart = False comment.append( diff --git a/salt/modules/modjk.py b/salt/modules/modjk.py index 9b1ec755f61..fb968a7a986 100644 --- a/salt/modules/modjk.py +++ b/salt/modules/modjk.py @@ -60,25 +60,25 @@ def _do_http(opts, profile="default"): ret = {} - url = __salt__["config.get"]("modjk:{}:url".format(profile), "") - user = __salt__["config.get"]("modjk:{}:user".format(profile), "") - passwd = __salt__["config.get"]("modjk:{}:pass".format(profile), "") - realm = __salt__["config.get"]("modjk:{}:realm".format(profile), "") - timeout = __salt__["config.get"]("modjk:{}:timeout".format(profile), "") + url = __salt__["config.get"](f"modjk:{profile}:url", "") + user = __salt__["config.get"](f"modjk:{profile}:user", "") + passwd = __salt__["config.get"](f"modjk:{profile}:pass", "") + realm = __salt__["config.get"](f"modjk:{profile}:realm", "") + timeout = __salt__["config.get"](f"modjk:{profile}:timeout", "") if not url: - raise Exception("missing url in profile {}".format(profile)) + raise Exception(f"missing url in profile {profile}") if user and passwd: auth = _auth(url=url, realm=realm, user=user, passwd=passwd) urllib.request.install_opener(auth) - url += "?{}".format(urllib.parse.urlencode(opts)) + url += f"?{urllib.parse.urlencode(opts)}" for line in urllib.request.urlopen(url, timeout=timeout).read().splitlines(): splt = line.split("=", 1) if splt[0] in ret: - ret[splt[0]] += ",{}".format(splt[1]) + ret[splt[0]] += f",{splt[1]}" else: ret[splt[0]] = splt[1] @@ -172,7 +172,7 @@ def list_configured_members(lbn, profile="default"): config = dump_config(profile) try: - ret = config["worker.{}.balance_workers".format(lbn)] + ret = config[f"worker.{lbn}.balance_workers"] except KeyError: return [] @@ -198,9 +198,7 @@ def workers(profile="default"): for lb in lbn: try: - worker_list.extend( - config["worker.{}.balance_workers".format(lb)].split(",") - ) + worker_list.extend(config[f"worker.{lb}.balance_workers"].split(",")) except KeyError: pass @@ -208,8 +206,8 @@ def workers(profile="default"): for worker in worker_list: ret[worker] = { - "activation": config["worker.{}.activation".format(worker)], - "state": config["worker.{}.state".format(worker)], + "activation": config[f"worker.{worker}.activation"], + "state": config[f"worker.{worker}.state"], } return ret @@ -230,7 +228,7 @@ def recover_all(lbn, profile="default"): ret = {} config = get_running(profile) try: - workers_ = config["worker.{}.balance_workers".format(lbn)].split(",") + workers_ = config[f"worker.{lbn}.balance_workers"].split(",") except KeyError: return ret @@ -418,8 +416,8 @@ def worker_status(worker, profile="default"): config = get_running(profile) try: return { - "activation": config["worker.{}.activation".format(worker)], - "state": config["worker.{}.state".format(worker)], + "activation": config[f"worker.{worker}.activation"], + "state": config[f"worker.{worker}.state"], } except KeyError: return False diff --git a/salt/modules/mongodb.py b/salt/modules/mongodb.py index 72b0ff00747..699dcfd48e9 100644 --- a/salt/modules/mongodb.py +++ b/salt/modules/mongodb.py @@ -236,7 +236,7 @@ def version( """ conn = _connect(user, password, host, port, authdb=authdb) if not conn: - err_msg = "Failed to connect to MongoDB database {}:{}".format(host, port) + err_msg = f"Failed to connect to MongoDB database {host}:{port}" log.error(err_msg) return (False, err_msg) @@ -283,7 +283,7 @@ def user_find( """ conn = _connect(user, password, host, port, authdb=authdb) if not conn: - err_msg = "Failed to connect to MongoDB database {}:{}".format(host, port) + err_msg = f"Failed to connect to MongoDB database {host}:{port}" log.error(err_msg) return (False, err_msg) @@ -993,7 +993,7 @@ def update_one( col = getattr(mdb, collection) ids = col.update_one(_id_field, {"$set": _update_doc}) nb_mod = ids.modified_count - return "{} objects updated".format(nb_mod) + return f"{nb_mod} objects updated" except pymongo.errors.PyMongoError as err: log.error("Updating object %s failed with error %s", objects, err) return err @@ -1139,7 +1139,7 @@ def remove( for count in range(0, w): res = col.delete_one(query) deleted_count += res.deleted_count - return "{} objects removed".format(deleted_count) + return f"{deleted_count} objects removed" except pymongo.errors.PyMongoError as err: log.error("Removing objects failed with error: %s", _get_error_message(err)) return _get_error_message(err) diff --git a/salt/modules/monit.py b/salt/modules/monit.py index 65d9da8286c..3f685f6f5d9 100644 --- a/salt/modules/monit.py +++ b/salt/modules/monit.py @@ -34,7 +34,7 @@ def start(name): salt '*' monit.start """ - cmd = "monit start {}".format(name) + cmd = f"monit start {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -49,7 +49,7 @@ def stop(name): salt '*' monit.stop """ - cmd = "monit stop {}".format(name) + cmd = f"monit stop {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -64,7 +64,7 @@ def restart(name): salt '*' monit.restart """ - cmd = "monit restart {}".format(name) + cmd = f"monit restart {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -79,7 +79,7 @@ def unmonitor(name): salt '*' monit.unmonitor """ - cmd = "monit unmonitor {}".format(name) + cmd = f"monit unmonitor {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -94,7 +94,7 @@ def monitor(name): salt '*' monit.monitor """ - cmd = "monit monitor {}".format(name) + cmd = f"monit monitor {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) diff --git a/salt/modules/mount.py b/salt/modules/mount.py index f27575fc8ed..f898c32e214 100644 --- a/salt/modules/mount.py +++ b/salt/modules/mount.py @@ -196,7 +196,7 @@ def _active_mounts_openbsd(ret): comps = re.sub(r"\s+", " ", line).split() parens = re.findall(r"\((.*?)\)", line, re.DOTALL) if len(parens) > 1: - nod = __salt__["cmd.run_stdout"]("ls -l {}".format(comps[0])) + nod = __salt__["cmd.run_stdout"](f"ls -l {comps[0]}") nod = " ".join(nod.split()).split(" ") ret[comps[3]] = { "device": comps[0], @@ -305,7 +305,7 @@ class _fstab_entry: @classmethod def dict_from_line(cls, line, keys=fstab_keys): if len(keys) != 6: - raise ValueError("Invalid key array: {}".format(keys)) + raise ValueError(f"Invalid key array: {keys}") if line.startswith("#"): raise cls.ParseError("Comment!") @@ -522,12 +522,12 @@ class _FileSystemsEntry: @classmethod def dict_from_lines(cls, lines, keys=filesystems_keys): if len(lines) < 2: - raise ValueError("Invalid number of lines: {}".format(lines)) + raise ValueError(f"Invalid number of lines: {lines}") if not keys: # if empty force default filesystems_keys keys = _FileSystemsEntry.filesystems_keys elif len(keys) < 6: - raise ValueError("Invalid key name array: {}".format(keys)) + raise ValueError(f"Invalid key name array: {keys}") blk_lines = lines orddict = OrderedDict() @@ -545,9 +545,7 @@ class _FileSystemsEntry: if key_name in keys: orddict[key_name] = comps[1].strip() else: - raise ValueError( - "Invalid name for use in filesystems: {}".format(key_name) - ) + raise ValueError(f"Invalid name for use in filesystems: {key_name}") return orddict @@ -574,7 +572,7 @@ class _FileSystemsEntry: strg_out = entry["name"] + ":" + os.linesep for k, v in entry.items(): if "name" not in k: - strg_out += "\t{}\t\t= {}".format(k, v) + os.linesep + strg_out += f"\t{k}\t\t= {v}" + os.linesep strg_out += os.linesep return str(strg_out) @@ -585,7 +583,7 @@ class _FileSystemsEntry: list_out.append(str(entry["name"] + ":" + os.linesep)) for k, v in entry.items(): if "name" not in k: - list_out.append(str("\t{}\t\t= {}".format(k, v) + os.linesep)) + list_out.append(str(f"\t{k}\t\t= {v}" + os.linesep)) list_out.append(str(os.linesep)) return list_out @@ -792,7 +790,7 @@ def set_fstab( test=False, match_on="auto", not_change=False, - **kwargs + **kwargs, ): """ Verify that this mount is represented in the fstab, change the mount @@ -871,12 +869,12 @@ def set_fstab( invalid_keys = filter(filterFn, match_on) - msg = 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) + msg = f'Unrecognized keys in match_on: "{invalid_keys}"' raise CommandExecutionError(msg) # parse file, use ret to cache status if not os.path.isfile(config): - raise CommandExecutionError('Bad config file "{}"'.format(config)) + raise CommandExecutionError(f'Bad config file "{config}"') try: with salt.utils.files.fopen(config, "r") as ifile: @@ -932,7 +930,7 @@ def set_vfstab( test=False, match_on="auto", not_change=False, - **kwargs + **kwargs, ): """ .. versionadded:: 2016.3.2 @@ -1004,12 +1002,12 @@ def set_vfstab( invalid_keys = filter(filterFn, match_on) - msg = 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) + msg = f'Unrecognized keys in match_on: "{invalid_keys}"' raise CommandExecutionError(msg) # parse file, use ret to cache status if not os.path.isfile(config): - raise CommandExecutionError('Bad config file "{}"'.format(config)) + raise CommandExecutionError(f'Bad config file "{config}"') try: with salt.utils.files.fopen(config, "r") as ifile: @@ -1122,7 +1120,7 @@ def set_automaster( config="/etc/auto_salt", test=False, not_change=False, - **kwargs + **kwargs, ): """ Verify that this mount is represented in the auto_salt, change the mount @@ -1144,11 +1142,11 @@ def set_automaster( if not os.path.isfile(config): __salt__["file.touch"](config) - __salt__["file.append"](automaster_file, "/-\t\t\t{}".format(config)) + __salt__["file.append"](automaster_file, f"/-\t\t\t{config}") - name = "/..{}".format(name) - device_fmt = "{}:{}".format(fstype, device) - type_opts = "-fstype={},{}".format(fstype, opts) + name = f"/..{name}" + device_fmt = f"{fstype}:{device}" + type_opts = f"-fstype={fstype},{opts}" if fstype == "smbfs": device_fmt = device_fmt.replace(fstype, "") @@ -1190,7 +1188,7 @@ def set_automaster( "auto_master entry for mount point %s needs to be updated", name, ) - newline = "{}\t{}\t{}\n".format(name, type_opts, device_fmt) + newline = f"{name}\t{type_opts}\t{device_fmt}\n" lines.append(newline) else: lines.append(line) @@ -1217,14 +1215,14 @@ def set_automaster( else: if not salt.utils.args.test_mode(test=test, **kwargs): # The entry is new, add it to the end of the fstab - newline = "{}\t{}\t{}\n".format(name, type_opts, device_fmt) + newline = f"{name}\t{type_opts}\t{device_fmt}\n" lines.append(newline) try: with salt.utils.files.fopen(config, "wb") as ofile: # The line was changed, commit it! ofile.writelines(salt.utils.data.encode(lines)) except OSError: - raise CommandExecutionError("File not writable {}".format(config)) + raise CommandExecutionError(f"File not writable {config}") return "new" @@ -1285,7 +1283,7 @@ def mount( if not mnt: return False first = next(iter(mnt.keys())) - __context__["img.mnt_{}".format(first)] = mnt + __context__[f"img.mnt_{first}"] = mnt return first return False @@ -1302,24 +1300,24 @@ def mount( args = "" if opts is not None: lopts = ",".join(opts) - args = "-o {}".format(lopts) + args = f"-o {lopts}" if fstype: # use of fstype on AIX differs from typical Linux use of -t # functionality AIX uses -v vfsname, -t fstype mounts all with # fstype in /etc/filesystems if "AIX" in __grains__["os"]: - args += " -v {}".format(fstype) + args += f" -v {fstype}" elif "solaris" in __grains__["os"].lower(): - args += " -F {}".format(fstype) + args += f" -F {fstype}" else: - args += " -t {}".format(fstype) + args += f" -t {fstype}" cmd = "mount " if device: - cmd += "{} '{}' '{}' ".format(args, device, name) + cmd += f"{args} '{device}' '{name}' " else: - cmd += "'{}' ".format(name) + cmd += f"'{name}' " out = __salt__["cmd.run_all"](cmd, runas=user, python_shell=False) if out["retcode"]: return out["stderr"] @@ -1365,23 +1363,23 @@ def remount(name, device, mkmnt=False, fstype="", opts="defaults", user=None): args = "" if opts: lopts = ",".join(opts) - args = "-o {}".format(lopts) + args = f"-o {lopts}" if fstype: # use of fstype on AIX differs from typical Linux use of # -t functionality AIX uses -v vfsname, -t fstype mounts # all with fstype in /etc/filesystems if "AIX" in __grains__["os"]: - args += " -v {}".format(fstype) + args += f" -v {fstype}" elif "solaris" in __grains__["os"].lower(): - args += " -F {}".format(fstype) + args += f" -F {fstype}" else: - args += " -t {}".format(fstype) + args += f" -t {fstype}" if __grains__["os"] not in ["OpenBSD", "MacOS", "Darwin"] or force_mount: - cmd = "mount {} '{}' '{}' ".format(args, device, name) + cmd = f"mount {args} '{device}' '{name}' " else: - cmd = "mount -u {} '{}' '{}' ".format(args, device, name) + cmd = f"mount -u {args} '{device}' '{name}' " out = __salt__["cmd.run_all"](cmd, runas=user, python_shell=False) if out["retcode"]: return out["stderr"] @@ -1412,18 +1410,18 @@ def umount(name, device=None, user=None, util="mount"): elif util == "qemu_nbd": # This functionality used to live in img.umount_image if "qemu_nbd.clear" in __salt__: - if "img.mnt_{}".format(name) in __context__: - __salt__["qemu_nbd.clear"](__context__["img.mnt_{}".format(name)]) + if f"img.mnt_{name}" in __context__: + __salt__["qemu_nbd.clear"](__context__[f"img.mnt_{name}"]) return mnts = active() if name not in mnts: - return "{} does not have anything mounted".format(name) + return f"{name} does not have anything mounted" if not device: - cmd = "umount '{}'".format(name) + cmd = f"umount '{name}'" else: - cmd = "umount '{}'".format(device) + cmd = f"umount '{device}'" out = __salt__["cmd.run_all"](cmd, runas=user, python_shell=False) if out["retcode"]: return out["stderr"] @@ -1448,7 +1446,7 @@ def is_fuse_exec(cmd): elif not salt.utils.path.which("ldd"): raise CommandNotFoundError("ldd") - out = __salt__["cmd.run"]("ldd {}".format(cmd_path), python_shell=False) + out = __salt__["cmd.run"](f"ldd {cmd_path}", python_shell=False) return "libfuse" in out @@ -1540,13 +1538,13 @@ def swapon(name, priority=None): if __grains__["kernel"] == "SunOS": if __grains__["virtual"] != "zone": - __salt__["cmd.run"]("swap -a '{}'".format(name), python_shell=False) + __salt__["cmd.run"](f"swap -a '{name}'", python_shell=False) else: return False else: - cmd = "swapon '{}'".format(name) + cmd = f"swapon '{name}'" if priority and "AIX" not in __grains__["kernel"]: - cmd += " -p {}".format(priority) + cmd += f" -p {priority}" __salt__["cmd.run"](cmd, python_shell=False) on_ = swaps() @@ -1574,13 +1572,13 @@ def swapoff(name): if name in on_: if __grains__["kernel"] == "SunOS": if __grains__["virtual"] != "zone": - __salt__["cmd.run"]("swap -a '{}'".format(name), python_shell=False) + __salt__["cmd.run"](f"swap -a '{name}'", python_shell=False) else: return False elif __grains__["os"] != "OpenBSD": - __salt__["cmd.run"]("swapoff '{}'".format(name), python_shell=False) + __salt__["cmd.run"](f"swapoff '{name}'", python_shell=False) else: - __salt__["cmd.run"]("swapctl -d '{}'".format(name), python_shell=False) + __salt__["cmd.run"](f"swapctl -d '{name}'", python_shell=False) on_ = swaps() if name in on_: return False @@ -1784,7 +1782,7 @@ def set_filesystems( test=False, match_on="auto", not_change=False, - **kwargs + **kwargs, ): """ .. versionadded:: 2018.3.3 @@ -1888,13 +1886,11 @@ def set_filesystems( return key not in _FileSystemsEntry.compatibility_keys invalid_keys = filter(filterFn, match_on) - raise CommandExecutionError( - 'Unrecognized keys in match_on: "{}"'.format(invalid_keys) - ) + raise CommandExecutionError(f'Unrecognized keys in match_on: "{invalid_keys}"') # parse file, use ret to cache status if not os.path.isfile(config): - raise CommandExecutionError('Bad config file "{}"'.format(config)) + raise CommandExecutionError(f'Bad config file "{config}"') # read in block of filesystem, block starts with '/' till empty line try: @@ -1912,7 +1908,7 @@ def set_filesystems( view_lines.append(fsys_view) except OSError as exc: - raise CommandExecutionError("Couldn't read from {}: {}".format(config, exc)) + raise CommandExecutionError(f"Couldn't read from {config}: {exc}") # add line if not present or changed if ret is None: @@ -1930,7 +1926,7 @@ def set_filesystems( ofile.writelines(salt.utils.data.encode(list_strgs)) except OSError: - raise CommandExecutionError("File not writable {}".format(config)) + raise CommandExecutionError(f"File not writable {config}") except Exception as exc: raise CommandExecutionError("set_filesystems error exception {exc}") @@ -1969,7 +1965,7 @@ def rm_filesystems(name, device, config="/etc/filesystems"): view_lines.append(fsys_view) except OSError as exc: - raise CommandExecutionError("Couldn't read from {}: {}".format(config, exc)) + raise CommandExecutionError(f"Couldn't read from {config}: {exc}") if modified: try: @@ -1979,7 +1975,7 @@ def rm_filesystems(name, device, config="/etc/filesystems"): list_strgs = _FileSystemsEntry.dict_to_list_lines(entry) ofile.writelines(salt.utils.data.encode(list_strgs)) except OSError as exc: - raise CommandExecutionError("Couldn't write to {}: {}".format(config, exc)) + raise CommandExecutionError(f"Couldn't write to {config}: {exc}") except Exception as exc: raise CommandExecutionError("rm_filesystems error exception {exc}") diff --git a/salt/modules/mssql.py b/salt/modules/mssql.py index 9254d78fe5d..23ca6577542 100644 --- a/salt/modules/mssql.py +++ b/salt/modules/mssql.py @@ -139,7 +139,7 @@ def db_exists(database_name, **kwargs): "SELECT database_id FROM sys.databases WHERE NAME='{}'".format( database_name ), - **kwargs + **kwargs, ) ) == 1 @@ -160,7 +160,7 @@ def db_create(database, containment="NONE", new_database_options=None, **kwargs) """ if containment not in ["NONE", "PARTIAL"]: return "CONTAINMENT can be one of NONE and PARTIAL" - sql = "CREATE DATABASE [{}] CONTAINMENT = {} ".format(database, containment) + sql = f"CREATE DATABASE [{database}] CONTAINMENT = {containment} " if new_database_options: sql += " WITH " + ", ".join(new_database_options) conn = None @@ -171,7 +171,7 @@ def db_create(database, containment="NONE", new_database_options=None, **kwargs) # cur.execute(sql) conn.cursor().execute(sql) except Exception as e: # pylint: disable=broad-except - return "Could not create the database: {}".format(e) + return f"Could not create the database: {e}" finally: if conn: conn.autocommit(False) @@ -205,14 +205,14 @@ def db_remove(database_name, **kwargs): database_name ) ) - cur.execute("DROP DATABASE {}".format(database_name)) + cur.execute(f"DROP DATABASE {database_name}") conn.autocommit(False) conn.close() return True else: return False except Exception as e: # pylint: disable=broad-except - return "Could not find the database: {}".format(e) + return f"Could not find the database: {e}" def role_list(**kwargs): @@ -239,10 +239,7 @@ def role_exists(role, **kwargs): salt minion mssql.role_exists db_owner """ # We should get one, and only one row - return ( - len(tsql_query(query='sp_helprole "{}"'.format(role), as_dict=True, **kwargs)) - == 1 - ) + return len(tsql_query(query=f'sp_helprole "{role}"', as_dict=True, **kwargs)) == 1 def role_create(role, owner=None, grants=None, **kwargs): @@ -261,9 +258,9 @@ def role_create(role, owner=None, grants=None, **kwargs): if not grants: grants = [] - sql = "CREATE ROLE {}".format(role) + sql = f"CREATE ROLE {role}" if owner: - sql += " AUTHORIZATION {}".format(owner) + sql += f" AUTHORIZATION {owner}" conn = None try: conn = _get_connection(**kwargs) @@ -272,9 +269,9 @@ def role_create(role, owner=None, grants=None, **kwargs): # cur.execute(sql) conn.cursor().execute(sql) for grant in grants: - conn.cursor().execute("GRANT {} TO [{}]".format(grant, role)) + conn.cursor().execute(f"GRANT {grant} TO [{role}]") except Exception as e: # pylint: disable=broad-except - return "Could not create the role: {}".format(e) + return f"Could not create the role: {e}" finally: if conn: conn.autocommit(False) @@ -296,12 +293,12 @@ def role_remove(role, **kwargs): conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() - cur.execute("DROP ROLE {}".format(role)) + cur.execute(f"DROP ROLE {role}") conn.autocommit(True) conn.close() return True except Exception as e: # pylint: disable=broad-except - return "Could not remove the role: {}".format(e) + return f"Could not remove the role: {e}" def login_exists(login, domain="", **kwargs): @@ -316,7 +313,7 @@ def login_exists(login, domain="", **kwargs): salt minion mssql.login_exists 'LOGIN' """ if domain: - login = "{}\\{}".format(domain, login) + login = f"{domain}\\{login}" try: # We should get one, and only one row return ( @@ -325,14 +322,14 @@ def login_exists(login, domain="", **kwargs): query="SELECT name FROM sys.syslogins WHERE name='{}'".format( login ), - **kwargs + **kwargs, ) ) == 1 ) except Exception as e: # pylint: disable=broad-except - return "Could not find the login: {}".format(e) + return f"Could not find the login: {e}" def login_create( @@ -341,7 +338,7 @@ def login_create( new_login_domain="", new_login_roles=None, new_login_options=None, - **kwargs + **kwargs, ): """ Creates a new login. Does not update password of existing logins. For @@ -368,19 +365,19 @@ def login_create( if login_exists(login, new_login_domain, **kwargs): return False if new_login_domain: - login = "{}\\{}".format(new_login_domain, login) + login = f"{new_login_domain}\\{login}" if not new_login_roles: new_login_roles = [] if not new_login_options: new_login_options = [] - sql = "CREATE LOGIN [{}] ".format(login) + sql = f"CREATE LOGIN [{login}] " if new_login_domain: sql += " FROM WINDOWS " elif isinstance(new_login_password, int): - new_login_options.insert(0, "PASSWORD=0x{:x} HASHED".format(new_login_password)) + new_login_options.insert(0, f"PASSWORD=0x{new_login_password:x} HASHED") else: # Plain test password - new_login_options.insert(0, "PASSWORD=N'{}'".format(new_login_password)) + new_login_options.insert(0, f"PASSWORD=N'{new_login_password}'") if new_login_options: sql += " WITH " + ", ".join(new_login_options) conn = None @@ -391,11 +388,9 @@ def login_create( # cur.execute(sql) conn.cursor().execute(sql) for role in new_login_roles: - conn.cursor().execute( - "ALTER SERVER ROLE [{}] ADD MEMBER [{}]".format(role, login) - ) + conn.cursor().execute(f"ALTER SERVER ROLE [{role}] ADD MEMBER [{login}]") except Exception as e: # pylint: disable=broad-except - return "Could not create the login: {}".format(e) + return f"Could not create the login: {e}" finally: if conn: conn.autocommit(False) @@ -417,12 +412,12 @@ def login_remove(login, **kwargs): conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() - cur.execute("DROP LOGIN [{}]".format(login)) + cur.execute(f"DROP LOGIN [{login}]") conn.autocommit(False) conn.close() return True except Exception as e: # pylint: disable=broad-except - return "Could not remove the login: {}".format(e) + return f"Could not remove the login: {e}" def user_exists(username, domain="", database=None, **kwargs): @@ -437,15 +432,14 @@ def user_exists(username, domain="", database=None, **kwargs): salt minion mssql.user_exists 'USERNAME' [database='DBNAME'] """ if domain: - username = "{}\\{}".format(domain, username) + username = f"{domain}\\{username}" if database: kwargs["database"] = database # We should get one, and only one row return ( len( tsql_query( - query="SELECT name FROM sysusers WHERE name='{}'".format(username), - **kwargs + query=f"SELECT name FROM sysusers WHERE name='{username}'", **kwargs ) ) == 1 @@ -467,7 +461,7 @@ def user_list(**kwargs): for row in tsql_query( "SELECT name FROM sysusers where issqluser=1 or isntuser=1", as_dict=False, - **kwargs + **kwargs, ) ] @@ -489,10 +483,10 @@ def user_create( if domain and not login: return "domain cannot be set without login" if user_exists(username, domain, **kwargs): - return "User {} already exists".format(username) + return f"User {username} already exists" if domain: - username = "{}\\{}".format(domain, username) - login = "{}\\{}".format(domain, login) if login else login + username = f"{domain}\\{username}" + login = f"{domain}\\{login}" if login else login if database: kwargs["database"] = database if not roles: @@ -500,12 +494,12 @@ def user_create( if not options: options = [] - sql = "CREATE USER [{}] ".format(username) + sql = f"CREATE USER [{username}] " if login: # If the login does not exist, user creation will throw # if not login_exists(name, **kwargs): # return False - sql += " FOR LOGIN [{}]".format(login) + sql += f" FOR LOGIN [{login}]" else: # Plain test password sql += " WITHOUT LOGIN" if options: @@ -518,11 +512,9 @@ def user_create( # cur.execute(sql) conn.cursor().execute(sql) for role in roles: - conn.cursor().execute( - "ALTER ROLE [{}] ADD MEMBER [{}]".format(role, username) - ) + conn.cursor().execute(f"ALTER ROLE [{role}] ADD MEMBER [{username}]") except Exception as e: # pylint: disable=broad-except - return "Could not create the user: {}".format(e) + return f"Could not create the user: {e}" finally: if conn: conn.autocommit(False) @@ -547,9 +539,9 @@ def user_remove(username, **kwargs): conn = _get_connection(**kwargs) conn.autocommit(True) cur = conn.cursor() - cur.execute("DROP USER {}".format(username)) + cur.execute(f"DROP USER {username}") conn.autocommit(False) conn.close() return True except Exception as e: # pylint: disable=broad-except - return "Could not remove the user: {}".format(e) + return f"Could not remove the user: {e}" diff --git a/salt/modules/munin.py b/salt/modules/munin.py index ced668011f0..764135fc485 100644 --- a/salt/modules/munin.py +++ b/salt/modules/munin.py @@ -49,9 +49,7 @@ def run(plugins): if plugin not in all_plugins: continue data[plugin] = {} - muninout = __salt__["cmd.run"]( - "munin-run {}".format(plugin), python_shell=False - ) + muninout = __salt__["cmd.run"](f"munin-run {plugin}", python_shell=False) for line in muninout.split("\n"): if "value" in line: # This skips multigraph lines, etc key, val = line.split(" ") diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py index 522b8858ce7..c3d234a73d6 100644 --- a/salt/modules/mysql.py +++ b/salt/modules/mysql.py @@ -263,7 +263,7 @@ def __virtual__(): def __mysql_hash_password(password): _password = hashlib.sha1(password.encode()).digest() - _password = "*{}".format(hashlib.sha1(_password).hexdigest().upper()) + _password = f"*{hashlib.sha1(_password).hexdigest().upper()}" return _password @@ -275,7 +275,7 @@ def __check_table(name, table, **connection_args): s_name = quote_identifier(name) s_table = quote_identifier(table) # identifiers cannot be used as values - qry = "CHECK TABLE {}.{}".format(s_name, s_table) + qry = f"CHECK TABLE {s_name}.{s_table}" _execute(cur, qry) results = cur.fetchall() log.debug(results) @@ -290,7 +290,7 @@ def __repair_table(name, table, **connection_args): s_name = quote_identifier(name) s_table = quote_identifier(table) # identifiers cannot be used as values - qry = "REPAIR TABLE {}.{}".format(s_name, s_table) + qry = f"REPAIR TABLE {s_name}.{s_table}" _execute(cur, qry) results = cur.fetchall() log.debug(results) @@ -305,7 +305,7 @@ def __optimize_table(name, table, **connection_args): s_name = quote_identifier(name) s_table = quote_identifier(table) # identifiers cannot be used as values - qry = "OPTIMIZE TABLE {}.{}".format(s_name, s_table) + qry = f"OPTIMIZE TABLE {s_name}.{s_table}" _execute(cur, qry) results = cur.fetchall() log.debug(results) @@ -386,7 +386,7 @@ def _connect(**kwargs): name = name[len(prefix) :] except IndexError: return - val = __salt__["config.option"]("mysql.{}".format(name), None) + val = __salt__["config.option"](f"mysql.{name}", None) if val is not None: connargs[key] = val @@ -581,7 +581,7 @@ def _grant_to_tokens(grant): if not column: current_grant = token else: - token = "{}.{}".format(current_grant, token) + token = f"{current_grant}.{token}" grant_tokens.append(token) else: # This is a multi-word, ala LOCK TABLES multiword_statement.append(token) @@ -1249,7 +1249,7 @@ def db_tables(name, **connection_args): cur = dbc.cursor() s_name = quote_identifier(name) # identifiers cannot be used as values - qry = "SHOW TABLES IN {}".format(s_name) + qry = f"SHOW TABLES IN {s_name}" try: _execute(cur, qry) except MySQLdb.OperationalError as exc: @@ -1328,7 +1328,7 @@ def db_create(name, character_set=None, collate=None, **connection_args): cur = dbc.cursor() s_name = quote_identifier(name) # identifiers cannot be used as values - qry = "CREATE DATABASE IF NOT EXISTS {}".format(s_name) + qry = f"CREATE DATABASE IF NOT EXISTS {s_name}" args = {} if character_set is not None: qry += " CHARACTER SET %(character_set)s" @@ -1375,7 +1375,7 @@ def db_remove(name, **connection_args): cur = dbc.cursor() s_name = quote_identifier(name) # identifiers cannot be used as values - qry = "DROP DATABASE {};".format(s_name) + qry = f"DROP DATABASE {s_name};" try: _execute(cur, qry) except MySQLdb.OperationalError as exc: @@ -1429,7 +1429,7 @@ def _mysql_user_exists( unix_socket=False, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): server_version = salt.utils.data.decode(version(**connection_args)) @@ -1474,7 +1474,7 @@ def _mariadb_user_exists( unix_socket=False, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): qry = "SELECT User,Host FROM mysql.user WHERE User = %(user)s AND Host = %(host)s" @@ -1506,7 +1506,7 @@ def user_exists( passwordless=False, unix_socket=False, password_column=None, - **connection_args + **connection_args, ): """ Checks if a user exists on the MySQL server. A login can be checked to see @@ -1551,7 +1551,7 @@ def user_exists( if ( dbc is None and __context__["mysql.error"].startswith( - "MySQL Error 1045: Access denied for user '{}'@".format(user) + f"MySQL Error 1045: Access denied for user '{user}'@" ) and password ): @@ -1578,7 +1578,7 @@ def user_exists( unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ) else: qry, args = _mysql_user_exists( @@ -1590,7 +1590,7 @@ def user_exists( unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ) try: @@ -1645,7 +1645,7 @@ def _mysql_user_create( unix_socket=False, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): server_version = salt.utils.data.decode(version(**connection_args)) @@ -1708,7 +1708,7 @@ def _mariadb_user_create( unix_socket=False, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): qry = "CREATE USER %(user)s@%(host)s" @@ -1754,7 +1754,7 @@ def user_create( unix_socket=False, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): """ Creates a MySQL user @@ -1844,7 +1844,7 @@ def user_create( unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ) else: qry, args = _mysql_user_create( @@ -1856,7 +1856,7 @@ def user_create( unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ) if isinstance(qry, bool): @@ -1876,9 +1876,9 @@ def user_create( password, password_hash, password_column=password_column, - **connection_args + **connection_args, ): - msg = "User '{}'@'{}' has been created".format(user, host) + msg = f"User '{user}'@'{host}' has been created" if not any((password, password_hash)): msg += " with passwordless login" log.info(msg) @@ -1897,7 +1897,7 @@ def _mysql_user_chpass( unix_socket=None, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): server_version = salt.utils.data.decode(version(**connection_args)) compare_version = "8.0.11" @@ -1983,7 +1983,7 @@ def _mariadb_user_chpass( unix_socket=None, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): server_version = salt.utils.data.decode(version(**connection_args)) @@ -2054,7 +2054,7 @@ def user_chpass( allow_passwordless=False, unix_socket=None, password_column=None, - **connection_args + **connection_args, ): """ Change password for a MySQL user @@ -2139,7 +2139,7 @@ def user_chpass( unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ) else: qry, args = _mysql_user_chpass( @@ -2151,7 +2151,7 @@ def user_chpass( unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ) try: @@ -2329,7 +2329,7 @@ def __grant_normalize(grant): exploded_grants = __grant_split(grant) for chkgrant, _ in exploded_grants: if chkgrant.strip().upper() not in __grants__: - raise Exception("Invalid grant : '{}'".format(chkgrant)) + raise Exception(f"Invalid grant : '{chkgrant}'") return grant @@ -2349,7 +2349,7 @@ def __ssl_option_sanitize(ssl_option): normal_key = key.strip().upper() if normal_key not in __ssl_options__: - raise Exception("Invalid SSL option : '{}'".format(key)) + raise Exception(f"Invalid SSL option : '{key}'") if normal_key in __ssl_options_parameterized__: # SSL option parameters (cipher, issuer, subject) are pasted directly to SQL so @@ -2397,7 +2397,7 @@ def __grant_generate( if table != "*": table = quote_identifier(table) # identifiers cannot be used as values, and same thing for grants - qry = "GRANT {} ON {}.{} TO %(user)s@%(host)s".format(grant, dbc, table) + qry = f"GRANT {grant} ON {dbc}.{table} TO %(user)s@%(host)s" args = {} args["user"] = user args["host"] = host @@ -2444,7 +2444,7 @@ def user_grants(user, host="localhost", **connection_args): for grant in results: tmp = grant[0].split(" IDENTIFIED BY")[0] if "WITH GRANT OPTION" in grant[0] and "WITH GRANT OPTION" not in tmp: - tmp = "{} WITH GRANT OPTION".format(tmp) + tmp = f"{tmp} WITH GRANT OPTION" ret.append(tmp) log.debug(ret) return ret @@ -2457,7 +2457,7 @@ def grant_exists( host="localhost", grant_option=False, escape=True, - **connection_args + **connection_args, ): """ Checks to see if a grant exists in the database @@ -2578,7 +2578,7 @@ def grant_add( grant_option=False, escape=True, ssl_option=False, - **connection_args + **connection_args, ): """ Adds a grant to the MySQL server. @@ -2634,7 +2634,7 @@ def grant_revoke( host="localhost", grant_option=False, escape=True, - **connection_args + **connection_args, ): """ Removes a grant from the MySQL server. @@ -2671,7 +2671,7 @@ def grant_revoke( if table != "*": table = quote_identifier(table) # identifiers cannot be used as values, same thing for grants - qry = "REVOKE {} ON {}.{} FROM %(user)s@%(host)s;".format(grant, s_database, table) + qry = f"REVOKE {grant} ON {s_database}.{table} FROM %(user)s@%(host)s;" args = {} args["user"] = user args["host"] = host @@ -3038,12 +3038,12 @@ def plugin_add(name, soname=None, **connection_args): if dbc is None: return False cur = dbc.cursor() - qry = "INSTALL PLUGIN {}".format(name) + qry = f"INSTALL PLUGIN {name}" if soname: - qry += ' SONAME "{}"'.format(soname) + qry += f' SONAME "{soname}"' else: - qry += ' SONAME "{}.so"'.format(name) + qry += f' SONAME "{name}.so"' try: _execute(cur, qry) @@ -3078,7 +3078,7 @@ def plugin_remove(name, **connection_args): if dbc is None: return False cur = dbc.cursor() - qry = "UNINSTALL PLUGIN {}".format(name) + qry = f"UNINSTALL PLUGIN {name}" args = {} args["name"] = name diff --git a/salt/modules/nagios.py b/salt/modules/nagios.py index 960b8b2e718..87f3ae639f7 100644 --- a/salt/modules/nagios.py +++ b/salt/modules/nagios.py @@ -32,9 +32,7 @@ def _execute_cmd(plugin, args="", run_type="cmd.retcode"): all_plugins = list_plugins() if plugin in all_plugins: - data = __salt__[run_type]( - "{}{} {}".format(PLUGINDIR, plugin, args), python_shell=False - ) + data = __salt__[run_type](f"{PLUGINDIR}{plugin} {args}", python_shell=False) return data diff --git a/salt/modules/nagios_rpc.py b/salt/modules/nagios_rpc.py index 5eae58b0b2b..9aee76a10c3 100644 --- a/salt/modules/nagios_rpc.py +++ b/salt/modules/nagios_rpc.py @@ -97,7 +97,7 @@ def _status_query(query, hostname, enumerate=None, service=None): elif result.get("status", None) == http.client.NOT_FOUND: ret["error"] = "URL {} was not found.".format(config["url"]) else: - ret["error"] = "Results: {}".format(result.text) + ret["error"] = f"Results: {result.text}" return ret diff --git a/salt/modules/namecheap_domains.py b/salt/modules/namecheap_domains.py index c3d9f3ba1d0..e12c102b913 100644 --- a/salt/modules/namecheap_domains.py +++ b/salt/modules/namecheap_domains.py @@ -364,7 +364,7 @@ def create(domain_name, years, **kwargs): for requiredkey in require_opts: if requiredkey not in opts: log.error("Missing required parameter '%s'", requiredkey) - raise Exception("Missing required parameter '{}'".format(requiredkey)) + raise Exception(f"Missing required parameter '{requiredkey}'") response_xml = salt.utils.namecheap.post_request(opts) diff --git a/salt/modules/napalm_formula.py b/salt/modules/napalm_formula.py index 1b641d71973..c69d376cd60 100644 --- a/salt/modules/napalm_formula.py +++ b/salt/modules/napalm_formula.py @@ -292,7 +292,7 @@ def render_field(dictionary, field, prepend=None, append=None, quotes=False, **o else: append = "" if quotes: - value = '"{value}"'.format(value=value) + value = f'"{value}"' return "{prepend} {value}{append}".format( prepend=prepend, value=value, append=append ) diff --git a/salt/modules/napalm_mod.py b/salt/modules/napalm_mod.py index 8f70c9ad62b..84a40ad04eb 100644 --- a/salt/modules/napalm_mod.py +++ b/salt/modules/napalm_mod.py @@ -322,7 +322,7 @@ def call(method, *args, **kwargs): napalm_device, # pylint: disable=undefined-variable method, *args, - **clean_kwargs + **clean_kwargs, ) @@ -561,7 +561,7 @@ def netmiko_fun(fun, *args, **kwargs): salt '*' napalm.netmiko_fun send_command 'show version' """ if "netmiko." not in fun: - fun = "netmiko.{fun}".format(fun=fun) + fun = f"netmiko.{fun}" netmiko_kwargs = netmiko_args() kwargs.update(netmiko_kwargs) return __salt__[fun](*args, **kwargs) @@ -1038,14 +1038,14 @@ def junos_call(fun, *args, **kwargs): if not prep["result"]: return prep if "junos." not in fun: - mod_fun = "junos.{}".format(fun) + mod_fun = f"junos.{fun}" else: mod_fun = fun if mod_fun not in __salt__: return { "out": None, "result": False, - "comment": "{} is not a valid function".format(fun), + "comment": f"{fun} is not a valid function", } return __salt__[mod_fun](*args, **kwargs) @@ -1177,7 +1177,7 @@ def pyeapi_config( context=None, defaults=None, saltenv="base", - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -1235,7 +1235,7 @@ def pyeapi_config( context=context, defaults=defaults, saltenv=saltenv, - **pyeapi_kwargs + **pyeapi_kwargs, ) @@ -1271,7 +1271,7 @@ def nxos_api_config( context=None, defaults=None, saltenv="base", - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -1327,7 +1327,7 @@ def nxos_api_config( context=context, defaults=defaults, saltenv=saltenv, - **nxos_api_kwargs + **nxos_api_kwargs, ) @@ -1915,7 +1915,7 @@ def scp_get( local_path=local_path, recursive=recursive, preserve_times=preserve_times, - **kwargs + **kwargs, ) @@ -1926,7 +1926,7 @@ def scp_put( recursive=False, preserve_times=False, saltenv="base", - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -2021,5 +2021,5 @@ def scp_put( recursive=recursive, preserve_times=preserve_times, saltenv=saltenv, - **kwargs + **kwargs, ) diff --git a/salt/modules/napalm_network.py b/salt/modules/napalm_network.py index c6156db1566..9fc5185553f 100644 --- a/salt/modules/napalm_network.py +++ b/salt/modules/napalm_network.py @@ -170,7 +170,7 @@ def _config_logic( revert_in=None, revert_at=None, commit_jid=None, - **kwargs + **kwargs, ): """ Builds the config logic for `load_config` and `load_template` functions. @@ -191,7 +191,7 @@ def _config_logic( current_jid = kwargs.get("__pub_jid") if not current_jid: - current_jid = "{:%Y%m%d%H%M%S%f}".format(datetime.datetime.now()) + current_jid = f"{datetime.datetime.now():%Y%m%d%H%M%S%f}" loaded_result["already_configured"] = False @@ -246,7 +246,7 @@ def _config_logic( time_in=commit_in, time_at=commit_in ) # schedule job - scheduled_job_name = "__napalm_commit_{}".format(current_jid) + scheduled_job_name = f"__napalm_commit_{current_jid}" temp_file = salt.utils.files.mkstemp() with salt.utils.files.fopen(temp_file, "w") as fp_: fp_.write(loaded_config) @@ -329,7 +329,7 @@ def _config_logic( # already done by the _safe_commit_config function), and # return with the command and other details. return loaded_result - scheduled_job_name = "__napalm_commit_{}".format(current_jid) + scheduled_job_name = f"__napalm_commit_{current_jid}" scheduled = __salt__["schedule.add"]( scheduled_job_name, function="net.load_config", @@ -692,7 +692,7 @@ def cli(*commands, **kwargs): # pylint: disable=unused-argument raw_cli_outputs = salt.utils.napalm.call( napalm_device, # pylint: disable=undefined-variable "cli", - **{"commands": list(commands)} + **{"commands": list(commands)}, ) # thus we can display the output as is # in case of errors, they'll be caught in the proxy @@ -826,7 +826,7 @@ def cli(*commands, **kwargs): # pylint: disable=unused-argument processed_command_output = command_output processed_cli_outputs[ "comment" - ] += "\nUnable to process the output from {}.".format(command) + ] += f"\nUnable to process the output from {command}." processed_cli_outputs["out"][command] = processed_command_output processed_cli_outputs["comment"] = processed_cli_outputs["comment"].strip() return processed_cli_outputs @@ -874,7 +874,7 @@ def traceroute( "ttl": ttl, "timeout": timeout, "vrf": vrf, - } + }, ) @@ -887,7 +887,7 @@ def ping( size=None, count=None, vrf=None, - **kwargs + **kwargs, ): # pylint: disable=unused-argument """ Executes a ping on the network device and returns a dictionary as a result. @@ -935,7 +935,7 @@ def ping( "size": size, "count": count, "vrf": vrf, - } + }, ) @@ -1143,7 +1143,7 @@ def lldp(interface="", **kwargs): # pylint: disable=unused-argument proxy_output = salt.utils.napalm.call( napalm_device, # pylint: disable=undefined-variable "get_lldp_neighbors_detail", - **{} + **{}, ) if not proxy_output.get("result"): @@ -1205,7 +1205,7 @@ def mac(address="", interface="", vlan=0, **kwargs): # pylint: disable=unused-a proxy_output = salt.utils.napalm.call( napalm_device, # pylint: disable=undefined-variable "get_mac_address_table", - **{} + **{}, ) if not proxy_output.get("result"): @@ -1274,7 +1274,7 @@ def config(source=None, **kwargs): # pylint: disable=unused-argument return salt.utils.napalm.call( napalm_device, # pylint: disable=undefined-variable "get_config", - **{"retrieve": source} + **{"retrieve": source}, ) @@ -1341,7 +1341,7 @@ def load_config( commit_jid=None, inherit_napalm_device=None, saltenv="base", - **kwargs + **kwargs, ): # pylint: disable=unused-argument """ Applies configuration changes on the device. It can be loaded from a file or from inline string. @@ -1582,7 +1582,7 @@ def load_config( revert_in=revert_in, revert_at=revert_at, commit_jid=commit_jid, - **kwargs + **kwargs, ) @@ -1606,7 +1606,7 @@ def load_template( revert_in=None, revert_at=None, inherit_napalm_device=None, # pylint: disable=unused-argument - **template_vars + **template_vars, ): """ Renders a configuration template (default: Jinja) and loads the result on the device. @@ -2068,7 +2068,7 @@ def load_template( _loaded = salt.utils.napalm.call( napalm_device, # pylint: disable=undefined-variable fun, - **{"config": _rendered} + **{"config": _rendered}, ) return _config_logic( napalm_device, # pylint: disable=undefined-variable @@ -2082,7 +2082,7 @@ def load_template( commit_in=commit_in, revert_in=revert_in, revert_at=revert_at, - **template_vars + **template_vars, ) @@ -2255,13 +2255,13 @@ def cancel_commit(jid): salt '*' net.cancel_commit 20180726083540640360 """ - job_name = "__napalm_commit_{}".format(jid) + job_name = f"__napalm_commit_{jid}" removed = __salt__["schedule.delete"](job_name) if removed["result"]: saved = __salt__["schedule.save"]() - removed["comment"] = "Commit #{jid} cancelled.".format(jid=jid) + removed["comment"] = f"Commit #{jid} cancelled." else: - removed["comment"] = "Unable to find commit #{jid}.".format(jid=jid) + removed["comment"] = f"Unable to find commit #{jid}." return removed @@ -2290,7 +2290,7 @@ def confirm_commit(jid): else: confirmed = cancel_commit(jid) if confirmed["result"]: - confirmed["comment"] = "Commit #{jid} confirmed.".format(jid=jid) + confirmed["comment"] = f"Commit #{jid} confirmed." return confirmed @@ -2328,7 +2328,7 @@ def save_config(source=None, path=None): return { "result": True, "out": path, - "comment": "{source} config saved to {path}".format(source=source, path=path), + "comment": f"{source} config saved to {path}", } @@ -2664,7 +2664,7 @@ def patch( return { "out": None, "result": False, - "comment": 'The file "{}" does not exist.'.format(patchfile), + "comment": f'The file "{patchfile}" does not exist.', } replace_pattern = __salt__["file.patch"](path, patchfile_cache, options=options) with salt.utils.files.fopen(path, "r") as fh_: diff --git a/salt/modules/netbox.py b/salt/modules/netbox.py index 656087d0cb0..13b1ff63a71 100644 --- a/salt/modules/netbox.py +++ b/salt/modules/netbox.py @@ -190,7 +190,7 @@ def get_(app, endpoint, id=None, **kwargs): endpoint, id=id, auth_required=True if app in AUTH_ENDPOINTS else False, - **kwargs + **kwargs, ) ) @@ -1014,7 +1014,7 @@ def create_circuit_provider(name, asn=None): else: log.error("Duplicate provider with different ASN: %s: %s", name, asn) raise CommandExecutionError( - "Duplicate provider with different ASN: {}: {}".format(name, asn) + f"Duplicate provider with different ASN: {name}: {asn}" ) else: payload = {"name": name, "slug": slugify(name)} diff --git a/salt/modules/netbsd_sysctl.py b/salt/modules/netbsd_sysctl.py index cd18ea36e47..dbae3de3b36 100644 --- a/salt/modules/netbsd_sysctl.py +++ b/salt/modules/netbsd_sysctl.py @@ -58,11 +58,11 @@ def show(config_file=False): out = __salt__["cmd.run"](cmd, output_loglevel="trace") comps = [""] for line in out.splitlines(): - if any([line.startswith("{}.".format(root)) for root in roots]): + if any([line.startswith(f"{root}.") for root in roots]): comps = re.split("[=:]", line, 1) ret[comps[0]] = comps[1] elif comps[0]: - ret[comps[0]] += "{}\n".format(line) + ret[comps[0]] += f"{line}\n" else: continue return ret @@ -78,7 +78,7 @@ def get(name): salt '*' sysctl.get hw.physmem """ - cmd = "sysctl -n {}".format(name) + cmd = f"sysctl -n {name}" out = __salt__["cmd.run"](cmd, python_shell=False) return out @@ -94,7 +94,7 @@ def assign(name, value): salt '*' sysctl.assign net.inet.icmp.icmplim 50 """ ret = {} - cmd = 'sysctl -w {}="{}"'.format(name, value) + cmd = f'sysctl -w {name}="{value}"' data = __salt__["cmd.run_all"](cmd, python_shell=False) if data["retcode"] != 0: @@ -130,7 +130,7 @@ def persist(name, value, config="/etc/sysctl.conf"): with salt.utils.files.fopen(config, "r") as ifile: for line in ifile: line = salt.utils.stringutils.to_unicode(line) - m = re.match(r"{}(\??=)".format(name), line) + m = re.match(rf"{name}(\??=)", line) if not m: nlines.append(line) continue @@ -145,13 +145,13 @@ def persist(name, value, config="/etc/sysctl.conf"): rest = rest[len(rest_v) :] if rest_v == value: return "Already set" - new_line = "{}{}{}{}".format(name, m.group(1), value, rest) + new_line = f"{name}{m.group(1)}{value}{rest}" nlines.append(new_line) edited = True if not edited: - newline = "{}={}".format(name, value) - nlines.append("{}\n".format(newline)) + newline = f"{name}={value}" + nlines.append(f"{newline}\n") with salt.utils.files.fopen(config, "wb") as ofile: ofile.writelines(salt.utils.data.encode(nlines)) diff --git a/salt/modules/netbsdservice.py b/salt/modules/netbsdservice.py index e8308415930..c6ebc20dbcd 100644 --- a/salt/modules/netbsdservice.py +++ b/salt/modules/netbsdservice.py @@ -41,7 +41,7 @@ def start(name): salt '*' service.start """ - cmd = "/etc/rc.d/{} onestart".format(name) + cmd = f"/etc/rc.d/{name} onestart" return not __salt__["cmd.retcode"](cmd) @@ -55,7 +55,7 @@ def stop(name): salt '*' service.stop """ - cmd = "/etc/rc.d/{} onestop".format(name) + cmd = f"/etc/rc.d/{name} onestop" return not __salt__["cmd.retcode"](cmd) @@ -69,7 +69,7 @@ def restart(name): salt '*' service.restart """ - cmd = "/etc/rc.d/{} onerestart".format(name) + cmd = f"/etc/rc.d/{name} onerestart" return not __salt__["cmd.retcode"](cmd) @@ -83,7 +83,7 @@ def reload_(name): salt '*' service.reload """ - cmd = "/etc/rc.d/{} onereload".format(name) + cmd = f"/etc/rc.d/{name} onereload" return not __salt__["cmd.retcode"](cmd) @@ -97,7 +97,7 @@ def force_reload(name): salt '*' service.force_reload """ - cmd = "/etc/rc.d/{} forcereload".format(name) + cmd = f"/etc/rc.d/{name} forcereload" return not __salt__["cmd.retcode"](cmd) @@ -134,7 +134,7 @@ def status(name, sig=None): services = [name] results = {} for service in services: - cmd = "/etc/rc.d/{} onestatus".format(service) + cmd = f"/etc/rc.d/{service} onestatus" results[service] = not __salt__["cmd.retcode"](cmd, ignore_retcode=True) if contains_globbing: return results @@ -146,9 +146,9 @@ def _get_svc(rcd, service_status): Returns a unique service status """ ena = None - lines = __salt__["cmd.run"]("{} rcvar".format(rcd)).splitlines() + lines = __salt__["cmd.run"](f"{rcd} rcvar").splitlines() for rcvar in lines: - if rcvar.startswith("$") and "={}".format(service_status) in rcvar: + if rcvar.startswith("$") and f"={service_status}" in rcvar: ena = "yes" elif rcvar.startswith("#"): svc = rcvar.split(" ", 1)[1] @@ -166,7 +166,7 @@ def _get_svc_list(service_status): """ prefix = "/etc/rc.d/" ret = set() - lines = glob.glob("{}*".format(prefix)) + lines = glob.glob(f"{prefix}*") for line in lines: svc = _get_svc(line, service_status) if svc is not None: @@ -249,9 +249,9 @@ def _rcconf_status(name, service_status): can be started via /etc/rc.d/ """ rcconf = "/etc/rc.conf" - rxname = "^{}=.*".format(name) - newstatus = "{}={}".format(name, service_status) - ret = __salt__["cmd.retcode"]("grep '{}' {}".format(rxname, rcconf)) + rxname = f"^{name}=.*" + newstatus = f"{name}={service_status}" + ret = __salt__["cmd.retcode"](f"grep '{rxname}' {rcconf}") if ret == 0: # service found in rc.conf, modify its status __salt__["file.replace"](rcconf, rxname, newstatus) else: @@ -296,7 +296,7 @@ def enabled(name, **kwargs): salt '*' service.enabled """ - return _get_svc("/etc/rc.d/{}".format(name), "YES") + return _get_svc(f"/etc/rc.d/{name}", "YES") def disabled(name): @@ -309,4 +309,4 @@ def disabled(name): salt '*' service.disabled """ - return _get_svc("/etc/rc.d/{}".format(name), "NO") + return _get_svc(f"/etc/rc.d/{name}", "NO") diff --git a/salt/modules/netmiko_mod.py b/salt/modules/netmiko_mod.py index 1769471f82b..d3cd44e10cd 100644 --- a/salt/modules/netmiko_mod.py +++ b/salt/modules/netmiko_mod.py @@ -486,7 +486,7 @@ def send_config( context=None, defaults=None, saltenv="base", - **kwargs + **kwargs, ): """ Send configuration commands down the SSH channel. @@ -564,7 +564,7 @@ def send_config( if config_file: file_str = __salt__["cp.get_file_str"](config_file, saltenv=saltenv) if file_str is False: - raise CommandExecutionError("Source file {} not found".format(config_file)) + raise CommandExecutionError(f"Source file {config_file} not found") elif config_commands: if isinstance(config_commands, ((str,), str)): config_commands = [config_commands] diff --git a/salt/modules/netscaler.py b/salt/modules/netscaler.py index e4d684c4088..94949f3527c 100644 --- a/salt/modules/netscaler.py +++ b/salt/modules/netscaler.py @@ -118,7 +118,7 @@ def _connect(**kwargs): name = name[len(prefix) :] except IndexError: return - val = __salt__["config.option"]("netscaler.{}".format(name), None) + val = __salt__["config.option"](f"netscaler.{name}", None) if val is not None: connargs[key] = val elif default is not None: diff --git a/salt/modules/network.py b/salt/modules/network.py index c72230f3335..3411144fb27 100644 --- a/salt/modules/network.py +++ b/salt/modules/network.py @@ -299,7 +299,7 @@ def _netstat_bsd(): ret = [] if __grains__["kernel"] == "NetBSD": for addr_family in ("inet", "inet6"): - cmd = "netstat -f {} -an | tail -n+3".format(addr_family) + cmd = f"netstat -f {addr_family} -an | tail -n+3" out = __salt__["cmd.run"](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() @@ -382,7 +382,7 @@ def _netstat_sunos(): ret = [] for addr_family in ("inet", "inet6"): # Lookup TCP connections - cmd = "netstat -f {} -P tcp -an | tail +5".format(addr_family) + cmd = f"netstat -f {addr_family} -P tcp -an | tail +5" out = __salt__["cmd.run"](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() @@ -397,7 +397,7 @@ def _netstat_sunos(): } ) # Lookup UDP connections - cmd = "netstat -f {} -P udp -an | tail +5".format(addr_family) + cmd = f"netstat -f {addr_family} -P udp -an | tail +5" out = __salt__["cmd.run"](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() @@ -421,7 +421,7 @@ def _netstat_aix(): ## for addr_family in ('inet', 'inet6'): for addr_family in ("inet",): # Lookup connections - cmd = "netstat -n -a -f {} | tail -n +3".format(addr_family) + cmd = f"netstat -n -a -f {addr_family} | tail -n +3" out = __salt__["cmd.run"](cmd, python_shell=True) for line in out.splitlines(): comps = line.split() @@ -1012,7 +1012,7 @@ def traceroute(host): "ip": traceline[2], } for idx, delay in enumerate(delays): - result["ms{}".format(idx + 1)] = delay + result[f"ms{idx + 1}"] = delay except IndexError: result = {} @@ -1400,7 +1400,7 @@ def mod_hostname(hostname): # Grab the old hostname so we know which hostname to change and then # change the hostname using the hostname command if hostname_cmd.endswith("hostnamectl"): - result = __salt__["cmd.run_all"]("{} status".format(hostname_cmd)) + result = __salt__["cmd.run_all"](f"{hostname_cmd} status") if 0 == result["retcode"]: out = result["stdout"] for line in out.splitlines(): @@ -1432,7 +1432,7 @@ def mod_hostname(hostname): ) return False elif not __utils__["platform.is_sunos"](): - __salt__["cmd.run"]("{} {}".format(hostname_cmd, hostname)) + __salt__["cmd.run"](f"{hostname_cmd} {hostname}") else: __salt__["cmd.run"]("{} -S {}".format(uname_cmd, hostname.split(".")[0])) @@ -1490,7 +1490,7 @@ def mod_hostname(hostname): ) if __salt__["cmd.run_all"](nirtcfg_cmd)["retcode"] != 0: raise CommandExecutionError( - "Couldn't set hostname to: {}\n".format(str_hostname) + f"Couldn't set hostname to: {str_hostname}\n" ) elif __grains__["os_family"] == "OpenBSD": with __utils__["files.fopen"]("/etc/myname", "w") as fh_: @@ -1666,7 +1666,7 @@ def _get_bufsize_linux(iface): """ ret = {"result": False} - cmd = "/sbin/ethtool -g {}".format(iface) + cmd = f"/sbin/ethtool -g {iface}" out = __salt__["cmd.run"](cmd) pat = re.compile(r"^(.+):\s+(\d+)$") suffix = "max-" @@ -1770,7 +1770,7 @@ def routes(family=None): salt '*' network.routes """ if family != "inet" and family != "inet6" and family is not None: - raise CommandExecutionError("Invalid address family {}".format(family)) + raise CommandExecutionError(f"Invalid address family {family}") if __grains__["kernel"] == "Linux": if not __utils__["path.which"]("netstat"): @@ -1814,7 +1814,7 @@ def default_route(family=None): salt '*' network.default_route """ if family != "inet" and family != "inet6" and family is not None: - raise CommandExecutionError("Invalid address family {}".format(family)) + raise CommandExecutionError(f"Invalid address family {family}") _routes = routes(family) @@ -1872,7 +1872,7 @@ def get_route(ip): """ if __grains__["kernel"] == "Linux": - cmd = "ip route get {}".format(ip) + cmd = f"ip route get {ip}" out = __salt__["cmd.run"](cmd, python_shell=True) regexp = re.compile( r"(via\s+(?P[\w\.:]+))?\s+dev\s+(?P[\w\.\:\-]+)\s+.*src\s+(?P[\w\.:]+)" @@ -1896,7 +1896,7 @@ def get_route(ip): # flags: # recvpipe sendpipe ssthresh rtt,ms rttvar,ms hopcount mtu expire # 0 0 0 0 0 0 1500 0 - cmd = "/usr/sbin/route -n get {}".format(ip) + cmd = f"/usr/sbin/route -n get {ip}" out = __salt__["cmd.run"](cmd, python_shell=False) ret = {"destination": ip, "gateway": None, "interface": None, "source": None} @@ -1925,7 +1925,7 @@ def get_route(ip): # flags: # use mtu expire # 8352657 0 0 - cmd = "route -n get {}".format(ip) + cmd = f"route -n get {ip}" out = __salt__["cmd.run"](cmd, python_shell=False) ret = {"destination": ip, "gateway": None, "interface": None, "source": None} @@ -1953,7 +1953,7 @@ def get_route(ip): # flags: # recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire # 0 0 0 0 0 0 0 -68642 - cmd = "route -n get {}".format(ip) + cmd = f"route -n get {ip}" out = __salt__["cmd.run"](cmd, python_shell=False) ret = {"destination": ip, "gateway": None, "interface": None, "source": None} diff --git a/salt/modules/nexus.py b/salt/modules/nexus.py index 06a44f38a22..e8e212ce8f5 100644 --- a/salt/modules/nexus.py +++ b/salt/modules/nexus.py @@ -94,7 +94,7 @@ def get_latest_snapshot( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - base64.encodestring("{}:{}".format(username, password)).replace("\n", "") + base64.encodestring(f"{username}:{password}").replace("\n", "") ) artifact_metadata = _get_artifact_metadata( nexus_url=nexus_url, @@ -175,7 +175,7 @@ def get_snapshot( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - base64.encodestring("{}:{}".format(username, password)).replace("\n", "") + base64.encodestring(f"{username}:{password}").replace("\n", "") ) snapshot_url, file_name = _get_snapshot_url( nexus_url=nexus_url, @@ -241,7 +241,7 @@ def get_snapshot_version_string( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - base64.encodestring("{}:{}".format(username, password)).replace("\n", "") + base64.encodestring(f"{username}:{password}").replace("\n", "") ) return _get_snapshot_url( nexus_url=nexus_url, @@ -306,7 +306,7 @@ def get_latest_release( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - base64.encodestring("{}:{}".format(username, password)).replace("\n", "") + base64.encodestring(f"{username}:{password}").replace("\n", "") ) artifact_metadata = _get_artifact_metadata( nexus_url=nexus_url, @@ -379,7 +379,7 @@ def get_release( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - base64.encodestring("{}:{}".format(username, password)).replace("\n", "") + base64.encodestring(f"{username}:{password}").replace("\n", "") ) release_url, file_name = _get_release_url( repository, group_id, artifact_id, packaging, version, nexus_url, classifier @@ -688,7 +688,7 @@ def __save_artifact(artifact_url, target_file, headers): local_file.write(salt.utils.stringutils.to_bytes(f.read())) result["status"] = True result["comment"] = __append_comment( - "Artifact downloaded from URL: {}".format(artifact_url), + f"Artifact downloaded from URL: {artifact_url}", result["comment"], ) result["changes"]["downloaded_file"] = target_file diff --git a/salt/modules/nfs3.py b/salt/modules/nfs3.py index 048c8b18456..d692c5fb01e 100644 --- a/salt/modules/nfs3.py +++ b/salt/modules/nfs3.py @@ -125,8 +125,8 @@ def _write_exports(exports, edict): for perms in edict[export]: hosts = perms["hosts"] options = ",".join(perms["options"]) - line += " {}({})".format(hosts, options) - efh.write("{}\n".format(line)) + line += f" {hosts}({options})" + efh.write(f"{line}\n") def reload_exports(): diff --git a/salt/modules/nftables.py b/salt/modules/nftables.py index 5af8f7b3b85..347b03c0897 100644 --- a/salt/modules/nftables.py +++ b/salt/modules/nftables.py @@ -73,7 +73,7 @@ def version(): salt '*' nftables.version """ - cmd = "{} --version".format(_nftables_cmd()) + cmd = f"{_nftables_cmd()} --version" out = __salt__["cmd.run"](cmd).split() return out[1] @@ -85,7 +85,7 @@ def build_rule( position="", full=None, family="ipv4", - **kwargs + **kwargs, ): """ Build a well-formatted nftables rule based on kwargs. @@ -260,8 +260,8 @@ def build_rule( rule = rule.strip() # Insert the protocol prior to dport or sport - rule = rule.replace("dport", "{} dport".format(proto)) - rule = rule.replace("sport", "{} sport".format(proto)) + rule = rule.replace("dport", f"{proto} dport") + rule = rule.replace("sport", f"{proto} sport") ret["rule"] = rule @@ -456,16 +456,14 @@ def save(filename=None, family="ipv4"): rules = rules + "\n" if __salt__["file.directory_exists"](filename): - filename = "{}/salt-all-in-one.nft".format(filename) + filename = f"{filename}/salt-all-in-one.nft" try: with salt.utils.files.fopen(filename, "wb") as _fh: # Write out any changes _fh.write(salt.utils.data.encode(rules)) except OSError as exc: - raise CommandExecutionError( - "Problem writing to configuration file: {}".format(exc) - ) + raise CommandExecutionError(f"Problem writing to configuration file: {exc}") return rules @@ -519,12 +517,12 @@ def get_rule_handle(table="filter", chain=None, rule=None, family="ipv4"): out = __salt__["cmd.run"](cmd, python_shell=False) rules = re.split("\n+", out) - pat = re.compile(r"{} # handle (?P\d+)".format(rule)) + pat = re.compile(rf"{rule} # handle (?P\d+)") for r in rules: match = pat.search(r) if match: return {"result": True, "handle": match.group("handle")} - return {"result": False, "comment": "Could not find rule {}".format(rule)} + return {"result": False, "comment": f"Could not find rule {rule}"} def check(table="filter", chain=None, rule=None, family="ipv4"): @@ -570,7 +568,7 @@ def check(table="filter", chain=None, rule=None, family="ipv4"): cmd = "{} --handle --numeric --numeric --numeric list chain {} {} {}".format( _nftables_cmd(), nft_family, table, chain ) - search_rule = "{} #".format(rule) + search_rule = f"{rule} #" out = __salt__["cmd.run"](cmd, python_shell=False).find(search_rule) if out == -1: @@ -610,10 +608,8 @@ def check_chain(table="filter", chain=None, family="ipv4"): return ret nft_family = _NFTABLES_FAMILIES[family] - cmd = "{} list table {} {}".format(_nftables_cmd(), nft_family, table) - out = __salt__["cmd.run"](cmd, python_shell=False).find( - "chain {0} {{".format(chain) - ) + cmd = f"{_nftables_cmd()} list table {nft_family} {table}" + out = __salt__["cmd.run"](cmd, python_shell=False).find(f"chain {chain} {{") if out == -1: ret["comment"] = "Chain {} in table {} in family {} does not exist".format( @@ -644,15 +640,15 @@ def check_table(table=None, family="ipv4"): return ret nft_family = _NFTABLES_FAMILIES[family] - cmd = "{} list tables {}".format(_nftables_cmd(), nft_family) + cmd = f"{_nftables_cmd()} list tables {nft_family}" out = __salt__["cmd.run"](cmd, python_shell=False).find( - "table {} {}".format(nft_family, table) + f"table {nft_family} {table}" ) if out == -1: - ret["comment"] = "Table {} in family {} does not exist".format(table, family) + ret["comment"] = f"Table {table} in family {family} does not exist" else: - ret["comment"] = "Table {} in family {} exists".format(table, family) + ret["comment"] = f"Table {table} in family {family} exists" ret["result"] = True return ret @@ -683,11 +679,11 @@ def new_table(table, family="ipv4"): return res nft_family = _NFTABLES_FAMILIES[family] - cmd = "{} add table {} {}".format(_nftables_cmd(), nft_family, table) + cmd = f"{_nftables_cmd()} add table {nft_family} {table}" out = __salt__["cmd.run"](cmd, python_shell=False) if not out: - ret["comment"] = "Table {} in family {} created".format(table, family) + ret["comment"] = f"Table {table} in family {family} created" ret["result"] = True else: ret["comment"] = "Table {} in family {} could not be created".format( @@ -722,11 +718,11 @@ def delete_table(table, family="ipv4"): return res nft_family = _NFTABLES_FAMILIES[family] - cmd = "{} delete table {} {}".format(_nftables_cmd(), nft_family, table) + cmd = f"{_nftables_cmd()} delete table {nft_family} {table}" out = __salt__["cmd.run"](cmd, python_shell=False) if not out: - ret["comment"] = "Table {} in family {} deleted".format(table, family) + ret["comment"] = f"Table {table} in family {family} deleted" ret["result"] = True else: ret["comment"] = "Table {} in family {} could not be deleted".format( @@ -780,7 +776,7 @@ def new_chain( return ret nft_family = _NFTABLES_FAMILIES[family] - cmd = "{} -- add chain {} {} {}".format(_nftables_cmd(), nft_family, table, chain) + cmd = f"{_nftables_cmd()} -- add chain {nft_family} {table} {chain}" if table_type or hook or priority: if table_type and hook and str(priority): cmd = r"{0} \{{ type {1} hook {2} priority {3}\; \}}".format( @@ -841,7 +837,7 @@ def delete_chain(table="filter", chain=None, family="ipv4"): return res nft_family = _NFTABLES_FAMILIES[family] - cmd = "{} delete chain {} {} {}".format(_nftables_cmd(), nft_family, table, chain) + cmd = f"{_nftables_cmd()} delete chain {nft_family} {table} {chain}" out = __salt__["cmd.run"](cmd, python_shell=False) if not out: @@ -962,7 +958,7 @@ def insert(table="filter", chain=None, position=None, rule=None, family="ipv4"): family=ipv6 """ ret = { - "comment": "Failed to insert rule {} to table {}.".format(rule, table), + "comment": f"Failed to insert rule {rule} to table {table}.", "result": False, } @@ -1043,7 +1039,7 @@ def delete(table, chain=None, position=None, rule=None, family="ipv4"): family=ipv6 """ ret = { - "comment": "Failed to delete rule {} in table {}.".format(rule, table), + "comment": f"Failed to delete rule {rule} in table {table}.", "result": False, } @@ -1131,17 +1127,17 @@ def flush(table="filter", chain="", family="ipv4"): cmd = "{} flush chain {} {} {}".format( _nftables_cmd(), nft_family, table, chain ) - comment = "from chain {} in table {} in family {}.".format(chain, table, family) + comment = f"from chain {chain} in table {table} in family {family}." else: - cmd = "{} flush table {} {}".format(_nftables_cmd(), nft_family, table) - comment = "from table {} in family {}.".format(table, family) + cmd = f"{_nftables_cmd()} flush table {nft_family} {table}" + comment = f"from table {table} in family {family}." out = __salt__["cmd.run"](cmd, python_shell=False) if not out: ret["result"] = True - ret["comment"] = "Flushed rules {}".format(comment) + ret["comment"] = f"Flushed rules {comment}" else: - ret["comment"] = "Failed to flush rules {}".format(comment) + ret["comment"] = f"Failed to flush rules {comment}" return ret @@ -1239,7 +1235,7 @@ def set_policy(table="filter", chain=None, policy=None, family="ipv4"): if not chain_info: return False - cmd = "{} add chain {} {} {}".format(_nftables_cmd(), nft_family, table, chain) + cmd = f"{_nftables_cmd()} add chain {nft_family} {table} {chain}" # We can't infer the base chain parameters. Bail out if they're not present. if "type" not in chain_info or "hook" not in chain_info or "prio" not in chain_info: @@ -1249,7 +1245,7 @@ def set_policy(table="filter", chain=None, policy=None, family="ipv4"): chain_info["type"], chain_info["hook"], chain_info["prio"] ) - cmd = '{0} "{{ {1} policy {2}; }}"'.format(cmd, params, policy) + cmd = f'{cmd} "{{ {params} policy {policy}; }}"' out = __salt__["cmd.run_all"](cmd, python_shell=False) diff --git a/salt/modules/nginx.py b/salt/modules/nginx.py index b684df5f6ff..21332816a5d 100644 --- a/salt/modules/nginx.py +++ b/salt/modules/nginx.py @@ -39,7 +39,7 @@ def version(): salt '*' nginx.version """ - cmd = "{} -v".format(__detect_os()) + cmd = f"{__detect_os()} -v" out = __salt__["cmd.run"](cmd).splitlines() ret = out[0].rsplit("/", maxsplit=1) return ret[-1] @@ -56,7 +56,7 @@ def build_info(): salt '*' nginx.build_info """ ret = {"info": []} - out = __salt__["cmd.run"]("{} -V".format(__detect_os())) + out = __salt__["cmd.run"](f"{__detect_os()} -V") for i in out.splitlines(): if i.startswith("configure argument"): @@ -80,7 +80,7 @@ def configtest(): """ ret = {} - cmd = "{} -t".format(__detect_os()) + cmd = f"{__detect_os()} -t" out = __salt__["cmd.run_all"](cmd) if out["retcode"] != 0: @@ -116,7 +116,7 @@ def signal(signal=None): if signal == "start": arguments = "" else: - arguments = " -s {}".format(signal) + arguments = f" -s {signal}" cmd = __detect_os() + arguments out = __salt__["cmd.run_all"](cmd) @@ -130,7 +130,7 @@ def signal(signal=None): ret = out["stdout"].strip() # No output for something like: nginxctl graceful else: - ret = 'Command: "{}" completed successfully!'.format(cmd) + ret = f'Command: "{cmd}" completed successfully!' return ret diff --git a/salt/modules/nilrt_ip.py b/salt/modules/nilrt_ip.py index 84612d7a17d..27243f2c70f 100644 --- a/salt/modules/nilrt_ip.py +++ b/salt/modules/nilrt_ip.py @@ -86,9 +86,7 @@ def _get_state(): except KeyError: return "offline" except dbus.DBusException as exc: - raise salt.exceptions.CommandExecutionError( - "Connman daemon error: {}".format(exc) - ) + raise salt.exceptions.CommandExecutionError(f"Connman daemon error: {exc}") def _get_technologies(): @@ -143,7 +141,7 @@ def _space_delimited_list(value): if valid: return True, "space-delimited string" - return False, "{} is not a valid list.\n".format(value) + return False, f"{value} is not a valid list.\n" def _validate_ipv4(value): @@ -152,13 +150,13 @@ def _validate_ipv4(value): """ if len(value) == 3: if not salt.utils.validate.net.ipv4_addr(value[0].strip()): - return False, "Invalid ip address: {} for ipv4 option".format(value[0]) + return False, f"Invalid ip address: {value[0]} for ipv4 option" if not salt.utils.validate.net.netmask(value[1].strip()): - return False, "Invalid netmask: {} for ipv4 option".format(value[1]) + return False, f"Invalid netmask: {value[1]} for ipv4 option" if not salt.utils.validate.net.ipv4_addr(value[2].strip()): - return False, "Invalid gateway: {} for ipv4 option".format(value[2]) + return False, f"Invalid gateway: {value[2]} for ipv4 option" else: - return False, "Invalid value: {} for ipv4 option".format(value) + return False, f"Invalid value: {value} for ipv4 option" return True, "" @@ -322,10 +320,8 @@ def _get_possible_adapter_modes(interface, blacklist): protocols = _load_config("lvrt", ["AdditionalNetworkProtocols"])[ "AdditionalNetworkProtocols" ].lower() - sys_interface_path = os.readlink("/sys/class/net/{}".format(interface)) - with salt.utils.files.fopen( - "/sys/class/net/{}/uevent".format(interface) - ) as uevent_file: + sys_interface_path = os.readlink(f"/sys/class/net/{interface}") + with salt.utils.files.fopen(f"/sys/class/net/{interface}/uevent") as uevent_file: uevent_lines = uevent_file.readlines() uevent_devtype = "" for line in uevent_lines: @@ -554,7 +550,7 @@ def _change_state_legacy(interface, new_state): if initial_mode == "ethercat": __salt__["system.set_reboot_required_witnessed"]() else: - out = __salt__["cmd.run_all"]("ip link set {} {}".format(interface, new_state)) + out = __salt__["cmd.run_all"](f"ip link set {interface} {new_state}") if out["retcode"] != 0: msg = "Couldn't {} interface {}. Error: {}".format( "enable" if new_state == "up" else "disable", interface, out["stderr"] @@ -582,22 +578,22 @@ def _change_dhcp_config(interface, enable_dhcp=True, filename=INTERFACES_CONFIG) interface = pyiface.Interface(name=interface) hwaddr = interface.hwaddr[:-1] hwaddr_section_number = "".join(hwaddr.split(":")) - if parser.has_section("service_{}".format(hwaddr_section_number)): - parser.remove_section("service_{}".format(hwaddr_section_number)) - parser.add_section("service_{}".format(hwaddr_section_number)) - parser.set("service_{}".format(hwaddr_section_number), "MAC", hwaddr) + if parser.has_section(f"service_{hwaddr_section_number}"): + parser.remove_section(f"service_{hwaddr_section_number}") + parser.add_section(f"service_{hwaddr_section_number}") + parser.set(f"service_{hwaddr_section_number}", "MAC", hwaddr) parser.set( - "service_{}".format(hwaddr_section_number), + f"service_{hwaddr_section_number}", "Name", - "ethernet_cable_{}".format(hwaddr_section_number), + f"ethernet_cable_{hwaddr_section_number}", ) - parser.set("service_{}".format(hwaddr_section_number), "Type", "ethernet") + parser.set(f"service_{hwaddr_section_number}", "Type", "ethernet") if enable_dhcp: - parser.set("service_{}".format(hwaddr_section_number), "IPv4.Method", "dhcp") - parser.set("service_{}".format(hwaddr_section_number), "AutoConnect", "true") - parser.set("service_{}".format(hwaddr_section_number), "Nameservers", "''") + parser.set(f"service_{hwaddr_section_number}", "IPv4.Method", "dhcp") + parser.set(f"service_{hwaddr_section_number}", "AutoConnect", "true") + parser.set(f"service_{hwaddr_section_number}", "Nameservers", "''") else: - parser.set("service_{}".format(hwaddr_section_number), "IPv4", "off") + parser.set(f"service_{hwaddr_section_number}", "IPv4", "off") with salt.utils.files.fopen(filename, "w") as config_file: parser.write(config_file) return True @@ -622,9 +618,7 @@ def _change_state(interface, new_state): if new_state == "up" else _change_dhcp_config(interface, False) ) - raise salt.exceptions.CommandExecutionError( - "Invalid interface name: {}".format(interface) - ) + raise salt.exceptions.CommandExecutionError(f"Invalid interface name: {interface}") def up(interface, iface_type=None): # pylint: disable=invalid-name,unused-argument @@ -708,9 +702,9 @@ def _save_config(section, token, value): Helper function to persist a configuration in the ini file """ cmd = NIRTCFG_PATH - cmd += " --set section={},token='{}',value='{}'".format(section, token, value) + cmd += f" --set section={section},token='{token}',value='{value}'" if __salt__["cmd.run_all"](cmd)["retcode"] != 0: - exc_msg = "Error: could not set {} to {} for {}\n".format(token, value, section) + exc_msg = f"Error: could not set {token} to {value} for {section}\n" raise salt.exceptions.CommandExecutionError(exc_msg) @@ -775,9 +769,7 @@ def set_dhcp_linklocal_all(interface): return True if interface in [x.name for x in pyiface.getIfaces()]: return _change_dhcp_config(interface) - raise salt.exceptions.CommandExecutionError( - "Invalid interface name: {}".format(interface) - ) + raise salt.exceptions.CommandExecutionError(f"Invalid interface name: {interface}") def set_dhcp_only_all(interface): @@ -863,24 +855,24 @@ def _configure_static_interface(interface, **settings): pass hwaddr = interface.hwaddr[:-1] hwaddr_section_number = "".join(hwaddr.split(":")) - if parser.has_section("service_{}".format(hwaddr_section_number)): - parser.remove_section("service_{}".format(hwaddr_section_number)) - parser.add_section("service_{}".format(hwaddr_section_number)) + if parser.has_section(f"service_{hwaddr_section_number}"): + parser.remove_section(f"service_{hwaddr_section_number}") + parser.add_section(f"service_{hwaddr_section_number}") ip_address = settings.get("ip", "0.0.0.0") netmask = settings.get("netmask", "0.0.0.0") gateway = settings.get("gateway", "0.0.0.0") dns_servers = settings.get("dns", "''") - name = settings.get("name", "ethernet_cable_{}".format(hwaddr_section_number)) + name = settings.get("name", f"ethernet_cable_{hwaddr_section_number}") parser.set( - "service_{}".format(hwaddr_section_number), + f"service_{hwaddr_section_number}", "IPv4", - "{}/{}/{}".format(ip_address, netmask, gateway), + f"{ip_address}/{netmask}/{gateway}", ) - parser.set("service_{}".format(hwaddr_section_number), "Nameservers", dns_servers) - parser.set("service_{}".format(hwaddr_section_number), "Name", name) - parser.set("service_{}".format(hwaddr_section_number), "MAC", hwaddr) - parser.set("service_{}".format(hwaddr_section_number), "Type", "ethernet") - parser.set("service_{}".format(hwaddr_section_number), "IPv4.method", "manual") + parser.set(f"service_{hwaddr_section_number}", "Nameservers", dns_servers) + parser.set(f"service_{hwaddr_section_number}", "Name", name) + parser.set(f"service_{hwaddr_section_number}", "MAC", hwaddr) + parser.set(f"service_{hwaddr_section_number}", "Type", "ethernet") + parser.set(f"service_{hwaddr_section_number}", "IPv4.method", "manual") with salt.utils.files.fopen(INTERFACES_CONFIG, "w") as config_file: parser.write(config_file) return True @@ -941,23 +933,23 @@ def set_static_all(interface, address, netmask, gateway, nameservers=None): "dns": ",".join(nameservers) if nameservers else "", "netmask": netmask, "gateway": gateway, - } + }, ) raise salt.exceptions.CommandExecutionError( - "Invalid interface name: {}".format(interface) + f"Invalid interface name: {interface}" ) service = pyconnman.ConnService(os.path.join(SERVICE_PATH, service)) ipv4 = service.get_property("IPv4.Configuration") ipv4["Method"] = dbus.String("manual", variant_level=1) - ipv4["Address"] = dbus.String("{}".format(address), variant_level=1) - ipv4["Netmask"] = dbus.String("{}".format(netmask), variant_level=1) - ipv4["Gateway"] = dbus.String("{}".format(gateway), variant_level=1) + ipv4["Address"] = dbus.String(f"{address}", variant_level=1) + ipv4["Netmask"] = dbus.String(f"{netmask}", variant_level=1) + ipv4["Gateway"] = dbus.String(f"{gateway}", variant_level=1) try: service.set_property("IPv4.Configuration", ipv4) if nameservers: service.set_property( "Nameservers.Configuration", - [dbus.String("{}".format(d)) for d in nameservers], + [dbus.String(f"{d}") for d in nameservers], ) except Exception as exc: # pylint: disable=broad-except exc_msg = "Couldn't set manual settings for service: {}\nError: {}\n".format( @@ -998,7 +990,7 @@ def build_interface(iface, iface_type, enabled, **settings): raise salt.exceptions.CommandExecutionError("Not supported in this version.") if iface_type != "eth": raise salt.exceptions.CommandExecutionError( - "Interface type not supported: {}:".format(iface_type) + f"Interface type not supported: {iface_type}:" ) if ( @@ -1049,7 +1041,7 @@ def build_network_settings(**settings): old_hostname = __salt__["network.get_hostname"] if new_hostname != old_hostname: __salt__["network.mod_hostname"](new_hostname) - changes.append("hostname={}".format(new_hostname)) + changes.append(f"hostname={new_hostname}") return changes @@ -1068,9 +1060,9 @@ def get_network_settings(): raise salt.exceptions.CommandExecutionError("Not supported in this version.") settings = [] networking = "no" if _get_state() == "offline" else "yes" - settings.append("networking={}".format(networking)) + settings.append(f"networking={networking}") hostname = __salt__["network.get_hostname"] - settings.append("hostname={}".format(hostname)) + settings.append(f"hostname={hostname}") return settings diff --git a/salt/modules/npm.py b/salt/modules/npm.py index edbb7b4ae1d..f7a40043de4 100644 --- a/salt/modules/npm.py +++ b/salt/modules/npm.py @@ -47,9 +47,7 @@ def _check_valid_version(): npm_path = salt.utils.path.which("npm") # pylint: disable=no-member - res = salt.modules.cmdmod.run( - "{npm} --version".format(npm=npm_path), output_loglevel="quiet" - ) + res = salt.modules.cmdmod.run(f"{npm_path} --version", output_loglevel="quiet") npm_version = Version(res) valid_version = Version("1.2") # pylint: enable=no-member @@ -151,7 +149,7 @@ def install( cwd = dir if registry: - cmd.append('--registry="{}"'.format(registry)) + cmd.append(f'--registry="{registry}"') if dry_run: cmd.append("--dry-run") @@ -222,7 +220,7 @@ def uninstall(pkg, dir=None, runas=None, env=None): if uid: env.update({"SUDO_UID": uid, "SUDO_USER": ""}) - cmd = ["npm", "uninstall", '"{}"'.format(pkg)] + cmd = ["npm", "uninstall", f'"{pkg}"'] if not dir: cmd.append("--global") @@ -291,14 +289,14 @@ def list_(pkg=None, dir=None, runas=None, env=None, depth=None): if depth is not None: if not isinstance(depth, (int, float)): raise salt.exceptions.SaltInvocationError( - "Error: depth {} must be a number".format(depth) + f"Error: depth {depth} must be a number" ) - cmd.append("--depth={}".format(int(depth))) + cmd.append(f"--depth={int(depth)}") if pkg: # Protect against injection pkg = shlex.quote(pkg) - cmd.append('"{}"'.format(pkg)) + cmd.append(f'"{pkg}"') cmd = " ".join(cmd) result = __salt__["cmd.run_all"]( diff --git a/salt/modules/nspawn.py b/salt/modules/nspawn.py index a1893ef8d2c..cd9d34e9e34 100644 --- a/salt/modules/nspawn.py +++ b/salt/modules/nspawn.py @@ -80,7 +80,7 @@ def _ensure_exists(wrapped): @functools.wraps(wrapped) def check_exists(name, *args, **kwargs): if not exists(name): - raise CommandExecutionError("Container '{}' does not exist".format(name)) + raise CommandExecutionError(f"Container '{name}' does not exist") return wrapped(name, *args, **salt.utils.args.clean_kwargs(**kwargs)) return check_exists @@ -114,14 +114,14 @@ def _make_container_root(name): path = _root(name) if os.path.exists(path): __context__["retcode"] = salt.defaults.exitcodes.SALT_BUILD_FAIL - raise CommandExecutionError("Container {} already exists".format(name)) + raise CommandExecutionError(f"Container {name} already exists") else: try: os.makedirs(path) return path except OSError as exc: raise CommandExecutionError( - "Unable to make container root directory {}: {}".format(name, exc) + f"Unable to make container root directory {name}: {exc}" ) @@ -131,10 +131,8 @@ def _build_failed(dst, name): shutil.rmtree(dst) except OSError as exc: if exc.errno != errno.ENOENT: - raise CommandExecutionError( - "Unable to cleanup container root dir {}".format(dst) - ) - raise CommandExecutionError("Container {} failed to build".format(name)) + raise CommandExecutionError(f"Unable to cleanup container root dir {dst}") + raise CommandExecutionError(f"Container {name} failed to build") def _bootstrap_arch(name, **kwargs): @@ -146,7 +144,7 @@ def _bootstrap_arch(name, **kwargs): "pacstrap not found, is the arch-install-scripts package installed?" ) dst = _make_container_root(name) - cmd = "pacstrap -c -d {} base".format(dst) + cmd = f"pacstrap -c -d {dst} base" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: _build_failed(dst, name) @@ -182,7 +180,7 @@ def _bootstrap_debian(name, **kwargs): ) dst = _make_container_root(name) - cmd = "debootstrap --arch=amd64 {} {}".format(version, dst) + cmd = f"debootstrap --arch=amd64 {version} {dst}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: _build_failed(dst, name) @@ -223,7 +221,7 @@ def _bootstrap_ubuntu(name, **kwargs): else: version = "xenial" dst = _make_container_root(name) - cmd = "debootstrap --arch=amd64 {} {}".format(version, dst) + cmd = f"debootstrap --arch=amd64 {version} {dst}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: _build_failed(dst, name) @@ -257,7 +255,7 @@ def _ensure_systemd(version): try: version = int(version) except ValueError: - raise CommandExecutionError("Invalid version '{}'".format(version)) + raise CommandExecutionError(f"Invalid version '{version}'") try: installed = _sd_version() @@ -279,7 +277,7 @@ def _machinectl(cmd, output_loglevel="debug", ignore_retcode=False, use_vt=False """ prefix = "machinectl --no-legend --no-pager" return __salt__["cmd.run_all"]( - "{} {}".format(prefix, cmd), + f"{prefix} {cmd}", output_loglevel=output_loglevel, ignore_retcode=ignore_retcode, use_vt=use_vt, @@ -349,9 +347,7 @@ def pid(name): try: return int(info(name).get("PID")) except (TypeError, ValueError) as exc: - raise CommandExecutionError( - "Unable to get PID for container '{}': {}".format(name, exc) - ) + raise CommandExecutionError(f"Unable to get PID for container '{name}': {exc}") def run( @@ -705,9 +701,9 @@ def bootstrap_container(name, dist=None, version=None): dist = __grains__["os"].lower() log.debug("nspawn.bootstrap: no dist provided, defaulting to '%s'", dist) try: - return globals()["_bootstrap_{}".format(dist)](name, version=version) + return globals()[f"_bootstrap_{dist}"](name, version=version) except KeyError: - raise CommandExecutionError('Unsupported distribution "{}"'.format(dist)) + raise CommandExecutionError(f'Unsupported distribution "{dist}"') def _needs_install(name): @@ -785,7 +781,7 @@ def bootstrap_salt( needs_install = _needs_install(name) else: needs_install = True - seeded = retcode(name, "test -e '{}'".format(SEED_MARKER)) == 0 + seeded = retcode(name, f"test -e '{SEED_MARKER}'") == 0 tmp = tempfile.mkdtemp() if seeded and not unconditional_install: ret = True @@ -802,20 +798,20 @@ def bootstrap_salt( if needs_install or force_install or unconditional_install: if install: rstr = __salt__["test.random_hash"]() - configdir = "/tmp/.c_{}".format(rstr) - run(name, "install -m 0700 -d {}".format(configdir), python_shell=False) + configdir = f"/tmp/.c_{rstr}" + run(name, f"install -m 0700 -d {configdir}", python_shell=False) bs_ = __salt__["config.gather_bootstrap_script"]( bootstrap=bootstrap_url ) dest_dir = os.path.join("/tmp", rstr) for cmd in [ - "mkdir -p {}".format(dest_dir), - "chmod 700 {}".format(dest_dir), + f"mkdir -p {dest_dir}", + f"chmod 700 {dest_dir}", ]: if run_stdout(name, cmd): log.error("tmpdir %s creation failed (%s)", dest_dir, cmd) return False - copy_to(name, bs_, "{}/bootstrap.sh".format(dest_dir), makedirs=True) + copy_to(name, bs_, f"{dest_dir}/bootstrap.sh", makedirs=True) copy_to(name, cfg_files["config"], os.path.join(configdir, "minion")) copy_to( name, cfg_files["privkey"], os.path.join(configdir, "minion.pem") @@ -848,7 +844,7 @@ def bootstrap_salt( stop(name) # mark seeded upon successful install if ret: - run(name, "touch '{}'".format(SEED_MARKER), python_shell=False) + run(name, f"touch '{SEED_MARKER}'", python_shell=False) return ret @@ -932,7 +928,7 @@ def exists(name): salt myminion nspawn.exists """ - contextkey = "nspawn.exists.{}".format(name) + contextkey = f"nspawn.exists.{name}" if contextkey in __context__: return __context__[contextkey] __context__[contextkey] = name in list_all() @@ -951,7 +947,7 @@ def state(name): salt myminion nspawn.state """ try: - cmd = "show {} --property=State".format(name) + cmd = f"show {name} --property=State" return _machinectl(cmd, ignore_retcode=True)["stdout"].split("=")[-1] except IndexError: return "stopped" @@ -991,11 +987,9 @@ def info(name, **kwargs): # Have to parse 'machinectl status' here since 'machinectl show' doesn't # contain IP address info or OS info. *shakes fist angrily* - c_info = _machinectl("status {}".format(name)) + c_info = _machinectl(f"status {name}") if c_info["retcode"] != 0: - raise CommandExecutionError( - "Unable to get info for container '{}'".format(name) - ) + raise CommandExecutionError(f"Unable to get info for container '{name}'") # Better human-readable names. False means key should be ignored. key_name_map = { "Iface": "Network Interface", @@ -1051,7 +1045,7 @@ def enable(name): salt myminion nspawn.enable """ - cmd = "systemctl enable systemd-nspawn@{}".format(name) + cmd = f"systemctl enable systemd-nspawn@{name}" if __salt__["cmd.retcode"](cmd, python_shell=False) != 0: __context__["retcode"] = salt.defaults.exitcodes.EX_UNAVAILABLE return False @@ -1069,7 +1063,7 @@ def disable(name): salt myminion nspawn.enable """ - cmd = "systemctl disable systemd-nspawn@{}".format(name) + cmd = f"systemctl disable systemd-nspawn@{name}" if __salt__["cmd.retcode"](cmd, python_shell=False) != 0: __context__["retcode"] = salt.defaults.exitcodes.EX_UNAVAILABLE return False @@ -1088,9 +1082,9 @@ def start(name): salt myminion nspawn.start """ if _sd_version() >= 219: - ret = _machinectl("start {}".format(name)) + ret = _machinectl(f"start {name}") else: - cmd = "systemctl start systemd-nspawn@{}".format(name) + cmd = f"systemctl start systemd-nspawn@{name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: @@ -1111,9 +1105,9 @@ def stop(name, kill=False): action = "terminate" else: action = "poweroff" - ret = _machinectl("{} {}".format(action, name)) + ret = _machinectl(f"{action} {name}") else: - cmd = "systemctl stop systemd-nspawn@{}".format(name) + cmd = f"systemctl stop systemd-nspawn@{name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: @@ -1203,7 +1197,7 @@ def reboot(name, kill=False): """ if _sd_version() >= 219: if state(name) == "running": - ret = _machinectl("reboot {}".format(name)) + ret = _machinectl(f"reboot {name}") else: # 'machinectl reboot' will fail on a stopped container return start(name) @@ -1213,7 +1207,7 @@ def reboot(name, kill=False): # we need stop and start the container in separate actions. # First stop the container - cmd = "systemctl stop systemd-nspawn@{}".format(name) + cmd = f"systemctl stop systemd-nspawn@{name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) # Now check if successful if ret["retcode"] != 0: @@ -1221,7 +1215,7 @@ def reboot(name, kill=False): return False # Finally, start the container back up. No need to check the retcode a # second time, it'll be checked below once we exit the if/else block. - cmd = "systemctl start systemd-nspawn@{}".format(name) + cmd = f"systemctl start systemd-nspawn@{name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) if ret["retcode"] != 0: @@ -1256,15 +1250,13 @@ def remove(name, stop=False): salt '*' nspawn.remove foo stop=True """ if not stop and state(name) != "stopped": - raise CommandExecutionError("Container '{}' is not stopped".format(name)) + raise CommandExecutionError(f"Container '{name}' is not stopped") def _failed_remove(name, exc): - raise CommandExecutionError( - "Unable to remove container '{}': {}".format(name, exc) - ) + raise CommandExecutionError(f"Unable to remove container '{name}': {exc}") if _sd_version() >= 219: - ret = _machinectl("remove {}".format(name)) + ret = _machinectl(f"remove {name}") if ret["retcode"] != 0: __context__["retcode"] = salt.defaults.exitcodes.EX_UNAVAILABLE _failed_remove(name, ret["stderr"]) @@ -1314,10 +1306,10 @@ def copy_to(name, source, dest, overwrite=False, makedirs=False): if source.startswith("salt://"): cached_source = __salt__["cp.cache_file"](source) if not cached_source: - raise CommandExecutionError("Unable to cache {}".format(source)) + raise CommandExecutionError(f"Unable to cache {source}") path = cached_source except AttributeError: - raise SaltInvocationError("Invalid source file {}".format(source)) + raise SaltInvocationError(f"Invalid source file {source}") if _sd_version() >= 219: # TODO: Use machinectl copy-to @@ -1345,13 +1337,13 @@ def _pull_image(pull_type, image, name, **kwargs): """ _ensure_systemd(219) if exists(name): - raise SaltInvocationError("Container '{}' already exists".format(name)) + raise SaltInvocationError(f"Container '{name}' already exists") if pull_type in ("raw", "tar"): valid_kwargs = ("verify",) elif pull_type == "dkr": valid_kwargs = ("index",) else: - raise SaltInvocationError("Unsupported image type '{}'".format(pull_type)) + raise SaltInvocationError(f"Unsupported image type '{pull_type}'") kwargs = salt.utils.args.clean_kwargs(**kwargs) bad_kwargs = { @@ -1383,7 +1375,7 @@ def _pull_image(pull_type, image, name, **kwargs): else: if verify not in ("signature", "checksum"): _bad_verify() - pull_opts.append("--verify={}".format(verify)) + pull_opts.append(f"--verify={verify}") elif pull_type == "dkr": # No need to validate the index URL, machinectl will take care of this diff --git a/salt/modules/nxos.py b/salt/modules/nxos.py index d1bd109063c..0cf01667d36 100644 --- a/salt/modules/nxos.py +++ b/salt/modules/nxos.py @@ -258,7 +258,7 @@ def get_roles(username, **kwargs): user = get_user(username) if not user: return [] - command = "show user-account {}".format(username) + command = f"show user-account {username}" info = sendline(command, **kwargs) if isinstance(info, list): info = info[0] @@ -278,7 +278,7 @@ def get_user(username, **kwargs): salt '*' nxos.get_user username=admin """ - command = 'show run | include "^username {} password 5 "'.format(username) + command = f'show run | include "^username {username} password 5 "' info = sendline(command, **kwargs) if isinstance(info, list): info = info[0] @@ -492,7 +492,7 @@ def config( context=None, defaults=None, saltenv="base", - **kwargs + **kwargs, ): """ Configures the Nexus switch with the specified commands. @@ -562,7 +562,7 @@ def config( if config_file: file_str = __salt__["cp.get_file_str"](config_file, saltenv=saltenv) if file_str is False: - raise CommandExecutionError("Source file {} not found".format(config_file)) + raise CommandExecutionError(f"Source file {config_file} not found") elif commands: if isinstance(commands, str): commands = [commands] @@ -664,7 +664,7 @@ def remove_user(username, **kwargs): salt '*' nxos.remove_user username=daniel """ - user_line = "no username {}".format(username) + user_line = f"no username {username}" kwargs = clean_kwargs(**kwargs) return config(user_line, **kwargs) @@ -681,7 +681,7 @@ def replace(old_value, new_value, full_match=False, **kwargs): salt '*' nxos.replace 'TESTSTRINGHERE' 'NEWTESTSTRINGHERE' """ if full_match is False: - matcher = re.compile("^.*{}.*$".format(re.escape(old_value)), re.MULTILINE) + matcher = re.compile(f"^.*{re.escape(old_value)}.*$", re.MULTILINE) repl = re.compile(re.escape(old_value)) else: matcher = re.compile(old_value, re.MULTILINE) @@ -719,7 +719,7 @@ def set_password( role=None, crypt_salt=None, algorithm="sha256", - **kwargs + **kwargs, ): """ Set users password on switch. @@ -767,9 +767,9 @@ def set_password( ) else: hashed_pass = password - password_line = "username {} password 5 {}".format(username, hashed_pass) + password_line = f"username {username} password 5 {hashed_pass}" if role is not None: - password_line += " role {}".format(role) + password_line += f" role {role}" kwargs = clean_kwargs(**kwargs) return config(password_line, **kwargs) @@ -793,7 +793,7 @@ def set_role(username, role, **kwargs): salt '*' nxos.set_role username=daniel role=vdc-admin. """ - role_line = "username {} role {}".format(username, role) + role_line = f"username {username} role {role}" kwargs = clean_kwargs(**kwargs) return config(role_line, **kwargs) @@ -817,7 +817,7 @@ def unset_role(username, role, **kwargs): salt '*' nxos.unset_role username=daniel role=vdc-admin """ - role_line = "no username {} role {}".format(username, role) + role_line = f"no username {username} role {role}" kwargs = clean_kwargs(**kwargs) return config(role_line, **kwargs) diff --git a/salt/modules/nxos_api.py b/salt/modules/nxos_api.py index 2513d9b0ff9..b787043f354 100644 --- a/salt/modules/nxos_api.py +++ b/salt/modules/nxos_api.py @@ -181,7 +181,7 @@ def _cli_command(commands, method="cli", **kwargs): ) raise SaltException(msg) else: - msg = 'Invalid command: "{cmd}".'.format(cmd=cmd) + msg = f'Invalid command: "{cmd}".' raise SaltException(msg) txt_responses.append(rpc_reponse["result"]) return txt_responses @@ -313,7 +313,7 @@ def config( context=None, defaults=None, saltenv="base", - **kwargs + **kwargs, ): """ Configures the Nexus switch with the specified commands. @@ -401,7 +401,7 @@ def config( if config_file: file_str = __salt__["cp.get_file_str"](config_file, saltenv=saltenv) if file_str is False: - raise CommandExecutionError("Source file {} not found".format(config_file)) + raise CommandExecutionError(f"Source file {config_file} not found") elif commands: if isinstance(commands, str): commands = [commands] diff --git a/salt/modules/nxos_upgrade.py b/salt/modules/nxos_upgrade.py index 69ce8d2b5c4..25f662db8ee 100644 --- a/salt/modules/nxos_upgrade.py +++ b/salt/modules/nxos_upgrade.py @@ -114,7 +114,7 @@ def check_upgrade_impact(system_image, kickstart_image=None, issu=True, **kwargs if ki is not None: cmd = cmd + " kickstart {0}:{1} system {0}:{2}".format(dev, ki, si) else: - cmd = cmd + " nxos {}:{}".format(dev, si) + cmd = cmd + f" nxos {dev}:{si}" if issu and ki is None: cmd = cmd + " non-disruptive" @@ -254,14 +254,14 @@ def _upgrade(system_image, kickstart_image, issu, **kwargs): if ki is None: logmsg = "Upgrading device using combined system/kickstart image." - logmsg += "\nSystem Image: {}".format(si) - cmd = cmd + " nxos {}:{}".format(dev, si) + logmsg += f"\nSystem Image: {si}" + cmd = cmd + f" nxos {dev}:{si}" if issu: cmd = cmd + " non-disruptive" else: logmsg = "Upgrading device using separate system/kickstart images." - logmsg += "\nSystem Image: {}".format(si) - logmsg += "\nKickstart Image: {}".format(ki) + logmsg += f"\nSystem Image: {si}" + logmsg += f"\nKickstart Image: {ki}" if not issu: log.info("Attempting upgrade using force option") cmd = cmd + " force" @@ -367,7 +367,7 @@ def _parse_upgrade_data(data): g3 = mo.group(3) g4 = mo.group(4) g5 = mo.group(5) - mk = "module {}:image {}".format(g1, g2) # module key + mk = f"module {g1}:image {g2}" # module key upgrade_result[bk][mk] = {} upgrade_result[bk][mk]["running_version"] = g3 upgrade_result[bk][mk]["new_version"] = g4 diff --git a/salt/modules/omapi.py b/salt/modules/omapi.py index fd92162b04b..e5d01260012 100644 --- a/salt/modules/omapi.py +++ b/salt/modules/omapi.py @@ -86,9 +86,9 @@ def add_host(mac, name=None, ip=None, ddns=False, group=None, supersede_host=Fal if group: msg.obj.append((b"group", salt.utils.stringutils.to_bytes(group))) if supersede_host: - statements += 'option host-name "{}"; '.format(name) + statements += f'option host-name "{name}"; ' if ddns and name: - statements += 'ddns-hostname "{}"; '.format(name) + statements += f'ddns-hostname "{name}"; ' if statements: msg.obj.append((b"statements", salt.utils.stringutils.to_bytes(statements))) response = o.query_server(msg) diff --git a/salt/modules/openbsd_sysctl.py b/salt/modules/openbsd_sysctl.py index 35a49297404..348d164efd0 100644 --- a/salt/modules/openbsd_sysctl.py +++ b/salt/modules/openbsd_sysctl.py @@ -61,7 +61,7 @@ def get(name): salt '*' sysctl.get hw.physmem """ - cmd = "sysctl -n {}".format(name) + cmd = f"sysctl -n {name}" out = __salt__["cmd.run"](cmd) return out @@ -77,7 +77,7 @@ def assign(name, value): salt '*' sysctl.assign net.inet.ip.forwarding 1 """ ret = {} - cmd = 'sysctl {}="{}"'.format(name, value) + cmd = f'sysctl {name}="{value}"' data = __salt__["cmd.run_all"](cmd) # Certain values cannot be set from this console, at the current @@ -119,7 +119,7 @@ def persist(name, value, config="/etc/sysctl.conf"): with salt.utils.files.fopen(config, "r") as ifile: for line in ifile: line = salt.utils.stringutils.to_unicode(line) - if not line.startswith("{}=".format(name)): + if not line.startswith(f"{name}="): nlines.append(line) continue else: @@ -133,11 +133,11 @@ def persist(name, value, config="/etc/sysctl.conf"): rest = rest[len(rest_v) :] if rest_v == value: return "Already set" - new_line = "{}={}{}".format(key, value, rest) + new_line = f"{key}={value}{rest}" nlines.append(new_line) edited = True if not edited: - nlines.append("{}={}\n".format(name, value)) + nlines.append(f"{name}={value}\n") with salt.utils.files.fopen(config, "wb") as ofile: ofile.writelines(salt.utils.data.encode(nlines)) diff --git a/salt/modules/openbsdpkg.py b/salt/modules/openbsdpkg.py index 3cbdc0cadf1..57d28ed96b5 100644 --- a/salt/modules/openbsdpkg.py +++ b/salt/modules/openbsdpkg.py @@ -95,7 +95,7 @@ def list_pkgs(versions_as_list=False, **kwargs): pkgname, pkgver, flavor = __PKG_RE.match(line).groups() except AttributeError: continue - pkgname += "--{}".format(flavor) if flavor else "" + pkgname += f"--{flavor}" if flavor else "" __salt__["pkg_resource.add_pkg"](ret, pkgname, pkgver) __salt__["pkg_resource.sort_pkglist"](ret) @@ -129,7 +129,7 @@ def latest_version(*names, **kwargs): ret[name] = "" # Query the repository for the package name - cmd = "pkg_info -Q {}".format(name) + cmd = f"pkg_info -Q {name}" out = __salt__["cmd.run_stdout"]( cmd, python_shell=False, output_loglevel="trace" ) @@ -153,8 +153,8 @@ def latest_version(*names, **kwargs): # First check if we need to look for flavors before # looking at unflavored packages. - if "{}--{}".format(pkgname, flavor) == name: - pkgname += "--{}".format(flavor) + if f"{pkgname}--{flavor}" == name: + pkgname += f"--{flavor}" elif pkgname == name: pass else: @@ -233,8 +233,8 @@ def install(name=None, pkgs=None, sources=None, **kwargs): if pkg_type == "repository": stem, branch = (pkg.split("%") + [""])[:2] base, flavor = (stem.split("--") + [""])[:2] - pkg = "{}--{}%{}".format(base, flavor, branch) - cmd = "pkg_add -x -I {}".format(pkg) + pkg = f"{base}--{flavor}%{branch}" + cmd = f"pkg_add -x -I {pkg}" out = __salt__["cmd.run_all"](cmd, python_shell=False, output_loglevel="trace") if out["retcode"] != 0 and out["stderr"]: errors.append(out["stderr"]) diff --git a/salt/modules/openbsdrcctl_service.py b/salt/modules/openbsdrcctl_service.py index 4baa0a4c56a..8a80cf57acd 100644 --- a/salt/modules/openbsdrcctl_service.py +++ b/salt/modules/openbsdrcctl_service.py @@ -56,7 +56,7 @@ def available(name): salt '*' service.available sshd """ - cmd = "{} get {}".format(_cmd(), name) + cmd = f"{_cmd()} get {name}" if __salt__["cmd.retcode"](cmd, ignore_retcode=True) == 2: return False return True @@ -88,7 +88,7 @@ def get_all(): """ ret = [] service = _cmd() - for svc in __salt__["cmd.run"]("{} ls all".format(service)).splitlines(): + for svc in __salt__["cmd.run"](f"{service} ls all").splitlines(): ret.append(svc) return sorted(ret) @@ -105,7 +105,7 @@ def get_disabled(): """ ret = [] service = _cmd() - for svc in __salt__["cmd.run"]("{} ls off".format(service)).splitlines(): + for svc in __salt__["cmd.run"](f"{service} ls off").splitlines(): ret.append(svc) return sorted(ret) @@ -122,7 +122,7 @@ def get_enabled(): """ ret = [] service = _cmd() - for svc in __salt__["cmd.run"]("{} ls on".format(service)).splitlines(): + for svc in __salt__["cmd.run"](f"{service} ls on").splitlines(): ret.append(svc) return sorted(ret) @@ -137,7 +137,7 @@ def start(name): salt '*' service.start """ - cmd = "{} -f start {}".format(_cmd(), name) + cmd = f"{_cmd()} -f start {name}" return not __salt__["cmd.retcode"](cmd) @@ -151,7 +151,7 @@ def stop(name): salt '*' service.stop """ - cmd = "{} stop {}".format(_cmd(), name) + cmd = f"{_cmd()} stop {name}" return not __salt__["cmd.retcode"](cmd) @@ -165,7 +165,7 @@ def restart(name): salt '*' service.restart """ - cmd = "{} -f restart {}".format(_cmd(), name) + cmd = f"{_cmd()} -f restart {name}" return not __salt__["cmd.retcode"](cmd) @@ -179,7 +179,7 @@ def reload_(name): salt '*' service.reload """ - cmd = "{} reload {}".format(_cmd(), name) + cmd = f"{_cmd()} reload {name}" return not __salt__["cmd.retcode"](cmd) @@ -197,7 +197,7 @@ def status(name, sig=None): if sig: return bool(__salt__["status.pid"](sig)) - cmd = "{} check {}".format(_cmd(), name) + cmd = f"{_cmd()} check {name}" return not __salt__["cmd.retcode"](cmd, ignore_retcode=True) @@ -217,14 +217,14 @@ def enable(name, **kwargs): salt '*' service.enable salt '*' service.enable flags= """ - stat_cmd = "{} set {} status on".format(_cmd(), name) + stat_cmd = f"{_cmd()} set {name} status on" stat_retcode = __salt__["cmd.retcode"](stat_cmd) flag_retcode = None # only (re)set flags for services that have an rc.d(8) script - if os.path.exists("/etc/rc.d/{}".format(name)): + if os.path.exists(f"/etc/rc.d/{name}"): flags = _get_flags(**kwargs) - flag_cmd = "{} set {} flags {}".format(_cmd(), name, flags) + flag_cmd = f"{_cmd()} set {name} flags {flags}" flag_retcode = __salt__["cmd.retcode"](flag_cmd) return not any([stat_retcode, flag_retcode]) @@ -240,7 +240,7 @@ def disable(name, **kwargs): salt '*' service.disable """ - cmd = "{} set {} status off".format(_cmd(), name) + cmd = f"{_cmd()} set {name} status off" return not __salt__["cmd.retcode"](cmd) @@ -254,7 +254,7 @@ def disabled(name): salt '*' service.disabled """ - cmd = "{} get {} status".format(_cmd(), name) + cmd = f"{_cmd()} get {name} status" return not __salt__["cmd.retcode"](cmd, ignore_retcode=True) == 0 @@ -273,18 +273,16 @@ def enabled(name, **kwargs): salt '*' service.enabled salt '*' service.enabled flags= """ - cmd = "{} get {} status".format(_cmd(), name) + cmd = f"{_cmd()} get {name} status" if not __salt__["cmd.retcode"](cmd, ignore_retcode=True): # also consider a service disabled if the current flags are different # than the configured ones so we have a chance to update them flags = _get_flags(**kwargs) - cur_flags = __salt__["cmd.run_stdout"]("{} get {} flags".format(_cmd(), name)) + cur_flags = __salt__["cmd.run_stdout"](f"{_cmd()} get {name} flags") if format(flags) == format(cur_flags): return True if not flags: - def_flags = __salt__["cmd.run_stdout"]( - "{} getdef {} flags".format(_cmd(), name) - ) + def_flags = __salt__["cmd.run_stdout"](f"{_cmd()} getdef {name} flags") if format(cur_flags) == format(def_flags): return True diff --git a/salt/modules/openbsdservice.py b/salt/modules/openbsdservice.py index 58304aa9fdb..70fe9981f54 100644 --- a/salt/modules/openbsdservice.py +++ b/salt/modules/openbsdservice.py @@ -55,7 +55,7 @@ def start(name): salt '*' service.start """ - cmd = "/etc/rc.d/{} -f start".format(name) + cmd = f"/etc/rc.d/{name} -f start" return not __salt__["cmd.retcode"](cmd) @@ -69,7 +69,7 @@ def stop(name): salt '*' service.stop """ - cmd = "/etc/rc.d/{} -f stop".format(name) + cmd = f"/etc/rc.d/{name} -f stop" return not __salt__["cmd.retcode"](cmd) @@ -83,7 +83,7 @@ def restart(name): salt '*' service.restart """ - cmd = "/etc/rc.d/{} -f restart".format(name) + cmd = f"/etc/rc.d/{name} -f restart" return not __salt__["cmd.retcode"](cmd) @@ -120,7 +120,7 @@ def status(name, sig=None): services = [name] results = {} for service in services: - cmd = "/etc/rc.d/{} -f check".format(service) + cmd = f"/etc/rc.d/{service} -f check" results[service] = not __salt__["cmd.retcode"](cmd, ignore_retcode=True) if contains_globbing: return results @@ -139,7 +139,7 @@ def reload_(name): salt '*' service.reload """ - cmd = "/etc/rc.d/{} -f reload".format(name) + cmd = f"/etc/rc.d/{name} -f reload" return not __salt__["cmd.retcode"](cmd) @@ -219,7 +219,7 @@ def available(name): salt '*' service.available sshd """ - path = "/etc/rc.d/{}".format(name) + path = f"/etc/rc.d/{name}" return os.path.isfile(path) and os.access(path, os.X_OK) diff --git a/salt/modules/openvswitch.py b/salt/modules/openvswitch.py index e0dc7ac2677..8063d0ad52e 100644 --- a/salt/modules/openvswitch.py +++ b/salt/modules/openvswitch.py @@ -175,7 +175,7 @@ def bridge_exists(br): salt '*' openvswitch.bridge_exists br0 """ - cmd = "ovs-vsctl br-exists {}".format(br) + cmd = f"ovs-vsctl br-exists {br}" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] return _retcode_to_bool(retcode) @@ -215,8 +215,8 @@ def bridge_create(br, may_exist=True, parent=None, vlan=None): raise ArgumentValueError("If parent is specified, vlan must also be specified.") if vlan is not None and parent is None: raise ArgumentValueError("If vlan is specified, parent must also be specified.") - param_parent = "" if parent is None else " {}".format(parent) - param_vlan = "" if vlan is None else " {}".format(vlan) + param_parent = "" if parent is None else f" {parent}" + param_vlan = "" if vlan is None else f" {vlan}" cmd = "ovs-vsctl {1}add-br {0}{2}{3}".format( br, param_may_exist, param_parent, param_vlan ) @@ -244,7 +244,7 @@ def bridge_delete(br, if_exists=True): salt '*' openvswitch.bridge_delete br0 """ param_if_exists = _param_if_exists(if_exists) - cmd = "ovs-vsctl {1}del-br {0}".format(br, param_if_exists) + cmd = f"ovs-vsctl {param_if_exists}del-br {br}" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] return _retcode_to_bool(retcode) @@ -271,7 +271,7 @@ def bridge_to_parent(br): salt '*' openvswitch.bridge_to_parent br0 """ - cmd = "ovs-vsctl br-to-parent {}".format(br) + cmd = f"ovs-vsctl br-to-parent {br}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] != 0: return False @@ -298,7 +298,7 @@ def bridge_to_vlan(br): salt '*' openvswitch.bridge_to_parent br0 """ - cmd = "ovs-vsctl br-to-vlan {}".format(br) + cmd = f"ovs-vsctl br-to-vlan {br}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] != 0: return False @@ -327,9 +327,9 @@ def port_add(br, port, may_exist=False, internal=False): salt '*' openvswitch.port_add br0 8080 """ param_may_exist = _param_may_exist(may_exist) - cmd = "ovs-vsctl {2}add-port {0} {1}".format(br, port, param_may_exist) + cmd = f"ovs-vsctl {param_may_exist}add-port {br} {port}" if internal: - cmd += " -- set interface {} type=internal".format(port) + cmd += f" -- set interface {port} type=internal" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] return _retcode_to_bool(retcode) @@ -358,9 +358,9 @@ def port_remove(br, port, if_exists=True): param_if_exists = _param_if_exists(if_exists) if port and not br: - cmd = "ovs-vsctl {1}del-port {0}".format(port, param_if_exists) + cmd = f"ovs-vsctl {param_if_exists}del-port {port}" else: - cmd = "ovs-vsctl {2}del-port {0} {1}".format(br, port, param_if_exists) + cmd = f"ovs-vsctl {param_if_exists}del-port {br} {port}" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] return _retcode_to_bool(retcode) @@ -384,7 +384,7 @@ def port_list(br): salt '*' openvswitch.port_list br0 """ - cmd = "ovs-vsctl list-ports {}".format(br) + cmd = f"ovs-vsctl list-ports {br}" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] stdout = result["stdout"] @@ -409,7 +409,7 @@ def port_get_tag(port): salt '*' openvswitch.port_get_tag tap0 """ - cmd = "ovs-vsctl get port {} tag".format(port) + cmd = f"ovs-vsctl get port {port} tag" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] stdout = result["stdout"] @@ -434,7 +434,7 @@ def interface_get_options(port): salt '*' openvswitch.interface_get_options tap0 """ - cmd = "ovs-vsctl get interface {} options".format(port) + cmd = f"ovs-vsctl get interface {port} options" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] stdout = result["stdout"] @@ -459,7 +459,7 @@ def interface_get_type(port): salt '*' openvswitch.interface_get_type tap0 """ - cmd = "ovs-vsctl get interface {} type".format(port) + cmd = f"ovs-vsctl get interface {port} type" result = __salt__["cmd.run_all"](cmd) retcode = result["retcode"] stdout = result["stdout"] @@ -495,15 +495,15 @@ def port_create_vlan(br, port, id, internal=False): elif not internal and port not in interfaces: return False elif port in port_list(br): - cmd = "ovs-vsctl set port {} tag={}".format(port, id) + cmd = f"ovs-vsctl set port {port} tag={id}" if internal: - cmd += " -- set interface {} type=internal".format(port) + cmd += f" -- set interface {port} type=internal" result = __salt__["cmd.run_all"](cmd) return _retcode_to_bool(result["retcode"]) else: - cmd = "ovs-vsctl add-port {} {} tag={}".format(br, port, id) + cmd = f"ovs-vsctl add-port {br} {port} tag={id}" if internal: - cmd += " -- set interface {} type=internal".format(port) + cmd += f" -- set interface {port} type=internal" result = __salt__["cmd.run_all"](cmd) return _retcode_to_bool(result["retcode"]) @@ -622,7 +622,7 @@ def db_get(table, record, column, if_exists=False): salt '*' openvswitch.db_get Port br0 vlan_mode """ - cmd = ["ovs-vsctl", "--format=json", "--columns={}".format(column)] + cmd = ["ovs-vsctl", "--format=json", f"--columns={column}"] if if_exists: cmd += ["--if-exists"] cmd += ["list", table, record] @@ -666,7 +666,7 @@ def db_set(table, record, column, value, if_exists=False): cmd = ["ovs-vsctl"] if if_exists: cmd += ["--if-exists"] - cmd += ["set", table, record, "{}={}".format(column, json.dumps(value))] + cmd += ["set", table, record, f"{column}={json.dumps(value)}"] result = __salt__["cmd.run_all"](cmd) if result["retcode"] != 0: return result["stderr"] diff --git a/salt/modules/opkg.py b/salt/modules/opkg.py index 72e7bcbb411..725a222b5d4 100644 --- a/salt/modules/opkg.py +++ b/salt/modules/opkg.py @@ -107,7 +107,7 @@ def _update_nilrt_restart_state(): if os.path.exists(nisysapi_conf_d_path): with salt.utils.files.fopen( - "{}/sysapi.conf.d.count".format(NILRT_RESTARTCHECK_STATE_PATH), "w" + f"{NILRT_RESTARTCHECK_STATE_PATH}/sysapi.conf.d.count", "w" ) as fcount: fcount.write(str(len(os.listdir(nisysapi_conf_d_path)))) @@ -135,7 +135,7 @@ def _fingerprint_file(*, filename, fingerprint_dir): ) ) __salt__["cmd.shell"]( - "md5sum {} > {}/{}.md5sum".format(filename, fingerprint_dir, filename.name) + f"md5sum {filename} > {fingerprint_dir}/{filename.name}.md5sum" ) @@ -532,7 +532,7 @@ def install( else: to_install.append(pkgname) else: - pkgstr = "{}={}".format(pkgname, version_num) + pkgstr = f"{pkgname}={version_num}" cver = old.get(pkgname, "") if ( reinstall @@ -839,15 +839,15 @@ def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613 state = _get_state(target) if not state: - ret[target]["comment"] = "Package {} not currently held.".format(target) + ret[target]["comment"] = f"Package {target} not currently held." elif state != "hold": if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) - ret[target]["comment"] = "Package {} is set to be held.".format(target) + ret[target]["comment"] = f"Package {target} is set to be held." else: result = _set_state(target, "hold") ret[target].update(changes=result[target], result=True) - ret[target]["comment"] = "Package {} is now being held.".format(target) + ret[target]["comment"] = f"Package {target} is now being held." else: ret[target].update(result=True) ret[target]["comment"] = "Package {} is already set to be held.".format( @@ -902,11 +902,11 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 state = _get_state(target) if not state: - ret[target]["comment"] = "Package {} does not have a state.".format(target) + ret[target]["comment"] = f"Package {target} does not have a state." elif state == "hold": if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) - ret["comment"] = "Package {} is set not to be held.".format(target) + ret["comment"] = f"Package {target} is set not to be held." else: result = _set_state(target, "ok") ret[target].update(changes=result[target], result=True) @@ -960,7 +960,7 @@ def _set_state(pkg, state): ret = {} valid_states = ("hold", "noprune", "user", "ok", "installed", "unpacked") if state not in valid_states: - raise SaltInvocationError("Invalid state: {}".format(state)) + raise SaltInvocationError(f"Invalid state: {state}") oldstate = _get_state(pkg) cmd = ["opkg", "flag"] cmd.append(state) @@ -1469,7 +1469,7 @@ def del_repo(repo, **kwargs): # pylint: disable=unused-argument refresh_db() return ret - return "Repo {} doesn't exist in the opkg repo lists".format(repo) + return f"Repo {repo} doesn't exist in the opkg repo lists" def mod_repo(repo, **kwargs): @@ -1517,9 +1517,9 @@ def mod_repo(repo, **kwargs): repostr += "src/gz" if source["compressed"] else "src" repo_alias = kwargs["alias"] if "alias" in kwargs else repo if " " in repo_alias: - repostr += ' "{}"'.format(repo_alias) + repostr += f' "{repo_alias}"' else: - repostr += " {}".format(repo_alias) + repostr += f" {repo_alias}" repostr += " {}".format(kwargs["uri"] if "uri" in kwargs else source["uri"]) trusted = kwargs.get("trusted") repostr = ( diff --git a/salt/modules/osquery.py b/salt/modules/osquery.py index c28d1685dc5..0bb7b6c994f 100644 --- a/salt/modules/osquery.py +++ b/salt/modules/osquery.py @@ -36,7 +36,7 @@ def _table_attrs(table): """ Helper function to find valid table attributes """ - cmd = ["osqueryi"] + ["--json"] + ["pragma table_info({})".format(table)] + cmd = ["osqueryi"] + ["--json"] + [f"pragma table_info({table})"] res = __salt__["cmd.run_all"](cmd) if res["retcode"] == 0: attrs = [] @@ -82,13 +82,13 @@ def _osquery_cmd(table, attrs=None, where=None, format="json"): if a not in valid_attrs: ret["result"] = False ret["comment"] = ( - "{} is not a valid attribute for table {}".format(a, table) + f"{a} is not a valid attribute for table {table}" ) return ret _attrs = ",".join(attrs) else: ret["result"] = False - ret["comment"] = "Invalid table {}.".format(table) + ret["comment"] = f"Invalid table {table}." return ret else: ret["comment"] = "attrs must be specified as a list." @@ -97,12 +97,12 @@ def _osquery_cmd(table, attrs=None, where=None, format="json"): else: _attrs = "*" - sql = "select {} from {}".format(_attrs, table) + sql = f"select {_attrs} from {table}" if where: - sql = "{} where {}".format(sql, where) + sql = f"{sql} where {where}" - sql = "{};".format(sql) + sql = f"{sql};" res = _osquery(sql) if res["result"]: diff --git a/salt/modules/pacmanpkg.py b/salt/modules/pacmanpkg.py index 25ed1177d9d..57df5f72cb8 100644 --- a/salt/modules/pacmanpkg.py +++ b/salt/modules/pacmanpkg.py @@ -567,11 +567,9 @@ def install( if prefix == "=": wildcards.append((param, verstr)) else: - errors.append( - "Invalid wildcard for {}{}{}".format(param, prefix, verstr) - ) + errors.append(f"Invalid wildcard for {param}{prefix}{verstr}") continue - targets.append("{}{}{}".format(param, prefix, verstr)) + targets.append(f"{param}{prefix}{verstr}") if wildcards: # Resolve wildcard matches diff --git a/salt/modules/pagerduty_util.py b/salt/modules/pagerduty_util.py index 10114b3e4bb..7485fa30e2f 100644 --- a/salt/modules/pagerduty_util.py +++ b/salt/modules/pagerduty_util.py @@ -347,7 +347,7 @@ def create_or_update_resource( resource_id = _get_resource_id(resource) return _query( method="PUT", - action="{}/{}".format(resource_name, resource_id), + action=f"{resource_name}/{resource_id}", data=data_to_update, profile=profile, subdomain=subdomain, @@ -385,7 +385,7 @@ def delete_resource( resource_id = _get_resource_id(resource) return _query( method="DELETE", - action="{}/{}".format(resource_name, resource_id), + action=f"{resource_name}/{resource_id}", profile=profile, subdomain=subdomain, api_key=api_key, @@ -401,7 +401,7 @@ def resource_present( profile="pagerduty", subdomain=None, api_key=None, - **kwargs + **kwargs, ): """ Generic resource.present state method. Pagerduty state modules should be a thin wrapper over this method, @@ -444,7 +444,7 @@ def resource_absent( profile="pagerduty", subdomain=None, api_key=None, - **kwargs + **kwargs, ): """ Generic resource.absent state method. Pagerduty state modules should be a thin wrapper over this method, @@ -469,7 +469,7 @@ def resource_absent( ) if result is None: ret["result"] = True - ret["comment"] = "{} deleted".format(v) + ret["comment"] = f"{v} deleted" return ret elif result is True: continue diff --git a/salt/modules/pam.py b/salt/modules/pam.py index 58254917e35..50b09262856 100644 --- a/salt/modules/pam.py +++ b/salt/modules/pam.py @@ -54,7 +54,7 @@ def _parse(contents=None, file_name=None): position += 1 break else: - control_flag += " {}".format(part) + control_flag += f" {part}" else: control_flag = comps[1] position += 1 diff --git a/salt/modules/panos.py b/salt/modules/panos.py index f5e22d268be..73dd05bd92f 100644 --- a/salt/modules/panos.py +++ b/salt/modules/panos.py @@ -228,7 +228,7 @@ def delete_license(key_name=None): else: query = { "type": "op", - "cmd": "{}".format(key_name), + "cmd": f"{key_name}", } return __proxy__["panos.call"](query) @@ -774,7 +774,7 @@ def get_interface_counters(name="all"): """ query = { "type": "op", - "cmd": "{}".format(name), + "cmd": f"{name}", } return __proxy__["panos.call"](query) @@ -797,7 +797,7 @@ def get_interfaces(name="all"): """ query = { "type": "op", - "cmd": "{}".format(name), + "cmd": f"{name}", } return __proxy__["panos.call"](query) @@ -820,7 +820,7 @@ def get_job(jid=None): if not jid: raise CommandExecutionError("ID option must not be none.") - query = {"type": "op", "cmd": "{}".format(jid)} + query = {"type": "op", "cmd": f"{jid}"} return __proxy__["panos.call"](query) @@ -1169,7 +1169,7 @@ def get_predefined_application(application=None): query = { "type": "config", "action": "get", - "xpath": "/config/predefined/application/entry[@name='{}']".format(application), + "xpath": f"/config/predefined/application/entry[@name='{application}']", } return __proxy__["panos.call"](query) @@ -1799,7 +1799,7 @@ def save_device_config(filename=None): query = { "type": "op", - "cmd": "{}".format(filename), + "cmd": f"{filename}", } return __proxy__["panos.call"](query) @@ -1893,7 +1893,7 @@ def set_hostname(hostname=None, deploy=False): "xpath": ( "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system" ), - "element": "{}".format(hostname), + "element": f"{hostname}", } ret.update(__proxy__["panos.call"](query)) @@ -1937,7 +1937,7 @@ def set_management_icmp(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -1981,7 +1981,7 @@ def set_management_http(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -2025,7 +2025,7 @@ def set_management_https(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -2069,7 +2069,7 @@ def set_management_ocsp(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -2113,7 +2113,7 @@ def set_management_snmp(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -2157,7 +2157,7 @@ def set_management_ssh(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -2201,7 +2201,7 @@ def set_management_telnet(enabled=True, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/service", - "element": "{}".format(value), + "element": f"{value}", } ret.update(__proxy__["panos.call"](query)) @@ -2446,7 +2446,7 @@ def set_permitted_ip(address=None, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/permitted-ip", - "element": "".format(address), + "element": f"", } ret.update(__proxy__["panos.call"](query)) @@ -2484,7 +2484,7 @@ def set_timezone(tz=None, deploy=False): "type": "config", "action": "set", "xpath": "/config/devices/entry[@name='localhost.localdomain']/deviceconfig/system/timezone", - "element": "{}".format(tz), + "element": f"{tz}", } ret.update(__proxy__["panos.call"](query)) @@ -2534,10 +2534,10 @@ def test_fib_route(ip=None, vr="vr1"): xpath = "" if ip: - xpath += "{}".format(ip) + xpath += f"{ip}" if vr: - xpath += "{}".format(vr) + xpath += f"{vr}" xpath += "" @@ -2593,35 +2593,35 @@ def test_security_policy( xpath = "" if sourcezone: - xpath += "{}".format(sourcezone) + xpath += f"{sourcezone}" if destinationzone: - xpath += "{}".format(destinationzone) + xpath += f"{destinationzone}" if source: - xpath += "{}".format(source) + xpath += f"{source}" if destination: - xpath += "{}".format(destination) + xpath += f"{destination}" if protocol: - xpath += "{}".format(protocol) + xpath += f"{protocol}" if port: - xpath += "{}".format(port) + xpath += f"{port}" if application: - xpath += "{}".format(application) + xpath += f"{application}" if category: - xpath += "{}".format(category) + xpath += f"{category}" if allrules: xpath += "yes" xpath += "" - query = {"type": "op", "vsys": "vsys{}".format(vsys), "cmd": xpath} + query = {"type": "op", "vsys": f"vsys{vsys}", "cmd": xpath} return __proxy__["panos.call"](query) diff --git a/salt/modules/parallels.py b/salt/modules/parallels.py index 27f187bacae..2f8ddf80556 100644 --- a/salt/modules/parallels.py +++ b/salt/modules/parallels.py @@ -277,7 +277,7 @@ def exists(name, runas=None): """ vm_info = list_vms(name, info=True, runas=runas).splitlines() for info_line in vm_info: - if "Name: {}".format(name) in info_line: + if f"Name: {name}" in info_line: return True return False @@ -453,7 +453,7 @@ def snapshot_id_to_name(name, snap_id, strict=False, runas=None): name = salt.utils.data.decode(name) if not re.match(GUID_REGEX, snap_id): raise SaltInvocationError( - 'Snapshot ID "{}" is not a GUID'.format(salt.utils.data.decode(snap_id)) + f'Snapshot ID "{salt.utils.data.decode(snap_id)}" is not a GUID' ) # Get the snapshot information of the snapshot having the requested ID @@ -461,9 +461,7 @@ def snapshot_id_to_name(name, snap_id, strict=False, runas=None): # Parallels desktop returned no information for snap_id if not info: - raise SaltInvocationError( - 'No snapshots for VM "{}" have ID "{}"'.format(name, snap_id) - ) + raise SaltInvocationError(f'No snapshots for VM "{name}" have ID "{snap_id}"') # Try to interpret the information try: @@ -540,7 +538,7 @@ def snapshot_name_to_id(name, snap_name, strict=False, runas=None): # non-singular names if not named_ids: raise SaltInvocationError( - 'No snapshots for VM "{}" have name "{}"'.format(name, snap_name) + f'No snapshots for VM "{name}" have name "{snap_name}"' ) elif len(named_ids) == 1: return named_ids[0] @@ -634,7 +632,7 @@ def list_snapshots(name, snap_name=None, tree=False, names=False, runas=None): ret = "{:<38} {}\n".format("Snapshot ID", "Snapshot Name") for snap_id in snap_ids: snap_name = snapshot_id_to_name(name, snap_id, runas=runas) - ret += "{{{0}}} {1}\n".format(snap_id, salt.utils.data.decode(snap_name)) + ret += f"{{{snap_id}}} {salt.utils.data.decode(snap_name)}\n" return ret # Return information directly from parallels desktop diff --git a/salt/modules/parted_partition.py b/salt/modules/parted_partition.py index 02c5ab5a49d..1c9a135b7b8 100644 --- a/salt/modules/parted_partition.py +++ b/salt/modules/parted_partition.py @@ -140,9 +140,7 @@ def _validate_partition_boundary(boundary): unit = match.group(2) if not unit or unit in VALID_UNITS: return - raise CommandExecutionError( - 'Invalid partition boundary passed: "{}"'.format(boundary) - ) + raise CommandExecutionError(f'Invalid partition boundary passed: "{boundary}"') def probe(*devices): @@ -186,9 +184,9 @@ def list_(device, unit=None): if unit: if unit not in VALID_UNITS: raise CommandExecutionError("Invalid unit passed to partition.part_list") - cmd = "parted -m -s {} unit {} print".format(device, unit) + cmd = f"parted -m -s {device} unit {unit} print" else: - cmd = "parted -m -s {} print".format(device) + cmd = f"parted -m -s {device} print" out = __salt__["cmd.run_stdout"](cmd).splitlines() ret = {"info": {}, "partitions": {}} @@ -268,7 +266,7 @@ def align_check(device, part_type, partition): except Exception: # pylint: disable=broad-except raise CommandExecutionError("Invalid partition passed to partition.align_check") - cmd = "parted -m {} align-check {} {}".format(device, part_type, partition) + cmd = f"parted -m {device} align-check {part_type} {partition}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -290,7 +288,7 @@ def check(device, minor): except Exception: # pylint: disable=broad-except raise CommandExecutionError("Invalid minor number passed to partition.check") - cmd = "parted -m -s {} check {}".format(device, minor) + cmd = f"parted -m -s {device} check {minor}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -315,7 +313,7 @@ def cp(device, from_minor, to_minor): # pylint: disable=C0103 except Exception: # pylint: disable=broad-except raise CommandExecutionError("Invalid minor number passed to partition.cp") - cmd = "parted -m -s {} cp {} {}".format(device, from_minor, to_minor) + cmd = f"parted -m -s {device} cp {from_minor} {to_minor}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -344,7 +342,7 @@ def get_id(device, minor): except Exception: # pylint: disable=broad-except raise CommandExecutionError("Invalid minor number passed to partition.get_id") - cmd = "sfdisk --print-id {} {}".format(device, minor) + cmd = f"sfdisk --print-id {device} {minor}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -376,7 +374,7 @@ def set_id(device, minor, system_id): if system_id not in system_types(): raise CommandExecutionError("Invalid system_id passed to partition.set_id") - cmd = "sfdisk --change-id {} {} {}".format(device, minor, system_id) + cmd = f"sfdisk --change-id {device} {minor} {system_id}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -451,11 +449,11 @@ def mkfs(device, fs_type): if fs_type == "linux-swap": mkfs_cmd = "mkswap" else: - mkfs_cmd = "mkfs.{}".format(fs_type) + mkfs_cmd = f"mkfs.{fs_type}" if not salt.utils.path.which(mkfs_cmd): - return "Error: {} is unavailable.".format(mkfs_cmd) - cmd = "{} {}".format(mkfs_cmd, device) + return f"Error: {mkfs_cmd} is unavailable." + cmd = f"{mkfs_cmd} {device}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -582,7 +580,7 @@ def name(device, partition, name): if letter not in valid: raise CommandExecutionError("Invalid characters passed to partition.name") - cmd = '''parted -m -s {} name {} "'{}'"'''.format(device, partition, name) + cmd = f'''parted -m -s {device} name {partition} "'{name}'"''' out = __salt__["cmd.run"](cmd).splitlines() return out @@ -603,7 +601,7 @@ def rescue(device, start, end): _validate_partition_boundary(start) _validate_partition_boundary(end) - cmd = "parted -m -s {} rescue {} {}".format(device, start, end) + cmd = f"parted -m -s {device} rescue {start} {end}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -633,9 +631,7 @@ def resize(device, minor, start, end): _validate_partition_boundary(start) _validate_partition_boundary(end) - out = __salt__["cmd.run"]( - "parted -m -s -- {} resize {} {} {}".format(device, minor, start, end) - ) + out = __salt__["cmd.run"](f"parted -m -s -- {device} resize {minor} {start} {end}") return out.splitlines() @@ -656,7 +652,7 @@ def rm(device, minor): # pylint: disable=C0103 except Exception: # pylint: disable=broad-except raise CommandExecutionError("Invalid minor number passed to partition.rm") - cmd = "parted -m -s {} rm {}".format(device, minor) + cmd = f"parted -m -s {device} rm {minor}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -709,7 +705,7 @@ def set_(device, minor, flag, state): if state not in {"on", "off"}: raise CommandExecutionError("Invalid state passed to partition.set") - cmd = "parted -m -s {} set {} {} {}".format(device, minor, flag, state) + cmd = f"parted -m -s {device} set {minor} {flag} {state}" out = __salt__["cmd.run"](cmd).splitlines() return out @@ -737,7 +733,7 @@ def toggle(device, partition, flag): if flag not in VALID_PARTITION_FLAGS: raise CommandExecutionError("Invalid flag passed to partition.toggle") - cmd = "parted -m -s {} toggle {} {}".format(device, partition, flag) + cmd = f"parted -m -s {device} toggle {partition} {flag}" out = __salt__["cmd.run"](cmd).splitlines() return out diff --git a/salt/modules/pcs.py b/salt/modules/pcs.py index 8225206f51c..78415307dda 100644 --- a/salt/modules/pcs.py +++ b/salt/modules/pcs.py @@ -159,7 +159,7 @@ def item_create( if isinstance(extra_args, (list, tuple)): # constraint command needs item_id in format 'id= 0: diff --git a/salt/modules/pecl.py b/salt/modules/pecl.py index 2a649923f62..d5ff3543bfa 100644 --- a/salt/modules/pecl.py +++ b/salt/modules/pecl.py @@ -30,7 +30,7 @@ def _pecl(command, defaults=False): """ Execute the command passed with pecl """ - cmdline = "pecl {}".format(command) + cmdline = f"pecl {command}" if salt.utils.data.is_true(defaults): cmdline = "yes ''" + " | " + cmdline @@ -68,7 +68,7 @@ def install(pecls, defaults=False, force=False, preferred_state="stable"): """ if isinstance(pecls, str): pecls = [pecls] - preferred_state = "-d preferred_state={}".format(shlex.quote(preferred_state)) + preferred_state = f"-d preferred_state={shlex.quote(preferred_state)}" if force: return _pecl( "{} install -f {}".format(preferred_state, shlex.quote(" ".join(pecls))), @@ -149,7 +149,7 @@ def list_(channel=None): pecls = {} command = "list" if channel: - command = "{} -c {}".format(command, shlex.quote(channel)) + command = f"{command} -c {shlex.quote(channel)}" lines = _pecl(command).splitlines() lines = (l for l in lines if pecl_channel_pat.match(l)) diff --git a/salt/modules/peeringdb.py b/salt/modules/peeringdb.py index 6a77a35fa03..cef8771aef8 100644 --- a/salt/modules/peeringdb.py +++ b/salt/modules/peeringdb.py @@ -55,8 +55,8 @@ def _get_auth(username=None, password=None): def _build_url(endpoint, id=None): if id: - return "{base}/{endp}/{id}".format(base=PEERINGDB_URL, endp=endpoint, id=id) - return "{base}/{endp}".format(base=PEERINGDB_URL, endp=endpoint) + return f"{PEERINGDB_URL}/{endpoint}/{id}" + return f"{PEERINGDB_URL}/{endpoint}" def _get_endpoint(endpoint, id=None, **kwargs): diff --git a/salt/modules/pf.py b/salt/modules/pf.py index 3a52257c8cf..f66849ed3f5 100644 --- a/salt/modules/pf.py +++ b/salt/modules/pf.py @@ -126,10 +126,10 @@ def loglevel(level): "debug", ] if level not in all_levels: - raise SaltInvocationError("Unknown loglevel: {}".format(level)) + raise SaltInvocationError(f"Unknown loglevel: {level}") result = __salt__["cmd.run_all"]( - "pfctl -x {}".format(level), output_loglevel="trace", python_shell=False + f"pfctl -x {level}", output_loglevel="trace", python_shell=False ) if result["retcode"] != 0: @@ -170,7 +170,7 @@ def load(file="/etc/pf.conf", noop=False): if result["retcode"] != 0: raise CommandExecutionError( - "Problem loading the ruleset from {}".format(file), + f"Problem loading the ruleset from {file}", info={"errors": [result["stderr"]], "changes": False}, ) @@ -213,9 +213,9 @@ def flush(modifier): modifier = modifier.title() if modifier not in all_modifiers: - raise SaltInvocationError("Unknown modifier: {}".format(modifier)) + raise SaltInvocationError(f"Unknown modifier: {modifier}") - cmd = "pfctl -v -F {}".format(modifier) + cmd = f"pfctl -v -F {modifier}" result = __salt__["cmd.run_all"](cmd, output_loglevel="trace", python_shell=False) if result["retcode"] == 0: @@ -227,7 +227,7 @@ def flush(modifier): ret["comment"] = result["stderr"] else: raise CommandExecutionError( - "Could not flush {}".format(modifier), + f"Could not flush {modifier}", info={"errors": [result["stderr"]], "changes": False}, ) @@ -278,7 +278,7 @@ def table(command, table, **kwargs): "zero", ] if command not in all_commands: - raise SaltInvocationError("Unknown table command: {}".format(command)) + raise SaltInvocationError(f"Unknown table command: {command}") cmd = ["pfctl", "-t", table, "-T", command] @@ -315,7 +315,7 @@ def table(command, table, **kwargs): ret = {"comment": result["stderr"], "matches": False} else: raise CommandExecutionError( - "Could not apply {} on table {}".format(command, table), + f"Could not apply {command} on table {table}", info={"errors": [result["stderr"]], "changes": False}, ) @@ -350,16 +350,16 @@ def show(modifier): modifier = modifier.title() if modifier not in all_modifiers: - raise SaltInvocationError("Unknown modifier: {}".format(modifier)) + raise SaltInvocationError(f"Unknown modifier: {modifier}") - cmd = "pfctl -s {}".format(modifier) + cmd = f"pfctl -s {modifier}" result = __salt__["cmd.run_all"](cmd, output_loglevel="trace", python_shell=False) if result["retcode"] == 0: ret["comment"] = result["stdout"].split("\n") else: raise CommandExecutionError( - "Could not show {}".format(modifier), + f"Could not show {modifier}", info={"errors": [result["stderr"]], "changes": False}, ) diff --git a/salt/modules/pillar.py b/salt/modules/pillar.py index ba195ab3e39..5c6ff18f2cf 100644 --- a/salt/modules/pillar.py +++ b/salt/modules/pillar.py @@ -184,7 +184,7 @@ def get( ret = salt.utils.data.traverse_dict_and_list(pillar_dict, key, default, delimiter) if ret is KeyError: - raise KeyError("Pillar key not found: {}".format(key)) + raise KeyError(f"Pillar key not found: {key}") return ret @@ -264,9 +264,7 @@ def items(*args, **kwargs): valid_rend=__opts__["decrypt_pillar_renderers"], ) except Exception as exc: # pylint: disable=broad-except - raise CommandExecutionError( - "Failed to decrypt pillar override: {}".format(exc) - ) + raise CommandExecutionError(f"Failed to decrypt pillar override: {exc}") pillar = salt.pillar.get_pillar( __opts__, @@ -295,7 +293,7 @@ def _obfuscate_inner(var): elif isinstance(var, (list, set, tuple)): return type(var)(_obfuscate_inner(v) for v in var) else: - return "<{}>".format(var.__class__.__name__) + return f"<{var.__class__.__name__}>" def obfuscate(*args, **kwargs): @@ -538,10 +536,10 @@ def keys(key, delimiter=DEFAULT_TARGET_DELIM): ret = salt.utils.data.traverse_dict_and_list(__pillar__, key, KeyError, delimiter) if ret is KeyError: - raise KeyError("Pillar key not found: {}".format(key)) + raise KeyError(f"Pillar key not found: {key}") if not isinstance(ret, dict): - raise ValueError("Pillar value in key {} is not a dict".format(key)) + raise ValueError(f"Pillar value in key {key} is not a dict") return list(ret) diff --git a/salt/modules/pip.py b/salt/modules/pip.py index aa58d230bec..bd56fd7a638 100644 --- a/salt/modules/pip.py +++ b/salt/modules/pip.py @@ -136,7 +136,7 @@ def _clear_context(bin_env=None): """ contextkey = "pip.version" if bin_env is not None: - contextkey = "{}.{}".format(contextkey, bin_env) + contextkey = f"{contextkey}.{bin_env}" __context__.pop(contextkey, None) @@ -189,7 +189,7 @@ def _get_pip_bin(bin_env): bin_path, ) raise CommandNotFoundError( - "Could not find a pip binary in virtualenv {}".format(bin_env) + f"Could not find a pip binary in virtualenv {bin_env}" ) # bin_env is the python or pip binary @@ -201,12 +201,10 @@ def _get_pip_bin(bin_env): # We have been passed a pip binary, use the pip binary. return [os.path.normpath(bin_env)] - raise CommandExecutionError( - "Could not find a pip binary within {}".format(bin_env) - ) + raise CommandExecutionError(f"Could not find a pip binary within {bin_env}") else: raise CommandNotFoundError( - "Access denied to {}, could not find a pip binary".format(bin_env) + f"Access denied to {bin_env}, could not find a pip binary" ) @@ -412,9 +410,7 @@ def _format_env_vars(env_vars): val = str(val) ret[key] = val else: - raise CommandExecutionError( - "env_vars {} is not a dictionary".format(env_vars) - ) + raise CommandExecutionError(f"env_vars {env_vars} is not a dictionary") return ret @@ -759,7 +755,7 @@ def install( if log: if os.path.isdir(log): - raise OSError("'{}' is a directory. Use --log path_to_file".format(log)) + raise OSError(f"'{log}' is a directory. Use --log path_to_file") if not os.path.exists(log): parent = os.path.dirname(log) if not os.path.exists(parent): @@ -771,7 +767,7 @@ def install( f"Trying to create '{log}' but parent directory '{parent}' is not writeable." ) elif not os.access(log, os.W_OK): - raise OSError("'{}' is not writeable".format(log)) + raise OSError(f"'{log}' is not writeable") cmd.extend(["--log", log]) @@ -796,9 +792,7 @@ def install( raise ValueError("Timeout cannot be a float") int(timeout) except ValueError: - raise ValueError( - "'{}' is not a valid timeout, must be an integer".format(timeout) - ) + raise ValueError(f"'{timeout}' is not a valid timeout, must be an integer") cmd.extend(["--timeout", timeout]) if find_links: @@ -809,9 +803,7 @@ def install( if not ( salt.utils.url.validate(link, VALID_PROTOS) or os.path.exists(link) ): - raise CommandExecutionError( - "'{}' is not a valid URL or path".format(link) - ) + raise CommandExecutionError(f"'{link}' is not a valid URL or path") cmd.extend(["--find-links", link]) if no_index and (index_url or extra_index_url): @@ -821,14 +813,12 @@ def install( if index_url: if not salt.utils.url.validate(index_url, VALID_PROTOS): - raise CommandExecutionError("'{}' is not a valid URL".format(index_url)) + raise CommandExecutionError(f"'{index_url}' is not a valid URL") cmd.extend(["--index-url", index_url]) if extra_index_url: if not salt.utils.url.validate(extra_index_url, VALID_PROTOS): - raise CommandExecutionError( - "'{}' is not a valid URL".format(extra_index_url) - ) + raise CommandExecutionError(f"'{extra_index_url}' is not a valid URL") cmd.extend(["--extra-index-url", extra_index_url]) if no_index: @@ -848,7 +838,7 @@ def install( cmd.append("--use-mirrors") for mirror in mirrors: if not mirror.startswith("http://"): - raise CommandExecutionError("'{}' is not a valid URL".format(mirror)) + raise CommandExecutionError(f"'{mirror}' is not a valid URL") cmd.extend(["--mirrors", mirror]) if disable_version_check: @@ -1010,7 +1000,7 @@ def install( # Don't allow any recursion into keyword arg definitions # Don't allow multiple definitions of a keyword if isinstance(val, (dict, list)): - raise TypeError("Too many levels in: {}".format(key)) + raise TypeError(f"Too many levels in: {key}") # This is a a normal one-to-one keyword argument cmd.extend([key, val]) # It is a positional argument, append it to the list @@ -1123,7 +1113,7 @@ def uninstall( # TODO make this check if writeable os.path.exists(log) except OSError: - raise OSError("'{}' is not writeable".format(log)) + raise OSError(f"'{log}' is not writeable") cmd.extend(["--log", log]) @@ -1148,9 +1138,7 @@ def uninstall( raise ValueError("Timeout cannot be a float") int(timeout) except ValueError: - raise ValueError( - "'{}' is not a valid timeout, must be an integer".format(timeout) - ) + raise ValueError(f"'{timeout}' is not a valid timeout, must be an integer") cmd.extend(["--timeout", timeout]) if pkgs: @@ -1410,7 +1398,7 @@ def version(bin_env=None, cwd=None, user=None): cwd = _pip_bin_env(cwd, bin_env) contextkey = "pip.version" if bin_env is not None: - contextkey = "{}.{}".format(contextkey, bin_env) + contextkey = f"{contextkey}.{bin_env}" if contextkey in __context__: return __context__[contextkey] @@ -1673,18 +1661,16 @@ def list_all_versions( if salt.utils.versions.compare(ver1=pip_version, oper=">=", ver2="20.3"): cmd.append("--use-deprecated=legacy-resolver") regex = re.compile(r"\s*Could not find a version.* \(from versions: (.*)\)") - cmd.extend(["install", "{}==versions".format(pkg)]) + cmd.extend(["install", f"{pkg}==versions"]) if index_url: if not salt.utils.url.validate(index_url, VALID_PROTOS): - raise CommandExecutionError("'{}' is not a valid URL".format(index_url)) + raise CommandExecutionError(f"'{index_url}' is not a valid URL") cmd.extend(["--index-url", index_url]) if extra_index_url: if not salt.utils.url.validate(extra_index_url, VALID_PROTOS): - raise CommandExecutionError( - "'{}' is not a valid URL".format(extra_index_url) - ) + raise CommandExecutionError(f"'{extra_index_url}' is not a valid URL") cmd.extend(["--extra-index-url", extra_index_url]) cmd_kwargs = dict( cwd=cwd, runas=user, output_loglevel="quiet", redirect_stderr=True diff --git a/salt/modules/pkg_resource.py b/salt/modules/pkg_resource.py index 6308641a2f9..88e38b91a41 100644 --- a/salt/modules/pkg_resource.py +++ b/salt/modules/pkg_resource.py @@ -413,7 +413,7 @@ def format_version(epoch, version, release): """ Formats a version string for list_pkgs. """ - full_version = "{}:{}".format(epoch, version) if epoch else version + full_version = f"{epoch}:{version}" if epoch else version if release: - full_version += "-{}".format(release) + full_version += f"-{release}" return full_version diff --git a/salt/modules/pkgin.py b/salt/modules/pkgin.py index 8380360047c..3756f556198 100644 --- a/salt/modules/pkgin.py +++ b/salt/modules/pkgin.py @@ -40,7 +40,7 @@ def _check_pkgin(): "pkg_info -Q LOCALBASE pkgin", output_loglevel="trace" ) if localbase is not None: - ppath = "{}/bin/pkgin".format(localbase) + ppath = f"{localbase}/bin/pkgin" if not os.path.exists(ppath): return None except CommandExecutionError: @@ -124,7 +124,7 @@ def search(pkg_name, **kwargs): return pkglist if _supports_regex(): - pkg_name = "^{}$".format(pkg_name) + pkg_name = f"^{pkg_name}$" out = __salt__["cmd.run"]([pkgin, "se", pkg_name], output_loglevel="trace") for line in out.splitlines(): @@ -170,7 +170,7 @@ def latest_version(*names, **kwargs): cmd_prefix.insert(1, "-p") for name in names: cmd = copy.deepcopy(cmd_prefix) - cmd.append("^{}$".format(name) if _supports_regex() else name) + cmd.append(f"^{name}$" if _supports_regex() else name) out = __salt__["cmd.run"](cmd, output_loglevel="trace") for line in out.splitlines(): @@ -564,9 +564,9 @@ def remove(name=None, pkgs=None, **kwargs): if not ver: continue if isinstance(ver, list): - args.extend(["{}-{}".format(param, v) for v in ver]) + args.extend([f"{param}-{v}" for v in ver]) else: - args.append("{}-{}".format(param, ver)) + args.append(f"{param}-{ver}") if not args: return {} diff --git a/salt/modules/pkgng.py b/salt/modules/pkgng.py index e5f94b7c297..4aaa28eb5a7 100644 --- a/salt/modules/pkgng.py +++ b/salt/modules/pkgng.py @@ -132,11 +132,11 @@ def _contextkey(jail=None, chroot=None, root=None, prefix="pkg.list_pkgs"): unique to that jail/chroot is used. """ if jail: - return str(prefix) + ".jail_{}".format(jail) + return str(prefix) + f".jail_{jail}" elif chroot: - return str(prefix) + ".chroot_{}".format(chroot) + return str(prefix) + f".chroot_{chroot}" elif root: - return str(prefix) + ".root_{}".format(root) + return str(prefix) + f".root_{root}" return prefix @@ -154,7 +154,7 @@ def parse_config(file_name="/usr/local/etc/pkg.conf"): """ ret = {} if not os.path.isfile(file_name): - return "Unable to find {} on file system".format(file_name) + return f"Unable to find {file_name} on file system" with salt.utils.files.fopen(file_name) as ifile: for line in ifile: @@ -356,7 +356,7 @@ def list_pkgs( chroot=None, root=None, with_origin=False, - **kwargs + **kwargs, ): """ List the packages currently installed as a dict:: @@ -444,9 +444,7 @@ def update_package_site(new_url): salt '*' pkg.update_package_site http://127.0.0.1/ """ config_file = parse_config()["config_file"] - __salt__["file.sed"]( - config_file, "PACKAGESITE.*", "PACKAGESITE\t : {}".format(new_url) - ) + __salt__["file.sed"](config_file, "PACKAGESITE.*", f"PACKAGESITE\t : {new_url}") # add change return later return True @@ -684,7 +682,7 @@ def install( regex=False, pcre=False, batch=False, - **kwargs + **kwargs, ): """ Install package(s) from a repository @@ -870,7 +868,7 @@ def install( if version_num is None: targets.append(param) else: - targets.append("{}-{}".format(param, version_num)) + targets.append(f"{param}-{version_num}") else: raise CommandExecutionError("Problem encountered installing package(s)") @@ -922,7 +920,7 @@ def remove( recurse=False, regex=False, pcre=False, - **kwargs + **kwargs, ): """ Remove a package from the database and system @@ -1887,9 +1885,9 @@ def updating(name, jail=None, chroot=None, root=None, filedate=None, filename=No opts = "" if filedate: - opts += "d {}".format(filedate) + opts += f"d {filedate}" if filename: - opts += "f {}".format(filename) + opts += f"f {filename}" cmd = _pkg(jail, chroot, root) cmd.append("updating") @@ -1942,7 +1940,7 @@ def hold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613 if not locked(target, **kwargs): if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) - ret[target]["comment"] = "Package {} is set to be held.".format(target) + ret[target]["comment"] = f"Package {target} is set to be held." else: if lock(target, **kwargs): ret[target].update(result=True) @@ -2018,12 +2016,12 @@ def unhold(name=None, pkgs=None, **kwargs): # pylint: disable=W0613 ret[target]["changes"]["new"] = "" ret[target]["changes"]["old"] = "hold" else: - ret[target]["comment"] = ( - "Package {} was unable to be unheld.".format(target) - ) + ret[target][ + "comment" + ] = f"Package {target} was unable to be unheld." else: ret[target].update(result=True) - ret[target]["comment"] = "Package {} is not being held.".format(target) + ret[target]["comment"] = f"Package {target} is not being held." return ret @@ -2071,7 +2069,7 @@ def list_locked(**kwargs): """ return [ - "{}-{}".format(pkgname, version(pkgname, **kwargs)) + f"{pkgname}-{version(pkgname, **kwargs)}" for pkgname in _lockcmd("lock", name=None, **kwargs) ] @@ -2247,7 +2245,7 @@ def _lockcmd(subcmd, pkgname=None, **kwargs): if out["retcode"] != 0: raise CommandExecutionError( - "Problem encountered {}ing packages".format(subcmd), info={"result": out} + f"Problem encountered {subcmd}ing packages", info={"result": out} ) for line in salt.utils.itertools.split(out["stdout"], "\n"): diff --git a/salt/modules/pkgutil.py b/salt/modules/pkgutil.py index d81f44f9437..67995471f3d 100644 --- a/salt/modules/pkgutil.py +++ b/salt/modules/pkgutil.py @@ -59,7 +59,7 @@ def upgrade_available(name): salt '*' pkgutil.upgrade_available CSWpython """ version_num = None - cmd = "/opt/csw/bin/pkgutil -c --parse --single {}".format(name) + cmd = f"/opt/csw/bin/pkgutil -c --parse --single {name}" out = __salt__["cmd.run_stdout"](cmd) if out: version_num = out.split()[2].strip() @@ -298,7 +298,7 @@ def install(name=None, refresh=False, version=None, pkgs=None, **kwargs): if pkgver is None: targets.append(param) else: - targets.append("{}-{}".format(param, pkgver)) + targets.append(f"{param}-{pkgver}") cmd = "/opt/csw/bin/pkgutil -yu {}".format(" ".join(targets)) old = list_pkgs() diff --git a/salt/modules/portage_config.py b/salt/modules/portage_config.py index 15c0ad983da..bd2f18b5c42 100644 --- a/salt/modules/portage_config.py +++ b/salt/modules/portage_config.py @@ -192,7 +192,7 @@ def _unify_keywords(): if os.path.isdir(old_path): for triplet in salt.utils.path.os_walk(old_path): for file_name in triplet[2]: - file_path = "{}/{}".format(triplet[0], file_name) + file_path = f"{triplet[0]}/{file_name}" with salt.utils.files.fopen(file_path) as fh_: for line in fh_: line = salt.utils.stringutils.to_unicode(line).strip() @@ -239,7 +239,7 @@ def _package_conf_ordering(conf, clean=True, keep_backup=False): for triplet in salt.utils.path.os_walk(path): for file_name in triplet[2]: - file_path = "{}/{}".format(triplet[0], file_name) + file_path = f"{triplet[0]}/{file_name}" cp = triplet[0][len(path) + 1 :] + "/" + file_name shutil.copy(file_path, file_path + ".bak") @@ -426,7 +426,7 @@ def append_to_package_conf(conf, atom="", flags=None, string="", overwrite=False atom, " ".join(merged_flags) ) else: - new_contents += "{}\n".format(atom) + new_contents += f"{atom}\n" added = True else: new_contents += l diff --git a/salt/modules/postfix.py b/salt/modules/postfix.py index 64059bfe44b..a3971309d3c 100644 --- a/salt/modules/postfix.py +++ b/salt/modules/postfix.py @@ -70,7 +70,7 @@ def _parse_master(path=MASTER_CF): "maxproc": comps[6], "command": " ".join(comps[7:]), } - dict_key = "{} {}".format(comps[0], comps[1]) + dict_key = f"{comps[0]} {comps[1]}" conf_list.append(conf_line) conf_dict[dict_key] = conf_line @@ -135,7 +135,7 @@ def set_master( conf_dict, conf_list = _parse_master(path) new_conf = [] - dict_key = "{} {}".format(service, conn_type) + dict_key = f"{service} {conn_type}" new_line = _format_master( service, conn_type, @@ -291,15 +291,15 @@ def set_main(key, value, path=MAIN_CF): pairs, conf_list = _parse_main(path) new_conf = [] - key_line_match = re.compile("^{}([\\s=]|$)".format(re.escape(key))) + key_line_match = re.compile(f"^{re.escape(key)}([\\s=]|$)") if key in pairs: for line in conf_list: if re.match(key_line_match, line): - new_conf.append("{} = {}".format(key, value)) + new_conf.append(f"{key} = {value}") else: new_conf.append(line) else: - conf_list.append("{} = {}".format(key, value)) + conf_list.append(f"{key} = {value}") new_conf = conf_list _write_conf(new_conf, path) @@ -394,11 +394,11 @@ def delete(queue_id): _message = item if not _message: - ret["message"] = "No message in queue with ID {}".format(queue_id) + ret["message"] = f"No message in queue with ID {queue_id}" ret["result"] = False return ret - cmd = "postsuper -d {}".format(queue_id) + cmd = f"postsuper -d {queue_id}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] == 0: @@ -445,11 +445,11 @@ def hold(queue_id): _message = item if not _message: - ret["message"] = "No message in queue with ID {}".format(queue_id) + ret["message"] = f"No message in queue with ID {queue_id}" ret["result"] = False return ret - cmd = "postsuper -h {}".format(queue_id) + cmd = f"postsuper -h {queue_id}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] == 0: @@ -457,7 +457,7 @@ def hold(queue_id): ret["message"] = "Successfully placed all messages on hold" else: ret["message"] = ( - "Successfully placed message on hold with queue id {}".format(queue_id) + f"Successfully placed message on hold with queue id {queue_id}" ) else: if queue_id == "ALL": @@ -498,11 +498,11 @@ def unhold(queue_id): _message = item if not _message: - ret["message"] = "No message in queue with ID {}".format(queue_id) + ret["message"] = f"No message in queue with ID {queue_id}" ret["result"] = False return ret - cmd = "postsuper -H {}".format(queue_id) + cmd = f"postsuper -H {queue_id}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] == 0: @@ -510,7 +510,7 @@ def unhold(queue_id): ret["message"] = "Successfully set all message as unheld" else: ret["message"] = ( - "Successfully set message as unheld with queue id {}".format(queue_id) + f"Successfully set message as unheld with queue id {queue_id}" ) else: if queue_id == "ALL": @@ -551,11 +551,11 @@ def requeue(queue_id): _message = item if not _message: - ret["message"] = "No message in queue with ID {}".format(queue_id) + ret["message"] = f"No message in queue with ID {queue_id}" ret["result"] = False return ret - cmd = "postsuper -r {}".format(queue_id) + cmd = f"postsuper -r {queue_id}" result = __salt__["cmd.run_all"](cmd) if result["retcode"] == 0: diff --git a/salt/modules/poudriere.py b/salt/modules/poudriere.py index 5805145d2a1..5b7e88ecab2 100644 --- a/salt/modules/poudriere.py +++ b/salt/modules/poudriere.py @@ -84,19 +84,15 @@ def make_pkgng_aware(jname): if not os.path.isdir(cdir): os.makedirs(cdir) if os.path.isdir(cdir): - ret["changes"] = "Created poudriere make file dir {}".format(cdir) + ret["changes"] = f"Created poudriere make file dir {cdir}" else: - return "Could not create or find required directory {}".format(cdir) + return f"Could not create or find required directory {cdir}" # Added args to file - __salt__["file.write"]( - "{}-make.conf".format(os.path.join(cdir, jname)), "WITH_PKGNG=yes" - ) + __salt__["file.write"](f"{os.path.join(cdir, jname)}-make.conf", "WITH_PKGNG=yes") if os.path.isfile(os.path.join(cdir, jname) + "-make.conf"): - ret["changes"] = "Created {}".format( - os.path.join(cdir, "{}-make.conf".format(jname)) - ) + ret["changes"] = "Created {}".format(os.path.join(cdir, f"{jname}-make.conf")) return ret else: return "Looks like file {} could not be created".format( @@ -124,7 +120,7 @@ def parse_config(config_file=None): ret[key] = val return ret - return "Could not find {} on file system".format(config_file) + return f"Could not find {config_file} on file system" def version(): @@ -190,9 +186,9 @@ def create_jail(name, arch, version="9.0-RELEASE"): # Check if the jail is there if is_jail(name): - return "{} already exists".format(name) + return f"{name} already exists" - cmd = "poudriere jails -c -j {} -v {} -a {}".format(name, version, arch) + cmd = f"poudriere jails -c -j {name} -v {version} -a {arch}" __salt__["cmd.run"](cmd) # Make jail pkgng aware @@ -200,9 +196,9 @@ def create_jail(name, arch, version="9.0-RELEASE"): # Make sure the jail was created if is_jail(name): - return "Created jail {}".format(name) + return f"Created jail {name}" - return "Issue creating jail {}".format(name) + return f"Issue creating jail {name}" def update_jail(name): @@ -216,11 +212,11 @@ def update_jail(name): salt '*' poudriere.update_jail freebsd:10:x86:64 """ if is_jail(name): - cmd = "poudriere jail -u -j {}".format(name) + cmd = f"poudriere jail -u -j {name}" ret = __salt__["cmd.run"](cmd) return ret else: - return "Could not find jail {}".format(name) + return f"Could not find jail {name}" def delete_jail(name): @@ -234,18 +230,18 @@ def delete_jail(name): salt '*' poudriere.delete_jail 90amd64 """ if is_jail(name): - cmd = "poudriere jail -d -j {}".format(name) + cmd = f"poudriere jail -d -j {name}" __salt__["cmd.run"](cmd) # Make sure jail is gone if is_jail(name): - return "Looks like there was an issue deleting jail {}".format(name) + return f"Looks like there was an issue deleting jail {name}" else: # Could not find jail. - return "Looks like jail {} has not been created".format(name) + return f"Looks like jail {name} has not been created" # clean up pkgng make info in config dir - make_file = os.path.join(_config_dir(), "{}-make.conf".format(name)) + make_file = os.path.join(_config_dir(), f"{name}-make.conf") if os.path.isfile(make_file): try: os.remove(make_file) @@ -255,7 +251,7 @@ def delete_jail(name): ) __salt__["file.remove"](make_file) - return "Deleted jail {}".format(name) + return f"Deleted jail {name}" def info_jail(name): @@ -269,11 +265,11 @@ def info_jail(name): salt '*' poudriere.info_jail head-amd64 """ if is_jail(name): - cmd = "poudriere jail -i -j {}".format(name) + cmd = f"poudriere jail -i -j {name}" ret = __salt__["cmd.run"](cmd).splitlines() return ret else: - return "Could not find jail {}".format(name) + return f"Could not find jail {name}" def create_ports_tree(): @@ -298,7 +294,7 @@ def update_ports_tree(ports_tree): """ _check_config_exists() if ports_tree: - cmd = "poudriere ports -u -p {}".format(ports_tree) + cmd = f"poudriere ports -u -p {ports_tree}" else: cmd = "poudriere ports -u" ret = __salt__["cmd.run"](cmd) @@ -320,15 +316,15 @@ def bulk_build(jail, pkg_file, keep=False): """ # make sure `pkg file` and jail is on file system if not os.path.isfile(pkg_file): - return "Could not find file {} on filesystem".format(pkg_file) + return f"Could not find file {pkg_file} on filesystem" if not is_jail(jail): - return "Could not find jail {}".format(jail) + return f"Could not find jail {jail}" # Generate command if keep: - cmd = "poudriere bulk -k -f {} -j {}".format(pkg_file, jail) + cmd = f"poudriere bulk -k -f {pkg_file} -j {jail}" else: - cmd = "poudriere bulk -f {} -j {}".format(pkg_file, jail) + cmd = f"poudriere bulk -f {pkg_file} -j {jail}" # Bulk build this can take some time, depending on pkg_file ... hours res = __salt__["cmd.run"](cmd) diff --git a/salt/modules/powerpath.py b/salt/modules/powerpath.py index 4477d89651e..b03840d760e 100644 --- a/salt/modules/powerpath.py +++ b/salt/modules/powerpath.py @@ -88,7 +88,7 @@ def add_license(key): result["output"] = "PowerPath is not installed" return result - cmd = "/sbin/emcpreg -add {}".format(key) + cmd = f"/sbin/emcpreg -add {key}" ret = __salt__["cmd.run_all"](cmd, python_shell=True) result["retcode"] = ret["retcode"] @@ -112,7 +112,7 @@ def remove_license(key): result["output"] = "PowerPath is not installed" return result - cmd = "/sbin/emcpreg -remove {}".format(key) + cmd = f"/sbin/emcpreg -remove {key}" ret = __salt__["cmd.run_all"](cmd, python_shell=True) result["retcode"] = ret["retcode"] diff --git a/salt/modules/proxy.py b/salt/modules/proxy.py index 1aa5dc9f2c6..6a7478b0b8c 100644 --- a/salt/modules/proxy.py +++ b/salt/modules/proxy.py @@ -27,9 +27,7 @@ def __virtual__(): def _get_proxy_osx(cmd_function, network_service): ret = {} - out = __salt__["cmd.run"]( - "networksetup -{} {}".format(cmd_function, network_service) - ) + out = __salt__["cmd.run"](f"networksetup -{cmd_function} {network_service}") match = re.match("Enabled: (.*)\nServer: (.*)\nPort: (.*)\n", out) if match is not None: g = match.groups() @@ -45,7 +43,7 @@ def _set_proxy_osx(cmd_function, server, port, user, password, network_service): ) if user is not None and password is not None: - cmd = cmd + " On {} {}".format(user, password) + cmd = cmd + f" On {user} {password}" out = __salt__["cmd.run"](cmd) @@ -110,7 +108,7 @@ def _set_proxy_windows( server_str = "" for t in types: - server_str += "{}={}:{};".format(t, server, port) + server_str += f"{t}={server}:{port};" __utils__["reg.set_value"]( hive="HKEY_CURRENT_USER", @@ -394,9 +392,7 @@ def get_proxy_bypass(network_service="Ethernet"): return reg_val.replace("", "").split(";") - out = __salt__["cmd.run"]( - "networksetup -getproxybypassdomains {}".format(network_service) - ) + out = __salt__["cmd.run"](f"networksetup -getproxybypassdomains {network_service}") return out.split("\n") diff --git a/salt/modules/ps.py b/salt/modules/ps.py index a6b23c500d0..e659a702b18 100644 --- a/salt/modules/ps.py +++ b/salt/modules/ps.py @@ -560,7 +560,7 @@ def boot_time(time_format=None): try: return b_time.strftime(time_format) except TypeError as exc: - raise SaltInvocationError("Invalid format string: {}".format(exc)) + raise SaltInvocationError(f"Invalid format string: {exc}") return b_time diff --git a/salt/modules/publish.py b/salt/modules/publish.py index cc424cc3835..c3aa8757b2f 100644 --- a/salt/modules/publish.py +++ b/salt/modules/publish.py @@ -94,7 +94,7 @@ def _publish( matching_master_uris = [ master for master in __opts__["master_uri_list"] - if "//{}:".format(via_master) in master + if f"//{via_master}:" in master ] if not matching_master_uris: @@ -144,7 +144,7 @@ def _publish( try: peer_data = channel.send(load) except SaltReqTimeoutError: - return "'{}' publish timed out".format(fun) + return f"'{fun}' publish timed out" if not peer_data: return {} # CLI args are passed as strings, re-cast to keep time.sleep happy @@ -348,4 +348,4 @@ def runner(fun, arg=None, timeout=5): try: return channel.send(load) except SaltReqTimeoutError: - return "'{}' runner publish timed out".format(fun) + return f"'{fun}' runner publish timed out" diff --git a/salt/modules/puppet.py b/salt/modules/puppet.py index 8fd1e994c7e..82df2986f2c 100644 --- a/salt/modules/puppet.py +++ b/salt/modules/puppet.py @@ -84,15 +84,15 @@ class _Puppet: ) args = " ".join(self.subcmd_args) - args += "".join([" --{}".format(k) for k in self.args]) # single spaces - args += "".join([" --{} {}".format(k, v) for k, v in self.kwargs.items()]) + args += "".join([f" --{k}" for k in self.args]) # single spaces + args += "".join([f" --{k} {v}" for k, v in self.kwargs.items()]) # Ensure that the puppet call will return 0 in case of exit code 2 if salt.utils.platform.is_windows(): return "cmd /V:ON /c {} {} ^& if !ERRORLEVEL! EQU 2 (EXIT 0) ELSE (EXIT /B)".format( cmd, args ) - return "({} {}) || test $? -eq 2".format(cmd, args) + return f"({cmd} {args}) || test $? -eq 2" def arguments(self, args=None): """ @@ -193,7 +193,7 @@ def enable(): try: os.remove(puppet.disabled_lockfile) except OSError as exc: - msg = "Failed to enable: {}".format(exc) + msg = f"Failed to enable: {exc}" log.error(msg) raise CommandExecutionError(msg) else: @@ -229,7 +229,7 @@ def disable(message=None): try: # Puppet chokes when no valid json is found msg = ( - '{{"disabled_message":"{0}"}}'.format(message) + f'{{"disabled_message":"{message}"}}' if message is not None else "{}" ) @@ -237,7 +237,7 @@ def disable(message=None): lockfile.close() return True except OSError as exc: - msg = "Failed to disable: {}".format(exc) + msg = f"Failed to disable: {exc}" log.error(msg) raise CommandExecutionError(msg) @@ -319,11 +319,9 @@ def summary(): result["resources"] = report["resources"] except salt.utils.yaml.YAMLError as exc: - raise CommandExecutionError( - "YAML error parsing puppet run summary: {}".format(exc) - ) + raise CommandExecutionError(f"YAML error parsing puppet run summary: {exc}") except OSError as exc: - raise CommandExecutionError("Unable to read puppet run summary: {}".format(exc)) + raise CommandExecutionError(f"Unable to read puppet run summary: {exc}") return result @@ -357,7 +355,7 @@ def facts(puppet=False): """ ret = {} opt_puppet = "--puppet" if puppet else "" - cmd_ret = __salt__["cmd.run_all"]("facter {}".format(opt_puppet)) + cmd_ret = __salt__["cmd.run_all"](f"facter {opt_puppet}") if cmd_ret["retcode"] != 0: raise CommandExecutionError(cmd_ret["stderr"]) @@ -388,9 +386,7 @@ def fact(name, puppet=False): salt '*' puppet.fact kernel """ opt_puppet = "--puppet" if puppet else "" - ret = __salt__["cmd.run_all"]( - "facter {} {}".format(opt_puppet, name), python_shell=False - ) + ret = __salt__["cmd.run_all"](f"facter {opt_puppet} {name}", python_shell=False) if ret["retcode"] != 0: raise CommandExecutionError(ret["stderr"]) diff --git a/salt/modules/purefb.py b/salt/modules/purefb.py index 787c77446b8..cf9cdb4e2e0 100644 --- a/salt/modules/purefb.py +++ b/salt/modules/purefb.py @@ -150,7 +150,7 @@ def _get_snapshot(name, suffix, blade): or None """ try: - filt = "source='{}' and suffix='{}'".format(name, suffix) + filt = f"source='{name}' and suffix='{suffix}'" res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt) return res.items[0] except rest.ApiException: diff --git a/salt/modules/pw_group.py b/salt/modules/pw_group.py index 99128d196bd..7c6d1fd5292 100644 --- a/salt/modules/pw_group.py +++ b/salt/modules/pw_group.py @@ -64,8 +64,8 @@ def add(name, gid=None, **kwargs): cmd = "pw groupadd " if gid: - cmd += "-g {} ".format(gid) - cmd = "{} -n {}".format(cmd, name) + cmd += f"-g {gid} " + cmd = f"{cmd} -n {name}" ret = __salt__["cmd.run_all"](cmd, python_shell=False) return not ret["retcode"] @@ -81,7 +81,7 @@ def delete(name): salt '*' group.delete foo """ - ret = __salt__["cmd.run_all"]("pw groupdel {}".format(name), python_shell=False) + ret = __salt__["cmd.run_all"](f"pw groupdel {name}", python_shell=False) return not ret["retcode"] @@ -142,7 +142,7 @@ def chgid(name, gid): pre_gid = __salt__["file.group_to_gid"](name) if gid == pre_gid: return True - cmd = "pw groupmod {} -g {}".format(name, gid) + cmd = f"pw groupmod {name} -g {gid}" __salt__["cmd.run"](cmd, python_shell=False) post_gid = __salt__["file.group_to_gid"](name) if post_gid != pre_gid: @@ -165,7 +165,7 @@ def adduser(name, username): """ # Note: pw exits with code 65 if group is unknown retcode = __salt__["cmd.retcode"]( - "pw groupmod {} -m {}".format(name, username), python_shell=False + f"pw groupmod {name} -m {username}", python_shell=False ) return not retcode @@ -191,7 +191,7 @@ def deluser(name, username): # Note: pw exits with code 65 if group is unknown retcode = __salt__["cmd.retcode"]( - "pw groupmod {} -d {}".format(name, username), python_shell=False + f"pw groupmod {name} -d {username}", python_shell=False ) return not retcode @@ -214,7 +214,7 @@ def members(name, members_list): """ retcode = __salt__["cmd.retcode"]( - "pw groupmod {} -M {}".format(name, members_list), python_shell=False + f"pw groupmod {name} -M {members_list}", python_shell=False ) return not retcode diff --git a/salt/modules/pw_user.py b/salt/modules/pw_user.py index 6506452db56..cebb46c993b 100644 --- a/salt/modules/pw_user.py +++ b/salt/modules/pw_user.py @@ -75,7 +75,7 @@ def _get_gecos(name): try: gecos_field = pwd.getpwnam(name).pw_gecos.split(",", 3) except KeyError: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if not gecos_field: return {} else: @@ -136,7 +136,7 @@ def add( homephone="", createhome=True, loginclass=None, - **kwargs + **kwargs, ): """ Add a user to the minion @@ -238,7 +238,7 @@ def chuid(name, uid): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if uid == pre_info["uid"]: return True cmd = ["pw", "usermod", "-u", uid, "-n", name] @@ -258,7 +258,7 @@ def chgid(name, gid): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if gid == pre_info["gid"]: return True cmd = ["pw", "usermod", "-g", gid, "-n", name] @@ -278,7 +278,7 @@ def chshell(name, shell): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if shell == pre_info["shell"]: return True cmd = ["pw", "usermod", "-s", shell, "-n", name] @@ -309,7 +309,7 @@ def chhome(name, home, persist=False): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if home == pre_info["home"]: return True cmd = ["pw", "usermod", name, "-d", home] @@ -419,7 +419,7 @@ def chloginclass(name, loginclass, root=None): if loginclass == get_loginclass(name): return True - cmd = ["pw", "usermod", "-L", "{}".format(loginclass), "-n", "{}".format(name)] + cmd = ["pw", "usermod", "-L", f"{loginclass}", "-n", f"{name}"] __salt__["cmd.run"](cmd, python_shell=False) @@ -518,10 +518,10 @@ def rename(name, new_name): """ current_info = info(name) if not current_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") new_info = info(new_name) if new_info: - raise CommandExecutionError("User '{}' already exists".format(new_name)) + raise CommandExecutionError(f"User '{new_name}' already exists") cmd = ["pw", "usermod", "-l", new_name, "-n", name] __salt__["cmd.run"](cmd) post_info = info(new_name) diff --git a/salt/modules/pyenv.py b/salt/modules/pyenv.py index df39db80333..30d569b5700 100644 --- a/salt/modules/pyenv.py +++ b/salt/modules/pyenv.py @@ -32,14 +32,12 @@ def _pyenv_exec(command, args="", env=None, runas=None, ret=None): path = _pyenv_path(runas) if env: - env = " {}".format(env) + env = f" {env}" env = env or "" - binary = "env PYENV_ROOT={}{} {}".format(path, env, binary) + binary = f"env PYENV_ROOT={path}{env} {binary}" - result = __salt__["cmd.run_all"]( - "{} {} {}".format(binary, command, args), runas=runas - ) + result = __salt__["cmd.run_all"](f"{binary} {command} {args}", runas=runas) if isinstance(ret, dict): ret.update(result) @@ -53,7 +51,7 @@ def _pyenv_exec(command, args="", env=None, runas=None, ret=None): def _pyenv_bin(runas=None): path = _pyenv_path(runas) - return "{}/bin/pyenv".format(path) + return f"{path}/bin/pyenv" def _pyenv_path(runas=None): @@ -61,7 +59,7 @@ def _pyenv_path(runas=None): if runas in (None, "root"): path = __salt__["config.option"]("pyenv.root") or "/usr/local/pyenv" else: - path = __salt__["config.option"]("pyenv.root") or "~{}/.pyenv".format(runas) + path = __salt__["config.option"]("pyenv.root") or f"~{runas}/.pyenv" return os.path.expanduser(path) @@ -71,7 +69,7 @@ def _install_pyenv(path, runas=None): return True return 0 == __salt__["cmd.retcode"]( - "git clone https://github.com/yyuu/pyenv.git {}".format(path), runas=runas + f"git clone https://github.com/yyuu/pyenv.git {path}", runas=runas ) @@ -80,17 +78,17 @@ def _update_pyenv(path, runas=None): return False return 0 == __salt__["cmd.retcode"]( - "cd {} && git pull".format(shlex.quote(path)), runas=runas + f"cd {shlex.quote(path)} && git pull", runas=runas ) def _update_python_build(path, runas=None): - path = "{}/plugins/python-build".format(path) + path = f"{path}/plugins/python-build" if not os.path.isdir(path): return False return 0 == __salt__["cmd.retcode"]( - "cd {} && git pull".format(shlex.quote(path)), runas=runas + f"cd {shlex.quote(path)} && git pull", runas=runas ) @@ -193,7 +191,7 @@ def uninstall_python(python, runas=None): """ python = re.sub(r"^python-", "", python) - args = "--force {}".format(python) + args = f"--force {python}" _pyenv_exec("uninstall", args, runas=runas) return True @@ -287,7 +285,7 @@ def do(cmdline=None, runas=None): for cmd in cmd_split: quoted_line = quoted_line + " " + shlex.quote(cmd) result = __salt__["cmd.run_all"]( - "env PATH={}/shims:$PATH {}".format(shlex.quote(path), quoted_line), + f"env PATH={shlex.quote(path)}/shims:$PATH {quoted_line}", runas=runas, python_shell=True, ) @@ -311,7 +309,7 @@ def do_with_python(python, cmdline, runas=None): salt '*' pyenv.do_with_python 2.0.0-p0 'gem list bundler' deploy """ if python: - cmd = "PYENV_VERSION={} {}".format(python, cmdline) + cmd = f"PYENV_VERSION={python} {cmdline}" else: cmd = cmdline diff --git a/salt/modules/qemu_img.py b/salt/modules/qemu_img.py index 1424929e45a..4f4b0dde628 100644 --- a/salt/modules/qemu_img.py +++ b/salt/modules/qemu_img.py @@ -42,7 +42,7 @@ def make_image(location, size, fmt): if not os.path.isdir(os.path.dirname(location)): return "" if not __salt__["cmd.retcode"]( - "qemu-img create -f {} {} {}M".format(fmt, location, size), + f"qemu-img create -f {fmt} {location} {size}M", python_shell=False, ): return location diff --git a/salt/modules/qemu_nbd.py b/salt/modules/qemu_nbd.py index c27bde15a78..375cbdeb3ab 100644 --- a/salt/modules/qemu_nbd.py +++ b/salt/modules/qemu_nbd.py @@ -51,14 +51,14 @@ def connect(image): fdisk = "fdisk -l" __salt__["cmd.run"]("modprobe nbd max_part=63") for nbd in glob.glob("/dev/nbd?"): - if __salt__["cmd.retcode"]("{} {}".format(fdisk, nbd)): + if __salt__["cmd.retcode"](f"{fdisk} {nbd}"): while True: # Sometimes nbd does not "take hold", loop until we can verify __salt__["cmd.run"]( - "qemu-nbd -c {} {}".format(nbd, image), + f"qemu-nbd -c {nbd} {image}", python_shell=False, ) - if not __salt__["cmd.retcode"]("{} {}".format(fdisk, nbd)): + if not __salt__["cmd.retcode"](f"{fdisk} {nbd}"): break return nbd log.warning("Could not connect image: %s", image) @@ -77,13 +77,13 @@ def mount(nbd, root=None): salt '*' qemu_nbd.mount /dev/nbd0 """ __salt__["cmd.run"]( - "partprobe {}".format(nbd), + f"partprobe {nbd}", python_shell=False, ) ret = {} if root is None: root = os.path.join(tempfile.gettempdir(), "nbd", os.path.basename(nbd)) - for part in glob.glob("{}p*".format(nbd)): + for part in glob.glob(f"{nbd}p*"): m_pt = os.path.join(root, os.path.basename(part)) time.sleep(1) mnt = __salt__["mount.mount"](m_pt, part, True) @@ -132,5 +132,5 @@ def clear(mnt): if ret: return ret for nbd in nbds: - __salt__["cmd.run"]("qemu-nbd -d {}".format(nbd), python_shell=False) + __salt__["cmd.run"](f"qemu-nbd -d {nbd}", python_shell=False) return ret diff --git a/salt/modules/quota.py b/salt/modules/quota.py index eb99d67a4f6..39bd3c5b1ce 100644 --- a/salt/modules/quota.py +++ b/salt/modules/quota.py @@ -48,7 +48,7 @@ def _parse_quota(mount, opts): """ Parse the output from repquota. Requires that -u -g are passed in """ - cmd = "repquota -vp {} {}".format(opts, mount) + cmd = f"repquota -vp {opts} {mount}" out = __salt__["cmd.run"](cmd, python_shell=False).splitlines() mode = "header" @@ -200,7 +200,7 @@ def on(device): salt '*' quota.on """ - cmd = "quotaon {}".format(device) + cmd = f"quotaon {device}" __salt__["cmd.run"](cmd, python_shell=False) return True @@ -215,7 +215,7 @@ def off(device): salt '*' quota.off """ - cmd = "quotaoff {}".format(device) + cmd = f"quotaoff {device}" __salt__["cmd.run"](cmd, python_shell=False) return True @@ -231,7 +231,7 @@ def get_mode(device): salt '*' quota.get_mode """ ret = {} - cmd = "quotaon -p {}".format(device) + cmd = f"quotaon -p {device}" out = __salt__["cmd.run"](cmd, python_shell=False) for line in out.splitlines(): comps = line.strip().split() diff --git a/salt/modules/rabbitmq.py b/salt/modules/rabbitmq.py index a11fc4a3ede..42f148ed476 100644 --- a/salt/modules/rabbitmq.py +++ b/salt/modules/rabbitmq.py @@ -44,11 +44,9 @@ def __virtual__(): ) (dir_path, value_type) = winreg.QueryValueEx(key, "Install_Dir") if value_type != winreg.REG_SZ: - raise TypeError( - "Invalid RabbitMQ Server directory type: {}".format(value_type) - ) + raise TypeError(f"Invalid RabbitMQ Server directory type: {value_type}") if not os.path.isdir(dir_path): - raise OSError("RabbitMQ directory not found: {}".format(dir_path)) + raise OSError(f"RabbitMQ directory not found: {dir_path}") subdir_match = "" for name in os.listdir(dir_path): if name.startswith("rabbitmq_server-"): @@ -58,7 +56,7 @@ def __virtual__(): subdir_match = subdir_path if not subdir_match: raise OSError( - '"rabbitmq_server-*" subdirectory not found in: {}'.format(dir_path) + f'"rabbitmq_server-*" subdirectory not found in: {dir_path}' ) RABBITMQCTL = os.path.join(subdir_match, "sbin", "rabbitmqctl.bat") RABBITMQ_PLUGINS = os.path.join( @@ -86,7 +84,7 @@ def _check_response(response): ) else: if "Error" in response: - raise CommandExecutionError("RabbitMQ command failed: {}".format(response)) + raise CommandExecutionError(f"RabbitMQ command failed: {response}") def _format_response(response, msg): @@ -99,7 +97,7 @@ def _format_response(response, msg): response = response["stdout"] else: if "Error" in response: - raise CommandExecutionError("RabbitMQ command failed: {}".format(response)) + raise CommandExecutionError(f"RabbitMQ command failed: {response}") return {msg: response} @@ -380,7 +378,7 @@ def add_user(name, password=None, runas=None): # command,\r\noperable program or batch file. # Work around this by using a shell and a quoted command. python_shell = True - cmd = '"{}" add_user "{}" "{}"'.format(RABBITMQCTL, name, password) + cmd = f'"{RABBITMQCTL}" add_user "{name}" "{password}"' else: python_shell = False cmd = [RABBITMQCTL, "add_user", name, password] @@ -450,7 +448,7 @@ def change_password(name, password, runas=None): # command,\r\noperable program or batch file. # Work around this by using a shell and a quoted command. python_shell = True - cmd = '"{}" change_password "{}" "{}"'.format(RABBITMQCTL, name, password) + cmd = f'"{RABBITMQCTL}" change_password "{name}" "{password}"' else: python_shell = False cmd = [RABBITMQCTL, "change_password", name, password] @@ -541,7 +539,7 @@ def check_password(name, password, runas=None): # command,\r\noperable program or batch file. # Work around this by using a shell and a quoted command. python_shell = True - cmd = '"{}" authenticate_user "{}" "{}"'.format(RABBITMQCTL, name, password) + cmd = f'"{RABBITMQCTL}" authenticate_user "{name}" "{password}"' else: python_shell = False cmd = [RABBITMQCTL, "authenticate_user", name, password] @@ -788,7 +786,7 @@ def join_cluster(host, user="rabbit", ram_node=None, runas=None): cmd = [RABBITMQCTL, "join_cluster"] if ram_node: cmd.append("--ram") - cmd.append("{}@{}".format(user, host)) + cmd.append(f"{user}@{host}") if runas is None and not salt.utils.platform.is_windows(): runas = salt.utils.user.get_user() diff --git a/salt/modules/rallydev.py b/salt/modules/rallydev.py index 219d0ab2baa..dc92ae93185 100644 --- a/salt/modules/rallydev.py +++ b/salt/modules/rallydev.py @@ -80,7 +80,7 @@ def _query( path += action if command: - path += "/{}".format(command) + path += f"/{command}" log.debug("RallyDev URL: %s", path) diff --git a/salt/modules/random_org.py b/salt/modules/random_org.py index f5d39cfbeaa..91db8756a41 100644 --- a/salt/modules/random_org.py +++ b/salt/modules/random_org.py @@ -206,7 +206,7 @@ def generateIntegers(api_key=None, api_version=None, **kwargs): for item in ["number", "minimum", "maximum"]: if item not in kwargs: ret["res"] = False - ret["message"] = "Rquired argument, {} is missing.".format(item) + ret["message"] = f"Rquired argument, {item} is missing." return ret if not _numeric(kwargs["number"]) or not 1 <= kwargs["number"] <= 10000: @@ -332,7 +332,7 @@ def generateStrings(api_key=None, api_version=None, **kwargs): for item in ["number", "length", "characters"]: if item not in kwargs: ret["res"] = False - ret["message"] = "Required argument, {} is missing.".format(item) + ret["message"] = f"Required argument, {item} is missing." return ret if not _numeric(kwargs["number"]) or not 1 <= kwargs["number"] <= 10000: @@ -422,7 +422,7 @@ def generateUUIDs(api_key=None, api_version=None, **kwargs): for item in ["number"]: if item not in kwargs: ret["res"] = False - ret["message"] = "Required argument, {} is missing.".format(item) + ret["message"] = f"Required argument, {item} is missing." return ret if isinstance(api_version, int): @@ -503,7 +503,7 @@ def generateDecimalFractions(api_key=None, api_version=None, **kwargs): for item in ["number", "decimalPlaces"]: if item not in kwargs: ret["res"] = False - ret["message"] = "Required argument, {} is missing.".format(item) + ret["message"] = f"Required argument, {item} is missing." return ret if not isinstance(kwargs["number"], int) or not 1 <= kwargs["number"] <= 10000: @@ -597,7 +597,7 @@ def generateGaussians(api_key=None, api_version=None, **kwargs): for item in ["number", "mean", "standardDeviation", "significantDigits"]: if item not in kwargs: ret["res"] = False - ret["message"] = "Required argument, {} is missing.".format(item) + ret["message"] = f"Required argument, {item} is missing." return ret if not _numeric(kwargs["number"]) or not 1 <= kwargs["number"] <= 10000: @@ -697,7 +697,7 @@ def generateBlobs(api_key=None, api_version=None, **kwargs): for item in ["number", "size"]: if item not in kwargs: ret["res"] = False - ret["message"] = "Required argument, {} is missing.".format(item) + ret["message"] = f"Required argument, {item} is missing." return ret if not _numeric(kwargs["number"]) or not 1 <= kwargs["number"] <= 100: diff --git a/salt/modules/rbac_solaris.py b/salt/modules/rbac_solaris.py index 876eaf0bf70..3adf2eb974f 100644 --- a/salt/modules/rbac_solaris.py +++ b/salt/modules/rbac_solaris.py @@ -21,7 +21,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded on a solaris like system".format(__virtualname__), + f"{__virtualname__} module can only be loaded on a solaris like system", ) @@ -459,7 +459,7 @@ def auth_list(): # add auth info to dict if auth[0][-1:] == ".": - auth[0] = "{}*".format(auth[0]) + auth[0] = f"{auth[0]}*" auths[auth[0]] = auth[3] return auths @@ -509,7 +509,7 @@ def auth_get(user, computed=True): ## also parse auths command if computed: - res = __salt__["cmd.run_all"]("auths {}".format(user)) + res = __salt__["cmd.run_all"](f"auths {user}") if res["retcode"] == 0: for auth in res["stdout"].splitlines(): if "," in auth: diff --git a/salt/modules/rbenv.py b/salt/modules/rbenv.py index b41ed1e8909..1f3ee003818 100644 --- a/salt/modules/rbenv.py +++ b/salt/modules/rbenv.py @@ -75,7 +75,7 @@ def _parse_env(env): def _rbenv_bin(runas=None): path = _rbenv_path(runas) - return "{}/bin/rbenv".format(path) + return f"{path}/bin/rbenv" def _rbenv_path(runas=None): @@ -83,7 +83,7 @@ def _rbenv_path(runas=None): if runas in (None, "root"): path = __salt__["config.option"]("rbenv.root") or "/usr/local/rbenv" else: - path = __salt__["config.option"]("rbenv.root") or "~{}/.rbenv".format(runas) + path = __salt__["config.option"]("rbenv.root") or f"~{runas}/.rbenv" return os.path.expanduser(path) @@ -119,7 +119,7 @@ def _install_rbenv(path, runas=None): def _install_ruby_build(path, runas=None): - path = "{}/plugins/ruby-build".format(path) + path = f"{path}/plugins/ruby-build" if os.path.isdir(path): return True @@ -140,7 +140,7 @@ def _update_rbenv(path, runas=None): def _update_ruby_build(path, runas=None): - path = "{}/plugins/ruby-build".format(path) + path = f"{path}/plugins/ruby-build" if not os.path.isdir(path): return False diff --git a/salt/modules/rdp.py b/salt/modules/rdp.py index e0c4a5d21a5..81dc1c77c6a 100644 --- a/salt/modules/rdp.py +++ b/salt/modules/rdp.py @@ -50,9 +50,7 @@ def _psrdp(cmd): "-Namespace root\\CIMV2\\TerminalServices -Computer . " "-Authentication 6 -ErrorAction Stop" ) - return __salt__["cmd.run"]( - "{} ; {}".format(rdp, cmd), shell="powershell", python_shell=True - ) + return __salt__["cmd.run"](f"{rdp} ; {cmd}", shell="powershell", python_shell=True) def enable(): diff --git a/salt/modules/reg.py b/salt/modules/reg.py index 5184d0423e2..5afaad95716 100644 --- a/salt/modules/reg.py +++ b/salt/modules/reg.py @@ -559,13 +559,13 @@ def import_file(source, use_32bit_registry=False): """ cache_path = __salt__["cp.cache_file"](source) if not cache_path: - error_msg = "File/URL '{}' probably invalid.".format(source) + error_msg = f"File/URL '{source}' probably invalid." raise ValueError(error_msg) if use_32bit_registry: word_sz_txt = "32" else: word_sz_txt = "64" - cmd = 'reg import "{}" /reg:{}'.format(cache_path, word_sz_txt) + cmd = f'reg import "{cache_path}" /reg:{word_sz_txt}' cmd_ret_dict = __salt__["cmd.run_all"](cmd, python_shell=True) retcode = cmd_ret_dict["retcode"] if retcode != 0: diff --git a/salt/modules/restartcheck.py b/salt/modules/restartcheck.py index b2a2a30bb66..9f355df48cd 100644 --- a/salt/modules/restartcheck.py +++ b/salt/modules/restartcheck.py @@ -330,7 +330,7 @@ def _kernel_versions_nilrt(): Get kernel version from a binary image or None if detection fails """ kvregex = r"[0-9]+\.[0-9]+\.[0-9]+-rt\S+" - kernel_strings = __salt__["cmd.run"]("strings {}".format(kbin)) + kernel_strings = __salt__["cmd.run"](f"strings {kbin}") re_result = re.search(kvregex, kernel_strings) return None if re_result is None else re_result.group(0) @@ -347,7 +347,7 @@ def _kernel_versions_nilrt(): itb_path, compressed_kernel ) ) - __salt__["cmd.run"]("gunzip -f {}".format(compressed_kernel)) + __salt__["cmd.run"](f"gunzip -f {compressed_kernel}") kver = _get_kver_from_bin(uncompressed_kernel) else: # the kernel bzImage is copied to rootfs without package management or @@ -388,8 +388,8 @@ def _file_changed_nilrt(full_filepath): """ rs_state_dir = "/var/lib/salt/restartcheck_state" base_filename = os.path.basename(full_filepath) - timestamp_file = os.path.join(rs_state_dir, "{}.timestamp".format(base_filename)) - md5sum_file = os.path.join(rs_state_dir, "{}.md5sum".format(base_filename)) + timestamp_file = os.path.join(rs_state_dir, f"{base_filename}.timestamp") + md5sum_file = os.path.join(rs_state_dir, f"{base_filename}.md5sum") if not os.path.exists(timestamp_file) or not os.path.exists(md5sum_file): return True @@ -402,9 +402,7 @@ def _file_changed_nilrt(full_filepath): return True return bool( - __salt__["cmd.retcode"]( - "md5sum -cs {}".format(md5sum_file), output_loglevel="quiet" - ) + __salt__["cmd.retcode"](f"md5sum -cs {md5sum_file}", output_loglevel="quiet") ) @@ -419,7 +417,7 @@ def _kernel_modules_changed_nilrt(kernelversion): - True if modules.dep was modified/touched, False otherwise. """ if kernelversion is not None: - return _file_changed_nilrt("/lib/modules/{}/modules.dep".format(kernelversion)) + return _file_changed_nilrt(f"/lib/modules/{kernelversion}/modules.dep") return False @@ -447,7 +445,7 @@ def _sysapi_changed_nilrt(): ) if os.path.exists(nisysapi_conf_d_path): - rs_count_file = "{}/sysapi.conf.d.count".format(restartcheck_state_dir) + rs_count_file = f"{restartcheck_state_dir}/sysapi.conf.d.count" if not os.path.exists(rs_count_file): return True @@ -458,7 +456,7 @@ def _sysapi_changed_nilrt(): return True for fexpert in os.listdir(nisysapi_conf_d_path): - if _file_changed_nilrt("{}/{}".format(nisysapi_conf_d_path, fexpert)): + if _file_changed_nilrt(f"{nisysapi_conf_d_path}/{fexpert}"): return True return False @@ -579,7 +577,7 @@ def restartcheck(ignorelist=None, blacklist=None, excludepid=None, **kwargs): if path in blacklist or pid in excludepid: continue try: - readlink = os.readlink("/proc/{}/exe".format(pid)) + readlink = os.readlink(f"/proc/{pid}/exe") except OSError: excludepid.append(pid) continue diff --git a/salt/modules/restconf.py b/salt/modules/restconf.py index 1a2d4f7799c..b99187c87f3 100644 --- a/salt/modules/restconf.py +++ b/salt/modules/restconf.py @@ -17,7 +17,7 @@ log = logging.getLogger(__file__) def __virtual__(): if __opts__.get("proxy", {}).get("proxytype") != __virtualname__: - return False, "Proxytype does not match: {}".format(__virtualname__) + return False, f"Proxytype does not match: {__virtualname__}" return True diff --git a/salt/modules/ret.py b/salt/modules/ret.py index 9210eb4d7ed..1885b92a8b5 100644 --- a/salt/modules/ret.py +++ b/salt/modules/ret.py @@ -16,7 +16,7 @@ def get_jid(returner, jid): salt '*' ret.get_jid redis 20421104181954700505 """ returners = salt.loader.returners(__opts__, __salt__) - return returners["{}.get_jid".format(returner)](jid) + return returners[f"{returner}.get_jid"](jid) def get_fun(returner, fun): @@ -30,7 +30,7 @@ def get_fun(returner, fun): salt '*' ret.get_fun mysql network.interfaces """ returners = salt.loader.returners(__opts__, __salt__) - return returners["{}.get_fun".format(returner)](fun) + return returners[f"{returner}.get_fun"](fun) def get_jids(returner): @@ -44,7 +44,7 @@ def get_jids(returner): salt '*' ret.get_jids mysql """ returners = salt.loader.returners(__opts__, __salt__) - return returners["{}.get_jids".format(returner)]() + return returners[f"{returner}.get_jids"]() def get_minions(returner): @@ -58,4 +58,4 @@ def get_minions(returner): salt '*' ret.get_minions mysql """ returners = salt.loader.returners(__opts__, __salt__) - return returners["{}.get_minions".format(returner)]() + return returners[f"{returner}.get_minions"]() diff --git a/salt/modules/rh_ip.py b/salt/modules/rh_ip.py index b6ee34846e2..f1d823b1a82 100644 --- a/salt/modules/rh_ip.py +++ b/salt/modules/rh_ip.py @@ -202,7 +202,7 @@ def _parse_ethtool_opts(opts, iface): _raise_error_iface(iface, "advertise", valid) if "channels" in opts: - channels_cmd = "-L {}".format(iface.strip()) + channels_cmd = f"-L {iface.strip()}" channels_params = [] for option in ("rx", "tx", "other", "combined"): if option in opts["channels"]: @@ -584,9 +584,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): if iface_type not in ("bridge",): ethtool = _parse_ethtool_opts(opts, iface) if ethtool: - result["ethtool"] = " ".join( - ["{} {}".format(x, y) for x, y in ethtool.items()] - ) + result["ethtool"] = " ".join([f"{x} {y}" for x, y in ethtool.items()]) if iface_type == "slave": result["proto"] = "none" @@ -609,9 +607,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): raise AttributeError(msg) bonding = _parse_settings_bond(opts, iface) if bonding: - result["bonding"] = " ".join( - ["{}={}".format(x, y) for x, y in bonding.items()] - ) + result["bonding"] = " ".join([f"{x}={y}" for x, y in bonding.items()]) result["devtype"] = "Bond" if iface_type == "vlan": @@ -1076,7 +1072,7 @@ def build_interface(iface, iface_type, enabled, **settings): ): opts = _parse_settings_eth(settings, iface_type, enabled, iface) try: - template = JINJA.get_template("rh{}_eth.jinja".format(rh_major)) + template = JINJA.get_template(f"rh{rh_major}_eth.jinja") except jinja2.exceptions.TemplateNotFound: log.error("Could not load template rh%s_eth.jinja", rh_major) return "" @@ -1086,7 +1082,7 @@ def build_interface(iface, iface_type, enabled, **settings): return _read_temp(ifcfg) _write_file_iface(iface, ifcfg, _RH_NETWORK_SCRIPT_DIR, "ifcfg-{0}") - path = os.path.join(_RH_NETWORK_SCRIPT_DIR, "ifcfg-{}".format(iface)) + path = os.path.join(_RH_NETWORK_SCRIPT_DIR, f"ifcfg-{iface}") return _read_file(path) @@ -1139,8 +1135,8 @@ def build_routes(iface, **settings): _write_file_iface(iface, routecfg, _RH_NETWORK_SCRIPT_DIR, "route-{0}") _write_file_iface(iface, routecfg6, _RH_NETWORK_SCRIPT_DIR, "route6-{0}") - path = os.path.join(_RH_NETWORK_SCRIPT_DIR, "route-{}".format(iface)) - path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, "route6-{}".format(iface)) + path = os.path.join(_RH_NETWORK_SCRIPT_DIR, f"route-{iface}") + path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, f"route6-{iface}") routes = _read_file(path) routes.extend(_read_file(path6)) @@ -1159,7 +1155,7 @@ def down(iface, iface_type): """ # Slave devices are controlled by the master. if iface_type.lower() not in ("slave", "teamport"): - return __salt__["cmd.run"]("ifdown {}".format(iface)) + return __salt__["cmd.run"](f"ifdown {iface}") return None @@ -1173,7 +1169,7 @@ def get_interface(iface): salt '*' ip.get_interface eth0 """ - path = os.path.join(_RH_NETWORK_SCRIPT_DIR, "ifcfg-{}".format(iface)) + path = os.path.join(_RH_NETWORK_SCRIPT_DIR, f"ifcfg-{iface}") return _read_file(path) @@ -1189,7 +1185,7 @@ def up(iface, iface_type): # pylint: disable=C0103 """ # Slave devices are controlled by the master. if iface_type.lower() not in ("slave", "teamport"): - return __salt__["cmd.run"]("ifup {}".format(iface)) + return __salt__["cmd.run"](f"ifup {iface}") return None @@ -1203,8 +1199,8 @@ def get_routes(iface): salt '*' ip.get_routes eth0 """ - path = os.path.join(_RH_NETWORK_SCRIPT_DIR, "route-{}".format(iface)) - path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, "route6-{}".format(iface)) + path = os.path.join(_RH_NETWORK_SCRIPT_DIR, f"route-{iface}") + path6 = os.path.join(_RH_NETWORK_SCRIPT_DIR, f"route6-{iface}") routes = _read_file(path) routes.extend(_read_file(path6)) return routes diff --git a/salt/modules/rh_service.py b/salt/modules/rh_service.py index b8b802479fe..f4ff8da54d0 100644 --- a/salt/modules/rh_service.py +++ b/salt/modules/rh_service.py @@ -113,7 +113,7 @@ def __virtual__(): "load rh_service.py as virtual 'service'", ) return __virtualname__ - return (False, "Cannot load rh_service module: OS not in {}".format(enable)) + return (False, f"Cannot load rh_service module: OS not in {enable}") def _runlevel(): @@ -137,7 +137,7 @@ def _chkconfig_add(name): /etc/init.d. The service is initially configured to be disabled at all run-levels. """ - cmd = "/sbin/chkconfig --add {}".format(name) + cmd = f"/sbin/chkconfig --add {name}" if __salt__["cmd.retcode"](cmd, python_shell=False) == 0: log.info('Added initscript "%s" to chkconfig', name) return True @@ -150,7 +150,7 @@ def _service_is_upstart(name): """ Return True if the service is an upstart service, otherwise return False. """ - return HAS_UPSTART and os.path.exists("/etc/init/{}.conf".format(name)) + return HAS_UPSTART and os.path.exists(f"/etc/init/{name}.conf") def _service_is_sysv(name): @@ -169,7 +169,7 @@ def _service_is_chkconfig(name): """ Return True if the service is managed by chkconfig. """ - cmdline = "/sbin/chkconfig --list {}".format(name) + cmdline = f"/sbin/chkconfig --list {name}" return ( __salt__["cmd.retcode"](cmdline, python_shell=False, ignore_retcode=True) == 0 ) @@ -188,7 +188,7 @@ def _sysv_is_enabled(name, runlevel=None): if runlevel is None: runlevel = _runlevel() - return len(glob.glob("/etc/rc.d/rc{}.d/S??{}".format(runlevel, name))) > 0 + return len(glob.glob(f"/etc/rc.d/rc{runlevel}.d/S??{name}")) > 0 def _chkconfig_is_enabled(name, runlevel=None): @@ -197,14 +197,14 @@ def _chkconfig_is_enabled(name, runlevel=None): return ``False``. If ``runlevel`` is ``None``, then use the current runlevel. """ - cmdline = "/sbin/chkconfig --list {}".format(name) + cmdline = f"/sbin/chkconfig --list {name}" result = __salt__["cmd.run_all"](cmdline, python_shell=False) if runlevel is None: runlevel = _runlevel() if result["retcode"] == 0: for row in result["stdout"].splitlines(): - if "{}:on".format(runlevel) in row: + if f"{runlevel}:on" in row: if row.split()[0] == name: return True elif row.split() == [name, "on"]: @@ -220,7 +220,7 @@ def _sysv_enable(name): """ if not _service_is_chkconfig(name) and not _chkconfig_add(name): return False - cmd = "/sbin/chkconfig {} on".format(name) + cmd = f"/sbin/chkconfig {name} on" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -233,7 +233,7 @@ def _sysv_disable(name): """ if not _service_is_chkconfig(name) and not _chkconfig_add(name): return False - cmd = "/sbin/chkconfig {} off".format(name) + cmd = f"/sbin/chkconfig {name} off" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -244,7 +244,7 @@ def _sysv_delete(name): """ if not _service_is_chkconfig(name): return False - cmd = "/sbin/chkconfig --del {}".format(name) + cmd = f"/sbin/chkconfig --del {name}" return not __salt__["cmd.retcode"](cmd) @@ -253,10 +253,10 @@ def _upstart_delete(name): Delete an upstart service. This will only rename the .conf file """ if HAS_UPSTART: - if os.path.exists("/etc/init/{}.conf".format(name)): + if os.path.exists(f"/etc/init/{name}.conf"): os.rename( - "/etc/init/{}.conf".format(name), - "/etc/init/{}.conf.removed".format(name), + f"/etc/init/{name}.conf", + f"/etc/init/{name}.conf.removed", ) return True @@ -435,9 +435,9 @@ def start(name): salt '*' service.start """ if _service_is_upstart(name): - cmd = "start {}".format(name) + cmd = f"start {name}" else: - cmd = "/sbin/service {} start".format(name) + cmd = f"/sbin/service {name} start" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -452,9 +452,9 @@ def stop(name): salt '*' service.stop """ if _service_is_upstart(name): - cmd = "stop {}".format(name) + cmd = f"stop {name}" else: - cmd = "/sbin/service {} stop".format(name) + cmd = f"/sbin/service {name} stop" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -469,9 +469,9 @@ def restart(name): salt '*' service.restart """ if _service_is_upstart(name): - cmd = "restart {}".format(name) + cmd = f"restart {name}" else: - cmd = "/sbin/service {} restart".format(name) + cmd = f"/sbin/service {name} restart" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -486,9 +486,9 @@ def reload_(name): salt '*' service.reload """ if _service_is_upstart(name): - cmd = "reload {}".format(name) + cmd = f"reload {name}" else: - cmd = "/sbin/service {} reload".format(name) + cmd = f"/sbin/service {name} reload" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -526,12 +526,12 @@ def status(name, sig=None): results = {} for service in services: if _service_is_upstart(service): - cmd = "status {}".format(service) + cmd = f"status {service}" results[service] = "start/running" in __salt__["cmd.run"]( cmd, python_shell=False ) else: - cmd = "/sbin/service {} status".format(service) + cmd = f"/sbin/service {service} status" results[service] = ( __salt__["cmd.retcode"](cmd, python_shell=False, ignore_retcode=True) == 0 diff --git a/salt/modules/riak.py b/salt/modules/riak.py index 197d8689971..f8d893a8451 100644 --- a/salt/modules/riak.py +++ b/salt/modules/riak.py @@ -21,7 +21,7 @@ def __execute_cmd(name, cmd): """ Execute Riak commands """ - return __salt__["cmd.run_all"]("{} {}".format(salt.utils.path.which(name), cmd)) + return __salt__["cmd.run_all"](f"{salt.utils.path.which(name)} {cmd}") def start(): @@ -89,7 +89,7 @@ def cluster_join(username, hostname): """ ret = {"comment": "", "success": False} - cmd = __execute_cmd("riak-admin", "cluster join {}@{}".format(username, hostname)) + cmd = __execute_cmd("riak-admin", f"cluster join {username}@{hostname}") if cmd["retcode"] != 0: ret["comment"] = cmd["stdout"] @@ -117,7 +117,7 @@ def cluster_leave(username, hostname): """ ret = {"comment": "", "success": False} - cmd = __execute_cmd("riak-admin", "cluster leave {}@{}".format(username, hostname)) + cmd = __execute_cmd("riak-admin", f"cluster leave {username}@{hostname}") if cmd["retcode"] != 0: ret["comment"] = cmd["stdout"] diff --git a/salt/modules/rpm_lowpkg.py b/salt/modules/rpm_lowpkg.py index 7bf45780f0c..1e3aa32e958 100644 --- a/salt/modules/rpm_lowpkg.py +++ b/salt/modules/rpm_lowpkg.py @@ -110,14 +110,14 @@ def bin_pkg_info(path, saltenv="base"): newpath = __salt__["cp.cache_file"](path, saltenv) if not newpath: raise CommandExecutionError( - "Unable to retrieve {} from saltenv '{}'".format(path, saltenv) + f"Unable to retrieve {path} from saltenv '{saltenv}'" ) path = newpath else: if not os.path.exists(path): - raise CommandExecutionError("{} does not exist on minion".format(path)) + raise CommandExecutionError(f"{path} does not exist on minion") elif not os.path.isabs(path): - raise SaltInvocationError("{} does not exist on minion".format(path)) + raise SaltInvocationError(f"{path} does not exist on minion") # REPOID is not a valid tag for the rpm command. Remove it and replace it # with 'none' @@ -495,7 +495,7 @@ def diff(package_path, path): ) res = __salt__["cmd.shell"](cmd.format(package_path, path), output_loglevel="trace") if res and res.startswith("Binary file"): - return "File '{}' is binary and its content has been modified.".format(path) + return f"File '{path}' is binary and its content has been modified." return res @@ -765,7 +765,7 @@ def version_cmp(ver1, ver2, ignore_epoch=False): # rpmdev-vercmp always uses epochs, even when zero def _ensure_epoch(ver): def _prepend(ver): - return "0:{}".format(ver) + return f"0:{ver}" try: if ":" not in ver: @@ -821,7 +821,7 @@ def version_cmp(ver1, ver2, ignore_epoch=False): ) if cmp_result not in (-1, 0, 1): raise CommandExecutionError( - "Comparison result '{}' is invalid".format(cmp_result) + f"Comparison result '{cmp_result}' is invalid" ) return cmp_result diff --git a/salt/modules/rpmbuild_pkgbuild.py b/salt/modules/rpmbuild_pkgbuild.py index 9d205392b1b..135afab975c 100644 --- a/salt/modules/rpmbuild_pkgbuild.py +++ b/salt/modules/rpmbuild_pkgbuild.py @@ -82,7 +82,7 @@ def _create_rpmmacros(runas="root"): rpmmacros = os.path.join(home, ".rpmmacros") with salt.utils.files.fopen(rpmmacros, "w") as afile: - afile.write(salt.utils.stringutils.to_str("%_topdir {}\n".format(rpmbuilddir))) + afile.write(salt.utils.stringutils.to_str(f"%_topdir {rpmbuilddir}\n")) afile.write("%signature gpg\n") afile.write("%_source_filedigest_algorithm 8\n") afile.write("%_binary_filedigest_algorithm 8\n") @@ -132,9 +132,9 @@ def _get_distset(tgt): # consistent naming on Centos and Redhat, and allow for Amazon naming tgtattrs = tgt.split("-") if tgtattrs[0] == "amzn2": - distset = '--define "dist .{}"'.format(tgtattrs[0]) + distset = f'--define "dist .{tgtattrs[0]}"' elif tgtattrs[1] in ["6", "7", "8"]: - distset = '--define "dist .el{}"'.format(tgtattrs[1]) + distset = f'--define "dist .el{tgtattrs[1]}"' else: distset = "" @@ -161,7 +161,7 @@ def _get_deps(deps, tree_base, saltenv="base"): else: shutil.copy(deprpm, dest) - deps_list += " {}".format(dest) + deps_list += f" {dest}" return deps_list @@ -174,9 +174,7 @@ def _check_repo_gpg_phrase_utils(): if __salt__["file.file_exists"](util_name): return True else: - raise CommandExecutionError( - "utility '{}' needs to be installed".format(util_name) - ) + raise CommandExecutionError(f"utility '{util_name}' needs to be installed") def _get_gpg_key_resources(keyid, env, use_passphrase, gnupghome, runas): @@ -325,7 +323,7 @@ def _get_gpg_key_resources(keyid, env, use_passphrase, gnupghome, runas): ) # need to update rpm with public key - cmd = "rpm --import {}".format(pkg_pub_key_file) + cmd = f"rpm --import {pkg_pub_key_file}" retrc = __salt__["cmd.retcode"](cmd, runas=runas, use_vt=True) if retrc != 0: raise SaltInvocationError( @@ -348,9 +346,9 @@ def _sign_file(runas, define_gpg_name, phrase, abs_file, timeout): interval = 0.5 number_retries = timeout / interval times_looped = 0 - error_msg = "Failed to sign file {}".format(abs_file) + error_msg = f"Failed to sign file {abs_file}" - cmd = "rpm {} --addsign {}".format(define_gpg_name, abs_file) + cmd = f"rpm {define_gpg_name} --addsign {abs_file}" preexec_fn = functools.partial(salt.utils.user.chugid_and_umask, runas, None) try: stdout, stderr = None, None @@ -395,7 +393,7 @@ def _sign_files_with_gpg_agent(runas, local_keyid, abs_file, repodir, env, timeo """ Sign file with provided key utilizing gpg-agent """ - cmd = "rpmsign --verbose --key-id={} --addsign {}".format(local_keyid, abs_file) + cmd = f"rpmsign --verbose --key-id={local_keyid} --addsign {abs_file}" retrc = __salt__["cmd.retcode"](cmd, runas=runas, cwd=repodir, use_vt=True, env=env) if retrc != 0: raise SaltInvocationError( @@ -547,7 +545,7 @@ def build( try: __salt__["file.chown"](path=dbase, user=runas, group="mock") __salt__["file.chown"](path=results_dir, user=runas, group="mock") - cmd = "mock --root={} --resultdir={} --init".format(tgt, results_dir) + cmd = f"mock --root={tgt} --resultdir={results_dir} --init" retrc |= __salt__["cmd.retcode"](cmd, runas=runas) if deps_list and not deps_list.isspace(): cmd = "mock --root={} --resultdir={} --install {} {}".format( @@ -564,7 +562,7 @@ def build( "rpm", "-qp", "--queryformat", - "{0}/%{{name}}/%{{version}}-%{{release}}".format(log_dir), + f"{log_dir}/%{{name}}/%{{version}}-%{{release}}", srpm, ] log_dest = __salt__["cmd.run_stdout"](cmdlist, python_shell=False) @@ -752,6 +750,6 @@ def make_repo( else: _sign_file(runas, define_gpg_name, phrase, abs_file, timeout) - cmd = "createrepo --update {}".format(repodir) + cmd = f"createrepo --update {repodir}" retrc = __salt__["cmd.run_all"](cmd, runas=runas) return retrc diff --git a/salt/modules/rsync.py b/salt/modules/rsync.py index ffecb3dfb89..311a51cf8a7 100644 --- a/salt/modules/rsync.py +++ b/salt/modules/rsync.py @@ -47,7 +47,7 @@ def _check(delete, force, update, passwordfile, exclude, excludefrom, dryrun, rs if update: options.append("--update") if rsh: - options.append("--rsh={}".format(rsh)) + options.append(f"--rsh={rsh}") if passwordfile: options.extend(["--password-file", passwordfile]) if excludefrom: @@ -182,16 +182,16 @@ def rsync( # get the contents not the tmpdir # itself. if not src.endswith("/"): - src = "{}/".format(src) + src = f"{src}/" else: - raise CommandExecutionError("{} does not exist".format(src)) + raise CommandExecutionError(f"{src} does not exist") else: tmp_src = salt.utils.files.mkstemp() file_src = __salt__["cp.get_file"](_src, tmp_src, saltenv) if file_src: src = tmp_src else: - raise CommandExecutionError("{} does not exist".format(src)) + raise CommandExecutionError(f"{src} does not exist") option = _check( delete, force, update, passwordfile, exclude, excludefrom, dryrun, rsh @@ -261,16 +261,14 @@ def config(conf_path="/etc/rsyncd.conf"): ret += salt.utils.stringutils.to_unicode(line) except OSError as exc: if exc.errno == errno.ENOENT: - raise CommandExecutionError("{} does not exist".format(conf_path)) + raise CommandExecutionError(f"{conf_path} does not exist") elif exc.errno == errno.EACCES: - raise CommandExecutionError( - "Unable to read {}, access denied".format(conf_path) - ) + raise CommandExecutionError(f"Unable to read {conf_path}, access denied") elif exc.errno == errno.EISDIR: raise CommandExecutionError( - "Unable to read {}, path is a directory".format(conf_path) + f"Unable to read {conf_path}, path is a directory" ) else: - raise CommandExecutionError("Error {}: {}".format(exc.errno, exc.strerror)) + raise CommandExecutionError(f"Error {exc.errno}: {exc.strerror}") else: return ret diff --git a/salt/modules/runit.py b/salt/modules/runit.py index 29f95bf377b..c38612f59f8 100644 --- a/salt/modules/runit.py +++ b/salt/modules/runit.py @@ -122,7 +122,7 @@ def start(name): salt '*' runit.start """ - cmd = "sv start {}".format(_service_path(name)) + cmd = f"sv start {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -140,7 +140,7 @@ def stop(name): salt '*' runit.stop """ - cmd = "sv stop {}".format(_service_path(name)) + cmd = f"sv stop {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -158,7 +158,7 @@ def reload_(name): salt '*' runit.reload """ - cmd = "sv reload {}".format(_service_path(name)) + cmd = f"sv reload {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -176,7 +176,7 @@ def restart(name): salt '*' runit.restart """ - cmd = "sv restart {}".format(_service_path(name)) + cmd = f"sv restart {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -226,7 +226,7 @@ def status(name, sig=None): # sv return code is not relevant to get a service status. # Check its output instead. - cmd = "sv status {}".format(svc_path) + cmd = f"sv status {svc_path}" try: out = __salt__["cmd.run_stdout"](cmd) return out.startswith("run: ") @@ -628,7 +628,7 @@ def enable(name, start=False, **kwargs): # if not, down_file might be removed too quickly, # before 'sv' have time to take care about it. # Documentation indicates that a change is handled within 5 seconds. - cmd = "sv status {}".format(_service_path(name)) + cmd = f"sv status {_service_path(name)}" retcode_sv = 1 count_sv = 0 while retcode_sv != 0 and count_sv < 10: diff --git a/salt/modules/rvm.py b/salt/modules/rvm.py index 28669a26511..92d9b92983d 100644 --- a/salt/modules/rvm.py +++ b/salt/modules/rvm.py @@ -21,8 +21,8 @@ __opts__ = { def _get_rvm_location(runas=None): if runas: - runas_home = os.path.expanduser("~{}".format(runas)) - rvmpath = "{}/.rvm/bin/rvm".format(runas_home) + runas_home = os.path.expanduser(f"~{runas}") + rvmpath = f"{runas_home}/.rvm/bin/rvm" if os.path.exists(rvmpath): return [rvmpath] return ["/usr/local/rvm/bin/rvm"] @@ -87,7 +87,7 @@ def install(runas=None): ret = __salt__["cmd.run_all"]( # the RVM installer automatically does a multi-user install when it is # invoked with root privileges - "curl -Ls {installer} | bash -s stable".format(installer=installer), + f"curl -Ls {installer} | bash -s stable", runas=runas, python_shell=True, ) diff --git a/salt/modules/s6.py b/salt/modules/s6.py index 23edface5a5..3f1c4656520 100644 --- a/salt/modules/s6.py +++ b/salt/modules/s6.py @@ -40,7 +40,7 @@ def _service_path(name): """ if not SERVICE_DIR: raise CommandExecutionError("Could not find service directory.") - return "{}/{}".format(SERVICE_DIR, name) + return f"{SERVICE_DIR}/{name}" def start(name): @@ -53,7 +53,7 @@ def start(name): salt '*' s6.start """ - cmd = "s6-svc -u {}".format(_service_path(name)) + cmd = f"s6-svc -u {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -67,7 +67,7 @@ def stop(name): salt '*' s6.stop """ - cmd = "s6-svc -d {}".format(_service_path(name)) + cmd = f"s6-svc -d {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -81,7 +81,7 @@ def term(name): salt '*' s6.term """ - cmd = "s6-svc -t {}".format(_service_path(name)) + cmd = f"s6-svc -t {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -95,7 +95,7 @@ def reload_(name): salt '*' s6.reload """ - cmd = "s6-svc -h {}".format(_service_path(name)) + cmd = f"s6-svc -h {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -109,7 +109,7 @@ def restart(name): salt '*' s6.restart """ - cmd = "s6-svc -t {}".format(_service_path(name)) + cmd = f"s6-svc -t {_service_path(name)}" return not __salt__["cmd.retcode"](cmd) @@ -136,7 +136,7 @@ def status(name, sig=None): salt '*' s6.status """ - cmd = "s6-svstat {}".format(_service_path(name)) + cmd = f"s6-svstat {_service_path(name)}" out = __salt__["cmd.run_stdout"](cmd) try: pid = re.search(r"up \(pid (\d+)\)", out).group(1) diff --git a/salt/modules/salt_proxy.py b/salt/modules/salt_proxy.py index 315abf4314d..70572ba1f33 100644 --- a/salt/modules/salt_proxy.py +++ b/salt/modules/salt_proxy.py @@ -33,7 +33,7 @@ def _write_proxy_conf(proxyfile): proxy_conf.write( salt.utils.stringutils.to_str("master: {}".format(__grains__["master"])) ) - msg = "Wrote proxy file {}".format(proxyfile) + msg = f"Wrote proxy file {proxyfile}" log.debug(msg) return msg @@ -50,18 +50,18 @@ def _proxy_conf_file(proxyfile, test): try: if not test: changes_new.append(_write_proxy_conf(proxyfile)) - msg = "Salt Proxy: Wrote proxy conf {}".format(proxyfile) + msg = f"Salt Proxy: Wrote proxy conf {proxyfile}" else: - msg = "Salt Proxy: Update required to proxy conf {}".format(proxyfile) + msg = f"Salt Proxy: Update required to proxy conf {proxyfile}" except OSError as err: success = False - msg = "Salt Proxy: Error writing proxy file {}".format(err) + msg = f"Salt Proxy: Error writing proxy file {err}" log.error(msg) changes_new.append(msg) changes_new.append(msg) log.debug(msg) else: - msg = "Salt Proxy: {} already exists, skipping".format(proxyfile) + msg = f"Salt Proxy: {proxyfile} already exists, skipping" changes_old.append(msg) log.debug(msg) return success, changes_new, changes_old @@ -90,18 +90,14 @@ def _proxy_process(proxyname, test): if not _is_proxy_running(proxyname): if not test: __salt__["cmd.run_all"]( - "salt-proxy --proxyid={} -l info -d".format(shlex.quote(proxyname)), + f"salt-proxy --proxyid={shlex.quote(proxyname)} -l info -d", timeout=5, ) - changes_new.append( - "Salt Proxy: Started proxy process for {}".format(proxyname) - ) + changes_new.append(f"Salt Proxy: Started proxy process for {proxyname}") else: - changes_new.append( - "Salt Proxy: process {} will be started".format(proxyname) - ) + changes_new.append(f"Salt Proxy: process {proxyname} will be started") else: - changes_old.append("Salt Proxy: already running for {}".format(proxyname)) + changes_old.append(f"Salt Proxy: already running for {proxyname}") return True, changes_new, changes_old diff --git a/salt/modules/saltcheck.py b/salt/modules/saltcheck.py index 77a010f3fb1..7ca48953097 100644 --- a/salt/modules/saltcheck.py +++ b/salt/modules/saltcheck.py @@ -647,7 +647,7 @@ def _is_valid_function(module_name, function): functions = __salt__["sys.list_functions"](module_name) except salt.exceptions.SaltException: functions = ["unable to look up functions"] - return "{}.{}".format(module_name, function) in functions + return f"{module_name}.{function}" in functions def _get_top_states(saltenv="base"): @@ -874,11 +874,11 @@ class SaltCheck: if output_details: if assertion_section: assertion_section_repr_title = " {}".format("assertion_section") - assertion_section_repr_value = " {}".format(assertion_section) + assertion_section_repr_value = f" {assertion_section}" else: assertion_section_repr_title = "" assertion_section_repr_value = "" - value["module.function [args]{}".format(assertion_section_repr_title)] = ( + value[f"module.function [args]{assertion_section_repr_title}"] = ( "{} {}{}".format( mod_and_func, dumps(args), @@ -886,7 +886,7 @@ class SaltCheck: ) ) value["saltcheck assertion"] = "{}{} {}".format( - ("" if expected_return is None else "{} ".format(expected_return)), + ("" if expected_return is None else f"{expected_return} "), assertion_desc, ("hidden" if not assert_print_result else module_output), ) @@ -931,7 +931,7 @@ class SaltCheck: for num, assert_group in enumerate( test_dict.get("assertions"), start=1 ): - result["assertion{}".format(num)] = self._run_assertions( + result[f"assertion{num}"] = self._run_assertions( mod_and_func, args, assert_group, @@ -1031,7 +1031,7 @@ class SaltCheck: """ result = "Pass" try: - assert returned is True, "{} not True".format(returned) + assert returned is True, f"{returned} not True" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1045,7 +1045,7 @@ class SaltCheck: if isinstance(returned, str): returned = bool(returned) try: - assert returned is False, "{} not False".format(returned) + assert returned is False, f"{returned} not False" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1091,7 +1091,7 @@ class SaltCheck: """ result = "Pass" try: - assert expected > returned, "{} not False".format(returned) + assert expected > returned, f"{returned} not False" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1103,7 +1103,7 @@ class SaltCheck: """ result = "Pass" try: - assert expected >= returned, "{} not False".format(returned) + assert expected >= returned, f"{returned} not False" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1115,7 +1115,7 @@ class SaltCheck: """ result = "Pass" try: - assert expected < returned, "{} not False".format(returned) + assert expected < returned, f"{returned} not False" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1127,7 +1127,7 @@ class SaltCheck: """ result = "Pass" try: - assert expected <= returned, "{} not False".format(returned) + assert expected <= returned, f"{returned} not False" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1139,7 +1139,7 @@ class SaltCheck: """ result = "Pass" try: - assert not returned, "{} is not empty".format(returned) + assert not returned, f"{returned} is not empty" except AssertionError as err: result = "Fail: " + str(err) return result @@ -1251,7 +1251,7 @@ class StateTestLoader: all_sls_paths.append(test_path) state_name_base = state_name.split(".")[0] - test_path = "salt://{}/{}".format(state_name_base, self.saltcheck_test_location) + test_path = f"salt://{state_name_base}/{self.saltcheck_test_location}" all_sls_paths.append(test_path) unique_paths = set(all_sls_paths) @@ -1367,13 +1367,13 @@ class StateTestLoader: os.path.join( os.sep.join(split_sls[: len(split_sls) - 1]), os.path.normpath(self.saltcheck_test_location), - "{}.tst".format(split_sls[-1]), + f"{split_sls[-1]}.tst", ), os.path.join( split_sls[0], os.path.normpath(self.saltcheck_test_location), os.sep.join(split_sls[1:-1]), - "{}.tst".format(split_sls[-1]), + f"{split_sls[-1]}.tst", ), } # for this state, find matching test files and load them diff --git a/salt/modules/saltcloudmod.py b/salt/modules/saltcloudmod.py index acaed51519b..29a549490e0 100644 --- a/salt/modules/saltcloudmod.py +++ b/salt/modules/saltcloudmod.py @@ -40,7 +40,7 @@ def create(name, profile): salt saltcloud.create webserver rackspace_centos_512 """ - cmd = "salt-cloud --out json -p {} {}".format(profile, name) + cmd = f"salt-cloud --out json -p {profile} {name}" out = __salt__["cmd.run_stdout"](cmd, python_shell=False) try: ret = salt.utils.json.loads(out) diff --git a/salt/modules/saltutil.py b/salt/modules/saltutil.py index 57b18d007f9..fbbda03d89a 100644 --- a/salt/modules/saltutil.py +++ b/salt/modules/saltutil.py @@ -84,9 +84,7 @@ def _get_top_file_envs(): else: envs = "base" except SaltRenderError as exc: - raise CommandExecutionError( - "Unable to render top file(s): {}".format(exc) - ) + raise CommandExecutionError(f"Unable to render top file(s): {exc}") __context__["saltutil._top_file_envs"] = envs return envs @@ -162,7 +160,7 @@ def update(version=None): try: version = app.find_update() except urllib.error.URLError as exc: - ret["_error"] = "Could not connect to update_url. Error: {}".format(exc) + ret["_error"] = f"Could not connect to update_url. Error: {exc}" return ret if not version: ret["_error"] = "No updates available" @@ -170,21 +168,21 @@ def update(version=None): try: app.fetch_version(version) except EskyVersionError as exc: - ret["_error"] = "Unable to fetch version {}. Error: {}".format(version, exc) + ret["_error"] = f"Unable to fetch version {version}. Error: {exc}" return ret try: app.install_version(version) except EskyVersionError as exc: - ret["_error"] = "Unable to install version {}. Error: {}".format(version, exc) + ret["_error"] = f"Unable to install version {version}. Error: {exc}" return ret try: app.cleanup() except Exception as exc: # pylint: disable=broad-except - ret["_error"] = "Unable to cleanup. Error: {}".format(exc) + ret["_error"] = f"Unable to cleanup. Error: {exc}" restarted = {} for service in __opts__["update_restart_services"]: restarted[service] = __salt__["service.restart"](service) - ret["comment"] = "Updated from {} to {}".format(oldversion, version) + ret["comment"] = f"Updated from {oldversion} to {version}" ret["restarted"] = restarted return ret @@ -1400,7 +1398,7 @@ def find_cached_job(jid): " enable cache_jobs on this minion" ) else: - return "Local jobs cache directory {} not found".format(job_dir) + return f"Local jobs cache directory {job_dir} not found" path = os.path.join(job_dir, "return.p") with salt.utils.files.fopen(path, "rb") as fp_: buf = fp_.read() @@ -1602,7 +1600,7 @@ def _exec( kwarg, batch=False, subset=False, - **kwargs + **kwargs, ): fcn_ret = {} seen = 0 @@ -1660,7 +1658,7 @@ def cmd( ret="", kwarg=None, ssh=False, - **kwargs + **kwargs, ): """ .. versionchanged:: 2017.7.0 @@ -1681,7 +1679,7 @@ def cmd( # if return is empty, we may have not used the right conf, # try with the 'minion relative master configuration counter part # if available - master_cfgfile = "{}master".format(cfgfile[:-6]) # remove 'minion' + master_cfgfile = f"{cfgfile[:-6]}master" # remove 'minion' if ( not fcn_ret and cfgfile.endswith("{}{}".format(os.path.sep, "minion")) @@ -1704,7 +1702,7 @@ def cmd_iter( ret="", kwarg=None, ssh=False, - **kwargs + **kwargs, ): """ .. versionchanged:: 2017.7.0 diff --git a/salt/modules/schedule.py b/salt/modules/schedule.py index 1fab2038924..42458fb1c25 100644 --- a/salt/modules/schedule.py +++ b/salt/modules/schedule.py @@ -259,14 +259,12 @@ def purge(**kwargs): if "test" in kwargs and kwargs["test"]: ret["result"] = True - ret["comment"].append( - "Job: {} would be deleted from schedule.".format(name) - ) + ret["comment"].append(f"Job: {name} would be deleted from schedule.") else: if kwargs.get("offline"): del current_schedule[name] - ret["comment"].append("Deleted job: {} from schedule.".format(name)) + ret["comment"].append(f"Deleted job: {name} from schedule.") ret["changes"][name] = "removed" else: @@ -290,7 +288,7 @@ def purge(**kwargs): ret["result"] = True ret["changes"][name] = "removed" ret["comment"].append( - "Deleted job: {} from schedule.".format(name) + f"Deleted job: {name} from schedule." ) else: ret["comment"].append( @@ -341,7 +339,7 @@ def delete(name, **kwargs): """ ret = { - "comment": "Failed to delete job {} from schedule.".format(name), + "comment": f"Failed to delete job {name} from schedule.", "result": False, "changes": {}, } @@ -350,7 +348,7 @@ def delete(name, **kwargs): ret["comment"] = "Job name is required." if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Job: {} would be deleted from schedule.".format(name) + ret["comment"] = f"Job: {name} would be deleted from schedule." ret["result"] = True else: if kwargs.get("offline"): @@ -379,7 +377,7 @@ def delete(name, **kwargs): ) ret["result"] = True - ret["comment"] = "Deleted Job {} from schedule.".format(name) + ret["comment"] = f"Deleted Job {name} from schedule." ret["changes"][name] = "removed" else: persist = kwargs.get("persist", True) @@ -404,7 +402,7 @@ def delete(name, **kwargs): "persist": False, } else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." return ret try: @@ -588,7 +586,7 @@ def add(name, **kwargs): """ ret = { - "comment": "Failed to add job {} to schedule.".format(name), + "comment": f"Failed to add job {name} to schedule.", "result": False, "changes": {}, } @@ -597,7 +595,7 @@ def add(name, **kwargs): ) if name in current_schedule: - ret["comment"] = "Job {} already exists in schedule.".format(name) + ret["comment"] = f"Job {name} already exists in schedule." ret["result"] = False return ret @@ -633,7 +631,7 @@ def add(name, **kwargs): schedule_data[name] = _new if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Job: {} would be added to schedule.".format(name) + ret["comment"] = f"Job: {name} would be added to schedule." ret["result"] = True else: if kwargs.get("offline"): @@ -655,7 +653,7 @@ def add(name, **kwargs): ) ret["result"] = True - ret["comment"] = "Added job: {} to schedule.".format(name) + ret["comment"] = f"Added job: {name} to schedule." ret["changes"][name] = "added" else: try: @@ -732,7 +730,7 @@ def modify(name, **kwargs): ) if name not in current_schedule: - ret["comment"] = "Job {} does not exist in schedule.".format(name) + ret["comment"] = f"Job {name} does not exist in schedule." ret["result"] = False return ret @@ -755,7 +753,7 @@ def modify(name, **kwargs): return _new if _new == _current: - ret["comment"] = "Job {} in correct state".format(name) + ret["comment"] = f"Job {name} in correct state" return ret ret["changes"][name] = { @@ -764,7 +762,7 @@ def modify(name, **kwargs): } if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Job: {} would be modified in schedule.".format(name) + ret["comment"] = f"Job: {name} would be modified in schedule." else: if kwargs.get("offline"): current_schedule[name].update(_new) @@ -785,7 +783,7 @@ def modify(name, **kwargs): ) ret["result"] = True - ret["comment"] = "Modified job: {} in schedule.".format(name) + ret["comment"] = f"Modified job: {name} in schedule." else: persist = kwargs.get("persist", True) @@ -807,9 +805,9 @@ def modify(name, **kwargs): out = __salt__["event.fire"](event_data, "manage_schedule") if out: - ret["comment"] = "Modified job: {} in schedule.".format(name) + ret["comment"] = f"Modified job: {name} in schedule." else: - ret["comment"] = "Failed to modify job {} in schedule.".format(name) + ret["comment"] = f"Failed to modify job {name} in schedule." ret["result"] = False return ret @@ -838,18 +836,18 @@ def run_job(name, force=False): if name in schedule: data = schedule[name] if "enabled" in data and not data["enabled"] and not force: - ret["comment"] = "Job {} is disabled.".format(name) + ret["comment"] = f"Job {name} is disabled." else: out = __salt__["event.fire"]( {"name": name, "func": "run_job"}, "manage_schedule" ) if out: - ret["comment"] = "Scheduling Job {} on minion.".format(name) + ret["comment"] = f"Scheduling Job {name} on minion." else: - ret["comment"] = "Failed to run job {} on minion.".format(name) + ret["comment"] = f"Failed to run job {name} on minion." ret["result"] = False else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret @@ -872,7 +870,7 @@ def enable_job(name, **kwargs): ret["result"] = False if "test" in __opts__ and __opts__["test"]: - ret["comment"] = "Job: {} would be enabled in schedule.".format(name) + ret["comment"] = f"Job: {name} would be enabled in schedule." else: persist = kwargs.get("persist", True) @@ -886,7 +884,7 @@ def enable_job(name, **kwargs): "persist": False, } else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret @@ -903,13 +901,11 @@ def enable_job(name, **kwargs): # check item exists in schedule and is enabled if name in schedule and schedule[name]["enabled"]: ret["result"] = True - ret["comment"] = "Enabled Job {} in schedule.".format(name) + ret["comment"] = f"Enabled Job {name} in schedule." ret["changes"][name] = "enabled" else: ret["result"] = False - ret["comment"] = ( - "Failed to enable job {} in schedule.".format(name) - ) + ret["comment"] = f"Failed to enable job {name} in schedule." return ret except KeyError: # Effectively a no-op, since we can't really return without an event system @@ -935,7 +931,7 @@ def disable_job(name, **kwargs): ret["result"] = False if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Job: {} would be disabled in schedule.".format(name) + ret["comment"] = f"Job: {name} would be disabled in schedule." else: persist = kwargs.get("persist", True) @@ -949,7 +945,7 @@ def disable_job(name, **kwargs): "persist": False, } else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret @@ -966,12 +962,12 @@ def disable_job(name, **kwargs): # check item exists in schedule and is enabled if name in schedule and not schedule[name]["enabled"]: ret["result"] = True - ret["comment"] = "Disabled Job {} in schedule.".format(name) + ret["comment"] = f"Disabled Job {name} in schedule." ret["changes"][name] = "disabled" else: ret["result"] = False ret["comment"] = ( - "Failed to disable job {} in schedule.".format(name) + f"Failed to disable job {name} in schedule." ) return ret except KeyError: @@ -1137,9 +1133,7 @@ def reload_(): try: schedule = salt.utils.yaml.safe_load(fp_) except salt.utils.yaml.YAMLError as exc: - ret["comment"].append( - "Unable to read existing schedule file: {}".format(exc) - ) + ret["comment"].append(f"Unable to read existing schedule file: {exc}") if schedule: if "schedule" in schedule and schedule["schedule"]: @@ -1187,7 +1181,7 @@ def move(name, target, **kwargs): ret["result"] = False if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Job: {} would be moved from schedule.".format(name) + ret["comment"] = f"Job: {name} would be moved from schedule." else: opts_schedule = list_(show_all=True, where="opts", return_yaml=False) pillar_schedule = list_(show_all=True, where="pillar", return_yaml=False) @@ -1199,13 +1193,13 @@ def move(name, target, **kwargs): schedule_data = pillar_schedule[name] where = "pillar" else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret schedule_opts = [] for key, value in schedule_data.items(): - temp = "{}={}".format(key, value) + temp = f"{key}={value}" schedule_opts.append(temp) response = __salt__["publish.publish"](target, "schedule.add", schedule_opts) @@ -1228,7 +1222,7 @@ def move(name, target, **kwargs): else: delete(name, where=where) ret["result"] = True - ret["comment"] = "Moved Job {} from schedule.".format(name) + ret["comment"] = f"Moved Job {name} from schedule." ret["minions"] = minions return ret return ret @@ -1252,7 +1246,7 @@ def copy(name, target, **kwargs): ret["result"] = False if "test" in kwargs and kwargs["test"]: - ret["comment"] = "Job: {} would be copied from schedule.".format(name) + ret["comment"] = f"Job: {name} would be copied from schedule." else: opts_schedule = list_(show_all=True, where="opts", return_yaml=False) pillar_schedule = list_(show_all=True, where="pillar", return_yaml=False) @@ -1262,13 +1256,13 @@ def copy(name, target, **kwargs): elif name in pillar_schedule: schedule_data = pillar_schedule[name] else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret schedule_opts = [] for key, value in schedule_data.items(): - temp = "{}={}".format(key, value) + temp = f"{key}={value}" schedule_opts.append(temp) response = __salt__["publish.publish"](target, "schedule.add", schedule_opts) @@ -1290,7 +1284,7 @@ def copy(name, target, **kwargs): return ret else: ret["result"] = True - ret["comment"] = "Copied Job {} from schedule to minion(s).".format(name) + ret["comment"] = f"Copied Job {name} from schedule to minion(s)." ret["minions"] = minions return ret return ret @@ -1353,7 +1347,7 @@ def postpone_job(name, current_time, new_time, **kwargs): return ret if "test" in __opts__ and __opts__["test"]: - ret["comment"] = "Job: {} would be postponed in schedule.".format(name) + ret["comment"] = f"Job: {name} would be postponed in schedule." else: if name in list_(show_all=True, where="opts", return_yaml=False): @@ -1374,7 +1368,7 @@ def postpone_job(name, current_time, new_time, **kwargs): "func": "postpone_job", } else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret @@ -1397,7 +1391,7 @@ def postpone_job(name, current_time, new_time, **kwargs): else: ret["result"] = False ret["comment"] = ( - "Failed to postpone job {} in schedule.".format(name) + f"Failed to postpone job {name} in schedule." ) return ret except KeyError: @@ -1444,7 +1438,7 @@ def skip_job(name, current_time, **kwargs): return ret if "test" in __opts__ and __opts__["test"]: - ret["comment"] = "Job: {} would be skipped in schedule.".format(name) + ret["comment"] = f"Job: {name} would be skipped in schedule." else: if name in list_(show_all=True, where="opts", return_yaml=False): @@ -1463,7 +1457,7 @@ def skip_job(name, current_time, **kwargs): "func": "skip_job", } else: - ret["comment"] = "Job {} does not exist.".format(name) + ret["comment"] = f"Job {name} does not exist." ret["result"] = False return ret @@ -1485,9 +1479,7 @@ def skip_job(name, current_time, **kwargs): ) else: ret["result"] = False - ret["comment"] = ( - "Failed to skip job {} in schedule.".format(name) - ) + ret["comment"] = f"Failed to skip job {name} in schedule." return ret except KeyError: # Effectively a no-op, since we can't really return without an event system diff --git a/salt/modules/scsi.py b/salt/modules/scsi.py index e405865806a..83a3e8b169d 100644 --- a/salt/modules/scsi.py +++ b/salt/modules/scsi.py @@ -47,7 +47,7 @@ def ls_(get_size=True): __context__["retcode"] = rc error = res.get("stderr", "").split("\n")[0] if error == "lsscsi: invalid option -- 's'": - return "{} - try get_size=False".format(error) + return f"{error} - try get_size=False" return res.get("stderr", "").split("\n")[0] data = res.get("stdout", "") @@ -93,8 +93,8 @@ def rescan_all(host): salt '*' scsi.rescan_all 0 """ - if os.path.isdir("/sys/class/scsi_host/host{}".format(host)): - cmd = 'echo "- - -" > /sys/class/scsi_host/host{}/scan'.format(host) + if os.path.isdir(f"/sys/class/scsi_host/host{host}"): + cmd = f'echo "- - -" > /sys/class/scsi_host/host{host}/scan' else: - return "Host {} does not exist".format(host) + return f"Host {host} does not exist" return __salt__["cmd.run"](cmd).splitlines() diff --git a/salt/modules/seed.py b/salt/modules/seed.py index 9bce998fd38..657c7bccd64 100644 --- a/salt/modules/seed.py +++ b/salt/modules/seed.py @@ -41,7 +41,7 @@ def prep_bootstrap(mpt): """ # Verify that the boostrap script is downloaded bs_ = __salt__["config.gather_bootstrap_script"]() - fpd_ = os.path.join(mpt, "tmp", "{}".format(uuid.uuid4())) + fpd_ = os.path.join(mpt, "tmp", f"{uuid.uuid4()}") if not os.path.exists(fpd_): os.makedirs(fpd_) os.chmod(fpd_, 0o700) @@ -135,7 +135,7 @@ def apply_( """ stats = __salt__["file.stats"](path, follow_symlinks=True) if not stats: - return "{} does not exist".format(path) + return f"{path} does not exist" ftype = stats["type"] path = stats["target"] log.debug("Mounting %s at %s", ftype, path) @@ -148,7 +148,7 @@ def apply_( mpt = _mount(path, ftype, mount_point) if not mpt: - return "{} could not be mounted".format(path) + return f"{path} could not be mounted" tmp = os.path.join(mpt, "tmp") log.debug("Attempting to create directory %s", tmp) @@ -299,6 +299,6 @@ def _check_install(root): sh_ = "/bin/bash" cmd = "if ! type salt-minion; then exit 1; fi" - cmd = "chroot '{}' {} -c '{}'".format(root, sh_, cmd) + cmd = f"chroot '{root}' {sh_} -c '{cmd}'" return not __salt__["cmd.retcode"](cmd, output_loglevel="quiet", python_shell=True) diff --git a/salt/modules/selinux.py b/salt/modules/selinux.py index 71dae99a7a0..da7d0bc3bee 100644 --- a/salt/modules/selinux.py +++ b/salt/modules/selinux.py @@ -142,14 +142,14 @@ def setenforce(mode): mode = "0" modestring = "disabled" else: - return "Invalid mode {}".format(mode) + return f"Invalid mode {mode}" elif isinstance(mode, int): if mode: mode = "1" else: mode = "0" else: - return "Invalid mode {}".format(mode) + return f"Invalid mode {mode}" # enforce file does not exist if currently disabled. Only for toggling enforcing/permissive if getenforce() != "Disabled": @@ -203,9 +203,9 @@ def setsebool(boolean, value, persist=False): salt '*' selinux.setsebool virt_use_usb off """ if persist: - cmd = "setsebool -P {} {}".format(boolean, value) + cmd = f"setsebool -P {boolean} {value}" else: - cmd = "setsebool {} {}".format(boolean, value) + cmd = f"setsebool {boolean} {value}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -226,7 +226,7 @@ def setsebools(pairs, persist=False): else: cmd = "setsebool " for boolean, value in pairs.items(): - cmd = "{} {}={}".format(cmd, boolean, value) + cmd = f"{cmd} {boolean}={value}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -283,9 +283,9 @@ def setsemod(module, state): .. versionadded:: 2016.3.0 """ if state.lower() == "enabled": - cmd = "semodule -e {}".format(module) + cmd = f"semodule -e {module}" elif state.lower() == "disabled": - cmd = "semodule -d {}".format(module) + cmd = f"semodule -d {module}" return not __salt__["cmd.retcode"](cmd) @@ -303,7 +303,7 @@ def install_semod(module_path): """ if module_path.find("salt://") == 0: module_path = __salt__["cp.cache_file"](module_path) - cmd = "semodule -i {}".format(module_path) + cmd = f"semodule -i {module_path}" return not __salt__["cmd.retcode"](cmd) @@ -319,7 +319,7 @@ def remove_semod(module): .. versionadded:: 2016.11.6 """ - cmd = "semodule -r {}".format(module) + cmd = f"semodule -r {module}" return not __salt__["cmd.retcode"](cmd) @@ -375,7 +375,7 @@ def _validate_filetype(filetype): specification. Throws an SaltInvocationError if it isn't. """ if filetype not in _SELINUX_FILETYPES: - raise SaltInvocationError("Invalid filetype given: {}".format(filetype)) + raise SaltInvocationError(f"Invalid filetype given: {filetype}") return True @@ -393,7 +393,7 @@ def _parse_protocol_port(name, protocol, port): protocol_port_pattern = r"^(tcp|udp)\/(([\d]+)\-?[\d]+)$" name_parts = re.match(protocol_port_pattern, name) if not name_parts: - name_parts = re.match(protocol_port_pattern, "{}/{}".format(protocol, port)) + name_parts = re.match(protocol_port_pattern, f"{protocol}/{port}") if not name_parts: raise SaltInvocationError( 'Invalid name "{}" format and protocol and port not provided or invalid:' @@ -851,15 +851,15 @@ def _port_add_or_delete_policy( """ if action not in ["add", "delete"]: raise SaltInvocationError( - 'Actions supported are "add" and "delete", not "{}".'.format(action) + f'Actions supported are "add" and "delete", not "{action}".' ) if action == "add" and not sel_type: raise SaltInvocationError("SELinux Type is required to add a policy") (protocol, port) = _parse_protocol_port(name, protocol, port) - cmd = "semanage port --{} --proto {}".format(action, protocol) + cmd = f"semanage port --{action} --proto {protocol}" if sel_type: - cmd += " --type {}".format(sel_type) + cmd += f" --type {sel_type}" if sel_range: - cmd += " --range {}".format(sel_range) - cmd += " {}".format(port) + cmd += f" --range {sel_range}" + cmd += f" {port}" return __salt__["cmd.run_all"](cmd) diff --git a/salt/modules/sensors.py b/salt/modules/sensors.py index b96c3a32a4c..53b1970bf8f 100644 --- a/salt/modules/sensors.py +++ b/salt/modules/sensors.py @@ -42,7 +42,7 @@ def sense(chip, fahrenheit=False): if fahrenheit is True: extra_args = "-f" sensors = __salt__["cmd.run"]( - "/usr/bin/sensors {} {}".format(chip, extra_args), python_shell=False + f"/usr/bin/sensors {chip} {extra_args}", python_shell=False ).splitlines() ret = {} for sensor in sensors: diff --git a/salt/modules/serverdensity_device.py b/salt/modules/serverdensity_device.py index 23c228ea706..741e2c52b68 100644 --- a/salt/modules/serverdensity_device.py +++ b/salt/modules/serverdensity_device.py @@ -48,14 +48,14 @@ def get_sd_auth(val, sd_auth_pillar_name="serverdensity"): if not sd_pillar: log.error("Could not load %s pillar", sd_auth_pillar_name) raise CommandExecutionError( - "{} pillar is required for authentication".format(sd_auth_pillar_name) + f"{sd_auth_pillar_name} pillar is required for authentication" ) try: return sd_pillar[val] except KeyError: log.error("Could not find value %s in pillar", val) - raise CommandExecutionError("{} value was not found in pillar".format(val)) + raise CommandExecutionError(f"{val} value was not found in pillar") def _clean_salt_variables(params, variable_prefix="__"): @@ -98,7 +98,7 @@ def create(name, **params): except ValueError: log.error("Could not parse API Response content: %s", api_response.content) raise CommandExecutionError( - "Failed to create, API Response: {}".format(api_response) + f"Failed to create, API Response: {api_response}" ) else: return None @@ -130,7 +130,7 @@ def delete(device_id): except ValueError: log.error("Could not parse API Response content: %s", api_response.content) raise CommandExecutionError( - "Failed to create, API Response: {}".format(api_response) + f"Failed to create, API Response: {api_response}" ) else: return None @@ -167,7 +167,7 @@ def ls(**params): params[key] = str(val) api_response = requests.get( - "https://api.serverdensity.io/inventory/{}".format(endpoint), + f"https://api.serverdensity.io/inventory/{endpoint}", params={ "token": get_sd_auth("api_token"), "filter": salt.utils.json.dumps(params), @@ -185,7 +185,7 @@ def ls(**params): api_response.content, ) raise CommandExecutionError( - "Failed to create, Server Density API Response: {}".format(api_response) + f"Failed to create, Server Density API Response: {api_response}" ) else: return None @@ -224,7 +224,7 @@ def update(device_id, **params): api_response.content, ) raise CommandExecutionError( - "Failed to create, API Response: {}".format(api_response) + f"Failed to create, API Response: {api_response}" ) else: return None @@ -258,10 +258,8 @@ def install_agent(agent_key, agent_version=1): account = get_sd_auth(account_field) - __salt__["cmd.run"]( - cmd="curl -L {} -o {}".format(url, install_filename), cwd=work_dir - ) - __salt__["cmd.run"](cmd="chmod +x {}".format(install_filename), cwd=work_dir) + __salt__["cmd.run"](cmd=f"curl -L {url} -o {install_filename}", cwd=work_dir) + __salt__["cmd.run"](cmd=f"chmod +x {install_filename}", cwd=work_dir) return __salt__["cmd.run"]( cmd="{filename} -a {account} -k {agent_key}".format( diff --git a/salt/modules/servicenow.py b/salt/modules/servicenow.py index 5ac48ee72c6..04cff9cb6b6 100644 --- a/salt/modules/servicenow.py +++ b/salt/modules/servicenow.py @@ -137,7 +137,7 @@ def non_structured_query(table, query=None, **kwargs): # try and assemble a query by keyword query_parts = [] for key, value in kwargs.items(): - query_parts.append("{}={}".format(key, value)) + query_parts.append(f"{key}={value}") query = "^".join(query_parts) query = str(query) response = client.get(query) diff --git a/salt/modules/slack_notify.py b/salt/modules/slack_notify.py index 9ac29929bd6..b82367176e8 100644 --- a/salt/modules/slack_notify.py +++ b/salt/modules/slack_notify.py @@ -204,7 +204,7 @@ def post_message( channel, channel, ) - channel = "#{}".format(channel) + channel = f"#{channel}" if not from_name: log.error("from_name is a required option.") diff --git a/salt/modules/slackware_service.py b/salt/modules/slackware_service.py index 54bc3c2a77f..67948539d38 100644 --- a/salt/modules/slackware_service.py +++ b/salt/modules/slackware_service.py @@ -46,7 +46,7 @@ def start(name): salt '*' service.start """ - cmd = "/bin/sh {}.{} start".format(prefix, name) + cmd = f"/bin/sh {prefix}.{name} start" return not __salt__["cmd.retcode"](cmd) @@ -62,7 +62,7 @@ def stop(name): salt '*' service.stop """ - cmd = "/bin/sh {}.{} stop".format(prefix, name) + cmd = f"/bin/sh {prefix}.{name} stop" return not __salt__["cmd.retcode"](cmd) @@ -78,7 +78,7 @@ def restart(name): salt '*' service.restart """ - cmd = "/bin/sh {}.{} restart".format(prefix, name) + cmd = f"/bin/sh {prefix}.{name} restart" return not __salt__["cmd.retcode"](cmd) @@ -94,7 +94,7 @@ def reload_(name): salt '*' service.reload """ - cmd = "/bin/sh {}.{} reload".format(prefix, name) + cmd = f"/bin/sh {prefix}.{name} reload" return not __salt__["cmd.retcode"](cmd) @@ -110,7 +110,7 @@ def force_reload(name): salt '*' service.force_reload """ - cmd = "/bin/sh {}.{} forcereload".format(prefix, name) + cmd = f"/bin/sh {prefix}.{name} forcereload" return not __salt__["cmd.retcode"](cmd) @@ -146,7 +146,7 @@ def status(name, sig=None): services = [name] results = {} for service in services: - cmd = "/bin/sh {}.{} status".format(prefix, service) + cmd = f"/bin/sh {prefix}.{service} status" results[service] = not __salt__["cmd.retcode"](cmd, ignore_retcode=True) if contains_globbing: return results @@ -179,7 +179,7 @@ def _get_svc_list(service_status): ) ) ret = set() - lines = glob.glob("{}.*".format(prefix)) + lines = glob.glob(f"{prefix}.*") for line in lines: if not notservice.match(line): svc = _get_svc(line, service_status) @@ -328,7 +328,7 @@ def enabled(name, **kwargs): salt '*' service.enabled """ ret = True - if _get_svc("{}.{}".format(prefix, name), "ON") is None: + if _get_svc(f"{prefix}.{name}", "ON") is None: ret = False return ret @@ -346,6 +346,6 @@ def disabled(name): salt '*' service.disabled """ ret = True - if _get_svc("{}.{}".format(prefix, name), "OFF") is None: + if _get_svc(f"{prefix}.{name}", "OFF") is None: ret = False return ret diff --git a/salt/modules/slsutil.py b/salt/modules/slsutil.py index df78b727f79..cf8afa76c37 100644 --- a/salt/modules/slsutil.py +++ b/salt/modules/slsutil.py @@ -181,7 +181,7 @@ def renderer(path=None, string=None, default_renderer="jinja|yaml", **kwargs): default_renderer, __opts__["renderer_blacklist"], __opts__["renderer_whitelist"], - **kwargs + **kwargs, ) return ret.read() if __utils__["stringio.is_readable"](ret) else ret @@ -193,12 +193,12 @@ def _get_serialize_fn(serializer, fn_name): if not fns: raise salt.exceptions.CommandExecutionError( - "Serializer '{}' not found.".format(serializer) + f"Serializer '{serializer}' not found." ) if not fn: raise salt.exceptions.CommandExecutionError( - "Serializer '{}' does not implement {}.".format(serializer, fn_name) + f"Serializer '{serializer}' does not implement {fn_name}." ) return fn @@ -570,7 +570,7 @@ def findup(startpath, filenames, saltenv="base"): # Verify the cwd is a valid path in the state tree if startpath and not path_exists(startpath, saltenv): raise salt.exceptions.SaltInvocationError( - "Starting path not found in the state tree: {}".format(startpath) + f"Starting path not found in the state tree: {startpath}" ) # Ensure that patterns is a string or list of strings diff --git a/salt/modules/smartos_imgadm.py b/salt/modules/smartos_imgadm.py index cfa74f055bc..8fe64d34830 100644 --- a/salt/modules/smartos_imgadm.py +++ b/salt/modules/smartos_imgadm.py @@ -29,7 +29,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded on SmartOS compute nodes".format(__virtualname__), + f"{__virtualname__} module can only be loaded on SmartOS compute nodes", ) @@ -73,7 +73,7 @@ def _parse_image_meta(image=None, detail=False): docker_repo = image["manifest"]["tags"][tag] if docker_repo and docker_tag: - name = "{}:{}".format(docker_repo, docker_tag) + name = f"{docker_repo}:{docker_tag}" description = ( "Docker image imported from {repo}:{tag} on {date}.".format( repo=docker_repo, @@ -186,7 +186,7 @@ def update_installed(uuid=""): salt '*' imgadm.update [uuid] """ - cmd = "imgadm update {}".format(uuid).rstrip() + cmd = f"imgadm update {uuid}".rstrip() __salt__["cmd.run"](cmd) return {} @@ -282,7 +282,7 @@ def show(uuid): ret = {} if _is_uuid(uuid) or _is_docker_uuid(uuid): - cmd = "imgadm show {}".format(uuid) + cmd = f"imgadm show {uuid}" res = __salt__["cmd.run_all"](cmd, python_shell=False) retcode = res["retcode"] if retcode != 0: @@ -290,7 +290,7 @@ def show(uuid): else: ret = salt.utils.json.loads(res["stdout"]) else: - ret["Error"] = "{} is not a valid uuid.".format(uuid) + ret["Error"] = f"{uuid} is not a valid uuid." return ret @@ -315,7 +315,7 @@ def get(uuid): uuid = docker_to_uuid(uuid) if _is_uuid(uuid): - cmd = "imgadm get {}".format(uuid) + cmd = f"imgadm get {uuid}" res = __salt__["cmd.run_all"](cmd, python_shell=False) retcode = res["retcode"] if retcode != 0: @@ -323,7 +323,7 @@ def get(uuid): else: ret = salt.utils.json.loads(res["stdout"]) else: - ret["Error"] = "{} is not a valid uuid.".format(uuid) + ret["Error"] = f"{uuid} is not a valid uuid." return ret @@ -344,7 +344,7 @@ def import_image(uuid, verbose=False): salt '*' imgadm.import e42f8c84-bbea-11e2-b920-078fab2aab1f [verbose=True] """ ret = {} - cmd = "imgadm import {}".format(uuid) + cmd = f"imgadm import {uuid}" res = __salt__["cmd.run_all"](cmd, python_shell=False) retcode = res["retcode"] if retcode != 0: @@ -370,7 +370,7 @@ def delete(uuid): salt '*' imgadm.delete e42f8c84-bbea-11e2-b920-078fab2aab1f """ ret = {} - cmd = "imgadm delete {}".format(uuid) + cmd = f"imgadm delete {uuid}" res = __salt__["cmd.run_all"](cmd, python_shell=False) retcode = res["retcode"] if retcode != 0: @@ -468,7 +468,7 @@ def source_delete(source): salt '*' imgadm.source_delete https://updates.joyent.com """ ret = {} - cmd = "imgadm sources -d {}".format(source) + cmd = f"imgadm sources -d {source}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -503,7 +503,7 @@ def source_add(source, source_type="imgapi"): if source_type not in ["imgapi", "docker"]: log.warning("Possible unsupported imgage source type specified!") - cmd = "imgadm sources -a {} -t {}".format(source, source_type) + cmd = f"imgadm sources -a {source} -t {source_type}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: diff --git a/salt/modules/smartos_nictagadm.py b/salt/modules/smartos_nictagadm.py index 9112b44efa9..fb67c9602b3 100644 --- a/salt/modules/smartos_nictagadm.py +++ b/salt/modules/smartos_nictagadm.py @@ -35,7 +35,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded on SmartOS compute nodes".format(__virtualname__), + f"{__virtualname__} module can only be loaded on SmartOS compute nodes", ) @@ -86,7 +86,7 @@ def vms(nictag): salt '*' nictagadm.vms admin """ ret = {} - cmd = "nictagadm vms {}".format(nictag) + cmd = f"nictagadm vms {nictag}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -157,13 +157,13 @@ def add(name, mac, mtu=1500): res = __salt__["cmd.run_all"](cmd) # dladm prints '00' as '0', so account for that. if mac.replace("00", "0") not in res["stdout"].splitlines(): - return {"Error": "{} is not present on this system.".format(mac)} + return {"Error": f"{mac} is not present on this system."} if mac == "etherstub": - cmd = "nictagadm add -l {}".format(name) + cmd = f"nictagadm add -l {name}" res = __salt__["cmd.run_all"](cmd) else: - cmd = "nictagadm add -p mtu={},mac={} {}".format(mtu, mac, name) + cmd = f"nictagadm add -p mtu={mtu},mac={mac} {name}" res = __salt__["cmd.run_all"](cmd) if res["retcode"] == 0: @@ -198,7 +198,7 @@ def update(name, mac=None, mtu=None): ret = {} if name not in list_nictags(): - return {"Error": "nictag {} does not exists.".format(name)} + return {"Error": f"nictag {name} does not exists."} if not mtu and not mac: return {"Error": "please provide either mac or/and mtu."} if mtu: @@ -212,16 +212,16 @@ def update(name, mac=None, mtu=None): res = __salt__["cmd.run_all"](cmd) # dladm prints '00' as '0', so account for that. if mac.replace("00", "0") not in res["stdout"].splitlines(): - return {"Error": "{} is not present on this system.".format(mac)} + return {"Error": f"{mac} is not present on this system."} if mac and mtu: - properties = "mtu={},mac={}".format(mtu, mac) + properties = f"mtu={mtu},mac={mac}" elif mac: - properties = "mac={}".format(mac) if mac else "" + properties = f"mac={mac}" if mac else "" elif mtu: - properties = "mtu={}".format(mtu) if mtu else "" + properties = f"mtu={mtu}" if mtu else "" - cmd = "nictagadm update -p {} {}".format(properties, name) + cmd = f"nictagadm update -p {properties} {name}" res = __salt__["cmd.run_all"](cmd) if res["retcode"] == 0: diff --git a/salt/modules/smartos_virt.py b/salt/modules/smartos_virt.py index 2f29fcefd5f..54aa8841822 100644 --- a/salt/modules/smartos_virt.py +++ b/salt/modules/smartos_virt.py @@ -22,7 +22,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded on SmartOS compute nodes".format(__virtualname__), + f"{__virtualname__} module can only be loaded on SmartOS compute nodes", ) @@ -185,9 +185,7 @@ def vm_virt_type(domain): salt '*' virt.vm_virt_type """ - ret = __salt__["vmadm.lookup"]( - search="uuid={uuid}".format(uuid=domain), order="type" - ) + ret = __salt__["vmadm.lookup"](search=f"uuid={domain}", order="type") if not ret: raise CommandExecutionError("We can't determine the type of this VM") @@ -232,9 +230,7 @@ def get_macs(domain): salt '*' virt.get_macs """ macs = [] - ret = __salt__["vmadm.lookup"]( - search="uuid={uuid}".format(uuid=domain), order="nics" - ) + ret = __salt__["vmadm.lookup"](search=f"uuid={domain}", order="nics") if not ret: raise CommandExecutionError("We can't find the MAC address of this VM") else: diff --git a/salt/modules/smartos_vmadm.py b/salt/modules/smartos_vmadm.py index 308d41d0294..5a88d1bacfc 100644 --- a/salt/modules/smartos_vmadm.py +++ b/salt/modules/smartos_vmadm.py @@ -35,7 +35,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded on SmartOS compute nodes".format(__virtualname__), + f"{__virtualname__} module can only be loaded on SmartOS compute nodes", ) @@ -57,7 +57,7 @@ def _create_update_from_file(mode="create", uuid=None, path=None): """ ret = {} if not os.path.isfile(path) or path is None: - ret["Error"] = "File ({}) does not exists!".format(path) + ret["Error"] = f"File ({path}) does not exists!" return ret # vmadm validate create|update [-f ] cmd = "vmadm validate {mode} {brand} -f {path}".format( @@ -171,7 +171,7 @@ def start(vm, options=None, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm start [option=value ...] @@ -210,7 +210,7 @@ def stop(vm, force=False, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm stop [-F] @@ -247,7 +247,7 @@ def reboot(vm, force=False, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm reboot [-F] @@ -286,8 +286,8 @@ def list_vms(search=None, sort=None, order="uuid,type,ram,state,alias", keyed=Tr ret = {} # vmadm list [-p] [-H] [-o field,...] [-s field,...] [field=value ...] cmd = "vmadm list -p -H {order} {sort} {search}".format( - order="-o {}".format(order) if order else "", - sort="-s {}".format(sort) if sort else "", + order=f"-o {order}" if order else "", + sort=f"-s {sort}" if sort else "", search=search if search else "", ) res = __salt__["cmd.run_all"](cmd) @@ -341,7 +341,7 @@ def lookup(search=None, order=None, one=False): # vmadm lookup [-j|-1] [-o field,...] [field=value ...] cmd = "vmadm lookup {one} {order} {search}".format( one="-1" if one else "-j", - order="-o {}".format(order) if order else "", + order=f"-o {order}" if order else "", search=search if search else "", ) res = __salt__["cmd.run_all"](cmd) @@ -386,11 +386,11 @@ def sysrq(vm, action="nmi", key="uuid"): if action not in ["nmi", "screenshot"]: ret["Error"] = "Action must be either nmi or screenshot" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm sysrq - cmd = "vmadm sysrq {uuid} {action}".format(uuid=vm, action=action) + cmd = f"vmadm sysrq {vm} {action}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -419,11 +419,11 @@ def delete(vm, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm delete - cmd = "vmadm delete {}".format(vm) + cmd = f"vmadm delete {vm}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -452,11 +452,11 @@ def get(vm, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm get - cmd = "vmadm get {}".format(vm) + cmd = f"vmadm get {vm}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -503,11 +503,11 @@ def info(vm, info_type="all", key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm info [type,...] - cmd = "vmadm info {uuid} {type}".format(uuid=vm, type=info_type) + cmd = f"vmadm info {vm} {info_type}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -541,7 +541,7 @@ def create_snapshot(vm, name, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm vmobj = get(vm) @@ -555,7 +555,7 @@ def create_snapshot(vm, name, key="uuid"): ret["Error"] = "VM must be running to take a snapshot" return ret # vmadm create-snapshot - cmd = "vmadm create-snapshot {uuid} {snapshot}".format(snapshot=name, uuid=vm) + cmd = f"vmadm create-snapshot {vm} {name}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -589,7 +589,7 @@ def delete_snapshot(vm, name, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm vmobj = get(vm) @@ -600,7 +600,7 @@ def delete_snapshot(vm, name, key="uuid"): ret["Error"] = "VM must be of type OS" return ret # vmadm delete-snapshot - cmd = "vmadm delete-snapshot {uuid} {snapshot}".format(snapshot=name, uuid=vm) + cmd = f"vmadm delete-snapshot {vm} {name}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -634,7 +634,7 @@ def rollback_snapshot(vm, name, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm vmobj = get(vm) @@ -645,7 +645,7 @@ def rollback_snapshot(vm, name, key="uuid"): ret["Error"] = "VM must be of type OS" return ret # vmadm rollback-snapshot - cmd = "vmadm rollback-snapshot {uuid} {snapshot}".format(snapshot=name, uuid=vm) + cmd = f"vmadm rollback-snapshot {vm} {name}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] if retcode != 0: @@ -676,11 +676,11 @@ def reprovision(vm, image, key="uuid"): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm if image not in __salt__["imgadm.list"](): - ret["Error"] = "Image ({}) is not present on this host".format(image) + ret["Error"] = f"Image ({image}) is not present on this host" return ret # vmadm reprovision [-f ] cmd = "echo {image} | vmadm reprovision {uuid}".format( @@ -755,7 +755,7 @@ def update(vm, from_file=None, key="uuid", **kwargs): if key not in ["uuid", "alias", "hostname"]: ret["Error"] = "Key must be either uuid, alias or hostname" return ret - uuid = lookup("{}={}".format(key, vm), one=True) + uuid = lookup(f"{key}={vm}", one=True) if "Error" in uuid: return uuid @@ -790,12 +790,12 @@ def send(vm, target, key="uuid"): if not os.path.isdir(target): ret["Error"] = "Target must be a directory or host" return ret - vm = lookup("{}={}".format(key, vm), one=True) + vm = lookup(f"{key}={vm}", one=True) if "Error" in vm: return vm # vmadm send [target] cmd = "vmadm send {uuid} > {target}".format( - uuid=vm, target=os.path.join(target, "{}.vmdata".format(vm)) + uuid=vm, target=os.path.join(target, f"{vm}.vmdata") ) res = __salt__["cmd.run_all"](cmd, python_shell=True) retcode = res["retcode"] @@ -812,7 +812,7 @@ def send(vm, target, key="uuid"): name = name[-1] cmd = "zfs send {dataset} > {target}".format( dataset=dataset, - target=os.path.join(target, "{}-{}.zfsds".format(vm, name)), + target=os.path.join(target, f"{vm}-{name}.zfsds"), ) res = __salt__["cmd.run_all"](cmd, python_shell=True) retcode = res["retcode"] @@ -841,12 +841,12 @@ def receive(uuid, source): if not os.path.isdir(source): ret["Error"] = "Source must be a directory or host" return ret - if not os.path.exists(os.path.join(source, "{}.vmdata".format(uuid))): - ret["Error"] = "Unknow vm with uuid in {}".format(source) + if not os.path.exists(os.path.join(source, f"{uuid}.vmdata")): + ret["Error"] = f"Unknow vm with uuid in {source}" return ret # vmadm receive cmd = "vmadm receive < {source}".format( - source=os.path.join(source, "{}.vmdata".format(uuid)) + source=os.path.join(source, f"{uuid}.vmdata") ) res = __salt__["cmd.run_all"](cmd, python_shell=True) retcode = res["retcode"] @@ -863,14 +863,14 @@ def receive(uuid, source): name = name[-1] cmd = "zfs receive {dataset} < {source}".format( dataset=dataset, - source=os.path.join(source, "{}-{}.zfsds".format(uuid, name)), + source=os.path.join(source, f"{uuid}-{name}.zfsds"), ) res = __salt__["cmd.run_all"](cmd, python_shell=True) retcode = res["retcode"] if retcode != 0: ret["Error"] = res["stderr"] if "stderr" in res else _exit_status(retcode) return ret - cmd = "vmadm install {}".format(uuid) + cmd = f"vmadm install {uuid}" res = __salt__["cmd.run_all"](cmd, python_shell=True) retcode = res["retcode"] if retcode != 0 and not res["stderr"].endswith("datasets"): diff --git a/salt/modules/smbios.py b/salt/modules/smbios.py index b27a2aeb2d3..9e6f7192ac0 100644 --- a/salt/modules/smbios.py +++ b/salt/modules/smbios.py @@ -75,7 +75,7 @@ def get(string, clean=True): salt '*' smbios.get system-uuid clean=False """ - val = _dmidecoder("-s {}".format(string)).strip() + val = _dmidecoder(f"-s {string}").strip() # Cleanup possible comments in strings. val = "\n".join([v for v in val.split("\n") if not v.startswith("#")]) @@ -158,7 +158,7 @@ def records(rec_type=None, fields=None, clean=True): if rec_type is None: smbios = _dmi_parse(_dmidecoder(), clean, fields) else: - smbios = _dmi_parse(_dmidecoder("-t {}".format(rec_type)), clean, fields) + smbios = _dmi_parse(_dmidecoder(f"-t {rec_type}"), clean, fields) return smbios @@ -334,6 +334,6 @@ def _dmidecoder(args=None): if not args: out = salt.modules.cmdmod._run_quiet(dmidecoder) else: - out = salt.modules.cmdmod._run_quiet("{} {}".format(dmidecoder, args)) + out = salt.modules.cmdmod._run_quiet(f"{dmidecoder} {args}") return out diff --git a/salt/modules/smf_service.py b/salt/modules/smf_service.py index f45ba48af75..4314c84c88f 100644 --- a/salt/modules/smf_service.py +++ b/salt/modules/smf_service.py @@ -111,7 +111,7 @@ def available(name): salt '*' service.available net-snmp """ - cmd = "/usr/bin/svcs -H -o FMRI {}".format(name) + cmd = f"/usr/bin/svcs -H -o FMRI {name}" name = __salt__["cmd.run"](cmd, python_shell=False) return name in get_all() @@ -128,7 +128,7 @@ def missing(name): salt '*' service.missing net-snmp """ - cmd = "/usr/bin/svcs -H -o FMRI {}".format(name) + cmd = f"/usr/bin/svcs -H -o FMRI {name}" name = __salt__["cmd.run"](cmd, python_shell=False) return name not in get_all() @@ -164,7 +164,7 @@ def start(name): salt '*' service.start """ - cmd = "/usr/sbin/svcadm enable -s -t {}".format(name) + cmd = f"/usr/sbin/svcadm enable -s -t {name}" retcode = __salt__["cmd.retcode"](cmd, python_shell=False) if not retcode: return True @@ -172,7 +172,7 @@ def start(name): # Return code 3 means there was a problem with the service # A common case is being in the 'maintenance' state # Attempt a clear and try one more time - clear_cmd = "/usr/sbin/svcadm clear {}".format(name) + clear_cmd = f"/usr/sbin/svcadm clear {name}" __salt__["cmd.retcode"](clear_cmd, python_shell=False) return not __salt__["cmd.retcode"](cmd, python_shell=False) return False @@ -188,7 +188,7 @@ def stop(name): salt '*' service.stop """ - cmd = "/usr/sbin/svcadm disable -s -t {}".format(name) + cmd = f"/usr/sbin/svcadm disable -s -t {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -202,7 +202,7 @@ def restart(name): salt '*' service.restart """ - cmd = "/usr/sbin/svcadm restart {}".format(name) + cmd = f"/usr/sbin/svcadm restart {name}" if not __salt__["cmd.retcode"](cmd, python_shell=False): # calling restart doesn't clear maintenance # or tell us that the service is in the 'online' state @@ -220,7 +220,7 @@ def reload_(name): salt '*' service.reload """ - cmd = "/usr/sbin/svcadm refresh {}".format(name) + cmd = f"/usr/sbin/svcadm refresh {name}" if not __salt__["cmd.retcode"](cmd, python_shell=False): # calling reload doesn't clear maintenance # or tell us that the service is in the 'online' state @@ -258,7 +258,7 @@ def status(name, sig=None): services = [name] results = {} for service in services: - cmd = "/usr/bin/svcs -H -o STATE {}".format(service) + cmd = f"/usr/bin/svcs -H -o STATE {service}" line = __salt__["cmd.run"](cmd, python_shell=False) results[service] = line == "online" if contains_globbing: @@ -276,7 +276,7 @@ def enable(name, **kwargs): salt '*' service.enable """ - cmd = "/usr/sbin/svcadm enable {}".format(name) + cmd = f"/usr/sbin/svcadm enable {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -290,7 +290,7 @@ def disable(name, **kwargs): salt '*' service.disable """ - cmd = "/usr/sbin/svcadm disable {}".format(name) + cmd = f"/usr/sbin/svcadm disable {name}" return not __salt__["cmd.retcode"](cmd, python_shell=False) @@ -307,9 +307,9 @@ def enabled(name, **kwargs): # The property that reveals whether a service is enabled # can only be queried using the full FMRI # We extract the FMRI and then do the query - fmri_cmd = "/usr/bin/svcs -H -o FMRI {}".format(name) + fmri_cmd = f"/usr/bin/svcs -H -o FMRI {name}" fmri = __salt__["cmd.run"](fmri_cmd, python_shell=False) - cmd = "/usr/sbin/svccfg -s {} listprop general/enabled".format(fmri) + cmd = f"/usr/sbin/svccfg -s {fmri} listprop general/enabled" comps = __salt__["cmd.run"](cmd, python_shell=False).split() if comps[2] == "true": return True diff --git a/salt/modules/smtp.py b/salt/modules/smtp.py index acfa0d0d639..fc9d55f0cbb 100644 --- a/salt/modules/smtp.py +++ b/salt/modules/smtp.py @@ -156,7 +156,7 @@ def send_msg( name = os.path.basename(f) with salt.utils.files.fopen(f, "rb") as fin: att = email.mime.application.MIMEApplication(fin.read(), Name=name) - att["Content-Disposition"] = 'attachment; filename="{}"'.format(name) + att["Content-Disposition"] = f'attachment; filename="{name}"' msg.attach(att) try: diff --git a/salt/modules/snapper.py b/salt/modules/snapper.py index f5781a1a64f..f97d3d5f598 100644 --- a/salt/modules/snapper.py +++ b/salt/modules/snapper.py @@ -334,7 +334,7 @@ def create_config( def raise_arg_error(argname): raise CommandExecutionError( - 'You must provide a "{}" for the new configuration'.format(argname) + f'You must provide a "{argname}" for the new configuration' ) if not name: @@ -366,7 +366,7 @@ def create_snapshot( description=None, cleanup_algorithm="number", userdata=None, - **kwargs + **kwargs, ): """ Creates an snapshot @@ -408,7 +408,7 @@ def create_snapshot( jid = kwargs.get("__pub_jid") if description is None and jid is not None: - description = "salt job {}".format(jid) + description = f"salt job {jid}" if jid is not None: userdata["salt_jid"] = jid @@ -433,9 +433,7 @@ def create_snapshot( config, pre_number, description, cleanup_algorithm, userdata ) else: - raise CommandExecutionError( - "Invalid snapshot type '{}'".format(snapshot_type) - ) + raise CommandExecutionError(f"Invalid snapshot type '{snapshot_type}'") except dbus.DBusException as exc: raise CommandExecutionError( "Error encountered while listing changed files: {}".format( @@ -560,7 +558,7 @@ def _is_text_file(filename): ["file", "-bi", filename], check=False, stdout=subprocess.PIPE, - universal_newlines=True, + text=True, ).stdout return type_of_file.startswith("text") @@ -606,7 +604,7 @@ def run(function, *args, **kwargs): salt '*' snapper.run file.append args='["/etc/motd", "some text"]' """ config = kwargs.pop("config", "root") - description = kwargs.pop("description", "snapper.run[{}]".format(function)) + description = kwargs.pop("description", f"snapper.run[{function}]") cleanup_algorithm = kwargs.pop("cleanup_algorithm", "number") userdata = kwargs.pop("userdata", {}) @@ -619,11 +617,11 @@ def run(function, *args, **kwargs): description=description, cleanup_algorithm=cleanup_algorithm, userdata=userdata, - **kwargs + **kwargs, ) if function not in __salt__: - raise CommandExecutionError('function "{}" does not exist'.format(function)) + raise CommandExecutionError(f'function "{function}" does not exist') try: ret = __salt__[function](*args, **func_kwargs) @@ -637,7 +635,7 @@ def run(function, *args, **kwargs): description=description, cleanup_algorithm=cleanup_algorithm, userdata=userdata, - **kwargs + **kwargs, ) return ret @@ -755,7 +753,7 @@ def undo(config="root", files=None, num_pre=None, num_post=None): return ret except ValueError as exc: raise CommandExecutionError( - "Error while processing Snapper response: {}".format(cmdret) + f"Error while processing Snapper response: {cmdret}" ) @@ -773,7 +771,7 @@ def _get_jid_snapshots(jid, config="root"): post_snapshot = [x for x in jid_snapshots if x["type"] == "post"] if not pre_snapshot or not post_snapshot: - raise CommandExecutionError("Jid '{}' snapshots not found".format(jid)) + raise CommandExecutionError(f"Jid '{jid}' snapshots not found") return (pre_snapshot[0]["id"], post_snapshot[0]["id"]) diff --git a/salt/modules/solaris_fmadm.py b/salt/modules/solaris_fmadm.py index 7dae9d6b100..3c928c47c2c 100644 --- a/salt/modules/solaris_fmadm.py +++ b/salt/modules/solaris_fmadm.py @@ -69,7 +69,7 @@ def _parse_fmdump(output): # parse entries for entry in output: entry = [item for item in entry.split(" ") if item] - entry = ["{} {} {}".format(entry[0], entry[1], entry[2])] + entry[3:] + entry = [f"{entry[0]} {entry[1]} {entry[2]}"] + entry[3:] # prepare faults fault = OrderedDict() @@ -152,7 +152,7 @@ def _fmadm_action_fmri(action, fmri): """ ret = {} fmadm = _check_fmadm() - cmd = "{cmd} {action} {fmri}".format(cmd=fmadm, action=action, fmri=fmri) + cmd = f"{fmadm} {action} {fmri}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] result = {} @@ -260,8 +260,8 @@ def list_records(after=None, before=None): fmdump = _check_fmdump() cmd = "{cmd}{after}{before}".format( cmd=fmdump, - after=" -t {}".format(after) if after else "", - before=" -T {}".format(before) if before else "", + after=f" -t {after}" if after else "", + before=f" -T {before}" if before else "", ) res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] @@ -289,7 +289,7 @@ def show(uuid): """ ret = {} fmdump = _check_fmdump() - cmd = "{cmd} -u {uuid} -V".format(cmd=fmdump, uuid=uuid) + cmd = f"{fmdump} -u {uuid} -V" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] result = {} @@ -313,7 +313,7 @@ def config(): """ ret = {} fmadm = _check_fmadm() - cmd = "{cmd} config".format(cmd=fmadm) + cmd = f"{fmadm} config" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] result = {} @@ -340,7 +340,7 @@ def load(path): """ ret = {} fmadm = _check_fmadm() - cmd = "{cmd} load {path}".format(cmd=fmadm, path=path) + cmd = f"{fmadm} load {path}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] result = {} @@ -367,7 +367,7 @@ def unload(module): """ ret = {} fmadm = _check_fmadm() - cmd = "{cmd} unload {module}".format(cmd=fmadm, module=module) + cmd = f"{fmadm} unload {module}" res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] result = {} @@ -397,7 +397,7 @@ def reset(module, serd=None): ret = {} fmadm = _check_fmadm() cmd = "{cmd} reset {serd}{module}".format( - cmd=fmadm, serd="-s {} ".format(serd) if serd else "", module=module + cmd=fmadm, serd=f"-s {serd} " if serd else "", module=module ) res = __salt__["cmd.run_all"](cmd) retcode = res["retcode"] diff --git a/salt/modules/solaris_group.py b/salt/modules/solaris_group.py index 31663be1846..7e9fc1d074f 100644 --- a/salt/modules/solaris_group.py +++ b/salt/modules/solaris_group.py @@ -54,7 +54,7 @@ def add(name, gid=None, **kwargs): cmd = "groupadd " if gid: - cmd += "-g {} ".format(gid) + cmd += f"-g {gid} " cmd += name ret = __salt__["cmd.run_all"](cmd, python_shell=False) @@ -72,7 +72,7 @@ def delete(name): salt '*' group.delete foo """ - ret = __salt__["cmd.run_all"]("groupdel {}".format(name), python_shell=False) + ret = __salt__["cmd.run_all"](f"groupdel {name}", python_shell=False) return not ret["retcode"] @@ -134,7 +134,7 @@ def chgid(name, gid): pre_gid = __salt__["file.group_to_gid"](name) if gid == pre_gid: return True - cmd = "groupmod -g {} {}".format(gid, name) + cmd = f"groupmod -g {gid} {name}" __salt__["cmd.run"](cmd, python_shell=False) post_gid = __salt__["file.group_to_gid"](name) if post_gid != pre_gid: diff --git a/salt/modules/solaris_shadow.py b/salt/modules/solaris_shadow.py index 9441ecea293..36d34d81e72 100644 --- a/salt/modules/solaris_shadow.py +++ b/salt/modules/solaris_shadow.py @@ -144,7 +144,7 @@ def info(name): # 5. Maximum age # 6. Warning period - output = __salt__["cmd.run_all"]("passwd -s {}".format(name), python_shell=False) + output = __salt__["cmd.run_all"](f"passwd -s {name}", python_shell=False) if output["retcode"] != 0: return ret @@ -183,7 +183,7 @@ def set_maxdays(name, maxdays): pre_info = info(name) if maxdays == pre_info["max"]: return True - cmd = "passwd -x {} {}".format(maxdays, name) + cmd = f"passwd -x {maxdays} {name}" __salt__["cmd.run"](cmd, python_shell=False) post_info = info(name) if post_info["max"] != pre_info["max"]: @@ -203,7 +203,7 @@ def set_mindays(name, mindays): pre_info = info(name) if mindays == pre_info["min"]: return True - cmd = "passwd -n {} {}".format(mindays, name) + cmd = f"passwd -n {mindays} {name}" __salt__["cmd.run"](cmd, python_shell=False) post_info = info(name) if post_info["min"] != pre_info["min"]: @@ -265,7 +265,7 @@ def del_password(name): salt '*' shadow.del_password username """ - cmd = "passwd -d {}".format(name) + cmd = f"passwd -d {name}" __salt__["cmd.run"](cmd, python_shell=False, output_loglevel="quiet") uinfo = info(name) return not uinfo["passwd"] @@ -296,7 +296,7 @@ def set_password(name, password): continue comps[1] = password line = ":".join(comps) - lines.append("{}\n".format(line)) + lines.append(f"{line}\n") with salt.utils.files.fopen(s_file, "w+") as ofile: lines = [salt.utils.stringutils.to_str(_l) for _l in lines] ofile.writelines(lines) @@ -318,7 +318,7 @@ def set_warndays(name, warndays): pre_info = info(name) if warndays == pre_info["warn"]: return True - cmd = "passwd -w {} {}".format(warndays, name) + cmd = f"passwd -w {warndays} {name}" __salt__["cmd.run"](cmd, python_shell=False) post_info = info(name) if post_info["warn"] != pre_info["warn"]: diff --git a/salt/modules/solaris_user.py b/salt/modules/solaris_user.py index f2c45f809b5..be705b2f0a6 100644 --- a/salt/modules/solaris_user.py +++ b/salt/modules/solaris_user.py @@ -108,7 +108,7 @@ def add( workphone="", homephone="", createhome=True, - **kwargs + **kwargs, ): """ Add a user to the minion @@ -218,7 +218,7 @@ def chuid(name, uid): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if uid == pre_info["uid"]: return True cmd = ["usermod", "-u", uid, name] @@ -238,7 +238,7 @@ def chgid(name, gid): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if gid == pre_info["gid"]: return True cmd = ["usermod", "-g", gid, name] @@ -258,7 +258,7 @@ def chshell(name, shell): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if shell == pre_info["shell"]: return True cmd = ["usermod", "-s", shell, name] @@ -289,7 +289,7 @@ def chhome(name, home, persist=False): """ pre_info = info(name) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if home == pre_info["home"]: return True cmd = ["usermod", "-d", home] @@ -457,10 +457,10 @@ def rename(name, new_name): """ current_info = info(name) if not current_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") new_info = info(new_name) if new_info: - raise CommandExecutionError("User '{}' already exists".format(new_name)) + raise CommandExecutionError(f"User '{new_name}' already exists") cmd = ["usermod", "-l", new_name, name] __salt__["cmd.run"](cmd, python_shell=False) return info(new_name).get("name") == new_name diff --git a/salt/modules/solarisipspkg.py b/salt/modules/solarisipspkg.py index 6e6e4f6610f..1d720db0656 100644 --- a/salt/modules/solarisipspkg.py +++ b/salt/modules/solarisipspkg.py @@ -539,19 +539,19 @@ def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwa if getattr(pkg, "items", False): if list(pkg.items())[0][1]: # version specified pkg2inst.append( - "{}@{}".format(list(pkg.items())[0][0], list(pkg.items())[0][1]) + f"{list(pkg.items())[0][0]}@{list(pkg.items())[0][1]}" ) else: pkg2inst.append(list(pkg.items())[0][0]) else: - pkg2inst.append("{}".format(pkg)) + pkg2inst.append(f"{pkg}") log.debug("Installing these packages instead of %s: %s", name, pkg2inst) else: # install single package if version: - pkg2inst = "{}@{}".format(name, version) + pkg2inst = f"{name}@{version}" else: - pkg2inst = "{}".format(name) + pkg2inst = f"{name}" cmd = ["pkg", "install", "-v", "--accept"] if test: diff --git a/salt/modules/solarispkg.py b/salt/modules/solarispkg.py index fd0ab8d1add..370981b0e7e 100644 --- a/salt/modules/solarispkg.py +++ b/salt/modules/solarispkg.py @@ -65,17 +65,17 @@ def _write_adminfile(kwargs): fp_.write(salt.utils.stringutils.to_str(line)) with salt.utils.files.fopen(adminfile, "w") as fp_: - _write_line(fp_, "email={}\n".format(email)) - _write_line(fp_, "instance={}\n".format(instance)) - _write_line(fp_, "partial={}\n".format(partial)) - _write_line(fp_, "runlevel={}\n".format(runlevel)) - _write_line(fp_, "idepend={}\n".format(idepend)) - _write_line(fp_, "rdepend={}\n".format(rdepend)) - _write_line(fp_, "space={}\n".format(space)) - _write_line(fp_, "setuid={}\n".format(setuid)) - _write_line(fp_, "conflict={}\n".format(conflict)) - _write_line(fp_, "action={}\n".format(action)) - _write_line(fp_, "basedir={}\n".format(basedir)) + _write_line(fp_, f"email={email}\n") + _write_line(fp_, f"instance={instance}\n") + _write_line(fp_, f"partial={partial}\n") + _write_line(fp_, f"runlevel={runlevel}\n") + _write_line(fp_, f"idepend={idepend}\n") + _write_line(fp_, f"rdepend={rdepend}\n") + _write_line(fp_, f"space={space}\n") + _write_line(fp_, f"setuid={setuid}\n") + _write_line(fp_, f"conflict={conflict}\n") + _write_line(fp_, f"action={action}\n") + _write_line(fp_, f"basedir={basedir}\n") return adminfile diff --git a/salt/modules/solr.py b/salt/modules/solr.py index fca581922f1..9654bd36f6c 100644 --- a/salt/modules/solr.py +++ b/salt/modules/solr.py @@ -205,7 +205,7 @@ def _format_url(handler, host=None, core_name=None, extra=None): baseurl = __salt__["config.option"]("solr.baseurl") if _get_none_or_value(core_name) is None: if extra is None or len(extra) == 0: - return "http://{}:{}{}/{}?wt=json".format(host, port, baseurl, handler) + return f"http://{host}:{port}{baseurl}/{handler}?wt=json" else: return "http://{}:{}{}/{}?wt=json&{}".format( host, port, baseurl, handler, "&".join(extra) @@ -260,7 +260,7 @@ def _http_request(url, request_timeout=None): data = salt.utils.json.load(urllib.request.urlopen(url, **kwargs)) return _get_return_dict(True, data, []) except Exception as err: # pylint: disable=broad-except - return _get_return_dict(False, {}, ["{} : {}".format(url, err)]) + return _get_return_dict(False, {}, [f"{url} : {err}"]) def _replication_request(command, host=None, core_name=None, params=None): @@ -286,7 +286,7 @@ def _replication_request(command, host=None, core_name=None, params=None): {'success':boolean, 'data':dict, 'errors':list, 'warnings':list} """ params = [] if params is None else params - extra = ["command={}".format(command)] + params + extra = [f"command={command}"] + params url = _format_url("replication", host=host, core_name=core_name, extra=extra) return _http_request(url) @@ -311,7 +311,7 @@ def _get_admin_info(command, host=None, core_name=None): {'success':boolean, 'data':dict, 'errors':list, 'warnings':list} """ - url = _format_url("admin/{}".format(command), host, core_name=core_name) + url = _format_url(f"admin/{command}", host, core_name=core_name) resp = _http_request(url) return resp @@ -390,10 +390,10 @@ def _pre_index_check(handler, host=None, core_name=None): warn = ["An indexing process is already running."] return _get_return_dict(True, warnings=warn) if status != "idle": - errors = ['Unknown status: "{}"'.format(status)] + errors = [f'Unknown status: "{status}"'] return _get_return_dict(False, data=resp["data"], errors=errors) else: - errors = ["Status check failed. Response details: {}".format(resp)] + errors = [f"Status check failed. Response details: {resp}"] return _get_return_dict(False, data=resp["data"], errors=errors) return resp @@ -421,7 +421,7 @@ def _find_value(ret_dict, key, path=None): if path is None: path = key else: - path = "{}:{}".format(path, key) + path = f"{path}:{key}" ret = [] for ikey, val in ret_dict.items(): @@ -739,7 +739,7 @@ def match_index_versions(host=None, core_name=None): if "ERROR" in slave: error = slave["ERROR"] success = False - err = "{}: {} - {}".format(core, error, master_url) + err = f"{core}: {error} - {master_url}" resp["errors"].append(err) # if there was an error return the entire response so the # alterer can get what it wants @@ -864,8 +864,8 @@ def backup(host=None, core_name=None, append_core_to_path=False): params = [] if path is not None: path = path + name if append_core_to_path else path - params.append("&location={}".format(path + name)) - params.append("&numberToKeep={}".format(num_backups)) + params.append(f"&location={path + name}") + params.append(f"&numberToKeep={num_backups}") resp = _replication_request( "backup", host=host, core_name=name, params=params ) @@ -881,8 +881,8 @@ def backup(host=None, core_name=None, append_core_to_path=False): if append_core_to_path: path += core_name if path is not None: - params = ["location={}".format(path)] - params.append("&numberToKeep={}".format(num_backups)) + params = [f"location={path}"] + params.append(f"&numberToKeep={num_backups}") resp = _replication_request( "backup", host=host, core_name=core_name, params=params ) @@ -1058,7 +1058,7 @@ def reload_core(host=None, core_name=None): ret, success, data, resp["errors"], resp["warnings"] ) return ret - extra = ["action=RELOAD", "core={}".format(core_name)] + extra = ["action=RELOAD", f"core={core_name}"] url = _format_url("admin/cores", host=host, core_name=None, extra=extra) return _http_request(url) @@ -1099,7 +1099,7 @@ def core_status(host=None, core_name=None): ret, success, data, resp["errors"], resp["warnings"] ) return ret - extra = ["action=STATUS", "core={}".format(core_name)] + extra = ["action=STATUS", f"core={core_name}"] url = _format_url("admin/cores", host=host, core_name=None, extra=extra) return _http_request(url) @@ -1241,7 +1241,7 @@ def full_import(handler, host=None, core_name=None, options=None, extra=None): return _get_return_dict(False, errors=errors) params = ["command=full-import"] for key, val in options.items(): - params.append("&{}={}".format(key, val)) + params.append(f"&{key}={val}") url = _format_url(handler, host=host, core_name=core_name, extra=params + extra) return _http_request(url) @@ -1294,7 +1294,7 @@ def delta_import(handler, host=None, core_name=None, options=None, extra=None): return _get_return_dict(False, errors=errors) params = ["command=delta-import"] for key, val in options.items(): - params.append("{}={}".format(key, val)) + params.append(f"{key}={val}") url = _format_url(handler, host=host, core_name=core_name, extra=params + extra) return _http_request(url) diff --git a/salt/modules/solrcloud.py b/salt/modules/solrcloud.py index fda16a1ef55..7b594e3292f 100644 --- a/salt/modules/solrcloud.py +++ b/salt/modules/solrcloud.py @@ -314,7 +314,7 @@ def alias_set_collections(alias_name, collections=None, **kwargs): "admin/collections?action=CREATEALIAS&name={alias}&wt=json&collections={collections}".format( alias=alias_name, collections=", ".join(collections) ), - **kwargs + **kwargs, ) @@ -337,7 +337,7 @@ def collection_reload(collection, **kwargs): "admin/collections?action=RELOAD&name={collection}&wt=json".format( collection=collection ), - **kwargs + **kwargs, ) @@ -398,7 +398,7 @@ def collection_backup(collection_name, location, backup_name=None, **kwargs): raise ValueError("Collection doesn't exists") if backup_name is not None: - backup_name = "&name={}".format(backup_name) + backup_name = f"&name={backup_name}" else: backup_name = "" @@ -406,7 +406,7 @@ def collection_backup(collection_name, location, backup_name=None, **kwargs): "{collection}/replication?command=BACKUP&location={location}{backup_name}&wt=json".format( collection=collection_name, backup_name=backup_name, location=location ), - **kwargs + **kwargs, ) @@ -436,7 +436,7 @@ def collection_backup_all(location, backup_name=None, **kwargs): "{collection}/replication?command=BACKUP&location={location}{backup_name}&wt=json".format( collection=collection_name, backup_name=backup_name, location=location ), - **kwargs + **kwargs, ) @@ -481,7 +481,7 @@ def collection_create(collection_name, options=None, **kwargs): "admin/collections?action=CREATE&wt=json&name=" + collection_name + options_string, - **kwargs + **kwargs, ) @@ -566,5 +566,5 @@ def collection_set_options(collection_name, options, **kwargs): "admin/collections?action=MODIFYCOLLECTION&wt=json&collection=" + collection_name + options_string, - **kwargs + **kwargs, ) diff --git a/salt/modules/splunk_search.py b/salt/modules/splunk_search.py index e0d101cb2f3..51f46cfc7d9 100644 --- a/salt/modules/splunk_search.py +++ b/salt/modules/splunk_search.py @@ -130,7 +130,7 @@ def update(name, profile="splunk", **kwargs): if old_value != new_value: update_set[key] = new_value update_needed = True - diffs.append("{}: '{}' => '{}'".format(key, old_value, new_value)) + diffs.append(f"{key}: '{old_value}' => '{new_value}'") if update_needed: search.update(**update_set).refresh() return update_set, diffs diff --git a/salt/modules/ssh.py b/salt/modules/ssh.py index 44e7c67da16..0701e963867 100644 --- a/salt/modules/ssh.py +++ b/salt/modules/ssh.py @@ -83,7 +83,7 @@ def _refine_enc(enc): elif enc in also_allowed: return enc else: - raise CommandExecutionError("Incorrect encryption key type '{}'.".format(enc)) + raise CommandExecutionError(f"Incorrect encryption key type '{enc}'.") def _format_auth_line(key, enc, comment, options): @@ -93,7 +93,7 @@ def _format_auth_line(key, enc, comment, options): line = "" if options: line += "{} ".format(",".join(options)) - line += "{} {} {}\n".format(enc, key, comment) + line += f"{enc} {key} {comment}\n" return line @@ -134,7 +134,7 @@ def _get_config_file(user, config): """ uinfo = __salt__["user.info"](user) if not uinfo: - raise CommandExecutionError("User '{}' does not exist".format(user)) + raise CommandExecutionError(f"User '{user}' does not exist") home = uinfo["home"] config = _expand_authorized_keys_path(config, user, home) if not os.path.isabs(config): @@ -183,9 +183,7 @@ def _replace_auth_key( # Write out any changes _fh.writelines(salt.utils.data.encode(lines)) except OSError as exc: - raise CommandExecutionError( - "Problem reading or writing to key file: {}".format(exc) - ) + raise CommandExecutionError(f"Problem reading or writing to key file: {exc}") def _validate_keys(key_file, fingerprint_hash_type): @@ -241,7 +239,7 @@ def _validate_keys(key_file, fingerprint_hash_type): "fingerprint": fingerprint, } except OSError: - raise CommandExecutionError("Problem reading ssh key file {}".format(key_file)) + raise CommandExecutionError(f"Problem reading ssh key file {key_file}") return ret @@ -277,7 +275,7 @@ def _fingerprint(public_key, fingerprint_hash_type): hash_func = getattr(hashlib, hash_type) except AttributeError: raise CommandExecutionError( - "The fingerprint_hash_type {} is not supported.".format(hash_type) + f"The fingerprint_hash_type {hash_type} is not supported." ) try: @@ -305,7 +303,7 @@ def _get_known_hosts_file(config=None, user=None): if not uinfo: return { "status": "error", - "error": "User {} does not exist".format(user), + "error": f"User {user} does not exist", } full = os.path.join(uinfo["home"], config) else: @@ -433,7 +431,7 @@ def check_key_file( return {} s_keys = _validate_keys(keyfile, fingerprint_hash_type) if not s_keys: - err = "No keys detected in {}. Is file properly formatted?".format(source) + err = f"No keys detected in {source}. Is file properly formatted?" log.error(err) __context__["ssh_auth.error"] = err return {} @@ -526,7 +524,7 @@ def rm_auth_key_from_file( s_keys = _validate_keys(lfile, fingerprint_hash_type) if not s_keys: - err = "No keys detected in {}. Is file properly formatted?".format(source) + err = f"No keys detected in {source}. Is file properly formatted?" log.error(err) __context__["ssh_auth.error"] = err return "fail" @@ -568,7 +566,7 @@ def rm_auth_key(user, key, config=".ssh/authorized_keys", fingerprint_hash_type= # Return something sensible if the file doesn't exist if not os.path.isfile(full): - return "Authorized keys file {} not present".format(full) + return f"Authorized keys file {full} not present" lines = [] try: @@ -644,7 +642,7 @@ def set_auth_key_from_file( s_keys = _validate_keys(lfile, fingerprint_hash_type) if not s_keys: - err = "No keys detected in {}. Is file properly formatted?".format(source) + err = f"No keys detected in {source}. Is file properly formatted?" log.error(err) __context__["ssh_auth.error"] = err return "fail" @@ -1009,7 +1007,7 @@ def rm_known_host(user=None, hostname=None, config=None, port=None): if not os.path.isfile(full): return { "status": "error", - "error": "Known hosts file {} does not exist".format(full), + "error": f"Known hosts file {full} does not exist", } ssh_hostname = _hostname_and_port_to_ssh_hostname(hostname, port) @@ -1252,7 +1250,7 @@ def set_known_host( ofile.writelines(salt.utils.data.encode(lines)) except OSError as exception: raise CommandExecutionError( - "Couldn't append to known hosts file: '{}'".format(exception) + f"Couldn't append to known hosts file: '{exception}'" ) if not salt.utils.platform.is_windows(): @@ -1378,7 +1376,7 @@ def hash_known_hosts(user=None, config=None): if not os.path.isfile(full): return { "status": "error", - "error": "Known hosts file {} does not exist".format(full), + "error": f"Known hosts file {full} does not exist", } origmode = os.stat(full).st_mode cmd = ["ssh-keygen", "-H", "-f", full] @@ -1396,7 +1394,7 @@ def _hostname_and_port_to_ssh_hostname(hostname, port=DEFAULT_SSH_PORT): if not port or port == DEFAULT_SSH_PORT: return hostname else: - return "[{}]:{}".format(hostname, port) + return f"[{hostname}]:{port}" def key_is_encrypted(key): diff --git a/salt/modules/state.py b/salt/modules/state.py index 20e1e67a24b..6440d347ffe 100644 --- a/salt/modules/state.py +++ b/salt/modules/state.py @@ -145,7 +145,7 @@ def _snapper_pre(opts, jid): snapper_pre = __salt__["snapper.create_snapshot"]( config=__opts__.get("snapper_states_config", "root"), snapshot_type="pre", - description="Salt State run for jid {}".format(jid), + description=f"Salt State run for jid {jid}", __pub_jid=jid, ) except Exception: # pylint: disable=broad-except @@ -164,7 +164,7 @@ def _snapper_post(opts, jid, pre_num): config=__opts__.get("snapper_states_config", "root"), snapshot_type="post", pre_number=pre_num, - description="Salt State run for jid {}".format(jid), + description=f"Salt State run for jid {jid}", __pub_jid=jid, ) except Exception: # pylint: disable=broad-except @@ -587,7 +587,7 @@ def template(tem, queue=None, **kwargs): raise CommandExecutionError("Pillar failed to render", info=errors) if not tem.endswith(".sls"): - tem = "{sls}.sls".format(sls=tem) + tem = f"{tem}.sls" high_state, errors = st_.render_state( tem, kwargs.get("saltenv", ""), "", None, local=True ) @@ -883,7 +883,7 @@ def request(mods=None, **kwargs): try: if salt.utils.platform.is_windows(): # Make sure cache file isn't read-only - __salt__["cmd.run"]('attrib -R "{}"'.format(notify_path)) + __salt__["cmd.run"](f'attrib -R "{notify_path}"') with salt.utils.files.fopen(notify_path, "w+b") as fp_: salt.payload.dump(req, fp_) except OSError: @@ -945,7 +945,7 @@ def clear_request(name=None): try: if salt.utils.platform.is_windows(): # Make sure cache file isn't read-only - __salt__["cmd.run"]('attrib -R "{}"'.format(notify_path)) + __salt__["cmd.run"](f'attrib -R "{notify_path}"') with salt.utils.files.fopen(notify_path, "w+b") as fp_: salt.payload.dump(req, fp_) except OSError: @@ -1215,7 +1215,7 @@ def sls( queue=None, sync_mods=None, state_events=None, - **kwargs + **kwargs, ): """ Execute the states in one or more SLS files @@ -1414,7 +1414,7 @@ def sls( for module_type in sync_mods: try: - __salt__["saltutil.sync_{}".format(module_type)](saltenv=opts["saltenv"]) + __salt__[f"saltutil.sync_{module_type}"](saltenv=opts["saltenv"]) except KeyError: log.warning("Invalid custom module type '%s', ignoring", module_type) @@ -2340,10 +2340,10 @@ def pkg(pkg_path, pkg_sum, hash_type, test=None, **kwargs): members = s_pkg.getmembers() for member in members: if salt.utils.stringutils.to_unicode(member.path).startswith( - (os.sep, "..{}".format(os.sep)) + (os.sep, f"..{os.sep}") ): return {} - elif "..{}".format(os.sep) in salt.utils.stringutils.to_unicode(member.path): + elif f"..{os.sep}" in salt.utils.stringutils.to_unicode(member.path): return {} s_pkg.extractall(root) # nosec s_pkg.close() @@ -2421,9 +2421,9 @@ def disable(states): _changed = False for _state in states: if _state in _disabled_state_runs: - msg.append("Info: {} state already disabled.".format(_state)) + msg.append(f"Info: {_state} state already disabled.") else: - msg.append("Info: {} state disabled.".format(_state)) + msg.append(f"Info: {_state} state disabled.") _disabled_state_runs.append(_state) _changed = True @@ -2471,9 +2471,9 @@ def enable(states): for _state in states: log.debug("_state %s", _state) if _state not in _disabled_state_runs: - msg.append("Info: {} state already enabled.".format(_state)) + msg.append(f"Info: {_state} state already enabled.") else: - msg.append("Info: {} state enabled.".format(_state)) + msg.append(f"Info: {_state} state enabled.") _disabled_state_runs.remove(_state) _changed = True diff --git a/salt/modules/status.py b/salt/modules/status.py index 8489256f0b5..71fa6f49cc9 100644 --- a/salt/modules/status.py +++ b/salt/modules/status.py @@ -221,9 +221,7 @@ def uptime(): if salt.utils.platform.is_linux(): ut_path = "/proc/uptime" if not os.path.exists(ut_path): - raise CommandExecutionError( - "File {ut_path} was not found.".format(ut_path=ut_path) - ) + raise CommandExecutionError(f"File {ut_path} was not found.") with salt.utils.files.fopen(ut_path) as rfh: seconds = int(float(rfh.read().split()[0])) elif salt.utils.platform.is_sunos(): @@ -267,7 +265,7 @@ def uptime(): "since_iso": boot_time.isoformat(), "since_t": int(curr_seconds - seconds), "days": up_time.days, - "time": "{}:{}".format(up_time.seconds // 3600, up_time.seconds % 3600 // 60), + "time": f"{up_time.seconds // 3600}:{up_time.seconds % 3600 // 60}", } if salt.utils.path.which("who"): @@ -569,7 +567,7 @@ def meminfo(): procn = len(ret["svmon"]) ret["svmon"].append({}) comps = line.split() - pg_space = "{} {}".format(comps[0], comps[1]) + pg_space = f"{comps[0]} {comps[1]}" ret["svmon"][procn][pg_space] = {} for idx, field in enumerate(fields): if len(comps) > idx + 2: @@ -760,7 +758,7 @@ def cpuinfo(): ret["psrinfo"][procn]["family"] = _number(line[4]) ret["psrinfo"][procn]["model"] = _number(line[6]) ret["psrinfo"][procn]["step"] = _number(line[8]) - ret["psrinfo"][procn]["clock"] = "{} {}".format(line[10], line[11][:-1]) + ret["psrinfo"][procn]["clock"] = f"{line[10]} {line[11][:-1]}" return ret def aix_cpuinfo(): @@ -1386,10 +1384,10 @@ def netdev(): ): # fetch device info netstat_ipv4 = __salt__["cmd.run"]( - "netstat -i -I {dev} -n -f inet".format(dev=dev) + f"netstat -i -I {dev} -n -f inet" ).splitlines() netstat_ipv6 = __salt__["cmd.run"]( - "netstat -i -I {dev} -n -f inet6".format(dev=dev) + f"netstat -i -I {dev} -n -f inet6" ).splitlines() # prepare data @@ -1404,14 +1402,14 @@ def netdev(): if val == "Name": continue if val in ["Address", "Net/Dest"]: - ret[dev]["IPv4 {field}".format(field=val)] = val + ret[dev][f"IPv4 {val}"] = val else: ret[dev][val] = _number(val) for val in netstat_ipv6[0][:-1]: if val == "Name": continue if val in ["Address", "Net/Dest"]: - ret[dev]["IPv6 {field}".format(field=val)] = val + ret[dev][f"IPv6 {val}"] = val else: ret[dev][val] = _number(val) @@ -1437,10 +1435,10 @@ def netdev(): # en0 1500 link#3 e2.eb.32.42.84.c 10029731 0 446499 0 0 netstat_ipv4 = __salt__["cmd.run"]( - "netstat -i -n -I {dev} -f inet".format(dev=dev) + f"netstat -i -n -I {dev} -f inet" ).splitlines() netstat_ipv6 = __salt__["cmd.run"]( - "netstat -i -n -I {dev} -f inet6".format(dev=dev) + f"netstat -i -n -I {dev} -f inet6" ).splitlines() # add data diff --git a/salt/modules/supervisord.py b/salt/modules/supervisord.py index 90754afc70a..1e97e3b7632 100644 --- a/salt/modules/supervisord.py +++ b/salt/modules/supervisord.py @@ -26,7 +26,7 @@ def _get_supervisorctl_bin(bin_env): if not bin_env: which_result = __salt__["cmd.which_bin"]([cmd]) if which_result is None: - raise CommandNotFoundError("Could not find a `{}` binary".format(cmd)) + raise CommandNotFoundError(f"Could not find a `{cmd}` binary") return which_result # try to get binary from env @@ -34,7 +34,7 @@ def _get_supervisorctl_bin(bin_env): cmd_bin = os.path.join(bin_env, "bin", cmd) if os.path.isfile(cmd_bin): return cmd_bin - raise CommandNotFoundError("Could not find a `{}` binary".format(cmd)) + raise CommandNotFoundError(f"Could not find a `{cmd}` binary") return bin_env @@ -57,7 +57,7 @@ def _get_return(ret): if ret["retcode"] != 0: # This is a non 0 exit code if "ERROR" not in retmsg: - retmsg = "ERROR: {}".format(retmsg) + retmsg = f"ERROR: {retmsg}" return retmsg @@ -371,7 +371,7 @@ def _read_config(conf_file=None): try: config.read(conf_file) except OSError as exc: - raise CommandExecutionError("Unable to read from {}: {}".format(conf_file, exc)) + raise CommandExecutionError(f"Unable to read from {conf_file}: {exc}") return config @@ -393,9 +393,9 @@ def options(name, conf_file=None): salt '*' supervisord.options foo """ config = _read_config(conf_file) - section_name = "program:{}".format(name) + section_name = f"program:{name}" if section_name not in config.sections(): - raise CommandExecutionError("Process '{}' not found".format(name)) + raise CommandExecutionError(f"Process '{name}' not found") ret = {} for key, val in config.items(section_name): val = salt.utils.stringutils.to_num(val.split(";")[0].strip()) @@ -437,7 +437,7 @@ def status_bool(name, expected_state=None, user=None, conf_file=None, bin_env=No salt '*' supervisord.status_bool nginx expected_state='RUNNING' """ - cmd = "status {}".format(name) + cmd = f"status {name}" for line in custom(cmd, user, conf_file, bin_env).splitlines(): if len(line.split()) > 2: process, state, reason = line.split(None, 2) diff --git a/salt/modules/suse_apache.py b/salt/modules/suse_apache.py index 7c599b34a83..5501fa21ddf 100644 --- a/salt/modules/suse_apache.py +++ b/salt/modules/suse_apache.py @@ -73,9 +73,9 @@ def a2enmod(mod): ret["Mod"] = mod if status == 1: - ret["Status"] = "Mod {} Not found".format(mod) + ret["Status"] = f"Mod {mod} Not found" elif status == 0: - ret["Status"] = "Mod {} enabled".format(mod) + ret["Status"] = f"Mod {mod} enabled" else: ret["Status"] = status @@ -104,9 +104,9 @@ def a2dismod(mod): ret["Mod"] = mod if status == 256: - ret["Status"] = "Mod {} Not found".format(mod) + ret["Status"] = f"Mod {mod} Not found" elif status == 0: - ret["Status"] = "Mod {} disabled".format(mod) + ret["Status"] = f"Mod {mod} disabled" else: ret["Status"] = status diff --git a/salt/modules/suse_ip.py b/salt/modules/suse_ip.py index 9422c0d91b2..fdff55e37a4 100644 --- a/salt/modules/suse_ip.py +++ b/salt/modules/suse_ip.py @@ -197,7 +197,7 @@ def _parse_ethtool_opts(opts, iface): _raise_error_iface(iface, "advertise", valid) if "channels" in opts: - channels_cmd = "-L {}".format(iface.strip()) + channels_cmd = f"-L {iface.strip()}" channels_params = [] for option in ("rx", "tx", "other", "combined"): if option in opts["channels"]: @@ -557,9 +557,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): if iface_type not in ("bridge",): ethtool = _parse_ethtool_opts(opts, iface) if ethtool: - result["ethtool"] = " ".join( - ["{} {}".format(x, y) for x, y in ethtool.items()] - ) + result["ethtool"] = " ".join([f"{x} {y}" for x, y in ethtool.items()]) if iface_type == "slave": result["proto"] = "none" @@ -571,9 +569,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): raise AttributeError(msg) bonding = _parse_settings_bond(opts, iface) if bonding: - result["bonding"] = " ".join( - ["{}={}".format(x, y) for x, y in bonding.items()] - ) + result["bonding"] = " ".join([f"{x}={y}" for x, y in bonding.items()]) result["devtype"] = "Bond" if "slaves" in opts: if isinstance(opts["slaves"], list): @@ -667,14 +663,14 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): ) or salt.utils.validate.net.ipv6_addr(opt): result["ipaddrs"].append(opt) else: - msg = "{} is invalid ipv4 or ipv6 CIDR".format(opt) + msg = f"{opt} is invalid ipv4 or ipv6 CIDR" log.error(msg) raise AttributeError(msg) if "ipv6addr" in opts: if salt.utils.validate.net.ipv6_addr(opts["ipv6addr"]): result["ipaddrs"].append(opts["ipv6addr"]) else: - msg = "{} is invalid ipv6 CIDR".format(opt) + msg = f"{opt} is invalid ipv6 CIDR" log.error(msg) raise AttributeError(msg) if "ipv6addrs" in opts: @@ -682,7 +678,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface): if salt.utils.validate.net.ipv6_addr(opt): result["ipaddrs"].append(opt) else: - msg = "{} is invalid ipv6 CIDR".format(opt) + msg = f"{opt} is invalid ipv6 CIDR" log.error(msg) raise AttributeError(msg) @@ -878,7 +874,7 @@ def _write_file_iface(iface, data, folder, pattern): """ filename = os.path.join(folder, pattern.format(iface)) if not os.path.exists(folder): - msg = "{} cannot be written. {} does not exist".format(filename, folder) + msg = f"{filename} cannot be written. {folder} does not exist" log.error(msg) raise AttributeError(msg) with salt.utils.files.fopen(filename, "w") as fp_: @@ -987,7 +983,7 @@ def build_interface(iface, iface_type, enabled, **settings): return _get_non_blank_lines(ifcfg) _write_file_iface(iface, ifcfg, _SUSE_NETWORK_SCRIPT_DIR, "ifcfg-{}") - path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, "ifcfg-{}".format(iface)) + path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, f"ifcfg-{iface}") return _read_file(path) @@ -1036,7 +1032,7 @@ def build_routes(iface, **settings): if iface == "routes": path = _SUSE_NETWORK_ROUTES_FILE else: - path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, "ifroute-{}".format(iface)) + path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, f"ifroute-{iface}") _write_file_network(routecfg, path) @@ -1068,7 +1064,7 @@ def down(iface, iface_type=None): """ # Slave devices are controlled by the master. if not iface_type or iface_type.lower() != "slave": - return __salt__["cmd.run"]("ifdown {}".format(iface)) + return __salt__["cmd.run"](f"ifdown {iface}") return None @@ -1089,7 +1085,7 @@ def get_interface(iface): salt '*' ip.get_interface eth0 """ - path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, "ifcfg-{}".format(iface)) + path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, f"ifcfg-{iface}") return _read_file(path) @@ -1118,7 +1114,7 @@ def up(iface, iface_type=None): """ # Slave devices are controlled by the master. if not iface_type or iface_type.lower() != "slave": - return __salt__["cmd.run"]("ifup {}".format(iface)) + return __salt__["cmd.run"](f"ifup {iface}") return None @@ -1142,7 +1138,7 @@ def get_routes(iface): if iface == "routes": path = _SUSE_NETWORK_ROUTES_FILE else: - path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, "ifroute-{}".format(iface)) + path = os.path.join(_SUSE_NETWORK_SCRIPT_DIR, f"ifroute-{iface}") return _read_file(path) diff --git a/salt/modules/sysbench.py b/salt/modules/sysbench.py index 9e56ddbbe71..1f44e77fb2a 100644 --- a/salt/modules/sysbench.py +++ b/salt/modules/sysbench.py @@ -79,7 +79,7 @@ def cpu(): # Test beings! for primes in max_primes: - key = "Prime numbers limit: {}".format(primes) + key = f"Prime numbers limit: {primes}" run_command = test_command.format(primes) result = __salt__["cmd.run"](run_command) ret_val[key] = _parser(result) @@ -110,7 +110,7 @@ def threads(): # Test begins! for yields, locks in zip(thread_yields, thread_locks): - key = "Yields: {} Locks: {}".format(yields, locks) + key = f"Yields: {yields} Locks: {locks}" run_command = test_command.format(yields, locks) result = __salt__["cmd.run"](run_command) ret_val[key] = _parser(result) @@ -149,7 +149,7 @@ def mutex(): # Test begins! for num, locks, loops in zip(mutex_num, mutex_locks, mutex_loops): - key = "Mutex: {} Locks: {} Loops: {}".format(num, locks, loops) + key = f"Mutex: {num} Locks: {locks} Loops: {loops}" run_command = test_command.format(num, locks, loops) result = __salt__["cmd.run"](run_command) ret_val[key] = _parser(result) @@ -187,7 +187,7 @@ def memory(): # Test begins! for oper in memory_oper: for scope in memory_scope: - key = "Operation: {} Scope: {}".format(oper, scope) + key = f"Operation: {oper} Scope: {scope}" run_command = test_command.format(oper, scope) result = __salt__["cmd.run"](run_command) ret_val[key] = _parser(result) @@ -228,7 +228,7 @@ def fileio(): # Test begins! for mode in test_modes: - key = "Mode: {}".format(mode) + key = f"Mode: {mode}" # Prepare phase run_command = (test_command + "prepare").format(mode) diff --git a/salt/modules/sysfs.py b/salt/modules/sysfs.py index 0192c038612..f86136c2060 100644 --- a/salt/modules/sysfs.py +++ b/salt/modules/sysfs.py @@ -62,7 +62,7 @@ def write(key, value): key = target(key) log.trace("Writing %s to %s", value, key) with salt.utils.files.fopen(key, "w") as twriter: - twriter.write(salt.utils.stringutils.to_str("{}\n".format(value))) + twriter.write(salt.utils.stringutils.to_str(f"{value}\n")) return True except Exception: # pylint: disable=broad-except return False diff --git a/salt/modules/syslog_ng.py b/salt/modules/syslog_ng.py index 5df09f233b4..d215d8057b0 100644 --- a/salt/modules/syslog_ng.py +++ b/salt/modules/syslog_ng.py @@ -79,7 +79,7 @@ def _indent(value): """ Returns the indented parameter. """ - return "{}{}".format(_INDENT, value) + return f"{_INDENT}{value}" def _indentln(string): @@ -161,9 +161,9 @@ class Statement(Buildable): def build_header(self): if self.has_name: - return _indentln("{0} {1} {{".format(self.type, self.id)) + return _indentln(f"{self.type} {self.id} {{") else: - return _indentln("{0} {{".format(self.type)) + return _indentln(f"{self.type} {{") def build_tail(self): return _indentln("};") @@ -231,7 +231,7 @@ class Option(Buildable): self.iterable = self.params def build(self): - header = _indentln("{}(".format(self.type)) + header = _indentln(f"{self.type}(") tail = _indentln(");") body = self.build_body() @@ -304,7 +304,7 @@ class TypedParameter(Parameter): self.iterable = self.values def build(self): - header = _indentln("{}(".format(self.type)) + header = _indentln(f"{self.type}(") tail = _indent(")") body = self.build_body() @@ -372,7 +372,7 @@ class TypedParameterValue(ParameterValue): self.iterable = self.arguments def build(self): - header = _indentln("{}(".format(self.type)) + header = _indentln(f"{self.type}(") tail = _indent(")") body = self.build_body() @@ -822,7 +822,7 @@ def config_test(syslog_ng_sbin_dir=None, cfgfile=None): """ params = ["--syntax-only"] if cfgfile: - params.append("--cfgfile={}".format(cfgfile)) + params.append(f"--cfgfile={cfgfile}") try: ret = _run_command_in_extended_path(syslog_ng_sbin_dir, "syslog-ng", params) @@ -936,7 +936,7 @@ def _add_cli_param(params, key, value): Adds key and value as a command line parameter to params. """ if value is not None: - params.append("--{}={}".format(key, value)) + params.append(f"--{key}={value}") def _add_boolean_cli_param(params, key, value): @@ -944,7 +944,7 @@ def _add_boolean_cli_param(params, key, value): Adds key as a command line parameter to params. """ if value is True: - params.append("--{}".format(key)) + params.append(f"--{key}") def stop(name=None): @@ -1040,7 +1040,7 @@ def start( command = [syslog_ng_binary] + params if __opts__.get("test", False): - comment = "Syslog_ng state module will start {}".format(command) + comment = f"Syslog_ng state module will start {command}" return _format_state_result(name, result=None, comment=comment) result = __salt__["cmd.run_all"](command, python_shell=False) @@ -1048,7 +1048,7 @@ def start( command = ["syslog-ng"] + params if __opts__.get("test", False): - comment = "Syslog_ng state module will start {}".format(command) + comment = f"Syslog_ng state module will start {command}" return _format_state_result(name, result=None, comment=comment) result = __salt__["cmd.run_all"](command, python_shell=False) @@ -1156,7 +1156,7 @@ def write_version(name): salt '*' syslog_ng.write_version name="3.6" """ - line = "@version: {}".format(name) + line = f"@version: {name}" try: if os.path.exists(__SYSLOG_NG_CONFIG_FILE): log.debug( diff --git a/salt/modules/system.py b/salt/modules/system.py index 5d1be5f6fd2..bcdce7a434c 100644 --- a/salt/modules/system.py +++ b/salt/modules/system.py @@ -67,7 +67,7 @@ def init(runlevel): salt '*' system.init 3 """ - cmd = ["init", "{}".format(runlevel)] + cmd = ["init", f"{runlevel}"] ret = __salt__["cmd.run"](cmd, python_shell=False) return ret @@ -100,7 +100,7 @@ def reboot(at_time=None): salt '*' system.reboot """ - cmd = ["shutdown", "-r", ("{}".format(at_time) if at_time else "now")] + cmd = ["shutdown", "-r", (f"{at_time}" if at_time else "now")] ret = __salt__["cmd.run"](cmd, python_shell=False) return ret @@ -128,7 +128,7 @@ def shutdown(at_time=None): else: flag = "-h" - cmd = ["shutdown", flag, ("{}".format(at_time) if at_time else "now")] + cmd = ["shutdown", flag, (f"{at_time}" if at_time else "now")] ret = __salt__["cmd.run"](cmd, python_shell=False) return ret @@ -592,7 +592,7 @@ def set_computer_desc(desc): pass pattern = re.compile(r"^\s*PRETTY_HOSTNAME=(.*)$") - new_line = salt.utils.stringutils.to_str('PRETTY_HOSTNAME="{}"'.format(desc)) + new_line = salt.utils.stringutils.to_str(f'PRETTY_HOSTNAME="{desc}"') try: with salt.utils.files.fopen("/etc/machine-info", "r+") as mach_info: lines = mach_info.readlines() @@ -669,10 +669,10 @@ def set_reboot_required_witnessed(): os.makedirs(dir_path) except OSError as ex: raise SaltInvocationError( - "Error creating {} (-{}): {}".format(dir_path, ex.errno, ex.strerror) + f"Error creating {dir_path} (-{ex.errno}): {ex.strerror}" ) - rdict = __salt__["cmd.run_all"]("touch {}".format(NILRT_REBOOT_WITNESS_PATH)) + rdict = __salt__["cmd.run_all"](f"touch {NILRT_REBOOT_WITNESS_PATH}") errcode = rdict["retcode"] return errcode == 0 diff --git a/salt/modules/systemd_service.py b/salt/modules/systemd_service.py index dd27106afd0..858495647f2 100644 --- a/salt/modules/systemd_service.py +++ b/salt/modules/systemd_service.py @@ -135,7 +135,7 @@ def _check_for_unit_changes(name): Check for modified/updated unit files, and run a daemon-reload if any are found. """ - contextkey = "systemd._check_for_unit_changes.{}".format(name) + contextkey = f"systemd._check_for_unit_changes.{name}" if contextkey not in __context__: if _untracked_custom_unit_found(name) or _unit_file_changed(name): systemctl_reload() @@ -377,7 +377,7 @@ def _sysv_enabled(name, root): runlevel. """ # Find exact match (disambiguate matches like "S01anacron" for cron) - rc = _root("/etc/rc{}.d/S*{}".format(_runlevel(), name), root) + rc = _root(f"/etc/rc{_runlevel()}.d/S*{name}", root) for match in glob.glob(rc): if re.match(r"S\d{,2}%s" % name, os.path.basename(match)): return True @@ -1451,7 +1451,7 @@ def firstboot( ] for parameter, value in parameters: if value: - cmd.extend(["--{}".format(parameter), str(value)]) + cmd.extend([f"--{parameter}", str(value)]) out = __salt__["cmd.run_all"](cmd) diff --git a/salt/modules/telegram.py b/salt/modules/telegram.py index e0f2f969045..3d1e73cca4d 100644 --- a/salt/modules/telegram.py +++ b/salt/modules/telegram.py @@ -104,7 +104,7 @@ def _post_message(message, chat_id, token): :param token: The Telegram API token. :return: Boolean if message was sent successfully. """ - url = "https://api.telegram.org/bot{}/sendMessage".format(token) + url = f"https://api.telegram.org/bot{token}/sendMessage" parameters = dict() if chat_id: diff --git a/salt/modules/telemetry.py b/salt/modules/telemetry.py index c55c94668ca..3fc4b902d5c 100644 --- a/salt/modules/telemetry.py +++ b/salt/modules/telemetry.py @@ -72,7 +72,7 @@ def _auth(api_key=None, profile="telemetry"): def _update_cache(deployment_id, metric_name, alert): - key = "telemetry.{}.alerts".format(deployment_id) + key = f"telemetry.{deployment_id}.alerts" if key in __context__: alerts = __context__[key] @@ -133,7 +133,7 @@ def get_alert_config( auth = _auth(profile=profile) alert = False - key = "telemetry.{}.alerts".format(deployment_id) + key = f"telemetry.{deployment_id}.alerts" if key not in __context__: try: @@ -209,9 +209,7 @@ def get_notification_channel_id(notify_channel, profile="telemetry"): notification_channel_id = response.json().get("_id") __context__["telemetry.channels"][notify_channel] = notification_channel_id else: - raise Exception( - "Failed to created notification channel {}".format(notify_channel) - ) + raise Exception(f"Failed to created notification channel {notify_channel}") return notification_channel_id @@ -233,8 +231,7 @@ def get_alarms(deployment_id, profile="telemetry"): try: response = requests.get( - _get_telemetry_base(profile) - + "/alerts?deployment={}".format(deployment_id), + _get_telemetry_base(profile) + f"/alerts?deployment={deployment_id}", headers=auth, timeout=120, ) @@ -248,7 +245,7 @@ def get_alarms(deployment_id, profile="telemetry"): if alarms: return alarms - return "No alarms defined for deployment: {}".format(deployment_id) + return f"No alarms defined for deployment: {deployment_id}" else: # Non 200 response, sent back the error response' return { @@ -276,7 +273,7 @@ def create_alarm(deployment_id, metric_name, data, api_key=None, profile="teleme auth = _auth(api_key, profile) request_uri = _get_telemetry_base(profile) + "/alerts" - key = "telemetry.{}.alerts".format(deployment_id) + key = f"telemetry.{deployment_id}.alerts" # set the notification channels if not already set post_body = { @@ -428,12 +425,12 @@ def delete_alarms( if not alert_ids: return ( False, - "failed to find alert associated with deployment: {}".format(deployment_id), + f"failed to find alert associated with deployment: {deployment_id}", ) failed_to_delete = [] for id in alert_ids: - delete_url = _get_telemetry_base(profile) + "/alerts/{}".format(id) + delete_url = _get_telemetry_base(profile) + f"/alerts/{id}" try: response = requests.delete(delete_url, headers=auth, timeout=120) diff --git a/salt/modules/test.py b/salt/modules/test.py index fe4c8ec9ae1..b98a0dbc99e 100644 --- a/salt/modules/test.py +++ b/salt/modules/test.py @@ -79,7 +79,7 @@ def module_report(): if hasattr(__salt__, ref): ret["module_attrs"].append(ref) for func in __salt__[ref]: - full = "{}.{}".format(ref, func) + full = f"{ref}.{func}" if hasattr(getattr(__salt__, ref), func): ret["function_attrs"].append(full) if func in __salt__[ref]: @@ -427,7 +427,7 @@ def provider(module): """ func = "" for key in __salt__: - if not key.startswith("{}.".format(module)): + if not key.startswith(f"{module}."): continue func = key break diff --git a/salt/modules/testinframod.py b/salt/modules/testinframod.py index eb7254a09d6..bac95da5c65 100644 --- a/salt/modules/testinframod.py +++ b/salt/modules/testinframod.py @@ -150,7 +150,7 @@ def _apply_assertion(expected, result): raise return comparison(expected["expected"], result) else: - raise TypeError("Expected bool or dict but received {}".format(type(expected))) + raise TypeError(f"Expected bool or dict but received {type(expected)}") # This does not currently generate documentation from the underlying modules diff --git a/salt/modules/textfsm_mod.py b/salt/modules/textfsm_mod.py index bcade66de15..e11dd5afbb7 100644 --- a/salt/modules/textfsm_mod.py +++ b/salt/modules/textfsm_mod.py @@ -476,5 +476,5 @@ def index( ret["result"] = True except clitable.CliTableError as cterr: log.error("Unable to proces the CliTable", exc_info=True) - ret["comment"] = "Unable to process the output: {}".format(cterr) + ret["comment"] = f"Unable to process the output: {cterr}" return ret diff --git a/salt/modules/timezone.py b/salt/modules/timezone.py index 26d37943987..115ec06eeef 100644 --- a/salt/modules/timezone.py +++ b/salt/modules/timezone.py @@ -144,7 +144,7 @@ def _get_zone_etc_timezone(): return salt.utils.stringutils.to_unicode(fp_.read()).strip() except OSError as exc: raise CommandExecutionError( - "Problem reading timezone file {}: {}".format(tzfile, exc.strerror) + f"Problem reading timezone file {tzfile}: {exc.strerror}" ) @@ -240,7 +240,7 @@ def get_offset(): salt_path = "/opt/salt/bin/date" if not os.path.exists(salt_path): - return "date in salt binaries does not exist: {}".format(salt_path) + return f"date in salt binaries does not exist: {salt_path}" return __salt__["cmd.run"]([salt_path, "+%z"], python_shell=False) @@ -273,24 +273,24 @@ def set_zone(timezone): """ if salt.utils.path.which("timedatectl"): try: - __salt__["cmd.run"]("timedatectl set-timezone {}".format(timezone)) + __salt__["cmd.run"](f"timedatectl set-timezone {timezone}") except CommandExecutionError: pass if "Solaris" in __grains__["os_family"] or "AIX" in __grains__["os_family"]: - zonepath = "/usr/share/lib/zoneinfo/{}".format(timezone) + zonepath = f"/usr/share/lib/zoneinfo/{timezone}" else: - zonepath = "/usr/share/zoneinfo/{}".format(timezone) + zonepath = f"/usr/share/zoneinfo/{timezone}" if not os.path.exists(zonepath) and "AIX" not in __grains__["os_family"]: - return "Zone does not exist: {}".format(zonepath) + return f"Zone does not exist: {zonepath}" tzfile = _get_localtime_path() if os.path.exists(tzfile): os.unlink(tzfile) if "Solaris" in __grains__["os_family"]: - __salt__["file.sed"]("/etc/default/init", "^TZ=.*", "TZ={}".format(timezone)) + __salt__["file.sed"]("/etc/default/init", "^TZ=.*", f"TZ={timezone}") elif "AIX" in __grains__["os_family"]: # timezone could be Olson or Posix curtzstring = get_zone() @@ -307,12 +307,10 @@ def set_zone(timezone): os.symlink(zonepath, tzfile) if "RedHat" in __grains__["os_family"]: - __salt__["file.sed"]( - "/etc/sysconfig/clock", "^ZONE=.*", 'ZONE="{}"'.format(timezone) - ) + __salt__["file.sed"]("/etc/sysconfig/clock", "^ZONE=.*", f'ZONE="{timezone}"') elif "Suse" in __grains__["os_family"]: __salt__["file.sed"]( - "/etc/sysconfig/clock", "^TIMEZONE=.*", 'TIMEZONE="{}"'.format(timezone) + "/etc/sysconfig/clock", "^TIMEZONE=.*", f'TIMEZONE="{timezone}"' ) elif "Debian" in __grains__["os_family"] or "Gentoo" in __grains__["os_family"]: with salt.utils.files.fopen("/etc/timezone", "w") as ofh: @@ -361,9 +359,7 @@ def zone_compare(timezone): except OSError as exc: problematic_file = exc.filename if problematic_file == zonepath: - raise SaltInvocationError( - 'Can\'t find a local timezone "{}"'.format(timezone) - ) + raise SaltInvocationError(f'Can\'t find a local timezone "{timezone}"') elif problematic_file == tzfile: raise CommandExecutionError( "Failed to read {} to determine current timezone: {}".format( @@ -383,7 +379,7 @@ def _get_localtime_path(): def _get_zone_file(timezone): - return "/usr/share/zoneinfo/{}".format(timezone) + return f"/usr/share/zoneinfo/{timezone}" def get_hwclock(): @@ -453,7 +449,7 @@ def get_hwclock(): if line == "local": return "LOCAL" raise CommandExecutionError( - "Correct offset value not found in {}".format(offset_file) + f"Correct offset value not found in {offset_file}" ) except OSError as exc: raise CommandExecutionError( @@ -555,10 +551,10 @@ def set_hwclock(clock): cmd = ["rtc", "-z", "GMT" if clock.lower() == "utc" else timezone] return __salt__["cmd.retcode"](cmd, python_shell=False) == 0 - zonepath = "/usr/share/zoneinfo/{}".format(timezone) + zonepath = f"/usr/share/zoneinfo/{timezone}" if not os.path.exists(zonepath): - raise CommandExecutionError("Zone '{}' does not exist".format(zonepath)) + raise CommandExecutionError(f"Zone '{zonepath}' does not exist") os.unlink("/etc/localtime") os.symlink(zonepath, "/etc/localtime") @@ -572,13 +568,13 @@ def set_hwclock(clock): return __salt__["cmd.retcode"](cmd, python_shell=False) == 0 elif "RedHat" in __grains__["os_family"]: __salt__["file.sed"]( - "/etc/sysconfig/clock", "^ZONE=.*", 'ZONE="{}"'.format(timezone) + "/etc/sysconfig/clock", "^ZONE=.*", f'ZONE="{timezone}"' ) elif "Suse" in __grains__["os_family"]: __salt__["file.sed"]( "/etc/sysconfig/clock", "^TIMEZONE=.*", - 'TIMEZONE="{}"'.format(timezone), + f'TIMEZONE="{timezone}"', ) elif "Debian" in __grains__["os_family"]: if clock == "UTC": @@ -590,14 +586,10 @@ def set_hwclock(clock): raise SaltInvocationError("Only 'UTC' and 'localtime' are allowed") if clock == "localtime": clock = "local" - __salt__["file.sed"]( - "/etc/conf.d/hwclock", "^clock=.*", 'clock="{}"'.format(clock) - ) + __salt__["file.sed"]("/etc/conf.d/hwclock", "^clock=.*", f'clock="{clock}"') elif "Slackware" in os_family: if clock not in ("UTC", "localtime"): raise SaltInvocationError("Only 'UTC' and 'localtime' are allowed") - __salt__["file.sed"]( - "/etc/hardwareclock", "^(UTC|localtime)", "{}".format(clock) - ) + __salt__["file.sed"]("/etc/hardwareclock", "^(UTC|localtime)", f"{clock}") return True diff --git a/salt/modules/tls.py b/salt/modules/tls.py index d54922a26c9..2cc3c09119a 100644 --- a/salt/modules/tls.py +++ b/salt/modules/tls.py @@ -169,7 +169,7 @@ def _microtime(): """ val1, val2 = math.modf(time.time()) val2 = int(val2) - return "{:f}{}".format(val1, val2) + return f"{val1:f}{val2}" def _context_or_config(key): @@ -249,7 +249,7 @@ def _new_serial(ca_name): # record the hash somewhere cachedir = __opts__["cachedir"] log.debug("cachedir: %s", cachedir) - serial_file = "{}/{}.serial".format(cachedir, ca_name) + serial_file = f"{cachedir}/{ca_name}.serial" if not os.path.exists(cachedir): os.makedirs(cachedir) if not os.path.exists(serial_file): @@ -271,9 +271,9 @@ def _get_basic_info(ca_name, cert, ca_dir=None): Get basic info to write out to the index.txt """ if ca_dir is None: - ca_dir = "{}/{}".format(_cert_base_path(), ca_name) + ca_dir = f"{_cert_base_path()}/{ca_name}" - index_file = "{}/index.txt".format(ca_dir) + index_file = f"{ca_dir}/index.txt" cert = _read_cert(cert) expire_date = _four_digit_year_to_two_digit(_get_expiration_date(cert)) @@ -283,9 +283,7 @@ def _get_basic_info(ca_name, cert, ca_dir=None): subject = "/" # then we can add the rest of the subject - subject += "/".join( - ["{}={}".format(x, y) for x, y in cert.get_subject().get_components()] - ) + subject += "/".join([f"{x}={y}" for x, y in cert.get_subject().get_components()]) subject += "\n" return (index_file, expire_date, serial_number, subject) @@ -302,7 +300,7 @@ def _write_cert_to_database(ca_name, cert, cacert_path=None, status="V"): certificate to be recorded """ set_ca_path(cacert_path) - ca_dir = "{}/{}".format(cert_base_path(), ca_name) + ca_dir = f"{cert_base_path()}/{ca_name}" index_file, expire_date, serial_number, subject = _get_basic_info( ca_name, cert, ca_dir ) @@ -338,9 +336,9 @@ def maybe_fix_ssl_version(ca_name, cacert_path=None, ca_filename=None): """ set_ca_path(cacert_path) if not ca_filename: - ca_filename = "{}_ca_cert".format(ca_name) - certp = "{}/{}/{}.crt".format(cert_base_path(), ca_name, ca_filename) - ca_keyp = "{}/{}/{}.key".format(cert_base_path(), ca_name, ca_filename) + ca_filename = f"{ca_name}_ca_cert" + certp = f"{cert_base_path()}/{ca_name}/{ca_filename}.crt" + ca_keyp = f"{cert_base_path()}/{ca_name}/{ca_filename}.key" with salt.utils.files.fopen(certp) as fic: cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, fic.read()) if cert.get_version() == 3: @@ -398,8 +396,8 @@ def ca_exists(ca_name, cacert_path=None, ca_filename=None): """ set_ca_path(cacert_path) if not ca_filename: - ca_filename = "{}_ca_cert".format(ca_name) - certp = "{}/{}/{}.crt".format(cert_base_path(), ca_name, ca_filename) + ca_filename = f"{ca_name}_ca_cert" + certp = f"{cert_base_path()}/{ca_name}/{ca_filename}.crt" if os.path.exists(certp): maybe_fix_ssl_version(ca_name, cacert_path=cacert_path, ca_filename=ca_filename) return True @@ -431,7 +429,7 @@ def get_ca(ca_name, as_text=False, cacert_path=None): set_ca_path(cacert_path) certp = "{0}/{1}/{1}_ca_cert.crt".format(cert_base_path(), ca_name) if not os.path.exists(certp): - raise ValueError("Certificate does not exist for {}".format(ca_name)) + raise ValueError(f"Certificate does not exist for {ca_name}") else: if as_text: with salt.utils.files.fopen(certp) as fic: @@ -468,9 +466,9 @@ def get_ca_signed_cert( if not cert_filename: cert_filename = CN - certp = "{}/{}/certs/{}.crt".format(cert_base_path(), ca_name, cert_filename) + certp = f"{cert_base_path()}/{ca_name}/certs/{cert_filename}.crt" if not os.path.exists(certp): - raise ValueError("Certificate does not exists for {}".format(CN)) + raise ValueError(f"Certificate does not exists for {CN}") else: if as_text: with salt.utils.files.fopen(certp) as fic: @@ -512,9 +510,9 @@ def get_ca_signed_key( if not key_filename: key_filename = CN - keyp = "{}/{}/certs/{}.key".format(cert_base_path(), ca_name, key_filename) + keyp = f"{cert_base_path()}/{ca_name}/certs/{key_filename}.key" if not os.path.exists(keyp): - raise ValueError("Certificate does not exists for {}".format(CN)) + raise ValueError(f"Certificate does not exists for {CN}") else: if as_text: with salt.utils.files.fopen(keyp) as fic: @@ -559,10 +557,10 @@ def validate(cert, ca_name, crl_file): cert_obj = _read_cert(cert) if cert_obj is None: raise CommandExecutionError( - "Failed to read cert from {}, see log for details".format(cert) + f"Failed to read cert from {cert}, see log for details" ) - ca_dir = "{}/{}".format(cert_base_path(), ca_name) - ca_cert = _read_cert("{}/{}_ca_cert.crt".format(ca_dir, ca_name)) + ca_dir = f"{cert_base_path()}/{ca_name}" + ca_cert = _read_cert(f"{ca_dir}/{ca_name}_ca_cert.crt") store.add_cert(ca_cert) # These flags tell OpenSSL to check the leaf as well as the # entire cert chain. @@ -594,7 +592,7 @@ def _get_expiration_date(cert): if cert_obj is None: raise CommandExecutionError( - "Failed to read cert from {}, see log for details".format(cert) + f"Failed to read cert from {cert}, see log for details" ) return datetime.strptime( @@ -734,18 +732,18 @@ def create_ca( set_ca_path(cacert_path) if not ca_filename: - ca_filename = "{}_ca_cert".format(ca_name) + ca_filename = f"{ca_name}_ca_cert" - certp = "{}/{}/{}.crt".format(cert_base_path(), ca_name, ca_filename) - ca_keyp = "{}/{}/{}.key".format(cert_base_path(), ca_name, ca_filename) + certp = f"{cert_base_path()}/{ca_name}/{ca_filename}.crt" + ca_keyp = f"{cert_base_path()}/{ca_name}/{ca_filename}.key" if not replace and not fixmode and ca_exists(ca_name, ca_filename=ca_filename): - return 'Certificate for CA named "{}" already exists'.format(ca_name) + return f'Certificate for CA named "{ca_name}" already exists' if fixmode and not os.path.exists(certp): - raise ValueError("{} does not exists, can't fix".format(certp)) + raise ValueError(f"{certp} does not exists, can't fix") - if not os.path.exists("{}/{}".format(cert_base_path(), ca_name)): - os.makedirs("{}/{}".format(cert_base_path(), ca_name)) + if not os.path.exists(f"{cert_base_path()}/{ca_name}"): + os.makedirs(f"{cert_base_path()}/{ca_name}") # try to reuse existing ssl key key = None @@ -932,9 +930,7 @@ def get_extensions(cert_type): # possible user-defined profile or a typo if cert_type not in ext: try: - ext[cert_type] = __salt__["pillar.get"]( - "tls.extensions:{}".format(cert_type) - ) + ext[cert_type] = __salt__["pillar.get"](f"tls.extensions:{cert_type}") except NameError as e: log.debug( "pillar, tls:extensions:%s not available or " @@ -1071,7 +1067,7 @@ def create_csr( set_ca_path(cacert_path) if not ca_filename: - ca_filename = "{}_ca_cert".format(ca_name) + ca_filename = f"{ca_name}_ca_cert" if not ca_exists(ca_name, ca_filename=ca_filename): return 'Certificate for CA named "{}" does not exist, please create it first.'.format( @@ -1079,20 +1075,20 @@ def create_csr( ) if not csr_path: - csr_path = "{}/{}/certs/".format(cert_base_path(), ca_name) + csr_path = f"{cert_base_path()}/{ca_name}/certs/" if not os.path.exists(csr_path): os.makedirs(csr_path) - CN_ext = "_{}".format(cert_type) if type_ext else "" + CN_ext = f"_{cert_type}" if type_ext else "" if not csr_filename: - csr_filename = "{}{}".format(CN, CN_ext) + csr_filename = f"{CN}{CN_ext}" - csr_f = "{}/{}.csr".format(csr_path, csr_filename) + csr_f = f"{csr_path}/{csr_filename}.csr" if not replace and os.path.exists(csr_f): - return 'Certificate Request "{}" already exists'.format(csr_f) + return f'Certificate Request "{csr_f}" already exists' key = OpenSSL.crypto.PKey() key.generate_key(OpenSSL.crypto.TYPE_RSA, bits) @@ -1153,7 +1149,7 @@ def create_csr( req.sign(key, salt.utils.stringutils.to_str(digest)) # Write private key and request - priv_keyp = "{}/{}.key".format(csr_path, csr_filename) + priv_keyp = f"{csr_path}/{csr_filename}.key" fp = os.open(priv_keyp, os.O_CREAT | os.O_RDWR, 0o600) with salt.utils.files.fopen(fp, "wb+") as priv_key: priv_key.write( @@ -1171,8 +1167,8 @@ def create_csr( ) ) - ret = 'Created Private Key: "{}{}.key" '.format(csr_path, csr_filename) - ret += 'Created CSR for "{}": "{}{}.csr"'.format(CN, csr_path, csr_filename) + ret = f'Created Private Key: "{csr_path}{csr_filename}.key" ' + ret += f'Created CSR for "{CN}": "{csr_path}{csr_filename}.csr"' return ret @@ -1255,16 +1251,16 @@ def create_self_signed_cert( """ set_ca_path(cacert_path) - if not os.path.exists("{}/{}/certs/".format(cert_base_path(), tls_dir)): - os.makedirs("{}/{}/certs/".format(cert_base_path(), tls_dir)) + if not os.path.exists(f"{cert_base_path()}/{tls_dir}/certs/"): + os.makedirs(f"{cert_base_path()}/{tls_dir}/certs/") if not cert_filename: cert_filename = CN if not replace and os.path.exists( - "{}/{}/certs/{}.crt".format(cert_base_path(), tls_dir, cert_filename) + f"{cert_base_path()}/{tls_dir}/certs/{cert_filename}.crt" ): - return 'Certificate "{}" already exists'.format(cert_filename) + return f'Certificate "{cert_filename}" already exists' key = OpenSSL.crypto.PKey() key.generate_key(OpenSSL.crypto.TYPE_RSA, bits) @@ -1303,7 +1299,7 @@ def create_self_signed_cert( ) ) - crt_path = "{}/{}/certs/{}.crt".format(cert_base_path(), tls_dir, cert_filename) + crt_path = f"{cert_base_path()}/{tls_dir}/certs/{cert_filename}.crt" with salt.utils.files.fopen(crt_path, "wb+") as crt: crt.write( salt.utils.stringutils.to_bytes( @@ -1431,10 +1427,10 @@ def create_ca_signed_cert( set_ca_path(cacert_path) if not ca_filename: - ca_filename = "{}_ca_cert".format(ca_name) + ca_filename = f"{ca_name}_ca_cert" if not cert_path: - cert_path = "{}/{}/certs".format(cert_base_path(), ca_name) + cert_path = f"{cert_base_path()}/{ca_name}/certs" if type_ext: if not cert_type: @@ -1443,14 +1439,14 @@ def create_ca_signed_cert( ) return ret elif cert_type: - CN_ext = "_{}".format(cert_type) + CN_ext = f"_{cert_type}" else: CN_ext = "" - csr_filename = "{}{}".format(CN, CN_ext) + csr_filename = f"{CN}{CN_ext}" if not cert_filename: - cert_filename = "{}{}".format(CN, CN_ext) + cert_filename = f"{CN}{CN_ext}" if not replace and os.path.exists( os.path.join( @@ -1461,29 +1457,29 @@ def create_ca_signed_cert( ) ) ): - return 'Certificate "{}" already exists'.format(cert_filename) + return f'Certificate "{cert_filename}" already exists' try: maybe_fix_ssl_version(ca_name, cacert_path=cacert_path, ca_filename=ca_filename) with salt.utils.files.fopen( - "{}/{}/{}.crt".format(cert_base_path(), ca_name, ca_filename) + f"{cert_base_path()}/{ca_name}/{ca_filename}.crt" ) as fhr: ca_cert = OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, fhr.read() ) with salt.utils.files.fopen( - "{}/{}/{}.key".format(cert_base_path(), ca_name, ca_filename) + f"{cert_base_path()}/{ca_name}/{ca_filename}.key" ) as fhr: ca_key = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, fhr.read() ) except OSError: ret["retcode"] = 1 - ret["comment"] = 'There is no CA named "{}"'.format(ca_name) + ret["comment"] = f'There is no CA named "{ca_name}"' return ret try: - csr_path = "{}/{}.csr".format(cert_path, csr_filename) + csr_path = f"{cert_path}/{csr_filename}.csr" with salt.utils.files.fopen(csr_path) as fhr: req = OpenSSL.crypto.load_certificate_request( OpenSSL.crypto.FILETYPE_PEM, fhr.read() @@ -1539,7 +1535,7 @@ def create_ca_signed_cert( cert.sign(ca_key, salt.utils.stringutils.to_str(digest)) - cert_full_path = "{}/{}.crt".format(cert_path, cert_filename) + cert_full_path = f"{cert_path}/{cert_filename}.crt" with salt.utils.files.fopen(cert_full_path, "wb+") as crt: crt.write( @@ -1590,10 +1586,8 @@ def create_pkcs12(ca_name, CN, passphrase="", cacert_path=None, replace=False): salt '*' tls.create_pkcs12 test localhost """ set_ca_path(cacert_path) - if not replace and os.path.exists( - "{}/{}/certs/{}.p12".format(cert_base_path(), ca_name, CN) - ): - return 'Certificate "{}" already exists'.format(CN) + if not replace and os.path.exists(f"{cert_base_path()}/{ca_name}/certs/{CN}.p12"): + return f'Certificate "{CN}" already exists' try: with salt.utils.files.fopen( @@ -1603,23 +1597,23 @@ def create_pkcs12(ca_name, CN, passphrase="", cacert_path=None, replace=False): OpenSSL.crypto.FILETYPE_PEM, fhr.read() ) except OSError: - return 'There is no CA named "{}"'.format(ca_name) + return f'There is no CA named "{ca_name}"' try: with salt.utils.files.fopen( - "{}/{}/certs/{}.crt".format(cert_base_path(), ca_name, CN) + f"{cert_base_path()}/{ca_name}/certs/{CN}.crt" ) as fhr: cert = OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, fhr.read() ) with salt.utils.files.fopen( - "{}/{}/certs/{}.key".format(cert_base_path(), ca_name, CN) + f"{cert_base_path()}/{ca_name}/certs/{CN}.key" ) as fhr: key = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, fhr.read() ) except OSError: - return 'There is no certificate that matches the CN "{}"'.format(CN) + return f'There is no certificate that matches the CN "{CN}"' pkcs12 = OpenSSL.crypto.PKCS12() @@ -1628,7 +1622,7 @@ def create_pkcs12(ca_name, CN, passphrase="", cacert_path=None, replace=False): pkcs12.set_privatekey(key) with salt.utils.files.fopen( - "{}/{}/certs/{}.p12".format(cert_base_path(), ca_name, CN), "wb" + f"{cert_base_path()}/{ca_name}/certs/{CN}.p12", "wb" ) as ofile: ofile.write( pkcs12.export(passphrase=salt.utils.stringutils.to_bytes(passphrase)) @@ -1780,29 +1774,29 @@ def create_empty_crl( set_ca_path(cacert_path) if not ca_filename: - ca_filename = "{}_ca_cert".format(ca_name) + ca_filename = f"{ca_name}_ca_cert" if not crl_file: - crl_file = "{}/{}/crl.pem".format(_cert_base_path(), ca_name) + crl_file = f"{_cert_base_path()}/{ca_name}/crl.pem" - if os.path.exists("{}".format(crl_file)): - return 'CRL "{}" already exists'.format(crl_file) + if os.path.exists(f"{crl_file}"): + return f'CRL "{crl_file}" already exists' try: with salt.utils.files.fopen( - "{}/{}/{}.crt".format(cert_base_path(), ca_name, ca_filename) + f"{cert_base_path()}/{ca_name}/{ca_filename}.crt" ) as fp_: ca_cert = OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, fp_.read() ) with salt.utils.files.fopen( - "{}/{}/{}.key".format(cert_base_path(), ca_name, ca_filename) + f"{cert_base_path()}/{ca_name}/{ca_filename}.key" ) as fp_: ca_key = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, fp_.read() ) except OSError: - return 'There is no CA named "{}"'.format(ca_name) + return f'There is no CA named "{ca_name}"' crl = OpenSSL.crypto.CRL() crl_text = crl.export( @@ -1814,7 +1808,7 @@ def create_empty_crl( with salt.utils.files.fopen(crl_file, "w") as f: f.write(salt.utils.stringutils.to_str(crl_text)) - return 'Created an empty CRL: "{}"'.format(crl_file) + return f'Created an empty CRL: "{crl_file}"' def revoke_cert( @@ -1870,43 +1864,43 @@ def revoke_cert( """ set_ca_path(cacert_path) - ca_dir = "{}/{}".format(cert_base_path(), ca_name) + ca_dir = f"{cert_base_path()}/{ca_name}" if ca_filename is None: - ca_filename = "{}_ca_cert".format(ca_name) + ca_filename = f"{ca_name}_ca_cert" if cert_path is None: - cert_path = "{}/{}/certs".format(_cert_base_path(), ca_name) + cert_path = f"{_cert_base_path()}/{ca_name}/certs" if cert_filename is None: - cert_filename = "{}".format(CN) + cert_filename = f"{CN}" try: with salt.utils.files.fopen( - "{}/{}/{}.crt".format(cert_base_path(), ca_name, ca_filename) + f"{cert_base_path()}/{ca_name}/{ca_filename}.crt" ) as fp_: ca_cert = OpenSSL.crypto.load_certificate( OpenSSL.crypto.FILETYPE_PEM, fp_.read() ) with salt.utils.files.fopen( - "{}/{}/{}.key".format(cert_base_path(), ca_name, ca_filename) + f"{cert_base_path()}/{ca_name}/{ca_filename}.key" ) as fp_: ca_key = OpenSSL.crypto.load_privatekey( OpenSSL.crypto.FILETYPE_PEM, fp_.read() ) except OSError: - return 'There is no CA named "{}"'.format(ca_name) + return f'There is no CA named "{ca_name}"' - client_cert = _read_cert("{}/{}.crt".format(cert_path, cert_filename)) + client_cert = _read_cert(f"{cert_path}/{cert_filename}.crt") if client_cert is None: - return 'There is no client certificate named "{}"'.format(CN) + return f'There is no client certificate named "{CN}"' index_file, expire_date, serial_number, subject = _get_basic_info( ca_name, client_cert, ca_dir ) - index_serial_subject = "{}\tunknown\t{}".format(serial_number, subject) - index_v_data = "V\t{}\t\t{}".format(expire_date, index_serial_subject) + index_serial_subject = f"{serial_number}\tunknown\t{subject}" + index_v_data = f"V\t{expire_date}\t\t{index_serial_subject}" index_r_data_pattern = re.compile( r"R\t" + expire_date + r"\t\d{12}Z\t" + re.escape(index_serial_subject) ) @@ -1963,11 +1957,11 @@ def revoke_cert( ) if crl_file is None: - crl_file = "{}/{}/crl.pem".format(_cert_base_path(), ca_name) + crl_file = f"{_cert_base_path()}/{ca_name}/crl.pem" if os.path.isdir(crl_file): ret["retcode"] = 1 - ret["comment"] = 'crl_file "{}" is an existing directory'.format(crl_file) + ret["comment"] = f'crl_file "{crl_file}" is an existing directory' return ret with salt.utils.files.fopen(crl_file, "w") as fp_: diff --git a/salt/modules/tomcat.py b/salt/modules/tomcat.py index d9f9f28e276..b1ff4a1364d 100644 --- a/salt/modules/tomcat.py +++ b/salt/modules/tomcat.py @@ -214,11 +214,11 @@ def _wget(cmd, opts=None, url="http://localhost:8080/manager", timeout=180): if url[-1] != "/": url += "/" url6 = url - url += "text/{}".format(cmd) - url6 += "{}".format(cmd) + url += f"text/{cmd}" + url6 += f"{cmd}" if opts: - url += "?{}".format(urllib.parse.urlencode(opts)) - url6 += "?{}".format(urllib.parse.urlencode(opts)) + url += f"?{urllib.parse.urlencode(opts)}" + url6 += f"?{urllib.parse.urlencode(opts)}" # Make the HTTP request urllib.request.install_opener(auth) @@ -257,7 +257,7 @@ def _simple_cmd(cmd, app, url="http://localhost:8080/manager", timeout=180): opts = {"path": app, "version": ls(url)[app]["version"]} return "\n".join(_wget(cmd, opts, url, timeout=timeout)["msg"]) except Exception: # pylint: disable=broad-except - return "FAIL - No context exists for path {}".format(app) + return f"FAIL - No context exists for path {app}" # Functions @@ -565,10 +565,10 @@ def deploy_war( salt '*' tomcat.deploy_war /tmp/application.war /api yes http://localhost:8080/manager """ # Decide the location to copy the war for the deployment - tfile = "salt.{}".format(os.path.basename(war)) + tfile = f"salt.{os.path.basename(war)}" if temp_war_location is not None: if not os.path.isdir(temp_war_location): - return 'Error - "{}" is not a directory'.format(temp_war_location) + return f'Error - "{temp_war_location}" is not a directory' tfile = os.path.join(temp_war_location, tfile) else: tfile = os.path.join(tempfile.gettempdir(), tfile) @@ -589,7 +589,7 @@ def deploy_war( # Prepare options opts = { - "war": "file:{}".format(tfile), + "war": f"file:{tfile}", "path": context, } @@ -707,7 +707,7 @@ def signal(signal=None): if signal not in valid_signals: return - cmd = "{}/bin/catalina.sh {}".format(__catalina_home(), valid_signals[signal]) + cmd = f"{__catalina_home()}/bin/catalina.sh {valid_signals[signal]}" __salt__["cmd.run"](cmd) diff --git a/salt/modules/transactional_update.py b/salt/modules/transactional_update.py index 71f6427b15e..c216d6e32ed 100644 --- a/salt/modules/transactional_update.py +++ b/salt/modules/transactional_update.py @@ -952,7 +952,7 @@ def call(function, *args, **kwargs): function, ] + list(args) - + ["{}={}".format(k, v) for (k, v) in safe_kwargs.items()] + + [f"{k}={v}" for (k, v) in safe_kwargs.items()] ) try: @@ -1062,7 +1062,7 @@ def sls(mods, activate_transaction=False, queue=False, **kwargs): mods, activate_transaction=activate_transaction, concurrent=concurrent, - **kwargs + **kwargs, ) @@ -1102,7 +1102,7 @@ def highstate(activate_transaction=False, queue=False, **kwargs): "state.highstate", activate_transaction=activate_transaction, concurrent=True, - **kwargs + **kwargs, ) @@ -1145,5 +1145,5 @@ def single(fun, name, activate_transaction=False, queue=False, **kwargs): name=name, activate_transaction=activate_transaction, concurrent=True, - **kwargs + **kwargs, ) diff --git a/salt/modules/tuned.py b/salt/modules/tuned.py index 8db9ea83e98..8b8b5c62534 100644 --- a/salt/modules/tuned.py +++ b/salt/modules/tuned.py @@ -110,7 +110,7 @@ def profile(profile_name): """ # run tuned-adm with the profile specified - result = __salt__["cmd.retcode"]("tuned-adm profile {}".format(profile_name)) + result = __salt__["cmd.retcode"](f"tuned-adm profile {profile_name}") if int(result) != 0: return False - return "{}".format(profile_name) + return f"{profile_name}" diff --git a/salt/modules/udev.py b/salt/modules/udev.py index 9a734edf4b7..0e4a7473eda 100644 --- a/salt/modules/udev.py +++ b/salt/modules/udev.py @@ -97,7 +97,7 @@ def info(dev): else: qtype = "name" - cmd = "udevadm info --export --query=all --{}={}".format(qtype, dev) + cmd = f"udevadm info --export --query=all --{qtype}={dev}" udev_result = __salt__["cmd.run_all"](cmd, output_loglevel="quiet") if udev_result["retcode"] != 0: diff --git a/salt/modules/upstart_service.py b/salt/modules/upstart_service.py index ee47f6d002a..c59da325e3d 100644 --- a/salt/modules/upstart_service.py +++ b/salt/modules/upstart_service.py @@ -159,7 +159,7 @@ def _runlevel(): ret = _default_runlevel() utmp = _find_utmp() if utmp: - out = __salt__["cmd.run"](["runlevel", "{}".format(utmp)], python_shell=False) + out = __salt__["cmd.run"](["runlevel", f"{utmp}"], python_shell=False) try: ret = out.split()[1] except IndexError: @@ -180,7 +180,7 @@ def _service_is_upstart(name): Jobs are defined in files placed in /etc/init, the name of the job is the filename under this directory without the .conf extension. """ - return os.access("/etc/init/{}.conf".format(name), os.R_OK) + return os.access(f"/etc/init/{name}.conf", os.R_OK) def _upstart_is_disabled(name): @@ -190,7 +190,7 @@ def _upstart_is_disabled(name): NOTE: An Upstart service can also be disabled by placing "manual" in /etc/init/[name].conf. """ - files = ["/etc/init/{}.conf".format(name), "/etc/init/{}.override".format(name)] + files = [f"/etc/init/{name}.conf", f"/etc/init/{name}.override"] for file_name in filter(os.path.isfile, files): with salt.utils.files.fopen(file_name) as fp_: if re.search( @@ -217,7 +217,7 @@ def _service_is_sysv(name): to Upstart's /lib/init/upstart-job, and anything that isn't an executable, like README or skeleton. """ - script = "/etc/init.d/{}".format(name) + script = f"/etc/init.d/{name}" return not _service_is_upstart(name) and os.access(script, os.X_OK) @@ -227,7 +227,7 @@ def _sysv_is_disabled(name): start-up link (starts with "S") to its script in /etc/init.d in the current runlevel. """ - return not bool(glob.glob("/etc/rc{}.d/S*{}".format(_runlevel(), name))) + return not bool(glob.glob(f"/etc/rc{_runlevel()}.d/S*{name}")) def _sysv_is_enabled(name): @@ -508,7 +508,7 @@ def _upstart_disable(name): """ if _upstart_is_disabled(name): return _upstart_is_disabled(name) - override = "/etc/init/{}.override".format(name) + override = f"/etc/init/{name}.override" with salt.utils.files.fopen(override, "a") as ofile: ofile.write(salt.utils.stringutils.to_str("manual\n")) return _upstart_is_disabled(name) @@ -520,8 +520,8 @@ def _upstart_enable(name): """ if _upstart_is_enabled(name): return _upstart_is_enabled(name) - override = "/etc/init/{}.override".format(name) - files = ["/etc/init/{}.conf".format(name), override] + override = f"/etc/init/{name}.override" + files = [f"/etc/init/{name}.conf", override] for file_name in filter(os.path.isfile, files): with salt.utils.files.fopen(file_name, "r+") as fp_: new_text = re.sub( @@ -552,7 +552,7 @@ def enable(name, **kwargs): if _service_is_upstart(name): return _upstart_enable(name) executable = _get_service_exec() - cmd = "{} -f {} defaults".format(executable, name) + cmd = f"{executable} -f {name} defaults" return not __salt__["cmd.retcode"](cmd, python_shell=False) diff --git a/salt/modules/uptime.py b/salt/modules/uptime.py index 34ebff403a1..702e01ec51a 100644 --- a/salt/modules/uptime.py +++ b/salt/modules/uptime.py @@ -42,17 +42,15 @@ def create(name, **params): """ if check_exists(name): - msg = "Trying to create check that already exists : {}".format(name) + msg = f"Trying to create check that already exists : {name}" log.error(msg) raise CommandExecutionError(msg) application_url = _get_application_url() log.debug("[uptime] trying PUT request") params.update(url=name) - req = requests.put( - "{}/api/checks".format(application_url), data=params, timeout=120 - ) + req = requests.put(f"{application_url}/api/checks", data=params, timeout=120) if not req.ok: - raise CommandExecutionError("request to uptime failed : {}".format(req.reason)) + raise CommandExecutionError(f"request to uptime failed : {req.reason}") log.debug("[uptime] PUT request successful") return req.json()["_id"] @@ -68,18 +66,16 @@ def delete(name): salt '*' uptime.delete http://example.org """ if not check_exists(name): - msg = "Trying to delete check that doesn't exists : {}".format(name) + msg = f"Trying to delete check that doesn't exists : {name}" log.error(msg) raise CommandExecutionError(msg) application_url = _get_application_url() log.debug("[uptime] trying DELETE request") - jcontent = requests.get("{}/api/checks".format(application_url), timeout=120).json() + jcontent = requests.get(f"{application_url}/api/checks", timeout=120).json() url_id = [x["_id"] for x in jcontent if x["url"] == name][0] - req = requests.delete( - "{}/api/checks/{}".format(application_url, url_id), timeout=120 - ) + req = requests.delete(f"{application_url}/api/checks/{url_id}", timeout=120) if not req.ok: - raise CommandExecutionError("request to uptime failed : {}".format(req.reason)) + raise CommandExecutionError(f"request to uptime failed : {req.reason}") log.debug("[uptime] DELETE request successful") return True @@ -109,7 +105,7 @@ def checks_list(): """ application_url = _get_application_url() log.debug("[uptime] get checks") - jcontent = requests.get("{}/api/checks".format(application_url), timeout=120).json() + jcontent = requests.get(f"{application_url}/api/checks", timeout=120).json() return [x["url"] for x in jcontent] diff --git a/salt/modules/useradd.py b/salt/modules/useradd.py index 604573cca0a..68f9c314ab4 100644 --- a/salt/modules/useradd.py +++ b/salt/modules/useradd.py @@ -106,7 +106,7 @@ def _which(cmd): """ _cmd = salt.utils.path.which(cmd) if not _cmd: - raise CommandExecutionError("Command '{}' cannot be found".format(cmd)) + raise CommandExecutionError(f"Command '{cmd}' cannot be found") return _cmd @@ -429,7 +429,7 @@ def _chattrib(name, key, value, param, persist=False, root=None): """ pre_info = info(name, root=root) if not pre_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") if value == pre_info[key]: return True @@ -911,7 +911,7 @@ def rename(name, new_name, root=None): salt '*' user.rename name new_name """ if info(new_name, root=root): - raise CommandExecutionError("User '{}' already exists".format(new_name)) + raise CommandExecutionError(f"User '{new_name}' already exists") return _chattrib(name, "name", new_name, "-l", root=root) diff --git a/salt/modules/uwsgi.py b/salt/modules/uwsgi.py index 2ede5c17da7..71ced4a4088 100644 --- a/salt/modules/uwsgi.py +++ b/salt/modules/uwsgi.py @@ -40,6 +40,6 @@ def stats(socket): salt '*' uwsgi.stats 127.0.0.1:5050 """ - cmd = ["uwsgi", "--connect-and-read", "{}".format(socket)] + cmd = ["uwsgi", "--connect-and-read", f"{socket}"] out = __salt__["cmd.run"](cmd, python_shell=False) return salt.utils.json.loads(out) diff --git a/salt/modules/vagrant.py b/salt/modules/vagrant.py index f34eae5e98e..7c214b1f59d 100644 --- a/salt/modules/vagrant.py +++ b/salt/modules/vagrant.py @@ -62,7 +62,7 @@ def _build_sdb_uri(key): Salt node id's are used as the key for vm_ dicts. """ - return "{}{}".format(VAGRANT_SDB_URL, key) + return f"{VAGRANT_SDB_URL}{key}" def _build_machine_uri(machine, cwd): @@ -73,7 +73,7 @@ def _build_machine_uri(machine, cwd): never collide with a Salt node id -- which is important since we will be storing both in the same table. """ - key = "{}?{}".format(machine, os.path.abspath(cwd)) + key = f"{machine}?{os.path.abspath(cwd)}" return _build_sdb_uri(key) @@ -102,9 +102,7 @@ def get_vm_info(name): "Probable sdb driver not found. Check your configuration." ) if vm_ is None or "machine" not in vm_: - raise SaltInvocationError( - "No Vagrant machine defined for Salt_id {}".format(name) - ) + raise SaltInvocationError(f"No Vagrant machine defined for Salt_id {name}") return vm_ @@ -161,7 +159,7 @@ def _vagrant_ssh_config(vm_): """ machine = vm_["machine"] log.info("requesting vagrant ssh-config for VM %s", machine or "(default)") - cmd = "vagrant ssh-config {}".format(machine) + cmd = f"vagrant ssh-config {machine}" reply = __salt__["cmd.shell"]( cmd, runas=vm_.get("runas"), cwd=vm_.get("cwd"), ignore_retcode=True ) @@ -305,12 +303,12 @@ def vm_state(name="", cwd=None): else: if not cwd: raise SaltInvocationError( - "Path to Vagranfile must be defined, but cwd={}".format(cwd) + f"Path to Vagranfile must be defined, but cwd={cwd}" ) machine = "" info = [] - cmd = "vagrant status {}".format(machine) + cmd = f"vagrant status {machine}" reply = __salt__["cmd.shell"](cmd, cwd) log.info("--->\n%s", reply) for line in reply.split("\n"): # build a list of the text reply @@ -404,13 +402,11 @@ def _start( try: machine = vm_["machine"] except KeyError: - raise SaltInvocationError( - "No Vagrant machine defined for Salt_id {}".format(name) - ) + raise SaltInvocationError(f"No Vagrant machine defined for Salt_id {name}") vagrant_provider = vm_.get("vagrant_provider", "") - provider_ = "--provider={}".format(vagrant_provider) if vagrant_provider else "" - cmd = "vagrant up {} {}".format(machine, provider_) + provider_ = f"--provider={vagrant_provider}" if vagrant_provider else "" + cmd = f"vagrant up {machine} {provider_}" ret = __salt__["cmd.run_all"]( cmd, runas=vm_.get("runas"), cwd=vm_.get("cwd"), output_loglevel="info" ) @@ -424,7 +420,7 @@ def _start( break if ret["retcode"] == 0: - return 'Started "{}" using Vagrant machine "{}".'.format(name, machine) + return f'Started "{name}" using Vagrant machine "{machine}".' return False @@ -458,7 +454,7 @@ def stop(name): vm_ = get_vm_info(name) machine = vm_["machine"] - cmd = "vagrant halt {}".format(machine) + cmd = f"vagrant halt {machine}" ret = __salt__["cmd.retcode"](cmd, runas=vm_.get("runas"), cwd=vm_.get("cwd")) return ret == 0 @@ -476,7 +472,7 @@ def pause(name): vm_ = get_vm_info(name) machine = vm_["machine"] - cmd = "vagrant suspend {}".format(machine) + cmd = f"vagrant suspend {machine}" ret = __salt__["cmd.retcode"](cmd, runas=vm_.get("runas"), cwd=vm_.get("cwd")) return ret == 0 @@ -498,7 +494,7 @@ def reboot(name, provision=False): machine = vm_["machine"] prov = "--provision" if provision else "" - cmd = "vagrant reload {} {}".format(machine, prov) + cmd = f"vagrant reload {machine} {prov}" ret = __salt__["cmd.retcode"](cmd, runas=vm_.get("runas"), cwd=vm_.get("cwd")) return ret == 0 @@ -518,14 +514,14 @@ def destroy(name): vm_ = get_vm_info(name) machine = vm_["machine"] - cmd = "vagrant destroy -f {}".format(machine) + cmd = f"vagrant destroy -f {machine}" ret = __salt__["cmd.run_all"]( cmd, runas=vm_.get("runas"), cwd=vm_.get("cwd"), output_loglevel="info" ) if ret["retcode"] == 0: _erase_vm_info(name) - return "Destroyed VM {}".format(name) + return f"Destroyed VM {name}" return False @@ -637,6 +633,6 @@ def get_ssh_config(name, network_mask="", get_private_key=False): ans["private_key"] = salt.utils.stringutils.to_unicode(pks.read()) except OSError as e: raise CommandExecutionError( - "Error processing Vagrant private key file: {}".format(e) + f"Error processing Vagrant private key file: {e}" ) return ans diff --git a/salt/modules/vault.py b/salt/modules/vault.py index 8dc2e5868d0..0c524640041 100644 --- a/salt/modules/vault.py +++ b/salt/modules/vault.py @@ -257,7 +257,7 @@ def read_secret(path, key=None, metadata=False, default=NOT_SET): path = version2["data"] log.debug("Reading Vault secret for %s at %s", __grains__["id"], path) try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("GET", url) if response.status_code != 200: response.raise_for_status() @@ -278,7 +278,7 @@ def read_secret(path, key=None, metadata=False, default=NOT_SET): except Exception as err: # pylint: disable=broad-except if default is CommandExecutionError: raise CommandExecutionError( - "Failed to read secret! {}: {}".format(type(err).__name__, err) + f"Failed to read secret! {type(err).__name__}: {err}" ) return default @@ -300,7 +300,7 @@ def write_secret(path, **kwargs): path = version2["data"] data = {"data": data} try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("POST", url, json=data) if response.status_code == 200: return response.json()["data"] @@ -328,7 +328,7 @@ def write_raw(path, raw): path = version2["data"] raw = {"data": raw} try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("POST", url, json=raw) if response.status_code == 200: return response.json()["data"] @@ -355,7 +355,7 @@ def delete_secret(path): if version2["v2"]: path = version2["data"] try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("DELETE", url) if response.status_code != 204: response.raise_for_status() @@ -387,7 +387,7 @@ def destroy_secret(path, *args): log.error("Destroy operation is only supported on KV version 2") return False try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("POST", url, json=data) if response.status_code != 204: response.raise_for_status() @@ -420,7 +420,7 @@ def list_secrets(path, default=NOT_SET): if version2["v2"]: path = version2["metadata"] try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("LIST", url) if response.status_code != 200: response.raise_for_status() @@ -428,7 +428,7 @@ def list_secrets(path, default=NOT_SET): except Exception as err: # pylint: disable=broad-except if default is CommandExecutionError: raise CommandExecutionError( - "Failed to list secrets! {}: {}".format(type(err).__name__, err) + f"Failed to list secrets! {type(err).__name__}: {err}" ) return default diff --git a/salt/modules/vboxmanage.py b/salt/modules/vboxmanage.py index 39ca6ecb3e6..290de89dfe3 100644 --- a/salt/modules/vboxmanage.py +++ b/salt/modules/vboxmanage.py @@ -85,7 +85,7 @@ def list_nodes_min(): salt '*' vboxmanage.list_nodes_min """ ret = {} - cmd = "{} list vms".format(vboxcmd()) + cmd = f"{vboxcmd()} list vms" for line in salt.modules.cmdmod.run(cmd).splitlines(): if not line.strip(): continue @@ -147,7 +147,7 @@ def start(name): salt '*' vboxmanage.start my_vm """ ret = {} - cmd = "{} startvm {}".format(vboxcmd(), name) + cmd = f"{vboxcmd()} startvm {name}" ret = salt.modules.cmdmod.run(cmd).splitlines() return ret @@ -162,7 +162,7 @@ def stop(name): salt '*' vboxmanage.stop my_vm """ - cmd = "{} controlvm {} poweroff".format(vboxcmd(), name) + cmd = f"{vboxcmd()} controlvm {name} poweroff" ret = salt.modules.cmdmod.run(cmd).splitlines() return ret @@ -179,10 +179,10 @@ def register(filename): """ if not os.path.isfile(filename): raise CommandExecutionError( - "The specified filename ({}) does not exist.".format(filename) + f"The specified filename ({filename}) does not exist." ) - cmd = "{} registervm {}".format(vboxcmd(), filename) + cmd = f"{vboxcmd()} registervm {filename}" ret = salt.modules.cmdmod.run_all(cmd) if ret["retcode"] == 0: return True @@ -201,11 +201,9 @@ def unregister(name, delete=False): """ nodes = list_nodes_min() if name not in nodes: - raise CommandExecutionError( - "The specified VM ({}) is not registered.".format(name) - ) + raise CommandExecutionError(f"The specified VM ({name}) is not registered.") - cmd = "{} unregistervm {}".format(vboxcmd(), name) + cmd = f"{vboxcmd()} unregistervm {name}" if delete is True: cmd += " --delete" ret = salt.modules.cmdmod.run_all(cmd) @@ -234,7 +232,7 @@ def create( register=True, basefolder=None, new_uuid=None, - **kwargs + **kwargs, ): """ Create a new VM @@ -247,16 +245,14 @@ def create( """ nodes = list_nodes_min() if name in nodes: - raise CommandExecutionError( - "The specified VM ({}) is already registered.".format(name) - ) + raise CommandExecutionError(f"The specified VM ({name}) is already registered.") params = "" if name: if NAME_RE.search(name): raise CommandExecutionError("New VM name contains invalid characters") - params += " --name {}".format(name) + params += f" --name {name}" if groups: if isinstance(groups, str): @@ -270,9 +266,7 @@ def create( ostypes = list_ostypes() if ostype not in ostypes: - raise CommandExecutionError( - "The specified OS type ({}) is not available.".format(name) - ) + raise CommandExecutionError(f"The specified OS type ({name}) is not available.") else: params += " --ostype " + ostype @@ -281,17 +275,15 @@ def create( if basefolder: if not os.path.exists(basefolder): - raise CommandExecutionError( - "basefolder {} was not found".format(basefolder) - ) - params += " --basefolder {}".format(basefolder) + raise CommandExecutionError(f"basefolder {basefolder} was not found") + params += f" --basefolder {basefolder}" if new_uuid: if NAME_RE.search(new_uuid): raise CommandExecutionError("New UUID contains invalid characters") - params += " --uuid {}".format(new_uuid) + params += f" --uuid {new_uuid}" - cmd = "{} create {}".format(vboxcmd(), params) + cmd = f"{vboxcmd()} create {params}" ret = salt.modules.cmdmod.run_all(cmd) if ret["retcode"] == 0: return True @@ -310,7 +302,7 @@ def clonevm( new_uuid=None, register=False, groups=None, - **kwargs + **kwargs, ): """ Clone a new VM from an existing VM @@ -331,15 +323,11 @@ def clonevm( nodes_uuids = list_items("vms", True, "UUID").keys() if name: if name not in nodes_names: - raise CommandExecutionError( - "The specified VM ({}) is not registered.".format(name) - ) + raise CommandExecutionError(f"The specified VM ({name}) is not registered.") params += " " + name elif uuid: if uuid not in nodes_uuids: - raise CommandExecutionError( - "The specified VM ({}) is not registered.".format(name) - ) + raise CommandExecutionError(f"The specified VM ({name}) is not registered.") params += " " + uuid if snapshot_name and snapshot_uuid: @@ -350,11 +338,11 @@ def clonevm( if snapshot_name: if NAME_RE.search(snapshot_name): raise CommandExecutionError("Snapshot name contains invalid characters") - params += " --snapshot {}".format(snapshot_name) + params += f" --snapshot {snapshot_name}" elif snapshot_uuid: if UUID_RE.search(snapshot_uuid): raise CommandExecutionError("Snapshot name contains invalid characters") - params += " --snapshot {}".format(snapshot_uuid) + params += f" --snapshot {snapshot_uuid}" valid_modes = ("machine", "machineandchildren", "all") if mode and mode not in valid_modes: @@ -375,7 +363,7 @@ def clonevm( if new_name: if NAME_RE.search(new_name): raise CommandExecutionError("New name contains invalid characters") - params += " --name {}".format(new_name) + params += f" --name {new_name}" if groups: if isinstance(groups, str): @@ -389,20 +377,18 @@ def clonevm( if basefolder: if not os.path.exists(basefolder): - raise CommandExecutionError( - "basefolder {} was not found".format(basefolder) - ) - params += " --basefolder {}".format(basefolder) + raise CommandExecutionError(f"basefolder {basefolder} was not found") + params += f" --basefolder {basefolder}" if new_uuid: if NAME_RE.search(new_uuid): raise CommandExecutionError("New UUID contains invalid characters") - params += " --uuid {}".format(new_uuid) + params += f" --uuid {new_uuid}" if register is True: params += " --register" - cmd = "{} clonevm {}".format(vboxcmd(), name) + cmd = f"{vboxcmd()} clonevm {name}" ret = salt.modules.cmdmod.run_all(cmd) if ret["retcode"] == 0: return True @@ -418,7 +404,7 @@ def clonemedium( mformat=None, variant=None, existing=False, - **kwargs + **kwargs, ): """ Clone a new VM from an existing VM @@ -454,11 +440,11 @@ def clonemedium( items = list_items(item) if uuid_in not in items: - raise CommandExecutionError("UUID {} was not found".format(uuid_in)) + raise CommandExecutionError(f"UUID {uuid_in} was not found") params += " " + uuid_in elif file_in: if not os.path.exists(file_in): - raise CommandExecutionError("File {} was not found".format(file_in)) + raise CommandExecutionError(f"File {file_in} was not found") params += " " + file_in if (uuid_out and file_out) or (not uuid_out and not file_out): @@ -476,7 +462,7 @@ def clonemedium( os.unlink(file_out) params += " " + file_out except OSError: - raise CommandExecutionError("{} is not a valid filename".format(file_out)) + raise CommandExecutionError(f"{file_out} is not a valid filename") if mformat: valid_mformat = ("VDI", "VMDK", "VHD", "RAW") @@ -503,7 +489,7 @@ def clonemedium( if existing: params += " --existing" - cmd = "{} clonemedium {}".format(vboxcmd(), params) + cmd = f"{vboxcmd()} clonemedium {params}" ret = salt.modules.cmdmod.run_all(cmd) if ret["retcode"] == 0: return True @@ -586,7 +572,7 @@ def list_items(item, details=False, group_by="UUID"): ret = {} tmp_id = None tmp_dict = {} - cmd = "{} list{} {}".format(vboxcmd(), flag, item) + cmd = f"{vboxcmd()} list{flag} {item}" for line in salt.modules.cmdmod.run(cmd).splitlines(): if not line.strip(): continue diff --git a/salt/modules/victorops.py b/salt/modules/victorops.py index 3f41a0b8ba4..058e0f3ed4a 100644 --- a/salt/modules/victorops.py +++ b/salt/modules/victorops.py @@ -48,10 +48,10 @@ def _query( path = "https://alert.victorops.com/integrations/generic/20131114/" if action: - path += "{}/".format(action) + path += f"{action}/" if api_key: - path += "{}/".format(api_key) + path += f"{api_key}/" if routing_key: path += routing_key diff --git a/salt/modules/virtualenv_mod.py b/salt/modules/virtualenv_mod.py index e662b339214..36fd6c9d93d 100644 --- a/salt/modules/virtualenv_mod.py +++ b/salt/modules/virtualenv_mod.py @@ -20,7 +20,7 @@ from salt.exceptions import CommandExecutionError, SaltInvocationError KNOWN_BINARY_NAMES = frozenset( [ "virtualenv-{}.{}".format(*sys.version_info[:2]), - "virtualenv{}".format(sys.version_info[0]), + f"virtualenv{sys.version_info[0]}", "virtualenv", ] ) @@ -87,7 +87,7 @@ def create( user=None, use_vt=False, saltenv="base", - **kwargs + **kwargs, ): """ Create a virtualenv @@ -211,15 +211,13 @@ def create( if python is not None and python.strip() != "": if not salt.utils.path.which(python): - raise CommandExecutionError( - "Cannot find requested python ({}).".format(python) - ) - cmd.append("--python={}".format(python)) + raise CommandExecutionError(f"Cannot find requested python ({python}).") + cmd.append(f"--python={python}") if extra_search_dir is not None: if isinstance(extra_search_dir, str) and extra_search_dir.strip() != "": extra_search_dir = [e.strip() for e in extra_search_dir.split(",")] for entry in extra_search_dir: - cmd.append("--extra-search-dir={}".format(entry)) + cmd.append(f"--extra-search-dir={entry}") if never_download is True: if (1, 10) <= virtualenv_version_info < (14, 0, 0): log.info( @@ -230,7 +228,7 @@ def create( else: cmd.append("--never-download") if prompt is not None and prompt.strip() != "": - cmd.append("--prompt='{}'".format(prompt)) + cmd.append(f"--prompt='{prompt}'") else: # venv module from the Python >= 3.3 standard library @@ -499,7 +497,7 @@ def _install_script(source, cwd, python, user, saltenv="base", use_vt=False): def _verify_safe_py_code(*args): for arg in args: if not salt.utils.verify.safe_py_code(arg): - raise SaltInvocationError("Unsafe python code detected in '{}'".format(arg)) + raise SaltInvocationError(f"Unsafe python code detected in '{arg}'") def _verify_virtualenv(venv_path): diff --git a/salt/modules/vmctl.py b/salt/modules/vmctl.py index 01021c3225f..01334383f92 100644 --- a/salt/modules/vmctl.py +++ b/salt/modules/vmctl.py @@ -59,7 +59,7 @@ def create_disk(name, size): salt '*' vmctl.create_disk /path/to/disk.img size=10G """ ret = False - cmd = "vmctl create {} -s {}".format(name, size) + cmd = f"vmctl create {name} -s {size}" result = __salt__["cmd.run_all"](cmd, output_loglevel="trace", python_shell=False) @@ -88,7 +88,7 @@ def load(path): salt '*' vmctl.load path=/etc/vm.switches.conf """ ret = False - cmd = "vmctl load {}".format(path) + cmd = f"vmctl load {path}" result = __salt__["cmd.run_all"](cmd, output_loglevel="trace", python_shell=False) if result["retcode"] == 0: ret = True @@ -226,7 +226,7 @@ def start( name = _id_to_name(id) if nics > 0: - cmd.append("-i {}".format(nics)) + cmd.append(f"-i {nics}") # Paths cannot be appended as otherwise the inserted whitespace is treated by # vmctl as being part of the path. @@ -234,10 +234,10 @@ def start( cmd.extend(["-b", bootpath]) if memory: - cmd.append("-m {}".format(memory)) + cmd.append(f"-m {memory}") if switch: - cmd.append("-n {}".format(switch)) + cmd.append(f"-n {switch}") if local_iface: cmd.append("-L") diff --git a/salt/modules/vsphere.py b/salt/modules/vsphere.py index 95dc3e03c29..667257e0ee5 100644 --- a/salt/modules/vsphere.py +++ b/salt/modules/vsphere.py @@ -355,7 +355,7 @@ def _get_proxy_connection_details(): elif proxytype == "esxvm": details = __salt__["esxvm.get_details"]() else: - raise CommandExecutionError("'{}' proxy is not supported".format(proxytype)) + raise CommandExecutionError(f"'{proxytype}' proxy is not supported") proxy_details = [ details.get("vcenter") if "vcenter" in details else details.get("host"), details.get("username"), @@ -783,7 +783,7 @@ def coredump_network_enable( enable_it = 1 else: enable_it = 0 - cmd = "system coredump network set -e {}".format(enable_it) + cmd = f"system coredump network set -e {enable_it}" ret = {} if esxi_hosts: @@ -1662,7 +1662,7 @@ def upload_ssh_key( if certificate_verify is None: certificate_verify = True - url = "{}://{}:{}/host/ssh_root_authorized_keys".format(protocol, host, port) + url = f"{protocol}://{host}:{port}/host/ssh_root_authorized_keys" ret = {} result = None try: @@ -1733,7 +1733,7 @@ def get_ssh_key( if certificate_verify is None: certificate_verify = True - url = "{}://{}:{}/host/ssh_root_authorized_keys".format(protocol, host, port) + url = f"{protocol}://{host}:{port}/host/ssh_root_authorized_keys" ret = {} try: result = salt.utils.http.query( @@ -1997,11 +1997,7 @@ def get_service_policy( # If we don't have a valid service, return. The service will be invalid for all hosts. if service_name not in valid_services: ret.update( - { - host_name: { - "Error": "{} is not a valid service name.".format(service_name) - } - } + {host_name: {"Error": f"{service_name} is not a valid service name."}} ) return ret @@ -2029,7 +2025,7 @@ def get_service_policy( # If we made it this far, something else has gone wrong. if ret.get(host_name) is None: - msg = "'vsphere.get_service_policy' failed for host {}.".format(host_name) + msg = f"'vsphere.get_service_policy' failed for host {host_name}." log.debug(msg) ret.update({host_name: {"Error": msg}}) @@ -2140,11 +2136,7 @@ def get_service_running( # If we don't have a valid service, return. The service will be invalid for all hosts. if service_name not in valid_services: ret.update( - { - host_name: { - "Error": "{} is not a valid service name.".format(service_name) - } - } + {host_name: {"Error": f"{service_name} is not a valid service name."}} ) return ret @@ -2172,7 +2164,7 @@ def get_service_running( # If we made it this far, something else has gone wrong. if ret.get(host_name) is None: - msg = "'vsphere.get_service_running' failed for host {}.".format(host_name) + msg = f"'vsphere.get_service_running' failed for host {host_name}." log.debug(msg) ret.update({host_name: {"Error": msg}}) @@ -2329,7 +2321,7 @@ def get_vsan_enabled( # We must have a VSAN Config in place get information about VSAN state. if vsan_config is None: - msg = "VSAN System Config Manager is unset for host '{}'.".format(host_name) + msg = f"VSAN System Config Manager is unset for host '{host_name}'." log.debug(msg) ret.update({host_name: {"Error": msg}}) else: @@ -3236,7 +3228,7 @@ def set_ntp_config( try: date_time_manager.UpdateDateTimeConfig(config=date_config) except vim.fault.HostConfigFault as err: - msg = "vsphere.ntp_configure_servers failed: {}".format(err) + msg = f"vsphere.ntp_configure_servers failed: {err}" log.debug(msg) ret.update({host_name: {"Error": msg}}) continue @@ -3355,11 +3347,7 @@ def service_start( # If we don't have a valid service, return. The service will be invalid for all hosts. if service_name not in valid_services: ret.update( - { - host_name: { - "Error": "{} is not a valid service name.".format(service_name) - } - } + {host_name: {"Error": f"{service_name} is not a valid service name."}} ) return ret @@ -3498,11 +3486,7 @@ def service_stop( # If we don't have a valid service, return. The service will be invalid for all hosts. if service_name not in valid_services: ret.update( - { - host_name: { - "Error": "{} is not a valid service name.".format(service_name) - } - } + {host_name: {"Error": f"{service_name} is not a valid service name."}} ) return ret @@ -3514,7 +3498,7 @@ def service_stop( try: service_manager.StopService(id=temp_service_name) except vim.fault.HostConfigFault as err: - msg = "'vsphere.service_stop' failed for host {}: {}".format(host_name, err) + msg = f"'vsphere.service_stop' failed for host {host_name}: {err}" log.debug(msg) ret.update({host_name: {"Error": msg}}) continue @@ -3639,11 +3623,7 @@ def service_restart( # If we don't have a valid service, return. The service will be invalid for all hosts. if service_name not in valid_services: ret.update( - { - host_name: { - "Error": "{} is not a valid service name.".format(service_name) - } - } + {host_name: {"Error": f"{service_name} is not a valid service name."}} ) return ret @@ -3780,11 +3760,7 @@ def set_service_policy( # If we don't have a valid service, return. The service will be invalid for all hosts. if service_name not in valid_services: ret.update( - { - host_name: { - "Error": "{} is not a valid service name.".format(service_name) - } - } + {host_name: {"Error": f"{service_name} is not a valid service name."}} ) return ret @@ -3811,7 +3787,7 @@ def set_service_policy( id=service_key, policy=service_policy ) except vim.fault.NotFound: - msg = "The service name '{}' was not found.".format(service_name) + msg = f"The service name '{service_name}' was not found." log.debug(msg) ret.update({host_name: {"Error": msg}}) continue @@ -4056,7 +4032,7 @@ def vmotion_disable( try: vmotion_system.DeselectVnic() except vim.fault.HostConfigFault as err: - msg = "vsphere.vmotion_disable failed: {}".format(err) + msg = f"vsphere.vmotion_disable failed: {err}" log.debug(msg) ret.update({host_name: {"Error": msg, "VMotion Disabled": False}}) continue @@ -4144,7 +4120,7 @@ def vmotion_enable( try: vmotion_system.SelectVnic(device) except vim.fault.HostConfigFault as err: - msg = "vsphere.vmotion_disable failed: {}".format(err) + msg = f"vsphere.vmotion_disable failed: {err}" log.debug(msg) ret.update({host_name: {"Error": msg, "VMotion Enabled": False}}) continue @@ -4871,7 +4847,7 @@ def create_dvs(dvs_dict, dvs_name, service_instance=None): dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs_name]) if not dvs_refs: raise VMwareObjectRetrievalError( - "DVS '{}' wasn't found in datacenter '{}'".format(dvs_name, datacenter) + f"DVS '{dvs_name}' wasn't found in datacenter '{datacenter}'" ) dvs_ref = dvs_refs[0] salt.utils.vmware.set_dvs_network_resource_management_enabled( @@ -4924,7 +4900,7 @@ def update_dvs(dvs_dict, dvs, service_instance=None): dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs]) if not dvs_refs: raise VMwareObjectRetrievalError( - "DVS '{}' wasn't found in datacenter '{}'".format(dvs, datacenter) + f"DVS '{dvs}' wasn't found in datacenter '{datacenter}'" ) dvs_ref = dvs_refs[0] # Build the config spec from the input @@ -5155,7 +5131,7 @@ def list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None): if dvs: dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs]) if not dvs_refs: - raise VMwareObjectRetrievalError("DVS '{}' was not retrieved".format(dvs)) + raise VMwareObjectRetrievalError(f"DVS '{dvs}' was not retrieved") dvs_ref = dvs_refs[0] get_all_portgroups = True if not portgroup_names else False for pg_ref in salt.utils.vmware.get_dvportgroups( @@ -5198,7 +5174,7 @@ def list_uplink_dvportgroup(dvs, service_instance=None): dc_ref = salt.utils.vmware.get_datacenter(service_instance, datacenter) dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs]) if not dvs_refs: - raise VMwareObjectRetrievalError("DVS '{}' was not retrieved".format(dvs)) + raise VMwareObjectRetrievalError(f"DVS '{dvs}' was not retrieved") uplink_pg_ref = salt.utils.vmware.get_uplink_dvportgroup(dvs_refs[0]) return _get_dvportgroup_dict(uplink_pg_ref) @@ -5433,7 +5409,7 @@ def create_dvportgroup(portgroup_dict, portgroup_name, dvs, service_instance=Non dc_ref = salt.utils.vmware.get_datacenter(service_instance, datacenter) dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs]) if not dvs_refs: - raise VMwareObjectRetrievalError("DVS '{}' was not retrieved".format(dvs)) + raise VMwareObjectRetrievalError(f"DVS '{dvs}' was not retrieved") # Make the name of the dvportgroup consistent with the parameter portgroup_dict["name"] = portgroup_name spec = vim.DVPortgroupConfigSpec() @@ -5489,14 +5465,12 @@ def update_dvportgroup(portgroup_dict, portgroup, dvs, service_instance=True): dc_ref = salt.utils.vmware.get_datacenter(service_instance, datacenter) dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs]) if not dvs_refs: - raise VMwareObjectRetrievalError("DVS '{}' was not retrieved".format(dvs)) + raise VMwareObjectRetrievalError(f"DVS '{dvs}' was not retrieved") pg_refs = salt.utils.vmware.get_dvportgroups( dvs_refs[0], portgroup_names=[portgroup] ) if not pg_refs: - raise VMwareObjectRetrievalError( - "Portgroup '{}' was not retrieved".format(portgroup) - ) + raise VMwareObjectRetrievalError(f"Portgroup '{portgroup}' was not retrieved") pg_props = salt.utils.vmware.get_properties_of_managed_object( pg_refs[0], ["config"] ) @@ -5555,14 +5529,12 @@ def remove_dvportgroup(portgroup, dvs, service_instance=None): dc_ref = salt.utils.vmware.get_datacenter(service_instance, datacenter) dvs_refs = salt.utils.vmware.get_dvss(dc_ref, dvs_names=[dvs]) if not dvs_refs: - raise VMwareObjectRetrievalError("DVS '{}' was not retrieved".format(dvs)) + raise VMwareObjectRetrievalError(f"DVS '{dvs}' was not retrieved") pg_refs = salt.utils.vmware.get_dvportgroups( dvs_refs[0], portgroup_names=[portgroup] ) if not pg_refs: - raise VMwareObjectRetrievalError( - "Portgroup '{}' was not retrieved".format(portgroup) - ) + raise VMwareObjectRetrievalError(f"Portgroup '{portgroup}' was not retrieved") salt.utils.vmware.remove_dvportgroup(pg_refs[0]) return True @@ -5833,7 +5805,7 @@ def update_storage_policy(policy, policy_dict, service_instance=None): profile_manager = salt.utils.pbm.get_profile_manager(service_instance) policies = salt.utils.pbm.get_storage_policies(profile_manager, [policy]) if not policies: - raise VMwareObjectRetrievalError("Policy '{}' was not found".format(policy)) + raise VMwareObjectRetrievalError(f"Policy '{policy}' was not found") policy_ref = policies[0] policy_update_spec = pbm.profile.CapabilityBasedProfileUpdateSpec() log.trace("Setting policy values in policy_update_spec") @@ -5876,9 +5848,7 @@ def list_default_storage_policy_of_datastore(datastore, service_instance=None): service_instance, target_ref, datastore_names=[datastore] ) if not ds_refs: - raise VMwareObjectRetrievalError( - "Datastore '{}' was not found".format(datastore) - ) + raise VMwareObjectRetrievalError(f"Datastore '{datastore}' was not found") profile_manager = salt.utils.pbm.get_profile_manager(service_instance) policy = salt.utils.pbm.get_default_storage_policy_of_datastore( profile_manager, ds_refs[0] @@ -5920,7 +5890,7 @@ def assign_default_storage_policy_to_datastore( # Find policy policies = salt.utils.pbm.get_storage_policies(profile_manager, [policy]) if not policies: - raise VMwareObjectRetrievalError("Policy '{}' was not found".format(policy)) + raise VMwareObjectRetrievalError(f"Policy '{policy}' was not found") policy_ref = policies[0] # Find datastore target_ref = _get_proxy_target(service_instance) @@ -5928,9 +5898,7 @@ def assign_default_storage_policy_to_datastore( service_instance, target_ref, datastore_names=[datastore] ) if not ds_refs: - raise VMwareObjectRetrievalError( - "Datastore '{}' was not found".format(datastore) - ) + raise VMwareObjectRetrievalError(f"Datastore '{datastore}' was not found") ds_ref = ds_refs[0] salt.utils.pbm.assign_default_storage_policy_to_datastore( profile_manager, policy_ref, ds_ref @@ -6656,7 +6624,7 @@ def create_vmfs_datastore( disks = salt.utils.vmware.get_disks(host_ref, disk_ids=[disk_id]) if not disks: raise VMwareObjectRetrievalError( - "Disk '{}' was not found in host '{}'".format(disk_id, hostname) + f"Disk '{disk_id}' was not found in host '{hostname}'" ) ds_ref = salt.utils.vmware.create_vmfs_datastore( host_ref, datastore_name, disks[0], vmfs_major_version @@ -6695,9 +6663,7 @@ def rename_datastore(datastore_name, new_datastore_name, service_instance=None): service_instance, target, datastore_names=[datastore_name] ) if not datastores: - raise VMwareObjectRetrievalError( - "Datastore '{}' was not found".format(datastore_name) - ) + raise VMwareObjectRetrievalError(f"Datastore '{datastore_name}' was not found") ds = datastores[0] salt.utils.vmware.rename_datastore(ds, new_datastore_name) return True @@ -6730,12 +6696,10 @@ def remove_datastore(datastore, service_instance=None): service_instance, reference=target, datastore_names=[datastore] ) if not datastores: - raise VMwareObjectRetrievalError( - "Datastore '{}' was not found".format(datastore) - ) + raise VMwareObjectRetrievalError(f"Datastore '{datastore}' was not found") if len(datastores) > 1: raise VMwareObjectRetrievalError( - "Multiple datastores '{}' were found".format(datastore) + f"Multiple datastores '{datastore}' were found" ) salt.utils.vmware.remove_datastore(service_instance, datastores[0]) return True @@ -6969,9 +6933,7 @@ def assign_license( if safety_checks: licenses = salt.utils.vmware.get_licenses(service_instance) if not [l for l in licenses if l.licenseKey == license_key]: - raise VMwareObjectRetrievalError( - "License '{}' wasn't found".format(license_name) - ) + raise VMwareObjectRetrievalError(f"License '{license_name}' wasn't found") salt.utils.vmware.assign_license( service_instance, license_key, @@ -7347,7 +7309,7 @@ def create_diskgroup( for id in disk_ids: if not [d for d in disks if d.canonicalName == id]: raise VMwareObjectRetrievalError( - "No disk with id '{}' was found in ESXi host '{}'".format(id, hostname) + f"No disk with id '{id}' was found in ESXi host '{hostname}'" ) cache_disk = [d for d in disks if d.canonicalName == cache_disk_id][0] capacity_disks = [d for d in disks if d.canonicalName in capacity_disk_ids] @@ -7596,7 +7558,7 @@ def get_host_cache(service_instance=None): return { "enabled": True, "datastore": {"name": hci.key.name}, - "swap_size": "{}MiB".format(hci.swapSize), + "swap_size": f"{hci.swapSize}MiB", } @@ -7660,7 +7622,7 @@ def configure_host_cache( ) if not ds_refs: raise VMwareObjectRetrievalError( - "Datastore '{}' was not found on host '{}'".format(datastore, hostname) + f"Datastore '{datastore}' was not found on host '{hostname}'" ) ds_ref = ds_refs[0] salt.utils.vmware.configure_host_cache(host_ref, ds_ref, swap_size_MiB) @@ -7959,7 +7921,7 @@ def _set_syslog_config_helper( """ Helper function for set_syslog_config that sets the config and populates the return dictionary. """ - cmd = "system syslog config set --{} {}".format(syslog_config, config_value) + cmd = f"system syslog config set --{syslog_config} {config_value}" ret_dict = {} valid_resets = [ @@ -7974,7 +7936,7 @@ def _set_syslog_config_helper( ret_dict.update( { "success": False, - "message": "'{}' is not a valid config variable.".format(syslog_config), + "message": f"'{syslog_config}' is not a valid config variable.", } ) return ret_dict @@ -8217,14 +8179,14 @@ def add_host_to_dvs( dvs = salt.utils.vmware._get_dvs(service_instance, dvs_name) if not dvs: ret["message"].append( - "No Distributed Virtual Switch found with name {}".format(dvs_name) + f"No Distributed Virtual Switch found with name {dvs_name}" ) ret["success"] = False target_portgroup = salt.utils.vmware._get_dvs_portgroup(dvs, target_portgroup_name) if not target_portgroup: ret["message"].append( - "No target portgroup found with name {}".format(target_portgroup_name) + f"No target portgroup found with name {target_portgroup_name}" ) ret["success"] = False @@ -8233,7 +8195,7 @@ def add_host_to_dvs( ) if not uplink_portgroup: ret["message"].append( - "No uplink portgroup found with name {}".format(uplink_portgroup_name) + f"No uplink portgroup found with name {uplink_portgroup_name}" ) ret["success"] = False @@ -8244,7 +8206,7 @@ def add_host_to_dvs( try: host_names = _check_hosts(service_instance, host, host_names) except CommandExecutionError as e: - ret["message"] = "Error retrieving hosts: {}".format(e.msg) + ret["message"] = f"Error retrieving hosts: {e.msg}" return ret for host_name in host_names: @@ -8271,9 +8233,7 @@ def add_host_to_dvs( p_nics = salt.utils.vmware._get_pnics(host_ref) p_nic = [x for x in p_nics if x.device == vmnic_name] if not p_nic: - ret[host_name].update( - {"message": "Physical nic {} not found".format(vmknic_name)} - ) + ret[host_name].update({"message": f"Physical nic {vmknic_name} not found"}) ret["success"] = False continue @@ -8281,9 +8241,7 @@ def add_host_to_dvs( v_nic = [x for x in v_nics if x.device == vmknic_name] if not v_nic: - ret[host_name].update( - {"message": "Virtual nic {} not found".format(vmnic_name)} - ) + ret[host_name].update({"message": f"Virtual nic {vmnic_name} not found"}) ret["success"] = False continue @@ -8376,7 +8334,7 @@ def add_host_to_dvs( except Exception as e: # pylint: disable=broad-except if hasattr(e, "msg"): ret[host_name].update( - {"message": "Failed to migrate adapters ({})".format(e.msg)} + {"message": f"Failed to migrate adapters ({e.msg})"} ) continue else: @@ -8875,7 +8833,7 @@ def _get_scsi_controller_key(bus_number, scsi_ctrls): ] if not keys: raise salt.exceptions.VMwareVmCreationError( - "SCSI controller number {} doesn't exist".format(bus_number) + f"SCSI controller number {bus_number} doesn't exist" ) return keys[0] @@ -9054,7 +9012,7 @@ def _create_network_backing(network_name, switch_type, parent_ref): ) if not networks: raise salt.exceptions.VMwareObjectRetrievalError( - "The network '{}' could not be retrieved.".format(network_name) + f"The network '{network_name}' could not be retrieved." ) network_ref = networks[0] backing = vim.vm.device.VirtualEthernetCard.NetworkBackingInfo() @@ -9066,7 +9024,7 @@ def _create_network_backing(network_name, switch_type, parent_ref): ) if not networks: raise salt.exceptions.VMwareObjectRetrievalError( - "The port group '{}' could not be retrieved.".format(network_name) + f"The port group '{network_name}' could not be retrieved." ) network_ref = networks[0] dvs_port_connection = vim.dvs.PortConnection( @@ -9834,7 +9792,7 @@ def _get_device_by_key(devices, key): return device_keys[0] else: raise salt.exceptions.VMwareObjectNotFoundError( - "Virtual machine device with unique key {} does not exist".format(key) + f"Virtual machine device with unique key {key} does not exist" ) @@ -9854,7 +9812,7 @@ def _get_device_by_label(devices, label): return device_labels[0] else: raise salt.exceptions.VMwareObjectNotFoundError( - "Virtual machine device with label {} does not exist".format(label) + f"Virtual machine device with label {label} does not exist" ) @@ -11212,7 +11170,7 @@ def create_vm( )[0] if not datastore_object: raise salt.exceptions.ArgumentValueError( - "Specified datastore: '{}' does not exist.".format(datastore) + f"Specified datastore: '{datastore}' does not exist." ) try: ds_summary = salt.utils.vmware.get_properties_of_managed_object( @@ -11223,7 +11181,7 @@ def create_vm( "The vmPathName should be the datastore " "name if the datastore type is vsan" ) - config_spec.files.vmPathName = "[{}]".format(datastore) + config_spec.files.vmPathName = f"[{datastore}]" else: config_spec.files.vmPathName = "[{0}] {1}/{1}.vmx".format( datastore, vm_name diff --git a/salt/modules/webutil.py b/salt/modules/webutil.py index 746c9a7299b..bb5109d1c2a 100644 --- a/salt/modules/webutil.py +++ b/salt/modules/webutil.py @@ -65,7 +65,7 @@ def useradd(pwfile, user, password, opts="", runas=None): if not os.path.exists(pwfile): opts += "c" - cmd = ["htpasswd", "-b{}".format(opts), pwfile, user, password] + cmd = ["htpasswd", f"-b{opts}", pwfile, user, password] return __salt__["cmd.run_all"](cmd, runas=runas, python_shell=False) @@ -139,7 +139,7 @@ def verify(pwfile, user, password, opts="", runas=None): if not os.path.exists(pwfile): return False - cmd = ["htpasswd", "-bv{}".format(opts), pwfile, user, password] + cmd = ["htpasswd", f"-bv{opts}", pwfile, user, password] ret = __salt__["cmd.run_all"](cmd, runas=runas, python_shell=False) log.debug("Result of verifying htpasswd for user %s: %s", user, ret) diff --git a/salt/modules/win_certutil.py b/salt/modules/win_certutil.py index efed109e2c0..9a0fd737ff7 100644 --- a/salt/modules/win_certutil.py +++ b/salt/modules/win_certutil.py @@ -48,10 +48,10 @@ def get_cert_serial(cert_file, saltenv="base"): # Since we're allowing a path, let's make sure it exists if not os.path.exists(cert_file): - msg = "cert_file not found: {}".format(cert_file) + msg = f"cert_file not found: {cert_file}" raise CommandExecutionError(msg) - cmd = 'certutil.exe -silent -verify "{}"'.format(cert_file) + cmd = f'certutil.exe -silent -verify "{cert_file}"' out = __salt__["cmd.run"](cmd) # match serial number by paragraph to work with multiple languages matches = re.search(r":\s*(\w*)\r\n\r\n", out) @@ -77,7 +77,7 @@ def get_stored_cert_serials(store): salt '*' certutil.get_stored_cert_serials """ - cmd = 'certutil.exe -store "{}"'.format(store) + cmd = f'certutil.exe -store "{store}"' out = __salt__["cmd.run"](cmd) # match serial numbers by header position to work with multiple languages matches = re.findall(r"={16}\r\n.*:\s*(\w*)\r\n", out) @@ -112,10 +112,10 @@ def add_store(source, store, retcode=False, saltenv="base"): # Since we're allowing a path, let's make sure it exists if not os.path.exists(source): - msg = "cert_file not found: {}".format(source) + msg = f"cert_file not found: {source}" raise CommandExecutionError(msg) - cmd = 'certutil.exe -addstore {} "{}"'.format(store, source) + cmd = f'certutil.exe -addstore {store} "{source}"' if retcode: return __salt__["cmd.retcode"](cmd) else: @@ -150,11 +150,11 @@ def del_store(source, store, retcode=False, saltenv="base"): # Since we're allowing a path, let's make sure it exists if not os.path.exists(source): - msg = "cert_file not found: {}".format(source) + msg = f"cert_file not found: {source}" raise CommandExecutionError(msg) serial = get_cert_serial(source) - cmd = 'certutil.exe -delstore {} "{}"'.format(store, serial) + cmd = f'certutil.exe -delstore {store} "{serial}"' if retcode: return __salt__["cmd.retcode"](cmd) else: diff --git a/salt/modules/win_dacl.py b/salt/modules/win_dacl.py index d9114a56453..b8b5aca3dc3 100644 --- a/salt/modules/win_dacl.py +++ b/salt/modules/win_dacl.py @@ -512,7 +512,7 @@ def add_ace(path, objectType, user, permission, acetype, propagation): if acesAdded: ret["changes"]["Added ACEs"] = acesAdded else: - ret["comment"] = "Unable to obtain the DACL of {}".format(path) + ret["comment"] = f"Unable to obtain the DACL of {path}" else: ret["comment"] = "An empty value was specified for a required item." ret["result"] = False @@ -603,7 +603,7 @@ def rm_ace(path, objectType, user, permission=None, acetype=None, propagation=No ret["result"] = True except Exception as e: # pylint: disable=broad-except ret["result"] = False - ret["comment"] = "Error removing ACE. The error was {}.".format(e) + ret["comment"] = f"Error removing ACE. The error was {e}." return ret else: ret["comment"] = "The specified ACE was not found on the path." @@ -619,9 +619,9 @@ def _ace_to_text(ace, objectType): try: userSid = win32security.LookupAccountSid("", ace[2]) if userSid[1]: - userSid = "{1}\\{0}".format(userSid[0], userSid[1]) + userSid = f"{userSid[1]}\\{userSid[0]}" else: - userSid = "{}".format(userSid[0]) + userSid = f"{userSid[0]}" except Exception: # pylint: disable=broad-except userSid = win32security.ConvertSidToStringSid(ace[2]) tPerm = ace[1] @@ -643,7 +643,7 @@ def _ace_to_text(ace, objectType): if dc.validPropagations[objectType][x]["BITS"] == tProps: tProps = dc.validPropagations[objectType][x]["TEXT"] break - return "{} {} {} on {} {}".format(userSid, tAceType, tPerm, tProps, tInherited) + return f"{userSid} {tAceType} {tPerm} on {tProps} {tInherited}" def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=False): @@ -730,7 +730,7 @@ def _set_dacl_inheritance(path, objectType, inheritance=True, copy=True, clear=F except Exception as e: # pylint: disable=broad-except ret["result"] = False ret["comment"] = ( - "Error attempting to set the inheritance. The error was {}.".format(e) + f"Error attempting to set the inheritance. The error was {e}." ) return ret @@ -818,7 +818,7 @@ def check_inheritance(path, objectType, user=None): except Exception as e: # pylint: disable=broad-except ret["result"] = False ret["comment"] = ( - "Error obtaining the Security Descriptor or DACL of the path: {}.".format(e) + f"Error obtaining the Security Descriptor or DACL of the path: {e}." ) return ret diff --git a/salt/modules/win_disk.py b/salt/modules/win_disk.py index 155efa5fe3f..92fa81ed59d 100644 --- a/salt/modules/win_disk.py +++ b/salt/modules/win_disk.py @@ -53,19 +53,19 @@ def usage(): available_bytes, total_bytes, total_free_bytes, - ) = win32api.GetDiskFreeSpaceEx("{}:\\".format(drive)) + ) = win32api.GetDiskFreeSpaceEx(f"{drive}:\\") used = total_bytes - total_free_bytes capacity = used / float(total_bytes) * 100 - ret["{}:\\".format(drive)] = { - "filesystem": "{}:\\".format(drive), + ret[f"{drive}:\\"] = { + "filesystem": f"{drive}:\\", "1K-blocks": total_bytes / 1024, "used": used / 1024, "available": total_free_bytes / 1024, - "capacity": "{:.0f}%".format(capacity), + "capacity": f"{capacity:.0f}%", } except Exception: # pylint: disable=broad-except - ret["{}:\\".format(drive)] = { - "filesystem": "{}:\\".format(drive), + ret[f"{drive}:\\"] = { + "filesystem": f"{drive}:\\", "1K-blocks": None, "used": None, "available": None, diff --git a/salt/modules/win_dism.py b/salt/modules/win_dism.py index c79e1c910a8..11838bf8ed6 100644 --- a/salt/modules/win_dism.py +++ b/salt/modules/win_dism.py @@ -52,11 +52,11 @@ def _get_components(type_regex, plural_type, install_value, image=None): cmd = [ bin_dism, "/English", - "/Image:{}".format(image) if image else "/Online", - "/Get-{}".format(plural_type), + f"/Image:{image}" if image else "/Online", + f"/Get-{plural_type}", ] out = __salt__["cmd.run"](cmd) - pattern = r"{} : (.*)\r\n.*State : {}\r\n".format(type_regex, install_value) + pattern = rf"{type_regex} : (.*)\r\n.*State : {install_value}\r\n" capabilities = re.findall(pattern, out, re.MULTILINE) capabilities.sort() return capabilities @@ -101,13 +101,13 @@ def add_capability( cmd = [ bin_dism, "/Quiet", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Add-Capability", - "/CapabilityName:{}".format(capability), + f"/CapabilityName:{capability}", ] if source: - cmd.append("/Source:{}".format(source)) + cmd.append(f"/Source:{source}") if limit_access: cmd.append("/LimitAccess") if not restart: @@ -149,9 +149,9 @@ def remove_capability(capability, image=None, restart=False): cmd = [ bin_dism, "/Quiet", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Remove-Capability", - "/CapabilityName:{}".format(capability), + f"/CapabilityName:{capability}", ] if not restart: @@ -191,7 +191,7 @@ def get_capabilities(image=None): cmd = [ bin_dism, "/English", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Get-Capabilities", ] out = __salt__["cmd.run"](cmd) @@ -303,14 +303,14 @@ def add_feature( cmd = [ bin_dism, "/Quiet", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Enable-Feature", - "/FeatureName:{}".format(feature), + f"/FeatureName:{feature}", ] if package: - cmd.append("/PackageName:{}".format(package)) + cmd.append(f"/PackageName:{package}") if source: - cmd.append("/Source:{}".format(source)) + cmd.append(f"/Source:{source}") if limit_access: cmd.append("/LimitAccess") if enable_parent: @@ -346,9 +346,9 @@ def remove_feature(feature, remove_payload=False, image=None, restart=False): cmd = [ bin_dism, "/Quiet", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Disable-Feature", - "/FeatureName:{}".format(feature), + f"/FeatureName:{feature}", ] if remove_payload: @@ -394,15 +394,15 @@ def get_features(package=None, image=None): cmd = [ bin_dism, "/English", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Get-Features", ] if package: if "~" in package: - cmd.append("/PackageName:{}".format(package)) + cmd.append(f"/PackageName:{package}") else: - cmd.append("/PackagePath:{}".format(package)) + cmd.append(f"/PackagePath:{package}") out = __salt__["cmd.run"](cmd) @@ -496,9 +496,9 @@ def add_package( cmd = [ bin_dism, "/Quiet", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Add-Package", - "/PackagePath:{}".format(package), + f"/PackagePath:{package}", ] if ignore_check: @@ -542,7 +542,7 @@ def remove_package(package, image=None, restart=False): cmd = [ bin_dism, "/Quiet", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Remove-Package", ] @@ -550,9 +550,9 @@ def remove_package(package, image=None, restart=False): cmd.append("/NoRestart") if "~" in package: - cmd.append("/PackageName:{}".format(package)) + cmd.append(f"/PackageName:{package}") else: - cmd.append("/PackagePath:{}".format(package)) + cmd.append(f"/PackagePath:{package}") return __salt__["cmd.run_all"](cmd) @@ -584,9 +584,9 @@ def get_kb_package_name(kb, image=None): salt '*' dism.get_kb_package_name 1231231 """ packages = installed_packages(image=image) - search = kb.upper() if kb.lower().startswith("kb") else "KB{}".format(kb) + search = kb.upper() if kb.lower().startswith("kb") else f"KB{kb}" for package in packages: - if "_{}~".format(search) in package: + if f"_{search}~" in package: return package return None @@ -622,7 +622,7 @@ def remove_kb(kb, image=None, restart=False): """ pkg_name = get_kb_package_name(kb=kb, image=image) if pkg_name is None: - msg = "{} not installed".format(kb) + msg = f"{kb} not installed" raise CommandExecutionError(msg) log.debug("Found: %s", pkg_name) return remove_package(package=pkg_name, image=image, restart=restart) @@ -679,14 +679,14 @@ def package_info(package, image=None): cmd = [ bin_dism, "/English", - "/Image:{}".format(image) if image else "/Online", + f"/Image:{image}" if image else "/Online", "/Get-PackageInfo", ] if "~" in package: - cmd.append("/PackageName:{}".format(package)) + cmd.append(f"/PackageName:{package}") else: - cmd.append("/PackagePath:{}".format(package)) + cmd.append(f"/PackagePath:{package}") out = __salt__["cmd.run_all"](cmd) diff --git a/salt/modules/win_dns_client.py b/salt/modules/win_dns_client.py index 89ba38fffb1..d72e344bbf8 100644 --- a/salt/modules/win_dns_client.py +++ b/salt/modules/win_dns_client.py @@ -118,7 +118,7 @@ def add_dns(ip, interface="Local Area Connection", index=1): "dns", interface, ip, - "index={}".format(index), + f"index={index}", "validate=no", ] diff --git a/salt/modules/win_dsc.py b/salt/modules/win_dsc.py index 9c99efae61b..997a72fd787 100644 --- a/salt/modules/win_dsc.py +++ b/salt/modules/win_dsc.py @@ -60,7 +60,7 @@ def _pshell(cmd, cwd=None, json_depth=2, ignore_retcode=False): CommandExecutionError. """ if "convertto-json" not in cmd.lower(): - cmd = "{} | ConvertTo-Json -Depth {}".format(cmd, json_depth) + cmd = f"{cmd} | ConvertTo-Json -Depth {json_depth}" log.debug("DSC: %s", cmd) results = __salt__["cmd.run_all"]( cmd, @@ -75,9 +75,7 @@ def _pshell(cmd, cwd=None, json_depth=2, ignore_retcode=False): if "retcode" not in results or results["retcode"] != 0: # run_all logs an error to log.error, fail hard back to the user - raise CommandExecutionError( - "Issue executing PowerShell {}".format(cmd), info=results - ) + raise CommandExecutionError(f"Issue executing PowerShell {cmd}", info=results) # Sometimes Powershell returns an empty string, which isn't valid JSON if results["stdout"] == "": @@ -267,7 +265,7 @@ def compile_config( path=source, dest=path, saltenv=salt_env, makedirs=True ) if not cached_files: - error = "Failed to cache {}".format(source) + error = f"Failed to cache {source}" log.error("DSC: %s", error) raise CommandExecutionError(error) @@ -277,13 +275,13 @@ def compile_config( path=config_data_source, dest=config_data, saltenv=salt_env, makedirs=True ) if not cached_files: - error = "Failed to cache {}".format(config_data_source) + error = f"Failed to cache {config_data_source}" log.error("DSC: %s", error) raise CommandExecutionError(error) # Make sure the path exists if not os.path.exists(path): - error = "{} not found".format(path) + error = f"{path} not found" log.error("DSC: %s", error) raise CommandExecutionError(error) @@ -341,8 +339,8 @@ def compile_config( log.info("DSC: Compile Config: %s", ret) return ret - error = "Failed to compile config: {}".format(path) - error += "\nReturned: {}".format(ret) + error = f"Failed to compile config: {path}" + error += f"\nReturned: {ret}" log.error("DSC: %s", error) raise CommandExecutionError(error) @@ -394,7 +392,7 @@ def apply_config(path, source=None, salt_env="base"): source_name = os.path.basename(os.path.normpath(source)) if path_name.lower() != source_name.lower(): # Append the Source name to the Path - path = "{}\\{}".format(path, source_name) + path = f"{path}\\{source_name}" log.debug("DSC: %s appended to the path.", source_name) # Destination path minus the basename @@ -402,7 +400,7 @@ def apply_config(path, source=None, salt_env="base"): log.info("DSC: Caching %s", source) cached_files = __salt__["cp.get_dir"](source, dest_path, salt_env) if not cached_files: - error = "Failed to copy {}".format(source) + error = f"Failed to copy {source}" log.error("DSC: %s", error) raise CommandExecutionError(error) else: @@ -410,13 +408,13 @@ def apply_config(path, source=None, salt_env="base"): # Make sure the path exists if not os.path.exists(config): - error = "{} not found".format(config) + error = f"{config} not found" log.error("DSC: %s", error) raise CommandExecutionError(error) # Run the DSC Configuration # Putting quotes around the parameter protects against command injection - cmd = 'Start-DscConfiguration -Path "{}" -Wait -Force'.format(config) + cmd = f'Start-DscConfiguration -Path "{config}" -Wait -Force' _pshell(cmd) cmd = "$status = Get-DscConfigurationStatus; $status.Status" @@ -541,7 +539,7 @@ def remove_config(reset=False): if os.path.exists(path): log.info("DSC: Removing %s", path) if not __salt__["file.remove"](path): - error = "Failed to remove {}".format(path) + error = f"Failed to remove {path}" log.error("DSC: %s", error) raise CommandExecutionError(error) @@ -550,13 +548,13 @@ def remove_config(reset=False): ) # Remove History - _remove_fs_obj("{}\\DSCStatusHistory.mof".format(dsc_config_dir)) + _remove_fs_obj(f"{dsc_config_dir}\\DSCStatusHistory.mof") # Remove Engine Cache - _remove_fs_obj("{}\\DSCEngineCache.mof".format(dsc_config_dir)) + _remove_fs_obj(f"{dsc_config_dir}\\DSCEngineCache.mof") # Remove Status Directory - _remove_fs_obj("{}\\ConfigurationStatus".format(dsc_config_dir)) + _remove_fs_obj(f"{dsc_config_dir}\\ConfigurationStatus") return True @@ -756,7 +754,7 @@ def set_lcm_config( "or ApplyAndAutoCorrect. Passed {}".format(config_mode) ) raise SaltInvocationError(error) - cmd += ' ConfigurationMode = "{}";'.format(config_mode) + cmd += f' ConfigurationMode = "{config_mode}";' if config_mode_freq: if not isinstance(config_mode_freq, int): error = "config_mode_freq must be an integer. Passed {}".format( @@ -771,11 +769,11 @@ def set_lcm_config( raise SaltInvocationError( "refresh_mode must be one of Disabled, Push, or Pull" ) - cmd += ' RefreshMode = "{}";'.format(refresh_mode) + cmd += f' RefreshMode = "{refresh_mode}";' if refresh_freq: if not isinstance(refresh_freq, int): raise SaltInvocationError("refresh_freq must be an integer") - cmd += " RefreshFrequencyMins = {};".format(refresh_freq) + cmd += f" RefreshFrequencyMins = {refresh_freq};" if reboot_if_needed is not None: if not isinstance(reboot_if_needed, bool): raise SaltInvocationError("reboot_if_needed must be a boolean value") @@ -783,22 +781,22 @@ def set_lcm_config( reboot_if_needed = "$true" else: reboot_if_needed = "$false" - cmd += " RebootNodeIfNeeded = {};".format(reboot_if_needed) + cmd += f" RebootNodeIfNeeded = {reboot_if_needed};" if action_after_reboot: if action_after_reboot not in ("ContinueConfiguration", "StopConfiguration"): raise SaltInvocationError( "action_after_reboot must be one of " "ContinueConfiguration or StopConfiguration" ) - cmd += ' ActionAfterReboot = "{}"'.format(action_after_reboot) + cmd += f' ActionAfterReboot = "{action_after_reboot}"' if certificate_id is not None: if certificate_id == "": certificate_id = None - cmd += ' CertificateID = "{}";'.format(certificate_id) + cmd += f' CertificateID = "{certificate_id}";' if configuration_id is not None: if configuration_id == "": configuration_id = None - cmd += ' ConfigurationID = "{}";'.format(configuration_id) + cmd += f' ConfigurationID = "{configuration_id}";' if allow_module_overwrite is not None: if not isinstance(allow_module_overwrite, bool): raise SaltInvocationError("allow_module_overwrite must be a boolean value") @@ -806,7 +804,7 @@ def set_lcm_config( allow_module_overwrite = "$true" else: allow_module_overwrite = "$false" - cmd += " AllowModuleOverwrite = {};".format(allow_module_overwrite) + cmd += f" AllowModuleOverwrite = {allow_module_overwrite};" if debug_mode is not False: if debug_mode is None: debug_mode = "None" @@ -815,7 +813,7 @@ def set_lcm_config( "debug_mode must be one of None, ForceModuleImport, " "ResourceScriptBreakAll, or All" ) - cmd += ' DebugMode = "{}";'.format(debug_mode) + cmd += f' DebugMode = "{debug_mode}";' if status_retention_days: if not isinstance(status_retention_days, int): raise SaltInvocationError("status_retention_days must be an integer") @@ -823,7 +821,7 @@ def set_lcm_config( status_retention_days ) cmd += " }}};" - cmd += r'SaltConfig -OutputPath "{}\SaltConfig"'.format(temp_dir) + cmd += rf'SaltConfig -OutputPath "{temp_dir}\SaltConfig"' # Execute Config to create the .mof _pshell(cmd) @@ -831,7 +829,7 @@ def set_lcm_config( # Apply the config cmd = r'Set-DscLocalConfigurationManager -Path "{}\SaltConfig"' r"".format(temp_dir) ret = __salt__["cmd.run_all"](cmd, shell="powershell", python_shell=True) - __salt__["file.remove"](r"{}\SaltConfig".format(temp_dir)) + __salt__["file.remove"](rf"{temp_dir}\SaltConfig") if not ret["retcode"]: log.info("DSC: LCM config applied successfully") return True diff --git a/salt/modules/win_event.py b/salt/modules/win_event.py index d8d9bde990b..71fc1ac4928 100644 --- a/salt/modules/win_event.py +++ b/salt/modules/win_event.py @@ -175,7 +175,7 @@ def _get_handle(log_name): return win32evtlog.OpenEventLog(None, log_name) except pywintypes.error as exc: raise FileNotFoundError( - "Failed to open log: {}\nError: {}".format(log_name, exc.strerror) + f"Failed to open log: {log_name}\nError: {exc.strerror}" ) @@ -680,7 +680,7 @@ def add( if event_type is None: event_type = event_types["Error"] elif event_type not in event_types: - msg = "Incorrect event type: {}".format(event_type) + msg = f"Incorrect event type: {event_type}" raise CommandExecutionError(msg) else: event_type = event_types[event_type] diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py index a7a411c93cc..262b3842f9b 100644 --- a/salt/modules/win_file.py +++ b/salt/modules/win_file.py @@ -272,7 +272,7 @@ def gid_to_group(gid): salt '*' file.gid_to_group S-1-5-21-626487655-2533044672-482107328-1010 """ - func_name = "{}.gid_to_group".format(__virtualname__) + func_name = f"{__virtualname__}.gid_to_group" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; " @@ -307,7 +307,7 @@ def group_to_gid(group): salt '*' file.group_to_gid administrators """ - func_name = "{}.group_to_gid".format(__virtualname__) + func_name = f"{__virtualname__}.group_to_gid" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; " @@ -349,7 +349,7 @@ def get_pgid(path, follow_symlinks=True): salt '*' file.get_pgid c:\\temp\\test.txt """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") # Under Windows, if the path is a symlink, the user that owns the symlink is # returned, not the user that owns the file/directory the symlink is @@ -433,7 +433,7 @@ def get_gid(path, follow_symlinks=True): salt '*' file.get_gid c:\\temp\\test.txt """ - func_name = "{}.get_gid".format(__virtualname__) + func_name = f"{__virtualname__}.get_gid" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; " @@ -480,7 +480,7 @@ def get_group(path, follow_symlinks=True): salt '*' file.get_group c:\\temp\\test.txt """ - func_name = "{}.get_group".format(__virtualname__) + func_name = f"{__virtualname__}.get_group" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; " @@ -561,7 +561,7 @@ def get_uid(path, follow_symlinks=True): salt '*' file.get_uid c:\\temp\\test.txt follow_symlinks=False """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") # Under Windows, if the path is a symlink, the user that owns the symlink is # returned, not the user that owns the file/directory the symlink is @@ -600,7 +600,7 @@ def get_user(path, follow_symlinks=True): salt '*' file.get_user c:\\temp\\test.txt follow_symlinks=False """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") # Under Windows, if the path is a symlink, the user that owns the symlink is # returned, not the user that owns the file/directory the symlink is @@ -633,9 +633,9 @@ def get_mode(path): salt '*' file.get_mode /etc/passwd """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") - func_name = "{}.get_mode".format(__virtualname__) + func_name = f"{__virtualname__}.get_mode" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; " @@ -684,7 +684,7 @@ def lchown(path, user, group=None, pgroup=None): salt '*' file.lchown c:\\temp\\test.txt myusername "pgroup='None'" """ if group: - func_name = "{}.lchown".format(__virtualname__) + func_name = f"{__virtualname__}.lchown" if __opts__.get("fun", "") == func_name: log.info( "The group parameter has no effect when using %s on " @@ -733,7 +733,7 @@ def chown(path, user, group=None, pgroup=None, follow_symlinks=True): """ # the group parameter is not used; only provided for API compatibility if group is not None: - func_name = "{}.chown".format(__virtualname__) + func_name = f"{__virtualname__}.chown" if __opts__.get("fun", "") == func_name: log.info( "The group parameter has no effect when using %s on " @@ -746,7 +746,7 @@ def chown(path, user, group=None, pgroup=None, follow_symlinks=True): path = _resolve_symlink(path) if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") salt.utils.win_dacl.set_owner(path, user) if pgroup: @@ -817,7 +817,7 @@ def chgrp(path, group): salt '*' file.chgrp c:\\temp\\test.txt administrators """ - func_name = "{}.chgrp".format(__virtualname__) + func_name = f"{__virtualname__}.chgrp" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; see " @@ -863,7 +863,7 @@ def stats(path, hash_type="sha256", follow_symlinks=True): # This is to mirror the behavior of file.py. `check_file_meta` expects an # empty dictionary when the file does not exist if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") if follow_symlinks and sys.getwindowsversion().major >= 6: path = _resolve_symlink(path) @@ -966,13 +966,13 @@ def _get_version_type(file_type, file_subtype): if ret_type == "Driver": if file_subtype in driver_subtypes: - ret_type = "{} Driver".format(driver_subtypes[file_subtype]) + ret_type = f"{driver_subtypes[file_subtype]} Driver" if ret_type == "Font": if file_subtype in font_subtypes: - ret_type = "{} Font".format(font_subtypes[file_subtype]) + ret_type = f"{font_subtypes[file_subtype]} Font" if ret_type == "Virtual Device": # The Virtual Device Identifier - ret_type = "Virtual Device: {}".format(file_subtype) + ret_type = f"Virtual Device: {file_subtype}" return ret_type @@ -1041,9 +1041,9 @@ def version(path): """ # Input validation if not os.path.exists(path): - raise CommandExecutionError("File not found: {}".format(path)) + raise CommandExecutionError(f"File not found: {path}") if os.path.isdir(path): - raise CommandExecutionError("Not a file: {}".format(path)) + raise CommandExecutionError(f"Not a file: {path}") return _get_version(path) @@ -1081,9 +1081,9 @@ def version_details(path): """ # Input validation if not os.path.exists(path): - raise CommandExecutionError("File not found: {}".format(path)) + raise CommandExecutionError(f"File not found: {path}") if os.path.isdir(path): - raise CommandExecutionError("Not a file: {}".format(path)) + raise CommandExecutionError(f"Not a file: {path}") ret = {} try: @@ -1159,7 +1159,7 @@ def get_attributes(path): salt '*' file.get_attributes c:\\temp\\a.txt """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") # set up dictionary for attribute values attributes = {} @@ -1241,7 +1241,7 @@ def set_attributes( salt '*' file.set_attributes c:\\temp\\a.txt readonly=True hidden=True """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") if normal: if archive or hidden or notIndexed or readonly or system or temporary: @@ -1310,7 +1310,7 @@ def set_mode(path, mode): salt '*' file.set_mode /etc/passwd 0644 """ - func_name = "{}.set_mode".format(__virtualname__) + func_name = f"{__virtualname__}.set_mode" if __opts__.get("fun", "") == func_name: log.info( "The function %s should not be used on Windows systems; " @@ -1346,11 +1346,11 @@ def remove(path, force=False): path = os.path.expanduser(path) if not os.path.isabs(path): - raise SaltInvocationError("File path must be absolute: {}".format(path)) + raise SaltInvocationError(f"File path must be absolute: {path}") # Does the file/folder exists if not os.path.exists(path) and not is_link(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") # Remove ReadOnly Attribute if force: @@ -1367,7 +1367,7 @@ def remove(path, force=False): os.rmdir(path) else: for name in os.listdir(path): - item = "{}\\{}".format(path, name) + item = f"{path}\\{name}" # If its a normal directory, recurse to remove it's contents remove(item, force) @@ -1377,7 +1377,7 @@ def remove(path, force=False): if force: # Reset attributes to the original if delete fails. win32api.SetFileAttributes(path, file_attributes) - raise CommandExecutionError("Could not remove '{}': {}".format(path, exc)) + raise CommandExecutionError(f"Could not remove '{path}': {exc}") return True @@ -1425,7 +1425,7 @@ def symlink(src, link, force=False, atomic=False): ) if not os.path.isabs(link): - raise SaltInvocationError("Link path must be absolute: {}".format(link)) + raise SaltInvocationError(f"Link path must be absolute: {link}") if os.path.islink(link): try: @@ -1438,11 +1438,11 @@ def symlink(src, link, force=False, atomic=False): pass if not force and not atomic: - msg = "Found existing symlink: {}".format(link) + msg = f"Found existing symlink: {link}" raise CommandExecutionError(msg) if os.path.exists(link) and not force and not atomic: - msg = "Existing path is not a symlink: {}".format(link) + msg = f"Existing path is not a symlink: {link}" raise CommandExecutionError(msg) # ensure paths are using the right slashes @@ -1477,14 +1477,14 @@ def symlink(src, link, force=False, atomic=False): return True except win32file.error: os.remove(temp_link) - raise CommandExecutionError("Could not create '{}'".format(link)) + raise CommandExecutionError(f"Could not create '{link}'") try: win32file.CreateSymbolicLink(link, src, int(is_dir)) return True except win32file.error as exc: raise CommandExecutionError( - "Could not create '{}' - [{}] {}".format(link, exc.winerror, exc.strerror) + f"Could not create '{link}' - [{exc.winerror}] {exc.strerror}" ) @@ -1594,7 +1594,7 @@ def mkdir( # Make sure the drive is valid drive = os.path.splitdrive(path)[0] if not os.path.isdir(drive): - raise CommandExecutionError("Drive {} is not mapped".format(drive)) + raise CommandExecutionError(f"Drive {drive} is not mapped") path = os.path.expanduser(path) path = os.path.expandvars(path) @@ -1711,12 +1711,12 @@ def makedirs_( if os.path.isdir(dirname): # There's nothing for us to do - msg = "Directory '{}' already exists".format(dirname) + msg = f"Directory '{dirname}' already exists" log.debug(msg) return msg if os.path.exists(dirname): - msg = "The path '{}' already exists and is not a directory".format(dirname) + msg = f"The path '{dirname}' already exists and is not a directory" log.debug(msg) return msg @@ -1925,7 +1925,7 @@ def check_perms( salt '*' file.check_perms C:\\Temp\\ {} Administrators "{'jsnuffy': {'perms': ['read_attributes', 'read_ea'], 'applies_to': 'files_only'}}" """ if not os.path.exists(path): - raise CommandExecutionError("Path not found: {}".format(path)) + raise CommandExecutionError(f"Path not found: {path}") path = os.path.expanduser(path) diff --git a/salt/modules/win_firewall.py b/salt/modules/win_firewall.py index 75dbd3f964e..6d8dd025895 100644 --- a/salt/modules/win_firewall.py +++ b/salt/modules/win_firewall.py @@ -151,7 +151,7 @@ def get_rule(name="all"): salt '*' firewall.get_rule 'MyAppPort' """ - cmd = ["netsh", "advfirewall", "firewall", "show", "rule", "name={}".format(name)] + cmd = ["netsh", "advfirewall", "firewall", "show", "rule", f"name={name}"] ret = __salt__["cmd.run_all"](cmd, python_shell=False, ignore_retcode=True) if ret["retcode"] != 0: raise CommandExecutionError(ret["stdout"]) @@ -228,15 +228,15 @@ def add_rule(name, localport, protocol="tcp", action="allow", dir="in", remoteip "firewall", "add", "rule", - "name={}".format(name), - "protocol={}".format(protocol), - "dir={}".format(dir), - "action={}".format(action), - "remoteip={}".format(remoteip), + f"name={name}", + f"protocol={protocol}", + f"dir={dir}", + f"action={action}", + f"remoteip={remoteip}", ] if protocol is None or ("icmpv4" not in protocol and "icmpv6" not in protocol): - cmd.append("localport={}".format(localport)) + cmd.append(f"localport={localport}") ret = __salt__["cmd.run_all"](cmd, python_shell=False, ignore_retcode=True) if ret["retcode"] != 0: @@ -292,19 +292,19 @@ def delete_rule(name=None, localport=None, protocol=None, dir=None, remoteip=Non """ cmd = ["netsh", "advfirewall", "firewall", "delete", "rule"] if name: - cmd.append("name={}".format(name)) + cmd.append(f"name={name}") if protocol: - cmd.append("protocol={}".format(protocol)) + cmd.append(f"protocol={protocol}") if dir: - cmd.append("dir={}".format(dir)) + cmd.append(f"dir={dir}") if remoteip: - cmd.append("remoteip={}".format(remoteip)) + cmd.append(f"remoteip={remoteip}") if protocol is None or ("icmpv4" not in protocol and "icmpv6" not in protocol): if localport: if not protocol: cmd.append("protocol=tcp") - cmd.append("localport={}".format(localport)) + cmd.append(f"localport={localport}") ret = __salt__["cmd.run_all"](cmd, python_shell=False, ignore_retcode=True) if ret["retcode"] != 0: diff --git a/salt/modules/win_iis.py b/salt/modules/win_iis.py index 68f67c01d9c..b20cc2fc7bc 100644 --- a/salt/modules/win_iis.py +++ b/salt/modules/win_iis.py @@ -84,7 +84,7 @@ def _list_certs(certificate_store="My"): ps_cmd = [ "Get-ChildItem", "-Path", - r"'Cert:\LocalMachine\{}'".format(certificate_store), + rf"'Cert:\LocalMachine\{certificate_store}'", "|", "Select-Object DnsNameList, SerialNumber, Subject, Thumbprint, Version", ] @@ -146,9 +146,9 @@ def _srvmgr(cmd, return_json=False): cmd = " ".join(cmd) if return_json: - cmd = "ConvertTo-Json -Compress -Depth 4 -InputObject @({})".format(cmd) + cmd = f"ConvertTo-Json -Compress -Depth 4 -InputObject @({cmd})" - cmd = "Import-Module WebAdministration; {}".format(cmd) + cmd = f"Import-Module WebAdministration; {cmd}" ret = __salt__["cmd.run_all"](cmd, shell="powershell", python_shell=True) @@ -306,7 +306,7 @@ def create_site( salt '*' win_iis.create_site name='My Test Site' sourcepath='c:\\stage' apppool='TestPool' """ protocol = str(protocol).lower() - site_path = r"IIS:\Sites\{}".format(name) + site_path = rf"IIS:\Sites\{name}" binding_info = _get_binding_info(hostheader, ipaddress, port) current_sites = list_sites() @@ -323,9 +323,9 @@ def create_site( ps_cmd = [ "New-Item", "-Path", - r"'{}'".format(site_path), + rf"'{site_path}'", "-PhysicalPath", - r"'{}'".format(sourcepath), + rf"'{sourcepath}'", "-Bindings", "@{{ protocol='{0}'; bindingInformation='{1}' }};".format( protocol, binding_info @@ -343,11 +343,11 @@ def create_site( [ "Set-ItemProperty", "-Path", - "'{}'".format(site_path), + f"'{site_path}'", "-Name", "ApplicationPool", "-Value", - "'{}'".format(apppool), + f"'{apppool}'", ] ) @@ -386,7 +386,7 @@ def modify_site(name, sourcepath=None, apppool=None): salt '*' win_iis.modify_site name='My Test Site' sourcepath='c:\\new_path' apppool='NewTestPool' """ - site_path = r"IIS:\Sites\{}".format(name) + site_path = rf"IIS:\Sites\{name}" current_sites = list_sites() if name not in current_sites: @@ -400,11 +400,11 @@ def modify_site(name, sourcepath=None, apppool=None): [ "Set-ItemProperty", "-Path", - r"'{}'".format(site_path), + rf"'{site_path}'", "-Name", "PhysicalPath", "-Value", - r"'{}'".format(sourcepath), + rf"'{sourcepath}'", ] ) @@ -424,11 +424,11 @@ def modify_site(name, sourcepath=None, apppool=None): [ "Set-ItemProperty", "-Path", - r"'{}'".format(site_path), + rf"'{site_path}'", "-Name", "ApplicationPool", "-Value", - r"'{}'".format(apppool), + rf"'{apppool}'", ] ) @@ -469,7 +469,7 @@ def remove_site(name): log.debug("Site already absent: %s", name) return True - ps_cmd = ["Remove-WebSite", "-Name", r"'{}'".format(name)] + ps_cmd = ["Remove-WebSite", "-Name", rf"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -499,7 +499,7 @@ def stop_site(name): salt '*' win_iis.stop_site name='My Test Site' """ - ps_cmd = ["Stop-WebSite", r"'{}'".format(name)] + ps_cmd = ["Stop-WebSite", rf"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -524,7 +524,7 @@ def start_site(name): salt '*' win_iis.start_site name='My Test Site' """ - ps_cmd = ["Start-WebSite", r"'{}'".format(name)] + ps_cmd = ["Start-WebSite", rf"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -642,31 +642,31 @@ def create_binding( ps_cmd = [ "New-WebBinding", "-Name", - "'{}'".format(site), + f"'{site}'", "-HostHeader", - "'{}'".format(hostheader), + f"'{hostheader}'", "-IpAddress", - "'{}'".format(ipaddress), + f"'{ipaddress}'", "-Port", - "'{}'".format(port), + f"'{port}'", "-Protocol", - "'{}'".format(protocol), + f"'{protocol}'", "-SslFlags", - "{}".format(sslflags), + f"{sslflags}", ] else: ps_cmd = [ "New-WebBinding", "-Name", - "'{}'".format(site), + f"'{site}'", "-HostHeader", - "'{}'".format(hostheader), + f"'{hostheader}'", "-IpAddress", - "'{}'".format(ipaddress), + f"'{ipaddress}'", "-Port", - "'{}'".format(port), + f"'{port}'", "-Protocol", - "'{}'".format(protocol), + f"'{protocol}'", ] cmd_ret = _srvmgr(ps_cmd) @@ -750,13 +750,13 @@ def modify_binding( ps_cmd = [ "Set-WebBinding", "-Name", - "'{}'".format(site), + f"'{site}'", "-BindingInformation", - "'{}'".format(binding), + f"'{binding}'", "-PropertyName", "BindingInformation", "-Value", - "'{}'".format(new_binding), + f"'{new_binding}'", ] cmd_ret = _srvmgr(ps_cmd) @@ -774,13 +774,13 @@ def modify_binding( ps_cmd = [ "Set-WebBinding", "-Name", - "'{}'".format(site), + f"'{site}'", "-BindingInformation", - "'{}'".format(new_binding), + f"'{new_binding}'", "-PropertyName", "sslflags", "-Value", - "'{}'".format(sslflags), + f"'{sslflags}'", ] cmd_ret = _srvmgr(ps_cmd) @@ -823,11 +823,11 @@ def remove_binding(site, hostheader="", ipaddress="*", port=80): ps_cmd = [ "Remove-WebBinding", "-HostHeader", - "'{}'".format(hostheader), + f"'{hostheader}'", "-IpAddress", - "'{}'".format(ipaddress), + f"'{ipaddress}'", "-Port", - "'{}'".format(port), + f"'{port}'", ] cmd_ret = _srvmgr(ps_cmd) @@ -962,19 +962,19 @@ def create_cert_binding(name, site, hostheader="", ipaddress="*", port=443, sslf ps_cmd = [ "New-Item", "-Path", - "'{}'".format(iis7path), + f"'{iis7path}'", "-Thumbprint", - "'{}'".format(name), + f"'{name}'", ] else: ps_cmd = [ "New-Item", "-Path", - "'{}'".format(binding_path), + f"'{binding_path}'", "-Thumbprint", - "'{}'".format(name), + f"'{name}'", "-SSLFlags", - "{}".format(sslflags), + f"{sslflags}", ] cmd_ret = _srvmgr(ps_cmd) @@ -1038,10 +1038,10 @@ def remove_cert_binding(name, site, hostheader="", ipaddress="*", port=443): r"'IIS:\Sites'", "|", "Where-Object", - r" {{ $_.Name -Eq '{0}' }};".format(site), + rf" {{ $_.Name -Eq '{site}' }};", "$Binding = $Site.Bindings.Collection", r"| Where-Object { $_.bindingInformation", - r"-Eq '{0}' }};".format(binding_info), + rf"-Eq '{binding_info}' }};", "$Binding.RemoveSslCertificate()", ] @@ -1168,13 +1168,13 @@ def create_apppool(name): salt '*' win_iis.create_apppool name='MyTestPool' """ current_apppools = list_apppools() - apppool_path = r"IIS:\AppPools\{}".format(name) + apppool_path = rf"IIS:\AppPools\{name}" if name in current_apppools: log.debug("Application pool '%s' already present.", name) return True - ps_cmd = ["New-Item", "-Path", r"'{}'".format(apppool_path)] + ps_cmd = ["New-Item", "-Path", rf"'{apppool_path}'"] cmd_ret = _srvmgr(ps_cmd) @@ -1205,13 +1205,13 @@ def remove_apppool(name): salt '*' win_iis.remove_apppool name='MyTestPool' """ current_apppools = list_apppools() - apppool_path = r"IIS:\AppPools\{}".format(name) + apppool_path = rf"IIS:\AppPools\{name}" if name not in current_apppools: log.debug("Application pool already absent: %s", name) return True - ps_cmd = ["Remove-Item", "-Path", r"'{}'".format(apppool_path), "-Recurse"] + ps_cmd = ["Remove-Item", "-Path", rf"'{apppool_path}'", "-Recurse"] cmd_ret = _srvmgr(ps_cmd) @@ -1243,7 +1243,7 @@ def stop_apppool(name): salt '*' win_iis.stop_apppool name='MyTestPool' """ - ps_cmd = ["Stop-WebAppPool", r"'{}'".format(name)] + ps_cmd = ["Stop-WebAppPool", rf"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -1268,7 +1268,7 @@ def start_apppool(name): salt '*' win_iis.start_apppool name='MyTestPool' """ - ps_cmd = ["Start-WebAppPool", r"'{}'".format(name)] + ps_cmd = ["Start-WebAppPool", rf"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -1293,7 +1293,7 @@ def restart_apppool(name): salt '*' win_iis.restart_apppool name='MyTestPool' """ - ps_cmd = ["Restart-WebAppPool", r"'{}'".format(name)] + ps_cmd = ["Restart-WebAppPool", rf"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -1325,7 +1325,7 @@ def get_container_setting(name, container, settings): ret = dict() ps_cmd = list() ps_cmd_validate = list() - container_path = r"IIS:\{}\{}".format(container, name) + container_path = rf"IIS:\{container}\{name}" if not settings: log.warning("No settings provided") @@ -1339,9 +1339,9 @@ def get_container_setting(name, container, settings): [ "Get-ItemProperty", "-Path", - "'{}'".format(container_path), + f"'{container_path}'", "-Name", - "'{}'".format(setting), + f"'{setting}'", "-ErrorAction", "Stop", "|", @@ -1352,13 +1352,13 @@ def get_container_setting(name, container, settings): # Some ItemProperties are Strings and others are ConfigurationAttributes. # Since the former doesn't have a Value property, we need to account # for this. - ps_cmd.append("$Property = Get-ItemProperty -Path '{}'".format(container_path)) - ps_cmd.append("-Name '{}' -ErrorAction Stop;".format(setting)) + ps_cmd.append(f"$Property = Get-ItemProperty -Path '{container_path}'") + ps_cmd.append(f"-Name '{setting}' -ErrorAction Stop;") ps_cmd.append(r"if (([String]::IsNullOrEmpty($Property) -eq $False) -and") ps_cmd.append(r"($Property.GetType()).Name -eq 'ConfigurationAttribute') {") ps_cmd.append(r"$Property = $Property | Select-Object") ps_cmd.append(r"-ExpandProperty Value };") - ps_cmd.append("$Settings['{}'] = [String] $Property;".format(setting)) + ps_cmd.append(f"$Settings['{setting}'] = [String] $Property;") ps_cmd.append(r"$Property = $Null;") # Validate the setting names that were passed in. @@ -1426,7 +1426,7 @@ def set_container_setting(name, container, settings): "ApplicationPoolIdentity": "4", } ps_cmd = list() - container_path = r"IIS:\{}\{}".format(container, name) + container_path = rf"IIS:\{container}\{name}" if not settings: log.warning("No settings provided") @@ -1450,7 +1450,7 @@ def set_container_setting(name, container, settings): complex(settings[setting]) value = settings[setting] except ValueError: - value = "'{}'".format(settings[setting]) + value = f"'{settings[setting]}'" # Map to numeric to support server 2008 if ( @@ -1463,18 +1463,18 @@ def set_container_setting(name, container, settings): [ "Set-ItemProperty", "-Path", - "'{}'".format(container_path), + f"'{container_path}'", "-Name", - "'{}'".format(setting), + f"'{setting}'", "-Value", - "{};".format(value), + f"{value};", ] ) cmd_ret = _srvmgr(ps_cmd) if cmd_ret["retcode"] != 0: - msg = "Unable to set settings for {}: {}".format(container, name) + msg = f"Unable to set settings for {container}: {name}" raise CommandExecutionError(msg) # Get the fields post-change so that we can verify tht all values @@ -1521,7 +1521,7 @@ def list_apps(site): """ ret = dict() ps_cmd = list() - ps_cmd.append("Get-WebApplication -Site '{}'".format(site)) + ps_cmd.append(f"Get-WebApplication -Site '{site}'") ps_cmd.append( r"| Select-Object applicationPool, path, PhysicalPath, preloadEnabled," ) @@ -1605,15 +1605,15 @@ def create_app(name, site, sourcepath, apppool=None): ps_cmd = [ "New-WebApplication", "-Name", - "'{}'".format(name), + f"'{name}'", "-Site", - "'{}'".format(site), + f"'{site}'", "-PhysicalPath", - "'{}'".format(sourcepath), + f"'{sourcepath}'", ] if apppool: - ps_cmd.extend(["-ApplicationPool", "'{}'".format(apppool)]) + ps_cmd.extend(["-ApplicationPool", f"'{apppool}'"]) cmd_ret = _srvmgr(ps_cmd) @@ -1659,9 +1659,9 @@ def remove_app(name, site): ps_cmd = [ "Remove-WebApplication", "-Name", - "'{}'".format(name), + f"'{name}'", "-Site", - "'{}'".format(site), + f"'{site}'", ] cmd_ret = _srvmgr(ps_cmd) @@ -1705,9 +1705,9 @@ def list_vdirs(site, app=_DEFAULT_APP): ps_cmd = [ "Get-WebVirtualDirectory", "-Site", - r"'{}'".format(site), + rf"'{site}'", "-Application", - r"'{}'".format(app), + rf"'{app}'", "|", "Select-Object PhysicalPath, @{ Name = 'name';", r"Expression = { $_.path.Trim('/') } }", @@ -1769,15 +1769,15 @@ def create_vdir(name, site, sourcepath, app=_DEFAULT_APP): ps_cmd = [ "New-WebVirtualDirectory", "-Name", - r"'{}'".format(name), + rf"'{name}'", "-Site", - r"'{}'".format(site), + rf"'{site}'", "-PhysicalPath", - r"'{}'".format(sourcepath), + rf"'{sourcepath}'", ] if app != _DEFAULT_APP: - ps_cmd.extend(["-Application", r"'{}'".format(app)]) + ps_cmd.extend(["-Application", rf"'{app}'"]) cmd_ret = _srvmgr(ps_cmd) @@ -1819,8 +1819,8 @@ def remove_vdir(name, site, app=_DEFAULT_APP): app_path = os.path.join(*app.rstrip("/").split("/")) if app_path: - app_path = "{}\\".format(app_path) - vdir_path = r"IIS:\Sites\{}\{}{}".format(site, app_path, name) + app_path = f"{app_path}\\" + vdir_path = rf"IIS:\Sites\{site}\{app_path}{name}" if name not in current_vdirs: log.debug("Virtual directory already absent: %s", name) @@ -1829,7 +1829,7 @@ def remove_vdir(name, site, app=_DEFAULT_APP): # We use Remove-Item here instead of Remove-WebVirtualDirectory, since the # latter has a bug that causes it to always prompt for user input. - ps_cmd = ["Remove-Item", "-Path", r"'{}'".format(vdir_path), "-Recurse"] + ps_cmd = ["Remove-Item", "-Path", rf"'{vdir_path}'", "-Recurse"] cmd_ret = _srvmgr(ps_cmd) @@ -1919,9 +1919,9 @@ def create_backup(name): salt '*' win_iis.create_backup good_config_20170209 """ if name in list_backups(): - raise CommandExecutionError("Backup already present: {}".format(name)) + raise CommandExecutionError(f"Backup already present: {name}") - ps_cmd = ["Backup-WebConfiguration", "-Name", "'{}'".format(name)] + ps_cmd = ["Backup-WebConfiguration", "-Name", f"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -1956,7 +1956,7 @@ def remove_backup(name): log.debug("Backup already removed: %s", name) return True - ps_cmd = ["Remove-WebConfigurationBackup", "-Name", "'{}'".format(name)] + ps_cmd = ["Remove-WebConfigurationBackup", "-Name", f"'{name}'"] cmd_ret = _srvmgr(ps_cmd) @@ -1988,7 +1988,7 @@ def list_worker_processes(apppool): salt '*' win_iis.list_worker_processes 'My App Pool' """ - ps_cmd = ["Get-ChildItem", r"'IIS:\AppPools\{}\WorkerProcesses'".format(apppool)] + ps_cmd = ["Get-ChildItem", rf"'IIS:\AppPools\{apppool}\WorkerProcesses'"] cmd_ret = _srvmgr(cmd=ps_cmd, return_json=True) @@ -2051,20 +2051,16 @@ def get_webapp_settings(name, site, settings): site, name ) ) - pscmd.append( - r' -Name "{}" -ErrorAction Stop | select Value;'.format(setting) - ) + pscmd.append(rf' -Name "{setting}" -ErrorAction Stop | select Value;') pscmd.append( r" $Property = $Property | Select-Object -ExpandProperty Value;" ) - pscmd.append(r" $Settings['{}'] = [String] $Property;".format(setting)) + pscmd.append(rf" $Settings['{setting}'] = [String] $Property;") pscmd.append(r" $Property = $Null;") if setting == "physicalPath" or setting == "applicationPool": - pscmd.append( - r" $Property = (get-webapplication {}).{};".format(name, setting) - ) - pscmd.append(r" $Settings['{}'] = [String] $Property;".format(setting)) + pscmd.append(rf" $Property = (get-webapplication {name}).{setting};") + pscmd.append(rf" $Settings['{setting}'] = [String] $Property;") pscmd.append(r" $Property = $Null;") else: @@ -2172,7 +2168,7 @@ def set_webapp_settings(name, site, settings): complex(settings[setting]) value = settings[setting] except ValueError: - value = "'{}'".format(settings[setting]) + value = f"'{settings[setting]}'" # Append relevant update command per setting key if setting == "userName" or setting == "password": @@ -2182,7 +2178,7 @@ def set_webapp_settings(name, site, settings): site, name ) ) - pscmd.append(' -Name "{}" -Value {};'.format(setting, value)) + pscmd.append(f' -Name "{setting}" -Value {value};') if setting == "physicalPath" or setting == "applicationPool": pscmd.append( @@ -2200,7 +2196,7 @@ def set_webapp_settings(name, site, settings): # Verify commands completed successfully if cmd_ret["retcode"] != 0: - msg = "Unable to set settings for web application {}".format(name) + msg = f"Unable to set settings for web application {name}" raise SaltInvocationError(msg) # verify changes @@ -2253,7 +2249,7 @@ def get_webconfiguration_settings(name, settings): [ "Get-WebConfigurationProperty", "-PSPath", - "'{}'".format(name), + f"'{name}'", "-Filter", "'{}'".format(setting["filter"]), "-Name", @@ -2268,9 +2264,7 @@ def get_webconfiguration_settings(name, settings): # Some ItemProperties are Strings and others are ConfigurationAttributes. # Since the former doesn't have a Value property, we need to account # for this. - ps_cmd.append( - "$Property = Get-WebConfigurationProperty -PSPath '{}'".format(name) - ) + ps_cmd.append(f"$Property = Get-WebConfigurationProperty -PSPath '{name}'") ps_cmd.append( "-Name '{}' -Filter '{}' -ErrorAction Stop;".format( setting["name"], setting["filter"] @@ -2368,7 +2362,7 @@ def set_webconfiguration_settings(name, settings): for value_item in setting["value"]: configelement_construct = [] for key, value in value_item.items(): - configelement_construct.append("{}='{}'".format(key, value)) + configelement_construct.append(f"{key}='{value}'") configelement_list.append( "@{" + ";".join(configelement_construct) + "}" ) @@ -2378,20 +2372,20 @@ def set_webconfiguration_settings(name, settings): [ "Set-WebConfigurationProperty", "-PSPath", - "'{}'".format(name), + f"'{name}'", "-Filter", "'{}'".format(setting["filter"]), "-Name", "'{}'".format(setting["name"]), "-Value", - "{};".format(value), + f"{value};", ] ) cmd_ret = _srvmgr(ps_cmd) if cmd_ret["retcode"] != 0: - msg = "Unable to set settings for {}".format(name) + msg = f"Unable to set settings for {name}" raise CommandExecutionError(msg) # Get the fields post-change so that we can verify tht all values diff --git a/salt/modules/win_ip.py b/salt/modules/win_ip.py index f1c11cfacbc..524a8d887c2 100644 --- a/salt/modules/win_ip.py +++ b/salt/modules/win_ip.py @@ -132,14 +132,14 @@ def is_enabled(iface): salt -G 'os_family:Windows' ip.is_enabled 'Local Area Connection #2' """ - cmd = ["netsh", "interface", "show", "interface", "name={}".format(iface)] + cmd = ["netsh", "interface", "show", "interface", f"name={iface}"] iface_found = False for line in __salt__["cmd.run"](cmd, python_shell=False).splitlines(): if "Connect state:" in line: iface_found = True return line.split()[-1] == "Connected" if not iface_found: - raise CommandExecutionError("Interface '{}' not found".format(iface)) + raise CommandExecutionError(f"Interface '{iface}' not found") return False @@ -173,7 +173,7 @@ def enable(iface): "interface", "set", "interface", - "name={}".format(iface), + f"name={iface}", "admin=ENABLED", ] __salt__["cmd.run"](cmd, python_shell=False) @@ -197,7 +197,7 @@ def disable(iface): "interface", "set", "interface", - "name={}".format(iface), + f"name={iface}", "admin=DISABLED", ] __salt__["cmd.run"](cmd, python_shell=False) @@ -215,7 +215,7 @@ def get_subnet_length(mask): salt -G 'os_family:Windows' ip.get_subnet_length 255.255.255.0 """ if not salt.utils.validate.net.netmask(mask): - raise SaltInvocationError("'{}' is not a valid netmask".format(mask)) + raise SaltInvocationError(f"'{mask}' is not a valid netmask") return salt.utils.network.get_net_size(mask) @@ -258,17 +258,17 @@ def set_static_ip(iface, addr, gateway=None, append=False): return {} if not salt.utils.validate.net.ipv4_addr(addr): - raise SaltInvocationError("Invalid address '{}'".format(addr)) + raise SaltInvocationError(f"Invalid address '{addr}'") if gateway and not salt.utils.validate.net.ipv4_addr(addr): - raise SaltInvocationError("Invalid default gateway '{}'".format(gateway)) + raise SaltInvocationError(f"Invalid default gateway '{gateway}'") if "/" not in addr: addr += "/32" if append and _find_addr(iface, addr): raise CommandExecutionError( - "Address '{}' already exists on interface '{}'".format(addr, iface) + f"Address '{addr}' already exists on interface '{iface}'" ) cmd = ["netsh", "interface", "ip"] @@ -276,12 +276,12 @@ def set_static_ip(iface, addr, gateway=None, append=False): cmd.append("add") else: cmd.append("set") - cmd.extend(["address", "name={}".format(iface)]) + cmd.extend(["address", f"name={iface}"]) if not append: cmd.append("source=static") - cmd.append("address={}".format(addr)) + cmd.append(f"address={addr}") if gateway: - cmd.append("gateway={}".format(gateway)) + cmd.append(f"gateway={gateway}") result = __salt__["cmd.run_all"](cmd, python_shell=False) if result["retcode"] != 0: @@ -348,7 +348,7 @@ def set_static_dns(iface, *addrs): "ip", "set", "dns", - "name={}".format(iface), + f"name={iface}", "source=static", "address=none", ] @@ -363,9 +363,9 @@ def set_static_dns(iface, *addrs): "ip", "set", "dns", - "name={}".format(iface), + f"name={iface}", "source=static", - "address={}".format(addr), + f"address={addr}", "register=primary", ] __salt__["cmd.run"](cmd, python_shell=False) @@ -377,9 +377,9 @@ def set_static_dns(iface, *addrs): "ip", "add", "dns", - "name={}".format(iface), - "address={}".format(addr), - "index={}".format(addr_index), + f"name={iface}", + f"address={addr}", + f"index={addr_index}", ] __salt__["cmd.run"](cmd, python_shell=False) addr_index = addr_index + 1 diff --git a/salt/modules/win_lgpo.py b/salt/modules/win_lgpo.py index f387eeebeb3..02f8bb90703 100644 --- a/salt/modules/win_lgpo.py +++ b/salt/modules/win_lgpo.py @@ -4651,7 +4651,7 @@ class _policy_info: """ add quotes around the string """ - return '"{}"'.format(val) + return f'"{val}"' @classmethod def _binary_enable_zero_disable_one_conversion(cls, val, **kwargs): @@ -4665,7 +4665,7 @@ class _policy_info: elif ord(val) == 1: return "Enabled" else: - return "Invalid Value: {!r}".format(val) + return f"Invalid Value: {val!r}" else: return "Not Defined" except TypeError: @@ -4805,9 +4805,9 @@ class _policy_info: try: userSid = win32security.LookupAccountSid("", _sid) if userSid[1]: - userSid = "{1}\\{0}".format(userSid[0], userSid[1]) + userSid = f"{userSid[1]}\\{userSid[0]}" else: - userSid = "{}".format(userSid[0]) + userSid = f"{userSid[0]}" # TODO: This needs to be more specific except Exception: # pylint: disable=broad-except userSid = win32security.ConvertSidToStringSid(_sid) @@ -4999,7 +4999,7 @@ def _updateNamespace(item, new_namespace): temp_item = item.tag[i + 1 :] else: temp_item = item.tag - item.tag = "{{{0}}}{1}".format(new_namespace, temp_item) + item.tag = f"{{{new_namespace}}}{temp_item}" for child in item.getiterator(): if isinstance(child.tag, str): temp_item = "" @@ -5008,7 +5008,7 @@ def _updateNamespace(item, new_namespace): temp_item = child.tag[i + 1 :] else: temp_item = child.tag - child.tag = "{{{0}}}{1}".format(new_namespace, temp_item) + child.tag = f"{{{new_namespace}}}{temp_item}" return item @@ -5076,10 +5076,10 @@ def _parse_xml(adm_file): modified_xml = "" with salt.utils.files.fopen(adm_file, "rb") as rfh: - file_hash = "{:X}".format(zlib.crc32(rfh.read()) & 0xFFFFFFFF) + file_hash = f"{zlib.crc32(rfh.read()) & 0xFFFFFFFF:X}" name, ext = os.path.splitext(os.path.basename(adm_file)) - hashed_filename = "{}-{}{}".format(name, file_hash, ext) + hashed_filename = f"{name}-{file_hash}{ext}" cache_dir = os.path.join(__opts__["cachedir"], "lgpo", "policy_defs") if not os.path.exists(cache_dir): @@ -5091,7 +5091,7 @@ def _parse_xml(adm_file): log.debug("LGPO: Generating policy template cache for %s%s", name, ext) # Remove old files, keep the cache clean - file_list = glob.glob(os.path.join(cache_dir, "{}*{}".format(name, ext))) + file_list = glob.glob(os.path.join(cache_dir, f"{name}*{ext}")) for file_path in file_list: os.remove(file_path) @@ -5649,7 +5649,7 @@ def _set_advaudit_value(option, value): """ # Set the values in both audit.csv files if not _set_advaudit_file_data(option=option, value=value): - raise CommandExecutionError("Failed to set audit.csv option: {}".format(option)) + raise CommandExecutionError(f"Failed to set audit.csv option: {option}") # Apply the settings locally if not _set_advaudit_pol_data(option=option, value=value): # Only log this error, it will be in effect the next time the machine @@ -5694,7 +5694,7 @@ def _get_netsh_value(profile, option): def _set_netsh_value(profile, section, option, value): if section not in ("firewallpolicy", "settings", "logging", "state"): - raise ValueError("LGPO: Invalid section: {}".format(section)) + raise ValueError(f"LGPO: Invalid section: {section}") log.trace( "LGPO: Setting the following\nProfile: %s\nSection: %s\nOption: %s\nValue: %s", profile, @@ -5738,7 +5738,7 @@ def _load_secedit_data(): Returns: str: The contents of the file generated by the secedit command """ - f_exp = os.path.join(__opts__["cachedir"], "secedit-{}.txt".format(UUID)) + f_exp = os.path.join(__opts__["cachedir"], f"secedit-{UUID}.txt") try: __salt__["cmd.run"](["secedit", "/export", "/cfg", f_exp]) with salt.utils.files.fopen(f_exp, encoding="utf-16") as fp: @@ -5788,7 +5788,7 @@ def _write_secedit_data(inf_data): # Set file names # The database must persist in order for the settings to remain in effect f_sdb = os.path.join(os.getenv("WINDIR"), "security", "database", "salt.sdb") - f_inf = os.path.join(__opts__["cachedir"], "secedit-{}.inf".format(UUID)) + f_inf = os.path.join(__opts__["cachedir"], f"secedit-{UUID}.inf") try: # Write the changes to the inf file @@ -5948,9 +5948,7 @@ def _getAdmlPresentationRefId(adml_data, ref_id): """ helper function to check for a presentation label for a policy element """ - search_results = adml_data.xpath( - '//*[@*[local-name() = "refId"] = "{}"]'.format(ref_id) - ) + search_results = adml_data.xpath(f'//*[@*[local-name() = "refId"] = "{ref_id}"]') alternate_label = "" if search_results: for result in search_results: @@ -6216,7 +6214,7 @@ def _encode_string(value): elif not isinstance(value, str): # Should we raise an error here, or attempt to cast to a string raise TypeError( - "Value {} is not a string type\nType: {}".format(repr(value), type(value)) + f"Value {repr(value)} is not a string type\nType: {type(value)}" ) return b"".join([value.encode("utf-16-le"), encoded_null]) @@ -6257,7 +6255,7 @@ def _buildKnownDataSearchString( encoded_semicolon, chr(registry.vtype[reg_vtype]).encode("utf-32-le"), encoded_semicolon, - chr(len(" {}".format(chr(0)).encode("utf-16-le"))).encode("utf-32-le"), + chr(len(f" {chr(0)}".encode("utf-16-le"))).encode("utf-32-le"), encoded_semicolon, " ".encode("utf-16-le"), encoded_null, @@ -6437,7 +6435,7 @@ def _processValueItem( encoded_semicolon, chr(registry.vtype[this_vtype]).encode("utf-32-le"), encoded_semicolon, - chr(len(" {}".format(chr(0)).encode("utf-16-le"))).encode( + chr(len(f" {chr(0)}".encode("utf-16-le"))).encode( "utf-32-le" ), encoded_semicolon, @@ -6492,7 +6490,7 @@ def _processValueItem( encoded_semicolon, chr( len( - "{}{}".format(element_values[i], chr(0)).encode( + f"{element_values[i]}{chr(0)}".encode( "utf-16-le" ) ) @@ -6523,9 +6521,7 @@ def _processValueItem( encoded_semicolon, chr(registry.vtype[this_vtype]).encode("utf-32-le"), encoded_semicolon, - chr(len(" {}".format(chr(0)).encode("utf-16-le"))).encode( - "utf-32-le" - ), + chr(len(f" {chr(0)}".encode("utf-16-le"))).encode("utf-32-le"), encoded_semicolon, " ".encode("utf-16-le"), encoded_null, @@ -6589,9 +6585,7 @@ def _processValueItem( encoded_semicolon, chr(registry.vtype[this_vtype]).encode("utf-32-le"), encoded_semicolon, - chr(len(" {}".format(chr(0)).encode("utf-16-le"))).encode( - "utf-32-le" - ), + chr(len(f" {chr(0)}".encode("utf-16-le"))).encode("utf-32-le"), encoded_semicolon, " ".encode("utf-16-le"), encoded_null, @@ -6643,10 +6637,10 @@ def _checkAllAdmxPolicies( if policy_file_data: log.trace("POLICY CLASS %s has file data", policy_class) policy_filedata_split = re.sub( - salt.utils.stringutils.to_bytes(r"\]{}$".format(chr(0))), + salt.utils.stringutils.to_bytes(rf"\]{chr(0)}$"), b"", re.sub( - salt.utils.stringutils.to_bytes(r"^\[{}".format(chr(0))), + salt.utils.stringutils.to_bytes(rf"^\[{chr(0)}"), b"", re.sub( re.escape(REG_POL_HEADER.encode("utf-16-le")), @@ -6660,7 +6654,7 @@ def _checkAllAdmxPolicies( # Get the policy for each item defined in Registry.pol for policy_item in policy_filedata_split: policy_item_key = ( - policy_item.split("{};".format(chr(0)).encode("utf-16-le"))[0] + policy_item.split(f"{chr(0)};".encode("utf-16-le"))[0] .decode("utf-16-le") .lower() ) @@ -7423,7 +7417,7 @@ def _build_parent_list(policy_definition, return_full_policy_names, adml_languag parent_list = [] policy_namespace = next(iter(policy_definition.nsmap)) parent_category = policy_definition.xpath( - "{}:parentCategory/@ref".format(policy_namespace), + f"{policy_namespace}:parentCategory/@ref", namespaces=policy_definition.nsmap, ) admx_policy_definitions = _get_policy_definitions(language=adml_language) @@ -7494,14 +7488,14 @@ def _admx_policy_parent_walk( ) path.append(this_parent_name) if tparent_category.xpath( - "{}:parentCategory/@ref".format(policy_namespace), namespaces=policy_nsmap + f"{policy_namespace}:parentCategory/@ref", namespaces=policy_nsmap ): # parent has a parent path = _admx_policy_parent_walk( path=path, policy_namespace=policy_namespace, parent_category=tparent_category.xpath( - "{}:parentCategory/@ref".format(policy_namespace), + f"{policy_namespace}:parentCategory/@ref", namespaces=policy_nsmap, )[0], policy_nsmap=policy_nsmap, @@ -8533,7 +8527,7 @@ def _lookup_admin_template(policy_name, policy_class, adml_language="en-US"): False, None, [], - "Unable to find {} policy {}".format(policy_class, policy_name), + f"Unable to find {policy_class} policy {policy_name}", ) diff --git a/salt/modules/win_lgpo_reg.py b/salt/modules/win_lgpo_reg.py index 3ee147aa812..6789b034a88 100644 --- a/salt/modules/win_lgpo_reg.py +++ b/salt/modules/win_lgpo_reg.py @@ -342,22 +342,22 @@ def set_value( "REG_SZ", ] if v_type not in valid_types: - msg = "Invalid type: {}".format(v_type) + msg = f"Invalid type: {v_type}" raise SaltInvocationError(msg) if v_type in ["REG_SZ", "REG_EXPAND_SZ"]: if not isinstance(v_data, str): - msg = "{} data must be a string".format(v_type) + msg = f"{v_type} data must be a string" raise SaltInvocationError(msg) elif v_type == "REG_MULTI_SZ": if not isinstance(v_data, list): - msg = "{} data must be a list".format(v_type) + msg = f"{v_type} data must be a list" raise SaltInvocationError(msg) elif v_type in ["REG_DWORD", "REG_QWORD"]: try: int(v_data) except (TypeError, ValueError): - msg = "{} data must be an integer".format(v_type) + msg = f"{v_type} data must be an integer" raise SaltInvocationError(msg) pol_data = read_reg_pol(policy_class=policy_class) @@ -467,11 +467,11 @@ def disable_value(key, v_name, policy_class="machine"): return None log.debug("LGPO_REG Mod: Disabling value name: %s", v_name) pol_data[found_key].pop(found_name) - found_name = "**del.{}".format(found_name) + found_name = f"**del.{found_name}" pol_data[found_key][found_name] = {"data": " ", "type": "REG_SZ"} else: log.debug("LGPO_REG Mod: Setting new disabled value name: %s", v_name) - pol_data[found_key]["**del.{}".format(v_name)] = { + pol_data[found_key][f"**del.{v_name}"] = { "data": " ", "type": "REG_SZ", } @@ -479,7 +479,7 @@ def disable_value(key, v_name, policy_class="machine"): log.debug( "LGPO_REG Mod: Adding new key and disabled value name: %s", found_name ) - pol_data[key] = {"**del.{}".format(v_name): {"data": " ", "type": "REG_SZ"}} + pol_data[key] = {f"**del.{v_name}": {"data": " ", "type": "REG_SZ"}} success = True if not write_reg_pol(pol_data, policy_class=policy_class): diff --git a/salt/modules/win_license.py b/salt/modules/win_license.py index 5311418abd0..11851398579 100644 --- a/salt/modules/win_license.py +++ b/salt/modules/win_license.py @@ -52,7 +52,7 @@ def install(product_key): salt '*' license.install XXXXX-XXXXX-XXXXX-XXXXX-XXXXX """ - cmd = r"cscript C:\Windows\System32\slmgr.vbs /ipk {}".format(product_key) + cmd = rf"cscript C:\Windows\System32\slmgr.vbs /ipk {product_key}" return __salt__["cmd.run"](cmd) diff --git a/salt/modules/win_network.py b/salt/modules/win_network.py index ad57ca33bc3..d3d9de5681d 100644 --- a/salt/modules/win_network.py +++ b/salt/modules/win_network.py @@ -259,7 +259,7 @@ def get_route(ip): salt '*' network.get_route 10.10.10.10 """ - cmd = "Find-NetRoute -RemoteIPAddress {}".format(ip) + cmd = f"Find-NetRoute -RemoteIPAddress {ip}" out = __salt__["cmd.run"](cmd, shell="powershell", python_shell=True) regexp = re.compile( r"^IPAddress\s+:\s(?P[\d\.:]+)?.*" @@ -492,7 +492,7 @@ def connect(host, port=None, **kwargs): ): address = host else: - address = "{}".format(salt.utils.network.sanitize_host(host)) + address = f"{salt.utils.network.sanitize_host(host)}" # just in case we encounter error on getaddrinfo _address = ("unknown",) diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index bc421a1f9bd..aff40b3d54d 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -489,14 +489,14 @@ def _get_reg_software(include_components=True, include_updates=True): return False if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="SystemComponent", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="SystemComponent", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -518,14 +518,14 @@ def _get_reg_software(include_components=True, include_updates=True): products_key = "Software\\Classes\\Installer\\Products\\{0}" if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="WindowsInstaller", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="WindowsInstaller", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -556,14 +556,14 @@ def _get_reg_software(include_components=True, include_updates=True): # https://docs.microsoft.com/en-us/windows/win32/msi/arpnoremove if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="NoRemove", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="NoRemove", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -572,7 +572,7 @@ def _get_reg_software(include_components=True, include_updates=True): return False if not __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="UninstallString", use_32bit_registry=use_32bit_registry, ): @@ -593,14 +593,14 @@ def _get_reg_software(include_components=True, include_updates=True): skip_types = ["Hotfix", "Security Update", "Update Rollup"] if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="ReleaseType", use_32bit_registry=use_32bit_registry, ): if ( __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="ReleaseType", use_32bit_registry=use_32bit_registry, )["vdata"] @@ -619,7 +619,7 @@ def _get_reg_software(include_components=True, include_updates=True): """ if __utils__["reg.value_exists"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="ParentKeyName", use_32bit_registry=use_32bit_registry, ): @@ -636,7 +636,7 @@ def _get_reg_software(include_components=True, include_updates=True): """ d_name_regdata = __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="DisplayName", use_32bit_registry=use_32bit_registry, ) @@ -655,7 +655,7 @@ def _get_reg_software(include_components=True, include_updates=True): d_vers_regdata = __utils__["reg.read_value"]( hive=hive, - key="{}\\{}".format(key, sub_key), + key=f"{key}\\{sub_key}", vname="DisplayVersion", use_32bit_registry=use_32bit_registry, ) @@ -726,7 +726,7 @@ def _get_reg_software(include_components=True, include_updates=True): for sub_key in __utils__["reg.list_keys"](**kwargs): # If the key does not exist in userdata, skip it if not __utils__["reg.key_exists"]( - hive=kwargs["hive"], key="{}\\{}".format(userdata_key, sub_key) + hive=kwargs["hive"], key=f"{userdata_key}\\{sub_key}" ): continue kwargs["sub_key"] = sub_key @@ -1040,7 +1040,7 @@ def _get_repo_details(saltenv): """ Return repo details for the specified saltenv as a namedtuple """ - contextkey = "winrepo._get_repo_details.{}".format(saltenv) + contextkey = f"winrepo._get_repo_details.{saltenv}" if contextkey in __context__: (winrepo_source_dir, local_dest, winrepo_file) = __context__[contextkey] @@ -1085,9 +1085,7 @@ def _get_repo_details(saltenv): os.makedirs(local_dest) except OSError as exc: if exc.errno != errno.EEXIST: - raise CommandExecutionError( - "Failed to create {}: {}".format(local_dest, exc) - ) + raise CommandExecutionError(f"Failed to create {local_dest}: {exc}") winrepo_age = -1 try: @@ -1096,9 +1094,7 @@ def _get_repo_details(saltenv): winrepo_age = time.time() - mtime except OSError as exc: if exc.errno != errno.ENOENT: - raise CommandExecutionError( - "Failed to get age of {}: {}".format(winrepo_file, exc) - ) + raise CommandExecutionError(f"Failed to get age of {winrepo_file}: {exc}") except AttributeError: # Shouldn't happen but log if it does log.warning("st_mtime missing from stat result %s", stat_result) @@ -1221,9 +1217,7 @@ def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose): def _failed_compile(prefix_msg, error_msg): log.error("%s '%s': %s", prefix_msg, short_path_name, error_msg) - ret.setdefault("errors", {})[short_path_name] = [ - "{}, {} ".format(prefix_msg, error_msg) - ] + ret.setdefault("errors", {})[short_path_name] = [f"{prefix_msg}, {error_msg} "] return False try: @@ -1249,7 +1243,7 @@ def _repo_process_pkg_sls(filename, short_path_name, ret, successful_verbose): pkgname, short_path_name, ) - errors.append("package '{}' already defined".format(pkgname)) + errors.append(f"package '{pkgname}' already defined") break for version_str, repodata in version_list.items(): # Ensure version is a string/unicode @@ -1321,9 +1315,7 @@ def _get_source_sum(source_hash, file_path, saltenv, verify_ssl=True): raise if not cached_hash_file: - raise CommandExecutionError( - "Source hash file {} not found".format(source_hash) - ) + raise CommandExecutionError(f"Source hash file {source_hash} not found") ret = __salt__["file.extract_hash"](cached_hash_file, "", file_path) if ret is None: @@ -1581,7 +1573,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): # Make sure pkginfo was found if not pkginfo: log.error("Unable to locate package %s", pkg_name) - ret[pkg_name] = "Unable to locate package {}".format(pkg_name) + ret[pkg_name] = f"Unable to locate package {pkg_name}" continue version_num = options.get("version") @@ -1665,9 +1657,9 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): exclude_pat="E@init.sls$", ) except MinionError as exc: - msg = "Failed to cache {}".format(path) + msg = f"Failed to cache {path}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check to see if the cache_file is cached... if passed if cache_file and cache_file.startswith("salt:"): @@ -1681,9 +1673,9 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): verify_ssl=kwargs.get("verify_ssl", True), ) except MinionError as exc: - msg = "Failed to cache {}".format(cache_file) + msg = f"Failed to cache {cache_file}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check if the cache_file was cached successfully if not cached_file: @@ -1712,9 +1704,9 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): use_etag=True, ) except MinionError as exc: - msg = "Failed to cache {}".format(installer) + msg = f"Failed to cache {installer}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check if the installer was cached successfully if not cached_pkg: @@ -1779,14 +1771,14 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): "ComSpec", "{}\\system32\\cmd.exe".format(os.getenv("WINDIR")) ) if use_msiexec: - arguments = '"{}" /I "{}"'.format(msiexec, cached_pkg) + arguments = f'"{msiexec}" /I "{cached_pkg}"' if pkginfo[version_num].get("allusers", True): - arguments = "{} ALLUSERS=1".format(arguments) + arguments = f"{arguments} ALLUSERS=1" else: - arguments = '"{}"'.format(cached_pkg) + arguments = f'"{cached_pkg}"' if install_flags: - arguments = "{} {}".format(arguments, install_flags) + arguments = f"{arguments} {install_flags}" # Install the software # Check Use Scheduler Option @@ -1800,7 +1792,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): force=True, action_type="Execute", cmd=cmd_shell, - arguments='/c "{}"'.format(arguments), + arguments=f'/c "{arguments}"', start_in=cache_path, trigger_type="Once", start_date="1975-01-01", @@ -1852,7 +1844,7 @@ def install(name=None, refresh=False, pkgs=None, **kwargs): else: # Launch the command result = __salt__["cmd.run_all"]( - '"{}" /c "{}"'.format(cmd_shell, arguments), + f'"{cmd_shell}" /c "{arguments}"', cache_path, output_loglevel="trace", python_shell=False, @@ -2005,7 +1997,7 @@ def remove(name=None, pkgs=None, **kwargs): # Make sure pkginfo was found if not pkginfo: - msg = "Unable to locate package {}".format(pkgname) + msg = f"Unable to locate package {pkgname}" log.error(msg) ret[pkgname] = msg continue @@ -2045,7 +2037,7 @@ def remove(name=None, pkgs=None, **kwargs): removal_targets.append(version_num) else: log.debug("%s %s not installed", pkgname, version_num) - ret[pkgname] = {"current": "{} not installed".format(version_num)} + ret[pkgname] = {"current": f"{version_num} not installed"} continue elif "latest" in pkginfo: # we do not have version entry, assume software can self upgrade and use latest @@ -2060,9 +2052,7 @@ def remove(name=None, pkgs=None, **kwargs): log.error( "%s %s no definition to remove this version", pkgname, version_num ) - ret[pkgname] = { - "current": "{} no definition, cannot removed".format(version_num) - } + ret[pkgname] = {"current": f"{version_num} no definition, cannot removed"} continue for target in removal_targets: @@ -2111,9 +2101,9 @@ def remove(name=None, pkgs=None, **kwargs): exclude_pat="E@init.sls$", ) except MinionError as exc: - msg = "Failed to cache {}".format(path) + msg = f"Failed to cache {path}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check to see if the uninstaller is cached. We don't want to # check for latest here like we do for "pkg.install" because we @@ -2135,9 +2125,9 @@ def remove(name=None, pkgs=None, **kwargs): use_etag=True, ) except MinionError as exc: - msg = "Failed to cache {}".format(uninstaller) + msg = f"Failed to cache {uninstaller}" log.exception(msg, exc_info=exc) - return "{}\n{}".format(msg, exc) + return f"{msg}\n{exc}" # Check if the uninstaller was cached successfully if not cached_pkg: @@ -2171,12 +2161,12 @@ def remove(name=None, pkgs=None, **kwargs): if use_msiexec: # Check if uninstaller is set to {guid}, if not we assume its a remote msi file. # which has already been downloaded. - arguments = '"{}" /X "{}"'.format(msiexec, cached_pkg) + arguments = f'"{msiexec}" /X "{cached_pkg}"' else: - arguments = '"{}"'.format(cached_pkg) + arguments = f'"{cached_pkg}"' if uninstall_flags: - arguments = "{} {}".format(arguments, uninstall_flags) + arguments = f"{arguments} {uninstall_flags}" # Uninstall the software changed.append(pkgname) @@ -2191,7 +2181,7 @@ def remove(name=None, pkgs=None, **kwargs): force=True, action_type="Execute", cmd=cmd_shell, - arguments='/c "{}"'.format(arguments), + arguments=f'/c "{arguments}"', start_in=cache_path, trigger_type="Once", start_date="1975-01-01", @@ -2208,7 +2198,7 @@ def remove(name=None, pkgs=None, **kwargs): else: # Launch the command result = __salt__["cmd.run_all"]( - '"{}" /c "{}"'.format(cmd_shell, arguments), + f'"{cmd_shell}" /c "{arguments}"', output_loglevel="trace", python_shell=False, redirect_stderr=True, diff --git a/salt/modules/win_pki.py b/salt/modules/win_pki.py index c90af40dd1b..e004f0bc9e8 100644 --- a/salt/modules/win_pki.py +++ b/salt/modules/win_pki.py @@ -90,10 +90,10 @@ def _validate_cert_path(name): """ Ensure that the certificate path, as determind from user input, is valid. """ - cmd = r"Test-Path -Path '{}'".format(name) + cmd = rf"Test-Path -Path '{name}'" if not ast.literal_eval(_cmd_run(cmd=cmd)): - raise SaltInvocationError(r"Invalid path specified: {}".format(name)) + raise SaltInvocationError(rf"Invalid path specified: {name}") def _validate_cert_format(name): @@ -155,11 +155,11 @@ def get_certs(context=_DEFAULT_CONTEXT, store=_DEFAULT_STORE): ret = dict() cmd = list() blacklist_keys = ["DnsNameList"] - store_path = r"Cert:\{}\{}".format(context, store) + store_path = rf"Cert:\{context}\{store}" _validate_cert_path(name=store_path) - cmd.append(r"Get-ChildItem -Path '{}' | Select-Object".format(store_path)) + cmd.append(rf"Get-ChildItem -Path '{store_path}' | Select-Object") cmd.append(" DnsNameList, SerialNumber, Subject, Thumbprint, Version") items = _cmd_run(cmd="".join(cmd), as_json=True) @@ -216,15 +216,15 @@ def get_cert_file(name, cert_format=_DEFAULT_FORMAT, password=""): cmd.append( " System.Security.Cryptography.X509Certificates.X509Certificate2;" ) - cmd.append(r" $CertObject.Import('{}'".format(name)) - cmd.append(",'{}'".format(password)) + cmd.append(rf" $CertObject.Import('{name}'") + cmd.append(f",'{password}'") cmd.append(",'DefaultKeySet') ; $CertObject") cmd.append( " | Select-Object DnsNameList, SerialNumber, Subject, " "Thumbprint, Version" ) else: - cmd.append(r"Get-PfxCertificate -FilePath '{}'".format(name)) + cmd.append(rf"Get-PfxCertificate -FilePath '{name}'") cmd.append( " | Select-Object DnsNameList, SerialNumber, Subject, " "Thumbprint, Version" @@ -232,7 +232,7 @@ def get_cert_file(name, cert_format=_DEFAULT_FORMAT, password=""): else: cmd.append("$CertObject = New-Object") cmd.append(" System.Security.Cryptography.X509Certificates.X509Certificate2;") - cmd.append(r" $CertObject.Import('{}'); $CertObject".format(name)) + cmd.append(rf" $CertObject.Import('{name}'); $CertObject") cmd.append( " | Select-Object DnsNameList, SerialNumber, Subject, Thumbprint, Version" ) @@ -288,7 +288,7 @@ def import_cert( """ cmd = list() thumbprint = None - store_path = r"Cert:\{}\{}".format(context, store) + store_path = rf"Cert:\{context}\{store}" cert_format = cert_format.lower() _validate_cert_format(name=cert_format) @@ -331,14 +331,14 @@ def import_cert( cmd.append( r"Import-PfxCertificate " r"-FilePath '{}'".format(cached_source_path) ) - cmd.append(r" -CertStoreLocation '{}'".format(store_path)) + cmd.append(rf" -CertStoreLocation '{store_path}'") cmd.append(r" -Password $Password") if exportable: cmd.append(" -Exportable") else: cmd.append(r"Import-Certificate " r"-FilePath '{}'".format(cached_source_path)) - cmd.append(r" -CertStoreLocation '{}'".format(store_path)) + cmd.append(rf" -CertStoreLocation '{store_path}'") _cmd_run(cmd="".join(cmd)) @@ -387,7 +387,7 @@ def export_cert( """ cmd = list() thumbprint = thumbprint.upper() - cert_path = r"Cert:\{}\{}\{}".format(context, store, thumbprint) + cert_path = rf"Cert:\{context}\{store}\{thumbprint}" cert_format = cert_format.lower() _validate_cert_path(name=cert_path) @@ -415,7 +415,7 @@ def export_cert( r"Export-Certificate " r"-Cert '{}' -FilePath '{}'".format(cert_path, name) ) - cmd.append(r" | Out-Null; Test-Path -Path '{}'".format(name)) + cmd.append(rf" | Out-Null; Test-Path -Path '{name}'") ret = ast.literal_eval(_cmd_run(cmd="".join(cmd))) @@ -458,17 +458,17 @@ def test_cert( """ cmd = list() thumbprint = thumbprint.upper() - cert_path = r"Cert:\{}\{}\{}".format(context, store, thumbprint) - cmd.append(r"Test-Certificate -Cert '{}'".format(cert_path)) + cert_path = rf"Cert:\{context}\{store}\{thumbprint}" + cmd.append(rf"Test-Certificate -Cert '{cert_path}'") _validate_cert_path(name=cert_path) if untrusted_root: cmd.append(" -AllowUntrustedRoot") if dns_name: - cmd.append(" -DnsName '{}'".format(dns_name)) + cmd.append(f" -DnsName '{dns_name}'") if eku: - cmd.append(" -EKU '{}'".format(eku)) + cmd.append(f" -EKU '{eku}'") cmd.append(" -ErrorAction SilentlyContinue") @@ -493,9 +493,9 @@ def remove_cert(thumbprint, context=_DEFAULT_CONTEXT, store=_DEFAULT_STORE): salt '*' win_pki.remove_cert thumbprint='AAA000' """ thumbprint = thumbprint.upper() - store_path = r"Cert:\{}\{}".format(context, store) - cert_path = r"{}\{}".format(store_path, thumbprint) - cmd = r"Remove-Item -Path '{}'".format(cert_path) + store_path = rf"Cert:\{context}\{store}" + cert_path = rf"{store_path}\{thumbprint}" + cmd = rf"Remove-Item -Path '{cert_path}'" current_certs = get_certs(context=context, store=store) diff --git a/salt/modules/win_powercfg.py b/salt/modules/win_powercfg.py index 5a76e98b58b..16428b48ea7 100644 --- a/salt/modules/win_powercfg.py +++ b/salt/modules/win_powercfg.py @@ -47,9 +47,9 @@ def _get_powercfg_minute_values(scheme, guid, subguid, safe_name): scheme = _get_current_scheme() if __grains__["osrelease"] == "7": - cmd = "powercfg /q {} {}".format(scheme, guid) + cmd = f"powercfg /q {scheme} {guid}" else: - cmd = "powercfg /q {} {} {}".format(scheme, guid, subguid) + cmd = f"powercfg /q {scheme} {guid} {subguid}" out = __salt__["cmd.run"](cmd, python_shell=False) split = out.split("\r\n\r\n") diff --git a/salt/modules/win_psget.py b/salt/modules/win_psget.py index 66302b4f91e..af978969a98 100644 --- a/salt/modules/win_psget.py +++ b/salt/modules/win_psget.py @@ -82,7 +82,7 @@ def _pshell(cmd, cwd=None, depth=2): in Xml format and load that into python """ - cmd = '{} | ConvertTo-Xml -Depth {} -As "stream"'.format(cmd, depth) + cmd = f'{cmd} | ConvertTo-Xml -Depth {depth} -As "stream"' log.debug("DSC: %s", cmd) results = __salt__["cmd.run_all"]( @@ -94,9 +94,7 @@ def _pshell(cmd, cwd=None, depth=2): if "retcode" not in results or results["retcode"] != 0: # run_all logs an error to log.error, fail hard back to the user - raise CommandExecutionError( - "Issue executing powershell {}".format(cmd), info=results - ) + raise CommandExecutionError(f"Issue executing powershell {cmd}", info=results) try: ret = _ps_xml_to_dict( @@ -224,8 +222,8 @@ def install( flags.append(("Repository", repository)) params = "" for flag, value in flags: - params += "-{} {} ".format(flag, value) - cmd = "Install-Module {} -Force".format(params) + params += f"-{flag} {value} " + cmd = f"Install-Module {params} -Force" _pshell(cmd) return name in list_modules() @@ -259,8 +257,8 @@ def update(name, maximum_version=None, required_version=None): params = "" for flag, value in flags: - params += "-{} {} ".format(flag, value) - cmd = "Update-Module {} -Force".format(params) + params += f"-{flag} {value} " + cmd = f"Update-Module {params} -Force" _pshell(cmd) return name in list_modules() @@ -279,7 +277,7 @@ def remove(name): salt 'win01' psget.remove PowerPlan """ # Putting quotes around the parameter protects against command injection - cmd = 'Uninstall-Module "{}"'.format(name) + cmd = f'Uninstall-Module "{name}"' no_ret = _pshell(cmd) return name not in list_modules() @@ -313,8 +311,8 @@ def register_repository(name, location, installation_policy=None): params = "" for flag, value in flags: - params += "-{} {} ".format(flag, value) - cmd = "Register-PSRepository {}".format(params) + params += f"-{flag} {value} " + cmd = f"Register-PSRepository {params}" no_ret = _pshell(cmd) return name not in list_modules() @@ -333,6 +331,6 @@ def get_repository(name): salt 'win01' psget.get_repository MyRepo """ # Putting quotes around the parameter protects against command injection - cmd = 'Get-PSRepository "{}"'.format(name) + cmd = f'Get-PSRepository "{name}"' no_ret = _pshell(cmd) return name not in list_modules() diff --git a/salt/modules/win_servermanager.py b/salt/modules/win_servermanager.py index cab3d996e82..85bececc3c4 100644 --- a/salt/modules/win_servermanager.py +++ b/salt/modules/win_servermanager.py @@ -55,9 +55,9 @@ def _pshell_json(cmd, cwd=None): Execute the desired powershell command and ensure that it returns data in JSON format and load that into python """ - cmd = "Import-Module ServerManager; {}".format(cmd) + cmd = f"Import-Module ServerManager; {cmd}" if "convertto-json" not in cmd.lower(): - cmd = "{} | ConvertTo-Json".format(cmd) + cmd = f"{cmd} | ConvertTo-Json" log.debug("PowerShell: %s", cmd) ret = __salt__["cmd.run_all"](cmd, shell="powershell", cwd=cwd) @@ -70,9 +70,7 @@ def _pshell_json(cmd, cwd=None): if "retcode" not in ret or ret["retcode"] != 0: # run_all logs an error to log.error, fail hard back to the user - raise CommandExecutionError( - "Issue executing PowerShell {}".format(cmd), info=ret - ) + raise CommandExecutionError(f"Issue executing PowerShell {cmd}", info=ret) # Sometimes Powershell returns an empty string, which isn't valid JSON if ret["stdout"] == "": @@ -227,7 +225,7 @@ def install(feature, recurse=False, restart=False, source=None, exclude=None): shlex.quote(feature), management_tools, "-IncludeAllSubFeature" if recurse else "", - "" if source is None else "-Source {}".format(source), + "" if source is None else f"-Source {source}", ) out = _pshell_json(cmd) diff --git a/salt/modules/win_service.py b/salt/modules/win_service.py index 604a22fd5bd..38356e87c69 100644 --- a/salt/modules/win_service.py +++ b/salt/modules/win_service.py @@ -113,7 +113,7 @@ def _cmd_quote(cmd): cmd = cmd.strip('"').strip("'") # Ensure the path to the binary is wrapped in double quotes to account for # spaces in the path - cmd = '"{}"'.format(cmd) + cmd = f'"{cmd}"' return cmd @@ -340,9 +340,7 @@ def start(name, timeout=90): win32serviceutil.StartService(name) except pywintypes.error as exc: if exc.winerror != 1056: - raise CommandExecutionError( - "Failed To Start {}: {}".format(name, exc.strerror) - ) + raise CommandExecutionError(f"Failed To Start {name}: {exc.strerror}") log.debug('Service "%s" is running', name) srv_status = _status_wait( @@ -381,9 +379,7 @@ def stop(name, timeout=90): win32serviceutil.StopService(name) except pywintypes.error as exc: if exc.winerror != 1062: - raise CommandExecutionError( - "Failed To Stop {}: {}".format(name, exc.strerror) - ) + raise CommandExecutionError(f"Failed To Stop {name}: {exc.strerror}") log.debug('Service "%s" is not running', name) srv_status = _status_wait( @@ -669,7 +665,7 @@ def modify( win32service.SERVICE_CHANGE_CONFIG | win32service.SERVICE_QUERY_CONFIG, ) except pywintypes.error as exc: - raise CommandExecutionError("Failed To Open {}: {}".format(name, exc.strerror)) + raise CommandExecutionError(f"Failed To Open {name}: {exc.strerror}") config_info = win32service.QueryServiceConfig(handle_svc) @@ -680,7 +676,7 @@ def modify( # shlex.quote the path to the binary bin_path = _cmd_quote(bin_path) if exe_args is not None: - bin_path = "{} {}".format(bin_path, exe_args) + bin_path = f"{bin_path} {exe_args}" changes["BinaryPath"] = bin_path if service_type is not None: @@ -689,7 +685,7 @@ def modify( if run_interactive: service_type = service_type | win32service.SERVICE_INTERACTIVE_PROCESS else: - raise CommandExecutionError("Invalid Service Type: {}".format(service_type)) + raise CommandExecutionError(f"Invalid Service Type: {service_type}") else: if run_interactive is True: service_type = config_info[0] | win32service.SERVICE_INTERACTIVE_PROCESS @@ -710,7 +706,7 @@ def modify( if start_type.lower() in SERVICE_START_TYPE: start_type = SERVICE_START_TYPE[start_type.lower()] else: - raise CommandExecutionError("Invalid Start Type: {}".format(start_type)) + raise CommandExecutionError(f"Invalid Start Type: {start_type}") changes["StartType"] = SERVICE_START_TYPE[start_type] else: start_type = win32service.SERVICE_NO_CHANGE @@ -719,9 +715,7 @@ def modify( if error_control.lower() in SERVICE_ERROR_CONTROL: error_control = SERVICE_ERROR_CONTROL[error_control.lower()] else: - raise CommandExecutionError( - "Invalid Error Control: {}".format(error_control) - ) + raise CommandExecutionError(f"Invalid Error Control: {error_control}") changes["ErrorControl"] = SERVICE_ERROR_CONTROL[error_control] else: error_control = win32service.SERVICE_NO_CHANGE @@ -898,7 +892,7 @@ def create( account_name=".\\LocalSystem", account_password=None, run_interactive=False, - **kwargs + **kwargs, ): """ Create the named service. @@ -1004,29 +998,29 @@ def create( # Test if the service already exists if name in get_all(): - raise CommandExecutionError("Service Already Exists: {}".format(name)) + raise CommandExecutionError(f"Service Already Exists: {name}") # shlex.quote the path to the binary bin_path = _cmd_quote(bin_path) if exe_args is not None: - bin_path = "{} {}".format(bin_path, exe_args) + bin_path = f"{bin_path} {exe_args}" if service_type.lower() in SERVICE_TYPE: service_type = SERVICE_TYPE[service_type.lower()] if run_interactive: service_type = service_type | win32service.SERVICE_INTERACTIVE_PROCESS else: - raise CommandExecutionError("Invalid Service Type: {}".format(service_type)) + raise CommandExecutionError(f"Invalid Service Type: {service_type}") if start_type.lower() in SERVICE_START_TYPE: start_type = SERVICE_START_TYPE[start_type.lower()] else: - raise CommandExecutionError("Invalid Start Type: {}".format(start_type)) + raise CommandExecutionError(f"Invalid Start Type: {start_type}") if error_control.lower() in SERVICE_ERROR_CONTROL: error_control = SERVICE_ERROR_CONTROL[error_control.lower()] else: - raise CommandExecutionError("Invalid Error Control: {}".format(error_control)) + raise CommandExecutionError(f"Invalid Error Control: {error_control}") if start_delayed: if start_type != 2: @@ -1121,18 +1115,14 @@ def delete(name, timeout=90): except pywintypes.error as exc: win32service.CloseServiceHandle(handle_scm) if exc.winerror != 1060: - raise CommandExecutionError( - "Failed to open {}. {}".format(name, exc.strerror) - ) + raise CommandExecutionError(f"Failed to open {name}. {exc.strerror}") log.debug('Service "%s" is not present', name) return True try: win32service.DeleteService(handle_svc) except pywintypes.error as exc: - raise CommandExecutionError( - "Failed to delete {}. {}".format(name, exc.strerror) - ) + raise CommandExecutionError(f"Failed to delete {name}. {exc.strerror}") finally: log.debug("Cleaning up") win32service.CloseServiceHandle(handle_scm) diff --git a/salt/modules/win_shortcut.py b/salt/modules/win_shortcut.py index 6bdb679d385..f3ae9d5942e 100644 --- a/salt/modules/win_shortcut.py +++ b/salt/modules/win_shortcut.py @@ -75,11 +75,11 @@ def get(path): salt * shortcut.get path="C:\path\to\shortcut.lnk" """ if not os.path.exists(path): - raise CommandExecutionError("Shortcut not found: {}".format(path)) + raise CommandExecutionError(f"Shortcut not found: {path}") if not path.endswith((".lnk", ".url")): _, ext = os.path.splitext(path) - raise CommandExecutionError("Invalid file extension: {}".format(ext)) + raise CommandExecutionError(f"Invalid file extension: {ext}") # This will load the existing shortcut with salt.utils.winapi.Com(): @@ -104,7 +104,7 @@ def get(path): if target: target = salt.utils.path.expand(target) else: - msg = "Not a valid shortcut: {}".format(path) + msg = f"Not a valid shortcut: {path}" log.debug(msg) raise CommandExecutionError(msg) if shortcut.Arguments: @@ -302,11 +302,11 @@ def modify( salt * shortcut.modify "C:\path\to\shortcut.lnk" "C:\Windows\notepad.exe" """ if not os.path.exists(path): - raise CommandExecutionError("Shortcut not found: {}".format(path)) + raise CommandExecutionError(f"Shortcut not found: {path}") if not path.endswith((".lnk", ".url")): _, ext = os.path.splitext(path) - raise CommandExecutionError("Invalid file extension: {}".format(ext)) + raise CommandExecutionError(f"Invalid file extension: {ext}") return _set_info( path=path, @@ -438,14 +438,14 @@ def create( """ if not path.endswith((".lnk", ".url")): _, ext = os.path.splitext(path) - raise CommandExecutionError("Invalid file extension: {}".format(ext)) + raise CommandExecutionError(f"Invalid file extension: {ext}") if os.path.exists(path): if backup: log.debug("Backing up: %s", path) file, ext = os.path.splitext(path) ext = ext.strip(".") - backup_path = "{}-{}.{}".format(file, time.time_ns(), ext) + backup_path = f"{file}-{time.time_ns()}.{ext}" os.rename(path, backup_path) elif force: log.debug("Removing: %s", path) @@ -474,11 +474,11 @@ def create( __salt__["file.makedirs"](path=path, owner=user) except CommandExecutionError as exc: raise CommandExecutionError( - "Error creating parent directory: {}".format(exc.message) + f"Error creating parent directory: {exc.message}" ) else: raise CommandExecutionError( - "Parent directory not present: {}".format(os.path.dirname(path)) + f"Parent directory not present: {os.path.dirname(path)}" ) return _set_info( diff --git a/salt/modules/win_smtp_server.py b/salt/modules/win_smtp_server.py index ab0e602fe79..44531a569b9 100644 --- a/salt/modules/win_smtp_server.py +++ b/salt/modules/win_smtp_server.py @@ -109,7 +109,7 @@ def _normalize_server_settings(**settings): _LOG.debug("Fixing value: %s", settings[setting]) value_from_key = next(iter(settings[setting].keys())) - ret[setting] = "{{{0}}}".format(value_from_key) + ret[setting] = f"{{{value_from_key}}}" else: ret[setting] = settings[setting] return ret @@ -391,7 +391,7 @@ def get_connection_ip_list(as_wmi_format=False, server=_DEFAULT_SERVER): for unnormalized_address in addresses: ip_address, subnet = re.split(reg_separator, unnormalized_address) if as_wmi_format: - ret.append("{}, {}".format(ip_address, subnet)) + ret.append(f"{ip_address}, {subnet}") else: ret[ip_address] = subnet @@ -431,9 +431,7 @@ def set_connection_ip_list( # Convert addresses to the 'ip_address, subnet' format used by # IIsIPSecuritySetting. for address in addresses: - formatted_addresses.append( - "{}, {}".format(address.strip(), addresses[address].strip()) - ) + formatted_addresses.append(f"{address.strip()}, {addresses[address].strip()}") current_addresses = get_connection_ip_list(as_wmi_format=True, server=server) diff --git a/salt/modules/win_snmp.py b/salt/modules/win_snmp.py index 0fc7775ea6c..a2cff764477 100644 --- a/salt/modules/win_snmp.py +++ b/salt/modules/win_snmp.py @@ -11,11 +11,11 @@ from salt.exceptions import CommandExecutionError, SaltInvocationError _HKEY = "HKLM" _SNMP_KEY = r"SYSTEM\CurrentControlSet\Services\SNMP\Parameters" -_AGENT_KEY = r"{}\RFC1156Agent".format(_SNMP_KEY) -_COMMUNITIES_KEY = r"{}\ValidCommunities".format(_SNMP_KEY) +_AGENT_KEY = rf"{_SNMP_KEY}\RFC1156Agent" +_COMMUNITIES_KEY = rf"{_SNMP_KEY}\ValidCommunities" _SNMP_GPO_KEY = r"SOFTWARE\Policies\SNMP\Parameters" -_COMMUNITIES_GPO_KEY = r"{}\ValidCommunities".format(_SNMP_GPO_KEY) +_COMMUNITIES_GPO_KEY = rf"{_SNMP_GPO_KEY}\ValidCommunities" _PERMISSION_TYPES = { "None": 1, diff --git a/salt/modules/win_system.py b/salt/modules/win_system.py index 0801d40aa93..e81248c30b6 100644 --- a/salt/modules/win_system.py +++ b/salt/modules/win_system.py @@ -509,15 +509,15 @@ def get_system_info(): def byte_calc(val): val = float(val) if val < 2**10: - return "{:.3f}B".format(val) + return f"{val:.3f}B" elif val < 2**20: - return "{:.3f}KB".format(val / 2**10) + return f"{val / 2**10:.3f}KB" elif val < 2**30: - return "{:.3f}MB".format(val / 2**20) + return f"{val / 2**20:.3f}MB" elif val < 2**40: - return "{:.3f}GB".format(val / 2**30) + return f"{val / 2**30:.3f}GB" else: - return "{:.3f}TB".format(val / 2**40) + return f"{val / 2**40:.3f}TB" # Lookup dicts for Win32_OperatingSystem os_type = {1: "Work Station", 2: "Domain Controller", 3: "Server"} @@ -772,10 +772,10 @@ def join_domain( status = get_domain_workgroup() if "Domain" in status: if status["Domain"] == domain: - return "Already joined to {}".format(domain) + return f"Already joined to {domain}" if username and "\\" not in username and "@" not in username: - username = "{}@{}".format(username, domain) + username = f"{username}@{domain}" if username and password is None: return "Must specify a password if you pass a username" @@ -918,11 +918,11 @@ def unjoin_domain( status = get_domain_workgroup() if "Workgroup" in status: if status["Workgroup"] == workgroup: - return "Already joined to {}".format(workgroup) + return f"Already joined to {workgroup}" if username and "\\" not in username and "@" not in username: if domain: - username = "{}@{}".format(username, domain) + username = f"{username}@{domain}" else: return "Must specify domain if not supplied in username" @@ -1060,7 +1060,7 @@ def get_system_time(): elif hours > 12: hours = hours - 12 meridian = "PM" - return "{:02d}:{:02d}:{:02d} {}".format(hours, now[5], now[6], meridian) + return f"{hours:02d}:{now[5]:02d}:{now[6]:02d} {meridian}" def set_system_time(newtime): @@ -1199,7 +1199,7 @@ def get_system_date(): salt '*' system.get_system_date """ now = win32api.GetLocalTime() - return "{:02d}/{:02d}/{:04d}".format(now[1], now[3], now[0]) + return f"{now[1]:02d}/{now[3]:02d}/{now[0]:04d}" def set_system_date(newdate): diff --git a/salt/modules/win_timezone.py b/salt/modules/win_timezone.py index d95f7338bfe..fde63eb7ff8 100644 --- a/salt/modules/win_timezone.py +++ b/salt/modules/win_timezone.py @@ -294,14 +294,14 @@ def set_zone(timezone): else: # Raise error because it's neither key nor value - raise CommandExecutionError("Invalid timezone passed: {}".format(timezone)) + raise CommandExecutionError(f"Invalid timezone passed: {timezone}") # Set the value cmd = ["tzutil", "/s", win_zone] res = __salt__["cmd.run_all"](cmd, python_shell=False) if res["retcode"]: raise CommandExecutionError( - "tzutil encountered an error setting timezone: {}".format(timezone), + f"tzutil encountered an error setting timezone: {timezone}", info=res, ) return zone_compare(timezone) @@ -336,7 +336,7 @@ def zone_compare(timezone): else: # Raise error because it's neither key nor value - raise CommandExecutionError("Invalid timezone passed: {}".format(timezone)) + raise CommandExecutionError(f"Invalid timezone passed: {timezone}") return get_zone() == mapper.get_unix(check_zone, "Unknown") diff --git a/salt/modules/win_useradd.py b/salt/modules/win_useradd.py index e557ffd8113..a9e9b2629b6 100644 --- a/salt/modules/win_useradd.py +++ b/salt/modules/win_useradd.py @@ -250,7 +250,7 @@ def update( try: dt_obj = salt.utils.dateutils.date_cast(expiration_date) except (ValueError, RuntimeError): - return "Invalid Date/Time Format: {}".format(expiration_date) + return f"Invalid Date/Time Format: {expiration_date}" user_info["acct_expires"] = time.mktime(dt_obj.timetuple()) if expired is not None: if expired: @@ -467,7 +467,7 @@ def addgroup(name, group): if group in user["groups"]: return True - cmd = 'net localgroup "{}" {} /add'.format(group, name) + cmd = f'net localgroup "{group}" {name} /add' ret = __salt__["cmd.run_all"](cmd, python_shell=True) return ret["retcode"] == 0 @@ -502,7 +502,7 @@ def removegroup(name, group): if group not in user["groups"]: return True - cmd = 'net localgroup "{}" {} /delete'.format(group, name) + cmd = f'net localgroup "{group}" {name} /delete' ret = __salt__["cmd.run_all"](cmd, python_shell=True) return ret["retcode"] == 0 @@ -633,14 +633,14 @@ def chgroups(name, groups, append=True): for group in ugrps: group = shlex.quote(group).lstrip("'").rstrip("'") if group not in groups: - cmd = 'net localgroup "{}" {} /delete'.format(group, name) + cmd = f'net localgroup "{group}" {name} /delete' __salt__["cmd.run_all"](cmd, python_shell=True) for group in groups: if group in ugrps: continue group = shlex.quote(group).lstrip("'").rstrip("'") - cmd = 'net localgroup "{}" {} /add'.format(group, name) + cmd = f'net localgroup "{group}" {name} /add' out = __salt__["cmd.run_all"](cmd, python_shell=True) if out["retcode"] != 0: log.error(out["stdout"]) @@ -774,7 +774,7 @@ def _get_userprofile_from_registry(user, sid): """ profile_dir = __utils__["reg.read_value"]( "HKEY_LOCAL_MACHINE", - "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{}".format(sid), + f"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\{sid}", "ProfileImagePath", )["vdata"] log.debug('user %s with sid=%s profile is located at "%s"', user, sid, profile_dir) @@ -901,12 +901,12 @@ def rename(name, new_name): # Load information for the current name current_info = info(name) if not current_info: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") # Look for an existing user with the new name new_info = info(new_name) if new_info: - raise CommandExecutionError("User '{}' already exists".format(new_name)) + raise CommandExecutionError(f"User '{new_name}' already exists") # Rename the user account # Connect to WMI @@ -917,7 +917,7 @@ def rename(name, new_name): try: user = c.Win32_UserAccount(Name=name)[0] except IndexError: - raise CommandExecutionError("User '{}' does not exist".format(name)) + raise CommandExecutionError(f"User '{name}' does not exist") # Rename the user result = user.Rename(new_name)[0] diff --git a/salt/modules/win_wua.py b/salt/modules/win_wua.py index 9c4a0bc8f2d..c7799d5f6be 100644 --- a/salt/modules/win_wua.py +++ b/salt/modules/win_wua.py @@ -995,7 +995,7 @@ def set_wu_settings( ) = error.args # pylint: enable=unpacking-non-sequence,unbalanced-tuple-unpacking # Consider checking for -2147024891 (0x80070005) Access Denied - ret["Comment"] = "Failed with failure code: {}".format(exc[5]) + ret["Comment"] = f"Failed with failure code: {exc[5]}" ret["Success"] = False else: # msupdate is false, so remove it from the services @@ -1019,7 +1019,7 @@ def set_wu_settings( # -2147024891 (0x80070005) Access Denied # -2145091564 (0x80248014) Service Not Found (shouldn't get # this with the check for _get_msupdate_status above - ret["Comment"] = "Failed with failure code: {}".format(exc[5]) + ret["Comment"] = f"Failed with failure code: {exc[5]}" ret["Success"] = False else: ret["msupdate"] = msupdate diff --git a/salt/modules/win_wusa.py b/salt/modules/win_wusa.py index c4c5f21ea01..db9dfc6a55e 100644 --- a/salt/modules/win_wusa.py +++ b/salt/modules/win_wusa.py @@ -40,7 +40,7 @@ def _pshell_json(cmd, cwd=None): in JSON format and load that into python """ if "convertto-json" not in cmd.lower(): - cmd = "{} | ConvertTo-Json".format(cmd) + cmd = f"{cmd} | ConvertTo-Json" log.debug("PowerShell: %s", cmd) ret = __salt__["cmd.run_all"](cmd, shell="powershell", cwd=cwd) @@ -53,9 +53,7 @@ def _pshell_json(cmd, cwd=None): if "retcode" not in ret or ret["retcode"] != 0: # run_all logs an error to log.error, fail hard back to the user - raise CommandExecutionError( - "Issue executing PowerShell {}".format(cmd), info=ret - ) + raise CommandExecutionError(f"Issue executing PowerShell {cmd}", info=ret) # Sometimes Powershell returns an empty string, which isn't valid JSON if ret["stdout"] == "": @@ -89,7 +87,7 @@ def is_installed(name): """ return ( __salt__["cmd.retcode"]( - cmd="Get-HotFix -Id {}".format(name), + cmd=f"Get-HotFix -Id {name}", shell="powershell", ignore_retcode=True, ) @@ -137,7 +135,7 @@ def install(path, restart=False): # Check the ret_code file_name = os.path.basename(path) errors = { - 2359302: "{} is already installed".format(file_name), + 2359302: f"{file_name} is already installed", 3010: ( "{} correctly installed but server reboot is needed to complete" " installation".format(file_name) @@ -147,7 +145,7 @@ def install(path, restart=False): if ret_code in errors: raise CommandExecutionError(errors[ret_code], ret_code) elif ret_code: - raise CommandExecutionError("Unknown error: {}".format(ret_code)) + raise CommandExecutionError(f"Unknown error: {ret_code}") return True @@ -202,14 +200,14 @@ def uninstall(path, restart=False): # If you pass /quiet and specify /kb, you'll always get retcode 87 if there # is an error. Use the actual file to get a more descriptive error errors = { - -2145116156: "{} does not support uninstall".format(kb), - 2359303: "{} not installed".format(kb), + -2145116156: f"{kb} does not support uninstall", + 2359303: f"{kb} not installed", 87: "Unknown error. Try specifying an .msu file", } if ret_code in errors: raise CommandExecutionError(errors[ret_code], ret_code) elif ret_code: - raise CommandExecutionError("Unknown error: {}".format(ret_code)) + raise CommandExecutionError(f"Unknown error: {ret_code}") return True diff --git a/salt/modules/winrepo.py b/salt/modules/winrepo.py index 227e81ee2e8..d7d39253eb1 100644 --- a/salt/modules/winrepo.py +++ b/salt/modules/winrepo.py @@ -165,15 +165,15 @@ def show_sls(name, saltenv="base"): repo.extend(definition) # Check for the sls file by name - sls_file = "{}.sls".format(os.sep.join(repo)) + sls_file = f"{os.sep.join(repo)}.sls" if not os.path.exists(sls_file): # Maybe it's a directory with an init.sls - sls_file = "{}\\init.sls".format(os.sep.join(repo)) + sls_file = f"{os.sep.join(repo)}\\init.sls" if not os.path.exists(sls_file): # It's neither, return - return "Software definition {} not found".format(name) + return f"Software definition {name} not found" # Load the renderer renderers = salt.loader.render(__opts__, __salt__) @@ -193,7 +193,7 @@ def show_sls(name, saltenv="base"): except SaltRenderError as exc: log.debug("Failed to compile %s.", sls_file) log.debug("Error: %s.", exc) - config["Message"] = "Failed to compile {}".format(sls_file) - config["Error"] = "{}".format(exc) + config["Message"] = f"Failed to compile {sls_file}" + config["Error"] = f"{exc}" return config diff --git a/salt/modules/wordpress.py b/salt/modules/wordpress.py index 792d4f25536..7ce4c6b3cca 100644 --- a/salt/modules/wordpress.py +++ b/salt/modules/wordpress.py @@ -41,7 +41,7 @@ def list_plugins(path, user): salt '*' wordpress.list_plugins /var/www/html apache """ ret = [] - resp = __salt__["cmd.shell"]("wp --path={} plugin list".format(path), runas=user) + resp = __salt__["cmd.shell"](f"wp --path={path} plugin list", runas=user) for line in resp.split("\n")[1:]: ret.append(line.split("\t")) return [plugin.__dict__ for plugin in map(_get_plugins, ret)] @@ -68,7 +68,7 @@ def show_plugin(name, path, user): """ ret = {"name": name} resp = __salt__["cmd.shell"]( - "wp --path={} plugin status {}".format(path, name), runas=user + f"wp --path={path} plugin status {name}", runas=user ).split("\n") for line in resp: if "Status" in line: @@ -101,9 +101,7 @@ def activate(name, path, user): if check["status"] == "active": # already active return None - resp = __salt__["cmd.shell"]( - "wp --path={} plugin activate {}".format(path, name), runas=user - ) + resp = __salt__["cmd.shell"](f"wp --path={path} plugin activate {name}", runas=user) if "Success" in resp: return True elif show_plugin(name, path, user)["status"] == "active": @@ -135,7 +133,7 @@ def deactivate(name, path, user): # already inactive return None resp = __salt__["cmd.shell"]( - "wp --path={} plugin deactivate {}".format(path, name), runas=user + f"wp --path={path} plugin deactivate {name}", runas=user ) if "Success" in resp: return True @@ -160,9 +158,7 @@ def is_installed(path, user=None): salt '*' wordpress.is_installed /var/www/html apache """ - retcode = __salt__["cmd.retcode"]( - "wp --path={} core is-installed".format(path), runas=user - ) + retcode = __salt__["cmd.retcode"](f"wp --path={path} core is-installed", runas=user) if retcode == 0: return True return False diff --git a/salt/modules/x509.py b/salt/modules/x509.py index 57c381ea382..ee1b2e378d2 100644 --- a/salt/modules/x509.py +++ b/salt/modules/x509.py @@ -188,7 +188,7 @@ def _parse_openssl_req(csr_filename): """ if not salt.utils.path.which("openssl"): raise salt.exceptions.SaltInvocationError("openssl binary not found in path") - cmd = "openssl req -text -noout -in {}".format(csr_filename) + cmd = f"openssl req -text -noout -in {csr_filename}" output = __salt__["cmd.run_stdout"](cmd) @@ -231,7 +231,7 @@ def _parse_openssl_crl(crl_filename): """ if not salt.utils.path.which("openssl"): raise salt.exceptions.SaltInvocationError("openssl binary not found in path") - cmd = "openssl crl -text -noout -in {}".format(crl_filename) + cmd = f"openssl crl -text -noout -in {crl_filename}" output = __salt__["cmd.run_stdout"](cmd) @@ -316,7 +316,7 @@ def _dec2hex(decval): """ Converts decimal values to nicely formatted hex strings """ - return _pretty_hex("{:X}".format(decval)) + return _pretty_hex(f"{decval:X}") def _isfile(path): @@ -505,7 +505,7 @@ def get_pem_entry(text, pem_type=None): pem_temp = pem_temp[pem_temp.index("-") :] text = "\n".join(pem_fixed) - errmsg = "PEM text not valid:\n{}".format(text) + errmsg = f"PEM text not valid:\n{text}" if pem_type: errmsg = "PEM does not contain a single entry of type {}:\n{}".format( pem_type, text @@ -824,7 +824,7 @@ def write_pem(text, path, overwrite=True, pem_type=None): _fp.write(salt.utils.stringutils.to_str(text)) if pem_type and pem_type == "CERTIFICATE" and _dhparams: _fp.write(salt.utils.stringutils.to_str(_dhparams)) - return "PEM written to {}".format(path) + return f"PEM written to {path}" def create_private_key( @@ -1130,7 +1130,7 @@ def get_signing_policy(signing_policy_name): """ signing_policy = _get_signing_policy(signing_policy_name) if not signing_policy: - return "Signing policy {} does not exist.".format(signing_policy_name) + return f"Signing policy {signing_policy_name} does not exist." if isinstance(signing_policy, list): dict_ = {} for item in signing_policy: diff --git a/salt/modules/xbpspkg.py b/salt/modules/xbpspkg.py index afcf54fb2f2..65376c7dea1 100644 --- a/salt/modules/xbpspkg.py +++ b/salt/modules/xbpspkg.py @@ -401,7 +401,7 @@ def install(name=None, refresh=False, fromrepo=None, pkgs=None, sources=None, ** if refresh: cmd.append("-S") # update repo db if fromrepo: - cmd.append("--repository={}".format(fromrepo)) + cmd.append(f"--repository={fromrepo}") cmd.append("-y") # assume yes when asked cmd.extend(pkg_params) @@ -578,9 +578,7 @@ def add_repo(repo, conffile="/usr/share/xbps.d/15-saltstack.conf"): if not _locate_repo_files(repo): try: with salt.utils.files.fopen(conffile, "a+") as conf_file: - conf_file.write( - salt.utils.stringutils.to_str("repository={}\n".format(repo)) - ) + conf_file.write(salt.utils.stringutils.to_str(f"repository={repo}\n")) except OSError: return False diff --git a/salt/modules/xfs.py b/salt/modules/xfs.py index b506cd965e7..c47201262d0 100644 --- a/salt/modules/xfs.py +++ b/salt/modules/xfs.py @@ -111,7 +111,7 @@ def info(device): salt '*' xfs.info /dev/sda1 """ - out = __salt__["cmd.run_all"]("xfs_info {}".format(device)) + out = __salt__["cmd.run_all"](f"xfs_info {device}") if out.get("stderr"): raise CommandExecutionError(out["stderr"].replace("xfs_info:", "").strip()) return _parse_xfs_info(out["stdout"]) @@ -186,16 +186,16 @@ def dump(device, destination, level=0, label=None, noerase=None): label and label or time.strftime( - 'XFS dump for "{}" of %Y.%m.%d, %H:%M'.format(device), time.localtime() + f'XFS dump for "{device}" of %Y.%m.%d, %H:%M', time.localtime() ).replace("'", '"') ) cmd = ["xfsdump"] cmd.append("-F") # Force if not noerase: cmd.append("-E") # pre-erase - cmd.append("-L '{}'".format(label)) # Label - cmd.append("-l {}".format(level)) # Dump level - cmd.append("-f {}".format(destination)) # Media destination + cmd.append(f"-L '{label}'") # Label + cmd.append(f"-l {level}") # Dump level + cmd.append(f"-f {destination}") # Media destination cmd.append(device) # Device cmd = " ".join(cmd) @@ -211,10 +211,10 @@ def _xr_to_keyset(line): """ tkns = [elm for elm in line.strip().split(":", 1) if elm] if len(tkns) == 1: - return "'{}': ".format(tkns[0]) + return f"'{tkns[0]}': " else: key, val = tkns - return "'{}': '{}',".format(key.strip(), val.strip()) + return f"'{key.strip()}': '{val.strip()}'," def _xfs_inventory_output(out): @@ -305,14 +305,14 @@ def prune_dump(sessionid): salt '*' xfs.prune_dump b74a3586-e52e-4a4a-8775-c3334fa8ea2c """ - out = __salt__["cmd.run_all"]("xfsinvutil -s {} -F".format(sessionid)) + out = __salt__["cmd.run_all"](f"xfsinvutil -s {sessionid} -F") _verify_run(out) data = _xfs_prune_output(out["stdout"], sessionid) if data: return data - raise CommandExecutionError('Session UUID "{}" was not found.'.format(sessionid)) + raise CommandExecutionError(f'Session UUID "{sessionid}" was not found.') def _blkid_output(out): @@ -390,9 +390,9 @@ def estimate(path): salt '*' xfs.estimate /path/to/dir/* """ if not os.path.exists(path): - raise CommandExecutionError('Path "{}" was not found.'.format(path)) + raise CommandExecutionError(f'Path "{path}" was not found.') - out = __salt__["cmd.run_all"]("xfs_estimate -v {}".format(path)) + out = __salt__["cmd.run_all"](f"xfs_estimate -v {path}") _verify_run(out) return _xfs_estimate_output(out["stdout"]) @@ -452,7 +452,7 @@ def mkfs( cmd = ["mkfs.xfs"] if label: cmd.append("-L") - cmd.append("'{}'".format(label)) + cmd.append(f"'{label}'") if ssize: cmd.append("-s") @@ -473,7 +473,7 @@ def mkfs( cmd.append(opts) except Exception: # pylint: disable=broad-except raise CommandExecutionError( - 'Wrong parameters "{}" for option "{}"'.format(opts, switch) + f'Wrong parameters "{opts}" for option "{switch}"' ) if not noforce: @@ -501,13 +501,13 @@ def modify(device, label=None, lazy_counting=None, uuid=None): """ if not label and lazy_counting is None and uuid is None: raise CommandExecutionError( - 'Nothing specified for modification for "{}" device'.format(device) + f'Nothing specified for modification for "{device}" device' ) cmd = ["xfs_admin"] if label: cmd.append("-L") - cmd.append("'{}'".format(label)) + cmd.append(f"'{label}'") if lazy_counting is False: cmd.append("-c") @@ -527,7 +527,7 @@ def modify(device, label=None, lazy_counting=None, uuid=None): cmd = " ".join(cmd) _verify_run(__salt__["cmd.run_all"](cmd), cmd=cmd) - out = __salt__["cmd.run_all"]("blkid -o export {}".format(device)) + out = __salt__["cmd.run_all"](f"blkid -o export {device}") _verify_run(out) return _blkid_output(out["stdout"]) @@ -568,9 +568,9 @@ def defragment(device): raise CommandExecutionError("Root is not a device.") if not _get_mounts().get(device): - raise CommandExecutionError('Device "{}" is not mounted'.format(device)) + raise CommandExecutionError(f'Device "{device}" is not mounted') - out = __salt__["cmd.run_all"]("xfs_fsr {}".format(device)) + out = __salt__["cmd.run_all"](f"xfs_fsr {device}") _verify_run(out) return {"log": out["stdout"]} diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 4e5cd8416d8..b4ffdc72ce5 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -102,7 +102,7 @@ def _strip_headers(output, *args): def _get_copr_repo(copr): copr = copr.split(":", 1)[1] copr = copr.split("/", 1) - return "copr:copr.fedorainfracloud.org:{}:{}".format(copr[0], copr[1]) + return f"copr:copr.fedorainfracloud.org:{copr[0]}:{copr[1]}" def _get_hold(line, pattern=__HOLD_PATTERN, full=True): @@ -115,14 +115,14 @@ def _get_hold(line, pattern=__HOLD_PATTERN, full=True): """ if full: if _yum() == "dnf": - lock_re = r"({}-\S+)".format(pattern) + lock_re = rf"({pattern}-\S+)" else: - lock_re = r"(\d+:{}-\S+)".format(pattern) + lock_re = rf"(\d+:{pattern}-\S+)" else: if _yum() == "dnf": - lock_re = r"({}-\S+)".format(pattern) + lock_re = rf"({pattern}-\S+)" else: - lock_re = r"\d+:({}-\S+)".format(pattern) + lock_re = rf"\d+:({pattern}-\S+)" match = re.search(lock_re, line) if match: @@ -263,9 +263,7 @@ def _check_versionlock(): """ vl_plugin = _versionlock_pkg() if vl_plugin not in list_pkgs(): - raise SaltInvocationError( - "Cannot proceed, {} is not installed.".format(vl_plugin) - ) + raise SaltInvocationError(f"Cannot proceed, {vl_plugin} is not installed.") def _get_options(**kwargs): @@ -295,26 +293,26 @@ def _get_options(**kwargs): if fromrepo: log.info("Restricting to repo '%s'", fromrepo) - ret.extend(["--disablerepo=*", "--enablerepo={}".format(fromrepo)]) + ret.extend(["--disablerepo=*", f"--enablerepo={fromrepo}"]) else: if disablerepo: targets = ( [disablerepo] if not isinstance(disablerepo, list) else disablerepo ) log.info("Disabling repo(s): %s", ", ".join(targets)) - ret.extend(["--disablerepo={}".format(x) for x in targets]) + ret.extend([f"--disablerepo={x}" for x in targets]) if enablerepo: targets = [enablerepo] if not isinstance(enablerepo, list) else enablerepo log.info("Enabling repo(s): %s", ", ".join(targets)) - ret.extend(["--enablerepo={}".format(x) for x in targets]) + ret.extend([f"--enablerepo={x}" for x in targets]) if disableexcludes: log.info("Disabling excludes for '%s'", disableexcludes) - ret.append("--disableexcludes={}".format(disableexcludes)) + ret.append(f"--disableexcludes={disableexcludes}") if branch: log.info("Adding branch '%s'", branch) - ret.append("--branch={}".format(branch)) + ret.append(f"--branch={branch}") for item in setopt: ret.extend(["--setopt", str(item)]) @@ -327,10 +325,10 @@ def _get_options(**kwargs): value = kwargs[key] if isinstance(value, str): log.info("Found extra option --%s=%s", key, value) - ret.append("--{}={}".format(key, value)) + ret.append(f"--{key}={value}") elif value is True: log.info("Found extra option --%s", key) - ret.append("--{}".format(key)) + ret.append(f"--{key}") if ret: log.info("Adding extra options: %s", ret) @@ -368,15 +366,13 @@ def _get_yum_config(strict_parser=True): break if not fn: - raise CommandExecutionError( - "No suitable yum config file found in: {}".format(paths) - ) + raise CommandExecutionError(f"No suitable yum config file found in: {paths}") cp = configparser.ConfigParser(strict=strict_parser) try: cp.read(fn) except OSError as exc: - raise CommandExecutionError("Unable to read from {}: {}".format(fn, exc)) + raise CommandExecutionError(f"Unable to read from {fn}: {exc}") if cp.has_section("main"): for opt in cp.options("main"): @@ -970,7 +966,7 @@ def list_repo_pkgs(*args, **kwargs): else: for repo in repos: if _yum() == "tdnf": - cmd = ["--quiet", "--enablerepo={}".format(repo), "list"] + cmd = ["--quiet", f"--enablerepo={repo}", "list"] else: cmd = [ "--quiet", @@ -1229,7 +1225,7 @@ def install( update_holds=False, saltenv="base", ignore_epoch=False, - **kwargs + **kwargs, ): """ .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 @@ -1443,7 +1439,7 @@ def install( sources, saltenv=saltenv, normalize=normalize and kwargs.get("split_arch", True), - **kwargs + **kwargs, ) except MinionError as exc: raise CommandExecutionError(exc) @@ -1502,9 +1498,7 @@ def install( cur_patches = list_patches() for advisory_id in pkg_params: if advisory_id not in cur_patches: - raise CommandExecutionError( - 'Advisory id "{}" not found'.format(advisory_id) - ) + raise CommandExecutionError(f'Advisory id "{advisory_id}" not found') else: pkg_params_items.append(advisory_id) else: @@ -1622,7 +1616,7 @@ def install( continue if ignore_epoch is True: - pkgstr = "{}-{}{}".format(pkgname, version_num, arch) + pkgstr = f"{pkgname}-{version_num}{arch}" else: pkgstr = "{}-{}{}".format( pkgname, version_num.split(":", 1)[-1], arch @@ -1746,7 +1740,7 @@ def install( with _temporarily_unhold(to_install, targets): if targets: if pkg_type == "advisory": - targets = ["--advisory={}".format(t) for t in targets] + targets = [f"--advisory={t}" for t in targets] cmd = ["-y"] if _yum() == "dnf": cmd.extend(["--best", "--allowerasing"]) @@ -1823,7 +1817,7 @@ def upgrade( minimal=False, obsoletes=True, diff_attr=None, - **kwargs + **kwargs, ): """ Run a full system upgrade (a ``yum upgrade`` or ``dnf upgrade``), or @@ -2051,7 +2045,7 @@ def update( normalize=True, minimal=False, obsoletes=False, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -2297,7 +2291,7 @@ def hold( if target not in current_locks: if "test" in __opts__ and __opts__["test"]: ret[target].update(result=None) - ret[target]["comment"] = "Package {} is set to be held.".format(target) + ret[target]["comment"] = f"Package {target} is set to be held." else: out = _call_yum(["versionlock", target]) if out["retcode"] == 0: @@ -2390,7 +2384,7 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 search_locks = [ x for x in current_locks - if fnmatch.fnmatch(x, "*{}*".format(target)) + if fnmatch.fnmatch(x, f"*{target}*") and target == _get_hold(x, full=False) ] @@ -2410,12 +2404,12 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06 ret[target]["changes"]["new"] = "" ret[target]["changes"]["old"] = "hold" else: - ret[target]["comment"] = ( - "Package {} was unable to be unheld.".format(target) - ) + ret[target][ + "comment" + ] = f"Package {target} was unable to be unheld." else: ret[target].update(result=True) - ret[target]["comment"] = "Package {} is not being held.".format(target) + ret[target]["comment"] = f"Package {target} is not being held." return ret @@ -2638,7 +2632,7 @@ def group_info(name, expand=False, ignore_groups=None, **kwargs): ret["group"] = g_info.get("environment group") or g_info.get("group") ret["id"] = g_info.get("environment-id") or g_info.get("group-id") if not ret["group"] and not ret["id"]: - raise CommandExecutionError("Group '{}' not found".format(name)) + raise CommandExecutionError(f"Group '{name}' not found") ret["description"] = g_info.get("description", "") @@ -2864,7 +2858,7 @@ def list_repos(basedir=None, **kwargs): if not os.path.exists(bdir): continue for repofile in os.listdir(bdir): - repopath = "{}/{}".format(bdir, repofile) + repopath = f"{bdir}/{repofile}" if not repofile.endswith(".repo"): continue filerepos = _parse_repo_file(repopath, strict_parser)[1] @@ -2936,7 +2930,7 @@ def del_repo(repo, basedir=None, **kwargs): # pylint: disable=W0613 repos = list_repos(basedirs, **kwargs) if repo not in repos: - return "Error: the {} repo does not exist in {}".format(repo, basedirs) + return f"Error: the {repo} repo does not exist in {basedirs}" # Find out what file the repo lives in repofile = "" @@ -2955,7 +2949,7 @@ def del_repo(repo, basedir=None, **kwargs): # pylint: disable=W0613 # If this is the only repo in the file, delete the file itself if onlyrepo: os.remove(repofile) - return "File {} containing repo {} has been removed".format(repofile, repo) + return f"File {repofile} containing repo {repo} has been removed" # There must be other repos in this file, write the file with them header, filerepos = _parse_repo_file(repofile, strict_parser) @@ -2969,20 +2963,20 @@ def del_repo(repo, basedir=None, **kwargs): # pylint: disable=W0613 filerepos[stanza]["comments"] ) del filerepos[stanza]["comments"] - content += "\n[{}]".format(stanza) + content += f"\n[{stanza}]" for line in filerepos[stanza]: # A whitespace is needed at the beginning of the new line in order # to avoid breaking multiple line values allowed on repo files. value = filerepos[stanza][line] if isinstance(value, str) and "\n" in value: value = "\n ".join(value.split("\n")) - content += "\n{}={}".format(line, value) - content += "\n{}\n".format(comments) + content += f"\n{line}={value}" + content += f"\n{comments}\n" with salt.utils.files.fopen(repofile, "w") as fileout: fileout.write(salt.utils.stringutils.to_str(content)) - return "Repo {} has been removed from {}".format(repo, repofile) + return f"Repo {repo} has been removed from {repofile}" def mod_repo(repo, basedir=None, **kwargs): @@ -3070,7 +3064,7 @@ def mod_repo(repo, basedir=None, **kwargs): "The repo does not exist and needs to be created, but none " "of the following basedir directories exist: {}".format(basedirs) ) - repofile = "{}/{}.repo".format(newdir, repo) + repofile = f"{newdir}/{repo}.repo" if use_copr: # Is copr plugin installed? copr_plugin_name = "" @@ -3081,7 +3075,7 @@ def mod_repo(repo, basedir=None, **kwargs): if not __salt__["pkg_resource.version"](copr_plugin_name): raise SaltInvocationError( - "{} must be installed to use COPR".format(copr_plugin_name) + f"{copr_plugin_name} must be installed to use COPR" ) # Enable COPR @@ -3098,7 +3092,7 @@ def mod_repo(repo, basedir=None, **kwargs): repofile = repos[repo]["file"] header, filerepos = _parse_repo_file(repofile, strict_parser) else: - repofile = "{}/{}.repo".format(newdir, repo) + repofile = f"{newdir}/{repo}.repo" if "name" not in repo_opts: raise SaltInvocationError( @@ -3144,7 +3138,7 @@ def mod_repo(repo, basedir=None, **kwargs): comments = salt.utils.pkg.rpm.combine_comments( filerepos[stanza].pop("comments", []) ) - content += "[{}]\n".format(stanza) + content += f"[{stanza}]\n" for line in filerepos[stanza].keys(): # A whitespace is needed at the beginning of the new line in order # to avoid breaking multiple line values allowed on repo files. @@ -3365,11 +3359,7 @@ def download(*packages, **kwargs): to_purge = [] for pkg in packages: to_purge.extend( - [ - os.path.join(CACHE_DIR, x) - for x in cached_pkgs - if x.startswith("{}-".format(pkg)) - ] + [os.path.join(CACHE_DIR, x) for x in cached_pkgs if x.startswith(f"{pkg}-")] ) for purge_target in set(to_purge): log.debug("Removing cached package %s", purge_target) @@ -3378,7 +3368,7 @@ def download(*packages, **kwargs): except OSError as exc: log.error("Unable to remove %s: %s", purge_target, exc) - cmd = ["yumdownloader", "-q", "--destdir={}".format(CACHE_DIR)] + cmd = ["yumdownloader", "-q", f"--destdir={CACHE_DIR}"] cmd.extend(packages) __salt__["cmd.run"](cmd, output_loglevel="trace", python_shell=False) ret = {} @@ -3388,7 +3378,7 @@ def download(*packages, **kwargs): pkg_name = None pkg_file = None for query_pkg in packages: - if dld_result.startswith("{}-".format(query_pkg)): + if dld_result.startswith(f"{query_pkg}-"): pkg_name = query_pkg pkg_file = dld_result break diff --git a/salt/modules/zabbix.py b/salt/modules/zabbix.py index f09ca1df3ba..4c834e09905 100644 --- a/salt/modules/zabbix.py +++ b/salt/modules/zabbix.py @@ -189,11 +189,9 @@ def _query(method, params, url, auth=None): ) return ret except ValueError as err: - raise SaltException( - "URL or HTTP headers are probably not correct! ({})".format(err) - ) + raise SaltException(f"URL or HTTP headers are probably not correct! ({err})") except OSError as err: - raise SaltException("Check hostname in URL! ({})".format(err)) + raise SaltException(f"Check hostname in URL! ({err})") def _login(**kwargs): @@ -232,9 +230,9 @@ def _login(**kwargs): name = name[len(prefix) :] except IndexError: return - val = __salt__["config.get"]("zabbix.{}".format(name), None) or __salt__[ + val = __salt__["config.get"](f"zabbix.{name}", None) or __salt__[ "config.get" - ]("zabbix:{}".format(name), None) + ](f"zabbix:{name}", None) if val is not None: connargs[key] = val @@ -258,7 +256,7 @@ def _login(**kwargs): else: raise KeyError except KeyError as err: - raise SaltException("URL is probably not correct! ({})".format(err)) + raise SaltException(f"URL is probably not correct! ({err})") def _params_extend(params, _ignore_name=False, **kwargs): @@ -2143,7 +2141,7 @@ def usermacro_get( hostmacroids=None, globalmacroids=None, globalmacro=False, - **connection_args + **connection_args, ): """ Retrieve user macros according to the given parameters. diff --git a/salt/modules/zcbuildout.py b/salt/modules/zcbuildout.py index e4a8b36e403..6a908b0c258 100644 --- a/salt/modules/zcbuildout.py +++ b/salt/modules/zcbuildout.py @@ -208,7 +208,7 @@ def _set_status(m, comment=INVALID_RESPONSE, status=False, out=None): if out and isinstance(out, str): outlog += HR outlog += "OUTPUT:\n" - outlog += "{}\n".format(salt.utils.stringutils.to_unicode(out)) + outlog += f"{salt.utils.stringutils.to_unicode(out)}\n" outlog += HR if m["logs"]: outlog += HR @@ -224,7 +224,7 @@ def _set_status(m, comment=INVALID_RESPONSE, status=False, out=None): for logger in "error", "warn", "info", "debug": logs = m["logs_by_level"].get(logger, []) if logs: - outlog_by_level += "\n{}:\n".format(logger.upper()) + outlog_by_level += f"\n{logger.upper()}:\n" for idx, log in enumerate(logs[:]): logs[idx] = salt.utils.stringutils.to_unicode(log) outlog_by_level += "\n".join(logs) @@ -517,7 +517,7 @@ def upgrade_bootstrap( os.makedirs(dbuild) # only try to download once per buildout checkout with salt.utils.files.fopen( - os.path.join(dbuild, "{}.updated_bootstrap".format(buildout_ver)) + os.path.join(dbuild, f"{buildout_ver}.updated_bootstrap") ): pass except OSError: @@ -536,7 +536,7 @@ def upgrade_bootstrap( fic.write(salt.utils.stringutils.to_str(data)) if dled: with salt.utils.files.fopen( - os.path.join(dbuild, "{}.updated_bootstrap".format(buildout_ver)), "w" + os.path.join(dbuild, f"{buildout_ver}.updated_bootstrap"), "w" ) as afic: afic.write("foo") except OSError: @@ -689,7 +689,7 @@ def bootstrap( if (test_release is not False) and " --accept-buildout-test-releases" in content: bootstrap_args += " --accept-buildout-test-releases" if config and '"-c"' in content: - bootstrap_args += " -c {}".format(config) + bootstrap_args += f" -c {config}" # be sure that the bootstrap belongs to the running user try: if runas: @@ -703,7 +703,7 @@ def bootstrap( exc, exc_info=_logger.isEnabledFor(logging.DEBUG), ) - cmd = "{} bootstrap.py {}".format(python, bootstrap_args) + cmd = f"{python} bootstrap.py {bootstrap_args}" ret = _Popen( cmd, directory=directory, runas=runas, loglevel=loglevel, env=env, use_vt=use_vt ) @@ -844,7 +844,7 @@ def _merge_statuses(statuses): status["out"] += "\n" status["out"] += HR out = salt.utils.stringutils.to_unicode(out) - status["out"] += "{}\n".format(out) + status["out"] += f"{out}\n" status["out"] += HR if comment: if not status["comment"]: @@ -856,12 +856,12 @@ def _merge_statuses(statuses): if not status["outlog"]: status["outlog"] = "" outlog = salt.utils.stringutils.to_unicode(outlog) - status["outlog"] += "\n{}".format(HR) + status["outlog"] += f"\n{HR}" status["outlog"] += outlog if outlog_by_level: if not status["outlog_by_level"]: status["outlog_by_level"] = "" - status["outlog_by_level"] += "\n{}".format(HR) + status["outlog_by_level"] += f"\n{HR}" status["outlog_by_level"] += salt.utils.stringutils.to_unicode( outlog_by_level ) diff --git a/salt/modules/zenoss.py b/salt/modules/zenoss.py index 5f2408c486b..50855f2bebb 100644 --- a/salt/modules/zenoss.py +++ b/salt/modules/zenoss.py @@ -203,7 +203,7 @@ def set_prod_state(prod_state, device=None): device_object = find_device(device) if not device_object: - return "Unable to find a device in Zenoss for {}".format(device) + return f"Unable to find a device in Zenoss for {device}" log.info("Setting prodState to %d on %s device", prod_state, device) data = dict( diff --git a/salt/modules/zoneadm.py b/salt/modules/zoneadm.py index 0bb4a60e26e..515f9663049 100644 --- a/salt/modules/zoneadm.py +++ b/salt/modules/zoneadm.py @@ -64,7 +64,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded in a solaris globalzone.".format(__virtualname__), + f"{__virtualname__} module can only be loaded in a solaris globalzone.", ) @@ -145,18 +145,18 @@ def boot(zone, single=False, altinit=None, smf_options=None): ## build boot_options boot_options = "" if single: - boot_options = "-s {}".format(boot_options) + boot_options = f"-s {boot_options}" if altinit: # note: we cannot validate the path, as this is local to the zonepath. - boot_options = "-i {} {}".format(altinit, boot_options) + boot_options = f"-i {altinit} {boot_options}" if smf_options: - boot_options = "-m {} {}".format(smf_options, boot_options) + boot_options = f"-m {smf_options} {boot_options}" if boot_options != "": - boot_options = " -- {}".format(boot_options.strip()) + boot_options = f" -- {boot_options.strip()}" ## execute boot res = __salt__["cmd.run_all"]( "zoneadm {zone} boot{boot_opts}".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", boot_opts=boot_options, ) ) @@ -195,18 +195,18 @@ def reboot(zone, single=False, altinit=None, smf_options=None): ## build boot_options boot_options = "" if single: - boot_options = "-s {}".format(boot_options) + boot_options = f"-s {boot_options}" if altinit: # note: we cannot validate the path, as this is local to the zonepath. - boot_options = "-i {} {}".format(altinit, boot_options) + boot_options = f"-i {altinit} {boot_options}" if smf_options: - boot_options = "-m {} {}".format(smf_options, boot_options) + boot_options = f"-m {smf_options} {boot_options}" if boot_options != "": - boot_options = " -- {}".format(boot_options.strip()) + boot_options = f" -- {boot_options.strip()}" ## execute reboot res = __salt__["cmd.run_all"]( "zoneadm {zone} reboot{boot_opts}".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", boot_opts=boot_options, ) ) @@ -240,7 +240,7 @@ def halt(zone): ## halt zone res = __salt__["cmd.run_all"]( "zoneadm {zone} halt".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", ) ) ret["status"] = res["retcode"] == 0 @@ -280,18 +280,18 @@ def shutdown(zone, reboot=False, single=False, altinit=None, smf_options=None): ## build boot_options boot_options = "" if single: - boot_options = "-s {}".format(boot_options) + boot_options = f"-s {boot_options}" if altinit: # note: we cannot validate the path, as this is local to the zonepath. - boot_options = "-i {} {}".format(altinit, boot_options) + boot_options = f"-i {altinit} {boot_options}" if smf_options: - boot_options = "-m {} {}".format(smf_options, boot_options) + boot_options = f"-m {smf_options} {boot_options}" if boot_options != "": - boot_options = " -- {}".format(boot_options.strip()) + boot_options = f" -- {boot_options.strip()}" ## shutdown zone res = __salt__["cmd.run_all"]( "zoneadm {zone} shutdown{reboot}{boot_opts}".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", reboot=" -r" if reboot else "", boot_opts=boot_options, ) @@ -323,7 +323,7 @@ def detach(zone): ## detach zone res = __salt__["cmd.run_all"]( "zoneadm {zone} detach".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", ) ) ret["status"] = res["retcode"] == 0 @@ -360,7 +360,7 @@ def attach(zone, force=False, brand_opts=None): "zoneadm -z {zone} attach{force}{brand_opts}".format( zone=zone, force=" -F" if force else "", - brand_opts=" {}".format(brand_opts) if brand_opts else "", + brand_opts=f" {brand_opts}" if brand_opts else "", ) ) ret["status"] = res["retcode"] == 0 @@ -390,7 +390,7 @@ def ready(zone): ## ready zone res = __salt__["cmd.run_all"]( "zoneadm {zone} ready".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", ) ) ret["status"] = res["retcode"] == 0 @@ -453,7 +453,7 @@ def move(zone, zonepath): ## verify zone res = __salt__["cmd.run_all"]( "zoneadm {zone} move {path}".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", path=zonepath, ) ) @@ -487,7 +487,7 @@ def uninstall(zone): ## uninstall zone res = __salt__["cmd.run_all"]( "zoneadm {zone} uninstall -F".format( - zone="-u {}".format(zone) if _is_uuid(zone) else "-z {}".format(zone), + zone=f"-u {zone}" if _is_uuid(zone) else f"-z {zone}", ) ) ret["status"] = res["retcode"] == 0 @@ -524,7 +524,7 @@ def install(zone, nodataset=False, brand_opts=None): "zoneadm -z {zone} install{nodataset}{brand_opts}".format( zone=zone, nodataset=" -x nodataset" if nodataset else "", - brand_opts=" {}".format(brand_opts) if brand_opts else "", + brand_opts=f" {brand_opts}" if brand_opts else "", ) ) ret["status"] = res["retcode"] == 0 @@ -560,7 +560,7 @@ def clone(zone, source, snapshot=None): "zoneadm -z {zone} clone {snapshot}{source}".format( zone=zone, source=source, - snapshot="-s {} ".format(snapshot) if snapshot else "", + snapshot=f"-s {snapshot} " if snapshot else "", ) ) ret["status"] = res["retcode"] == 0 diff --git a/salt/modules/zonecfg.py b/salt/modules/zonecfg.py index a9040804797..57ae570b6b3 100644 --- a/salt/modules/zonecfg.py +++ b/salt/modules/zonecfg.py @@ -110,7 +110,7 @@ def __virtual__(): return __virtualname__ return ( False, - "{} module can only be loaded in a solaris globalzone.".format(__virtualname__), + f"{__virtualname__} module can only be loaded in a solaris globalzone.", ) @@ -195,7 +195,7 @@ def _sanitize_value(value): return "".join(str(v) for v in new_value).replace(",)", ")") else: # note: we can't use shelx or pipes quote here because it makes zonecfg barf - return '"{}"'.format(value) if " " in value else value + return f'"{value}"' if " " in value else value def _dump_cfg(cfg_file): @@ -233,13 +233,13 @@ def create(zone, brand, zonepath, force=False): cfg_file = salt.utils.files.mkstemp() with salt.utils.files.fpopen(cfg_file, "w+", mode=0o600) as fp_: fp_.write("create -b -F\n" if force else "create -b\n") - fp_.write("set brand={}\n".format(_sanitize_value(brand))) - fp_.write("set zonepath={}\n".format(_sanitize_value(zonepath))) + fp_.write(f"set brand={_sanitize_value(brand)}\n") + fp_.write(f"set zonepath={_sanitize_value(zonepath)}\n") # create if not __salt__["file.directory_exists"](zonepath): __salt__["file.makedirs_perms"]( - zonepath if zonepath[-1] == "/" else "{}/".format(zonepath), mode="0700" + zonepath if zonepath[-1] == "/" else f"{zonepath}/", mode="0700" ) _dump_cfg(cfg_file) @@ -354,7 +354,7 @@ def export(zone, path=None): res = __salt__["cmd.run_all"]( "zonecfg -z {zone} export{path}".format( zone=zone, - path=" -f {}".format(path) if path else "", + path=f" -f {path}" if path else "", ) ) ret["status"] = res["retcode"] == 0 @@ -422,7 +422,7 @@ def _property(methode, zone, key, value): cfg_file = None if methode not in ["set", "clear"]: ret["status"] = False - ret["message"] = "unkown methode {}!".format(methode) + ret["message"] = f"unkown methode {methode}!" else: cfg_file = salt.utils.files.mkstemp() with salt.utils.files.fpopen(cfg_file, "w+", mode=0o600) as fp_: @@ -430,9 +430,9 @@ def _property(methode, zone, key, value): if isinstance(value, dict) or isinstance(value, list): value = _sanitize_value(value) value = str(value).lower() if isinstance(value, bool) else str(value) - fp_.write("{} {}={}\n".format(methode, key, _sanitize_value(value))) + fp_.write(f"{methode} {key}={_sanitize_value(value)}\n") elif methode == "clear": - fp_.write("{} {}\n".format(methode, key)) + fp_.write(f"{methode} {key}\n") # update property if cfg_file: @@ -530,7 +530,7 @@ def _resource(methode, zone, resource_type, resource_selector, **kwargs): kwargs[k] = _sanitize_value(kwargs[k]) if methode not in ["add", "update"]: ret["status"] = False - ret["message"] = "unknown methode {}".format(methode) + ret["message"] = f"unknown methode {methode}" return ret if methode in ["update"] and resource_selector and resource_selector not in kwargs: ret["status"] = False @@ -543,7 +543,7 @@ def _resource(methode, zone, resource_type, resource_selector, **kwargs): cfg_file = salt.utils.files.mkstemp() with salt.utils.files.fpopen(cfg_file, "w+", mode=0o600) as fp_: if methode in ["add"]: - fp_.write("add {}\n".format(resource_type)) + fp_.write(f"add {resource_type}\n") elif methode in ["update"]: if resource_selector: value = kwargs[resource_selector] @@ -556,7 +556,7 @@ def _resource(methode, zone, resource_type, resource_selector, **kwargs): ) ) else: - fp_.write("select {}\n".format(resource_type)) + fp_.write(f"select {resource_type}\n") for k, v in kwargs.items(): if methode in ["update"] and k == resource_selector: continue @@ -564,9 +564,9 @@ def _resource(methode, zone, resource_type, resource_selector, **kwargs): value = _sanitize_value(value) value = str(v).lower() if isinstance(v, bool) else str(v) if k in _zonecfg_resource_setters[resource_type]: - fp_.write("set {}={}\n".format(k, _sanitize_value(value))) + fp_.write(f"set {k}={_sanitize_value(value)}\n") else: - fp_.write("add {} {}\n".format(k, _sanitize_value(value))) + fp_.write(f"add {k} {_sanitize_value(value)}\n") fp_.write("end\n") # update property @@ -671,7 +671,7 @@ def remove_resource(zone, resource_type, resource_key, resource_value): ) ) else: - fp_.write("remove {}\n".format(resource_type)) + fp_.write(f"remove {resource_type}\n") # update property if cfg_file: diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py index 5d3404a4ab1..f37de2d2455 100644 --- a/salt/modules/zypperpkg.py +++ b/salt/modules/zypperpkg.py @@ -44,8 +44,8 @@ log = logging.getLogger(__name__) HAS_ZYPP = False ZYPP_HOME = "/etc/zypp" -LOCKS = "{}/locks".format(ZYPP_HOME) -REPOS = "{}/repos.d".format(ZYPP_HOME) +LOCKS = f"{ZYPP_HOME}/locks" +REPOS = f"{ZYPP_HOME}/repos.d" DEFAULT_PRIORITY = 99 PKG_ARCH_SEPARATOR = "." @@ -371,9 +371,7 @@ class _Zypper: self.TAG_RELEASED, ) if self.error_msg and not self.__no_raise and not self.__ignore_repo_failure: - raise CommandExecutionError( - "Zypper command failure: {}".format(self.error_msg) - ) + raise CommandExecutionError(f"Zypper command failure: {self.error_msg}") return ( self._is_xml_mode() @@ -482,9 +480,7 @@ class Wildcard: "se", "-xv", self.name ).getElementsByTagName("solvable") if not solvables: - raise CommandExecutionError( - "No packages found matching '{}'".format(self.name) - ) + raise CommandExecutionError(f"No packages found matching '{self.name}'") return sorted( { @@ -519,7 +515,7 @@ class Wildcard: self._op = version.replace(exact_version, "") or None if self._op and self._op not in self.Z_OP: raise CommandExecutionError( - 'Zypper do not supports operator "{}".'.format(self._op) + f'Zypper do not supports operator "{self._op}".' ) self.version = exact_version @@ -920,7 +916,7 @@ def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs): # Results can be different if a different root or a different # inclusion types are passed - contextkey = "pkg.list_pkgs_{}_{}".format(root, includes) + contextkey = f"pkg.list_pkgs_{root}_{includes}" if contextkey in __context__ and kwargs.get("use_context", True): return _list_pkgs_from_context(versions_as_list, contextkey, attr) @@ -988,7 +984,7 @@ def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs): else: elements = [] for element in elements: - extended_name = "{}:{}".format(include, element) + extended_name = f"{include}:{element}" info = info_available(extended_name, refresh=False, root=root) _ret[extended_name] = [ { @@ -1229,7 +1225,7 @@ def del_repo(repo, root=None): "message": msg[0].childNodes[0].nodeValue, } - raise CommandExecutionError("Repository '{}' not found.".format(repo)) + raise CommandExecutionError(f"Repository '{repo}' not found.") def mod_repo(repo, **kwargs): @@ -1316,7 +1312,7 @@ def mod_repo(repo, **kwargs): if new_url == base_url: raise CommandExecutionError( - "Repository '{}' already exists as '{}'.".format(repo, alias) + f"Repository '{repo}' already exists as '{alias}'." ) # Add new repo @@ -1472,7 +1468,7 @@ def install( ignore_repo_failure=False, no_recommends=False, root=None, - **kwargs + **kwargs, ): """ .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 @@ -1639,7 +1635,7 @@ def install( prefix, verstr = salt.utils.pkg.split_comparison(version_num) if not prefix: prefix = "=" - target = "{}{}{}".format(param, prefix, verstr) + target = f"{param}{prefix}{verstr}" log.debug("targeting package: %s", target) targets.append(target) elif pkg_type == "advisory": @@ -1647,9 +1643,7 @@ def install( cur_patches = list_patches(root=root) for advisory_id in pkg_params: if advisory_id not in cur_patches: - raise CommandExecutionError( - 'Advisory id "{}" not found'.format(advisory_id) - ) + raise CommandExecutionError(f'Advisory id "{advisory_id}" not found') else: # If we add here the `patch:` prefix, the # `_find_types` helper will take the patches into the @@ -1702,7 +1696,7 @@ def install( # if the name of the package is already prefixed with 'patch:' we # can avoid listing them in the `advisory_ids` field. if pkg_type == "advisory": - targets = ["patch:{}".format(t) for t in targets] + targets = [f"patch:{t}" for t in targets] # Split the targets into batches of 500 packages each, so that # the maximal length of the command line is not broken @@ -1766,7 +1760,7 @@ def upgrade( no_recommends=False, root=None, diff_attr=None, - **kwargs + **kwargs, ): # pylint: disable=unused-argument """ .. versionchanged:: 2015.8.12,2016.3.3,2016.11.0 @@ -2185,7 +2179,7 @@ def list_holds(pattern=None, full=True, root=None, **kwargs): ) ) - ptrn_re = re.compile(r"{}-\S+".format(pattern)) if pattern else None + ptrn_re = re.compile(rf"{pattern}-\S+") if pattern else None for pkg_name, pkg_editions in inst_pkgs.items(): for pkg_info in pkg_editions: pkg_ret = ( @@ -2327,14 +2321,12 @@ def unhold(name=None, pkgs=None, root=None, **kwargs): ) ) else: - removed.append( - target if not lock_ver else "{}={}".format(target, lock_ver) - ) + removed.append(target if not lock_ver else f"{target}={lock_ver}") ret[target]["changes"]["new"] = "" ret[target]["changes"]["old"] = "hold" - ret[target]["comment"] = "Package {} is no longer held.".format(target) + ret[target]["comment"] = f"Package {target} is no longer held." else: - ret[target]["comment"] = "Package {} was already unheld.".format(target) + ret[target]["comment"] = f"Package {target} was already unheld." if removed: __zypper__(root=root).call("rl", *removed) @@ -2386,10 +2378,10 @@ def hold(name=None, pkgs=None, root=None, **kwargs): (target, version) = next(iter(target.items())) ret[target] = {"name": target, "changes": {}, "result": True, "comment": ""} if not locks.get(target): - added.append(target if not version else "{}={}".format(target, version)) + added.append(target if not version else f"{target}={version}") ret[target]["changes"]["new"] = "hold" ret[target]["changes"]["old"] = "" - ret[target]["comment"] = "Package {} is now being held.".format(target) + ret[target]["comment"] = f"Package {target} is now being held." else: ret[target]["comment"] = "Package {} is already set to be held.".format( target @@ -2739,7 +2731,7 @@ def search(criteria, refresh=False, **kwargs): .getElementsByTagName("solvable") ) if not solvables: - raise CommandExecutionError("No packages found matching '{}'".format(criteria)) + raise CommandExecutionError(f"No packages found matching '{criteria}'") out = {} for solvable in solvables: diff --git a/salt/netapi/__init__.py b/salt/netapi/__init__.py index c0275c127fe..583a6f158d5 100644 --- a/salt/netapi/__init__.py +++ b/salt/netapi/__init__.py @@ -53,7 +53,7 @@ def sum_permissions(token, eauth): eauth_groups = {i.rstrip("%") for i in eauth.keys() if i.endswith("%")} for group in user_groups & eauth_groups: - perms.extend(eauth["{}%".format(group)]) + perms.extend(eauth[f"{group}%"]) return perms diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index 52334728242..4083e8d231b 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -899,7 +899,7 @@ def hypermedia_handler(*args, **kwargs): ret = { "status": cherrypy.response.status, "return": ( - "{}".format(traceback.format_exc()) + f"{traceback.format_exc()}" if cherrypy.config["debug"] else "An unexpected error occurred" ), @@ -1946,7 +1946,7 @@ class Logout(LowDataAdapter): _cp_config = dict( LowDataAdapter._cp_config, - **{"tools.salt_auth.on": True, "tools.lowdata_fmt.on": False} + **{"tools.salt_auth.on": True, "tools.lowdata_fmt.on": False}, ) def POST(self): # pylint: disable=arguments-differ @@ -2189,7 +2189,7 @@ class Events: "tools.salt_auth.on": False, "tools.hypermedia_in.on": False, "tools.hypermedia_out.on": False, - } + }, ) def __init__(self): @@ -2394,7 +2394,7 @@ class Events: data = next(stream) yield "tag: {}\n".format(data.get("tag", "")) - yield "data: {}\n\n".format(salt.utils.json.dumps(data)) + yield f"data: {salt.utils.json.dumps(data)}\n\n" return listen() @@ -2424,7 +2424,7 @@ class WebsocketEndpoint: "tools.hypermedia_out.on": False, "tools.websocket.on": True, "tools.websocket.handler_cls": websockets.SynchronizingWebsocket, - } + }, ) def __init__(self): @@ -2578,7 +2578,7 @@ class WebsocketEndpoint: SaltInfo.process(data, salt_token, self.opts) else: handler.send( - "data: {}\n\n".format(salt.utils.json.dumps(data)), + f"data: {salt.utils.json.dumps(data)}\n\n", False, ) except UnicodeDecodeError: @@ -2650,7 +2650,7 @@ class Webhook: "tools.lowdata_fmt.on": True, # Auth can be overridden in __init__(). "tools.salt_auth.on": True, - } + }, ) def __init__(self): diff --git a/salt/netapi/rest_tornado/__init__.py b/salt/netapi/rest_tornado/__init__.py index 9ab2569c822..0d8fa5fa683 100644 --- a/salt/netapi/rest_tornado/__init__.py +++ b/salt/netapi/rest_tornado/__init__.py @@ -64,8 +64,8 @@ def get_application(opts): getattr(hashlib, opts.get("hash_type", DEFAULT_HASH_TYPE))().hexdigest() ) ) - all_events_pattern = r"/all_events/{}".format(token_pattern) - formatted_events_pattern = r"/formatted_events/{}".format(token_pattern) + all_events_pattern = rf"/all_events/{token_pattern}" + formatted_events_pattern = rf"/formatted_events/{token_pattern}" log.debug("All events URL pattern is %s", all_events_pattern) paths += [ # Matches /all_events/[0-9A-Fa-f]{n} diff --git a/salt/netapi/rest_tornado/saltnado.py b/salt/netapi/rest_tornado/saltnado.py index a0697bbc3fc..83d5226a039 100644 --- a/salt/netapi/rest_tornado/saltnado.py +++ b/salt/netapi/rest_tornado/saltnado.py @@ -944,7 +944,7 @@ class SaltAPIHandler(BaseSaltAPIHandler): # pylint: disable=W0223 ret.append("Failed to authenticate") break except Exception as ex: # pylint: disable=broad-except - ret.append("Unexpected exception while handling request: {}".format(ex)) + ret.append(f"Unexpected exception while handling request: {ex}") log.error("Unexpected exception while handling request:", exc_info=True) try: @@ -1611,7 +1611,7 @@ class EventsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223 self.set_header("Cache-Control", "no-cache") self.set_header("Connection", "keep-alive") - self.write("retry: {}\n".format(400)) + self.write(f"retry: {400}\n") self.flush() while True: @@ -1622,7 +1622,7 @@ class EventsSaltAPIHandler(SaltAPIHandler): # pylint: disable=W0223 event = yield self.application.event_listener.get_event(self) self.write("tag: {}\n".format(event.get("tag", ""))) - self.write("data: {}\n\n".format(_json_dumps(event))) + self.write(f"data: {_json_dumps(event)}\n\n") self.flush() except TimeoutException: break diff --git a/salt/netapi/rest_wsgi.py b/salt/netapi/rest_wsgi.py index 4afd3d55ec3..50dfabe23c1 100644 --- a/salt/netapi/rest_wsgi.py +++ b/salt/netapi/rest_wsgi.py @@ -161,7 +161,7 @@ class HTTPError(Exception): def __init__(self, code, message): self.code = code - Exception.__init__(self, "{}: {}".format(code, message)) + Exception.__init__(self, f"{code}: {message}") def mkdir_p(path): diff --git a/salt/output/__init__.py b/salt/output/__init__.py index a8c318579df..c90932fa8ea 100644 --- a/salt/output/__init__.py +++ b/salt/output/__init__.py @@ -53,7 +53,7 @@ def get_progress(opts, out, progress): Get the progress bar from the given outputter """ return salt.loader.raw_mod(opts, out, "rawmodule", mod="output")[ - "{}.progress_iter".format(out) + f"{out}.progress_iter" ](progress) diff --git a/salt/output/highstate.py b/salt/output/highstate.py index 76ebac0d6d0..dc00885753f 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -571,10 +571,10 @@ def _format_host(host, data, indent_level=1): if "data" in ret: if isinstance(ret["data"], list): for item in ret["data"]: - comment = "{} {}".format(comment, item) + comment = f"{comment} {item}" elif isinstance(ret["data"], dict): for key, value in ret["data"].items(): - comment = "{}\n\t\t{}: {}".format(comment, key, value) + comment = f"{comment}\n\t\t{key}: {value}" else: comment = "{} {}".format(comment, ret["data"]) for detail in ["start_time", "duration"]: @@ -634,13 +634,13 @@ def _format_host(host, data, indent_level=1): changestats.append( colorfmt.format( colors["LIGHT_YELLOW"], - "unchanged={}".format(rcounts.get(None, 0)), + f"unchanged={rcounts.get(None, 0)}", colors, ) ) if nchanges > 0: changestats.append( - colorfmt.format(colors["GREEN"], "changed={}".format(nchanges), colors) + colorfmt.format(colors["GREEN"], f"changed={nchanges}", colors) ) if changestats: changestats = " ({})".format(", ".join(changestats)) @@ -732,7 +732,7 @@ def _format_host(host, data, indent_level=1): sum_duration /= 1000 duration_unit = "s" total_duration = "Total run time: {} {}".format( - "{:.3f}".format(sum_duration).rjust(line_max_len - 5), duration_unit + f"{sum_duration:.3f}".rjust(line_max_len - 5), duration_unit ) hstrs.append(colorfmt.format(colors["CYAN"], total_duration, colors)) @@ -762,7 +762,7 @@ def _format_changes(changes, orchestration=False): return True, _nested_changes(changes) if not isinstance(changes, dict): - return True, "Invalid Changes data: {}".format(changes) + return True, f"Invalid Changes data: {changes}" ret = changes.get("ret") if ret is not None and changes.get("out") == "highstate": diff --git a/salt/output/key.py b/salt/output/key.py index 13ee6f0f5fe..f89f95c7f96 100644 --- a/salt/output/key.py +++ b/salt/output/key.py @@ -84,7 +84,7 @@ def output(data, **kwargs): # pylint: disable=unused-argument ret = "" for status in sorted(data): - ret += "{}\n".format(trans[status]) + ret += f"{trans[status]}\n" for key in sorted(data[status]): key = salt.utils.data.decode(key) skey = salt.output.strip_esc_sequence(key) if strip_colors else key diff --git a/salt/output/profile.py b/salt/output/profile.py index d182da565ff..8f54c7017f4 100644 --- a/salt/output/profile.py +++ b/salt/output/profile.py @@ -56,11 +56,11 @@ def _find_durations(data, name_max=60): if len(name) > name_max: name = name[0 : name_max - 3] + "..." - l = len("{:0.4f}".format(dur)) + l = len(f"{dur:0.4f}") if l > ml: ml = l - ret.append([dur, name, "{}.{}".format(mod, fun)]) + ret.append([dur, name, f"{mod}.{fun}"]) for row in ret: row[0] = "{0:{w}.4f}".format(row[0], w=ml) diff --git a/salt/output/table_out.py b/salt/output/table_out.py index 8bc94eb3e46..6b17c901b64 100644 --- a/salt/output/table_out.py +++ b/salt/output/table_out.py @@ -346,7 +346,7 @@ def output(ret, **kwargs): ) for argk in argks: - argv = kwargs.get(argk) or __opts__.get("out.table.{key}".format(key=argk)) + argv = kwargs.get(argk) or __opts__.get(f"out.table.{argk}") if argv is not None: class_kvargs[argk] = argv diff --git a/salt/output/txt.py b/salt/output/txt.py index 71d694a2333..f5e652cdd14 100644 --- a/salt/output/txt.py +++ b/salt/output/txt.py @@ -26,14 +26,14 @@ def output(data, **kwargs): # pylint: disable=unused-argument # Don't blow up on non-strings try: for line in value.splitlines(): - ret += "{}: {}\n".format(key, line) + ret += f"{key}: {line}\n" except AttributeError: - ret += "{}: {}\n".format(key, value) + ret += f"{key}: {value}\n" else: try: ret += data + "\n" except TypeError: # For non-dictionary, non-string data, just use print - ret += "{}\n".format(pprint.pformat(data)) + ret += f"{pprint.pformat(data)}\n" return ret diff --git a/salt/output/virt_query.py b/salt/output/virt_query.py index d20e6357e60..935b9d213d7 100644 --- a/salt/output/virt_query.py +++ b/salt/output/virt_query.py @@ -13,9 +13,9 @@ def output(data, **kwargs): # pylint: disable=unused-argument """ out = "" for id_ in data["data"]: - out += "{}\n".format(id_) + out += f"{id_}\n" for vm_ in data["data"][id_]["vm_info"]: - out += " {}\n".format(vm_) + out += f" {vm_}\n" vm_data = data[id_]["vm_info"][vm_] if "cpu" in vm_data: out += " CPU: {}\n".format(vm_data["cpu"]) @@ -30,13 +30,13 @@ def output(data, **kwargs): # pylint: disable=unused-argument ) if "disks" in vm_data: for disk, d_data in vm_data["disks"].items(): - out += " Disk - {}:\n".format(disk) + out += f" Disk - {disk}:\n" out += " Size: {}\n".format(d_data["disk size"]) out += " File: {}\n".format(d_data["file"]) out += " File Format: {}\n".format(d_data["file format"]) if "nics" in vm_data: for mac in vm_data["nics"]: - out += " Nic - {}:\n".format(mac) + out += f" Nic - {mac}:\n" out += " Source: {}\n".format( vm_data["nics"][mac]["source"][ next(iter(vm_data["nics"][mac]["source"].keys())) diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py index 0a874daab11..21df2b9afb7 100644 --- a/salt/pillar/__init__.py +++ b/salt/pillar/__init__.py @@ -751,9 +751,7 @@ class Pillar: ) ) except Exception as exc: # pylint: disable=broad-except - errors.append( - "Rendering Primary Top file failed, render error:\n{}".format(exc) - ) + errors.append(f"Rendering Primary Top file failed, render error:\n{exc}") log.exception("Pillar rendering failed for minion %s", self.minion_id) # Search initial top files for includes @@ -958,7 +956,7 @@ class Pillar: **defaults, ) except Exception as exc: # pylint: disable=broad-except - msg = "Rendering SLS '{}' failed, render error:\n{}".format(sls, exc) + msg = f"Rendering SLS '{sls}' failed, render error:\n{exc}" log.critical(msg, exc_info=True) if self.opts.get("pillar_safe_render_error", True): errors.append( @@ -971,7 +969,7 @@ class Pillar: nstate = None if state: if not isinstance(state, dict): - msg = "SLS '{}' does not render to a dictionary".format(sls) + msg = f"SLS '{sls}' does not render to a dictionary" log.error(msg) errors.append(msg) else: @@ -1108,7 +1106,7 @@ class Pillar: "a sign of a malformed pillar sls file. Returned " "errors: %s", sls, - ", ".join(["'{}'".format(e) for e in errors]), + ", ".join([f"'{e}'" for e in errors]), ) continue pillar = merge( @@ -1358,7 +1356,7 @@ class Pillar: if ptr is not None: ptr[child] = ret except Exception as exc: # pylint: disable=broad-except - msg = "Failed to decrypt pillar key '{}': {}".format(key, exc) + msg = f"Failed to decrypt pillar key '{key}': {exc}" errors.append(msg) log.error(msg, exc_info=True) return errors diff --git a/salt/pillar/azureblob.py b/salt/pillar/azureblob.py index 4c26ba14b29..3b8c064201c 100644 --- a/salt/pillar/azureblob.py +++ b/salt/pillar/azureblob.py @@ -258,7 +258,7 @@ def _get_containers_cache_filename(container): if not os.path.exists(cache_dir): os.makedirs(cache_dir) - return os.path.join(cache_dir, "{}-files.cache".format(container)) + return os.path.join(cache_dir, f"{container}-files.cache") def _refresh_containers_cache_file( diff --git a/salt/pillar/django_orm.py b/salt/pillar/django_orm.py index 29a5eaaa413..641e6098514 100644 --- a/salt/pillar/django_orm.py +++ b/salt/pillar/django_orm.py @@ -125,7 +125,7 @@ def ext_pillar( env=None, env_file=None, *args, # pylint: disable=W0613 - **kwargs + **kwargs, ): # pylint: disable=W0613 """ Connect to a Django database through the ORM and retrieve model fields @@ -179,7 +179,7 @@ def ext_pillar( (key, _, value) = salt.utils.stringutils.to_str(line).partition("=") base_env[key] = value - command = ["bash", "-c", "source {} && env".format(env_file)] + command = ["bash", "-c", f"source {env_file} && env"] proc = subprocess.Popen(command, stdout=subprocess.PIPE) for line in proc.stdout: @@ -229,7 +229,7 @@ def ext_pillar( # (since we're using it as the key in a dictionary) if name_field not in model: raise salt.exceptions.SaltException( - "Name '{}' not found in returned fields.".format(name_field) + f"Name '{name_field}' not found in returned fields." ) if model[name_field] in pillar_for_model: diff --git a/salt/pillar/ec2_pillar.py b/salt/pillar/ec2_pillar.py index c4fe8e17519..7aa6cb008dd 100644 --- a/salt/pillar/ec2_pillar.py +++ b/salt/pillar/ec2_pillar.py @@ -184,9 +184,9 @@ def ext_pillar( find_id = minion_id elif tag_match_key: if tag_match_value == "uqdn": - find_filter = {"tag:{}".format(tag_match_key): minion_id.split(".", 1)[0]} + find_filter = {f"tag:{tag_match_key}": minion_id.split(".", 1)[0]} else: - find_filter = {"tag:{}".format(tag_match_key): minion_id} + find_filter = {f"tag:{tag_match_key}": minion_id} if grain_instance_id: # we have an untrusted grain_instance_id, use it to narrow the search # even more. Combination will be unique even if uqdn is set. diff --git a/salt/pillar/hiera.py b/salt/pillar/hiera.py index 55b8305db72..c799d4f195f 100644 --- a/salt/pillar/hiera.py +++ b/salt/pillar/hiera.py @@ -24,10 +24,10 @@ def ext_pillar( """ Execute hiera and return the data """ - cmd = "hiera -c {}".format(conf) + cmd = f"hiera -c {conf}" for key, val in __grains__.items(): if isinstance(val, str): - cmd += " {}='{}'".format(key, val) + cmd += f" {key}='{val}'" try: data = salt.utils.yaml.safe_load(__salt__["cmd.run"](cmd)) except Exception: # pylint: disable=broad-except diff --git a/salt/pillar/http_json.py b/salt/pillar/http_json.py index acebb3aaf89..b07a2573772 100644 --- a/salt/pillar/http_json.py +++ b/salt/pillar/http_json.py @@ -101,7 +101,7 @@ def ext_pillar( return {} grain_value = urllib.parse.quote(str(grain_value)) - url = re.sub("<{}>".format(grain_name), grain_value, url) + url = re.sub(f"<{grain_name}>", grain_value, url) log.debug("Getting url: %s", url) data = __salt__["http.query"]( diff --git a/salt/pillar/http_yaml.py b/salt/pillar/http_yaml.py index ff791c6cd8c..58df6248ae0 100644 --- a/salt/pillar/http_yaml.py +++ b/salt/pillar/http_yaml.py @@ -95,7 +95,7 @@ def ext_pillar( return {} grain_value = urllib.parse.quote(str(grain_value)) - url = re.sub("<{}>".format(grain_name), grain_value, url) + url = re.sub(f"<{grain_name}>", grain_value, url) log.debug("Getting url: %s", url) data = __salt__["http.query"]( diff --git a/salt/pillar/libvirt.py b/salt/pillar/libvirt.py index ae957639b7d..cbcba870e4c 100644 --- a/salt/pillar/libvirt.py +++ b/salt/pillar/libvirt.py @@ -42,9 +42,7 @@ def ext_pillar(minion_id, pillar, command): continue fn_ = os.path.join(key_dir, key) with salt.utils.files.fopen(fn_, "r") as fp_: - ret["libvirt.{}".format(key)] = salt.utils.stringutils.to_unicode( - fp_.read() - ) + ret[f"libvirt.{key}"] = salt.utils.stringutils.to_unicode(fp_.read()) with salt.utils.files.fopen(cacert, "r") as fp_: ret["libvirt.cacert.pem"] = salt.utils.stringutils.to_unicode(fp_.read()) return ret @@ -75,7 +73,7 @@ def gen_hyper_keys( proc = subprocess.run( ["certtool", "--generate-privkey"], stdout=subprocess.PIPE, - universal_newlines=True, + text=True, check=True, ) with salt.utils.files.fopen(cakey, "w") as wfh: @@ -116,7 +114,7 @@ def gen_hyper_keys( proc = subprocess.run( ["certtool", "--generate-privkey"], stdout=subprocess.PIPE, - universal_newlines=True, + text=True, check=True, ) with salt.utils.files.fopen(priv, "w") as wfh: @@ -153,7 +151,7 @@ def gen_hyper_keys( proc = subprocess.run( ["certtool", "--generate-privkey"], stdout=subprocess.PIPE, - universal_newlines=True, + text=True, check=True, ) with salt.utils.files.fopen(cpriv, "w") as wfh: diff --git a/salt/pillar/makostack.py b/salt/pillar/makostack.py index ef3b3d64cb5..f96092f8945 100644 --- a/salt/pillar/makostack.py +++ b/salt/pillar/makostack.py @@ -498,9 +498,7 @@ def _cleanup(obj): def _merge_dict(stack, obj): strategy = obj.pop("__", "merge-last") if strategy not in strategies: - raise Exception( - 'Unknown strategy "{}", should be one of {}'.format(strategy, strategies) - ) + raise Exception(f'Unknown strategy "{strategy}", should be one of {strategies}') if strategy == "overwrite": return _cleanup(obj) else: @@ -537,9 +535,7 @@ def _merge_list(stack, obj): strategy = obj[0]["__"] del obj[0] if strategy not in strategies: - raise Exception( - 'Unknown strategy "{}", should be one of {}'.format(strategy, strategies) - ) + raise Exception(f'Unknown strategy "{strategy}", should be one of {strategies}') if strategy == "overwrite": return obj elif strategy == "remove": diff --git a/salt/pillar/netbox.py b/salt/pillar/netbox.py index bbbf765e62a..1cee59c204d 100644 --- a/salt/pillar/netbox.py +++ b/salt/pillar/netbox.py @@ -1109,7 +1109,7 @@ def ext_pillar(minion_id, pillar, *args, **kwargs): # Fetch device from API headers = {} if api_token: - headers = {"Authorization": "Token {}".format(api_token)} + headers = {"Authorization": f"Token {api_token}"} else: log.error("The value for api_token is not set") return ret diff --git a/salt/pillar/puppet.py b/salt/pillar/puppet.py index b907ad1f321..792c3ec7738 100644 --- a/salt/pillar/puppet.py +++ b/salt/pillar/puppet.py @@ -19,9 +19,7 @@ def ext_pillar(minion_id, pillar, command): # pylint: disable=W0613 Execute an unmodified puppet_node_classifier and read the output as YAML """ try: - data = salt.utils.yaml.safe_load( - __salt__["cmd.run"]("{} {}".format(command, minion_id)) - ) + data = salt.utils.yaml.safe_load(__salt__["cmd.run"](f"{command} {minion_id}")) return data["parameters"] except Exception: # pylint: disable=broad-except log.critical("YAML data from %s failed to parse", command) diff --git a/salt/pillar/reclass_adapter.py b/salt/pillar/reclass_adapter.py index f47b4c52de2..ded9d664934 100644 --- a/salt/pillar/reclass_adapter.py +++ b/salt/pillar/reclass_adapter.py @@ -126,4 +126,4 @@ def ext_pillar(minion_id, pillar, **kwargs): raise except ReclassException as e: - raise SaltInvocationError("ext_pillar.reclass: {}".format(e)) + raise SaltInvocationError(f"ext_pillar.reclass: {e}") diff --git a/salt/pillar/s3.py b/salt/pillar/s3.py index 7f08439f8e4..deb1c9b2a26 100644 --- a/salt/pillar/s3.py +++ b/salt/pillar/s3.py @@ -276,7 +276,7 @@ def _get_buckets_cache_filename(bucket, prefix): if not os.path.exists(cache_dir): os.makedirs(cache_dir) - return os.path.join(cache_dir, "{}-{}-files.cache".format(bucket, prefix)) + return os.path.join(cache_dir, f"{bucket}-{prefix}-files.cache") def _refresh_buckets_cache_file(creds, cache_file, multiple_env, environment, prefix): diff --git a/salt/pillar/stack.py b/salt/pillar/stack.py index 0d72444418d..f8936ad4b4a 100644 --- a/salt/pillar/stack.py +++ b/salt/pillar/stack.py @@ -476,9 +476,7 @@ def _process_stack_cfg(cfg, stack, minion_id, pillar): try: yaml = jenv.get_template(unix_path).render(stack=stack, ymlpath=path) except Exception as e: - raise Exception( - 'Stack pillar template render error in {}:\n"{}"'.format(path, e) - ) + raise Exception(f'Stack pillar template render error in {path}:\n"{e}"') try: obj = salt.utils.yaml.safe_load(yaml) except Exception as e: @@ -506,9 +504,7 @@ def _cleanup(obj): def _merge_dict(stack, obj): strategy = obj.pop("__", "merge-last") if strategy not in strategies: - raise Exception( - 'Unknown strategy "{}", should be one of {}'.format(strategy, strategies) - ) + raise Exception(f'Unknown strategy "{strategy}", should be one of {strategies}') if strategy == "overwrite": return _cleanup(obj) else: @@ -545,9 +541,7 @@ def _merge_list(stack, obj): strategy = obj[0]["__"] del obj[0] if strategy not in strategies: - raise Exception( - 'Unknown strategy "{}", should be one of {}'.format(strategy, strategies) - ) + raise Exception(f'Unknown strategy "{strategy}", should be one of {strategies}') if strategy == "overwrite": return obj elif strategy == "remove": diff --git a/salt/pillar/vault.py b/salt/pillar/vault.py index 904c626b0e6..b51b5b828d2 100644 --- a/salt/pillar/vault.py +++ b/salt/pillar/vault.py @@ -203,7 +203,7 @@ def ext_pillar( if version2["v2"]: path = version2["data"] - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("GET", url) response.raise_for_status() vault_pillar_single = response.json().get("data", {}) diff --git a/salt/platform/win.py b/salt/platform/win.py index fff1010039b..ec63dbe319f 100644 --- a/salt/platform/win.py +++ b/salt/platform/win.py @@ -157,7 +157,7 @@ class NTSTATUS(wintypes.LONG): def __repr__(self): name = self.__class__.__name__ status = wintypes.ULONG.from_buffer(self) - return "{}({})".format(name, status.value) + return f"{name}({status.value})" PNTSTATUS = ctypes.POINTER(NTSTATUS) @@ -166,7 +166,7 @@ PNTSTATUS = ctypes.POINTER(NTSTATUS) class BOOL(wintypes.BOOL): def __repr__(self): name = self.__class__.__name__ - return "{}({})".format(name, bool(self)) + return f"{name}({bool(self)})" class HANDLE(wintypes.HANDLE): @@ -190,7 +190,7 @@ class HANDLE(wintypes.HANDLE): __del__ = Close def __repr__(self): - return "{}({})".format(self.__class__.__name__, int(self)) + return f"{self.__class__.__name__}({int(self)})" class LARGE_INTEGER(wintypes.LARGE_INTEGER): @@ -205,7 +205,7 @@ class LARGE_INTEGER(wintypes.LARGE_INTEGER): def __repr__(self): name = self.__class__.__name__ - return "{}({})".format(name, self.value) + return f"{name}({self.value})" def as_time(self): time100ns = self.value - self._unix_epoch @@ -261,7 +261,7 @@ class LUID(ctypes.Structure): def __repr__(self): name = self.__class__.__name__ - return "{}({})".format(name, int(self)) + return f"{name}({int(self)})" LPLUID = ctypes.POINTER(LUID) @@ -312,7 +312,7 @@ class TOKEN_SOURCE(ctypes.Structure): LPTOKEN_SOURCE = ctypes.POINTER(TOKEN_SOURCE) py_source_context = TOKEN_SOURCE(b"PYTHON ") py_origin_name = __name__.encode() -py_logon_process_name = "{}-{}".format(py_origin_name, os.getpid()) +py_logon_process_name = f"{py_origin_name}-{os.getpid()}" SIZE_T = ctypes.c_size_t @@ -343,7 +343,7 @@ class ContiguousUnicode(ctypes.Structure): def _get_unicode_string(self, name): wchar_size = ctypes.sizeof(WCHAR) - s = getattr(self, "_{}".format(name)) + s = getattr(self, f"_{name}") length = s.Length // wchar_size buf = s.Buffer if buf: @@ -375,7 +375,7 @@ class ContiguousUnicode(ctypes.Structure): addr = ctypes.addressof(self) + ctypes.sizeof(cls) for n, v in zip(self._string_names_, values): ptr = ctypes.cast(addr, PWCHAR) - ustr = getattr(self, "_{}".format(n)) + ustr = getattr(self, f"_{n}") length = ustr.Length = len(v) * wchar_size full_length = length + wchar_size if (n == name and value is None) or ( @@ -407,7 +407,7 @@ class ContiguousUnicode(ctypes.Structure): ctypes.memmove(ctypes.byref(x), address, ctypes.sizeof(x)) delta = ctypes.addressof(x) - address for n in cls._string_names_: - ustr = getattr(x, "_{}".format(n)) + ustr = getattr(x, f"_{n}") addr = ctypes.c_void_p.from_buffer(ustr.Buffer) if addr: addr.value += delta diff --git a/salt/proxy/chronos.py b/salt/proxy/chronos.py index 69b06d63e44..a138f39e78b 100644 --- a/salt/proxy/chronos.py +++ b/salt/proxy/chronos.py @@ -55,7 +55,7 @@ def ping(): """ try: response = salt.utils.http.query( - "{}/scheduler/jobs".format(CONFIG[CONFIG_BASE_URL]), + f"{CONFIG[CONFIG_BASE_URL]}/scheduler/jobs", decode_type="json", decode=True, ) diff --git a/salt/proxy/docker.py b/salt/proxy/docker.py index 7dca6d3f384..202a3e00f60 100644 --- a/salt/proxy/docker.py +++ b/salt/proxy/docker.py @@ -38,7 +38,7 @@ __virtualname__ = "docker" def __virtual__(): if __opts__.get("proxy", {}).get("proxytype") != __virtualname__: - return False, "Proxytype does not match: {}".format(__virtualname__) + return False, f"Proxytype does not match: {__virtualname__}" return True diff --git a/salt/proxy/dummy.py b/salt/proxy/dummy.py index 8656be31d93..12d71104a0a 100644 --- a/salt/proxy/dummy.py +++ b/salt/proxy/dummy.py @@ -30,7 +30,7 @@ def __virtual__(): def _save_state(opts, details): _id = __context__["dummy_proxy"]["id"] - cachefile = os.path.join(opts["cachedir"], "dummy-proxy-{}.cache".format(_id)) + cachefile = os.path.join(opts["cachedir"], f"dummy-proxy-{_id}.cache") with salt.utils.files.fopen(cachefile, "wb") as pck: pck.write(salt.utils.msgpack.packb(details, use_bin_type=True)) log.warning("Dummy Proxy Saved State(%s):\n%s", cachefile, pprint.pformat(details)) @@ -38,7 +38,7 @@ def _save_state(opts, details): def _load_state(opts): _id = __context__["dummy_proxy"]["id"] - cachefile = os.path.join(opts["cachedir"], "dummy-proxy-{}.cache".format(_id)) + cachefile = os.path.join(opts["cachedir"], f"dummy-proxy-{_id}.cache") try: with salt.utils.files.fopen(cachefile, "rb") as pck: state = salt.utils.msgpack.unpackb(pck.read(), raw=False) diff --git a/salt/proxy/marathon.py b/salt/proxy/marathon.py index 5347276bbdb..3be5b366333 100644 --- a/salt/proxy/marathon.py +++ b/salt/proxy/marathon.py @@ -55,7 +55,7 @@ def ping(): """ try: response = salt.utils.http.query( - "{}/ping".format(CONFIG[CONFIG_BASE_URL]), + f"{CONFIG[CONFIG_BASE_URL]}/ping", decode_type="plain", decode=True, ) diff --git a/salt/proxy/napalm.py b/salt/proxy/napalm.py index 4b9729635cb..13f2663cf0a 100644 --- a/salt/proxy/napalm.py +++ b/salt/proxy/napalm.py @@ -299,7 +299,7 @@ def shutdown(opts): __context__["napalm_device"]["network_device"].get( "HOSTNAME", "[unknown hostname]" ), - ":{}".format(port) if port else "", + f":{port}" if port else "", error, ) diff --git a/salt/queues/pgjsonb_queue.py b/salt/queues/pgjsonb_queue.py index aa42daa650d..f198c580b2b 100644 --- a/salt/queues/pgjsonb_queue.py +++ b/salt/queues/pgjsonb_queue.py @@ -80,15 +80,11 @@ def _conn(commit=False): conn_kwargs = {} for key, value in defaults.items(): - conn_kwargs[key] = __opts__.get( - "queue.{}.{}".format(__virtualname__, key), value - ) + conn_kwargs[key] = __opts__.get(f"queue.{__virtualname__}.{key}", value) try: conn = psycopg2.connect(**conn_kwargs) except psycopg2.OperationalError as exc: - raise SaltMasterError( - "pgjsonb returner could not connect to database: {exc}".format(exc=exc) - ) + raise SaltMasterError(f"pgjsonb returner could not connect to database: {exc}") cursor = conn.cursor() @@ -117,7 +113,7 @@ def _list_tables(cur): def _create_table(cur, queue): - cmd = "CREATE TABLE {}(id SERIAL PRIMARY KEY, data jsonb NOT NULL)".format(queue) + cmd = f"CREATE TABLE {queue}(id SERIAL PRIMARY KEY, data jsonb NOT NULL)" log.debug("SQL Query: %s", cmd) cur.execute(cmd) return True @@ -128,7 +124,7 @@ def _list_items(queue): Private function to list contents of a queue """ with _conn() as cur: - cmd = "SELECT data FROM {}".format(queue) + cmd = f"SELECT data FROM {queue}" log.debug("SQL Query: %s", cmd) cur.execute(cmd) contents = cur.fetchall() @@ -191,7 +187,7 @@ def insert(queue, items): with _conn(commit=True) as cur: if isinstance(items, dict): items = salt.utils.json.dumps(items) - cmd = "INSERT INTO {}(data) VALUES('{}')".format(queue, items) + cmd = f"INSERT INTO {queue}(data) VALUES('{items}')" log.debug("SQL Query: %s", cmd) try: cur.execute(cmd) @@ -201,7 +197,7 @@ def insert(queue, items): ) if isinstance(items, list): items = [(salt.utils.json.dumps(el),) for el in items] - cmd = "INSERT INTO {}(data) VALUES (%s)".format(queue) + cmd = f"INSERT INTO {queue}(data) VALUES (%s)" log.debug("SQL Query: %s", cmd) try: cur.executemany(cmd, items) @@ -227,7 +223,7 @@ def delete(queue, items): return True if isinstance(items, list): items = [(salt.utils.json.dumps(el),) for el in items] - cmd = "DELETE FROM {} WHERE data = %s".format(queue) + cmd = f"DELETE FROM {queue} WHERE data = %s" log.debug("SQL Query: %s", cmd) cur.executemany(cmd, items) return True @@ -237,7 +233,7 @@ def pop(queue, quantity=1, is_runner=False): """ Pop one or more or all items from the queue return them. """ - cmd = "SELECT id, data FROM {}".format(queue) + cmd = f"SELECT id, data FROM {queue}" if quantity != "all": try: quantity = int(quantity) @@ -246,7 +242,7 @@ def pop(queue, quantity=1, is_runner=False): exc ) raise SaltInvocationError(error_txt) - cmd = "".join([cmd, " LIMIT {};".format(quantity)]) + cmd = "".join([cmd, f" LIMIT {quantity};"]) log.debug("SQL Query: %s", cmd) items = [] with _conn(commit=True) as cur: @@ -256,7 +252,7 @@ def pop(queue, quantity=1, is_runner=False): ids = [str(item[0]) for item in result] items = [item[1] for item in result] idlist = "','".join(ids) - del_cmd = "DELETE FROM {} WHERE id IN ('{}');".format(queue, idlist) + del_cmd = f"DELETE FROM {queue} WHERE id IN ('{idlist}');" log.debug("SQL Query: %s", del_cmd) diff --git a/salt/queues/sqlite_queue.py b/salt/queues/sqlite_queue.py index 713bfa09ccd..b81d13ce5ed 100644 --- a/salt/queues/sqlite_queue.py +++ b/salt/queues/sqlite_queue.py @@ -38,7 +38,7 @@ def _conn(queue): Return an sqlite connection """ queue_dir = __opts__["sqlite_queue_dir"] - db = os.path.join(queue_dir, "{}.db".format(queue)) + db = os.path.join(queue_dir, f"{queue}.db") log.debug("Connecting to: %s", db) con = sqlite3.connect(db) @@ -61,7 +61,7 @@ def _list_tables(con): def _create_table(con, queue): with con: cur = con.cursor() - cmd = "CREATE TABLE {}(id INTEGER PRIMARY KEY, name TEXT UNIQUE)".format(queue) + cmd = f"CREATE TABLE {queue}(id INTEGER PRIMARY KEY, name TEXT UNIQUE)" log.debug("SQL Query: %s", cmd) cur.execute(cmd) return True @@ -74,7 +74,7 @@ def _list_items(queue): con = _conn(queue) with con: cur = con.cursor() - cmd = "SELECT name FROM {}".format(queue) + cmd = f"SELECT name FROM {queue}" log.debug("SQL Query: %s", cmd) cur.execute(cmd) contents = cur.fetchall() @@ -138,15 +138,15 @@ def insert(queue, items): cur = con.cursor() if isinstance(items, str): items = _quote_escape(items) - cmd = "INSERT INTO {}(name) VALUES('{}')".format(queue, items) + cmd = f"INSERT INTO {queue}(name) VALUES('{items}')" log.debug("SQL Query: %s", cmd) try: cur.execute(cmd) except sqlite3.IntegrityError as esc: - return "Item already exists in this queue. sqlite error: {}".format(esc) + return f"Item already exists in this queue. sqlite error: {esc}" if isinstance(items, list): items = [_quote_escape(el) for el in items] - cmd = "INSERT INTO {}(name) VALUES(?)".format(queue) + cmd = f"INSERT INTO {queue}(name) VALUES(?)" log.debug("SQL Query: %s", cmd) newitems = [] for item in items: @@ -162,12 +162,12 @@ def insert(queue, items): if isinstance(items, dict): items = salt.utils.json.dumps(items).replace('"', "'") items = _quote_escape(items) - cmd = "INSERT INTO {}(name) VALUES('{}')".format(queue, items) + cmd = f"INSERT INTO {queue}(name) VALUES('{items}')" log.debug("SQL Query: %s", cmd) try: cur.execute(cmd) except sqlite3.IntegrityError as esc: - return "Item already exists in this queue. sqlite error: {}".format(esc) + return f"Item already exists in this queue. sqlite error: {esc}" return True @@ -180,13 +180,13 @@ def delete(queue, items): cur = con.cursor() if isinstance(items, str): items = _quote_escape(items) - cmd = "DELETE FROM {} WHERE name = '{}'".format(queue, items) + cmd = f"DELETE FROM {queue} WHERE name = '{items}'" log.debug("SQL Query: %s", cmd) cur.execute(cmd) return True if isinstance(items, list): items = [_quote_escape(el) for el in items] - cmd = "DELETE FROM {} WHERE name = ?".format(queue) + cmd = f"DELETE FROM {queue} WHERE name = ?" log.debug("SQL Query: %s", cmd) newitems = [] for item in items: @@ -196,7 +196,7 @@ def delete(queue, items): if isinstance(items, dict): items = salt.utils.json.dumps(items).replace('"', "'") items = _quote_escape(items) - cmd = "DELETE FROM {} WHERE name = '{}'".format(queue, items) + cmd = f"DELETE FROM {queue} WHERE name = '{items}'" log.debug("SQL Query: %s", cmd) cur.execute(cmd) return True @@ -207,7 +207,7 @@ def pop(queue, quantity=1, is_runner=False): """ Pop one or more or all items from the queue return them. """ - cmd = "SELECT name FROM {}".format(queue) + cmd = f"SELECT name FROM {queue}" if quantity != "all": try: quantity = int(quantity) @@ -216,7 +216,7 @@ def pop(queue, quantity=1, is_runner=False): exc ) raise SaltInvocationError(error_txt) - cmd = "".join([cmd, " LIMIT {}".format(quantity)]) + cmd = "".join([cmd, f" LIMIT {quantity}"]) log.debug("SQL Query: %s", cmd) con = _conn(queue) items = [] @@ -227,7 +227,7 @@ def pop(queue, quantity=1, is_runner=False): items = [item[0] for item in result] itemlist = '","'.join(items) _quote_escape(itemlist) - del_cmd = 'DELETE FROM {} WHERE name IN ("{}")'.format(queue, itemlist) + del_cmd = f'DELETE FROM {queue} WHERE name IN ("{itemlist}")' log.debug("SQL Query: %s", del_cmd) diff --git a/salt/renderers/jinja.py b/salt/renderers/jinja.py index e19636dba00..f238bd281de 100644 --- a/salt/renderers/jinja.py +++ b/salt/renderers/jinja.py @@ -46,7 +46,7 @@ def render( argline="", context=None, tmplpath=None, - **kws + **kws, ): """ Render the template_file, passing the functions and grains into the @@ -56,7 +56,7 @@ def render( """ from_str = argline == "-s" if not from_str and argline: - raise SaltRenderError("Unknown renderer option: {opt}".format(opt=argline)) + raise SaltRenderError(f"Unknown renderer option: {argline}") tmp_data = salt.utils.templates.JINJA( template_file, @@ -71,7 +71,7 @@ def render( tmplpath=tmplpath, proxy=__proxy__, from_str=from_str, - **kws + **kws, ) if not tmp_data.get("result", False): raise SaltRenderError( diff --git a/salt/renderers/py.py b/salt/renderers/py.py index 3ce58ac405c..46ce1c03902 100644 --- a/salt/renderers/py.py +++ b/salt/renderers/py.py @@ -140,7 +140,7 @@ def render(template, saltenv="base", sls="", tmplpath=None, **kws): """ template = tmplpath if not os.path.isfile(template): - raise SaltRenderError("Template {} is not a file!".format(template)) + raise SaltRenderError(f"Template {template} is not a file!") tmp_data = salt.utils.templates.py( template, @@ -157,7 +157,7 @@ def render(template, saltenv="base", sls="", tmplpath=None, **kws): saltenv=saltenv, __sls__=sls, sls=sls, - **kws + **kws, ) if not tmp_data.get("result", False): raise SaltRenderError( diff --git a/salt/renderers/pyobjects.py b/salt/renderers/pyobjects.py index f8de8d1f9e8..a719b34ef5f 100644 --- a/salt/renderers/pyobjects.py +++ b/salt/renderers/pyobjects.py @@ -347,7 +347,7 @@ class PyobjectsModule: self.__dict__ = attrs def __repr__(self): - return "".format(self.name) + return f"" def load_states(): @@ -464,9 +464,7 @@ def render(template, saltenv="base", sls="", salt_data=True, **kwargs): with get_file_client(__opts__) as client: state_file = client.cache_file(import_file, saltenv) if not state_file: - raise ImportError( - "Could not find the file '{}'".format(import_file) - ) + raise ImportError(f"Could not find the file '{import_file}'") with salt.utils.files.fopen(state_file) as state_fh: state_contents, state_globals = process_template(state_fh) @@ -491,7 +489,7 @@ def render(template, saltenv="base", sls="", salt_data=True, **kwargs): if name not in state_globals: raise ImportError( - "'{}' was not found in '{}'".format(name, import_file) + f"'{name}' was not found in '{import_file}'" ) template_globals[alias] = state_globals[name] diff --git a/salt/renderers/stateconf.py b/salt/renderers/stateconf.py index e65664754d8..d487f2d4e67 100644 --- a/salt/renderers/stateconf.py +++ b/salt/renderers/stateconf.py @@ -116,7 +116,7 @@ def render(input, saltenv="base", sls="", argline="", **kws): sls, context=ctx, argline=rt_argline.strip(), - **kws + **kws, ) high = render_data(tmplout, saltenv, sls, argline=rd_argline.strip()) return process_high_data(high, extract) @@ -202,7 +202,7 @@ def render(input, saltenv="base", sls="", argline="", **kws): name, rt_argline = (args[1] + " ").split(" ", 1) render_template = renderers[name] # e.g., the mako renderer except KeyError as err: - raise SaltRenderError("Renderer: {} is not available!".format(err)) + raise SaltRenderError(f"Renderer: {err} is not available!") except IndexError: raise INVALID_USAGE_ERROR @@ -428,7 +428,7 @@ EXTENDED_REQUIRE_IN = {} # explicit require_in/watch_in/listen_in/onchanges_in/onfail_in can only contain states after it def add_implicit_requires(data): def T(sid, state): # pylint: disable=C0103 - return "{}:{}".format(sid, state_name(state)) + return f"{sid}:{state_name(state)}" states_before = set() states_after = set() diff --git a/salt/returners/__init__.py b/salt/returners/__init__.py index 5ad44a7ff65..2f184fa598a 100644 --- a/salt/returners/__init__.py +++ b/salt/returners/__init__.py @@ -120,9 +120,9 @@ def _fetch_option(cfg, ret_config, virtualname, attr_name): if isinstance(cfg, dict): c_cfg = cfg else: - c_cfg = cfg("{}".format(virtualname), {}) + c_cfg = cfg(f"{virtualname}", {}) - default_cfg_key = "{}.{}".format(virtualname, attr_name) + default_cfg_key = f"{virtualname}.{attr_name}" if not ret_config: # Using the default configuration key if isinstance(cfg, dict): @@ -134,7 +134,7 @@ def _fetch_option(cfg, ret_config, virtualname, attr_name): return c_cfg.get(attr_name, cfg(default_cfg_key)) # Using ret_config to override the default configuration key - ret_cfg = cfg("{}.{}".format(ret_config, virtualname), {}) + ret_cfg = cfg(f"{ret_config}.{virtualname}", {}) override_default_cfg_key = "{}.{}.{}".format( ret_config, @@ -209,6 +209,6 @@ def _fetch_profile_opts( return {} return { - pattr: creds.get("{}.{}".format(virtualname, profile_attrs[pattr])) + pattr: creds.get(f"{virtualname}.{profile_attrs[pattr]}") for pattr in profile_attrs } diff --git a/salt/returners/carbon_return.py b/salt/returners/carbon_return.py index 5dd6cd82dbd..91d5ceeb24a 100644 --- a/salt/returners/carbon_return.py +++ b/salt/returners/carbon_return.py @@ -198,10 +198,10 @@ def _walk(path, value, metrics, timestamp, skip): ) if isinstance(value, Mapping): for key, val in value.items(): - _walk("{}.{}".format(path, key), val, metrics, timestamp, skip) + _walk(f"{path}.{key}", val, metrics, timestamp, skip) elif isinstance(value, list): for item in value: - _walk("{}.{}".format(path, item), item, metrics, timestamp, skip) + _walk(f"{path}.{item}", item, metrics, timestamp, skip) else: try: diff --git a/salt/returners/couchdb_return.py b/salt/returners/couchdb_return.py index eff8c919bb0..0e39745c883 100644 --- a/salt/returners/couchdb_return.py +++ b/salt/returners/couchdb_return.py @@ -122,7 +122,7 @@ def _request(method, url, content_type=None, _data=None): try: handler = opener.open(request) except HTTPError as exc: - return {"error": "{}".format(exc)} + return {"error": f"{exc}"} return salt.utils.json.loads(handler.read()) diff --git a/salt/returners/elasticsearch_return.py b/salt/returners/elasticsearch_return.py index aa93542339a..8d329e313e3 100644 --- a/salt/returners/elasticsearch_return.py +++ b/salt/returners/elasticsearch_return.py @@ -182,8 +182,8 @@ def _ensure_index(index): "number_of_replicas": options["number_of_replicas"], } } - __salt__["elasticsearch.index_create"]("{}-v1".format(index), index_definition) - __salt__["elasticsearch.alias_create"]("{}-v1".format(index), index) + __salt__["elasticsearch.index_create"](f"{index}-v1", index_definition) + __salt__["elasticsearch.alias_create"](f"{index}-v1", index) def _convert_keys(data): @@ -235,9 +235,9 @@ def returner(ret): # Build the index name if options["states_single_index"] and job_fun in STATE_FUNCTIONS: - index = "salt-{}".format(STATE_FUNCTIONS[job_fun]) + index = f"salt-{STATE_FUNCTIONS[job_fun]}" else: - index = "salt-{}".format(job_fun_escaped) + index = f"salt-{job_fun_escaped}" if options["index_date"]: index = "{}-{}".format(index, datetime.date.today().strftime("%Y.%m.%d")) @@ -259,7 +259,7 @@ def returner(ret): # index to be '-ordered' so as not to clash with the unsorted # index data format if options["states_order_output"] and isinstance(ret["return"], dict): - index = "{}-ordered".format(index) + index = f"{index}-ordered" max_chars = len(str(len(ret["return"]))) for uid, data in ret["return"].items(): diff --git a/salt/returners/influxdb_return.py b/salt/returners/influxdb_return.py index ff78d2b02d4..76fdc15b369 100644 --- a/salt/returners/influxdb_return.py +++ b/salt/returners/influxdb_return.py @@ -109,7 +109,7 @@ def _get_version(host, port, user, password): # check the InfluxDB version via the HTTP API try: result = requests.get( - "http://{}:{}/ping".format(host, port), auth=(user, password), timeout=120 + f"http://{host}:{port}/ping", auth=(user, password), timeout=120 ) if influxDBVersionHeader in result.headers: version = result.headers[influxDBVersionHeader] @@ -224,7 +224,7 @@ def get_load(jid): Return the load data that marks a specified jid """ serv = _get_serv(ret=None) - sql = "select load from jids where jid = '{}'".format(jid) + sql = f"select load from jids where jid = '{jid}'" log.debug(">> Now in get_load %s", jid) data = serv.query(sql) @@ -240,7 +240,7 @@ def get_jid(jid): """ serv = _get_serv(ret=None) - sql = "select id, full_ret from returns where jid = '{}'".format(jid) + sql = f"select id, full_ret from returns where jid = '{jid}'" data = serv.query(sql) ret = {} diff --git a/salt/returners/local_cache.py b/salt/returners/local_cache.py index 632e11c22e9..4f62de3a5a3 100644 --- a/salt/returners/local_cache.py +++ b/salt/returners/local_cache.py @@ -89,7 +89,7 @@ def prep_jid(nocache=False, passed_jid=None, recurse_count=0): So do what you have to do to make sure that stays the case """ if recurse_count >= 5: - err = "prep_jid could not store a jid after {} tries.".format(recurse_count) + err = f"prep_jid could not store a jid after {recurse_count} tries." log.error(err) raise salt.exceptions.SaltCacheError(err) if passed_jid is None: # this can be a None or an empty string. @@ -237,7 +237,7 @@ def save_minions(jid, minions, syndic_id=None): log.debug( "Adding minions for job %s%s: %s", jid, - " from syndic master '{}'".format(syndic_id) if syndic_id else "", + f" from syndic master '{syndic_id}'" if syndic_id else "", minions, ) diff --git a/salt/returners/mattermost_returner.py b/salt/returners/mattermost_returner.py index fae03a0259b..d41841aa4a1 100644 --- a/salt/returners/mattermost_returner.py +++ b/salt/returners/mattermost_returner.py @@ -128,7 +128,7 @@ def event_return(events): log.debug("Event data: %s", event["data"]) message = "tag: {}\r\n".format(event["tag"]) for key, value in event["data"].items(): - message += "{}: {}\r\n".format(key, value) + message += f"{key}: {value}\r\n" result = post_message(channel, message, username, api_url, hook) if not result: is_ok = False @@ -157,7 +157,7 @@ def post_message(channel, message, username, api_url, hook): result = salt.utils.mattermost.query( api_url=api_url, hook=hook, - data="payload={}".format(salt.utils.json.dumps(parameters)), + data=f"payload={salt.utils.json.dumps(parameters)}", ) log.debug("result %s", result) diff --git a/salt/returners/memcache_return.py b/salt/returners/memcache_return.py index a5d80802757..455f0a4adc9 100644 --- a/salt/returners/memcache_return.py +++ b/salt/returners/memcache_return.py @@ -121,9 +121,9 @@ def _get_list(serv, key): def _append_list(serv, key, value): if value in _get_list(serv, key): return - r = serv.append(key, "{},".format(value)) + r = serv.append(key, f"{value},") if not r: - serv.add(key, "{},".format(value)) + serv.add(key, f"{value},") def prep_jid(nocache=False, passed_jid=None): # pylint: disable=unused-argument @@ -142,8 +142,8 @@ def returner(ret): jid = ret["jid"] fun = ret["fun"] rets = salt.utils.json.dumps(ret) - serv.set("{}:{}".format(jid, minion), rets) # cache for get_jid - serv.set("{}:{}".format(fun, minion), rets) # cache for get_fun + serv.set(f"{jid}:{minion}", rets) # cache for get_jid + serv.set(f"{fun}:{minion}", rets) # cache for get_fun # The following operations are neither efficient nor atomic. # If there is a way to make them so, this should be updated. @@ -183,7 +183,7 @@ def get_jid(jid): """ serv = _get_serv(ret=None) minions = _get_list(serv, "minions") - returns = serv.get_multi(minions, key_prefix="{}:".format(jid)) + returns = serv.get_multi(minions, key_prefix=f"{jid}:") # returns = {minion: return, minion: return, ...} ret = {} for minion, data in returns.items(): @@ -197,7 +197,7 @@ def get_fun(fun): """ serv = _get_serv(ret=None) minions = _get_list(serv, "minions") - returns = serv.get_multi(minions, key_prefix="{}:".format(fun)) + returns = serv.get_multi(minions, key_prefix=f"{fun}:") # returns = {minion: return, minion: return, ...} ret = {} for minion, data in returns.items(): diff --git a/salt/returners/multi_returner.py b/salt/returners/multi_returner.py index 9a030a2ae60..0017f6e7a2f 100644 --- a/salt/returners/multi_returner.py +++ b/salt/returners/multi_returner.py @@ -41,11 +41,9 @@ def prep_jid(nocache=False, passed_jid=None): jid = passed_jid for returner_ in __opts__[CONFIG_KEY]: if jid is None: - jid = _mminion().returners["{}.prep_jid".format(returner_)](nocache=nocache) + jid = _mminion().returners[f"{returner_}.prep_jid"](nocache=nocache) else: - r_jid = _mminion().returners["{}.prep_jid".format(returner_)]( - nocache=nocache - ) + r_jid = _mminion().returners[f"{returner_}.prep_jid"](nocache=nocache) if r_jid != jid: log.debug("Uhh.... crud the jids do not match") return jid @@ -56,7 +54,7 @@ def returner(load): Write return to all returners in multi_returner """ for returner_ in __opts__[CONFIG_KEY]: - _mminion().returners["{}.returner".format(returner_)](load) + _mminion().returners[f"{returner_}.returner"](load) def save_load(jid, clear_load, minions=None): @@ -64,7 +62,7 @@ def save_load(jid, clear_load, minions=None): Write load to all returners in multi_returner """ for returner_ in __opts__[CONFIG_KEY]: - _mminion().returners["{}.save_load".format(returner_)](jid, clear_load) + _mminion().returners[f"{returner_}.save_load"](jid, clear_load) def save_minions(jid, minions, syndic_id=None): # pylint: disable=unused-argument @@ -79,7 +77,7 @@ def get_load(jid): """ ret = {} for returner_ in __opts__[CONFIG_KEY]: - ret.update(_mminion().returners["{}.get_load".format(returner_)](jid)) + ret.update(_mminion().returners[f"{returner_}.get_load"](jid)) return ret @@ -90,7 +88,7 @@ def get_jid(jid): """ ret = {} for returner_ in __opts__[CONFIG_KEY]: - ret.update(_mminion().returners["{}.get_jid".format(returner_)](jid)) + ret.update(_mminion().returners[f"{returner_}.get_jid"](jid)) return ret @@ -101,7 +99,7 @@ def get_jids(): """ ret = {} for returner_ in __opts__[CONFIG_KEY]: - ret.update(_mminion().returners["{}.get_jids".format(returner_)]()) + ret.update(_mminion().returners[f"{returner_}.get_jids"]()) return ret @@ -111,6 +109,6 @@ def clean_old_jobs(): Clean out the old jobs from all returners (if you have it) """ for returner_ in __opts__[CONFIG_KEY]: - fstr = "{}.clean_old_jobs".format(returner_) + fstr = f"{returner_}.clean_old_jobs" if fstr in _mminion().returners: _mminion().returners[fstr]() diff --git a/salt/returners/odbc.py b/salt/returners/odbc.py index f7393876739..da98baf18c4 100644 --- a/salt/returners/odbc.py +++ b/salt/returners/odbc.py @@ -153,7 +153,7 @@ def _get_options(ret=None): attrs = {"dsn": "dsn", "user": "user", "passwd": "passwd"} _options = salt.returners.get_returner_options( - "returner.{}".format(__virtualname__), + f"returner.{__virtualname__}", ret, attrs, __salt__=__salt__, @@ -171,7 +171,7 @@ def _get_conn(ret=None): user = _options.get("user") passwd = _options.get("passwd") - return pyodbc.connect("DSN={};UID={};PWD={}".format(dsn, user, passwd)) + return pyodbc.connect(f"DSN={dsn};UID={user};PWD={passwd}") def _close_conn(conn): diff --git a/salt/returners/postgres.py b/salt/returners/postgres.py index a30ac590056..de7d436c83c 100644 --- a/salt/returners/postgres.py +++ b/salt/returners/postgres.py @@ -174,7 +174,7 @@ def _get_options(ret=None): } _options = salt.returners.get_returner_options( - "returner.{}".format(__virtualname__), + f"returner.{__virtualname__}", ret, attrs, __salt__=__salt__, @@ -204,7 +204,7 @@ def _get_serv(ret=None, commit=False): except psycopg2.OperationalError as exc: raise salt.exceptions.SaltMasterError( - "postgres returner could not connect to database: {exc}".format(exc=exc) + f"postgres returner could not connect to database: {exc}" ) cursor = conn.cursor() diff --git a/salt/returners/redis_return.py b/salt/returners/redis_return.py index 8a821630b70..9a75ae0f7a8 100644 --- a/salt/returners/redis_return.py +++ b/salt/returners/redis_return.py @@ -212,8 +212,8 @@ def returner(ret): serv = _get_serv(ret) pipeline = serv.pipeline(transaction=False) minion, jid = ret["id"], ret["jid"] - pipeline.hset("ret:{}".format(jid), minion, salt.utils.json.dumps(ret)) - pipeline.expire("ret:{}".format(jid), _get_ttl()) + pipeline.hset(f"ret:{jid}", minion, salt.utils.json.dumps(ret)) + pipeline.expire(f"ret:{jid}", _get_ttl()) pipeline.set("{}:{}".format(minion, ret["fun"]), jid) pipeline.sadd("minions", minion) pipeline.execute() @@ -224,7 +224,7 @@ def save_load(jid, load, minions=None): Save the load to the specified jid """ serv = _get_serv(ret=None) - serv.setex("load:{}".format(jid), _get_ttl(), salt.utils.json.dumps(load)) + serv.setex(f"load:{jid}", _get_ttl(), salt.utils.json.dumps(load)) def save_minions(jid, minions, syndic_id=None): # pylint: disable=unused-argument @@ -238,7 +238,7 @@ def get_load(jid): Return the load data that marks a specified jid """ serv = _get_serv(ret=None) - data = serv.get("load:{}".format(jid)) + data = serv.get(f"load:{jid}") if data: return salt.utils.json.loads(data) return {} @@ -250,7 +250,7 @@ def get_jid(jid): """ serv = _get_serv(ret=None) ret = {} - for minion, data in serv.hgetall("ret:{}".format(jid)).items(): + for minion, data in serv.hgetall(f"ret:{jid}").items(): if data: ret[minion] = salt.utils.json.loads(data) return ret @@ -263,14 +263,14 @@ def get_fun(fun): serv = _get_serv(ret=None) ret = {} for minion in serv.smembers("minions"): - ind_str = "{}:{}".format(minion, fun) + ind_str = f"{minion}:{fun}" try: jid = serv.get(ind_str) except Exception: # pylint: disable=broad-except continue if not jid: continue - data = serv.get("{}:{}".format(minion, jid)) + data = serv.get(f"{minion}:{jid}") if data: ret[minion] = salt.utils.json.loads(data) return ret diff --git a/salt/returners/sentry_return.py b/salt/returners/sentry_return.py index 0b660392ef0..6f477dc1c99 100644 --- a/salt/returners/sentry_return.py +++ b/salt/returners/sentry_return.py @@ -111,11 +111,7 @@ def _get_message(ret): kwargs = ret["fun_args"][-1] if isinstance(kwargs, dict): kwarg_string = " ".join( - sorted( - "{}={}".format(k, v) - for k, v in kwargs.items() - if not k.startswith("_") - ) + sorted(f"{k}={v}" for k, v in kwargs.items() if not k.startswith("_")) ) return "salt func: {fun} {argstr} {kwargstr}".format( fun=ret["fun"], argstr=arg_string, kwargstr=kwarg_string diff --git a/salt/returners/slack_webhook_return.py b/salt/returners/slack_webhook_return.py index 43357f53d23..5df1a1d641c 100644 --- a/salt/returners/slack_webhook_return.py +++ b/salt/returners/slack_webhook_return.py @@ -170,10 +170,10 @@ def _generate_payload(author_icon, title, report, **kwargs): text += "JID: {}\n".format(report.get("jid")) if TOTAL_KEY in report: - text += "Total: {}\n".format(report[TOTAL_KEY]) + text += f"Total: {report[TOTAL_KEY]}\n" if DURATION_KEY in report: - text += "Duration: {:.2f} secs".format(float(report[DURATION_KEY])) + text += f"Duration: {float(report[DURATION_KEY]):.2f} secs" attachments = [ { @@ -201,7 +201,7 @@ def _generate_payload(author_icon, title, report, **kwargs): # Changed changed = { "color": "warning", - "title": "Changed: {}".format(report[CHANGED_KEY].get(COUNTER_KEY, 0)), + "title": f"Changed: {report[CHANGED_KEY].get(COUNTER_KEY, 0)}", } if len(report[CHANGED_KEY].get(TASKS_KEY, [])) > 0: @@ -212,7 +212,7 @@ def _generate_payload(author_icon, title, report, **kwargs): # Failed failed = { "color": "danger", - "title": "Failed: {}".format(report[FAILED_KEY].get(COUNTER_KEY, None)), + "title": f"Failed: {report[FAILED_KEY].get(COUNTER_KEY, None)}", } if len(report[FAILED_KEY].get(TASKS_KEY, [])) > 0: @@ -319,9 +319,7 @@ def _generate_report(ret, show_tasks): del ret_return[CHANGED_KEY][TASKS_KEY] del ret_return[FAILED_KEY][TASKS_KEY] elif isinstance(ret_return, dict): - ret_return = { - "return": "\n{}".format(salt.utils.yaml.safe_dump(ret_return, indent=2)) - } + ret_return = {"return": f"\n{salt.utils.yaml.safe_dump(ret_return, indent=2)}"} else: ret_return = {"return": ret_return} diff --git a/salt/returners/smtp_return.py b/salt/returners/smtp_return.py index ca10015ef24..6c6394861d9 100644 --- a/salt/returners/smtp_return.py +++ b/salt/returners/smtp_return.py @@ -185,7 +185,7 @@ def returner(ret): for field in fields: if field in ret: - subject += " {}".format(ret[field]) + subject += f" {ret[field]}" subject = compile_template( ":string:", rend, renderer, blacklist, whitelist, input_data=subject, **ret ) @@ -213,7 +213,7 @@ def returner(ret): if gpgowner: if HAS_GNUPG: gpg = gnupg.GPG( - gnupghome=os.path.expanduser("~{}/.gnupg".format(gpgowner)), + gnupghome=os.path.expanduser(f"~{gpgowner}/.gnupg"), options=["--trust-model always"], ) encrypted_data = gpg.encrypt(content, to_addrs) diff --git a/salt/returners/zabbix_return.py b/salt/returners/zabbix_return.py index acf9db3f746..1b232aec2b3 100644 --- a/salt/returners/zabbix_return.py +++ b/salt/returners/zabbix_return.py @@ -90,4 +90,4 @@ def returner(ret): ) if not changes and not errors: - zabbix_send("salt.trap.info", "SALT {} OK".format(job_minion_id)) + zabbix_send("salt.trap.info", f"SALT {job_minion_id} OK") diff --git a/salt/roster/__init__.py b/salt/roster/__init__.py index fc7339d785b..a6b8bb2475d 100644 --- a/salt/roster/__init__.py +++ b/salt/roster/__init__.py @@ -45,10 +45,10 @@ def get_roster_file(options): template = os.path.join(salt.syspaths.CONFIG_DIR, "roster") if not os.path.isfile(template): - raise OSError('Roster file "{}" not found'.format(template)) + raise OSError(f'Roster file "{template}" not found') if not os.access(template, os.R_OK): - raise OSError('Access denied to roster "{}"'.format(template)) + raise OSError(f'Access denied to roster "{template}"') return template @@ -80,7 +80,7 @@ class Roster: back = set() if self.backends: for backend in self.backends: - fun = "{}.targets".format(backend) + fun = f"{backend}.targets" if fun in self.rosters: back.add(backend) return back @@ -93,7 +93,7 @@ class Roster: """ targets = {} for back in self._gen_back(): - f_str = "{}.targets".format(back) + f_str = f"{back}.targets" if f_str not in self.rosters: continue try: diff --git a/salt/roster/cache.py b/salt/roster/cache.py index 5a6018d69d0..0e8d85dc634 100644 --- a/salt/roster/cache.py +++ b/salt/roster/cache.py @@ -177,7 +177,7 @@ def _load_minion(minion_id, cache): 6: sorted(ipaddress.IPv6Address(addr) for addr in grains.get("ipv6", [])), } - mine = cache.fetch("minions/{}".format(minion_id), "mine") + mine = cache.fetch(f"minions/{minion_id}", "mine") return grains, pillar, addrs, mine @@ -256,6 +256,4 @@ def _minion_lookup(minion_id, key, minion): if filters[key](addr): return str(addr) except KeyError: - raise KeyError( - "Invalid filter {} specified in roster_order".format(key) - ) + raise KeyError(f"Invalid filter {key} specified in roster_order") diff --git a/salt/roster/dir.py b/salt/roster/dir.py index 2aa78dffe4e..8ac42a3350b 100644 --- a/salt/roster/dir.py +++ b/salt/roster/dir.py @@ -71,7 +71,7 @@ def targets(tgt, tgt_type="glob", **kwargs): for minion_id in matched_raw: target_file = salt.utils.verify.clean_path(roster_dir, minion_id) if not os.path.exists(target_file): - raise CommandExecutionError("{} does not exist".format(target_file)) + raise CommandExecutionError(f"{target_file} does not exist") rendered[minion_id] = _render(target_file, **kwargs) pruned_rendered = {id_: data for id_, data in rendered.items() if data} log.debug( @@ -99,9 +99,9 @@ def _render(roster_file, **kwargs): __opts__["renderer_blacklist"], __opts__["renderer_whitelist"], mask_value="*passw*", - **kwargs + **kwargs, ) - result.setdefault("host", "{}.{}".format(os.path.basename(roster_file), domain)) + result.setdefault("host", f"{os.path.basename(roster_file)}.{domain}") return result except: # pylint: disable=W0702 log.warning('Unable to render roster file "%s".', roster_file, exc_info=True) diff --git a/salt/roster/sshconfig.py b/salt/roster/sshconfig.py index a499fff5860..c4b3bdcb7ae 100644 --- a/salt/roster/sshconfig.py +++ b/salt/roster/sshconfig.py @@ -33,7 +33,7 @@ def _get_ssh_config_file(opts): if not os.path.isfile(ssh_config_file): raise OSError("Cannot find SSH config file") if not os.access(ssh_config_file, os.R_OK): - raise OSError("Cannot access SSH config file: {}".format(ssh_config_file)) + raise OSError(f"Cannot access SSH config file: {ssh_config_file}") return ssh_config_file @@ -117,7 +117,7 @@ class RosterMatcher: Execute the correct tgt_type routine and return """ try: - return getattr(self, "ret_{}_minions".format(self.tgt_type))() + return getattr(self, f"ret_{self.tgt_type}_minions")() except AttributeError: return {} diff --git a/salt/roster/sshknownhosts.py b/salt/roster/sshknownhosts.py index 9f8432e1672..6f895e2e7fa 100644 --- a/salt/roster/sshknownhosts.py +++ b/salt/roster/sshknownhosts.py @@ -97,9 +97,7 @@ def targets(tgt, tgt_type="glob"): raise OSError("Cannot find SSH known_hosts file") if not os.access(ssh_known_hosts_file, os.R_OK): log.error("Cannot access SSH known_hosts file: %s", ssh_known_hosts_file) - raise OSError( - "Cannot access SSH known_hosts file: {}".format(ssh_known_hosts_file) - ) + raise OSError(f"Cannot access SSH known_hosts file: {ssh_known_hosts_file}") with salt.utils.files.fopen(ssh_known_hosts_file, "r") as hostfile: raw = _parse_ssh_known_hosts([line.rstrip() for line in hostfile]) diff --git a/salt/runner.py b/salt/runner.py index 2a19636b8ed..d3501b8f919 100644 --- a/salt/runner.py +++ b/salt/runner.py @@ -203,7 +203,7 @@ class Runner(RunnerClient): arg = self.opts.get("fun", None) docs = super().get_docs(arg) for fun in sorted(docs): - display_output("{}:".format(fun), "text", self.opts) + display_output(f"{fun}:", "text", self.opts) print(docs[fun]) # TODO: move to mixin whenever we want a salt-wheel cli @@ -313,13 +313,13 @@ class Runner(RunnerClient): evt.fire_event( { "success": False, - "return": "{}".format(exc), + "return": f"{exc}", "retcode": 254, "fun": self.opts["fun"], "fun_args": fun_args, "jid": self.jid, }, - tag="salt/run/{}/ret".format(self.jid), + tag=f"salt/run/{self.jid}/ret", ) # Attempt to grab documentation if "fun" in low: @@ -330,7 +330,7 @@ class Runner(RunnerClient): # If we didn't get docs returned then # return the `not availble` message. if not ret: - ret = "{}".format(exc) + ret = f"{exc}" if not self.opts.get("quiet", False): display_output(ret, "nested", self.opts) else: diff --git a/salt/runners/asam.py b/salt/runners/asam.py index 6014429c792..372bc7dd742 100644 --- a/salt/runners/asam.py +++ b/salt/runners/asam.py @@ -226,7 +226,7 @@ def remove_platform(name, server_url): try: html_content = _make_post_request(url, data, auth, verify=config["verify_ssl"]) except Exception as exc: # pylint: disable=broad-except - err_msg = "Failed to look up existing platforms on {}".format(server_url) + err_msg = f"Failed to look up existing platforms on {server_url}" log.error("%s:\n%s", err_msg, exc) return {name: err_msg} @@ -244,18 +244,18 @@ def remove_platform(name, server_url): url, data, auth, verify=config["verify_ssl"] ) except Exception as exc: # pylint: disable=broad-except - err_msg = "Failed to delete platform from {}".format(server_url) + err_msg = f"Failed to delete platform from {server_url}" log.error("%s:\n%s", err_msg, exc) return {name: err_msg} parser = _parse_html_content(html_content) platformset_name = _get_platformset_name(parser.data, name) if platformset_name: - return {name: "Failed to delete platform from {}".format(server_url)} + return {name: f"Failed to delete platform from {server_url}"} else: - return {name: "Successfully deleted platform from {}".format(server_url)} + return {name: f"Successfully deleted platform from {server_url}"} else: - return {name: "Specified platform name does not exist on {}".format(server_url)} + return {name: f"Specified platform name does not exist on {server_url}"} def list_platforms(server_url): @@ -351,11 +351,11 @@ def add_platform(name, platform_set, server_url): platforms = list_platforms(server_url) if name in platforms[server_url]: - return {name: "Specified platform already exists on {}".format(server_url)} + return {name: f"Specified platform already exists on {server_url}"} platform_sets = list_platform_sets(server_url) if platform_set not in platform_sets[server_url]: - return {name: "Specified platform set does not exist on {}".format(server_url)} + return {name: f"Specified platform set does not exist on {server_url}"} url = config["platform_edit_url"] @@ -373,12 +373,12 @@ def add_platform(name, platform_set, server_url): try: html_content = _make_post_request(url, data, auth, verify=config["verify_ssl"]) except Exception as exc: # pylint: disable=broad-except - err_msg = "Failed to add platform on {}".format(server_url) + err_msg = f"Failed to add platform on {server_url}" log.error("%s:\n%s", err_msg, exc) return {name: err_msg} platforms = list_platforms(server_url) if name in platforms[server_url]: - return {name: "Successfully added platform on {}".format(server_url)} + return {name: f"Successfully added platform on {server_url}"} else: - return {name: "Failed to add platform on {}".format(server_url)} + return {name: f"Failed to add platform on {server_url}"} diff --git a/salt/runners/bgp.py b/salt/runners/bgp.py index 4603de029af..bee6d4698ea 100644 --- a/salt/runners/bgp.py +++ b/salt/runners/bgp.py @@ -331,9 +331,7 @@ def neighbors(*asns, **kwargs): ) ) if ipnet: - title_parts.append( - "Selecting neighbors within the IP network: {ipnet}".format(ipnet=ipnet) - ) + title_parts.append(f"Selecting neighbors within the IP network: {ipnet}") if kwargs: title_parts.append( "Searching for BGP neighbors having the attributes: {attrmap}".format( diff --git a/salt/runners/cache.py b/salt/runners/cache.py index 88a5c6be0db..89309af690f 100644 --- a/salt/runners/cache.py +++ b/salt/runners/cache.py @@ -327,7 +327,7 @@ def clear_git_lock(role, remote=None, **kwargs): ) git_objects.append(obj) else: - raise SaltInvocationError("Invalid role '{}'".format(role)) + raise SaltInvocationError(f"Invalid role '{role}'") ret = {} for obj in git_objects: diff --git a/salt/runners/ddns.py b/salt/runners/ddns.py index 9e4d5c64971..831f5211627 100644 --- a/salt/runners/ddns.py +++ b/salt/runners/ddns.py @@ -75,7 +75,7 @@ def create( """ if zone in name: name = name.replace(zone, "").rstrip(".") - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, rdtype) answer = dns.query.udp(request, nameserver, timeout, port) @@ -99,9 +99,9 @@ def create( answer = dns.query.udp(dns_update, nameserver, timeout, port) if answer.rcode() > 0: - return {fqdn: "Failed to create record of type '{}'".format(rdtype)} + return {fqdn: f"Failed to create record of type '{rdtype}'"} - return {fqdn: "Created record of type '{}': {} -> {}".format(rdtype, fqdn, data)} + return {fqdn: f"Created record of type '{rdtype}': {fqdn} -> {data}"} def update( @@ -135,7 +135,7 @@ def update( """ if zone in name: name = name.replace(zone, "").rstrip(".") - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, rdtype) answer = dns.query.udp(request, nameserver, timeout, port) if not answer.answer: @@ -166,9 +166,9 @@ def update( answer = dns.query.udp(dns_update, nameserver, timeout, port) if answer.rcode() > 0: - return {fqdn: "Failed to update record of type '{}'".format(rdtype)} + return {fqdn: f"Failed to update record of type '{rdtype}'"} - return {fqdn: "Updated record of type '{}'".format(rdtype)} + return {fqdn: f"Updated record of type '{rdtype}'"} def delete( @@ -194,7 +194,7 @@ def delete( """ if zone in name: name = name.replace(zone, "").rstrip(".") - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, (rdtype or "ANY")) answer = dns.query.udp(request, nameserver, timeout, port) @@ -248,7 +248,7 @@ def add_host( res = [] if zone in name: name = name.replace(zone, "").rstrip(".") - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" ret = create( zone, @@ -277,13 +277,13 @@ def add_host( zone = "{}.{}".format(".".join(parts), "in-addr.arpa.") name = ".".join(popped) - rev_fqdn = "{}.{}".format(name, zone) + rev_fqdn = f"{name}.{zone}" ret = create( zone, name, ttl, "PTR", - "{}.".format(fqdn), + f"{fqdn}.", keyname, keyfile, nameserver, @@ -317,7 +317,7 @@ def delete_host( res = [] if zone in name: name = name.replace(zone, "").rstrip(".") - fqdn = "{}.{}".format(name, zone) + fqdn = f"{name}.{zone}" request = dns.message.make_query(fqdn, "A") answer = dns.query.udp(request, nameserver, timeout, port) @@ -336,7 +336,7 @@ def delete_host( port=port, keyalgorithm=keyalgorithm, ) - res.append("{} of type 'A'".format(ret[fqdn])) + res.append(f"{ret[fqdn]} of type 'A'") for ip in ips: parts = ip.split(".")[::-1] @@ -350,7 +350,7 @@ def delete_host( popped.append(p) zone = "{}.{}".format(".".join(parts), "in-addr.arpa.") name = ".".join(popped) - rev_fqdn = "{}.{}".format(name, zone) + rev_fqdn = f"{name}.{zone}" ret = delete( zone, name, @@ -359,13 +359,13 @@ def delete_host( nameserver, timeout, "PTR", - "{}.".format(fqdn), + f"{fqdn}.", port, keyalgorithm, ) if "Deleted" in ret[rev_fqdn]: - res.append("{} of type 'PTR'".format(ret[rev_fqdn])) + res.append(f"{ret[rev_fqdn]} of type 'PTR'") return {fqdn: res} res.append(ret[rev_fqdn]) diff --git a/salt/runners/digicertapi.py b/salt/runners/digicertapi.py index 44c8d02f728..a7450d7b8ad 100644 --- a/salt/runners/digicertapi.py +++ b/salt/runners/digicertapi.py @@ -113,7 +113,7 @@ def _paginate(url, topkey, *args, **kwargs): aggregate_ret = ret["dict"][topkey] url = args[0] for p in range(2, numpages): - param_url = url + "?offset={}".format(lim * (p - 1)) + param_url = url + f"?offset={lim * (p - 1)}" next_ret = salt.utils.http.query(param_url, kwargs) aggregate_ret[topkey].extend(next_ret["dict"][topkey]) @@ -132,9 +132,9 @@ def list_domains(container_id=None): salt-run digicert.list_domains """ if container_id: - url = "{}/domain?{}".format(_base_url(), container_id) + url = f"{_base_url()}/domain?{container_id}" else: - url = "{}/domain".format(_base_url()) + url = f"{_base_url()}/domain" orgs = _paginate( url, @@ -161,9 +161,9 @@ def list_requests(status=None): salt-run digicert.list_requests pending """ if status: - url = "{}/request?status={}".format(_base_url(), status) + url = f"{_base_url()}/request?status={status}" else: - url = "{}/request".format(_base_url()) + url = f"{_base_url()}/request" reqs = _paginate( url, @@ -189,7 +189,7 @@ def list_orders(status=None): salt-run digicert.list_orders """ - url = "{}/order/certificate".format(_base_url()) + url = f"{_base_url()}/order/certificate" reqs = _paginate( url, @@ -239,7 +239,7 @@ def get_certificate( if order_id: order_cert = salt.utils.http.query( - "{}/order/certificate/{}".format(_base_url(), order_id), + f"{_base_url()}/order/certificate/{order_id}", method="GET", raise_error=False, decode=True, @@ -373,7 +373,7 @@ def list_organizations(container_id=None, include_validation=True): """ orgs = _paginate( - "{}/organization".format(_base_url()), + f"{_base_url()}/organization", "organizations", method="GET", decode=True, @@ -496,7 +496,7 @@ def order_certificate( encoded_body = salt.utils.json.dumps(body) qdata = salt.utils.http.query( - "{}/order/certificate/ssl".format(_base_url()), + f"{_base_url()}/order/certificate/ssl", method="POST", data=encoded_body, decode=True, @@ -572,7 +572,7 @@ def get_org_details(organization_id): """ qdata = salt.utils.http.query( - "{}/organization/{}".format(_base_url(), organization_id), + f"{_base_url()}/organization/{organization_id}", method="GET", decode=True, decode_type="json", @@ -624,8 +624,8 @@ def gen_csr( if "private_key" not in data: data["private_key"] = gen_key(minion_id, dns_name, password, key_len=key_len) - tmppriv = "{}/priv".format(tmpdir) - tmpcsr = "{}/csr".format(tmpdir) + tmppriv = f"{tmpdir}/priv" + tmpcsr = f"{tmpdir}/csr" with salt.utils.files.fopen(tmppriv, "w") as if_: if_.write(salt.utils.stringutils.to_str(data["private_key"])) @@ -637,9 +637,9 @@ def gen_csr( ) if ou_name: - subject = subject + "/OU={}".format(ou_name) + subject = subject + f"/OU={ou_name}" - subject = subject + "/CN={}".format(dns_name) + subject = subject + f"/CN={dns_name}" cmd = "openssl req -new -{} -key {} -out {} -subj '{}'".format( shatype, tmppriv, tmpcsr, subject @@ -690,7 +690,7 @@ def show_organization(domain): salt-run digicert.show_company example.com """ data = salt.utils.http.query( - "{}/companies/domain/{}".format(_base_url(), domain), + f"{_base_url()}/companies/domain/{domain}", status=True, decode=True, decode_type="json", @@ -713,7 +713,7 @@ def show_csrs(): salt-run digicert.show_csrs """ data = salt.utils.http.query( - "{}/certificaterequests".format(_base_url()), + f"{_base_url()}/certificaterequests", status=True, decode=True, decode_type="json", diff --git a/salt/runners/f5.py b/salt/runners/f5.py index bac50c00cd9..13f33f31a1d 100644 --- a/salt/runners/f5.py +++ b/salt/runners/f5.py @@ -53,7 +53,7 @@ class F5Mgmt: wsdls=["LocalLB.VirtualServer", "LocalLB.Pool"], ) except Exception: # pylint: disable=broad-except - raise Exception("Unable to connect to {}".format(self.lb)) + raise Exception(f"Unable to connect to {self.lb}") return True @@ -123,9 +123,7 @@ class F5Mgmt: profiles=[vs_profile_seq], ) except Exception as e: # pylint: disable=broad-except - raise Exception( - "Unable to create `{}` virtual server\n\n{}".format(name, e) - ) + raise Exception(f"Unable to create `{name}` virtual server\n\n{e}") return True def create_pool(self, name, method="ROUND_ROBIN"): @@ -144,7 +142,7 @@ class F5Mgmt: pool_names=[name], lb_methods=[supported_method], members=[[]] ) except Exception as e: # pylint: disable=broad-except - raise Exception("Unable to create `{}` pool\n\n{}".format(name, e)) + raise Exception(f"Unable to create `{name}` pool\n\n{e}") else: raise Exception("Unsupported method") return True @@ -154,7 +152,7 @@ class F5Mgmt: Add a node to a pool """ if not self.check_pool(pool_name): - raise CommandExecutionError("{} pool does not exists".format(pool_name)) + raise CommandExecutionError(f"{pool_name} pool does not exists") members_seq = self.bigIP.LocalLB.Pool.typefactory.create( "Common.IPPortDefinitionSequence" @@ -173,9 +171,7 @@ class F5Mgmt: pool_names=[pool_name], members=[members_seq] ) except Exception as e: # pylint: disable=broad-except - raise Exception( - "Unable to add `{}` to `{}`\n\n{}".format(name, pool_name, e) - ) + raise Exception(f"Unable to add `{name}` to `{pool_name}`\n\n{e}") return True def check_pool(self, name): @@ -229,7 +225,7 @@ def create_vs(lb, name, ip, port, protocol, profile, pool_name): if __opts__["load_balancers"].get(lb, None): (username, password) = list(__opts__["load_balancers"][lb].values()) else: - raise Exception("Unable to find `{}` load balancer".format(lb)) + raise Exception(f"Unable to find `{lb}` load balancer") F5 = F5Mgmt(lb, username, password) F5.create_vs(name, ip, port, protocol, profile, pool_name) @@ -250,7 +246,7 @@ def create_pool(lb, name, method="ROUND_ROBIN"): if __opts__["load_balancers"].get(lb, None): (username, password) = list(__opts__["load_balancers"][lb].values()) else: - raise Exception("Unable to find `{}` load balancer".format(lb)) + raise Exception(f"Unable to find `{lb}` load balancer") F5 = F5Mgmt(lb, username, password) F5.create_pool(name, method) return True @@ -269,7 +265,7 @@ def add_pool_member(lb, name, port, pool_name): if __opts__["load_balancers"].get(lb, None): (username, password) = list(__opts__["load_balancers"][lb].values()) else: - raise Exception("Unable to find `{}` load balancer".format(lb)) + raise Exception(f"Unable to find `{lb}` load balancer") F5 = F5Mgmt(lb, username, password) F5.add_pool_member(name, port, pool_name) return True @@ -288,7 +284,7 @@ def check_pool(lb, name): if __opts__["load_balancers"].get(lb, None): (username, password) = list(__opts__["load_balancers"][lb].values()) else: - raise Exception("Unable to find `{}` load balancer".format(lb)) + raise Exception(f"Unable to find `{lb}` load balancer") F5 = F5Mgmt(lb, username, password) return F5.check_pool(name) @@ -306,7 +302,7 @@ def check_virtualserver(lb, name): if __opts__["load_balancers"].get(lb, None): (username, password) = list(__opts__["load_balancers"][lb].values()) else: - raise Exception("Unable to find `{}` load balancer".format(lb)) + raise Exception(f"Unable to find `{lb}` load balancer") F5 = F5Mgmt(lb, username, password) return F5.check_virtualserver(name) @@ -324,6 +320,6 @@ def check_member_pool(lb, member, pool_name): if __opts__["load_balancers"].get(lb, None): (username, password) = list(__opts__["load_balancers"][lb].values()) else: - raise Exception("Unable to find `{}` load balancer".format(lb)) + raise Exception(f"Unable to find `{lb}` load balancer") F5 = F5Mgmt(lb, username, password) return F5.check_member_pool(member, pool_name) diff --git a/salt/runners/jobs.py b/salt/runners/jobs.py index 1d958b87a9b..f1ff0f8b492 100644 --- a/salt/runners/jobs.py +++ b/salt/runners/jobs.py @@ -70,7 +70,7 @@ def active(display_progress=False): for minion, data in active_.items(): if display_progress: __jid_event__.fire_event( - {"message": "Received reply from minion {}".format(minion)}, "progress" + {"message": f"Received reply from minion {minion}"}, "progress" ) if not isinstance(data, list): continue @@ -88,7 +88,7 @@ def active(display_progress=False): returner = _get_returner( (__opts__["ext_job_cache"], __opts__["master_job_cache"]) ) - data = mminion.returners["{}.get_jid".format(returner)](jid) + data = mminion.returners[f"{returner}.get_jid"](jid) if data: for minion in data: if minion not in ret[jid]["Returned"]: @@ -199,12 +199,12 @@ def list_job(jid, ext_source=None, display_progress=False): ) if display_progress: __jid_event__.fire_event( - {"message": "Querying returner: {}".format(returner)}, "progress" + {"message": f"Querying returner: {returner}"}, "progress" ) - job = mminion.returners["{}.get_load".format(returner)](jid) + job = mminion.returners[f"{returner}.get_load"](jid) ret.update(_format_jid_instance(jid, job)) - ret["Result"] = mminion.returners["{}.get_jid".format(returner)](jid) + ret["Result"] = mminion.returners[f"{returner}.get_jid"](jid) fstr = "{}.get_endtime".format(__opts__["master_job_cache"]) if __opts__.get("job_cache_store_endtime") and fstr in mminion.returners: @@ -306,11 +306,11 @@ def list_jobs( ) if display_progress: __jid_event__.fire_event( - {"message": "Querying returner {} for jobs.".format(returner)}, "progress" + {"message": f"Querying returner {returner} for jobs."}, "progress" ) mminion = salt.minion.MasterMinion(__opts__) - ret = mminion.returners["{}.get_jids".format(returner)]() + ret = mminion.returners[f"{returner}.get_jids"]() mret = {} for item in ret: @@ -401,15 +401,13 @@ def list_jobs_filter( ) if display_progress: __jid_event__.fire_event( - {"message": "Querying returner {} for jobs.".format(returner)}, "progress" + {"message": f"Querying returner {returner} for jobs."}, "progress" ) mminion = salt.minion.MasterMinion(__opts__) - fun = "{}.get_jids_filter".format(returner) + fun = f"{returner}.get_jids_filter" if fun not in mminion.returners: - raise NotImplementedError( - "'{}' returner function not implemented yet.".format(fun) - ) + raise NotImplementedError(f"'{fun}' returner function not implemented yet.") ret = mminion.returners[fun](count, filter_find_job) if outputter: @@ -436,7 +434,7 @@ def print_job(jid, ext_source=None): mminion = salt.minion.MasterMinion(__opts__) try: - job = mminion.returners["{}.get_load".format(returner)](jid) + job = mminion.returners[f"{returner}.get_load"](jid) ret[jid] = _format_jid_instance(jid, job) except TypeError: ret[jid]["Result"] = ( @@ -444,7 +442,7 @@ def print_job(jid, ext_source=None): "retrieved. Check master log for details.".format(returner) ) return ret - ret[jid]["Result"] = mminion.returners["{}.get_jid".format(returner)](jid) + ret[jid]["Result"] = mminion.returners[f"{returner}.get_jid"](jid) fstr = "{}.get_endtime".format(__opts__["master_job_cache"]) if __opts__.get("job_cache_store_endtime") and fstr in mminion.returners: @@ -598,7 +596,5 @@ def _walk_through(job_dir, display_progress=False): job = salt.payload.load(rfh) jid = job["jid"] if display_progress: - __jid_event__.fire_event( - {"message": "Found JID {}".format(jid)}, "progress" - ) + __jid_event__.fire_event({"message": f"Found JID {jid}"}, "progress") yield jid, job, t_path, final diff --git a/salt/runners/launchd.py b/salt/runners/launchd.py index 268668a79a1..87184e5c66c 100644 --- a/salt/runners/launchd.py +++ b/salt/runners/launchd.py @@ -48,7 +48,7 @@ def write_launchd_plist(program): supported_programs = ["salt-master", "salt-minion"] if program not in supported_programs: - sys.stderr.write("Supported programs: '{}'\n".format(supported_programs)) + sys.stderr.write(f"Supported programs: '{supported_programs}'\n") sys.exit(-1) return plist_sample_text.format( diff --git a/salt/runners/lxc.py b/salt/runners/lxc.py index f325dcb7b64..c12826f4162 100644 --- a/salt/runners/lxc.py +++ b/salt/runners/lxc.py @@ -40,7 +40,7 @@ def _do(name, fun, path=None): with salt.client.get_local_client(__opts__["conf_file"]) as client: cmd_ret = client.cmd_iter( - host, "lxc.{}".format(fun), [name], kwarg={"path": path}, timeout=60 + host, f"lxc.{fun}", [name], kwarg={"path": path}, timeout=60 ) data = next(cmd_ret) data = data.get(host, {}).get("ret", None) @@ -71,7 +71,7 @@ def _do_names(names, fun, path=None): cmds.append( client.cmd_iter( host, - "lxc.{}".format(fun), + f"lxc.{fun}", [name], kwarg={"path": path}, timeout=60, @@ -247,7 +247,7 @@ def init(names, host=None, saltcloud_mode=False, quiet=False, **kwargs): except (TypeError, KeyError): pass if not alive: - ret["comment"] = "Host {} is not reachable".format(host) + ret["comment"] = f"Host {host} is not reachable" ret["result"] = False return ret @@ -263,7 +263,7 @@ def init(names, host=None, saltcloud_mode=False, quiet=False, **kwargs): host, ) if host not in data: - ret["comment"] = "Host '{}' was not found".format(host) + ret["comment"] = f"Host '{host}' was not found" ret["result"] = False return ret @@ -390,7 +390,7 @@ def init(names, host=None, saltcloud_mode=False, quiet=False, **kwargs): time.sleep(1) if ping: return "OK" - raise Exception("Unresponsive {}".format(mid_)) + raise Exception(f"Unresponsive {mid_}") ping = salt.utils.cloud.wait_for_fun(testping, timeout=21, mid=mid) if ping != "OK": diff --git a/salt/runners/manage.py b/salt/runners/manage.py index 63ee54e4b66..65b3455f53d 100644 --- a/salt/runners/manage.py +++ b/salt/runners/manage.py @@ -537,7 +537,7 @@ def safe_accept(target, tgt_type="glob"): del ret[minion] continue elif minion not in pending: - failures[minion] = "Minion key {} not found by salt-key".format(minion) + failures[minion] = f"Minion key {minion} not found by salt-key" elif pending[minion] != finger: failures[minion] = ( "Minion key {} does not match the key in salt-key: {}".format( @@ -558,9 +558,7 @@ def safe_accept(target, tgt_type="glob"): print(message) print("") - __jid_event__.fire_event( - {"message": "Accepted {:d} keys".format(len(ret))}, "progress" - ) + __jid_event__.fire_event({"message": f"Accepted {len(ret):d} keys"}, "progress") return ret, failures @@ -729,8 +727,8 @@ def bootstrap( client_opts["argv"] = [ "http.query", script, - "backend={}".format(http_backend), - "text_out={}".format(deploy_command), + f"backend={http_backend}", + f"text_out={deploy_command}", ] salt.client.ssh.SSH(client_opts).run() client_opts["argv"] = [ @@ -845,7 +843,7 @@ objShell.Exec("{1}{2}")""" vb_saltexec = "saltinstall.exe" vb_saltexec_args = " /S /minion-name=%COMPUTERNAME%" if master: - vb_saltexec_args += " /master={}".format(master) + vb_saltexec_args += f" /master={master}" # One further thing we need to do; the Windows Salt minion is pretty # self-contained, except for the Microsoft Visual C++ 2008 runtime. diff --git a/salt/runners/mattermost.py b/salt/runners/mattermost.py index bb332de3411..828ff857939 100644 --- a/salt/runners/mattermost.py +++ b/salt/runners/mattermost.py @@ -129,7 +129,7 @@ def post_message(message, channel=None, username=None, api_url=None, hook=None): log.debug("Parameters: %s", parameters) data = salt.utils.json.dumps(parameters) result = salt.utils.mattermost.query( - api_url=api_url, hook=hook, data="payload={}".format(data) + api_url=api_url, hook=hook, data=f"payload={data}" ) if result: @@ -167,7 +167,7 @@ def post_event(event, channel=None, username=None, api_url=None, hook=None): log.debug("Event data: %s", event["data"]) message = "tag: {}\r\n".format(event["tag"]) for key, value in event["data"].items(): - message += "{}: {}\r\n".format(key, value) + message += f"{key}: {value}\r\n" result = post_message( message, channel=channel, username=username, api_url=api_url, hook=hook ) diff --git a/salt/runners/net.py b/salt/runners/net.py index a7865219b62..f330c0ba924 100644 --- a/salt/runners/net.py +++ b/salt/runners/net.py @@ -347,13 +347,13 @@ def interfaces( if not title: title = "Details" if interface: - title += " for interface {}".format(interface) + title += f" for interface {interface}" else: title += " for all interfaces" if device: - title += " on device {}".format(device) + title += f" on device {device}" if ipnet: - title += " that include network {net}".format(net=str(ipnet)) + title += f" that include network {str(ipnet)}" if best: title += " - only best match returned" @@ -511,13 +511,13 @@ def findarp( title = "ARP Entries" if device: - title += " on device {device}".format(device=device) + title += f" on device {device}" if interface: - title += " on interface {interf}".format(interf=interface) + title += f" on interface {interface}" if ip: - title += " for IP {ip}".format(ip=ip) + title += f" for IP {ip}" if mac: - title += " for MAC {mac}".format(mac=mac) + title += f" for MAC {mac}" if device: all_arp = {device: all_arp.get(device)} @@ -615,11 +615,11 @@ def findmac(device=None, mac=None, interface=None, vlan=None, display=_DEFAULT_D title = "MAC Address(es)" if device: - title += " on device {device}".format(device=device) + title += f" on device {device}" if interface: - title += " on interface {interf}".format(interf=interface) + title += f" on interface {interface}" if vlan: - title += " on VLAN {vlan}".format(vlan=vlan) + title += f" on VLAN {vlan}" if device: all_mac = {device: all_mac.get(device)} @@ -752,13 +752,13 @@ def lldp( if not title: title = "LLDP Neighbors" if interface: - title += " for interface {}".format(interface) + title += f" for interface {interface}" else: title += " for all interfaces" if device: - title += " on device {}".format(device) + title += f" on device {device}" if chassis: - title += " having Chassis ID {}".format(chassis) + title += f" having Chassis ID {chassis}" if device: all_lldp = {device: all_lldp.get(device)} diff --git a/salt/runners/network.py b/salt/runners/network.py index 2812bb3a94e..2bf46e80a98 100644 --- a/salt/runners/network.py +++ b/salt/runners/network.py @@ -31,11 +31,11 @@ def wollist(maclist, bcast="255.255.255.255", destport=9): for mac in ifile: mac = salt.utils.stringutils.to_unicode(mac).strip() wol(mac, bcast, destport) - print("Waking up {}".format(mac)) + print(f"Waking up {mac}") ret.append(mac) except Exception as err: # pylint: disable=broad-except __jid_event__.fire_event( - {"error": "Failed to open the MAC file. Error: {}".format(err)}, "progress" + {"error": f"Failed to open the MAC file. Error: {err}"}, "progress" ) return [] return ret diff --git a/salt/runners/pkg.py b/salt/runners/pkg.py index 1987b696920..5abf574d063 100644 --- a/salt/runners/pkg.py +++ b/salt/runners/pkg.py @@ -32,7 +32,7 @@ def list_upgrades(jid, style="group", outputter="nested", ext_source=None): (__opts__["ext_job_cache"], ext_source, __opts__["master_job_cache"]) ) - data = mminion.returners["{}.get_jid".format(returner)](jid) + data = mminion.returners[f"{returner}.get_jid"](jid) pkgs = {} if style == "group": diff --git a/salt/runners/queue.py b/salt/runners/queue.py index 36c77daaa98..d91418355c3 100644 --- a/salt/runners/queue.py +++ b/salt/runners/queue.py @@ -80,9 +80,9 @@ def insert(queue, items, backend="sqlite"): salt-run queue.insert myqueue "['item1', 'item2', 'item3']" backend=sqlite """ queue_funcs = salt.loader.queues(__opts__) - cmd = "{}.insert".format(backend) + cmd = f"{backend}.insert" if cmd not in queue_funcs: - raise SaltInvocationError('Function "{}" is not available'.format(cmd)) + raise SaltInvocationError(f'Function "{cmd}" is not available') ret = queue_funcs[cmd](items=items, queue=queue) return ret @@ -100,9 +100,9 @@ def delete(queue, items, backend="sqlite"): salt-run queue.delete myqueue "['item1', 'item2', 'item3']" """ queue_funcs = salt.loader.queues(__opts__) - cmd = "{}.delete".format(backend) + cmd = f"{backend}.delete" if cmd not in queue_funcs: - raise SaltInvocationError('Function "{}" is not available'.format(cmd)) + raise SaltInvocationError(f'Function "{cmd}" is not available') ret = queue_funcs[cmd](items=items, queue=queue) return ret @@ -119,9 +119,9 @@ def list_queues(backend="sqlite"): salt-run queue.list_queues backend=sqlite """ queue_funcs = salt.loader.queues(__opts__) - cmd = "{}.list_queues".format(backend) + cmd = f"{backend}.list_queues" if cmd not in queue_funcs: - raise SaltInvocationError('Function "{}" is not available'.format(cmd)) + raise SaltInvocationError(f'Function "{cmd}" is not available') ret = queue_funcs[cmd]() return ret @@ -138,9 +138,9 @@ def list_length(queue, backend="sqlite"): salt-run queue.list_length myqueue backend=sqlite """ queue_funcs = salt.loader.queues(__opts__) - cmd = "{}.list_length".format(backend) + cmd = f"{backend}.list_length" if cmd not in queue_funcs: - raise SaltInvocationError('Function "{}" is not available'.format(cmd)) + raise SaltInvocationError(f'Function "{cmd}" is not available') ret = queue_funcs[cmd](queue=queue) return ret @@ -157,9 +157,9 @@ def list_items(queue, backend="sqlite"): salt-run queue.list_items myqueue backend=sqlite """ queue_funcs = salt.loader.queues(__opts__) - cmd = "{}.list_items".format(backend) + cmd = f"{backend}.list_items" if cmd not in queue_funcs: - raise SaltInvocationError('Function "{}" is not available'.format(cmd)) + raise SaltInvocationError(f'Function "{cmd}" is not available') ret = queue_funcs[cmd](queue=queue) return ret @@ -179,9 +179,9 @@ def pop(queue, quantity=1, backend="sqlite", is_runner=False): salt-run queue.pop myqueue all backend=sqlite """ queue_funcs = salt.loader.queues(__opts__) - cmd = "{}.pop".format(backend) + cmd = f"{backend}.pop" if cmd not in queue_funcs: - raise SaltInvocationError('Function "{}" is not available'.format(cmd)) + raise SaltInvocationError(f'Function "{cmd}" is not available') ret = queue_funcs[cmd](quantity=quantity, queue=queue, is_runner=is_runner) return ret @@ -211,7 +211,7 @@ def process_queue(queue, quantity=1, backend="sqlite", is_runner=False): queue=queue, quantity=quantity, backend=backend, is_runner=is_runner ) except SaltInvocationError as exc: - error_txt = "{}".format(exc) + error_txt = f"{exc}" __jid_event__.fire_event({"errors": error_txt}, "progress") return False diff --git a/salt/runners/salt.py b/salt/runners/salt.py index 50fac6ab4a7..3ac499ae579 100644 --- a/salt/runners/salt.py +++ b/salt/runners/salt.py @@ -102,7 +102,7 @@ def cmd(fun, *args, **kwargs): return ( functions[fun](*args, **kwargs) if fun in functions - else "'{}' is not available.".format(fun) + else f"'{fun}' is not available." ) @@ -115,7 +115,7 @@ def execute( ret="", jid="", kwarg=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2017.7.0 @@ -159,7 +159,7 @@ def execute( ret=ret, jid=jid, kwarg=kwarg, - **kwargs + **kwargs, ) except SaltClientError as client_error: log.error("Error while executing %s on %s (%s)", fun, tgt, tgt_type) diff --git a/salt/runners/smartos_vmadm.py b/salt/runners/smartos_vmadm.py index 7575fdbaf18..b469f1239e5 100644 --- a/salt/runners/smartos_vmadm.py +++ b/salt/runners/smartos_vmadm.py @@ -100,7 +100,7 @@ def _action(action="get", search=None, one=True, force=False): ## multiple allowed? if one and len(matched_vms) > 1: return { - "Error": "Matched {} vms, only one allowed!".format(len(matched_vms)), + "Error": f"Matched {len(matched_vms)} vms, only one allowed!", "Matches": matched_vms, } @@ -111,7 +111,7 @@ def _action(action="get", search=None, one=True, force=False): vmadm_args = {"key": "uuid", "vm": vm} try: for vmadm_res in client.cmd_iter( - vms[vm]["node"], "vmadm.{}".format(action), kwarg=vmadm_args + vms[vm]["node"], f"vmadm.{action}", kwarg=vmadm_args ): if not vmadm_res: continue @@ -188,7 +188,7 @@ def nodes(verbose=False): else: ret.append(node) except SaltClientError as client_error: - return "{}".format(client_error) + return f"{client_error}" if not verbose: ret.sort() @@ -256,7 +256,7 @@ def list_vms(search=None, verbose=False): else: ret.append(vm) except SaltClientError as client_error: - return "{}".format(client_error) + return f"{client_error}" if not verbose: ret = sorted(ret) diff --git a/salt/runners/spacewalk.py b/salt/runners/spacewalk.py index 69fce4731cd..4936859b16b 100644 --- a/salt/runners/spacewalk.py +++ b/salt/runners/spacewalk.py @@ -71,7 +71,7 @@ def _get_spacewalk_configuration(spacewalk_url=""): return False ret = { - "api_url": "{}://{}/rpc/api".format(protocol, spacewalk_server), + "api_url": f"{protocol}://{spacewalk_server}/rpc/api", "username": username, "password": password, } @@ -120,7 +120,7 @@ def _get_session(server): config = _get_spacewalk_configuration(server) if not config: - raise Exception("No config for '{}' found on master".format(server)) + raise Exception(f"No config for '{server}' found on master") session = _get_client_and_key( config["api_url"], config["username"], config["password"] @@ -163,7 +163,7 @@ def api(server, command, *args, **kwargs): else: arguments = args - call = "{} {}".format(command, arguments) + call = f"{command} {arguments}" try: client, key = _get_session(server) except Exception as exc: # pylint: disable=broad-except @@ -185,7 +185,7 @@ def api(server, command, *args, **kwargs): try: output = endpoint(key, *arguments) except Exception as e: # pylint: disable=broad-except - output = "API call failed: {}".format(e) + output = f"API call failed: {e}" return {call: output} @@ -360,10 +360,8 @@ def unregister(name, server_url): for system in systems_list: out = client.system.deleteSystem(key, system["id"]) if out == 1: - return {name: "Successfully unregistered from {}".format(server_url)} + return {name: f"Successfully unregistered from {server_url}"} else: - return {name: "Failed to unregister from {}".format(server_url)} + return {name: f"Failed to unregister from {server_url}"} else: - return { - name: "System does not exist in spacewalk server ({})".format(server_url) - } + return {name: f"System does not exist in spacewalk server ({server_url})"} diff --git a/salt/runners/test.py b/salt/runners/test.py index 98df7fd4e11..b20e27c847c 100644 --- a/salt/runners/test.py +++ b/salt/runners/test.py @@ -116,9 +116,7 @@ def stream(): """ ret = True for i in range(1, 100): - __jid_event__.fire_event( - {"message": "Runner is {}% done".format(i)}, "progress" - ) + __jid_event__.fire_event({"message": f"Runner is {i}% done"}, "progress") time.sleep(0.1) return ret diff --git a/salt/runners/vault.py b/salt/runners/vault.py index 12225aea361..14aa9ff07b1 100644 --- a/salt/runners/vault.py +++ b/salt/runners/vault.py @@ -216,15 +216,15 @@ def _validate_signature(minion_id, signature, impersonated_by_master): """ pki_dir = __opts__["pki_dir"] if impersonated_by_master: - public_key = "{}/master.pub".format(pki_dir) + public_key = f"{pki_dir}/master.pub" else: - public_key = "{}/minions/{}".format(pki_dir, minion_id) + public_key = f"{pki_dir}/minions/{minion_id}" log.trace("Validating signature for %s", minion_id) signature = base64.b64decode(signature) if not salt.crypt.verify_signature(public_key, minion_id, signature): raise salt.exceptions.AuthenticationError( - "Could not validate token request from {}".format(minion_id) + f"Could not validate token request from {minion_id}" ) log.trace("Signature ok") @@ -354,7 +354,7 @@ def _selftoken_expired(): return False except Exception as e: # pylint: disable=broad-except raise salt.exceptions.CommandExecutionError( - "Error while looking up self token : {}".format(str(e)) + f"Error while looking up self token : {str(e)}" ) diff --git a/salt/runners/venafiapi.py b/salt/runners/venafiapi.py index 23118ee8f7a..e5794f906dd 100644 --- a/salt/runners/venafiapi.py +++ b/salt/runners/venafiapi.py @@ -138,9 +138,7 @@ def request( csr = csr_file.read() request = CertificateRequest(csr=csr, common_name=dns_name) except Exception as e: - raise Exception( - "Unable to open file {file}: {excp}".format(file=csr_path, excp=e) - ) + raise Exception(f"Unable to open file {csr_path}: {e}") conn.request_cert(request, zone) # TODO: add timeout parameter here @@ -160,9 +158,7 @@ def request( with salt.utils.files.fopen(pkey_path) as pkey_file: private_key = pkey_file.read() except Exception as e: - raise Exception( - "Unable to open file {file}: {excp}".format(file=pkey_path, excp=e) - ) + raise Exception(f"Unable to open file {pkey_path}: {e}") else: private_key = None diff --git a/salt/runners/virt.py b/salt/runners/virt.py index 317a7206068..669ded40137 100644 --- a/salt/runners/virt.py +++ b/salt/runners/virt.py @@ -246,7 +246,7 @@ def init( if "vm_info" in data[node]: if name in data[node]["vm_info"]: __jid_event__.fire_event( - {"message": "Virtual machine {} is already deployed".format(name)}, + {"message": f"Virtual machine {name} is already deployed"}, "progress", ) return "fail" @@ -255,9 +255,7 @@ def init( host = _determine_host(data) if host not in data or not host: - __jid_event__.fire_event( - {"message": "Host {} was not found".format(host)}, "progress" - ) + __jid_event__.fire_event({"message": f"Host {host} was not found"}, "progress") return "fail" pub_key = None @@ -272,7 +270,7 @@ def init( with salt.client.get_local_client(__opts__["conf_file"]) as client: __jid_event__.fire_event( - {"message": "Creating VM {} on host {}".format(name, host)}, "progress" + {"message": f"Creating VM {name} on host {host}"}, "progress" ) try: cmd_ret = client.cmd_iter( @@ -304,7 +302,7 @@ def init( ret = next(cmd_ret) if not ret: __jid_event__.fire_event( - {"message": "VM {} was not initialized.".format(name)}, "progress" + {"message": f"VM {name} was not initialized."}, "progress" ) return "fail" for minion_id in ret: @@ -317,7 +315,7 @@ def init( return "fail" __jid_event__.fire_event( - {"message": "VM {} initialized on host {}".format(name, host)}, "progress" + {"message": f"VM {name} initialized on host {host}"}, "progress" ) return "good" @@ -339,7 +337,7 @@ def reset(name): data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event( - {"message": "Failed to find VM {} to reset".format(name)}, "progress" + {"message": f"Failed to find VM {name} to reset"}, "progress" ) return "fail" host = next(iter(data.keys())) @@ -347,9 +345,7 @@ def reset(name): cmd_ret = client.cmd_iter(host, "virt.reset", [name], timeout=600) for comp in cmd_ret: ret.update(comp) - __jid_event__.fire_event( - {"message": "Reset VM {}".format(name)}, "progress" - ) + __jid_event__.fire_event({"message": f"Reset VM {name}"}, "progress") except SaltClientError as client_error: print(client_error) return ret @@ -364,20 +360,20 @@ def start(name): data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event( - {"message": "Failed to find VM {} to start".format(name)}, "progress" + {"message": f"Failed to find VM {name} to start"}, "progress" ) return "fail" host = next(iter(data.keys())) if data[host][name]["state"] == "running": - print("VM {} is already running".format(name)) + print(f"VM {name} is already running") return "bad state" try: cmd_ret = client.cmd_iter(host, "virt.start", [name], timeout=600) except SaltClientError as client_error: - return "Virtual machine {} not started: {}".format(name, client_error) + return f"Virtual machine {name} not started: {client_error}" for comp in cmd_ret: ret.update(comp) - __jid_event__.fire_event({"message": "Started VM {}".format(name)}, "progress") + __jid_event__.fire_event({"message": f"Started VM {name}"}, "progress") return "good" @@ -389,11 +385,11 @@ def force_off(name): with salt.client.get_local_client(__opts__["conf_file"]) as client: data = vm_info(name, quiet=True) if not data: - print("Failed to find VM {} to destroy".format(name)) + print(f"Failed to find VM {name} to destroy") return "fail" host = next(iter(data.keys())) if data[host][name]["state"] == "shutdown": - print("VM {} is already shutdown".format(name)) + print(f"VM {name} is already shutdown") return "bad state" try: cmd_ret = client.cmd_iter(host, "virt.stop", [name], timeout=600) @@ -403,9 +399,7 @@ def force_off(name): ) for comp in cmd_ret: ret.update(comp) - __jid_event__.fire_event( - {"message": "Powered off VM {}".format(name)}, "progress" - ) + __jid_event__.fire_event({"message": f"Powered off VM {name}"}, "progress") return "good" @@ -418,7 +412,7 @@ def purge(name, delete_key=True): data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event( - {"error": "Failed to find VM {} to purge".format(name)}, "progress" + {"error": f"Failed to find VM {name} to purge"}, "progress" ) return "fail" host = next(iter(data.keys())) @@ -436,7 +430,7 @@ def purge(name, delete_key=True): log.debug("Deleting key %s", name) with salt.key.Key(__opts__) as skey: skey.delete_key(name) - __jid_event__.fire_event({"message": "Purged VM {}".format(name)}, "progress") + __jid_event__.fire_event({"message": f"Purged VM {name}"}, "progress") return "good" @@ -450,13 +444,13 @@ def pause(name): data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event( - {"error": "Failed to find VM {} to pause".format(name)}, "progress" + {"error": f"Failed to find VM {name} to pause"}, "progress" ) return "fail" host = next(iter(data.keys())) if data[host][name]["state"] == "paused": __jid_event__.fire_event( - {"error": "VM {} is already paused".format(name)}, "progress" + {"error": f"VM {name} is already paused"}, "progress" ) return "bad state" try: @@ -467,7 +461,7 @@ def pause(name): ) for comp in cmd_ret: ret.update(comp) - __jid_event__.fire_event({"message": "Paused VM {}".format(name)}, "progress") + __jid_event__.fire_event({"message": f"Paused VM {name}"}, "progress") return "good" @@ -480,14 +474,12 @@ def resume(name): data = vm_info(name, quiet=True) if not data: __jid_event__.fire_event( - {"error": "Failed to find VM {} to pause".format(name)}, "progress" + {"error": f"Failed to find VM {name} to pause"}, "progress" ) return "not found" host = next(iter(data.keys())) if data[host][name]["state"] != "paused": - __jid_event__.fire_event( - {"error": "VM {} is not paused".format(name)}, "progress" - ) + __jid_event__.fire_event({"error": f"VM {name} is not paused"}, "progress") return "bad state" try: cmd_ret = client.cmd_iter(host, "virt.resume", [name], timeout=600) @@ -497,7 +489,7 @@ def resume(name): ) for comp in cmd_ret: ret.update(comp) - __jid_event__.fire_event({"message": "Resumed VM {}".format(name)}, "progress") + __jid_event__.fire_event({"message": f"Resumed VM {name}"}, "progress") return "good" @@ -513,14 +505,14 @@ def migrate(name, target=""): origin_host = next(iter(origin_data)) except StopIteration: __jid_event__.fire_event( - {"error": "Named VM {} was not found to migrate".format(name)}, + {"error": f"Named VM {name} was not found to migrate"}, "progress", ) return "" disks = origin_data[origin_host][name]["disks"] if not origin_data: __jid_event__.fire_event( - {"error": "Named VM {} was not found to migrate".format(name)}, + {"error": f"Named VM {name} was not found to migrate"}, "progress", ) return "" @@ -528,7 +520,7 @@ def migrate(name, target=""): target = _determine_host(data, origin_host) if target not in data: __jid_event__.fire_event( - {"error": "Target host {} not found".format(origin_data)}, "progress" + {"error": f"Target host {origin_data} not found"}, "progress" ) return "" try: diff --git a/salt/runners/vistara.py b/salt/runners/vistara.py index ea2d708e354..bd594764919 100644 --- a/salt/runners/vistara.py +++ b/salt/runners/vistara.py @@ -94,7 +94,7 @@ def delete_device(name, safety_on=True): if not access_token: return "Vistara access token not available" - query_string = "dnsName:{}".format(name) + query_string = f"dnsName:{name}" devices = _search_devices(query_string, config["client_id"], access_token) @@ -123,7 +123,7 @@ def delete_device(name, safety_on=True): def _search_devices(query_string, client_id, access_token): - authstring = "Bearer {}".format(access_token) + authstring = f"Bearer {access_token}" headers = { "Authorization": authstring, @@ -134,7 +134,7 @@ def _search_devices(query_string, client_id, access_token): params = {"queryString": query_string} method = "GET" - url = "https://api.vistara.io/api/v2/tenants/{}/devices/search".format(client_id) + url = f"https://api.vistara.io/api/v2/tenants/{client_id}/devices/search" resp = salt.utils.http.query( url=url, method=method, header_dict=headers, params=params, opts=__opts__ @@ -152,7 +152,7 @@ def _search_devices(query_string, client_id, access_token): def _delete_resource(device_id, client_id, access_token): - authstring = "Bearer {}".format(access_token) + authstring = f"Bearer {access_token}" headers = { "Authorization": authstring, diff --git a/salt/runners/winrepo.py b/salt/runners/winrepo.py index 9e31040884c..856115d6642 100644 --- a/salt/runners/winrepo.py +++ b/salt/runners/winrepo.py @@ -241,7 +241,7 @@ def update_git_repos(opts=None, clean=False, masterless=False): winrepo.clear_old_remotes() winrepo.checkout() except Exception as exc: # pylint: disable=broad-except - msg = "Failed to update winrepo_remotes: {}".format(exc) + msg = f"Failed to update winrepo_remotes: {exc}" log.error(msg, exc_info_on_loglevel=logging.DEBUG) return msg ret.update(winrepo.winrepo_dirs) diff --git a/salt/scripts.py b/salt/scripts.py index dd3af6247fc..662104a7142 100644 --- a/salt/scripts.py +++ b/salt/scripts.py @@ -412,7 +412,7 @@ def salt_key(): _install_signal_handlers(client) client.run() except Exception as err: # pylint: disable=broad-except - sys.stderr.write("Error: {}\n".format(err)) + sys.stderr.write(f"Error: {err}\n") def salt_cp(): @@ -568,7 +568,7 @@ def salt_unity(): if len(sys.argv) < 2: msg = "Must pass in a salt command, available commands are:" for cmd in avail: - msg += "\n{}".format(cmd) + msg += f"\n{cmd}" print(msg) sys.exit(1) cmd = sys.argv[1] @@ -577,9 +577,9 @@ def salt_unity(): sys.argv[0] = "salt" s_fun = salt_main else: - sys.argv[0] = "salt-{}".format(cmd) + sys.argv[0] = f"salt-{cmd}" sys.argv.pop(1) - s_fun = getattr(sys.modules[__name__], "salt_{}".format(cmd)) + s_fun = getattr(sys.modules[__name__], f"salt_{cmd}") s_fun() diff --git a/salt/sdb/sqlite3.py b/salt/sdb/sqlite3.py index 28419060789..3aba762fe78 100644 --- a/salt/sdb/sqlite3.py +++ b/salt/sdb/sqlite3.py @@ -106,8 +106,8 @@ def _connect(profile): for sql in stmts: cur.execute(sql) elif profile.get("create_table", True): - cur.execute("CREATE TABLE {} (key text, value blob)".format(table)) - cur.execute("CREATE UNIQUE INDEX {} ON {} (key)".format(idx, table)) + cur.execute(f"CREATE TABLE {table} (key text, value blob)") + cur.execute(f"CREATE UNIQUE INDEX {idx} ON {table} (key)") except sqlite3.OperationalError: pass @@ -124,7 +124,7 @@ def set_(key, value, profile=None): value = memoryview(salt.utils.msgpack.packb(value)) q = profile.get( "set_query", - "INSERT OR REPLACE INTO {} VALUES (:key, :value)".format(table), + f"INSERT OR REPLACE INTO {table} VALUES (:key, :value)", ) conn.execute(q, {"key": key, "value": value}) conn.commit() @@ -138,7 +138,7 @@ def get(key, profile=None): if not profile: return None _, cur, table = _connect(profile) - q = profile.get("get_query", "SELECT value FROM {} WHERE key=:key".format(table)) + q = profile.get("get_query", f"SELECT value FROM {table} WHERE key=:key") res = cur.execute(q, {"key": key}) res = res.fetchone() if not res: diff --git a/salt/sdb/vault.py b/salt/sdb/vault.py index 6e99e267a45..ffc0949dbcb 100644 --- a/salt/sdb/vault.py +++ b/salt/sdb/vault.py @@ -64,7 +64,7 @@ def set_(key, value, profile=None): data = {"data": data} try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("POST", url, json=data) if response.status_code != 204: @@ -89,12 +89,12 @@ def get(key, profile=None): path = version2["data"] try: - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("GET", url) if response.status_code == 404: if version2["v2"]: path = version2["data"] + "/" + key - url = "v1/{}".format(path) + url = f"v1/{path}" response = __utils__["vault.make_request"]("GET", url) if response.status_code == 404: return None diff --git a/salt/serializers/configparser.py b/salt/serializers/configparser.py index cb9c820758c..96fdbcde282 100644 --- a/salt/serializers/configparser.py +++ b/salt/serializers/configparser.py @@ -54,7 +54,7 @@ def serialize(obj, **options): try: if not isinstance(obj, dict): raise TypeError( - "configparser can only serialize dictionaries, not {}".format(type(obj)) + f"configparser can only serialize dictionaries, not {type(obj)}" ) fp = options.pop("fp", None) cp = configparser.ConfigParser(**options) diff --git a/salt/serializers/yamlex.py b/salt/serializers/yamlex.py index ec77d2c7333..c1f68f1c07a 100644 --- a/salt/serializers/yamlex.py +++ b/salt/serializers/yamlex.py @@ -209,7 +209,7 @@ class Loader(BaseLoader): # pylint: disable=W0232 raise ConstructorError( None, None, - "expected a mapping node, but found {}".format(node.id), + f"expected a mapping node, but found {node.id}", node.start_mark, ) diff --git a/salt/spm/__init__.py b/salt/spm/__init__.py index 6738d108a6f..34649f6d087 100644 --- a/salt/spm/__init__.py +++ b/salt/spm/__init__.py @@ -136,7 +136,7 @@ class SPMClient: elif command == "close": self._close() else: - raise SPMInvocationError("Invalid command '{}'".format(command)) + raise SPMInvocationError(f"Invalid command '{command}'") except SPMException as exc: self.ui.error(str(exc)) @@ -144,7 +144,7 @@ class SPMClient: try: return getattr(getattr(self.pkgdb, self.db_prov), func)(*args, **kwargs) except AttributeError: - return self.pkgdb["{}.{}".format(self.db_prov, func)](*args, **kwargs) + return self.pkgdb[f"{self.db_prov}.{func}"](*args, **kwargs) def _pkgfiles_fun(self, func, *args, **kwargs): try: @@ -152,7 +152,7 @@ class SPMClient: *args, **kwargs ) except AttributeError: - return self.pkgfiles["{}.{}".format(self.files_prov, func)](*args, **kwargs) + return self.pkgfiles[f"{self.files_prov}.{func}"](*args, **kwargs) def _list(self, args): """ @@ -167,7 +167,7 @@ class SPMClient: elif command == "repos": self._repo_list(args) else: - raise SPMInvocationError("Invalid list command '{}'".format(command)) + raise SPMInvocationError(f"Invalid list command '{command}'") def _local(self, args): """ @@ -182,7 +182,7 @@ class SPMClient: elif command == "info": self._local_info(args) else: - raise SPMInvocationError("Invalid local command '{}'".format(command)) + raise SPMInvocationError(f"Invalid local command '{command}'") def _repo(self, args): """ @@ -201,7 +201,7 @@ class SPMClient: elif command == "create": self._create_repo(args) else: - raise SPMInvocationError("Invalid repo command '{}'".format(command)) + raise SPMInvocationError(f"Invalid repo command '{command}'") def _repo_packages(self, args, search=False): """ @@ -216,7 +216,7 @@ class SPMClient: release = repo_metadata[repo]["packages"][pkg]["info"]["release"] packages.append((pkg, version, release, repo)) for pkg in sorted(packages): - self.ui.status("{}\t{}-{}\t{}".format(pkg[0], pkg[1], pkg[2], pkg[3])) + self.ui.status(f"{pkg[0]}\t{pkg[1]}-{pkg[2]}\t{pkg[3]}") return packages def _repo_list(self, args): @@ -255,7 +255,7 @@ class SPMClient: pkg_name = comps[-1] formula_tar = tarfile.open(pkg, "r:bz2") - formula_ref = formula_tar.extractfile("{}/FORMULA".format(pkg_name)) + formula_ref = formula_tar.extractfile(f"{pkg_name}/FORMULA") formula_def = salt.utils.yaml.safe_load(formula_ref) file_map[pkg_name] = pkg @@ -267,7 +267,7 @@ class SPMClient: recommended.extend(re_) formula_tar.close() else: - raise SPMInvocationError("Package file {} not found".format(pkg)) + raise SPMInvocationError(f"Package file {pkg} not found") else: to_, op_, re_ = self._check_all_deps(pkg_name=pkg) to_install.extend(to_) @@ -385,7 +385,7 @@ class SPMClient: Starting with one package, check all packages for dependencies """ if pkg_file and not os.path.exists(pkg_file): - raise SPMInvocationError("Package file {} not found".format(pkg_file)) + raise SPMInvocationError(f"Package file {pkg_file} not found") self.repo_metadata = self._get_repo_metadata() if not formula_def: @@ -396,7 +396,7 @@ class SPMClient: formula_def = self.repo_metadata[repo]["packages"][pkg_name]["info"] if not formula_def: - raise SPMInvocationError("Unable to read formula for {}".format(pkg_name)) + raise SPMInvocationError(f"Unable to read formula for {pkg_name}") # Check to see if the package is already installed pkg_info = self._pkgdb_fun("info", pkg_name, self.db_conn) @@ -439,7 +439,7 @@ class SPMClient: pkg_info = self._pkgdb_fun("info", formula_def["name"]) msg = dep_pkg if isinstance(pkg_info, dict): - msg = "{} [Installed]".format(dep_pkg) + msg = f"{dep_pkg} [Installed]" optional_install.append(msg) if recommended: @@ -448,7 +448,7 @@ class SPMClient: pkg_info = self._pkgdb_fun("info", formula_def["name"]) msg = dep_pkg if isinstance(pkg_info, dict): - msg = "{} [Installed]".format(dep_pkg) + msg = f"{dep_pkg} [Installed]" recommended_install.append(msg) if needs: @@ -457,7 +457,7 @@ class SPMClient: pkg_info = self._pkgdb_fun("info", formula_def["name"]) msg = dep_pkg if isinstance(pkg_info, dict): - msg = "{} [Installed]".format(dep_pkg) + msg = f"{dep_pkg} [Installed]" return pkgs_to_install, optional_install, recommended_install @@ -465,16 +465,14 @@ class SPMClient: """ Install one individual package """ - self.ui.status("... installing {}".format(pkg_name)) + self.ui.status(f"... installing {pkg_name}") formula_tar = tarfile.open(pkg_file, "r:bz2") - formula_ref = formula_tar.extractfile("{}/FORMULA".format(pkg_name)) + formula_ref = formula_tar.extractfile(f"{pkg_name}/FORMULA") formula_def = salt.utils.yaml.safe_load(formula_ref) for field in ("version", "release", "summary", "description"): if field not in formula_def: - raise SPMPackageError( - "Invalid package: the {} was not found".format(field) - ) + raise SPMPackageError(f"Invalid package: the {field} was not found") pkg_files = formula_tar.getmembers() @@ -542,7 +540,7 @@ class SPMClient: digest = "" else: self._verbose( - "Installing file {} to {}".format(member.name, out_path), + f"Installing file {member.name} to {out_path}", log.trace, ) file_hash = hashlib.sha1() @@ -580,7 +578,7 @@ class SPMClient: Return a list of packages which need to be installed, to resolve all dependencies """ - pkg_info = self.pkgdb["{}.info".format(self.db_prov)](formula_def["name"]) + pkg_info = self.pkgdb[f"{self.db_prov}.info"](formula_def["name"]) if not isinstance(pkg_info, dict): pkg_info = {} @@ -592,7 +590,7 @@ class SPMClient: dep = dep.strip() if not dep: continue - if self.pkgdb["{}.info".format(self.db_prov)](dep): + if self.pkgdb[f"{self.db_prov}.info"](dep): continue if dep in self.avail_pkgs: @@ -757,13 +755,13 @@ class SPMClient: for spm_file in filenames: if not spm_file.endswith(".spm"): continue - spm_path = "{}/{}".format(repo_path, spm_file) + spm_path = f"{repo_path}/{spm_file}" if not tarfile.is_tarfile(spm_path): continue comps = spm_file.split("-") spm_name = "-".join(comps[:-2]) spm_fh = tarfile.open(spm_path, "r:bz2") - formula_handle = spm_fh.extractfile("{}/FORMULA".format(spm_name)) + formula_handle = spm_fh.extractfile(f"{spm_name}/FORMULA") formula_conf = salt.utils.yaml.safe_load(formula_handle.read()) use_formula = True @@ -815,7 +813,7 @@ class SPMClient: } repo_metadata[spm_name]["filename"] = spm_file - metadata_filename = "{}/SPM-METADATA".format(repo_path) + metadata_filename = f"{repo_path}/SPM-METADATA" with salt.utils.files.fopen(metadata_filename, "w") as mfh: salt.utils.yaml.safe_dump( repo_metadata, @@ -868,7 +866,7 @@ class SPMClient: self.ui.confirm(msg) for package in packages: - self.ui.status("... removing {}".format(package)) + self.ui.status(f"... removing {package}") if not self._pkgdb_fun("db_exists", self.opts["spm_db"]): raise SPMDatabaseError( @@ -880,7 +878,7 @@ class SPMClient: # Look at local repo index pkg_info = self._pkgdb_fun("info", package, self.db_conn) if pkg_info is None: - raise SPMInvocationError("Package {} not installed".format(package)) + raise SPMInvocationError(f"Package {package} not installed") # Find files that have not changed and remove them files = self._pkgdb_fun("list_files", package, self.db_conn) @@ -894,22 +892,22 @@ class SPMClient: "hash_file", filerow[0], file_hash, self.files_conn ) if filerow[1] == digest: - self._verbose("Removing file {}".format(filerow[0]), log.trace) + self._verbose(f"Removing file {filerow[0]}", log.trace) self._pkgfiles_fun("remove_file", filerow[0], self.files_conn) else: - self._verbose("Not removing file {}".format(filerow[0]), log.trace) + self._verbose(f"Not removing file {filerow[0]}", log.trace) self._pkgdb_fun("unregister_file", filerow[0], package, self.db_conn) # Clean up directories for dir_ in sorted(dirs, reverse=True): self._pkgdb_fun("unregister_file", dir_, package, self.db_conn) try: - self._verbose("Removing directory {}".format(dir_), log.trace) + self._verbose(f"Removing directory {dir_}", log.trace) os.rmdir(dir_) except OSError: # Leave directories in place that still have files in them self._verbose( - "Cannot remove directory {}, probably not empty".format(dir_), + f"Cannot remove directory {dir_}, probably not empty", log.trace, ) @@ -933,14 +931,14 @@ class SPMClient: pkg_file = args[1] if not os.path.exists(pkg_file): - raise SPMInvocationError("Package file {} not found".format(pkg_file)) + raise SPMInvocationError(f"Package file {pkg_file} not found") comps = pkg_file.split("-") comps = "-".join(comps[:-2]).split("/") name = comps[-1] formula_tar = tarfile.open(pkg_file, "r:bz2") - formula_ref = formula_tar.extractfile("{}/FORMULA".format(name)) + formula_ref = formula_tar.extractfile(f"{name}/FORMULA") formula_def = salt.utils.yaml.safe_load(formula_ref) self.ui.status(self._get_info(formula_def)) @@ -957,7 +955,7 @@ class SPMClient: pkg_info = self._pkgdb_fun("info", package, self.db_conn) if pkg_info is None: - raise SPMPackageError("package {} not installed".format(package)) + raise SPMPackageError(f"package {package} not installed") self.ui.status(self._get_info(pkg_info)) def _get_info(self, formula_def): @@ -1007,7 +1005,7 @@ class SPMClient: pkg_file = args[1] if not os.path.exists(pkg_file): - raise SPMPackageError("Package file {} not found".format(pkg_file)) + raise SPMPackageError(f"Package file {pkg_file} not found") formula_tar = tarfile.open(pkg_file, "r:bz2") pkg_files = formula_tar.getmembers() @@ -1037,7 +1035,7 @@ class SPMClient: files = self._pkgdb_fun("list_files", package, self.db_conn) if files is None: - raise SPMPackageError("package {} not installed".format(package)) + raise SPMPackageError(f"package {package} not installed") else: for file_ in files: if self.opts["verbose"]: @@ -1057,17 +1055,15 @@ class SPMClient: comps = self.abspath.split("/") self.relpath = comps[-1] - formula_path = "{}/FORMULA".format(self.abspath) + formula_path = f"{self.abspath}/FORMULA" if not os.path.exists(formula_path): - raise SPMPackageError("Formula file {} not found".format(formula_path)) + raise SPMPackageError(f"Formula file {formula_path} not found") with salt.utils.files.fopen(formula_path) as fp_: formula_conf = salt.utils.yaml.safe_load(fp_) for field in ("name", "version", "release", "summary", "description"): if field not in formula_conf: - raise SPMPackageError( - "Invalid package: a {} must be defined".format(field) - ) + raise SPMPackageError(f"Invalid package: a {field} must be defined") out_path = "{}/{}-{}-{}.spm".format( self.opts["spm_build_dir"], @@ -1094,8 +1090,8 @@ class SPMClient: formula_tar.addfile(formula_dir) for file_ in formula_conf["files"]: for ftype in FILE_TYPES: - if file_.startswith("{}|".format(ftype)): - file_ = file_.lstrip("{}|".format(ftype)) + if file_.startswith(f"{ftype}|"): + file_ = file_.lstrip(f"{ftype}|") formula_tar.add( os.path.join(os.getcwd(), file_), os.path.join(formula_conf["name"], file_), @@ -1118,7 +1114,7 @@ class SPMClient: ) formula_tar.close() - self.ui.status("Built package {}".format(out_path)) + self.ui.status(f"Built package {out_path}") def _exclude(self, member): """ @@ -1130,7 +1126,7 @@ class SPMClient: for item in self.opts["spm_build_exclude"]: if member.name.startswith("{}/{}".format(self.formula_conf["name"], item)): return None - elif member.name.startswith("{}/{}".format(self.abspath, item)): + elif member.name.startswith(f"{self.abspath}/{item}"): return None return member @@ -1152,7 +1148,7 @@ class SPMClient: blacklist, whitelist, input_data=data, - **template_vars + **template_vars, ) diff --git a/salt/spm/pkgdb/sqlite3.py b/salt/spm/pkgdb/sqlite3.py index 7d1634c3b76..c6c0fb1384f 100644 --- a/salt/spm/pkgdb/sqlite3.py +++ b/salt/spm/pkgdb/sqlite3.py @@ -193,7 +193,7 @@ def register_file(name, member, path, digest="", conn=None): "INSERT INTO files VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", ( name, - "{}/{}".format(path, member.path), + f"{path}/{member.path}", member.size, member.mode, digest, diff --git a/salt/spm/pkgfiles/local.py b/salt/spm/pkgfiles/local.py index 6eab896bf68..2b826a5d393 100644 --- a/salt/spm/pkgfiles/local.py +++ b/salt/spm/pkgfiles/local.py @@ -56,11 +56,11 @@ def check_existing(package, pkg_files, formula_def, conn=None): continue tld = formula_def.get("top_level_dir", package) - new_name = member.name.replace("{}/".format(package), "") + new_name = member.name.replace(f"{package}/", "") if not new_name.startswith(tld): continue - if member.name.startswith("{}/_".format(package)): + if member.name.startswith(f"{package}/_"): if node_type in ("master", "minion"): # Module files are distributed via extmods directory out_file = os.path.join( @@ -72,9 +72,9 @@ def check_existing(package, pkg_files, formula_def, conn=None): else: # Module files are distributed via _modules, _states, etc out_file = os.path.join(conn["formula_path"], new_name) - elif member.name == "{}/pillar.example".format(package): + elif member.name == f"{package}/pillar.example": # Pillars are automatically put in the pillar_path - new_name = "{}.sls.orig".format(package) + new_name = f"{package}.sls.orig" out_file = os.path.join(conn["pillar_path"], new_name) elif package.endswith("-conf"): # Configuration files go into /etc/salt/ @@ -108,7 +108,7 @@ def install_file(package, formula_tar, member, formula_def, conn=None): out_path = conn["formula_path"] tld = formula_def.get("top_level_dir", package) - new_name = member.name.replace("{}/".format(package), "", 1) + new_name = member.name.replace(f"{package}/", "", 1) if ( not new_name.startswith(tld) and not new_name.startswith("_") @@ -121,7 +121,7 @@ def install_file(package, formula_tar, member, formula_def, conn=None): for line in formula_def.get("files", []): tag = "" for ftype in FILE_TYPES: - if line.startswith("{}|".format(ftype)): + if line.startswith(f"{ftype}|"): tag = line.split("|", 1)[0] line = line.split("|", 1)[1] if tag and new_name == line: @@ -130,10 +130,10 @@ def install_file(package, formula_tar, member, formula_def, conn=None): elif tag in ("s", "m"): pass - if member.name.startswith("{}{}_".format(package, os.sep)): + if member.name.startswith(f"{package}{os.sep}_"): if node_type in ("master", "minion"): # Module files are distributed via extmods directory - member.name = new_name.replace("{}{}_".format(package, os.sep), "") + member.name = new_name.replace(f"{package}{os.sep}_", "") out_path = os.path.join( salt.syspaths.CACHE_DIR, node_type, @@ -141,14 +141,14 @@ def install_file(package, formula_tar, member, formula_def, conn=None): ) else: # Module files are distributed via _modules, _states, etc - member.name = new_name.replace("{}{}".format(package, os.sep), "") - elif member.name == "{}/pillar.example".format(package): + member.name = new_name.replace(f"{package}{os.sep}", "") + elif member.name == f"{package}/pillar.example": # Pillars are automatically put in the pillar_path - member.name = "{}.sls.orig".format(package) + member.name = f"{package}.sls.orig" out_path = conn["pillar_path"] elif package.endswith("-conf"): # Configuration files go into /etc/salt/ - member.name = member.name.replace("{}/".format(package), "") + member.name = member.name.replace(f"{package}/", "") out_path = salt.syspaths.CONFIG_DIR elif package.endswith("-reactor"): # Reactor files go into /srv/reactor/ diff --git a/salt/state.py b/salt/state.py index 08198e7f54f..250b46da4f4 100644 --- a/salt/state.py +++ b/salt/state.py @@ -156,8 +156,8 @@ def _clean_tag(tag): def _l_tag(name, id_): low = { - "name": "listen_{}".format(name), - "__id__": "listen_{}".format(id_), + "name": f"listen_{name}", + "__id__": f"listen_{id_}", "state": "Listen_Error", "fun": "Listen_Error", } @@ -1094,7 +1094,7 @@ class State: return ret elif isinstance(entry, dict): if "fun" not in entry: - ret["comment"] = "no `fun` argument in onlyif: {}".format(entry) + ret["comment"] = f"no `fun` argument in onlyif: {entry}" log.warning(ret["comment"]) return ret @@ -1172,7 +1172,7 @@ class State: return ret elif isinstance(entry, dict): if "fun" not in entry: - ret["comment"] = "no `fun` argument in unless: {}".format(entry) + ret["comment"] = f"no `fun` argument in unless: {entry}" log.warning(ret["comment"]) return ret @@ -1428,9 +1428,9 @@ class State: ) reason = self.states.missing_fun_string(full) if reason: - errors.append("Reason: {}".format(reason)) + errors.append(f"Reason: {reason}") else: - errors.append("Specified state '{}' was not found".format(full)) + errors.append(f"Specified state '{full}' was not found") else: # First verify that the parameters are met aspec = salt.utils.args.get_function_argspec(self.states[full]) @@ -2163,7 +2163,7 @@ class State: "result": False, "name": name, "changes": {}, - "comment": "An exception occurred in this state: {}".format(trb), + "comment": f"An exception occurred in this state: {trb}", } utc_finish_time = datetime.datetime.utcnow() @@ -2269,7 +2269,7 @@ class State: proc = salt.utils.process.Process( target=self._call_parallel_target, args=(instance, self._init_kwargs, name, cdata, low), - name="ParallelState({})".format(name), + name=f"ParallelState({name})", ) proc.start() ret = { @@ -2305,7 +2305,7 @@ class State: "comment": "", } for err in errors: - ret["comment"] += "{}\n".format(err) + ret["comment"] += f"{err}\n" ret["__run_num__"] = self.__run_num self.__run_num += 1 format_log(ret) @@ -2452,7 +2452,7 @@ class State: "result": False, "name": name, "changes": {}, - "comment": "An exception occurred in this state: {}".format(trb), + "comment": f"An exception occurred in this state: {trb}", } finally: if low.get("__prereq__"): @@ -3466,7 +3466,7 @@ class State: lkey, lval ) ), - "name": "listen_{}:{}".format(lkey, lval), + "name": f"listen_{lkey}:{lval}", "result": False, "changes": {}, } @@ -3581,9 +3581,7 @@ class State: return high, errors if not isinstance(high, dict): - errors.append( - "Template {} does not render to a dictionary".format(template) - ) + errors.append(f"Template {template} does not render to a dictionary") return high, errors invalid_items = ("include", "exclude", "extends") @@ -3968,10 +3966,10 @@ class BaseHighState: """ merging_strategy = self.opts["top_file_merging_strategy"] try: - merge_attr = "_merge_tops_{}".format(merging_strategy) + merge_attr = f"_merge_tops_{merging_strategy}" merge_func = getattr(self, merge_attr) if not hasattr(merge_func, "__call__"): - msg = "'{}' is not callable".format(merge_attr) + msg = f"'{merge_attr}' is not callable" log.error(msg) raise TypeError(msg) except (AttributeError, TypeError): @@ -4299,7 +4297,7 @@ class BaseHighState: fn_ = sls if not os.path.isfile(fn_): errors.append( - "Specified SLS {} on local filesystem cannot be found.".format(sls) + f"Specified SLS {sls} on local filesystem cannot be found." ) state = None if not fn_: @@ -4322,25 +4320,25 @@ class BaseHighState: context=context, ) except SaltRenderError as exc: - msg = "Rendering SLS '{}:{}' failed: {}".format(saltenv, sls, exc) + msg = f"Rendering SLS '{saltenv}:{sls}' failed: {exc}" log.critical(msg) errors.append(msg) except Exception as exc: # pylint: disable=broad-except - msg = "Rendering SLS {} failed, render error: {}".format(sls, exc) + msg = f"Rendering SLS {sls} failed, render error: {exc}" log.critical( msg, # Show the traceback if the debug logging level is enabled exc_info_on_loglevel=logging.DEBUG, ) - errors.append("{}\n{}".format(msg, traceback.format_exc())) + errors.append(f"{msg}\n{traceback.format_exc()}") try: - mods.add("{}:{}".format(saltenv, sls)) + mods.add(f"{saltenv}:{sls}") except AttributeError: pass if state: if not isinstance(state, dict): - errors.append("SLS {} does not render to a dictionary".format(sls)) + errors.append(f"SLS {sls} does not render to a dictionary") else: include = [] if "include" in state: @@ -4443,7 +4441,7 @@ class BaseHighState: r_env = ( resolved_envs[0] if len(resolved_envs) == 1 else saltenv ) - mod_tgt = "{}:{}".format(r_env, sls_target) + mod_tgt = f"{r_env}:{sls_target}" if mod_tgt not in mods: nstate, err = self.render_state( sls_target, @@ -4545,7 +4543,7 @@ class BaseHighState: comps[0]: [comps[1]], } continue - errors.append("ID {} in SLS {} is not a dictionary".format(name, sls)) + errors.append(f"ID {name} in SLS {sls} is not a dictionary") continue skeys = set() for key in list(state[name]): @@ -4589,9 +4587,7 @@ class BaseHighState: if "extend" in state: ext = state.pop("extend") if not isinstance(ext, dict): - errors.append( - "Extension value in SLS '{}' is not a dictionary".format(sls) - ) + errors.append(f"Extension value in SLS '{sls}' is not a dictionary") return for name in ext: if not isinstance(ext[name], dict): @@ -4658,7 +4654,7 @@ class BaseHighState: statefiles = [sls_match] for sls in statefiles: - r_env = "{}:{}".format(saltenv, sls) + r_env = f"{saltenv}:{sls}" if r_env in mods: continue state, errors = self.render_state( @@ -4669,7 +4665,7 @@ class BaseHighState: for i, error in enumerate(errors[:]): if "is not available" in error: # match SLS foobar in environment - this_sls = "SLS {} in saltenv".format(sls_match) + this_sls = f"SLS {sls_match} in saltenv" if this_sls in error: errors[i] = ( "No matching sls found for '{}' in env '{}'".format( @@ -4714,7 +4710,7 @@ class BaseHighState: try: highstate.update(state) except ValueError: - errors.append("Error when rendering state with contents: {}".format(state)) + errors.append(f"Error when rendering state with contents: {state}") def _check_pillar(self, force=False): """ @@ -4767,7 +4763,7 @@ class BaseHighState: "__run_num__": 0, } } - cfn = os.path.join(self.opts["cachedir"], "{}.cache.p".format(cache_name)) + cfn = os.path.join(self.opts["cachedir"], f"{cache_name}.cache.p") if cache: if os.path.isfile(cfn): diff --git a/salt/states/acme.py b/salt/states/acme.py index 6cd9e165f6c..ae5a7a8399c 100644 --- a/salt/states/acme.py +++ b/salt/states/acme.py @@ -109,15 +109,13 @@ def cert( else: ret["result"] = True ret["comment"].append( - "Certificate {} exists and does not need renewal.".format(certname) + f"Certificate {certname} exists and does not need renewal." ) if action: if __opts__["test"]: ret["result"] = None - ret["comment"].append( - "Certificate {} would have been {}ed.".format(certname, action) - ) + ret["comment"].append(f"Certificate {certname} would have been {action}ed.") ret["changes"] = {"old": "current certificate", "new": "new certificate"} else: res = __salt__["acme.cert"]( diff --git a/salt/states/alias.py b/salt/states/alias.py index 6c2eb8959e1..48b153b5f6e 100644 --- a/salt/states/alias.py +++ b/salt/states/alias.py @@ -43,20 +43,20 @@ def present(name, target): ret = {"name": name, "changes": {}, "result": False, "comment": ""} if __salt__["aliases.has_target"](name, target): ret["result"] = True - ret["comment"] = "Alias {} already present".format(name) + ret["comment"] = f"Alias {name} already present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Alias {} -> {} is set to be added".format(name, target) + ret["comment"] = f"Alias {name} -> {target} is set to be added" return ret if __salt__["aliases.set_target"](name, target): ret["changes"] = {"alias": name} ret["result"] = True - ret["comment"] = "Set email alias {} -> {}".format(name, target) + ret["comment"] = f"Set email alias {name} -> {target}" return ret else: ret["result"] = False - ret["comment"] = "Failed to set alias {} -> {}".format(name, target) + ret["comment"] = f"Failed to set alias {name} -> {target}" return ret @@ -70,18 +70,18 @@ def absent(name): ret = {"name": name, "changes": {}, "result": False, "comment": ""} if not __salt__["aliases.get_target"](name): ret["result"] = True - ret["comment"] = "Alias {} already absent".format(name) + ret["comment"] = f"Alias {name} already absent" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Alias {} is set to be removed".format(name) + ret["comment"] = f"Alias {name} is set to be removed" return ret if __salt__["aliases.rm_alias"](name): ret["changes"] = {"alias": name} ret["result"] = True - ret["comment"] = "Removed alias {}".format(name) + ret["comment"] = f"Removed alias {name}" return ret else: ret["result"] = False - ret["comment"] = "Failed to remove alias {}".format(name) + ret["comment"] = f"Failed to remove alias {name}" return ret diff --git a/salt/states/alternatives.py b/salt/states/alternatives.py index de4e119c529..2f89516acbc 100644 --- a/salt/states/alternatives.py +++ b/salt/states/alternatives.py @@ -105,7 +105,7 @@ def install(name, link, path, priority): } else: ret["result"] = False - ret["comment"] = "Alternative for {} not installed: {}".format(name, out) + ret["comment"] = f"Alternative for {name} not installed: {out}" return ret @@ -128,7 +128,7 @@ def remove(name, path): isinstalled = __salt__["alternatives.check_exists"](name, path) if isinstalled: if __opts__["test"]: - ret["comment"] = "Alternative for {} will be removed".format(name) + ret["comment"] = f"Alternative for {name} will be removed" ret["result"] = None return ret __salt__["alternatives.remove"](name, path) @@ -143,7 +143,7 @@ def remove(name, path): ret["changes"] = {"path": current} return ret - ret["comment"] = "Alternative for {} removed".format(name) + ret["comment"] = f"Alternative for {name} removed" ret["changes"] = {} return ret @@ -156,7 +156,7 @@ def remove(name, path): return ret ret["result"] = False - ret["comment"] = "Alternative for {} doesn't exist".format(name) + ret["comment"] = f"Alternative for {name} doesn't exist" return ret @@ -178,11 +178,11 @@ def auto(name): display = __salt__["alternatives.display"](name) line = display.splitlines()[0] if line.endswith(" auto mode"): - ret["comment"] = "{} already in auto mode".format(name) + ret["comment"] = f"{name} already in auto mode" return ret if __opts__["test"]: - ret["comment"] = "{} will be put in auto mode".format(name) + ret["comment"] = f"{name} will be put in auto mode" ret["result"] = None return ret ret["changes"]["result"] = __salt__["alternatives.auto"](name) @@ -214,7 +214,7 @@ def set_(name, path): current = __salt__["alternatives.show_current"](name) if current == path: - ret["comment"] = "Alternative for {} already set to {}".format(name, path) + ret["comment"] = f"Alternative for {name} already set to {path}" return ret display = __salt__["alternatives.display"](name) @@ -234,15 +234,15 @@ def set_(name, path): __salt__["alternatives.set"](name, path) current = __salt__["alternatives.show_current"](name) if current == path: - ret["comment"] = "Alternative for {} set to path {}".format(name, current) + ret["comment"] = f"Alternative for {name} set to path {current}" ret["changes"] = {"path": current} else: - ret["comment"] = "Alternative for {} not updated".format(name) + ret["comment"] = f"Alternative for {name} not updated" return ret else: ret["result"] = False - ret["comment"] = "Alternative {} for {} doesn't exist".format(path, name) + ret["comment"] = f"Alternative {path} for {name} doesn't exist" return ret diff --git a/salt/states/ansiblegate.py b/salt/states/ansiblegate.py index 2ecc18f6e81..3de3dd5a36c 100644 --- a/salt/states/ansiblegate.py +++ b/salt/states/ansiblegate.py @@ -96,7 +96,7 @@ class AnsibleState: for mod_name, mod_params in kwargs.items(): args, kwargs = self.get_args(mod_params) try: - ans_mod_out = __salt__["ansible.{}".format(mod_name)]( + ans_mod_out = __salt__[f"ansible.{mod_name}"]( **{"__pub_arg": [args, kwargs]} ) except Exception as err: # pylint: disable=broad-except @@ -170,7 +170,7 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs= ret = { "result": False, "changes": {}, - "comment": "Running playbook {}".format(name), + "comment": f"Running playbook {name}", "name": name, } if git_repo: @@ -197,13 +197,13 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs= not check["changed"] and not check["failures"] and not check["unreachable"] for check in checks["stats"].values() ): - ret["comment"] = "No changes to be made from playbook {}".format(name) + ret["comment"] = f"No changes to be made from playbook {name}" ret["result"] = True elif any( check["changed"] and not check["failures"] and not check["unreachable"] for check in checks["stats"].values() ): - ret["comment"] = "Changes will be made from playbook {}".format(name) + ret["comment"] = f"Changes will be made from playbook {name}" ret["result"] = None ret["changes"] = _changes(checks) else: @@ -224,7 +224,7 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs= not check["changed"] and not check["failures"] and not check["unreachable"] for check in results["stats"].values() ): - ret["comment"] = "No changes to be made from playbook {}".format(name) + ret["comment"] = f"No changes to be made from playbook {name}" ret["result"] = True ret["changes"] = _changes(results) else: @@ -234,9 +234,7 @@ def playbooks(name, rundir=None, git_repo=None, git_kwargs=None, ansible_kwargs= for check in results["stats"].values() ) if ret["result"]: - ret["comment"] = "Changes were made by playbook {}".format(name) + ret["comment"] = f"Changes were made by playbook {name}" else: - ret["comment"] = ( - "There were some issues running the playbook {}".format(name) - ) + ret["comment"] = f"There were some issues running the playbook {name}" return ret diff --git a/salt/states/apache_conf.py b/salt/states/apache_conf.py index 3521ebbeb15..bda2eee00a8 100644 --- a/salt/states/apache_conf.py +++ b/salt/states/apache_conf.py @@ -40,7 +40,7 @@ def enabled(name): is_enabled = __salt__["apache.check_conf_enabled"](name) if not is_enabled: if __opts__["test"]: - msg = "Apache conf {} is set to be enabled.".format(name) + msg = f"Apache conf {name} is set to be enabled." ret["comment"] = msg ret["changes"]["old"] = None ret["changes"]["new"] = name @@ -53,12 +53,12 @@ def enabled(name): ret["changes"]["new"] = name else: ret["result"] = False - ret["comment"] = "Failed to enable {} Apache conf".format(name) + ret["comment"] = f"Failed to enable {name} Apache conf" if isinstance(status, str): - ret["comment"] = ret["comment"] + " ({})".format(status) + ret["comment"] = ret["comment"] + f" ({status})" return ret else: - ret["comment"] = "{} already enabled.".format(name) + ret["comment"] = f"{name} already enabled." return ret @@ -74,7 +74,7 @@ def disabled(name): is_enabled = __salt__["apache.check_conf_enabled"](name) if is_enabled: if __opts__["test"]: - msg = "Apache conf {} is set to be disabled.".format(name) + msg = f"Apache conf {name} is set to be disabled." ret["comment"] = msg ret["changes"]["old"] = name ret["changes"]["new"] = None @@ -87,10 +87,10 @@ def disabled(name): ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to disable {} Apache conf".format(name) + ret["comment"] = f"Failed to disable {name} Apache conf" if isinstance(status, str): - ret["comment"] = ret["comment"] + " ({})".format(status) + ret["comment"] = ret["comment"] + f" ({status})" return ret else: - ret["comment"] = "{} already disabled.".format(name) + ret["comment"] = f"{name} already disabled." return ret diff --git a/salt/states/apache_module.py b/salt/states/apache_module.py index a61de00223b..61b72dc0825 100644 --- a/salt/states/apache_module.py +++ b/salt/states/apache_module.py @@ -40,7 +40,7 @@ def enabled(name): is_enabled = __salt__["apache.check_mod_enabled"](name) if not is_enabled: if __opts__["test"]: - msg = "Apache module {} is set to be enabled.".format(name) + msg = f"Apache module {name} is set to be enabled." ret["comment"] = msg ret["changes"]["old"] = None ret["changes"]["new"] = name @@ -53,12 +53,12 @@ def enabled(name): ret["changes"]["new"] = name else: ret["result"] = False - ret["comment"] = "Failed to enable {} Apache module".format(name) + ret["comment"] = f"Failed to enable {name} Apache module" if isinstance(status, str): - ret["comment"] = ret["comment"] + " ({})".format(status) + ret["comment"] = ret["comment"] + f" ({status})" return ret else: - ret["comment"] = "{} already enabled.".format(name) + ret["comment"] = f"{name} already enabled." return ret @@ -76,7 +76,7 @@ def disabled(name): is_enabled = __salt__["apache.check_mod_enabled"](name) if is_enabled: if __opts__["test"]: - msg = "Apache module {} is set to be disabled.".format(name) + msg = f"Apache module {name} is set to be disabled." ret["comment"] = msg ret["changes"]["old"] = name ret["changes"]["new"] = None @@ -89,10 +89,10 @@ def disabled(name): ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to disable {} Apache module".format(name) + ret["comment"] = f"Failed to disable {name} Apache module" if isinstance(status, str): - ret["comment"] = ret["comment"] + " ({})".format(status) + ret["comment"] = ret["comment"] + f" ({status})" return ret else: - ret["comment"] = "{} already disabled.".format(name) + ret["comment"] = f"{name} already disabled." return ret diff --git a/salt/states/apache_site.py b/salt/states/apache_site.py index 6ba92b2a3cc..506e72bccfc 100644 --- a/salt/states/apache_site.py +++ b/salt/states/apache_site.py @@ -38,7 +38,7 @@ def enabled(name): is_enabled = __salt__["apache.check_site_enabled"](name) if not is_enabled: if __opts__["test"]: - msg = "Apache site {} is set to be enabled.".format(name) + msg = f"Apache site {name} is set to be enabled." ret["comment"] = msg ret["changes"]["old"] = None ret["changes"]["new"] = name @@ -51,12 +51,12 @@ def enabled(name): ret["changes"]["new"] = name else: ret["result"] = False - ret["comment"] = "Failed to enable {} Apache site".format(name) + ret["comment"] = f"Failed to enable {name} Apache site" if isinstance(status, str): - ret["comment"] = ret["comment"] + " ({})".format(status) + ret["comment"] = ret["comment"] + f" ({status})" return ret else: - ret["comment"] = "{} already enabled.".format(name) + ret["comment"] = f"{name} already enabled." return ret @@ -72,7 +72,7 @@ def disabled(name): is_enabled = __salt__["apache.check_site_enabled"](name) if is_enabled: if __opts__["test"]: - msg = "Apache site {} is set to be disabled.".format(name) + msg = f"Apache site {name} is set to be disabled." ret["comment"] = msg ret["changes"]["old"] = name ret["changes"]["new"] = None @@ -85,10 +85,10 @@ def disabled(name): ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to disable {} Apache site".format(name) + ret["comment"] = f"Failed to disable {name} Apache site" if isinstance(status, str): - ret["comment"] = ret["comment"] + " ({})".format(status) + ret["comment"] = ret["comment"] + f" ({status})" return ret else: - ret["comment"] = "{} already disabled.".format(name) + ret["comment"] = f"{name} already disabled." return ret diff --git a/salt/states/aptpkg.py b/salt/states/aptpkg.py index 7a285bfc913..0b196e3503e 100644 --- a/salt/states/aptpkg.py +++ b/salt/states/aptpkg.py @@ -35,18 +35,18 @@ def held(name): pattern=name, ) if not state: - ret.update(comment="Package {} does not have a state".format(name)) + ret.update(comment=f"Package {name} does not have a state") elif not salt.utils.data.is_true(state.get("hold", False)): if not __opts__["test"]: result = __salt__["pkg.set_selections"](selection={"hold": [name]}) ret.update( changes=result[name], result=True, - comment="Package {} is now being held".format(name), + comment=f"Package {name} is now being held", ) else: - ret.update(result=None, comment="Package {} is set to be held".format(name)) + ret.update(result=None, comment=f"Package {name} is set to be held") else: - ret.update(result=True, comment="Package {} is already held".format(name)) + ret.update(result=True, comment=f"Package {name} is already held") return ret diff --git a/salt/states/archive.py b/salt/states/archive.py index bf47864f542..e99556f1eaf 100644 --- a/salt/states/archive.py +++ b/salt/states/archive.py @@ -114,7 +114,7 @@ def _update_checksum(path): line[1] = hsum fp_.write("{}:{}\n".format(*line)) if hash_type not in [x[0] for x in lines]: - fp_.write("{}:{}\n".format(hash_type, hsum)) + fp_.write(f"{hash_type}:{hsum}\n") except OSError as exc: log.warning( "Failed to update checksum for %s: %s", @@ -190,7 +190,7 @@ def extracted( enforce_ownership_on=None, archive_format=None, use_etag=False, - **kwargs + **kwargs, ): """ .. versionadded:: 2014.1.0 @@ -737,7 +737,7 @@ def extracted( keep_source = True if not _path_is_abs(name): - ret["comment"] = "{} is not an absolute path".format(name) + ret["comment"] = f"{name} is not an absolute path" return ret else: if not name: @@ -755,7 +755,7 @@ def extracted( # False name = name.rstrip(os.sep) if os.path.isfile(name): - ret["comment"] = "{} exists and is not a directory".format(name) + ret["comment"] = f"{name} exists and is not a directory" return ret # Add back the slash so that file.makedirs properly creates the # destdir if it needs to be created. file.makedirs expects a trailing @@ -781,13 +781,13 @@ def extracted( not_rel = True if not_rel: ret["comment"] = ( - "Value for 'enforce_ownership_on' must be within {}".format(name) + f"Value for 'enforce_ownership_on' must be within {name}" ) return ret if if_missing is not None and os.path.exists(if_missing): ret["result"] = True - ret["comment"] = "Path {} exists".format(if_missing) + ret["comment"] = f"Path {if_missing} exists" return ret if user or group: @@ -800,7 +800,7 @@ def extracted( if user: uid = __salt__["file.user_to_uid"](user) if uid == "": - ret["comment"] = "User {} does not exist".format(user) + ret["comment"] = f"User {user} does not exist" return ret else: uid = -1 @@ -808,7 +808,7 @@ def extracted( if group: gid = __salt__["file.group_to_gid"](group) if gid == "": - ret["comment"] = "Group {} does not exist".format(group) + ret["comment"] = f"Group {group} does not exist" return ret else: gid = -1 @@ -833,7 +833,7 @@ def extracted( if not source_match: ret["result"] = False - ret["comment"] = 'Invalid source "{}"'.format(source) + ret["comment"] = f'Invalid source "{source}"' return ret urlparsed_source = urlparse(source_match) @@ -1153,7 +1153,7 @@ def extracted( ) for error in errors: - msg += "\n- {}".format(error) + msg += f"\n- {error}" ret["comment"] = msg return ret @@ -1241,9 +1241,7 @@ def extracted( return ret if incorrect_type: - incorrect_paths = "\n\n" + "\n".join( - ["- {}".format(x) for x in incorrect_type] - ) + incorrect_paths = "\n\n" + "\n".join([f"- {x}" for x in incorrect_type]) ret["comment"] = ( "The below paths (relative to {}) exist, but are the " "incorrect type (file instead of directory, symlink " @@ -1297,7 +1295,7 @@ def extracted( "following errors were observed:\n" ) for error in errors: - msg += "\n- {}".format(error) + msg += f"\n- {error}" ret["comment"] = msg return ret @@ -1343,7 +1341,7 @@ def extracted( salt.utils.files.rm_rf(name.rstrip(os.sep)) ret["changes"].setdefault( "removed", - "Directory {} was removed prior to the extraction".format(name), + f"Directory {name} was removed prior to the extraction", ) except OSError as exc: if exc.errno != errno.ENOENT: @@ -1354,7 +1352,7 @@ def extracted( "errors were observed:\n".format(name) ) for error in errors: - msg += "\n- {}".format(error) + msg += f"\n- {error}" ret["comment"] = msg return ret @@ -1377,7 +1375,7 @@ def extracted( "errors were observed:\n" ) for error in errors: - msg += "\n- {}".format(error) + msg += f"\n- {error}" ret["comment"] = msg return ret @@ -1396,7 +1394,7 @@ def extracted( options=options, trim_output=trim_output, password=password, - **kwargs + **kwargs, ) except (CommandExecutionError, CommandNotFoundError) as exc: ret["comment"] = exc.strerror @@ -1409,7 +1407,7 @@ def extracted( trim_output=trim_output, password=password, extract_perms=extract_perms, - **kwargs + **kwargs, ) elif archive_format == "rar": try: @@ -1661,7 +1659,7 @@ def extracted( else: ret["result"] = True if if_missing_path_exists: - ret["comment"] = "{} exists".format(if_missing) + ret["comment"] = f"{if_missing} exists" else: ret["comment"] = "All files in archive are already present" if __opts__["test"]: @@ -1686,7 +1684,7 @@ def extracted( "paths were missing:\n" ) for item in enforce_missing: - ret["comment"] += "\n- {}".format(item) + ret["comment"] += f"\n- {item}" if enforce_failed: ret["result"] = False @@ -1695,7 +1693,7 @@ def extracted( "unable to change ownership on the following paths:\n" ) for item in enforce_failed: - ret["comment"] += "\n- {}".format(item) + ret["comment"] += f"\n- {item}" if not source_is_local: if keep_source: diff --git a/salt/states/at.py b/salt/states/at.py index 09b2fd0e423..5d211f7f7d3 100644 --- a/salt/states/at.py +++ b/salt/states/at.py @@ -74,7 +74,7 @@ def present(name, timespec, tag=None, user=None, job=None, unique_tag=False): ret["comment"] = "no tag provided and unique_tag is set to True" return ret elif len(__salt__["at.jobcheck"](tag=tag)["jobs"]) > 0: - ret["comment"] = "atleast one job with tag {tag} exists.".format(tag=tag) + ret["comment"] = f"atleast one job with tag {tag} exists." return ret # create job @@ -82,7 +82,7 @@ def present(name, timespec, tag=None, user=None, job=None, unique_tag=False): luser = __salt__["user.info"](user) if not luser: ret["result"] = False - ret["comment"] = "user {} does not exists".format(user) + ret["comment"] = f"user {user} does not exists" return ret ret["comment"] = "job {} added and will run as {} on {}".format( job, @@ -176,7 +176,7 @@ def absent(name, jobid=None, **kwargs): # limit was never support if "limit" in kwargs: - ret["comment"] = "limit parameter not supported {}".format(name) + ret["comment"] = f"limit parameter not supported {name}" ret["result"] = False return ret @@ -191,7 +191,7 @@ def absent(name, jobid=None, **kwargs): jobs = __salt__["at.atq"](jobid) if "jobs" in jobs and len(jobs["jobs"]) == 0: ret["result"] = True - ret["comment"] = "job with id {jobid} not present".format(jobid=jobid) + ret["comment"] = f"job with id {jobid} not present" return ret elif "jobs" in jobs and len(jobs["jobs"]) == 1: if "job" in jobs["jobs"][0] and jobs["jobs"][0]["job"]: diff --git a/salt/states/augeas.py b/salt/states/augeas.py index 843f82c8ba2..c1b7cef99de 100644 --- a/salt/states/augeas.py +++ b/salt/states/augeas.py @@ -70,7 +70,7 @@ def _check_filepath(changes): cmd, arg = change_.split(" ", 1) if cmd not in METHOD_MAP: - error = "Command {} is not supported (yet)".format(cmd) + error = f"Command {cmd} is not supported (yet)" raise ValueError(error) method = METHOD_MAP[cmd] parts = salt.utils.args.shlex_split(arg) @@ -276,7 +276,7 @@ def change(name, context=None, changes=None, lens=None, load_path=None, **kwargs try: filename = _check_filepath(changes) except ValueError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret else: filename = re.sub("^/files|/$", "", context) @@ -285,7 +285,7 @@ def change(name, context=None, changes=None, lens=None, load_path=None, **kwargs ret["result"] = True ret["comment"] = "Executing commands" if context: - ret["comment"] += ' in file "{}":\n'.format(context) + ret["comment"] += f' in file "{context}":\n' ret["comment"] += "\n".join(changes) return ret diff --git a/salt/states/aws_sqs.py b/salt/states/aws_sqs.py index 42b8a5eb996..68370410ef2 100644 --- a/salt/states/aws_sqs.py +++ b/salt/states/aws_sqs.py @@ -48,7 +48,7 @@ def exists(name, region, user=None, opts=False): if not does_exist: if __opts__["test"]: ret["result"] = None - ret["comment"] = "AWS SQS queue {} is set to be created".format(name) + ret["comment"] = f"AWS SQS queue {name} is set to be created" return ret created = __salt__["aws_sqs.create_queue"](name, region, opts, user) if created["retcode"] == 0: @@ -58,7 +58,7 @@ def exists(name, region, user=None, opts=False): ret["comment"] = created["stderr"] else: - ret["comment"] = "{} exists in {}".format(name, region) + ret["comment"] = f"{name} exists in {region}" return ret @@ -86,7 +86,7 @@ def absent(name, region, user=None, opts=False): if does_exist: if __opts__["test"]: ret["result"] = None - ret["comment"] = "AWS SQS queue {} is set to be removed".format(name) + ret["comment"] = f"AWS SQS queue {name} is set to be removed" return ret removed = __salt__["aws_sqs.delete_queue"](name, region, opts, user) if removed["retcode"] == 0: @@ -95,6 +95,6 @@ def absent(name, region, user=None, opts=False): ret["result"] = False ret["comment"] = removed["stderr"] else: - ret["comment"] = "{} does not exist in {}".format(name, region) + ret["comment"] = f"{name} does not exist in {region}" return ret diff --git a/salt/states/azurearm_compute.py b/salt/states/azurearm_compute.py index bfdd2dd925a..7b46a95b14f 100644 --- a/salt/states/azurearm_compute.py +++ b/salt/states/azurearm_compute.py @@ -142,7 +142,7 @@ def availability_set_present( virtual_machines=None, sku=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -254,12 +254,12 @@ def availability_set_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Availability set {} is already present.".format(name) + ret["comment"] = f"Availability set {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Availability set {} would be updated.".format(name) + ret["comment"] = f"Availability set {name} would be updated." return ret else: @@ -276,7 +276,7 @@ def availability_set_present( } if __opts__["test"]: - ret["comment"] = "Availability set {} would be created.".format(name) + ret["comment"] = f"Availability set {name} would be created." ret["result"] = None return ret @@ -291,12 +291,12 @@ def availability_set_present( platform_fault_domain_count=platform_fault_domain_count, sku=sku, tags=tags, - **aset_kwargs + **aset_kwargs, ) if "error" not in aset: ret["result"] = True - ret["comment"] = "Availability set {} has been created.".format(name) + ret["comment"] = f"Availability set {name} has been created." return ret ret["comment"] = "Failed to create availability set {}! ({})".format( @@ -336,11 +336,11 @@ def availability_set_absent(name, resource_group, connection_auth=None): if "error" in aset: ret["result"] = True - ret["comment"] = "Availability set {} was not found.".format(name) + ret["comment"] = f"Availability set {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Availability set {} would be deleted.".format(name) + ret["comment"] = f"Availability set {name} would be deleted." ret["result"] = None ret["changes"] = { "old": aset, @@ -354,9 +354,9 @@ def availability_set_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Availability set {} has been deleted.".format(name) + ret["comment"] = f"Availability set {name} has been deleted." ret["changes"] = {"old": aset, "new": {}} return ret - ret["comment"] = "Failed to delete availability set {}!".format(name) + ret["comment"] = f"Failed to delete availability set {name}!" return ret diff --git a/salt/states/azurearm_dns.py b/salt/states/azurearm_dns.py index 6002d24a821..91a1bd121c0 100644 --- a/salt/states/azurearm_dns.py +++ b/salt/states/azurearm_dns.py @@ -169,7 +169,7 @@ def zone_present( tags=None, zone_type="Public", connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 3000 @@ -304,12 +304,12 @@ def zone_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "DNS zone {} is already present.".format(name) + ret["comment"] = f"DNS zone {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "DNS zone {} would be updated.".format(name) + ret["comment"] = f"DNS zone {name} would be updated." return ret else: @@ -327,7 +327,7 @@ def zone_present( } if __opts__["test"]: - ret["comment"] = "DNS zone {} would be created.".format(name) + ret["comment"] = f"DNS zone {name} would be created." ret["result"] = None return ret @@ -344,12 +344,12 @@ def zone_present( resolution_virtual_networks=resolution_virtual_networks, tags=tags, zone_type=zone_type, - **zone_kwargs + **zone_kwargs, ) if "error" not in zone: ret["result"] = True - ret["comment"] = "DNS zone {} has been created.".format(name) + ret["comment"] = f"DNS zone {name} has been created." return ret ret["comment"] = "Failed to create DNS zone {}! ({})".format( @@ -389,11 +389,11 @@ def zone_absent(name, resource_group, connection_auth=None): if "error" in zone: ret["result"] = True - ret["comment"] = "DNS zone {} was not found.".format(name) + ret["comment"] = f"DNS zone {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "DNS zone {} would be deleted.".format(name) + ret["comment"] = f"DNS zone {name} would be deleted." ret["result"] = None ret["changes"] = { "old": zone, @@ -407,11 +407,11 @@ def zone_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "DNS zone {} has been deleted.".format(name) + ret["comment"] = f"DNS zone {name} has been deleted." ret["changes"] = {"old": zone, "new": {}} return ret - ret["comment"] = "Failed to delete DNS zone {}!".format(name) + ret["comment"] = f"Failed to delete DNS zone {name}!" return ret @@ -437,7 +437,7 @@ def record_set_present( soa_record=None, caa_records=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 3000 @@ -576,7 +576,7 @@ def record_set_present( resource_group, record_type, azurearm_log_level="info", - **connection_auth + **connection_auth, ) if "error" not in rec_set: @@ -632,12 +632,12 @@ def record_set_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Record set {} is already present.".format(name) + ret["comment"] = f"Record set {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Record set {} would be updated.".format(name) + ret["comment"] = f"Record set {name} would be updated." return ret else: @@ -660,7 +660,7 @@ def record_set_present( ret["changes"]["new"][record] = eval(record) if __opts__["test"]: - ret["comment"] = "Record set {} would be created.".format(name) + ret["comment"] = f"Record set {name} would be created." ret["result"] = None return ret @@ -687,12 +687,12 @@ def record_set_present( cname_record=cname_record, soa_record=soa_record, caa_records=caa_records, - **rec_set_kwargs + **rec_set_kwargs, ) if "error" not in rec_set: ret["result"] = True - ret["comment"] = "Record set {} has been created.".format(name) + ret["comment"] = f"Record set {name} has been created." return ret ret["comment"] = "Failed to create record set {}! ({})".format( @@ -741,7 +741,7 @@ def record_set_absent(name, zone_name, resource_group, connection_auth=None): return ret elif __opts__["test"]: - ret["comment"] = "Record set {} would be deleted.".format(name) + ret["comment"] = f"Record set {name} would be deleted." ret["result"] = None ret["changes"] = { "old": rec_set, @@ -755,9 +755,9 @@ def record_set_absent(name, zone_name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Record set {} has been deleted.".format(name) + ret["comment"] = f"Record set {name} has been deleted." ret["changes"] = {"old": rec_set, "new": {}} return ret - ret["comment"] = "Failed to delete record set {}!".format(name) + ret["comment"] = f"Failed to delete record set {name}!" return ret diff --git a/salt/states/azurearm_network.py b/salt/states/azurearm_network.py index 513206d95f2..ec872bec4c9 100644 --- a/salt/states/azurearm_network.py +++ b/salt/states/azurearm_network.py @@ -140,7 +140,7 @@ def virtual_network_present( dns_servers=None, tags=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -243,12 +243,12 @@ def virtual_network_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Virtual network {} is already present.".format(name) + ret["comment"] = f"Virtual network {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Virtual network {} would be updated.".format(name) + ret["comment"] = f"Virtual network {name} would be updated." return ret else: @@ -266,7 +266,7 @@ def virtual_network_present( } if __opts__["test"]: - ret["comment"] = "Virtual network {} would be created.".format(name) + ret["comment"] = f"Virtual network {name} would be created." ret["result"] = None return ret @@ -279,12 +279,12 @@ def virtual_network_present( address_prefixes=address_prefixes, dns_servers=dns_servers, tags=tags, - **vnet_kwargs + **vnet_kwargs, ) if "error" not in vnet: ret["result"] = True - ret["comment"] = "Virtual network {} has been created.".format(name) + ret["comment"] = f"Virtual network {name} has been created." return ret ret["comment"] = "Failed to create virtual network {}! ({})".format( @@ -324,11 +324,11 @@ def virtual_network_absent(name, resource_group, connection_auth=None): if "error" in vnet: ret["result"] = True - ret["comment"] = "Virtual network {} was not found.".format(name) + ret["comment"] = f"Virtual network {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Virtual network {} would be deleted.".format(name) + ret["comment"] = f"Virtual network {name} would be deleted." ret["result"] = None ret["changes"] = { "old": vnet, @@ -342,11 +342,11 @@ def virtual_network_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Virtual network {} has been deleted.".format(name) + ret["comment"] = f"Virtual network {name} has been deleted." ret["changes"] = {"old": vnet, "new": {}} return ret - ret["comment"] = "Failed to delete virtual network {}!".format(name) + ret["comment"] = f"Failed to delete virtual network {name}!" return ret @@ -359,7 +359,7 @@ def subnet_present( security_group=None, route_table=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -420,7 +420,7 @@ def subnet_present( virtual_network, resource_group, azurearm_log_level="info", - **connection_auth + **connection_auth, ) if "error" not in snet: @@ -449,12 +449,12 @@ def subnet_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Subnet {} is already present.".format(name) + ret["comment"] = f"Subnet {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Subnet {} would be updated.".format(name) + ret["comment"] = f"Subnet {name} would be updated." return ret else: @@ -469,7 +469,7 @@ def subnet_present( } if __opts__["test"]: - ret["comment"] = "Subnet {} would be created.".format(name) + ret["comment"] = f"Subnet {name} would be created." ret["result"] = None return ret @@ -483,12 +483,12 @@ def subnet_present( address_prefix=address_prefix, network_security_group=security_group, route_table=route_table, - **snet_kwargs + **snet_kwargs, ) if "error" not in snet: ret["result"] = True - ret["comment"] = "Subnet {} has been created.".format(name) + ret["comment"] = f"Subnet {name} has been created." return ret ret["comment"] = "Failed to create subnet {}! ({})".format(name, snet.get("error")) @@ -528,16 +528,16 @@ def subnet_absent(name, virtual_network, resource_group, connection_auth=None): virtual_network, resource_group, azurearm_log_level="info", - **connection_auth + **connection_auth, ) if "error" in snet: ret["result"] = True - ret["comment"] = "Subnet {} was not found.".format(name) + ret["comment"] = f"Subnet {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Subnet {} would be deleted.".format(name) + ret["comment"] = f"Subnet {name} would be deleted." ret["result"] = None ret["changes"] = { "old": snet, @@ -551,11 +551,11 @@ def subnet_absent(name, virtual_network, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Subnet {} has been deleted.".format(name) + ret["comment"] = f"Subnet {name} has been deleted." ret["changes"] = {"old": snet, "new": {}} return ret - ret["comment"] = "Failed to delete subnet {}!".format(name) + ret["comment"] = f"Failed to delete subnet {name}!" return ret @@ -661,7 +661,7 @@ def network_security_group_present( if __opts__["test"]: ret["result"] = None - ret["comment"] = "Network security group {} would be updated.".format(name) + ret["comment"] = f"Network security group {name} would be updated." return ret else: @@ -676,7 +676,7 @@ def network_security_group_present( } if __opts__["test"]: - ret["comment"] = "Network security group {} would be created.".format(name) + ret["comment"] = f"Network security group {name} would be created." ret["result"] = None return ret @@ -688,12 +688,12 @@ def network_security_group_present( resource_group=resource_group, tags=tags, security_rules=security_rules, - **nsg_kwargs + **nsg_kwargs, ) if "error" not in nsg: ret["result"] = True - ret["comment"] = "Network security group {} has been created.".format(name) + ret["comment"] = f"Network security group {name} has been created." return ret ret["comment"] = "Failed to create network security group {}! ({})".format( @@ -733,11 +733,11 @@ def network_security_group_absent(name, resource_group, connection_auth=None): if "error" in nsg: ret["result"] = True - ret["comment"] = "Network security group {} was not found.".format(name) + ret["comment"] = f"Network security group {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Network security group {} would be deleted.".format(name) + ret["comment"] = f"Network security group {name} would be deleted." ret["result"] = None ret["changes"] = { "old": nsg, @@ -751,11 +751,11 @@ def network_security_group_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Network security group {} has been deleted.".format(name) + ret["comment"] = f"Network security group {name} has been deleted." ret["changes"] = {"old": nsg, "new": {}} return ret - ret["comment"] = "Failed to delete network security group {}!".format(name) + ret["comment"] = f"Failed to delete network security group {name}!" return ret @@ -778,7 +778,7 @@ def security_rule_present( source_address_prefixes=None, source_port_ranges=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -897,17 +897,17 @@ def security_rule_present( if eval(params[0]): # pylint: disable=eval-used if not isinstance(eval(params[0]), list): - ret["comment"] = "The {} parameter must be a list!".format(params[0]) + ret["comment"] = f"The {params[0]} parameter must be a list!" return ret # pylint: disable=exec-used - exec("{} = None".format(params[1])) + exec(f"{params[1]} = None") rule = __salt__["azurearm_network.security_rule_get"]( name, security_group, resource_group, azurearm_log_level="info", - **connection_auth + **connection_auth, ) if "error" not in rule: @@ -1037,12 +1037,12 @@ def security_rule_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Security rule {} is already present.".format(name) + ret["comment"] = f"Security rule {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Security rule {} would be updated.".format(name) + ret["comment"] = f"Security rule {name} would be updated." return ret else: @@ -1067,7 +1067,7 @@ def security_rule_present( } if __opts__["test"]: - ret["comment"] = "Security rule {} would be created.".format(name) + ret["comment"] = f"Security rule {name} would be created." ret["result"] = None return ret @@ -1091,12 +1091,12 @@ def security_rule_present( source_address_prefixes=source_address_prefixes, source_port_range=source_port_range, source_port_ranges=source_port_ranges, - **rule_kwargs + **rule_kwargs, ) if "error" not in rule: ret["result"] = True - ret["comment"] = "Security rule {} has been created.".format(name) + ret["comment"] = f"Security rule {name} has been created." return ret ret["comment"] = "Failed to create security rule {}! ({})".format( @@ -1138,16 +1138,16 @@ def security_rule_absent(name, security_group, resource_group, connection_auth=N security_group, resource_group, azurearm_log_level="info", - **connection_auth + **connection_auth, ) if "error" in rule: ret["result"] = True - ret["comment"] = "Security rule {} was not found.".format(name) + ret["comment"] = f"Security rule {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Security rule {} would be deleted.".format(name) + ret["comment"] = f"Security rule {name} would be deleted." ret["result"] = None ret["changes"] = { "old": rule, @@ -1161,11 +1161,11 @@ def security_rule_absent(name, security_group, resource_group, connection_auth=N if deleted: ret["result"] = True - ret["comment"] = "Security rule {} has been deleted.".format(name) + ret["comment"] = f"Security rule {name} has been deleted." ret["changes"] = {"old": rule, "new": {}} return ret - ret["comment"] = "Failed to delete security rule {}!".format(name) + ret["comment"] = f"Failed to delete security rule {name}!" return ret @@ -1183,7 +1183,7 @@ def load_balancer_present( outbound_nat_rules=None, tags=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -1487,12 +1487,12 @@ def load_balancer_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Load balancer {} is already present.".format(name) + ret["comment"] = f"Load balancer {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Load balancer {} would be updated.".format(name) + ret["comment"] = f"Load balancer {name} would be updated." return ret else: @@ -1513,7 +1513,7 @@ def load_balancer_present( } if __opts__["test"]: - ret["comment"] = "Load balancer {} would be created.".format(name) + ret["comment"] = f"Load balancer {name} would be created." ret["result"] = None return ret @@ -1532,12 +1532,12 @@ def load_balancer_present( inbound_nat_rules=inbound_nat_rules, inbound_nat_pools=inbound_nat_pools, outbound_nat_rules=outbound_nat_rules, - **lb_kwargs + **lb_kwargs, ) if "error" not in load_bal: ret["result"] = True - ret["comment"] = "Load balancer {} has been created.".format(name) + ret["comment"] = f"Load balancer {name} has been created." return ret ret["comment"] = "Failed to create load balancer {}! ({})".format( @@ -1577,11 +1577,11 @@ def load_balancer_absent(name, resource_group, connection_auth=None): if "error" in load_bal: ret["result"] = True - ret["comment"] = "Load balancer {} was not found.".format(name) + ret["comment"] = f"Load balancer {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Load balancer {} would be deleted.".format(name) + ret["comment"] = f"Load balancer {name} would be deleted." ret["result"] = None ret["changes"] = { "old": load_bal, @@ -1595,11 +1595,11 @@ def load_balancer_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Load balancer {} has been deleted.".format(name) + ret["comment"] = f"Load balancer {name} has been deleted." ret["changes"] = {"old": load_bal, "new": {}} return ret - ret["comment"] = "Failed to delete load balancer {}!".format(name) + ret["comment"] = f"Failed to delete load balancer {name}!" return ret @@ -1614,7 +1614,7 @@ def public_ip_address_present( dns_settings=None, idle_timeout_in_minutes=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -1751,12 +1751,12 @@ def public_ip_address_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Public IP address {} is already present.".format(name) + ret["comment"] = f"Public IP address {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Public IP address {} would be updated.".format(name) + ret["comment"] = f"Public IP address {name} would be updated." return ret else: @@ -1774,7 +1774,7 @@ def public_ip_address_present( } if __opts__["test"]: - ret["comment"] = "Public IP address {} would be created.".format(name) + ret["comment"] = f"Public IP address {name} would be created." ret["result"] = None return ret @@ -1790,12 +1790,12 @@ def public_ip_address_present( public_ip_allocation_method=public_ip_allocation_method, public_ip_address_version=public_ip_address_version, idle_timeout_in_minutes=idle_timeout_in_minutes, - **pub_ip_kwargs + **pub_ip_kwargs, ) if "error" not in pub_ip: ret["result"] = True - ret["comment"] = "Public IP address {} has been created.".format(name) + ret["comment"] = f"Public IP address {name} has been created." return ret ret["comment"] = "Failed to create public IP address {}! ({})".format( @@ -1835,11 +1835,11 @@ def public_ip_address_absent(name, resource_group, connection_auth=None): if "error" in pub_ip: ret["result"] = True - ret["comment"] = "Public IP address {} was not found.".format(name) + ret["comment"] = f"Public IP address {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Public IP address {} would be deleted.".format(name) + ret["comment"] = f"Public IP address {name} would be deleted." ret["result"] = None ret["changes"] = { "old": pub_ip, @@ -1853,11 +1853,11 @@ def public_ip_address_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Public IP address {} has been deleted.".format(name) + ret["comment"] = f"Public IP address {name} has been deleted." ret["changes"] = {"old": pub_ip, "new": {}} return ret - ret["comment"] = "Failed to delete public IP address {}!".format(name) + ret["comment"] = f"Failed to delete public IP address {name}!" return ret @@ -1877,7 +1877,7 @@ def network_interface_present( enable_accelerated_networking=None, enable_ip_forwarding=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -2071,12 +2071,12 @@ def network_interface_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Network interface {} is already present.".format(name) + ret["comment"] = f"Network interface {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Network interface {} would be updated.".format(name) + ret["comment"] = f"Network interface {name} would be updated." return ret else: @@ -2097,7 +2097,7 @@ def network_interface_present( } if __opts__["test"]: - ret["comment"] = "Network interface {} would be created.".format(name) + ret["comment"] = f"Network interface {name} would be created." ret["result"] = None return ret @@ -2118,12 +2118,12 @@ def network_interface_present( network_security_group=network_security_group, virtual_machine=virtual_machine, tags=tags, - **iface_kwargs + **iface_kwargs, ) if "error" not in iface: ret["result"] = True - ret["comment"] = "Network interface {} has been created.".format(name) + ret["comment"] = f"Network interface {name} has been created." return ret ret["comment"] = "Failed to create network interface {}! ({})".format( @@ -2163,11 +2163,11 @@ def network_interface_absent(name, resource_group, connection_auth=None): if "error" in iface: ret["result"] = True - ret["comment"] = "Network interface {} was not found.".format(name) + ret["comment"] = f"Network interface {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Network interface {} would be deleted.".format(name) + ret["comment"] = f"Network interface {name} would be deleted." ret["result"] = None ret["changes"] = { "old": iface, @@ -2181,11 +2181,11 @@ def network_interface_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Network interface {} has been deleted.".format(name) + ret["comment"] = f"Network interface {name} has been deleted." ret["changes"] = {"old": iface, "new": {}} return ret - ret["comment"] = "Failed to delete network interface {}!)".format(name) + ret["comment"] = f"Failed to delete network interface {name}!)" return ret @@ -2197,7 +2197,7 @@ def route_table_present( routes=None, disable_bgp_route_propagation=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -2293,12 +2293,12 @@ def route_table_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Route table {} is already present.".format(name) + ret["comment"] = f"Route table {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Route table {} would be updated.".format(name) + ret["comment"] = f"Route table {name} would be updated." return ret else: @@ -2313,7 +2313,7 @@ def route_table_present( } if __opts__["test"]: - ret["comment"] = "Route table {} would be created.".format(name) + ret["comment"] = f"Route table {name} would be created." ret["result"] = None return ret @@ -2326,12 +2326,12 @@ def route_table_present( disable_bgp_route_propagation=disable_bgp_route_propagation, routes=routes, tags=tags, - **rt_tbl_kwargs + **rt_tbl_kwargs, ) if "error" not in rt_tbl: ret["result"] = True - ret["comment"] = "Route table {} has been created.".format(name) + ret["comment"] = f"Route table {name} has been created." return ret ret["comment"] = "Failed to create route table {}! ({})".format( @@ -2371,11 +2371,11 @@ def route_table_absent(name, resource_group, connection_auth=None): if "error" in rt_tbl: ret["result"] = True - ret["comment"] = "Route table {} was not found.".format(name) + ret["comment"] = f"Route table {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Route table {} would be deleted.".format(name) + ret["comment"] = f"Route table {name} would be deleted." ret["result"] = None ret["changes"] = { "old": rt_tbl, @@ -2389,11 +2389,11 @@ def route_table_absent(name, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Route table {} has been deleted.".format(name) + ret["comment"] = f"Route table {name} has been deleted." ret["changes"] = {"old": rt_tbl, "new": {}} return ret - ret["comment"] = "Failed to delete route table {}!".format(name) + ret["comment"] = f"Failed to delete route table {name}!" return ret @@ -2406,7 +2406,7 @@ def route_present( resource_group, next_hop_ip_address=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -2489,12 +2489,12 @@ def route_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Route {} is already present.".format(name) + ret["comment"] = f"Route {name} is already present." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Route {} would be updated.".format(name) + ret["comment"] = f"Route {name} would be updated." return ret else: @@ -2509,7 +2509,7 @@ def route_present( } if __opts__["test"]: - ret["comment"] = "Route {} would be created.".format(name) + ret["comment"] = f"Route {name} would be created." ret["result"] = None return ret @@ -2523,12 +2523,12 @@ def route_present( address_prefix=address_prefix, next_hop_type=next_hop_type, next_hop_ip_address=next_hop_ip_address, - **route_kwargs + **route_kwargs, ) if "error" not in route: ret["result"] = True - ret["comment"] = "Route {} has been created.".format(name) + ret["comment"] = f"Route {name} has been created." return ret ret["comment"] = "Failed to create route {}! ({})".format(name, route.get("error")) @@ -2569,11 +2569,11 @@ def route_absent(name, route_table, resource_group, connection_auth=None): if "error" in route: ret["result"] = True - ret["comment"] = "Route {} was not found.".format(name) + ret["comment"] = f"Route {name} was not found." return ret elif __opts__["test"]: - ret["comment"] = "Route {} would be deleted.".format(name) + ret["comment"] = f"Route {name} would be deleted." ret["result"] = None ret["changes"] = { "old": route, @@ -2587,9 +2587,9 @@ def route_absent(name, route_table, resource_group, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Route {} has been deleted.".format(name) + ret["comment"] = f"Route {name} has been deleted." ret["changes"] = {"old": route, "new": {}} return ret - ret["comment"] = "Failed to delete route {}!".format(name) + ret["comment"] = f"Failed to delete route {name}!" return ret diff --git a/salt/states/azurearm_resource.py b/salt/states/azurearm_resource.py index 5cd896c4252..e8c8f819641 100644 --- a/salt/states/azurearm_resource.py +++ b/salt/states/azurearm_resource.py @@ -192,17 +192,17 @@ def resource_group_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Resource group {} is already present.".format(name) + ret["comment"] = f"Resource group {name} is already present." return ret if __opts__["test"]: - ret["comment"] = "Resource group {} tags would be updated.".format(name) + ret["comment"] = f"Resource group {name} tags would be updated." ret["result"] = None ret["changes"] = {"old": group.get("tags", {}), "new": tags} return ret elif __opts__["test"]: - ret["comment"] = "Resource group {} would be created.".format(name) + ret["comment"] = f"Resource group {name} would be created." ret["result"] = None ret["changes"] = { "old": {}, @@ -227,7 +227,7 @@ def resource_group_present( if present: ret["result"] = True - ret["comment"] = "Resource group {} has been created.".format(name) + ret["comment"] = f"Resource group {name} has been created." ret["changes"] = {"old": {}, "new": group} return ret @@ -267,7 +267,7 @@ def resource_group_absent(name, connection_auth=None): if not present: ret["result"] = True - ret["comment"] = "Resource group {} is already absent.".format(name) + ret["comment"] = f"Resource group {name} is already absent." return ret elif __opts__["test"]: @@ -275,7 +275,7 @@ def resource_group_absent(name, connection_auth=None): name, **connection_auth ) - ret["comment"] = "Resource group {} would be deleted.".format(name) + ret["comment"] = f"Resource group {name} would be deleted." ret["result"] = None ret["changes"] = { "old": group, @@ -297,11 +297,11 @@ def resource_group_absent(name, connection_auth=None): if not present: ret["result"] = True - ret["comment"] = "Resource group {} has been deleted.".format(name) + ret["comment"] = f"Resource group {name} has been deleted." ret["changes"] = {"old": group, "new": {}} return ret - ret["comment"] = "Failed to delete resource group {}!".format(name) + ret["comment"] = f"Failed to delete resource group {name}!" return ret @@ -322,7 +322,7 @@ def policy_definition_present( source_hash_name=None, skip_verify=False, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -450,7 +450,7 @@ def policy_definition_present( try: temp_rule = json.loads(policy_rule_json) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Unable to load policy rule json! ({})".format(exc) + ret["comment"] = f"Unable to load policy rule json! ({exc})" return ret elif policy_rule_file: try: @@ -468,7 +468,7 @@ def policy_definition_present( None, None, skip_verify=skip_verify, - **kwargs + **kwargs, ) except Exception as exc: # pylint: disable=broad-except ret["comment"] = 'Unable to locate policy rule file "{}"! ({})'.format( @@ -552,11 +552,11 @@ def policy_definition_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Policy definition {} is already present.".format(name) + ret["comment"] = f"Policy definition {name} is already present." return ret if __opts__["test"]: - ret["comment"] = "Policy definition {} would be updated.".format(name) + ret["comment"] = f"Policy definition {name} would be updated." ret["result"] = None return ret @@ -576,7 +576,7 @@ def policy_definition_present( } if __opts__["test"]: - ret["comment"] = "Policy definition {} would be created.".format(name) + ret["comment"] = f"Policy definition {name} would be created." ret["result"] = None return ret @@ -598,12 +598,12 @@ def policy_definition_present( description=description, metadata=metadata, parameters=parameters, - **policy_kwargs + **policy_kwargs, ) if "error" not in policy: ret["result"] = True - ret["comment"] = "Policy definition {} has been created.".format(name) + ret["comment"] = f"Policy definition {name} has been created." return ret ret["comment"] = "Failed to create policy definition {}! ({})".format( @@ -640,11 +640,11 @@ def policy_definition_absent(name, connection_auth=None): if "error" in policy: ret["result"] = True - ret["comment"] = "Policy definition {} is already absent.".format(name) + ret["comment"] = f"Policy definition {name} is already absent." return ret elif __opts__["test"]: - ret["comment"] = "Policy definition {} would be deleted.".format(name) + ret["comment"] = f"Policy definition {name} would be deleted." ret["result"] = None ret["changes"] = { "old": policy, @@ -658,11 +658,11 @@ def policy_definition_absent(name, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Policy definition {} has been deleted.".format(name) + ret["comment"] = f"Policy definition {name} has been deleted." ret["changes"] = {"old": policy, "new": {}} return ret - ret["comment"] = "Failed to delete policy definition {}!".format(name) + ret["comment"] = f"Failed to delete policy definition {name}!" return ret @@ -676,7 +676,7 @@ def policy_assignment_present( assignment_type=None, parameters=None, connection_auth=None, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -768,11 +768,11 @@ def policy_assignment_present( if not ret["changes"]: ret["result"] = True - ret["comment"] = "Policy assignment {} is already present.".format(name) + ret["comment"] = f"Policy assignment {name} is already present." return ret if __opts__["test"]: - ret["comment"] = "Policy assignment {} would be updated.".format(name) + ret["comment"] = f"Policy assignment {name} would be updated." ret["result"] = None return ret @@ -791,7 +791,7 @@ def policy_assignment_present( } if __opts__["test"]: - ret["comment"] = "Policy assignment {} would be created.".format(name) + ret["comment"] = f"Policy assignment {name} would be created." ret["result"] = None return ret @@ -808,12 +808,12 @@ def policy_assignment_present( display_name=display_name, description=description, parameters=parameters, - **policy_kwargs + **policy_kwargs, ) if "error" not in policy: ret["result"] = True - ret["comment"] = "Policy assignment {} has been created.".format(name) + ret["comment"] = f"Policy assignment {name} has been created." return ret ret["comment"] = "Failed to create policy assignment {}! ({})".format( @@ -853,11 +853,11 @@ def policy_assignment_absent(name, scope, connection_auth=None): if "error" in policy: ret["result"] = True - ret["comment"] = "Policy assignment {} is already absent.".format(name) + ret["comment"] = f"Policy assignment {name} is already absent." return ret elif __opts__["test"]: - ret["comment"] = "Policy assignment {} would be deleted.".format(name) + ret["comment"] = f"Policy assignment {name} would be deleted." ret["result"] = None ret["changes"] = { "old": policy, @@ -871,9 +871,9 @@ def policy_assignment_absent(name, scope, connection_auth=None): if deleted: ret["result"] = True - ret["comment"] = "Policy assignment {} has been deleted.".format(name) + ret["comment"] = f"Policy assignment {name} has been deleted." ret["changes"] = {"old": policy, "new": {}} return ret - ret["comment"] = "Failed to delete policy assignment {}!".format(name) + ret["comment"] = f"Failed to delete policy assignment {name}!" return ret diff --git a/salt/states/beacon.py b/salt/states/beacon.py index 088c8d308ec..b83717ae2bd 100644 --- a/salt/states/beacon.py +++ b/salt/states/beacon.py @@ -104,7 +104,7 @@ def present(name, save=False, **kwargs): if name in current_beacons: if beacon_data == current_beacons[name]: - ret["comment"].append("Job {} in correct state".format(name)) + ret["comment"].append(f"Job {name} in correct state") else: if __opts__.get("test"): kwargs["test"] = True @@ -119,7 +119,7 @@ def present(name, save=False, **kwargs): return ret else: if "changes" in result: - ret["comment"].append("Modifying {} in beacons".format(name)) + ret["comment"].append(f"Modifying {name} in beacons") ret["changes"] = result["changes"] else: ret["comment"].append(result["comment"]) @@ -136,14 +136,14 @@ def present(name, save=False, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Adding {} to beacons".format(name)) + ret["comment"].append(f"Adding {name} to beacons") if save: if __opts__.get("test"): - ret["comment"].append("Beacon {} would be saved".format(name)) + ret["comment"].append(f"Beacon {name} would be saved") else: __salt__["beacons.save"]() - ret["comment"].append("Beacon {} saved".format(name)) + ret["comment"].append(f"Beacon {name} saved") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -184,16 +184,16 @@ def absent(name, save=False, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Removed {} from beacons".format(name)) + ret["comment"].append(f"Removed {name} from beacons") else: - ret["comment"].append("{} not configured in beacons".format(name)) + ret["comment"].append(f"{name} not configured in beacons") if save: if __opts__.get("test"): - ret["comment"].append("Beacon {} would be saved".format(name)) + ret["comment"].append(f"Beacon {name} would be saved") else: __salt__["beacons.save"]() - ret["comment"].append("Beacon {} saved".format(name)) + ret["comment"].append(f"Beacon {name} saved") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -231,9 +231,9 @@ def enabled(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Enabled {} from beacons".format(name)) + ret["comment"].append(f"Enabled {name} from beacons") else: - ret["comment"].append("{} not a configured beacon".format(name)) + ret["comment"].append(f"{name} not a configured beacon") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -271,9 +271,9 @@ def disabled(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Disabled beacon {}.".format(name)) + ret["comment"].append(f"Disabled beacon {name}.") else: - ret["comment"].append("Job {} is not configured.".format(name)) + ret["comment"].append(f"Job {name} is not configured.") ret["comment"] = "\n".join(ret["comment"]) return ret diff --git a/salt/states/bigip.py b/salt/states/bigip.py index 2b72e4b7530..9f494ac20c5 100644 --- a/salt/states/bigip.py +++ b/salt/states/bigip.py @@ -1628,9 +1628,7 @@ def modify_pool_member( # check for changes old = {"content": existing_member} new = {"content": modified_member} - ret = _check_for_changes( - "Pool Member: {member}".format(member=member), ret, old, new - ) + ret = _check_for_changes(f"Pool Member: {member}", ret, old, new) else: ret = _load_result(modified, ret) diff --git a/salt/states/blockdev.py b/salt/states/blockdev.py index c8218e68b3d..0f85f3485e5 100644 --- a/salt/states/blockdev.py +++ b/salt/states/blockdev.py @@ -82,7 +82,7 @@ def tuned(name, **kwargs): name ) elif __opts__["test"]: - ret["comment"] = "Changes to {} will be applied ".format(name) + ret["comment"] = f"Changes to {name} will be applied " ret["result"] = None return ret else: @@ -102,15 +102,15 @@ def tuned(name, **kwargs): if key == "read-write": old = not old new = not new - changeset[key] = "Changed from {} to {}".format(old, new) + changeset[key] = f"Changed from {old} to {new}" if changes: if changeset: - ret["comment"] = "Block device {} successfully modified ".format(name) + ret["comment"] = f"Block device {name} successfully modified " ret["changes"] = changeset else: - ret["comment"] = "Block device {} already in correct state".format(name) + ret["comment"] = f"Block device {name} already in correct state" else: - ret["comment"] = "Failed to modify block device {}".format(name) + ret["comment"] = f"Failed to modify block device {name}" ret["result"] = False return ret @@ -136,13 +136,13 @@ def formatted(name, fs_type="ext4", force=False, **kwargs): """ ret = { "changes": {}, - "comment": "{} already formatted with {}".format(name, fs_type), + "comment": f"{name} already formatted with {fs_type}", "name": name, "result": False, } if not os.path.exists(name): - ret["comment"] = "{} does not exist".format(name) + ret["comment"] = f"{name} does not exist" return ret current_fs = _checkblk(name) @@ -150,12 +150,12 @@ def formatted(name, fs_type="ext4", force=False, **kwargs): if current_fs == fs_type: ret["result"] = True return ret - elif not salt.utils.path.which("mkfs.{}".format(fs_type)): - ret["comment"] = "Invalid fs_type: {}".format(fs_type) + elif not salt.utils.path.which(f"mkfs.{fs_type}"): + ret["comment"] = f"Invalid fs_type: {fs_type}" ret["result"] = False return ret elif __opts__["test"]: - ret["comment"] = "Changes to {} will be applied ".format(name) + ret["comment"] = f"Changes to {name} will be applied " ret["result"] = None return ret @@ -171,7 +171,7 @@ def formatted(name, fs_type="ext4", force=False, **kwargs): current_fs = _checkblk(name) if current_fs == fs_type: - ret["comment"] = "{} has been formatted with {}".format(name, fs_type) + ret["comment"] = f"{name} has been formatted with {fs_type}" ret["changes"] = {"new": fs_type, "old": current_fs} ret["result"] = True return ret @@ -182,7 +182,7 @@ def formatted(name, fs_type="ext4", force=False, **kwargs): else: break - ret["comment"] = "Failed to format {}".format(name) + ret["comment"] = f"Failed to format {name}" ret["result"] = False return ret diff --git a/salt/states/boto3_elasticache.py b/salt/states/boto3_elasticache.py index 0cf1a867851..d2d5774a4b5 100644 --- a/salt/states/boto3_elasticache.py +++ b/salt/states/boto3_elasticache.py @@ -173,7 +173,7 @@ def cache_cluster_present( key=None, keyid=None, profile=None, - **args + **args, ): """ Ensure a given cache cluster exists. @@ -444,7 +444,7 @@ def cache_cluster_present( else: create_args[k] = v if __opts__["test"]: - ret["comment"] = "Cache cluster {} would be created.".format(name) + ret["comment"] = f"Cache cluster {name} would be created." ret["result"] = None return ret created = __salt__["boto3_elasticache.create_cache_cluster"]( @@ -455,18 +455,18 @@ def cache_cluster_present( key=key, keyid=keyid, profile=profile, - **create_args + **create_args, ) if created: new = __salt__["boto3_elasticache.describe_cache_clusters"]( name, region=region, key=key, keyid=keyid, profile=profile ) - ret["comment"] = "Cache cluster {} was created.".format(name) + ret["comment"] = f"Cache cluster {name} was created." ret["changes"]["old"] = None ret["changes"]["new"] = new[0] else: ret["result"] = False - ret["comment"] = "Failed to create {} cache cluster.".format(name) + ret["comment"] = f"Failed to create {name} cache cluster." if check_update: # Refresh this in case we're updating from 'only_on_modify' above... @@ -476,7 +476,7 @@ def cache_cluster_present( need_update = _diff_cache_cluster(updated["CacheClusters"][0], args) if need_update: if __opts__["test"]: - ret["comment"] = "Cache cluster {} would be modified.".format(name) + ret["comment"] = f"Cache cluster {name} would be modified." ret["result"] = None return ret modified = __salt__["boto3_elasticache.modify_cache_cluster"]( @@ -487,7 +487,7 @@ def cache_cluster_present( key=key, keyid=keyid, profile=profile, - **need_update + **need_update, ) if modified: new = __salt__["boto3_elasticache.describe_cache_clusters"]( @@ -496,14 +496,14 @@ def cache_cluster_present( if ret["comment"]: # 'create' just ran... ret["comment"] += " ... and then immediately modified." else: - ret["comment"] = "Cache cluster {} was modified.".format(name) + ret["comment"] = f"Cache cluster {name} was modified." ret["changes"]["old"] = current ret["changes"]["new"] = new[0] else: ret["result"] = False - ret["comment"] = "Failed to modify cache cluster {}.".format(name) + ret["comment"] = f"Failed to modify cache cluster {name}." else: - ret["comment"] = "Cache cluster {} is in the desired state.".format(name) + ret["comment"] = f"Cache cluster {name} is in the desired state." return ret @@ -552,7 +552,7 @@ def cache_cluster_absent( ) if exists: if __opts__["test"]: - ret["comment"] = "Cache cluster {} would be removed.".format(name) + ret["comment"] = f"Cache cluster {name} would be removed." ret["result"] = None return ret deleted = __salt__["boto3_elasticache.delete_cache_cluster"]( @@ -562,16 +562,16 @@ def cache_cluster_absent( key=key, keyid=keyid, profile=profile, - **args + **args, ) if deleted: ret["changes"]["old"] = name ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to delete {} cache cluster.".format(name) + ret["comment"] = f"Failed to delete {name} cache cluster." else: - ret["comment"] = "Cache cluster {} already absent.".format(name) + ret["comment"] = f"Cache cluster {name} already absent." return ret @@ -637,7 +637,7 @@ def replication_group_present( key=None, keyid=None, profile=None, - **args + **args, ): """ Ensure a replication group exists and is in the given state. @@ -896,7 +896,7 @@ def replication_group_present( else: create_args[k] = v if __opts__["test"]: - ret["comment"] = "Replication group {} would be created.".format(name) + ret["comment"] = f"Replication group {name} would be created." ret["result"] = None return ret created = __salt__["boto3_elasticache.create_replication_group"]( @@ -907,18 +907,18 @@ def replication_group_present( key=key, keyid=keyid, profile=profile, - **create_args + **create_args, ) if created: new = __salt__["boto3_elasticache.describe_replication_groups"]( name, region=region, key=key, keyid=keyid, profile=profile ) - ret["comment"] = "Replication group {} was created.".format(name) + ret["comment"] = f"Replication group {name} was created." ret["changes"]["old"] = None ret["changes"]["new"] = new[0] else: ret["result"] = False - ret["comment"] = "Failed to create {} replication group.".format(name) + ret["comment"] = f"Failed to create {name} replication group." if check_update: # Refresh this in case we're updating from 'only_on_modify' above... @@ -928,7 +928,7 @@ def replication_group_present( need_update = _diff_replication_group(updated, args) if need_update: if __opts__["test"]: - ret["comment"] = "Replication group {} would be modified.".format(name) + ret["comment"] = f"Replication group {name} would be modified." ret["result"] = None return ret modified = __salt__["boto3_elasticache.modify_replication_group"]( @@ -939,7 +939,7 @@ def replication_group_present( key=key, keyid=keyid, profile=profile, - **need_update + **need_update, ) if modified: new = __salt__["boto3_elasticache.describe_replication_groups"]( @@ -948,12 +948,12 @@ def replication_group_present( if ret["comment"]: # 'create' just ran... ret["comment"] += " ... and then immediately modified." else: - ret["comment"] = "Replication group {} was modified.".format(name) + ret["comment"] = f"Replication group {name} was modified." ret["changes"]["old"] = current[0] if current else None ret["changes"]["new"] = new[0] else: ret["result"] = False - ret["comment"] = "Failed to modify replication group {}.".format(name) + ret["comment"] = f"Failed to modify replication group {name}." else: ret["comment"] = "Replication group {} is in the desired state.".format( name @@ -1010,7 +1010,7 @@ def replication_group_absent( ) if exists: if __opts__["test"]: - ret["comment"] = "Replication group {} would be removed.".format(name) + ret["comment"] = f"Replication group {name} would be removed." ret["result"] = None return ret deleted = __salt__["boto3_elasticache.delete_replication_group"]( @@ -1020,16 +1020,16 @@ def replication_group_absent( key=key, keyid=keyid, profile=profile, - **args + **args, ) if deleted: ret["changes"]["old"] = name ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to delete {} replication group.".format(name) + ret["comment"] = f"Failed to delete {name} replication group." else: - ret["comment"] = "Replication group {} already absent.".format(name) + ret["comment"] = f"Replication group {name} already absent." return ret @@ -1113,7 +1113,7 @@ def cache_subnet_group_present( else: check_update = False if __opts__["test"]: - ret["comment"] = "Cache subnet group {} would be created.".format(name) + ret["comment"] = f"Cache subnet group {name} would be created." ret["result"] = None return ret created = __salt__["boto3_elasticache.create_cache_subnet_group"]( @@ -1123,24 +1123,24 @@ def cache_subnet_group_present( key=key, keyid=keyid, profile=profile, - **args + **args, ) if created: new = __salt__["boto3_elasticache.describe_cache_subnet_groups"]( name, region=region, key=key, keyid=keyid, profile=profile ) - ret["comment"] = "Cache subnet group {} was created.".format(name) + ret["comment"] = f"Cache subnet group {name} was created." ret["changes"]["old"] = None ret["changes"]["new"] = new[0] else: ret["result"] = False - ret["comment"] = "Failed to create {} cache subnet group.".format(name) + ret["comment"] = f"Failed to create {name} cache subnet group." if check_update: need_update = _diff_cache_subnet_group(current, args) if need_update: if __opts__["test"]: - ret["comment"] = "Cache subnet group {} would be modified.".format(name) + ret["comment"] = f"Cache subnet group {name} would be modified." ret["result"] = None return ret modified = __salt__["boto3_elasticache.modify_cache_subnet_group"]( @@ -1150,18 +1150,18 @@ def cache_subnet_group_present( key=key, keyid=keyid, profile=profile, - **need_update + **need_update, ) if modified: new = __salt__["boto3_elasticache.describe_cache_subnet_groups"]( name, region=region, key=key, keyid=keyid, profile=profile ) - ret["comment"] = "Cache subnet group {} was modified.".format(name) + ret["comment"] = f"Cache subnet group {name} was modified." ret["changes"]["old"] = current["CacheSubetGroups"][0] ret["changes"]["new"] = new[0] else: ret["result"] = False - ret["comment"] = "Failed to modify cache subnet group {}.".format(name) + ret["comment"] = f"Failed to modify cache subnet group {name}." else: ret["comment"] = "Cache subnet group {} is in the desired state.".format( name @@ -1202,7 +1202,7 @@ def cache_subnet_group_absent( ) if exists: if __opts__["test"]: - ret["comment"] = "Cache subnet group {} would be removed.".format(name) + ret["comment"] = f"Cache subnet group {name} would be removed." ret["result"] = None return ret deleted = __salt__["boto3_elasticache.delete_cache_subnet_group"]( @@ -1213,7 +1213,7 @@ def cache_subnet_group_absent( ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to delete {} cache_subnet group.".format(name) + ret["comment"] = f"Failed to delete {name} cache_subnet group." else: - ret["comment"] = "Cache subnet group {} already absent.".format(name) + ret["comment"] = f"Cache subnet group {name} already absent." return ret diff --git a/salt/states/boto3_elasticsearch.py b/salt/states/boto3_elasticsearch.py index ac50995660c..9a908f33ae7 100644 --- a/salt/states/boto3_elasticsearch.py +++ b/salt/states/boto3_elasticsearch.py @@ -72,7 +72,7 @@ def __virtual__(): if req not in __salt__: return ( False, - "A required function was not found in __salt__: {}".format(req), + f"A required function was not found in __salt__: {req}", ) return __virtualname__ @@ -377,7 +377,7 @@ def present( else: ret["result"] = True ret["comment"].append( - 'Elasticsearch Domain "{}" has been {}d.'.format(name, action) + f'Elasticsearch Domain "{name}" has been {action}d.' ) ret["changes"] = config_diff elif action == "upgrade": @@ -454,7 +454,7 @@ def absent(name, blocking=True, region=None, keyid=None, key=None, profile=None) if __opts__["test"]: ret["result"] = None ret["comment"].append( - 'Elasticsearch domain "{}" would have been removed.'.format(name) + f'Elasticsearch domain "{name}" would have been removed.' ) ret["changes"] = {"old": name, "new": None} else: @@ -476,14 +476,12 @@ def absent(name, blocking=True, region=None, keyid=None, key=None, profile=None) else: ret["result"] = True ret["comment"].append( - 'Elasticsearch domain "{}" has been deleted.'.format(name) + f'Elasticsearch domain "{name}" has been deleted.' ) ret["changes"] = {"old": name, "new": None} else: ret["result"] = True - ret["comment"].append( - 'Elasticsearch domain "{}" is already absent.'.format(name) - ) + ret["comment"].append(f'Elasticsearch domain "{name}" is already absent.') ret = _check_return_value(ret) return ret @@ -528,9 +526,7 @@ def upgraded( if not res["result"]: ret["result"] = False if "ResourceNotFoundException" in res["error"]: - ret["comment"].append( - 'The Elasticsearch domain "{}" does not exist.'.format(name) - ) + ret["comment"].append(f'The Elasticsearch domain "{name}" does not exist.') else: ret["comment"].append(res["error"]) else: @@ -726,9 +722,7 @@ def latest(name, minor_only=True, region=None, keyid=None, key=None, profile=Non pass if not current_version: ret["result"] = True - ret["comment"].append( - 'The Elasticsearch domain "{}" can not be upgraded.'.format(name) - ) + ret["comment"].append(f'The Elasticsearch domain "{name}" can not be upgraded.') elif not latest_version: ret["result"] = True ret["comment"].append( @@ -818,7 +812,7 @@ def tagged( current_tags = res["response"] or {} else: ret["result"] = False - ret["comment"].append('Elasticsearch domain "{}" does not exist.'.format(name)) + ret["comment"].append(f'Elasticsearch domain "{name}" does not exist.') if isinstance(ret["result"], bool): return ret @@ -826,7 +820,7 @@ def tagged( if not diff_tags: ret["result"] = True ret["comment"].append( - 'Elasticsearch domain "{}" already has the specified tags.'.format(name) + f'Elasticsearch domain "{name}" already has the specified tags.' ) else: if replace: diff --git a/salt/states/boto3_route53.py b/salt/states/boto3_route53.py index 7cd3ede3452..7b1a5fdf3ab 100644 --- a/salt/states/boto3_route53.py +++ b/salt/states/boto3_route53.py @@ -241,7 +241,7 @@ def hosted_zone_present( update_comment = True if not (create or add_vpcs or del_vpcs or update_comment): - ret["comment"] = "Hostd Zone {} already in desired state".format(Name) + ret["comment"] = f"Hostd Zone {Name} already in desired state" return ret if create: @@ -745,7 +745,7 @@ def rr_present( # this appears to be incredibly difficult with the jinja templating engine # so inject the quotations here to make a viable ChangeBatch if Type == "TXT": - rr = '"{}"'.format(rr) + rr = f'"{rr}"' fixed_rrs += [rr] ResourceRecords = [{"Value": rr} for rr in sorted(fixed_rrs)] diff --git a/salt/states/boto3_sns.py b/salt/states/boto3_sns.py index b47b4447288..feeca5602c1 100644 --- a/salt/states/boto3_sns.py +++ b/salt/states/boto3_sns.py @@ -135,11 +135,11 @@ def topic_present( something_changed = False current = __salt__["boto3_sns.describe_topic"](name, region, key, keyid, profile) if current: - ret["comment"] = "AWS SNS topic {} present.".format(name) + ret["comment"] = f"AWS SNS topic {name} present." TopicArn = current["TopicArn"] else: if __opts__["test"]: - ret["comment"] = "AWS SNS topic {} would be created.".format(name) + ret["comment"] = f"AWS SNS topic {name} would be created." ret["result"] = None return ret else: @@ -152,7 +152,7 @@ def topic_present( ) something_changed = True else: - ret["comment"] = "Failed to create AWS SNS topic {}".format(name) + ret["comment"] = f"Failed to create AWS SNS topic {name}" log.error(ret["comment"]) ret["result"] = False return ret @@ -246,7 +246,7 @@ def topic_present( TopicArn, prot, endp, region=region, key=key, keyid=keyid, profile=profile ) if subbed: - msg = " Subscription {}:{} set on topic {}.".format(prot, endp, TopicArn) + msg = f" Subscription {prot}:{endp} set on topic {TopicArn}." ret["comment"] += msg something_changed = True else: @@ -318,11 +318,11 @@ def topic_absent( something_changed = False current = __salt__["boto3_sns.describe_topic"](name, region, key, keyid, profile) if not current: - ret["comment"] = "AWS SNS topic {} absent.".format(name) + ret["comment"] = f"AWS SNS topic {name} absent." else: TopicArn = current["TopicArn"] if __opts__["test"]: - ret["comment"] = "AWS SNS topic {} would be removed.".format(TopicArn) + ret["comment"] = f"AWS SNS topic {TopicArn} would be removed." if unsubscribe: ret["comment"] += " {} subscription(s) would be removed.".format( len(current["Subscriptions"]) @@ -360,17 +360,14 @@ def topic_absent( if not __salt__["boto3_sns.delete_topic"]( TopicArn, region=region, key=key, keyid=keyid, profile=profile ): - ret["comment"] = "Failed to delete SNS topic {}".format(TopicArn) + ret["comment"] = f"Failed to delete SNS topic {TopicArn}" log.error(ret["comment"]) ret["result"] = False else: - ret["comment"] = "AWS SNS topic {} deleted.".format(TopicArn) + ret["comment"] = f"AWS SNS topic {TopicArn} deleted." if unsubscribe: ret["comment"] += " ".join( - [ - "Subscription {} deleted".format(s) - for s in current["Subscriptions"] - ] + [f"Subscription {s} deleted" for s in current["Subscriptions"]] ) something_changed = True diff --git a/salt/states/boto_apigateway.py b/salt/states/boto_apigateway.py index 32aad36f677..554f574c8a3 100644 --- a/salt/states/boto_apigateway.py +++ b/salt/states/boto_apigateway.py @@ -349,7 +349,7 @@ def present( except (ValueError, OSError) as e: ret["result"] = False - ret["comment"] = "{}".format(e.args) + ret["comment"] = f"{e.args}" return ret @@ -434,7 +434,7 @@ def absent( swagger = _Swagger(api_name, stage_name, "", None, None, None, common_args) if not swagger.restApiId: - ret["comment"] = "[Rest API: {}] does not exist.".format(api_name) + ret["comment"] = f"[Rest API: {api_name}] does not exist." return ret if __opts__["test"]: @@ -445,7 +445,7 @@ def absent( "deleted.".format(stage_name, api_name) ) else: - ret["comment"] = "[stage: {}] will be deleted.".format(stage_name) + ret["comment"] = f"[stage: {stage_name}] will be deleted." ret["result"] = None return ret @@ -459,7 +459,7 @@ def absent( except (ValueError, OSError) as e: ret["result"] = False - ret["comment"] = "{}".format(e.args) + ret["comment"] = f"{e.args}" return ret @@ -724,11 +724,11 @@ class _Swagger: _name = self._paramdict.get("name") if _name: if self.location == "header": - return "method.request.header.{}".format(_name) + return f"method.request.header.{_name}" elif self.location == "query": - return "method.request.querystring.{}".format(_name) + return f"method.request.querystring.{_name}" elif self.location == "path": - return "method.request.path.{}".format(_name) + return f"method.request.path.{_name}" return None raise ValueError( "Parameter must have a name: {}".format( @@ -753,9 +753,7 @@ class _Swagger: self.name ) ) - raise ValueError( - "Body parameter must have a schema: {}".format(self.name) - ) + raise ValueError(f"Body parameter must have a schema: {self.name}") return None class SwaggerMethodResponse: @@ -818,7 +816,7 @@ class _Swagger: self._cfg = salt.utils.yaml.safe_load(sf) self._swagger_version = "" else: - raise OSError("Invalid swagger file path, {}".format(swagger_file_path)) + raise OSError(f"Invalid swagger file path, {swagger_file_path}") self._validate_swagger_file() @@ -876,7 +874,7 @@ class _Swagger: if model.get("type") != "object": raise ValueError( - "model schema {} must be type object".format(modelname) + f"model schema {modelname} must be type object" ) if "properties" not in model: raise ValueError( @@ -927,12 +925,12 @@ class _Swagger: field not in _Swagger.SWAGGER_OBJ_V2_FIELDS and not _Swagger.VENDOR_EXT_PATTERN.match(field) ): - raise ValueError("Invalid Swagger Object Field: {}".format(field)) + raise ValueError(f"Invalid Swagger Object Field: {field}") # check for Required Swagger fields by Saltstack boto apigateway state for field in _Swagger.SWAGGER_OBJ_V2_FIELDS_REQUIRED: if field not in self._cfg: - raise ValueError("Missing Swagger Object Field: {}".format(field)) + raise ValueError(f"Missing Swagger Object Field: {field}") # check for Swagger Version self._swagger_version = self._cfg.get("swagger") @@ -1026,7 +1024,7 @@ class _Swagger: for path in paths: if not path.startswith("/"): raise ValueError( - "Path object {} should start with /. Please fix it".format(path) + f"Path object {path} should start with /. Please fix it" ) return paths.items() @@ -1099,7 +1097,7 @@ class _Swagger: stages = __salt__["boto_apigateway.describe_api_stages"]( restApiId=self.restApiId, deploymentId=deploymentId, - **self._common_aws_args + **self._common_aws_args, ).get("stages") if stages: no_more_deployments = False @@ -1115,7 +1113,7 @@ class _Swagger: stage = __salt__["boto_apigateway.describe_api_stage"]( restApiId=self.restApiId, stageName=self._stage_name, - **self._common_aws_args + **self._common_aws_args, ).get("stage") if stage: deploymentId = stage.get("deploymentId") @@ -1155,7 +1153,7 @@ class _Swagger: restApiId=self.restApiId, stageName=self._stage_name, variables=stage_variables, - **self._common_aws_args + **self._common_aws_args, ) if not res.get("overwrite"): @@ -1173,7 +1171,7 @@ class _Swagger: stage = __salt__["boto_apigateway.describe_api_stage"]( restApiId=self.restApiId, stageName=self._stage_name, - **self._common_aws_args + **self._common_aws_args, ).get("stage") if not stage: stage = __salt__["boto_apigateway.create_api_stage"]( @@ -1182,7 +1180,7 @@ class _Swagger: deploymentId=self._deploymentId, description=stage_desc_json, variables=stage_variables, - **self._common_aws_args + **self._common_aws_args, ) if not stage.get("stage"): return {"set": False, "error": stage.get("error")} @@ -1192,7 +1190,7 @@ class _Swagger: restApiId=self.restApiId, stageName=self._stage_name, variables=stage_variables, - **self._common_aws_args + **self._common_aws_args, ) if not overwrite.get("stage"): return {"set": False, "error": overwrite.get("error")} @@ -1201,7 +1199,7 @@ class _Swagger: restApiId=self.restApiId, stageName=self._stage_name, deploymentId=self._deploymentId, - **self._common_aws_args + **self._common_aws_args, ) def _resolve_api_id(self): @@ -1212,7 +1210,7 @@ class _Swagger: apis = __salt__["boto_apigateway.describe_apis"]( name=self.rest_api_name, description=_Swagger.AWS_API_DESCRIPTION, - **self._common_aws_args + **self._common_aws_args, ).get("restapi") if apis: if len(apis) == 1: @@ -1235,7 +1233,7 @@ class _Swagger: result = __salt__["boto_apigateway.delete_api_stage"]( restApiId=self.restApiId, stageName=self._stage_name, - **self._common_aws_args + **self._common_aws_args, ) if not result.get("deleted"): ret["abort"] = True @@ -1249,7 +1247,7 @@ class _Swagger: result = __salt__["boto_apigateway.delete_api_deployment"]( restApiId=self.restApiId, deploymentId=deploymentId, - **self._common_aws_args + **self._common_aws_args, ) if not result.get("deleted"): ret["abort"] = True @@ -1265,7 +1263,7 @@ class _Swagger: ) else: # no matching stage_name/deployment found - ret["comment"] = "stage {} does not exist".format(self._stage_name) + ret["comment"] = f"stage {self._stage_name} does not exist" return ret @@ -1326,7 +1324,7 @@ class _Swagger: stageDescription=stage_desc_json, description=self.deployment_label_json, variables=stage_variables, - **self._common_aws_args + **self._common_aws_args, ) if not res.get("created"): ret["abort"] = True @@ -1353,7 +1351,7 @@ class _Swagger: delres = __salt__["boto_apigateway.delete_api_resources"]( restApiId=self.restApiId, path=resource.get("path"), - **self._common_aws_args + **self._common_aws_args, ) if not delres.get("deleted"): return delres @@ -1366,7 +1364,7 @@ class _Swagger: delres = __salt__["boto_apigateway.delete_api_model"]( restApiId=self.restApiId, modelName=model.get("name"), - **self._common_aws_args + **self._common_aws_args, ) if not delres.get("deleted"): return delres @@ -1380,7 +1378,7 @@ class _Swagger: if self.restApiId: res = self._cleanup_api() if not res.get("deleted"): - ret["comment"] = "Failed to cleanup restAreId {}".format(self.restApiId) + ret["comment"] = f"Failed to cleanup restAreId {self.restApiId}" ret["abort"] = True ret["result"] = False return ret @@ -1389,7 +1387,7 @@ class _Swagger: response = __salt__["boto_apigateway.create_api"]( name=self.rest_api_name, description=_Swagger.AWS_API_DESCRIPTION, - **self._common_aws_args + **self._common_aws_args, ) if not response.get("created"): @@ -1416,7 +1414,7 @@ class _Swagger: exists_response = __salt__["boto_apigateway.api_exists"]( name=self.rest_api_name, description=_Swagger.AWS_API_DESCRIPTION, - **self._common_aws_args + **self._common_aws_args, ) if exists_response.get("exists"): if __opts__["test"]: @@ -1430,7 +1428,7 @@ class _Swagger: delete_api_response = __salt__["boto_apigateway.delete_api"]( name=self.rest_api_name, description=_Swagger.AWS_API_DESCRIPTION, - **self._common_aws_args + **self._common_aws_args, ) if not delete_api_response.get("deleted"): ret["result"] = False @@ -1552,7 +1550,7 @@ class _Swagger: _schema.update( { "$schema": _Swagger.JSON_SCHEMA_DRAFT_4, - "title": "{} Schema".format(model), + "title": f"{model} Schema", } ) @@ -1569,7 +1567,7 @@ class _Swagger: restApiId=self.restApiId, modelName=model, schema=_dict_to_json_pretty(_schema), - **self._common_aws_args + **self._common_aws_args, ) if not update_model_schema_response.get("updated"): ret["result"] = False @@ -1593,7 +1591,7 @@ class _Swagger: modelDescription=model, schema=_dict_to_json_pretty(_schema), contentType="application/json", - **self._common_aws_args + **self._common_aws_args, ) if not create_model_response.get("created"): @@ -1744,7 +1742,7 @@ class _Swagger: method_response_params = {} method_integration_response_params = {} for header in method_response.headers: - response_header = "method.response.header.{}".format(header) + response_header = f"method.response.header.{header}" method_response_params[response_header] = False header_data = method_response.headers.get(header) method_integration_response_params[response_header] = ( @@ -1821,7 +1819,7 @@ class _Swagger: apiKeyRequired=api_key_required, requestParameters=method.get("params"), requestModels=method.get("models"), - **self._common_aws_args + **self._common_aws_args, ) if not m.get("created"): ret = _log_error_and_abort(ret, m) @@ -1847,7 +1845,7 @@ class _Swagger: uri=lambda_uri, credentials=lambda_integration_role, requestTemplates=method.get("request_templates"), - **self._common_aws_args + **self._common_aws_args, ) if not integration.get("created"): ret = _log_error_and_abort(ret, integration) @@ -1870,7 +1868,7 @@ class _Swagger: statusCode=httpStatus, responseParameters=method_response.get("params"), responseModels=method_response.get("models"), - **self._common_aws_args + **self._common_aws_args, ) if not mr.get("created"): ret = _log_error_and_abort(ret, mr) @@ -1885,7 +1883,7 @@ class _Swagger: selectionPattern=method_response.get("pattern"), responseParameters=method_response.get("integration_params"), responseTemplates=method_response.get("response_templates"), - **self._common_aws_args + **self._common_aws_args, ) if not mir.get("created"): ret = _log_error_and_abort(ret, mir) @@ -1895,7 +1893,7 @@ class _Swagger: ) else: raise ValueError( - "No responses specified for {} {}".format(resource_path, method_name) + f"No responses specified for {resource_path} {method_name}" ) return ret @@ -2042,7 +2040,7 @@ def usage_plan_present( description=description, throttle=throttle, quota=quota, - **common_args + **common_args, ) if "error" in result: ret["result"] = False @@ -2052,7 +2050,7 @@ def usage_plan_present( return ret ret["changes"]["old"] = {"plan": None} - ret["comment"] = "A new usage plan {} has been created".format(plan_name) + ret["comment"] = f"A new usage plan {plan_name} has been created" else: # need an existing plan modified to match given value @@ -2097,7 +2095,7 @@ def usage_plan_present( return ret ret["changes"]["old"] = {"plan": plan} - ret["comment"] = "usage plan {} has been updated".format(plan_name) + ret["comment"] = f"usage plan {plan_name} has been updated" newstate = __salt__["boto_apigateway.describe_usage_plans"]( name=plan_name, **common_args @@ -2111,7 +2109,7 @@ def usage_plan_present( except (ValueError, OSError) as e: ret["result"] = False - ret["comment"] = "{}".format(e.args) + ret["comment"] = f"{e.args}" return ret @@ -2152,7 +2150,7 @@ def usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profil return ret if not existing["plans"]: - ret["comment"] = "Usage plan {} does not exist already".format(plan_name) + ret["comment"] = f"Usage plan {plan_name} does not exist already" return ret if __opts__["test"]: @@ -2172,13 +2170,13 @@ def usage_plan_absent(name, plan_name, region=None, key=None, keyid=None, profil ) return ret - ret["comment"] = "Usage plan {} has been deleted".format(plan_name) + ret["comment"] = f"Usage plan {plan_name} has been deleted" ret["changes"]["old"] = {"plan": existing["plans"][0]} ret["changes"]["new"] = {"plan": None} except (ValueError, OSError) as e: ret["result"] = False - ret["comment"] = "{}".format(e.args) + ret["comment"] = f"{e.args}" return ret @@ -2234,7 +2232,7 @@ def usage_plan_association_present( return ret if not existing["plans"]: - ret["comment"] = "Usage plan {} does not exist".format(plan_name) + ret["comment"] = f"Usage plan {plan_name} does not exist" ret["result"] = False return ret @@ -2277,7 +2275,7 @@ def usage_plan_association_present( except (ValueError, OSError) as e: ret["result"] = False - ret["comment"] = "{}".format(e.args) + ret["comment"] = f"{e.args}" return ret @@ -2335,7 +2333,7 @@ def usage_plan_association_absent( return ret if not existing["plans"]: - ret["comment"] = "Usage plan {} does not exist".format(plan_name) + ret["comment"] = f"Usage plan {plan_name} does not exist" ret["result"] = False return ret @@ -2384,6 +2382,6 @@ def usage_plan_association_absent( except (ValueError, OSError) as e: ret["result"] = False - ret["comment"] = "{}".format(e.args) + ret["comment"] = f"{e.args}" return ret diff --git a/salt/states/boto_asg.py b/salt/states/boto_asg.py index 2734aec50c3..64d44574773 100644 --- a/salt/states/boto_asg.py +++ b/salt/states/boto_asg.py @@ -449,7 +449,7 @@ def present( ret["result"] = False return ret if "id" not in r: - ret["comment"] = "Subnet {} does not exist.".format(i) + ret["comment"] = f"Subnet {i} does not exist." ret["result"] = False return ret vpc_zone_identifier.append(r["id"]) @@ -829,7 +829,7 @@ def _alarms_present( if "scaling_policy" not in action: scaling_policy_actions_only = False if ":self:" in action: - action = action.replace(":self:", ":{}:".format(name)) + action = action.replace(":self:", f":{name}:") new_actions.append(action) info["attributes"][action_type] = new_actions # skip alarms that only have actions for scaling policy, if min_size == max_size for this ASG diff --git a/salt/states/boto_cfn.py b/salt/states/boto_cfn.py index 971514a3b6b..bd748eb410f 100644 --- a/salt/states/boto_cfn.py +++ b/salt/states/boto_cfn.py @@ -56,7 +56,7 @@ def __virtual__(): else: return ( False, - "Cannot load {} state: boto_cfn module unavailable".format(__virtualname__), + f"Cannot load {__virtualname__} state: boto_cfn module unavailable", ) @@ -177,7 +177,7 @@ def present( log.debug("Templates are not the same. Compare value is %s", compare) # At this point we should be able to run update safely since we already validated the template if __opts__["test"]: - ret["comment"] = "Stack {} is set to be updated.".format(name) + ret["comment"] = f"Stack {name} is set to be updated." ret["result"] = None return ret updated = __salt__["boto_cfn.update_stack"]( @@ -213,11 +213,11 @@ def present( ) ret["changes"]["new"] = updated return ret - ret["comment"] = "Stack {} exists.".format(name) + ret["comment"] = f"Stack {name} exists." ret["changes"] = {} return ret if __opts__["test"]: - ret["comment"] = "Stack {} is set to be created.".format(name) + ret["comment"] = f"Stack {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_cfn.create"]( @@ -239,7 +239,7 @@ def present( profile, ) if created: - ret["comment"] = "Stack {} was created.".format(name) + ret["comment"] = f"Stack {name} was created." ret["changes"]["new"] = created return ret ret["result"] = False @@ -263,11 +263,11 @@ def absent(name, region=None, key=None, keyid=None, profile=None): """ ret = {"name": name, "result": True, "comment": "", "changes": {}} if not __salt__["boto_cfn.exists"](name, region, key, keyid, profile): - ret["comment"] = "Stack {} does not exist.".format(name) + ret["comment"] = f"Stack {name} does not exist." ret["changes"] = {} return ret if __opts__["test"]: - ret["comment"] = "Stack {} is set to be deleted.".format(name) + ret["comment"] = f"Stack {name} is set to be deleted." ret["result"] = None return ret deleted = __salt__["boto_cfn.delete"](name, region, key, keyid, profile) @@ -280,7 +280,7 @@ def absent(name, region=None, key=None, keyid=None, profile=None): ret["changes"] = {} return ret if deleted: - ret["comment"] = "Stack {} was deleted.".format(name) + ret["comment"] = f"Stack {name} was deleted." ret["changes"]["deleted"] = name return ret @@ -293,7 +293,7 @@ def _get_template(template, name): return __salt__["cp.get_file_str"](template) except OSError as e: log.debug(e) - ret["comment"] = "File {} not found.".format(template) + ret["comment"] = f"File {template} not found." ret["result"] = False return ret return template diff --git a/salt/states/boto_cloudfront.py b/salt/states/boto_cloudfront.py index fbfe1602eaa..0bdd44d13bb 100644 --- a/salt/states/boto_cloudfront.py +++ b/salt/states/boto_cloudfront.py @@ -131,7 +131,7 @@ def present( if old is None: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Distribution {} set for creation.".format(name) + ret["comment"] = f"Distribution {name} set for creation." ret["changes"] = {"old": None, "new": name} return ret @@ -153,7 +153,7 @@ def present( return ret ret["result"] = True - ret["comment"] = "Created distribution {}.".format(name) + ret["comment"] = f"Created distribution {name}." ret["changes"] = {"old": None, "new": name} return ret else: @@ -198,7 +198,7 @@ def present( if __opts__["test"]: ret["result"] = None ret["comment"] = "\n".join( - ["Distribution {} set for new config:".format(name), changes_diff] + [f"Distribution {name} set for new config:", changes_diff] ) ret["changes"] = {"diff": changes_diff} return ret @@ -221,6 +221,6 @@ def present( return ret ret["result"] = True - ret["comment"] = "Updated distribution {}.".format(name) + ret["comment"] = f"Updated distribution {name}." ret["changes"] = {"diff": changes_diff} return ret diff --git a/salt/states/boto_cloudtrail.py b/salt/states/boto_cloudtrail.py index dc8a12b153a..d4cf62f5be3 100644 --- a/salt/states/boto_cloudtrail.py +++ b/salt/states/boto_cloudtrail.py @@ -164,7 +164,7 @@ def present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "CloudTrail {} is set to be created.".format(Name) + ret["comment"] = f"CloudTrail {Name} is set to be created." ret["result"] = None return ret r = __salt__["boto_cloudtrail.create"]( @@ -192,7 +192,7 @@ def present( ) ret["changes"]["old"] = {"trail": None} ret["changes"]["new"] = _describe - ret["comment"] = "CloudTrail {} created.".format(Name) + ret["comment"] = f"CloudTrail {Name} created." if LoggingEnabled: r = __salt__["boto_cloudtrail.start_logging"]( @@ -223,9 +223,7 @@ def present( ret["changes"]["new"]["trail"]["Tags"] = Tags return ret - ret["comment"] = os.linesep.join( - [ret["comment"], "CloudTrail {} is present.".format(Name)] - ) + ret["comment"] = os.linesep.join([ret["comment"], f"CloudTrail {Name} is present."]) ret["changes"] = {} # trail exists, ensure config matches _describe = __salt__["boto_cloudtrail.describe"]( @@ -277,7 +275,7 @@ def present( if need_update: if __opts__["test"]: - msg = "CloudTrail {} set to be modified.".format(Name) + msg = f"CloudTrail {Name} set to be modified." ret["comment"] = msg ret["result"] = None return ret @@ -344,7 +342,7 @@ def present( key=key, keyid=keyid, profile=profile, - **adds + **adds, ) if bool(removes): r = __salt__["boto_cloudtrail.remove_tags"]( @@ -353,7 +351,7 @@ def present( key=key, keyid=keyid, profile=profile, - **removes + **removes, ) return ret @@ -394,11 +392,11 @@ def absent(name, Name, region=None, key=None, keyid=None, profile=None): return ret if r and not r["exists"]: - ret["comment"] = "CloudTrail {} does not exist.".format(Name) + ret["comment"] = f"CloudTrail {Name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "CloudTrail {} is set to be removed.".format(Name) + ret["comment"] = f"CloudTrail {Name} is set to be removed." ret["result"] = None return ret r = __salt__["boto_cloudtrail.delete"]( @@ -410,5 +408,5 @@ def absent(name, Name, region=None, key=None, keyid=None, profile=None): return ret ret["changes"]["old"] = {"trail": Name} ret["changes"]["new"] = {"trail": None} - ret["comment"] = "CloudTrail {} deleted.".format(Name) + ret["comment"] = f"CloudTrail {Name} deleted." return ret diff --git a/salt/states/boto_cloudwatch_alarm.py b/salt/states/boto_cloudwatch_alarm.py index 25600b363e7..5a931ef2ae2 100644 --- a/salt/states/boto_cloudwatch_alarm.py +++ b/salt/states/boto_cloudwatch_alarm.py @@ -105,7 +105,7 @@ def present(name, attributes, region=None, key=None, keyid=None, profile=None): if alarm_details: for k, v in attributes.items(): if k not in alarm_details: - difference.append("{}={} (new)".format(k, v)) + difference.append(f"{k}={v} (new)") continue v = salt.utils.data.decode(v) v2 = salt.utils.data.decode(alarm_details[k]) @@ -119,7 +119,7 @@ def present(name, attributes, region=None, key=None, keyid=None, profile=None): continue if isinstance(v, list) and sorted(v) == sorted(v2): continue - difference.append("{}='{}' was: '{}'".format(k, v, v2)) + difference.append(f"{k}='{v}' was: '{v2}'") else: difference.append("new alarm") create_or_update_alarm_args = { @@ -133,10 +133,10 @@ def present(name, attributes, region=None, key=None, keyid=None, profile=None): if alarm_details: # alarm is present. update, or do nothing # check to see if attributes matches is_present. If so, do nothing. if len(difference) == 0: - ret["comment"] = "alarm {} present and matching".format(name) + ret["comment"] = f"alarm {name} present and matching" return ret if __opts__["test"]: - msg = "alarm {} is to be created/updated.".format(name) + msg = f"alarm {name} is to be created/updated." ret["comment"] = msg ret["result"] = None return ret @@ -147,10 +147,10 @@ def present(name, attributes, region=None, key=None, keyid=None, profile=None): ret["changes"]["diff"] = difference else: ret["result"] = False - ret["comment"] = "Failed to create {} alarm".format(name) + ret["comment"] = f"Failed to create {name} alarm" else: # alarm is absent. create it. if __opts__["test"]: - msg = "alarm {} is to be created/updated.".format(name) + msg = f"alarm {name} is to be created/updated." ret["comment"] = msg ret["result"] = None return ret @@ -161,7 +161,7 @@ def present(name, attributes, region=None, key=None, keyid=None, profile=None): ret["changes"]["new"] = attributes else: ret["result"] = False - ret["comment"] = "Failed to create {} alarm".format(name) + ret["comment"] = f"Failed to create {name} alarm" return ret @@ -193,7 +193,7 @@ def absent(name, region=None, key=None, keyid=None, profile=None): if is_present: if __opts__["test"]: - ret["comment"] = "alarm {} is set to be removed.".format(name) + ret["comment"] = f"alarm {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_cloudwatch.delete_alarm"]( @@ -204,8 +204,8 @@ def absent(name, region=None, key=None, keyid=None, profile=None): ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to delete {} alarm.".format(name) + ret["comment"] = f"Failed to delete {name} alarm." else: - ret["comment"] = "{} does not exist in {}.".format(name, region) + ret["comment"] = f"{name} does not exist in {region}." return ret diff --git a/salt/states/boto_cloudwatch_event.py b/salt/states/boto_cloudwatch_event.py index 65c460ca28b..1e718b374cc 100644 --- a/salt/states/boto_cloudwatch_event.py +++ b/salt/states/boto_cloudwatch_event.py @@ -182,7 +182,7 @@ def present( return ret ret["changes"]["old"] = {"rule": None} ret["changes"]["new"] = _describe - ret["comment"] = "CloudTrail {} created.".format(Name) + ret["comment"] = f"CloudTrail {Name} created." if bool(Targets): r = __salt__["boto_cloudwatch_event.put_targets"]( @@ -204,7 +204,7 @@ def present( return ret ret["comment"] = os.linesep.join( - [ret["comment"], "CloudWatch event rule {} is present.".format(Name)] + [ret["comment"], f"CloudWatch event rule {Name} is present."] ) ret["changes"] = {} # trail exists, ensure config matches @@ -249,7 +249,7 @@ def present( if need_update: if __opts__["test"]: - msg = "CloudWatch event rule {} set to be modified.".format(Name) + msg = f"CloudWatch event rule {Name} set to be modified." ret["comment"] = msg ret["result"] = None return ret @@ -360,11 +360,11 @@ def absent(name, Name=None, region=None, key=None, keyid=None, profile=None): return ret if r and not r["exists"]: - ret["comment"] = "CloudWatch event rule {} does not exist.".format(Name) + ret["comment"] = f"CloudWatch event rule {Name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "CloudWatch event rule {} is set to be removed.".format(Name) + ret["comment"] = f"CloudWatch event rule {Name} is set to be removed." ret["result"] = None return ret @@ -405,5 +405,5 @@ def absent(name, Name=None, region=None, key=None, keyid=None, profile=None): return ret ret["changes"]["old"] = {"rule": Name} ret["changes"]["new"] = {"rule": None} - ret["comment"] = "CloudWatch event rule {} deleted.".format(Name) + ret["comment"] = f"CloudWatch event rule {Name} deleted." return ret diff --git a/salt/states/boto_cognitoidentity.py b/salt/states/boto_cognitoidentity.py index 41f8e3dc573..a6115f9f49a 100644 --- a/salt/states/boto_cognitoidentity.py +++ b/salt/states/boto_cognitoidentity.py @@ -108,7 +108,7 @@ def _role_present( IdentityPoolId=IdentityPoolId, AuthenticatedRole=AuthenticatedRole, UnauthenticatedRole=UnauthenticatedRole, - **conn_params + **conn_params, ) if not r.get("set"): ret["result"] = False @@ -298,7 +298,7 @@ def pool_present( if existing_identity_pool != updated_identity_pool: ret["changes"]["old"] = dict() ret["changes"]["new"] = dict() - change_key = "Identity Pool Name {}".format(IdentityPoolName) + change_key = f"Identity Pool Name {IdentityPoolName}" ret["changes"]["old"][change_key] = existing_identity_pool ret["changes"]["new"][change_key] = updated_identity_pool else: @@ -412,12 +412,10 @@ def pool_absent( if not ret["changes"]: ret["changes"]["old"] = dict() ret["changes"]["new"] = dict() - change_key = "Identity Pool Id {}".format(IdentityPoolId) + change_key = f"Identity Pool Id {IdentityPoolId}" ret["changes"]["old"][change_key] = IdentityPoolName ret["changes"]["new"][change_key] = None - ret["comment"] = "{}\n{}".format( - ret["comment"], "{} deleted".format(change_key) - ) + ret["comment"] = "{}\n{}".format(ret["comment"], f"{change_key} deleted") else: ret["result"] = False failure_comment = ( diff --git a/salt/states/boto_datapipeline.py b/salt/states/boto_datapipeline.py index 40735585868..0ed8ab42257 100644 --- a/salt/states/boto_datapipeline.py +++ b/salt/states/boto_datapipeline.py @@ -132,11 +132,11 @@ def present( profile=profile, ) if present: - ret["comment"] = "AWS data pipeline {} present".format(name) + ret["comment"] = f"AWS data pipeline {name} present" return ret if __opts__["test"]: - ret["comment"] = "Data pipeline {} is set to be created or updated".format(name) + ret["comment"] = f"Data pipeline {name} is set to be created or updated" ret["result"] = None return ret @@ -259,10 +259,10 @@ def present( if not old_pipeline_definition: ret["changes"]["new"] = "Pipeline created." - ret["comment"] = "Data pipeline {} created".format(name) + ret["comment"] = f"Data pipeline {name} created" else: ret["changes"]["diff"] = _diff(old_pipeline_definition, new_pipeline_definition) - ret["comment"] = "Data pipeline {} updated".format(name) + ret["comment"] = f"Data pipeline {name} updated" return ret @@ -595,7 +595,7 @@ def absent(name, region=None, key=None, keyid=None, profile=None): if "error" not in result_pipeline_id: pipeline_id = result_pipeline_id["result"] if __opts__["test"]: - ret["comment"] = "Data pipeline {} set to be deleted.".format(name) + ret["comment"] = f"Data pipeline {name} set to be deleted." ret["result"] = None return ret else: @@ -609,6 +609,6 @@ def absent(name, region=None, key=None, keyid=None, profile=None): ret["changes"]["old"] = {"pipeline_id": pipeline_id} ret["changes"]["new"] = None else: - ret["comment"] = "AWS data pipeline {} absent.".format(name) + ret["comment"] = f"AWS data pipeline {name} absent." return ret diff --git a/salt/states/boto_dynamodb.py b/salt/states/boto_dynamodb.py index 8e563ba0574..505f0f11a63 100644 --- a/salt/states/boto_dynamodb.py +++ b/salt/states/boto_dynamodb.py @@ -284,7 +284,7 @@ def present( if not table_exists: if __opts__["test"]: ret["result"] = None - ret["comment"] = "DynamoDB table {} would be created.".format(name) + ret["comment"] = f"DynamoDB table {name} would be created." return ret else: is_created = __salt__["boto_dynamodb.create_table"]( @@ -304,11 +304,11 @@ def present( ) if not is_created: ret["result"] = False - ret["comment"] = "Failed to create table {}".format(name) + ret["comment"] = f"Failed to create table {name}" _add_changes(ret, changes_old, changes_new) return ret - comments.append("DynamoDB table {} was successfully created".format(name)) + comments.append(f"DynamoDB table {name} was successfully created") changes_new["table"] = name changes_new["read_capacity_units"] = read_capacity_units changes_new["write_capacity_units"] = write_capacity_units @@ -319,7 +319,7 @@ def present( changes_new["local_indexes"] = local_indexes changes_new["global_indexes"] = global_indexes else: - comments.append("DynamoDB table {} exists".format(name)) + comments.append(f"DynamoDB table {name} exists") # Ensure DynamoDB table provisioned throughput matches description = __salt__["boto_dynamodb.describe"](name, region, key, keyid, profile) @@ -335,7 +335,7 @@ def present( if not throughput_matches: if __opts__["test"]: ret["result"] = None - comments.append("DynamoDB table {} is set to be updated.".format(name)) + comments.append(f"DynamoDB table {name} is set to be updated.") else: is_updated = __salt__["boto_dynamodb.update"]( name, @@ -350,17 +350,17 @@ def present( ) if not is_updated: ret["result"] = False - ret["comment"] = "Failed to update table {}".format(name) + ret["comment"] = f"Failed to update table {name}" _add_changes(ret, changes_old, changes_new) return ret - comments.append("DynamoDB table {} was successfully updated".format(name)) + comments.append(f"DynamoDB table {name} was successfully updated") changes_old["read_capacity_units"] = (current_read_capacity_units,) changes_old["write_capacity_units"] = (current_write_capacity_units,) changes_new["read_capacity_units"] = (read_capacity_units,) changes_new["write_capacity_units"] = (write_capacity_units,) else: - comments.append("DynamoDB table {} throughput matches".format(name)) + comments.append(f"DynamoDB table {name} throughput matches") provisioned_indexes = description.get("Table", {}).get("GlobalSecondaryIndexes", []) @@ -478,7 +478,7 @@ def _global_indexes_present( index_name = next(iter(entry.values())) if not index_name: ret["result"] = False - ret["comment"] = "Index name not found for table {}".format(name) + ret["comment"] = f"Index name not found for table {name}" return ret gsi_config[index_name] = index @@ -591,11 +591,11 @@ def _add_global_secondary_index( ) if success: - comments.append("Created GSI {}".format(index_name)) + comments.append(f"Created GSI {index_name}") changes_new["global_indexes"][index_name] = gsi_config[index_name] else: ret["result"] = False - ret["comment"] = "Failed to create GSI {}".format(index_name) + ret["comment"] = f"Failed to create GSI {index_name}" def _update_global_secondary_indexes( @@ -641,9 +641,7 @@ def _update_global_secondary_indexes( ) if success: - comments.append( - "Updated GSIs with new throughputs {}".format(index_updates) - ) + comments.append(f"Updated GSIs with new throughputs {index_updates}") for index_name in index_updates: changes_old["global_indexes"][index_name] = provisioned_throughputs[ index_name @@ -651,7 +649,7 @@ def _update_global_secondary_indexes( changes_new["global_indexes"][index_name] = index_updates[index_name] else: ret["result"] = False - ret["comment"] = "Failed to update GSI throughputs {}".format(index_updates) + ret["comment"] = f"Failed to update GSI throughputs {index_updates}" def _determine_gsi_updates(existing_index_names, provisioned_gsi_config, gsi_config): @@ -779,7 +777,7 @@ def _ensure_backup_datapipeline_present( ): kwargs = { - "name": "{}-{}-backup".format(name, schedule_name), + "name": f"{name}-{schedule_name}-backup", "pipeline_objects": { "DefaultSchedule": { "name": schedule_name, @@ -794,7 +792,7 @@ def _ensure_backup_datapipeline_present( }, "parameter_values": { "myDDBTableName": name, - "myOutputS3Loc": "{}/{}/".format(s3_base_location, name), + "myOutputS3Loc": f"{s3_base_location}/{name}/", }, } return __states__["boto_datapipeline.present"](**kwargs) @@ -860,20 +858,20 @@ def absent(name, region=None, key=None, keyid=None, profile=None): ret = {"name": name, "result": True, "comment": "", "changes": {}} exists = __salt__["boto_dynamodb.exists"](name, region, key, keyid, profile) if not exists: - ret["comment"] = "DynamoDB table {} does not exist".format(name) + ret["comment"] = f"DynamoDB table {name} does not exist" return ret if __opts__["test"]: - ret["comment"] = "DynamoDB table {} is set to be deleted".format(name) + ret["comment"] = f"DynamoDB table {name} is set to be deleted" ret["result"] = None return ret is_deleted = __salt__["boto_dynamodb.delete"](name, region, key, keyid, profile) if is_deleted: - ret["comment"] = "Deleted DynamoDB table {}".format(name) - ret["changes"].setdefault("old", "Table {} exists".format(name)) - ret["changes"].setdefault("new", "Table {} deleted".format(name)) + ret["comment"] = f"Deleted DynamoDB table {name}" + ret["changes"].setdefault("old", f"Table {name} exists") + ret["changes"].setdefault("new", f"Table {name} deleted") else: - ret["comment"] = "Failed to delete DynamoDB table {}".format(name) + ret["comment"] = f"Failed to delete DynamoDB table {name}" ret["result"] = False return ret diff --git a/salt/states/boto_ec2.py b/salt/states/boto_ec2.py index fda59c13b5b..6e7b1d3ea06 100644 --- a/salt/states/boto_ec2.py +++ b/salt/states/boto_ec2.py @@ -89,12 +89,12 @@ def key_present( upload_public = __salt__["cp.get_file_str"](upload_public) except OSError as e: log.debug(e) - ret["comment"] = "File {} not found.".format(upload_public) + ret["comment"] = f"File {upload_public} not found." ret["result"] = False return ret if not exists: if __opts__["test"]: - ret["comment"] = "The key {} is set to be created.".format(name) + ret["comment"] = f"The key {name} is set to be created." ret["result"] = None return ret if save_private and not upload_public: @@ -103,29 +103,29 @@ def key_present( ) if created: ret["result"] = True - ret["comment"] = "The key {} is created.".format(name) + ret["comment"] = f"The key {name} is created." ret["changes"]["new"] = created else: ret["result"] = False - ret["comment"] = "Could not create key {} ".format(name) + ret["comment"] = f"Could not create key {name} " elif not save_private and upload_public: imported = __salt__["boto_ec2.import_key"]( name, upload_public, region, key, keyid, profile ) if imported: ret["result"] = True - ret["comment"] = "The key {} is created.".format(name) + ret["comment"] = f"The key {name} is created." ret["changes"]["old"] = None ret["changes"]["new"] = imported else: ret["result"] = False - ret["comment"] = "Could not create key {} ".format(name) + ret["comment"] = f"Could not create key {name} " else: ret["result"] = False ret["comment"] = "You can either upload or download a private key " else: ret["result"] = True - ret["comment"] = "The key name {} already exists".format(name) + ret["comment"] = f"The key name {name} already exists" return ret @@ -137,21 +137,21 @@ def key_absent(name, region=None, key=None, keyid=None, profile=None): exists = __salt__["boto_ec2.get_key"](name, region, key, keyid, profile) if exists: if __opts__["test"]: - ret["comment"] = "The key {} is set to be deleted.".format(name) + ret["comment"] = f"The key {name} is set to be deleted." ret["result"] = None return ret deleted = __salt__["boto_ec2.delete_key"](name, region, key, keyid, profile) log.debug("exists is %s", deleted) if deleted: ret["result"] = True - ret["comment"] = "The key {} is deleted.".format(name) + ret["comment"] = f"The key {name} is deleted." ret["changes"]["old"] = name else: ret["result"] = False - ret["comment"] = "Could not delete key {} ".format(name) + ret["comment"] = f"Could not delete key {name} " else: ret["result"] = True - ret["comment"] = "The key name {} does not exist".format(name) + ret["comment"] = f"The key name {name} does not exist" return ret @@ -283,7 +283,7 @@ def eni_present( ) return ret r["result"] = result_create["result"] - ret["comment"] = "Created ENI {}".format(name) + ret["comment"] = f"Created ENI {name}" ret["changes"]["id"] = r["result"]["id"] else: _ret = _eni_attribute( @@ -421,7 +421,7 @@ def _eni_attribute(metadata, attr, value, region, key, keyid, profile): if metadata[attr] == value: return ret if __opts__["test"]: - ret["comment"] = "ENI set to have {} updated.".format(attr) + ret["comment"] = f"ENI set to have {attr} updated." ret["result"] = None return ret result_update = __salt__["boto_ec2.modify_network_interface_attribute"]( @@ -438,7 +438,7 @@ def _eni_attribute(metadata, attr, value, region, key, keyid, profile): ret["result"] = False ret["comment"] = msg.format(attr, result_update["error"]["message"]) else: - ret["comment"] = "Updated ENI {}.".format(attr) + ret["comment"] = f"Updated ENI {attr}." ret["changes"][attr] = {"old": metadata[attr], "new": value} return ret @@ -560,7 +560,7 @@ def eni_absent( result_delete["error"]["message"] ) return ret - ret["comment"] = "Deleted ENI {}".format(name) + ret["comment"] = f"Deleted ENI {name}" ret["changes"]["id"] = None if release_eip and "allocationId" in r["result"]: _ret = __salt__["boto_ec2.release_eip_address"]( @@ -589,7 +589,7 @@ def snapshot_created( instance_name, wait_until_available=True, wait_timeout_seconds=300, - **kwargs + **kwargs, ): """ Create a snapshot from the given instance @@ -601,11 +601,11 @@ def snapshot_created( if not __salt__["boto_ec2.create_image"]( ami_name=ami_name, instance_name=instance_name, **kwargs ): - ret["comment"] = "Failed to create new AMI {ami_name}".format(ami_name=ami_name) + ret["comment"] = f"Failed to create new AMI {ami_name}" ret["result"] = False return ret - ret["comment"] = "Created new AMI {ami_name}".format(ami_name=ami_name) + ret["comment"] = f"Created new AMI {ami_name}" ret["changes"]["new"] = {ami_name: ami_name} if not wait_until_available: return ret @@ -887,7 +887,7 @@ def instance_present( if _create: if __opts__["test"]: - ret["comment"] = "The instance {} is set to be created.".format(name) + ret["comment"] = f"The instance {name} is set to be created." ret["result"] = None return ret if image_name: @@ -1014,7 +1014,7 @@ def instance_present( return ret else: if __opts__["test"]: - ret["comment"] = "Instance {} to be updated.".format(name) + ret["comment"] = f"Instance {name} to be updated." ret["result"] = None return ret r = __salt__["boto_ec2.associate_eip_address"]( @@ -1247,7 +1247,7 @@ def instance_absent( ) if not instances: ret["result"] = True - ret["comment"] = "Instance {} is already gone.".format(instance_id) + ret["comment"] = f"Instance {instance_id} is already gone." return ret instance = instances[0] @@ -1268,7 +1268,7 @@ def instance_absent( return ret if __opts__["test"]: - ret["comment"] = "The instance {} is set to be deleted.".format(name) + ret["comment"] = f"The instance {name} is set to be deleted." ret["result"] = None return ret @@ -1282,7 +1282,7 @@ def instance_absent( ) if not r: ret["result"] = False - ret["comment"] = "Failed to terminate instance {}.".format(instance_id) + ret["comment"] = f"Failed to terminate instance {instance_id}." return ret ret["changes"]["old"] = {"instance_id": instance_id} @@ -1308,9 +1308,7 @@ def instance_absent( else: # I /believe/ this situation is impossible but let's hedge our bets... ret["result"] = False - ret["comment"] = ( - "Can't determine AllocationId for address {}.".format(ip) - ) + ret["comment"] = f"Can't determine AllocationId for address {ip}." return ret else: public_ip = instance.ip_address @@ -1329,7 +1327,7 @@ def instance_absent( ret["changes"]["old"]["public_ip"] = public_ip or r[0]["public_ip"] else: ret["result"] = False - ret["comment"] = "Failed to release EIP {}.".format(ip) + ret["comment"] = f"Failed to release EIP {ip}." return ret return ret @@ -1449,14 +1447,14 @@ def volume_absent( log.info("Matched Volume ID %s", vol) if __opts__["test"]: - ret["comment"] = "The volume {} is set to be deleted.".format(vol) + ret["comment"] = f"The volume {vol} is set to be deleted." ret["result"] = None return ret if __salt__["boto_ec2.delete_volume"](volume_id=vol, force=True, **args): - ret["comment"] = "Volume {} deleted.".format(vol) + ret["comment"] = f"Volume {vol} deleted." ret["changes"] = {"old": {"volume_id": vol}, "new": {"volume_id": None}} else: - ret["comment"] = "Error deleting volume {}.".format(vol) + ret["comment"] = f"Error deleting volume {vol}." ret["result"] = False return ret @@ -1664,9 +1662,7 @@ def volume_present( name=instance_name, in_states=running_states, **args ) if not instance_id: - raise SaltInvocationError( - "Instance with Name {} not found.".format(instance_name) - ) + raise SaltInvocationError(f"Instance with Name {instance_name} not found.") instances = __salt__["boto_ec2.find_instances"]( instance_id=instance_id, return_objs=True, **args @@ -1699,13 +1695,13 @@ def volume_present( encrypted=encrypted, kms_key_id=kms_key_id, wait_for_creation=True, - **args + **args, ) if "result" in _rt: volume_id = _rt["result"] else: raise SaltInvocationError( - "Error creating volume with name {}.".format(volume_name) + f"Error creating volume with name {volume_name}." ) _rt = __salt__["boto_ec2.set_volumes_tags"]( tag_maps=[ @@ -1714,7 +1710,7 @@ def volume_present( "tags": {"Name": volume_name}, } ], - **args + **args, ) if _rt["success"] is False: raise SaltInvocationError( @@ -1730,7 +1726,7 @@ def volume_present( volume_ids=[volume_id], return_objs=True, **args ) if len(vols) < 1: - raise SaltInvocationError("Volume {} do not exist".format(volume_id)) + raise SaltInvocationError(f"Volume {volume_id} do not exist") vol = vols[0] if vol.zone != instance.placement: raise SaltInvocationError( diff --git a/salt/states/boto_elasticache.py b/salt/states/boto_elasticache.py index 475f165484f..b5520bfc7da 100644 --- a/salt/states/boto_elasticache.py +++ b/salt/states/boto_elasticache.py @@ -226,7 +226,7 @@ def present( return ret elif not config: if __opts__["test"]: - msg = "Cache cluster {} is set to be created.".format(name) + msg = f"Cache cluster {name} is set to be created." ret["comment"] = msg ret["result"] = None return ret @@ -260,11 +260,11 @@ def present( ret["changes"]["new"] = config else: ret["result"] = False - ret["comment"] = "Failed to create {} cache cluster.".format(name) + ret["comment"] = f"Failed to create {name} cache cluster." return ret # TODO: support modification of existing elasticache clusters else: - ret["comment"] = "Cache cluster {} is present.".format(name) + ret["comment"] = f"Cache cluster {name} is present." return ret @@ -319,7 +319,7 @@ def subnet_group_present( ) if not exists: if __opts__["test"]: - ret["comment"] = "Subnet group {} is set to be created.".format(name) + ret["comment"] = f"Subnet group {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_elasticache.create_subnet_group"]( @@ -335,11 +335,11 @@ def subnet_group_present( ) if not created: ret["result"] = False - ret["comment"] = "Failed to create {} subnet group.".format(name) + ret["comment"] = f"Failed to create {name} subnet group." return ret ret["changes"]["old"] = None ret["changes"]["new"] = name - ret["comment"] = "Subnet group {} created.".format(name) + ret["comment"] = f"Subnet group {name} created." return ret ret["comment"] = "Subnet group present." return ret @@ -379,7 +379,7 @@ def absent(name, wait=True, region=None, key=None, keyid=None, profile=None): if is_present: if __opts__["test"]: - ret["comment"] = "Cache cluster {} is set to be removed.".format(name) + ret["comment"] = f"Cache cluster {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_elasticache.delete"]( @@ -390,9 +390,9 @@ def absent(name, wait=True, region=None, key=None, keyid=None, profile=None): ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to delete {} cache cluster.".format(name) + ret["comment"] = f"Failed to delete {name} cache cluster." else: - ret["comment"] = "{} does not exist in {}.".format(name, region) + ret["comment"] = f"{name} does not exist in {region}." return ret @@ -444,7 +444,7 @@ def creategroup( ) if not is_present: if __opts__["test"]: - ret["comment"] = "Replication {} is set to be created.".format(name) + ret["comment"] = f"Replication {name} is set to be created." ret["result"] = None created = __salt__["boto_elasticache.create_replication_group"]( name, @@ -465,9 +465,9 @@ def creategroup( ret["result"] = True else: ret["result"] = False - ret["comment"] = "Failed to create {} replication group.".format(name) + ret["comment"] = f"Failed to create {name} replication group." else: - ret["comment"] = "{} replication group exists .".format(name) + ret["comment"] = f"{name} replication group exists ." ret["result"] = True return ret @@ -482,7 +482,7 @@ def subnet_group_absent( ) if not exists: ret["result"] = True - ret["comment"] = "{} ElastiCache subnet group does not exist.".format(name) + ret["comment"] = f"{name} ElastiCache subnet group does not exist." return ret if __opts__["test"]: @@ -496,11 +496,11 @@ def subnet_group_absent( ) if not deleted: ret["result"] = False - ret["comment"] = "Failed to delete {} ElastiCache subnet group.".format(name) + ret["comment"] = f"Failed to delete {name} ElastiCache subnet group." return ret ret["changes"]["old"] = name ret["changes"]["new"] = None - ret["comment"] = "ElastiCache subnet group {} deleted.".format(name) + ret["comment"] = f"ElastiCache subnet group {name} deleted." return ret @@ -514,14 +514,12 @@ def replication_group_absent( ) if not exists: ret["result"] = True - ret["comment"] = "{} ElastiCache replication group does not exist.".format(name) + ret["comment"] = f"{name} ElastiCache replication group does not exist." log.info(ret["comment"]) return ret if __opts__["test"]: - ret["comment"] = ( - "ElastiCache replication group {} is set to be removed.".format(name) - ) + ret["comment"] = f"ElastiCache replication group {name} is set to be removed." ret["result"] = True return ret deleted = __salt__["boto_elasticache.delete_replication_group"]( @@ -536,6 +534,6 @@ def replication_group_absent( return ret ret["changes"]["old"] = name ret["changes"]["new"] = None - ret["comment"] = "ElastiCache replication group {} deleted.".format(name) + ret["comment"] = f"ElastiCache replication group {name} deleted." log.info(ret["comment"]) return ret diff --git a/salt/states/boto_elasticsearch_domain.py b/salt/states/boto_elasticsearch_domain.py index c0f1f8b059b..e682c463257 100644 --- a/salt/states/boto_elasticsearch_domain.py +++ b/salt/states/boto_elasticsearch_domain.py @@ -221,7 +221,7 @@ def present( AccessPolicies = salt.utils.json.loads(AccessPolicies) except ValueError as e: ret["result"] = False - ret["comment"] = "Failed to create domain: {}.".format(e.message) + ret["comment"] = f"Failed to create domain: {e.message}." return ret r = __salt__["boto_elasticsearch_domain.exists"]( DomainName=DomainName, region=region, key=key, keyid=keyid, profile=profile @@ -234,7 +234,7 @@ def present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Domain {} is set to be created.".format(DomainName) + ret["comment"] = f"Domain {DomainName} is set to be created." ret["result"] = None return ret r = __salt__["boto_elasticsearch_domain.create"]( @@ -261,11 +261,11 @@ def present( ) ret["changes"]["old"] = {"domain": None} ret["changes"]["new"] = _describe - ret["comment"] = "Domain {} created.".format(DomainName) + ret["comment"] = f"Domain {DomainName} created." return ret ret["comment"] = os.linesep.join( - [ret["comment"], "Domain {} is present.".format(DomainName)] + [ret["comment"], f"Domain {DomainName} is present."] ) ret["changes"] = {} # domain exists, ensure config matches @@ -310,7 +310,7 @@ def present( ret["changes"].setdefault("old", {})[k] = _describe[k] if need_update: if __opts__["test"]: - msg = "Domain {} set to be modified.".format(DomainName) + msg = f"Domain {DomainName} set to be modified." ret["comment"] = msg ret["result"] = None return ret @@ -323,7 +323,7 @@ def present( key=key, keyid=keyid, profile=profile, - **comm_args + **comm_args, ) if not r.get("updated"): ret["result"] = False @@ -368,11 +368,11 @@ def absent(name, DomainName, region=None, key=None, keyid=None, profile=None): return ret if r and not r["exists"]: - ret["comment"] = "Domain {} does not exist.".format(DomainName) + ret["comment"] = f"Domain {DomainName} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Domain {} is set to be removed.".format(DomainName) + ret["comment"] = f"Domain {DomainName} is set to be removed." ret["result"] = None return ret @@ -385,5 +385,5 @@ def absent(name, DomainName, region=None, key=None, keyid=None, profile=None): return ret ret["changes"]["old"] = {"domain": DomainName} ret["changes"]["new"] = {"domain": None} - ret["comment"] = "Domain {} deleted.".format(DomainName) + ret["comment"] = f"Domain {DomainName} deleted." return ret diff --git a/salt/states/boto_elb.py b/salt/states/boto_elb.py index 73a3f7d62e3..7499f9c1008 100644 --- a/salt/states/boto_elb.py +++ b/salt/states/boto_elb.py @@ -548,7 +548,7 @@ def present( if __salt__["boto_elb.set_instances"]( name, instance_ids, True, region, key, keyid, profile ): - ret["comment"] += " ELB {} instances would be updated.".format(name) + ret["comment"] += f" ELB {name} instances would be updated." ret["result"] = None else: success = __salt__["boto_elb.set_instances"]( @@ -591,7 +591,7 @@ def register_instances( ret = {"name": name, "result": True, "comment": "", "changes": {}} lb = __salt__["boto_elb.exists"](name, region, key, keyid, profile) if not lb: - msg = "Could not find lb {}".format(name) + msg = f"Could not find lb {name}" log.error(msg) ret.update({"comment": msg, "result": False}) return ret @@ -610,7 +610,7 @@ def register_instances( return ret if __opts__["test"]: - ret["comment"] = "ELB {} is set to register : {}.".format(name, new) + ret["comment"] = f"ELB {name} is set to register : {new}." ret["result"] = None return ret @@ -618,7 +618,7 @@ def register_instances( name, instances, region, key, keyid, profile ) if state: - msg = "Load Balancer {} has been changed".format(name) + msg = f"Load Balancer {name} has been changed" log.info(msg) new = set().union(nodes, instances) ret.update( @@ -628,7 +628,7 @@ def register_instances( } ) else: - msg = "Load balancer {} failed to add instances".format(name) + msg = f"Load balancer {name} failed to add instances" log.error(msg) ret.update({"comment": msg, "result": False}) return ret @@ -705,7 +705,7 @@ def _elb_present( ret["result"] = False return ret if "id" not in r: - ret["comment"] = "Subnet {} does not exist.".format(i) + ret["comment"] = f"Subnet {i} does not exist." ret["result"] = False return ret subnets.append(r["id"]) @@ -717,7 +717,7 @@ def _elb_present( ) vpc_id = vpc_id.get("vpc_id") if not vpc_id: - ret["comment"] = "Subnets {} do not map to a valid vpc id.".format(subnets) + ret["comment"] = f"Subnets {subnets} do not map to a valid vpc id." ret["result"] = False return ret _security_groups = __salt__["boto_secgroup.convert_to_group_ids"]( @@ -739,7 +739,7 @@ def _elb_present( exists = __salt__["boto_elb.exists"](name, region, key, keyid, profile) if not exists: if __opts__["test"]: - ret["comment"] = "ELB {} is set to be created.".format(name) + ret["comment"] = f"ELB {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_elb.create"]( @@ -757,12 +757,12 @@ def _elb_present( if created: ret["changes"]["old"] = {"elb": None} ret["changes"]["new"] = {"elb": name} - ret["comment"] = "ELB {} created.".format(name) + ret["comment"] = f"ELB {name} created." else: ret["result"] = False - ret["comment"] = "Failed to create {} ELB.".format(name) + ret["comment"] = f"Failed to create {name} ELB." else: - ret["comment"] = "ELB {} present.".format(name) + ret["comment"] = f"ELB {name} present." _ret = _security_groups_present( name, _security_groups, region, key, keyid, profile ) @@ -804,7 +804,7 @@ def _listeners_present(name, listeners, region, key, keyid, profile): ret = {"result": True, "comment": "", "changes": {}} lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) if not lb: - ret["comment"] = "{} ELB configuration could not be retrieved.".format(name) + ret["comment"] = f"{name} ELB configuration could not be retrieved." ret["result"] = False return ret if not listeners: @@ -832,7 +832,7 @@ def _listeners_present(name, listeners, region, key, keyid, profile): if __opts__["test"]: msg = [] if to_create or to_delete: - msg.append("ELB {} set to have listeners modified:".format(name)) + msg.append(f"ELB {name} set to have listeners modified:") for listener in to_create: msg.append( "Listener {} added.".format( @@ -847,7 +847,7 @@ def _listeners_present(name, listeners, region, key, keyid, profile): ) ret["result"] = None else: - msg.append("Listeners already set on ELB {}.".format(name)) + msg.append(f"Listeners already set on ELB {name}.") ret["comment"] = " ".join(msg) return ret @@ -857,9 +857,9 @@ def _listeners_present(name, listeners, region, key, keyid, profile): name, ports, region, key, keyid, profile ) if deleted: - ret["comment"] = "Deleted listeners on {} ELB.".format(name) + ret["comment"] = f"Deleted listeners on {name} ELB." else: - ret["comment"] = "Failed to delete listeners on {} ELB.".format(name) + ret["comment"] = f"Failed to delete listeners on {name} ELB." ret["result"] = False if to_create: @@ -880,7 +880,7 @@ def _listeners_present(name, listeners, region, key, keyid, profile): lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) ret["changes"]["listeners"]["new"] = lb["listeners"] else: - ret["comment"] = "Listeners already set on ELB {}.".format(name) + ret["comment"] = f"Listeners already set on ELB {name}." return ret @@ -889,7 +889,7 @@ def _security_groups_present(name, security_groups, region, key, keyid, profile) ret = {"result": True, "comment": "", "changes": {}} lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) if not lb: - ret["comment"] = "{} ELB configuration could not be retrieved.".format(name) + ret["comment"] = f"{name} ELB configuration could not be retrieved." ret["result"] = False return ret if not security_groups: @@ -899,21 +899,21 @@ def _security_groups_present(name, security_groups, region, key, keyid, profile) change_needed = True if change_needed: if __opts__["test"]: - ret["comment"] = "ELB {} set to have security groups modified.".format(name) + ret["comment"] = f"ELB {name} set to have security groups modified." ret["result"] = None return ret changed = __salt__["boto_elb.apply_security_groups"]( name, security_groups, region, key, keyid, profile ) if changed: - ret["comment"] = "Modified security_groups on {} ELB.".format(name) + ret["comment"] = f"Modified security_groups on {name} ELB." else: - ret["comment"] = "Failed to modify security_groups on {} ELB.".format(name) + ret["comment"] = f"Failed to modify security_groups on {name} ELB." ret["result"] = False ret["changes"]["old"] = {"security_groups": lb["security_groups"]} ret["changes"]["new"] = {"security_groups": security_groups} else: - ret["comment"] = "security_groups already set on ELB {}.".format(name) + ret["comment"] = f"security_groups already set on ELB {name}." return ret @@ -922,7 +922,7 @@ def _attributes_present(name, attributes, region, key, keyid, profile): _attributes = __salt__["boto_elb.get_attributes"](name, region, key, keyid, profile) if not _attributes: ret["result"] = False - ret["comment"] = "Failed to retrieve attributes for ELB {}.".format(name) + ret["comment"] = f"Failed to retrieve attributes for ELB {name}." return ret attrs_to_set = [] if "cross_zone_load_balancing" in attributes: @@ -954,7 +954,7 @@ def _attributes_present(name, attributes, region, key, keyid, profile): ) if attrs_to_set: if __opts__["test"]: - ret["comment"] = "ELB {} set to have attributes set.".format(name) + ret["comment"] = f"ELB {name} set to have attributes set." ret["result"] = None return ret was_set = __salt__["boto_elb.set_attributes"]( @@ -963,12 +963,12 @@ def _attributes_present(name, attributes, region, key, keyid, profile): if was_set: ret["changes"]["old"] = {"attributes": _attributes} ret["changes"]["new"] = {"attributes": attributes} - ret["comment"] = "Set attributes on ELB {}.".format(name) + ret["comment"] = f"Set attributes on ELB {name}." else: ret["result"] = False - ret["comment"] = "Failed to set attributes on ELB {}.".format(name) + ret["comment"] = f"Failed to set attributes on ELB {name}." else: - ret["comment"] = "Attributes already set on ELB {}.".format(name) + ret["comment"] = f"Attributes already set on ELB {name}." return ret @@ -981,7 +981,7 @@ def _health_check_present(name, health_check, region, key, keyid, profile): ) if not _health_check: ret["result"] = False - ret["comment"] = "Failed to retrieve health_check for ELB {}.".format(name) + ret["comment"] = f"Failed to retrieve health_check for ELB {name}." return ret need_to_set = False for attr, val in health_check.items(): @@ -989,7 +989,7 @@ def _health_check_present(name, health_check, region, key, keyid, profile): need_to_set = True if need_to_set: if __opts__["test"]: - ret["comment"] = "ELB {} set to have health check set.".format(name) + ret["comment"] = f"ELB {name} set to have health check set." ret["result"] = None return ret was_set = __salt__["boto_elb.set_health_check"]( @@ -1001,12 +1001,12 @@ def _health_check_present(name, health_check, region, key, keyid, profile): name, region, key, keyid, profile ) ret["changes"]["new"] = {"health_check": _health_check} - ret["comment"] = "Set health check on ELB {}.".format(name) + ret["comment"] = f"Set health check on ELB {name}." else: ret["result"] = False - ret["comment"] = "Failed to set health check on ELB {}.".format(name) + ret["comment"] = f"Failed to set health check on ELB {name}." else: - ret["comment"] = "Health check already set on ELB {}.".format(name) + ret["comment"] = f"Health check already set on ELB {name}." return ret @@ -1015,7 +1015,7 @@ def _zones_present(name, availability_zones, region, key, keyid, profile): lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) if not lb: ret["result"] = False - ret["comment"] = "Failed to retrieve ELB {}.".format(name) + ret["comment"] = f"Failed to retrieve ELB {name}." return ret to_enable = [] to_disable = [] @@ -1028,7 +1028,7 @@ def _zones_present(name, availability_zones, region, key, keyid, profile): to_disable.append(zone) if to_enable or to_disable: if __opts__["test"]: - ret["comment"] = "ELB {} to have availability zones set.".format(name) + ret["comment"] = f"ELB {name} to have availability zones set." ret["result"] = None return ret if to_enable: @@ -1036,11 +1036,9 @@ def _zones_present(name, availability_zones, region, key, keyid, profile): name, to_enable, region, key, keyid, profile ) if enabled: - ret["comment"] = "Enabled availability zones on {} ELB.".format(name) + ret["comment"] = f"Enabled availability zones on {name} ELB." else: - ret["comment"] = ( - "Failed to enable availability zones on {} ELB.".format(name) - ) + ret["comment"] = f"Failed to enable availability zones on {name} ELB." ret["result"] = False if to_disable: disabled = __salt__["boto_elb.disable_availability_zones"]( @@ -1057,7 +1055,7 @@ def _zones_present(name, availability_zones, region, key, keyid, profile): lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) ret["changes"]["new"] = {"availability_zones": lb["availability_zones"]} else: - ret["comment"] = "Availability zones already set on ELB {}.".format(name) + ret["comment"] = f"Availability zones already set on ELB {name}." return ret @@ -1068,7 +1066,7 @@ def _subnets_present(name, subnets, region, key, keyid, profile): lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) if not lb: ret["result"] = False - ret["comment"] = "Failed to retrieve ELB {}.".format(name) + ret["comment"] = f"Failed to retrieve ELB {name}." return ret to_enable = [] to_disable = [] @@ -1081,7 +1079,7 @@ def _subnets_present(name, subnets, region, key, keyid, profile): to_disable.append(subnet) if to_enable or to_disable: if __opts__["test"]: - ret["comment"] = "ELB {} to have subnets set.".format(name) + ret["comment"] = f"ELB {name} to have subnets set." ret["result"] = None return ret if to_enable: @@ -1089,9 +1087,9 @@ def _subnets_present(name, subnets, region, key, keyid, profile): name, to_enable, region, key, keyid, profile ) if attached: - ret["comment"] = "Attached subnets on {} ELB.".format(name) + ret["comment"] = f"Attached subnets on {name} ELB." else: - ret["comment"] = "Failed to attach subnets on {} ELB.".format(name) + ret["comment"] = f"Failed to attach subnets on {name} ELB." ret["result"] = False if to_disable: detached = __salt__["boto_elb.detach_subnets"]( @@ -1099,13 +1097,13 @@ def _subnets_present(name, subnets, region, key, keyid, profile): ) if detached: ret["comment"] = " ".join( - [ret["comment"], "Detached subnets on {} ELB.".format(name)] + [ret["comment"], f"Detached subnets on {name} ELB."] ) else: ret["comment"] = " ".join( [ ret["comment"], - "Failed to detach subnets on {} ELB.".format(name), + f"Failed to detach subnets on {name} ELB.", ] ) ret["result"] = False @@ -1113,7 +1111,7 @@ def _subnets_present(name, subnets, region, key, keyid, profile): lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) ret["changes"]["new"] = {"subnets": lb["subnets"]} else: - ret["comment"] = "Subnets already set on ELB {}.".format(name) + ret["comment"] = f"Subnets already set on ELB {name}." return ret @@ -1209,7 +1207,7 @@ def _policies_present( lb = __salt__["boto_elb.get_elb_config"](name, region, key, keyid, profile) if not lb: - ret["comment"] = "{} ELB configuration could not be retrieved.".format(name) + ret["comment"] = f"{name} ELB configuration could not be retrieved." ret["result"] = False return ret @@ -1295,18 +1293,18 @@ def _policies_present( if __opts__["test"]: msg = [] if to_create or to_delete: - msg.append("ELB {} set to have policies modified:".format(name)) + msg.append(f"ELB {name} set to have policies modified:") for policy in to_create: - msg.append("Policy {} added.".format(policy)) + msg.append(f"Policy {policy} added.") for policy in to_delete: - msg.append("Policy {} deleted.".format(policy)) + msg.append(f"Policy {policy} deleted.") ret["result"] = None else: - msg.append("Policies already set on ELB {}.".format(name)) + msg.append(f"Policies already set on ELB {name}.") for listener in listeners_to_update: - msg.append("Listener {} policies updated.".format(listener)) + msg.append(f"Listener {listener} policies updated.") for backend in backends_to_update: - msg.append("Backend {} policies updated.".format(backend)) + msg.append(f"Backend {backend} policies updated.") ret["comment"] = " ".join(msg) return ret @@ -1324,7 +1322,7 @@ def _policies_present( ) if created: ret["changes"].setdefault(policy_name, {})["new"] = policy_name - comment = "Policy {} was created on ELB {}".format(policy_name, name) + comment = f"Policy {policy_name} was created on ELB {name}" ret["comment"] = " ".join([ret["comment"], comment]) ret["result"] = True else: @@ -1342,7 +1340,7 @@ def _policies_present( profile=profile, ) if policy_set: - policy_key = "listener_{}_policy".format(port) + policy_key = f"listener_{port}_policy" ret["changes"][policy_key] = { "old": list(actual_policies_by_listener.get(port, [])), "new": list(expected_policies_by_listener.get(port, [])), @@ -1367,7 +1365,7 @@ def _policies_present( profile=profile, ) if policy_set: - policy_key = "backend_{}_policy".format(port) + policy_key = f"backend_{port}_policy" ret["changes"][policy_key] = { "old": list(actual_policies_by_backend.get(port, [])), "new": list(expected_policies_by_backend.get(port, [])), @@ -1393,7 +1391,7 @@ def _policies_present( ) if deleted: ret["changes"].setdefault(policy_name, {})["old"] = policy_name - comment = "Policy {} was deleted from ELB {}".format(policy_name, name) + comment = f"Policy {policy_name} was deleted from ELB {name}" ret["comment"] = " ".join([ret["comment"], comment]) ret["result"] = True else: @@ -1412,7 +1410,7 @@ def _policy_cname(policy_dict): ).hexdigest() if policy_type.endswith("Type"): policy_type = policy_type[:-4] - return "{}-{}-{}".format(policy_type, policy_name, policy_hash) + return f"{policy_type}-{policy_name}-{policy_hash}" def absent(name, region=None, key=None, keyid=None, profile=None): @@ -1427,19 +1425,19 @@ def absent(name, region=None, key=None, keyid=None, profile=None): exists = __salt__["boto_elb.exists"](name, region, key, keyid, profile) if exists: if __opts__["test"]: - ret["comment"] = "ELB {} is set to be removed.".format(name) + ret["comment"] = f"ELB {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_elb.delete"](name, region, key, keyid, profile) if deleted: ret["changes"]["old"] = {"elb": name} ret["changes"]["new"] = {"elb": None} - ret["comment"] = "ELB {} deleted.".format(name) + ret["comment"] = f"ELB {name} deleted." else: ret["result"] = False - ret["comment"] = "Failed to delete {} ELB.".format(name) + ret["comment"] = f"Failed to delete {name} ELB." else: - ret["comment"] = "{} ELB does not exist.".format(name) + ret["comment"] = f"{name} ELB does not exist." return ret @@ -1477,7 +1475,7 @@ def _tags_present(name, tags, region, key, keyid, profile): ) if not _ret: ret["result"] = False - msg = "Error attempting to delete tag {}.".format(tags_to_remove) + msg = f"Error attempting to delete tag {tags_to_remove}." ret["comment"] = " ".join([ret["comment"], msg]) return ret if "old" not in ret["changes"]: diff --git a/salt/states/boto_elbv2.py b/salt/states/boto_elbv2.py index d2eca045f0a..480d5b3b04a 100644 --- a/salt/states/boto_elbv2.py +++ b/salt/states/boto_elbv2.py @@ -64,7 +64,7 @@ def create_target_group( health_check_timeout_seconds=5, healthy_threshold_count=5, unhealthy_threshold_count=2, - **kwargs + **kwargs, ): """ .. versionadded:: 2017.11.0 @@ -121,11 +121,11 @@ def create_target_group( if __salt__["boto_elbv2.target_group_exists"](name, region, key, keyid, profile): ret["result"] = True - ret["comment"] = "Target Group {} already exists".format(name) + ret["comment"] = f"Target Group {name} already exists" return ret if __opts__["test"]: - ret["comment"] = "Target Group {} will be created".format(name) + ret["comment"] = f"Target Group {name} will be created" return ret state = __salt__["boto_elbv2.create_target_group"]( @@ -144,16 +144,16 @@ def create_target_group( health_check_timeout_seconds=health_check_timeout_seconds, healthy_threshold_count=healthy_threshold_count, unhealthy_threshold_count=unhealthy_threshold_count, - **kwargs + **kwargs, ) if state: ret["changes"]["target_group"] = name ret["result"] = True - ret["comment"] = "Target Group {} created".format(name) + ret["comment"] = f"Target Group {name} created" else: ret["result"] = False - ret["comment"] = "Target Group {} creation failed".format(name) + ret["comment"] = f"Target Group {name} creation failed" return ret @@ -184,11 +184,11 @@ def delete_target_group(name, region=None, key=None, keyid=None, profile=None): name, region, key, keyid, profile ): ret["result"] = True - ret["comment"] = "Target Group {} does not exists".format(name) + ret["comment"] = f"Target Group {name} does not exists" return ret if __opts__["test"]: - ret["comment"] = "Target Group {} will be deleted".format(name) + ret["comment"] = f"Target Group {name} will be deleted" return ret state = __salt__["boto_elbv2.delete_target_group"]( @@ -198,10 +198,10 @@ def delete_target_group(name, region=None, key=None, keyid=None, profile=None): if state: ret["result"] = True ret["changes"]["target_group"] = name - ret["comment"] = "Target Group {} deleted".format(name) + ret["comment"] = f"Target Group {name} deleted" else: ret["result"] = False - ret["comment"] = "Target Group {} deletion failed".format(name) + ret["comment"] = f"Target Group {name} deletion failed" return ret @@ -276,18 +276,18 @@ def targets_registered( if changes: ret["changes"]["old"] = health if __opts__["test"]: - ret["comment"] = "Target Group {} would be changed".format(name) + ret["comment"] = f"Target Group {name} would be changed" ret["result"] = None ret["changes"]["new"] = newhealth_mock else: - ret["comment"] = "Target Group {} has been changed".format(name) + ret["comment"] = f"Target Group {name} has been changed" newhealth = __salt__["boto_elbv2.describe_target_health"]( name, region=region, key=key, keyid=keyid, profile=profile ) ret["changes"]["new"] = newhealth return ret else: - ret["comment"] = "Could not find target group {}".format(name) + ret["comment"] = f"Could not find target group {name}" return ret @@ -326,9 +326,9 @@ def targets_deregistered( targets = [targets] for target in targets: if target not in health or health.get(target) == "draining": - ret["comment"] = ret[ - "comment" - ] + "Target/s {} already deregistered\n".format(target) + ret["comment"] = ( + ret["comment"] + f"Target/s {target} already deregistered\n" + ) ret["result"] = True else: if __opts__["test"]: @@ -347,25 +347,23 @@ def targets_deregistered( changes = True ret["result"] = True else: - ret["comment"] = ( - "Target Group {} failed to remove targets".format(name) - ) + ret["comment"] = f"Target Group {name} failed to remove targets" failure = True if failure: ret["result"] = False if changes: ret["changes"]["old"] = health if __opts__["test"]: - ret["comment"] = "Target Group {} would be changed".format(name) + ret["comment"] = f"Target Group {name} would be changed" ret["result"] = None ret["changes"]["new"] = newhealth_mock else: - ret["comment"] = "Target Group {} has been changed".format(name) + ret["comment"] = f"Target Group {name} has been changed" newhealth = __salt__["boto_elbv2.describe_target_health"]( name, region=region, key=key, keyid=keyid, profile=profile ) ret["changes"]["new"] = newhealth return ret else: - ret["comment"] = "Could not find target group {}".format(name) + ret["comment"] = f"Could not find target group {name}" return ret diff --git a/salt/states/boto_iam.py b/salt/states/boto_iam.py index a5bbd1ee8b3..d89573cf5ae 100644 --- a/salt/states/boto_iam.py +++ b/salt/states/boto_iam.py @@ -155,7 +155,7 @@ def __virtual__(): else: return ( False, - "Cannot load {} state: boto_iam module unavailable".format(__virtualname__), + f"Cannot load {__virtualname__} state: boto_iam module unavailable", ) @@ -207,7 +207,7 @@ def user_absent( ret = {"name": name, "result": True, "comment": "", "changes": {}} if not __salt__["boto_iam.get_user"](name, region, key, keyid, profile): ret["result"] = True - ret["comment"] = "IAM User {} does not exist.".format(name) + ret["comment"] = f"IAM User {name} does not exist." return ret # delete the user's access keys if delete_keys: @@ -297,7 +297,7 @@ def user_absent( ret["comment"] = " ".join( [ ret["comment"], - "Virtual MFA device {} is deleted.".format(serial), + f"Virtual MFA device {serial} is deleted.", ] ) # delete the user's login profile @@ -306,7 +306,7 @@ def user_absent( ret["comment"] = " ".join( [ ret["comment"], - "IAM user {} login profile is set to be deleted.".format(name), + f"IAM user {name} login profile is set to be deleted.", ] ) ret["result"] = None @@ -318,14 +318,14 @@ def user_absent( ret["comment"] = " ".join( [ ret["comment"], - "IAM user {} login profile is deleted.".format(name), + f"IAM user {name} login profile is deleted.", ] ) if __opts__["test"]: ret["comment"] = " ".join( [ ret["comment"], - "IAM user {} managed policies are set to be detached.".format(name), + f"IAM user {name} managed policies are set to be detached.", ] ) ret["result"] = None @@ -340,7 +340,7 @@ def user_absent( ret["comment"] = " ".join( [ ret["comment"], - "IAM user {} inline policies are set to be deleted.".format(name), + f"IAM user {name} inline policies are set to be deleted.", ] ) ret["result"] = None @@ -354,19 +354,17 @@ def user_absent( # finally, actually delete the user if __opts__["test"]: ret["comment"] = " ".join( - [ret["comment"], "IAM user {} is set to be deleted.".format(name)] + [ret["comment"], f"IAM user {name} is set to be deleted."] ) ret["result"] = None return ret deleted = __salt__["boto_iam.delete_user"](name, region, key, keyid, profile) if deleted is True: - ret["comment"] = " ".join( - [ret["comment"], "IAM user {} is deleted.".format(name)] - ) + ret["comment"] = " ".join([ret["comment"], f"IAM user {name} is deleted."]) ret["result"] = True ret["changes"]["deleted"] = name return ret - ret["comment"] = "IAM user {} could not be deleted.\n {}".format(name, deleted) + ret["comment"] = f"IAM user {name} could not be deleted.\n {deleted}" ret["result"] = False return ret @@ -418,14 +416,14 @@ def keys_present( ret = {"name": name, "result": True, "comment": "", "changes": {}} if not __salt__["boto_iam.get_user"](name, region, key, keyid, profile): ret["result"] = False - ret["comment"] = "IAM User {} does not exist.".format(name) + ret["comment"] = f"IAM User {name} does not exist." return ret if not isinstance(number, int): ret["comment"] = "The number of keys must be an integer." ret["result"] = False return ret if not os.path.isdir(save_dir): - ret["comment"] = "The directory {} does not exist.".format(save_dir) + ret["comment"] = f"The directory {save_dir} does not exist." ret["result"] = False return ret keys = __salt__["boto_iam.get_all_access_keys"]( @@ -434,7 +432,7 @@ def keys_present( if isinstance(keys, str): log.debug("keys are : false %s", keys) error, message = _get_error(keys) - ret["comment"] = "Could not get keys.\n{}\n{}".format(error, message) + ret["comment"] = f"Could not get keys.\n{error}\n{message}" ret["result"] = False return ret keys = keys["list_access_keys_response"]["list_access_keys_result"][ @@ -442,11 +440,11 @@ def keys_present( ] log.debug("Keys are : %s.", keys) if len(keys) >= number: - ret["comment"] = "The number of keys exist for user {}".format(name) + ret["comment"] = f"The number of keys exist for user {name}" ret["result"] = True return ret if __opts__["test"]: - ret["comment"] = "Access key is set to be created for {}.".format(name) + ret["comment"] = f"Access key is set to be created for {name}." ret["result"] = None return ret new_keys = {} @@ -456,7 +454,7 @@ def keys_present( ) if isinstance(created, str): error, message = _get_error(created) - ret["comment"] = "Could not create keys.\n{}\n{}".format(error, message) + ret["comment"] = f"Could not create keys.\n{error}\n{message}" ret["result"] = False return ret log.debug("Created is : %s", created) @@ -470,7 +468,7 @@ def keys_present( "secret_access_key" ] try: - with salt.utils.files.fopen("{}/{}".format(save_dir, name), "a") as _wrf: + with salt.utils.files.fopen(f"{save_dir}/{name}", "a") as _wrf: for key_num, key in new_keys.items(): key_id = key["key_id"] secret_key = key["secret_key"] @@ -479,17 +477,17 @@ def keys_present( save_format.format( key_id, secret_key, - "key_id-{}".format(key_num), - "key-{}".format(key_num), + f"key_id-{key_num}", + f"key-{key_num}", ) ) ) - ret["comment"] = "Keys have been written to file {}/{}.".format(save_dir, name) + ret["comment"] = f"Keys have been written to file {save_dir}/{name}." ret["result"] = True ret["changes"] = new_keys return ret except OSError: - ret["comment"] = "Could not write to file {}/{}.".format(save_dir, name) + ret["comment"] = f"Could not write to file {save_dir}/{name}." ret["result"] = False return ret @@ -525,7 +523,7 @@ def keys_absent( ret = {"name": access_keys, "result": True, "comment": "", "changes": {}} if not __salt__["boto_iam.get_user"](user_name, region, key, keyid, profile): ret["result"] = False - ret["comment"] = "IAM User {} does not exist.".format(user_name) + ret["comment"] = f"IAM User {user_name} does not exist." return ret for k in access_keys: ret = _delete_key(ret, k, user_name, region, key, keyid, profile) @@ -542,7 +540,7 @@ def _delete_key( if isinstance(keys, str): log.debug("Keys %s are a string. Something went wrong.", keys) ret["comment"] = " ".join( - [ret["comment"], "Key {} could not be deleted.".format(access_key_id)] + [ret["comment"], f"Key {access_key_id} could not be deleted."] ) return ret keys = keys["list_access_keys_response"]["list_access_keys_result"][ @@ -564,15 +562,15 @@ def _delete_key( ) if deleted: ret["comment"] = " ".join( - [ret["comment"], "Key {} has been deleted.".format(access_key_id)] + [ret["comment"], f"Key {access_key_id} has been deleted."] ) ret["changes"][access_key_id] = "deleted" return ret ret["comment"] = " ".join( - [ret["comment"], "Key {} could not be deleted.".format(access_key_id)] + [ret["comment"], f"Key {access_key_id} could not be deleted."] ) return ret - ret["comment"] = " ".join([ret["comment"], "Key {} does not exist.".format(k)]) + ret["comment"] = " ".join([ret["comment"], f"Key {k} does not exist."]) return ret @@ -649,7 +647,7 @@ def user_present( exists = __salt__["boto_iam.get_user"](name, region, key, keyid, profile) if not exists: if __opts__["test"]: - ret["comment"] = "IAM user {} is set to be created.".format(name) + ret["comment"] = f"IAM user {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_iam.create_user"]( @@ -658,7 +656,7 @@ def user_present( if created: ret["changes"]["user"] = created ret["comment"] = " ".join( - [ret["comment"], "User {} has been created.".format(name)] + [ret["comment"], f"User {name} has been created."] ) if password: ret = _case_password(ret, name, password, region, key, keyid, profile) @@ -666,7 +664,7 @@ def user_present( ret["changes"] = dictupdate.update(ret["changes"], _ret["changes"]) ret["comment"] = " ".join([ret["comment"], _ret["comment"]]) else: - ret["comment"] = " ".join([ret["comment"], "User {} is present.".format(name)]) + ret["comment"] = " ".join([ret["comment"], f"User {name} is present."]) if password: ret = _case_password(ret, name, password, region, key, keyid, profile) _ret = _user_policies_present(name, _policies, region, key, keyid, profile) @@ -845,7 +843,7 @@ def _user_policies_detached(name, region=None, key=None, keyid=None, profile=Non ) oldpolicies = [x.get("policy_arn") for x in _list] if not _list: - ret["comment"] = "No attached policies in user {}.".format(name) + ret["comment"] = f"No attached policies in user {name}." return ret if __opts__["test"]: ret["comment"] = "{} policies to be detached from user {}.".format( @@ -865,7 +863,7 @@ def _user_policies_detached(name, region=None, key=None, keyid=None, profile=Non newpolicies = [x.get("policy_arn") for x in _list] ret["changes"]["new"] = {"managed_policies": newpolicies} ret["result"] = False - ret["comment"] = "Failed to detach {} from user {}".format(policy_arn, name) + ret["comment"] = f"Failed to detach {policy_arn} from user {name}" return ret _list = __salt__["boto_iam.list_attached_user_policies"]( name, region=region, key=key, keyid=keyid, profile=profile @@ -884,7 +882,7 @@ def _user_policies_deleted(name, region=None, key=None, keyid=None, profile=None user_name=name, region=region, key=key, keyid=keyid, profile=profile ) if not oldpolicies: - ret["comment"] = "No inline policies in user {}.".format(name) + ret["comment"] = f"No inline policies in user {name}." return ret if __opts__["test"]: ret["comment"] = "{} policies to be deleted from user {}.".format( @@ -921,7 +919,7 @@ def _case_password( ret, name, password, region=None, key=None, keyid=None, profile=None ): if __opts__["test"]: - ret["comment"] = "Login policy for {} is set to be changed.".format(name) + ret["comment"] = f"Login policy for {name} is set to be changed." ret["result"] = None return ret login = __salt__["boto_iam.create_login_profile"]( @@ -931,11 +929,11 @@ def _case_password( if login: if "Conflict" in login: ret["comment"] = " ".join( - [ret["comment"], "Login profile for user {} exists.".format(name)] + [ret["comment"], f"Login profile for user {name} exists."] ) else: ret["comment"] = " ".join( - [ret["comment"], "Password has been added to User {}.".format(name)] + [ret["comment"], f"Password has been added to User {name}."] ) ret["changes"]["password"] = "REDACTED" else: @@ -976,13 +974,13 @@ def group_absent(name, region=None, key=None, keyid=None, profile=None): ret = {"name": name, "result": True, "comment": "", "changes": {}} if not __salt__["boto_iam.get_group"](name, region, key, keyid, profile): ret["result"] = True - ret["comment"] = "IAM Group {} does not exist.".format(name) + ret["comment"] = f"IAM Group {name} does not exist." return ret if __opts__["test"]: ret["comment"] = " ".join( [ ret["comment"], - "IAM group {} managed policies are set to be detached.".format(name), + f"IAM group {name} managed policies are set to be detached.", ] ) ret["result"] = None @@ -997,7 +995,7 @@ def group_absent(name, region=None, key=None, keyid=None, profile=None): ret["comment"] = " ".join( [ ret["comment"], - "IAM group {} inline policies are set to be deleted.".format(name), + f"IAM group {name} inline policies are set to be deleted.", ] ) ret["result"] = None @@ -1009,7 +1007,7 @@ def group_absent(name, region=None, key=None, keyid=None, profile=None): if ret["result"] is False: return ret ret["comment"] = " ".join( - [ret["comment"], "IAM group {} users are set to be removed.".format(name)] + [ret["comment"], f"IAM group {name} users are set to be removed."] ) existing_users = __salt__["boto_iam.get_group_members"]( group_name=name, region=region, key=key, keyid=keyid, profile=profile @@ -1023,19 +1021,17 @@ def group_absent(name, region=None, key=None, keyid=None, profile=None): # finally, actually delete the group if __opts__["test"]: ret["comment"] = " ".join( - [ret["comment"], "IAM group {} is set to be deleted.".format(name)] + [ret["comment"], f"IAM group {name} is set to be deleted."] ) ret["result"] = None return ret deleted = __salt__["boto_iam.delete_group"](name, region, key, keyid, profile) if deleted is True: - ret["comment"] = " ".join( - [ret["comment"], "IAM group {} is deleted.".format(name)] - ) + ret["comment"] = " ".join([ret["comment"], f"IAM group {name} is deleted."]) ret["result"] = True ret["changes"]["deleted"] = name return ret - ret["comment"] = "IAM group {} could not be deleted.\n {}".format(name, deleted) + ret["comment"] = f"IAM group {name} could not be deleted.\n {deleted}" ret["result"] = False return ret @@ -1119,7 +1115,7 @@ def group_present( ) if not exists: if __opts__["test"]: - ret["comment"] = "IAM group {} is set to be created.".format(name) + ret["comment"] = f"IAM group {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_iam.create_group"]( @@ -1131,15 +1127,13 @@ def group_present( profile=profile, ) if not created: - ret["comment"] = "Failed to create IAM group {}.".format(name) + ret["comment"] = f"Failed to create IAM group {name}." ret["result"] = False return ret ret["changes"]["group"] = created - ret["comment"] = " ".join( - [ret["comment"], "Group {} has been created.".format(name)] - ) + ret["comment"] = " ".join([ret["comment"], f"Group {name} has been created."]) else: - ret["comment"] = " ".join([ret["comment"], "Group {} is present.".format(name)]) + ret["comment"] = " ".join([ret["comment"], f"Group {name} is present."]) # Group exists, ensure group policies and users are set. _ret = _group_policies_present( name, _policies, region, key, keyid, profile, delete_policies @@ -1178,7 +1172,7 @@ def _case_group(ret, users, group_name, existing_users, region, key, keyid, prof ret["comment"] = " ".join( [ ret["comment"], - "User {} is already a member of group {}.".format(user, group_name), + f"User {user} is already a member of group {group_name}.", ] ) continue @@ -1196,7 +1190,7 @@ def _case_group(ret, users, group_name, existing_users, region, key, keyid, prof ret["comment"] = " ".join( [ ret["comment"], - "User {} has been added to group {}.".format(user, group_name), + f"User {user} has been added to group {group_name}.", ] ) ret["changes"][user] = group_name @@ -1229,7 +1223,7 @@ def _case_group(ret, users, group_name, existing_users, region, key, keyid, prof ), ] ) - ret["changes"][user] = "Removed from group {}.".format(group_name) + ret["changes"][user] = f"Removed from group {group_name}." return ret @@ -1410,7 +1404,7 @@ def _group_policies_detached(name, region=None, key=None, keyid=None, profile=No ) oldpolicies = [x.get("policy_arn") for x in _list] if not _list: - ret["comment"] = "No attached policies in group {}.".format(name) + ret["comment"] = f"No attached policies in group {name}." return ret if __opts__["test"]: ret["comment"] = "{} policies to be detached from group {}.".format( @@ -1451,7 +1445,7 @@ def _group_policies_deleted(name, region=None, key=None, keyid=None, profile=Non group_name=name, region=region, key=key, keyid=keyid, profile=profile ) if not oldpolicies: - ret["comment"] = "No inline policies in group {}.".format(name) + ret["comment"] = f"No inline policies in group {name}." return ret if __opts__["test"]: ret["comment"] = "{} policies to be deleted from group {}.".format( @@ -1568,7 +1562,7 @@ def account_policy( ret["comment"] = " ".join( [ ret["comment"], - "Policy value {} has been set to {}.".format(value, info[key]), + f"Policy value {value} has been set to {info[key]}.", ] ) ret["changes"][key] = str(value).lower() @@ -1627,18 +1621,18 @@ def server_cert_absent(name, region=None, key=None, keyid=None, profile=None): name, region, key, keyid, profile ) if not exists: - ret["comment"] = "Certificate {} does not exist.".format(name) + ret["comment"] = f"Certificate {name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Server certificate {} is set to be deleted.".format(name) + ret["comment"] = f"Server certificate {name} is set to be deleted." ret["result"] = None return ret deleted = __salt__["boto_iam.delete_server_cert"](name, region, key, keyid, profile) if not deleted: ret["result"] = False - ret["comment"] = "Certificate {} failed to be deleted.".format(name) + ret["comment"] = f"Certificate {name} failed to be deleted." return ret - ret["comment"] = "Certificate {} was deleted.".format(name) + ret["comment"] = f"Certificate {name} was deleted." ret["changes"] = deleted return ret @@ -1693,14 +1687,14 @@ def server_cert_present( ) log.debug("Variables are : %s.", locals()) if exists: - ret["comment"] = "Certificate {} exists.".format(name) + ret["comment"] = f"Certificate {name} exists." return ret if "salt://" in public_key: try: public_key = __salt__["cp.get_file_str"](public_key) except OSError as e: log.debug(e) - ret["comment"] = "File {} not found.".format(public_key) + ret["comment"] = f"File {public_key} not found." ret["result"] = False return ret if "salt://" in private_key: @@ -1708,7 +1702,7 @@ def server_cert_present( private_key = __salt__["cp.get_file_str"](private_key) except OSError as e: log.debug(e) - ret["comment"] = "File {} not found.".format(private_key) + ret["comment"] = f"File {private_key} not found." ret["result"] = False return ret if cert_chain is not None and "salt://" in cert_chain: @@ -1716,22 +1710,22 @@ def server_cert_present( cert_chain = __salt__["cp.get_file_str"](cert_chain) except OSError as e: log.debug(e) - ret["comment"] = "File {} not found.".format(cert_chain) + ret["comment"] = f"File {cert_chain} not found." ret["result"] = False return ret if __opts__["test"]: - ret["comment"] = "Server certificate {} is set to be created.".format(name) + ret["comment"] = f"Server certificate {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_iam.upload_server_cert"]( name, public_key, private_key, cert_chain, path, region, key, keyid, profile ) if created is not False: - ret["comment"] = "Certificate {} was created.".format(name) + ret["comment"] = f"Certificate {name} was created." ret["changes"] = created return ret ret["result"] = False - ret["comment"] = "Certificate {} failed to be created.".format(name) + ret["comment"] = f"Certificate {name} failed to be created." return ret @@ -1780,7 +1774,7 @@ def policy_present( policy = __salt__["boto_iam.get_policy"](name, region, key, keyid, profile) if not policy: if __opts__["test"]: - ret["comment"] = "IAM policy {} is set to be created.".format(name) + ret["comment"] = f"IAM policy {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_iam.create_policy"]( @@ -1789,7 +1783,7 @@ def policy_present( if created: ret["changes"]["policy"] = created ret["comment"] = " ".join( - [ret["comment"], "Policy {} has been created.".format(name)] + [ret["comment"], f"Policy {name} has been created."] ) else: ret["result"] = False @@ -1798,9 +1792,7 @@ def policy_present( return ret else: policy = policy.get("policy", {}) - ret["comment"] = " ".join( - [ret["comment"], "Policy {} is present.".format(name)] - ) + ret["comment"] = " ".join([ret["comment"], f"Policy {name} is present."]) _describe = __salt__["boto_iam.get_policy_version"]( name, policy.get("default_version_id"), region, key, keyid, profile ).get("policy_version", {}) @@ -1816,7 +1808,7 @@ def policy_present( if bool(r): if __opts__["test"]: - ret["comment"] = "Policy {} set to be modified.".format(name) + ret["comment"] = f"Policy {name} set to be modified." ret["result"] = None return ret @@ -1883,11 +1875,11 @@ def policy_absent(name, region=None, key=None, keyid=None, profile=None): name, region=region, key=key, keyid=keyid, profile=profile ) if not r: - ret["comment"] = "Policy {} does not exist.".format(name) + ret["comment"] = f"Policy {name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Policy {} is set to be removed.".format(name) + ret["comment"] = f"Policy {name} is set to be removed." ret["result"] = None return ret # delete non-default versions @@ -1908,18 +1900,18 @@ def policy_absent(name, region=None, key=None, keyid=None, profile=None): ) if not r: ret["result"] = False - ret["comment"] = "Failed to delete policy {}.".format(name) + ret["comment"] = f"Failed to delete policy {name}." return ret r = __salt__["boto_iam.delete_policy"]( name, region=region, key=key, keyid=keyid, profile=profile ) if not r: ret["result"] = False - ret["comment"] = "Failed to delete policy {}.".format(name) + ret["comment"] = f"Failed to delete policy {name}." return ret ret["changes"]["old"] = {"policy": name} ret["changes"]["new"] = {"policy": None} - ret["comment"] = "Policy {} deleted.".format(name) + ret["comment"] = f"Policy {name} deleted." return ret @@ -1958,7 +1950,7 @@ def saml_provider_present( except OSError as e: log.debug(e) ret["comment"] = ( - "SAML document file {} not found or could not be loaded".format(name) + f"SAML document file {name} not found or could not be loaded" ) ret["result"] = False return ret @@ -1966,10 +1958,10 @@ def saml_provider_present( region=region, key=key, keyid=keyid, profile=profile ): if provider == name: - ret["comment"] = "SAML provider {} is present.".format(name) + ret["comment"] = f"SAML provider {name} is present." return ret if __opts__["test"]: - ret["comment"] = "SAML provider {} is set to be create.".format(name) + ret["comment"] = f"SAML provider {name} is set to be create." ret["result"] = None return ret created = __salt__["boto_iam.create_saml_provider"]( @@ -1981,11 +1973,11 @@ def saml_provider_present( profile=profile, ) if created: - ret["comment"] = "SAML provider {} was created.".format(name) + ret["comment"] = f"SAML provider {name} was created." ret["changes"]["new"] = name return ret ret["result"] = False - ret["comment"] = "SAML provider {} failed to be created.".format(name) + ret["comment"] = f"SAML provider {name} failed to be created." return ret @@ -2019,21 +2011,21 @@ def saml_provider_absent(name, region=None, key=None, keyid=None, profile=None): region=region, key=key, keyid=keyid, profile=profile ) if len(provider) == 0: - ret["comment"] = "SAML provider {} is absent.".format(name) + ret["comment"] = f"SAML provider {name} is absent." return ret if __opts__["test"]: - ret["comment"] = "SAML provider {} is set to be removed.".format(name) + ret["comment"] = f"SAML provider {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_iam.delete_saml_provider"]( name, region=region, key=key, keyid=keyid, profile=profile ) if deleted is not False: - ret["comment"] = "SAML provider {} was deleted.".format(name) + ret["comment"] = f"SAML provider {name} was deleted." ret["changes"]["old"] = name return ret ret["result"] = False - ret["comment"] = "SAML provider {} failed to be deleted.".format(name) + ret["comment"] = f"SAML provider {name} failed to be deleted." return ret diff --git a/salt/states/boto_iam_role.py b/salt/states/boto_iam_role.py index 1ff1abcc5c8..9ddcdfdee39 100644 --- a/salt/states/boto_iam_role.py +++ b/salt/states/boto_iam_role.py @@ -255,7 +255,7 @@ def _role_present( role = __salt__["boto_iam.describe_role"](name, region, key, keyid, profile) if not role: if __opts__["test"]: - ret["comment"] = "IAM role {} is set to be created.".format(name) + ret["comment"] = f"IAM role {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_iam.create_role"]( @@ -264,12 +264,12 @@ def _role_present( if created: ret["changes"]["old"] = {"role": None} ret["changes"]["new"] = {"role": name} - ret["comment"] = "IAM role {} created.".format(name) + ret["comment"] = f"IAM role {name} created." else: ret["result"] = False - ret["comment"] = "Failed to create {} IAM role.".format(name) + ret["comment"] = f"Failed to create {name} IAM role." else: - ret["comment"] = "{} role present.".format(name) + ret["comment"] = f"{name} role present." if not policy_document: _policy_document = __salt__["boto_iam.build_policy"]( region, key, keyid, profile @@ -309,7 +309,7 @@ def _instance_profile_present(name, region=None, key=None, keyid=None, profile=N ) if not exists: if __opts__["test"]: - ret["comment"] = "Instance profile {} is set to be created.".format(name) + ret["comment"] = f"Instance profile {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_iam.create_instance_profile"]( @@ -318,10 +318,10 @@ def _instance_profile_present(name, region=None, key=None, keyid=None, profile=N if created: ret["changes"]["old"] = {"instance_profile": None} ret["changes"]["new"] = {"instance_profile": name} - ret["comment"] = "Instance profile {} created.".format(name) + ret["comment"] = f"Instance profile {name} created." else: ret["result"] = False - ret["comment"] = "Failed to create {} instance profile.".format(name) + ret["comment"] = f"Failed to create {name} instance profile." return ret @@ -332,7 +332,7 @@ def _instance_profile_associated(name, region=None, key=None, keyid=None, profil ) if not is_associated: if __opts__["test"]: - ret["comment"] = "Instance profile {} is set to be associated.".format(name) + ret["comment"] = f"Instance profile {name} is set to be associated." ret["result"] = None return ret associated = __salt__["boto_iam.associate_profile_to_role"]( @@ -341,7 +341,7 @@ def _instance_profile_associated(name, region=None, key=None, keyid=None, profil if associated: ret["changes"]["old"] = {"profile_associated": None} ret["changes"]["new"] = {"profile_associated": True} - ret["comment"] = "Instance profile {} associated.".format(name) + ret["comment"] = f"Instance profile {name} associated." else: ret["result"] = False ret["comment"] = ( @@ -591,19 +591,19 @@ def _role_absent(name, region=None, key=None, keyid=None, profile=None): exists = __salt__["boto_iam.role_exists"](name, region, key, keyid, profile) if exists: if __opts__["test"]: - ret["comment"] = "IAM role {} is set to be removed.".format(name) + ret["comment"] = f"IAM role {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_iam.delete_role"](name, region, key, keyid, profile) if deleted: ret["changes"]["old"] = {"role": name} ret["changes"]["new"] = {"role": None} - ret["comment"] = "IAM role {} removed.".format(name) + ret["comment"] = f"IAM role {name} removed." else: ret["result"] = False - ret["comment"] = "Failed to delete {} iam role.".format(name) + ret["comment"] = f"Failed to delete {name} iam role." else: - ret["comment"] = "{} role does not exist.".format(name) + ret["comment"] = f"{name} role does not exist." return ret @@ -615,7 +615,7 @@ def _instance_profile_absent(name, region=None, key=None, keyid=None, profile=No ) if exists: if __opts__["test"]: - ret["comment"] = "Instance profile {} is set to be removed.".format(name) + ret["comment"] = f"Instance profile {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_iam.delete_instance_profile"]( @@ -624,12 +624,12 @@ def _instance_profile_absent(name, region=None, key=None, keyid=None, profile=No if deleted: ret["changes"]["old"] = {"instance_profile": name} ret["changes"]["new"] = {"instance_profile": None} - ret["comment"] = "Instance profile {} removed.".format(name) + ret["comment"] = f"Instance profile {name} removed." else: ret["result"] = False - ret["comment"] = "Failed to delete {} instance profile.".format(name) + ret["comment"] = f"Failed to delete {name} instance profile." else: - ret["comment"] = "{} instance profile does not exist.".format(name) + ret["comment"] = f"{name} instance profile does not exist." return ret @@ -637,7 +637,7 @@ def _policies_absent(name, region=None, key=None, keyid=None, profile=None): ret = {"result": True, "comment": "", "changes": {}} _list = __salt__["boto_iam.list_role_policies"](name, region, key, keyid, profile) if not _list: - ret["comment"] = "No policies in role {}.".format(name) + ret["comment"] = f"No policies in role {name}." return ret if __opts__["test"]: ret["comment"] = "{} policies to be removed from role {}.".format( @@ -673,7 +673,7 @@ def _policies_detached(name, region=None, key=None, keyid=None, profile=None): ) oldpolicies = [x.get("policy_arn") for x in _list] if not _list: - ret["comment"] = "No attached policies in role {}.".format(name) + ret["comment"] = f"No attached policies in role {name}." return ret if __opts__["test"]: ret["comment"] = "{} policies to be detached from role {}.".format( @@ -693,7 +693,7 @@ def _policies_detached(name, region=None, key=None, keyid=None, profile=None): newpolicies = [x.get("policy_arn") for x in _list] ret["changes"]["new"] = {"managed_policies": newpolicies} ret["result"] = False - ret["comment"] = "Failed to detach {} from role {}".format(policy_arn, name) + ret["comment"] = f"Failed to detach {policy_arn} from role {name}" return ret _list = __salt__["boto_iam.list_attached_role_policies"]( name, region=region, key=key, keyid=keyid, profile=profile @@ -726,7 +726,7 @@ def _instance_profile_disassociated( if associated: ret["changes"]["old"] = {"profile_associated": True} ret["changes"]["new"] = {"profile_associated": False} - ret["comment"] = "Instance profile {} disassociated.".format(name) + ret["comment"] = f"Instance profile {name} disassociated." else: ret["result"] = False ret["comment"] = ( diff --git a/salt/states/boto_iot.py b/salt/states/boto_iot.py index e14d1541949..bea8f9481f5 100644 --- a/salt/states/boto_iot.py +++ b/salt/states/boto_iot.py @@ -157,7 +157,7 @@ def thing_type_present( return ret if __opts__["test"]: - ret["comment"] = "Thing type {} is set to be created.".format(thingTypeName) + ret["comment"] = f"Thing type {thingTypeName} is set to be created." ret["result"] = None return ret @@ -187,7 +187,7 @@ def thing_type_present( ) ret["changes"]["old"] = {"thing_type": None} ret["changes"]["new"] = _describe - ret["comment"] = "Thing Type {} created.".format(thingTypeName) + ret["comment"] = f"Thing Type {thingTypeName} created." return ret @@ -237,7 +237,7 @@ def thing_type_absent( return ret if _describe and not _describe["thing_type"]: - ret["comment"] = "Thing Type {} does not exist.".format(thingTypeName) + ret["comment"] = f"Thing Type {thingTypeName} does not exist." return ret _existing_thing_type = _describe["thing_type"] @@ -319,7 +319,7 @@ def thing_type_absent( return ret ret["changes"]["old"] = _describe ret["changes"]["new"] = {"thing_type": None} - ret["comment"] = "Thing Type {} deleted.".format(thingTypeName) + ret["comment"] = f"Thing Type {thingTypeName} deleted." return ret @@ -366,7 +366,7 @@ def policy_present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Policy {} is set to be created.".format(policyName) + ret["comment"] = f"Policy {policyName} is set to be created." ret["result"] = None return ret r = __salt__["boto_iot.create_policy"]( @@ -388,11 +388,11 @@ def policy_present( ) ret["changes"]["old"] = {"policy": None} ret["changes"]["new"] = _describe - ret["comment"] = "Policy {} created.".format(policyName) + ret["comment"] = f"Policy {policyName} created." return ret ret["comment"] = os.linesep.join( - [ret["comment"], "Policy {} is present.".format(policyName)] + [ret["comment"], f"Policy {policyName} is present."] ) ret["changes"] = {} # policy exists, ensure config matches @@ -411,7 +411,7 @@ def policy_present( r = salt.utils.data.compare_dicts(describeDict, policyDocument) if bool(r): if __opts__["test"]: - msg = "Policy {} set to be modified.".format(policyName) + msg = f"Policy {policyName} set to be modified." ret["comment"] = msg ret["result"] = None return ret @@ -487,11 +487,11 @@ def policy_absent(name, policyName, region=None, key=None, keyid=None, profile=N return ret if r and not r["exists"]: - ret["comment"] = "Policy {} does not exist.".format(policyName) + ret["comment"] = f"Policy {policyName} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Policy {} is set to be removed.".format(policyName) + ret["comment"] = f"Policy {policyName} is set to be removed." ret["result"] = None return ret # delete non-default versions @@ -532,7 +532,7 @@ def policy_absent(name, policyName, region=None, key=None, keyid=None, profile=N return ret ret["changes"]["old"] = {"policy": policyName} ret["changes"]["new"] = {"policy": None} - ret["comment"] = "Policy {} deleted.".format(policyName) + ret["comment"] = f"Policy {policyName} deleted." return ret @@ -603,11 +603,11 @@ def policy_attached( return ret ret["changes"]["old"] = {"attached": False} ret["changes"]["new"] = {"attached": True} - ret["comment"] = "Policy {} attached to {}.".format(policyName, principal) + ret["comment"] = f"Policy {policyName} attached to {principal}." return ret ret["comment"] = os.linesep.join( - [ret["comment"], "Policy {} is attached.".format(policyName)] + [ret["comment"], f"Policy {policyName} is attached."] ) ret["changes"] = {} @@ -682,11 +682,11 @@ def policy_detached( return ret ret["changes"]["old"] = {"attached": True} ret["changes"]["new"] = {"attached": False} - ret["comment"] = "Policy {} detached from {}.".format(policyName, principal) + ret["comment"] = f"Policy {policyName} detached from {principal}." return ret ret["comment"] = os.linesep.join( - [ret["comment"], "Policy {} is detached.".format(policyName)] + [ret["comment"], f"Policy {policyName} is detached."] ) ret["changes"] = {} @@ -752,7 +752,7 @@ def topic_rule_present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Rule {} is set to be created.".format(ruleName) + ret["comment"] = f"Rule {ruleName} is set to be created." ret["result"] = None return ret r = __salt__["boto_iot.create_topic_rule"]( @@ -775,12 +775,10 @@ def topic_rule_present( ) ret["changes"]["old"] = {"rule": None} ret["changes"]["new"] = _describe - ret["comment"] = "Rule {} created.".format(ruleName) + ret["comment"] = f"Rule {ruleName} created." return ret - ret["comment"] = os.linesep.join( - [ret["comment"], "Rule {} is present.".format(ruleName)] - ) + ret["comment"] = os.linesep.join([ret["comment"], f"Rule {ruleName} is present."]) ret["changes"] = {} # policy exists, ensure config matches _describe = __salt__["boto_iot.describe_topic_rule"]( @@ -805,7 +803,7 @@ def topic_rule_present( ret["changes"].setdefault("old", {})[var] = _describe[var] if need_update: if __opts__["test"]: - msg = "Rule {} set to be modified.".format(ruleName) + msg = f"Rule {ruleName} set to be modified." ret["changes"] = {} ret["comment"] = msg ret["result"] = None @@ -864,11 +862,11 @@ def topic_rule_absent(name, ruleName, region=None, key=None, keyid=None, profile return ret if r and not r["exists"]: - ret["comment"] = "Rule {} does not exist.".format(ruleName) + ret["comment"] = f"Rule {ruleName} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Rule {} is set to be removed.".format(ruleName) + ret["comment"] = f"Rule {ruleName} is set to be removed." ret["result"] = None return ret r = __salt__["boto_iot.delete_topic_rule"]( @@ -880,5 +878,5 @@ def topic_rule_absent(name, ruleName, region=None, key=None, keyid=None, profile return ret ret["changes"]["old"] = {"rule": ruleName} ret["changes"]["new"] = {"rule": None} - ret["comment"] = "Rule {} deleted.".format(ruleName) + ret["comment"] = f"Rule {ruleName} deleted." return ret diff --git a/salt/states/boto_kinesis.py b/salt/states/boto_kinesis.py index 5809ef711e5..938449515c2 100644 --- a/salt/states/boto_kinesis.py +++ b/salt/states/boto_kinesis.py @@ -140,7 +140,7 @@ def present( if exists["result"] is False: if __opts__["test"]: ret["result"] = None - comments.append("Kinesis stream {} would be created".format(name)) + comments.append(f"Kinesis stream {name} would be created") _add_changes(ret, changes_old, changes_new, comments) return ret else: @@ -155,11 +155,11 @@ def present( _add_changes(ret, changes_old, changes_new, comments) return ret - comments.append("Kinesis stream {} successfully created".format(name)) + comments.append(f"Kinesis stream {name} successfully created") changes_new["name"] = name changes_new["num_shards"] = num_shards else: - comments.append("Kinesis stream {} already exists".format(name)) + comments.append(f"Kinesis stream {name} already exists") stream_response = __salt__["boto_kinesis.get_stream_when_active"]( name, region, key, keyid, profile @@ -238,9 +238,7 @@ def present( " at {}".format(name, old_retention_hours) ) else: - comments.append( - "Kinesis stream {}: did not configure retention hours".format(name) - ) + comments.append(f"Kinesis stream {name}: did not configure retention hours") # Configure enhanced monitoring if enhanced_monitoring is not None: @@ -345,9 +343,7 @@ def present( enhanced_monitoring if len(enhanced_monitoring) > 0 else "None" ) else: - comments.append( - "Kinesis stream {}: did not configure enhanced monitoring".format(name) - ) + comments.append(f"Kinesis stream {name}: did not configure enhanced monitoring") # Reshard stream if necessary min_hash_key, max_hash_key, full_stream_details = __salt__[ @@ -439,11 +435,11 @@ def absent(name, region=None, key=None, keyid=None, profile=None): exists = __salt__["boto_kinesis.exists"](name, region, key, keyid, profile) if exists["result"] is False: - ret["comment"] = "Kinesis stream {} does not exist".format(name) + ret["comment"] = f"Kinesis stream {name} does not exist" return ret if __opts__["test"]: - ret["comment"] = "Kinesis stream {} would be deleted".format(name) + ret["comment"] = f"Kinesis stream {name} would be deleted" ret["result"] = None return ret @@ -456,9 +452,9 @@ def absent(name, region=None, key=None, keyid=None, profile=None): ) ret["result"] = False else: - ret["comment"] = "Deleted stream {}".format(name) - ret["changes"].setdefault("old", "Stream {} exists".format(name)) - ret["changes"].setdefault("new", "Stream {} deleted".format(name)) + ret["comment"] = f"Deleted stream {name}" + ret["changes"].setdefault("old", f"Stream {name} exists") + ret["changes"].setdefault("new", f"Stream {name} deleted") return ret diff --git a/salt/states/boto_kms.py b/salt/states/boto_kms.py index aadc02093e8..3c542541304 100644 --- a/salt/states/boto_kms.py +++ b/salt/states/boto_kms.py @@ -174,7 +174,7 @@ def _key_present( profile, ): ret = {"result": True, "comment": "", "changes": {}} - alias = "alias/{}".format(name) + alias = f"alias/{name}" r = __salt__["boto_kms.key_exists"](alias, region, key, keyid, profile) if "error" in r: ret["result"] = False @@ -212,7 +212,7 @@ def _key_present( return ret ret["changes"]["old"] = {"key": None} ret["changes"]["new"] = {"key": name} - ret["comment"] = "Key {} created.".format(name) + ret["comment"] = f"Key {name} created." else: rd = __salt__["boto_kms.describe_key"](alias, region, key, keyid, profile) if "error" in rd: @@ -271,7 +271,7 @@ def _key_enabled(key_metadata, enabled, region, key, keyid, profile): re["error"]["message"] ) else: - ret["comment"] = "{} key.".format(event) + ret["comment"] = f"{event} key." return ret @@ -339,7 +339,7 @@ def _key_rotation(key_metadata, key_rotation, region, key, keyid, profile): "old": {"key_rotation": not key_rotation}, "new": {"key_rotation": key_rotation}, } - ret["comment"] = "Set key rotation policy to {}.".format(key_rotation) + ret["comment"] = f"Set key rotation policy to {key_rotation}." return ret diff --git a/salt/states/boto_lambda.py b/salt/states/boto_lambda.py index 2a0cb1c20a3..0ce5a513c06 100644 --- a/salt/states/boto_lambda.py +++ b/salt/states/boto_lambda.py @@ -248,7 +248,7 @@ def function_present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Function {} is set to be created.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} is set to be created." ret["result"] = None return ret r = __salt__["boto_lambda.create_function"]( @@ -288,7 +288,7 @@ def function_present( key=key, keyid=keyid, profile=profile, - **permission + **permission, ) if not r.get("updated"): ret["result"] = False @@ -304,11 +304,11 @@ def function_present( )["permissions"] ret["changes"]["old"] = {"function": None} ret["changes"]["new"] = _describe - ret["comment"] = "Function {} created.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} created." return ret ret["comment"] = os.linesep.join( - [ret["comment"], "Function {} is present.".format(FunctionName)] + [ret["comment"], f"Function {FunctionName} is present."] ) ret["changes"] = {} # function exists, ensure config matches @@ -372,7 +372,7 @@ def _get_role_arn(name, region=None, key=None, keyid=None, profile=None): account_id = __salt__["boto_iam.get_account_id"]( region=region, key=key, keyid=keyid, profile=profile ) - return "arn:aws:iam::{}:role/{}".format(account_id, name) + return f"arn:aws:iam::{account_id}:role/{name}" def _resolve_vpcconfig(conf, region=None, key=None, keyid=None, profile=None): @@ -460,7 +460,7 @@ def _function_config_present( [ret["comment"], "Function config to be modified"] ) if __opts__["test"]: - ret["comment"] = "Function {} set to be modified.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} set to be modified." ret["result"] = None return ret _r = __salt__["boto_lambda.update_function_config"]( @@ -501,7 +501,7 @@ def _function_code_present( dlZipFile = __salt__["cp.cache_file"](path=ZipFile) if dlZipFile is False: ret["result"] = False - ret["comment"] = "Failed to cache ZipFile `{}`.".format(ZipFile) + ret["comment"] = f"Failed to cache ZipFile `{ZipFile}`." return ret ZipFile = dlZipFile size = os.path.getsize(ZipFile) @@ -521,7 +521,7 @@ def _function_code_present( update = True if update: if __opts__["test"]: - ret["comment"] = "Function {} set to be modified.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} set to be modified." ret["result"] = None return ret ret["changes"]["old"] = { @@ -579,7 +579,7 @@ def _function_permissions_present( [ret["comment"], "Function permissions to be modified"] ) if __opts__["test"]: - ret["comment"] = "Function {} set to be modified.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} set to be modified." ret["result"] = None return ret for sid, diff in diffs.items(): @@ -608,7 +608,7 @@ def _function_permissions_present( key=key, keyid=keyid, profile=profile, - **diff["new"] + **diff["new"], ) ret["changes"].setdefault("new", {}).setdefault("Permissions", {})[ sid @@ -664,11 +664,11 @@ def function_absent( return ret if r and not r["exists"]: - ret["comment"] = "Function {} does not exist.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Function {} is set to be removed.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} is set to be removed." ret["result"] = None return ret r = __salt__["boto_lambda.delete_function"]( @@ -680,7 +680,7 @@ def function_absent( return ret ret["changes"]["old"] = {"function": FunctionName} ret["changes"]["new"] = {"function": None} - ret["comment"] = "Function {} deleted.".format(FunctionName) + ret["comment"] = f"Function {FunctionName} deleted." return ret @@ -745,7 +745,7 @@ def alias_present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Alias {} is set to be created.".format(Name) + ret["comment"] = f"Alias {Name} is set to be created." ret["result"] = None return ret r = __salt__["boto_lambda.create_alias"]( @@ -767,12 +767,10 @@ def alias_present( ) ret["changes"]["old"] = {"alias": None} ret["changes"]["new"] = _describe - ret["comment"] = "Alias {} created.".format(Name) + ret["comment"] = f"Alias {Name} created." return ret - ret["comment"] = os.linesep.join( - [ret["comment"], "Alias {} is present.".format(Name)] - ) + ret["comment"] = os.linesep.join([ret["comment"], f"Alias {Name} is present."]) ret["changes"] = {} _describe = __salt__["boto_lambda.describe_alias"]( FunctionName, Name, region=region, key=key, keyid=keyid, profile=profile @@ -791,7 +789,7 @@ def alias_present( [ret["comment"], "Alias config to be modified"] ) if __opts__["test"]: - ret["comment"] = "Alias {} set to be modified.".format(Name) + ret["comment"] = f"Alias {Name} set to be modified." ret["result"] = None return ret _r = __salt__["boto_lambda.update_alias"]( @@ -853,11 +851,11 @@ def alias_absent( return ret if r and not r["exists"]: - ret["comment"] = "Alias {} does not exist.".format(Name) + ret["comment"] = f"Alias {Name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Alias {} is set to be removed.".format(Name) + ret["comment"] = f"Alias {Name} is set to be removed." ret["result"] = None return ret r = __salt__["boto_lambda.delete_alias"]( @@ -869,7 +867,7 @@ def alias_absent( return ret ret["changes"]["old"] = {"alias": Name} ret["changes"]["new"] = {"alias": None} - ret["comment"] = "Alias {} deleted.".format(Name) + ret["comment"] = f"Alias {Name} deleted." return ret @@ -884,7 +882,7 @@ def _get_function_arn(name, region=None, key=None, keyid=None, profile=None): region = profile["region"] if region is None: region = "us-east-1" - return "arn:aws:lambda:{}:{}:function:{}".format(region, account_id, name) + return f"arn:aws:lambda:{region}:{account_id}:function:{name}" def event_source_mapping_present( diff --git a/salt/states/boto_rds.py b/salt/states/boto_rds.py index e7af123149e..5d33a01925f 100644 --- a/salt/states/boto_rds.py +++ b/salt/states/boto_rds.py @@ -305,7 +305,7 @@ def present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "RDS instance {} would be created.".format(name) + ret["comment"] = f"RDS instance {name} would be created." ret["result"] = None return ret @@ -373,9 +373,9 @@ def present( profile=profile, ) } - ret["comment"] = "RDS instance {} created.".format(name) + ret["comment"] = f"RDS instance {name} created." else: - ret["comment"] = "RDS instance {} exists.".format(name) + ret["comment"] = f"RDS instance {name} exists." return ret @@ -412,7 +412,7 @@ def replica_present( ) if not replica_exists.get("exists"): if __opts__["test"]: - ret["comment"] = "RDS read replica {} is set to be created ".format(name) + ret["comment"] = f"RDS read replica {name} is set to be created " ret["result"] = None return ret created = __salt__["boto_rds.create_read_replica"]( @@ -432,7 +432,7 @@ def replica_present( profile, ) if created: - ret["comment"] = "RDS replica {} created.".format(name) + ret["comment"] = f"RDS replica {name} created." ret["changes"]["old"] = {"instance": None} ret["changes"]["new"] = { "instance": __salt__["boto_rds.describe_db_instances"]( @@ -446,7 +446,7 @@ def replica_present( } else: ret["result"] = False - ret["comment"] = "Failed to create RDS replica {}.".format(name) + ret["comment"] = f"Failed to create RDS replica {name}." else: jmespath = "DBInstances[0].DBParameterGroups[0].DBParameterGroupName" pmg_name = __salt__["boto_rds.describe_db_instances"]( @@ -470,12 +470,12 @@ def replica_present( if not modified: ret["result"] = False ret["comment"] = ( - "Failed to update parameter group of {} RDS instance.".format(name) + f"Failed to update parameter group of {name} RDS instance." ) ret["changes"]["old"] = pmg_name ret["changes"]["new"] = db_parameter_group_name ret["result"] = True - ret["comment"] = "RDS replica {} exists.".format(name) + ret["comment"] = f"RDS replica {name} exists." return ret @@ -546,7 +546,7 @@ def subnet_group_present( ret["result"] = False return ret if r["id"] is None: - ret["comment"] = "Subnet {} does not exist.".format(i) + ret["comment"] = f"Subnet {i} does not exist." ret["result"] = False return ret subnet_ids.append(r["id"]) @@ -556,7 +556,7 @@ def subnet_group_present( ) if not exists.get("exists"): if __opts__["test"]: - ret["comment"] = "Subnet group {} is set to be created.".format(name) + ret["comment"] = f"Subnet group {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_rds.create_subnet_group"]( @@ -572,14 +572,14 @@ def subnet_group_present( if not created: ret["result"] = False - ret["comment"] = "Failed to create {} subnet group.".format(name) + ret["comment"] = f"Failed to create {name} subnet group." return ret ret["changes"]["old"] = None ret["changes"]["new"] = name - ret["comment"] = "Subnet {} created.".format(name) + ret["comment"] = f"Subnet {name} created." return ret else: - ret["comment"] = "Subnet {} present.".format(name) + ret["comment"] = f"Subnet {name} present." return ret @@ -641,11 +641,11 @@ def absent( ) if not current: ret["result"] = True - ret["comment"] = "{} RDS already absent.".format(name) + ret["comment"] = f"{name} RDS already absent." return ret if __opts__["test"]: - ret["comment"] = "RDS {} would be removed.".format(name) + ret["comment"] = f"RDS {name} would be removed." ret["result"] = None return ret deleted = __salt__["boto_rds.delete"]( @@ -662,11 +662,11 @@ def absent( ) if not deleted: ret["result"] = False - ret["comment"] = "Failed to delete {} RDS.".format(name) + ret["comment"] = f"Failed to delete {name} RDS." return ret ret["changes"]["old"] = {"instance": current[0]} ret["changes"]["new"] = {"instance": None} - ret["comment"] = "RDS {} deleted.".format(name) + ret["comment"] = f"RDS {name} deleted." return ret @@ -680,11 +680,11 @@ def subnet_group_absent( ) if not exists: ret["result"] = True - ret["comment"] = "{} RDS subnet group does not exist.".format(name) + ret["comment"] = f"{name} RDS subnet group does not exist." return ret if __opts__["test"]: - ret["comment"] = "RDS subnet group {} is set to be removed.".format(name) + ret["comment"] = f"RDS subnet group {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_rds.delete_subnet_group"]( @@ -692,11 +692,11 @@ def subnet_group_absent( ) if not deleted: ret["result"] = False - ret["comment"] = "Failed to delete {} RDS subnet group.".format(name) + ret["comment"] = f"Failed to delete {name} RDS subnet group." return ret ret["changes"]["old"] = name ret["changes"]["new"] = None - ret["comment"] = "RDS subnet group {} deleted.".format(name) + ret["comment"] = f"RDS subnet group {name} deleted." return ret @@ -761,7 +761,7 @@ def parameter_present( ) if not res.get("exists"): if __opts__["test"]: - ret["comment"] = "Parameter group {} is set to be created.".format(name) + ret["comment"] = f"Parameter group {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_rds.create_parameter_group"]( @@ -776,12 +776,12 @@ def parameter_present( ) if not created: ret["result"] = False - ret["comment"] = "Failed to create {} parameter group.".format(name) + ret["comment"] = f"Failed to create {name} parameter group." return ret ret["changes"]["New Parameter Group"] = name - ret["comment"] = "Parameter group {} created.".format(name) + ret["comment"] = f"Parameter group {name} created." else: - ret["comment"] = "Parameter group {} present.".format(name) + ret["comment"] = f"Parameter group {name} present." if parameters is not None: params = {} changed = {} @@ -798,7 +798,7 @@ def parameter_present( if not options.get("result"): ret["result"] = False ret["comment"] = os.linesep.join( - [ret["comment"], "Faled to get parameters for group {}.".format(name)] + [ret["comment"], f"Faled to get parameters for group {name}."] ) return ret for parameter in options["parameters"].values(): @@ -852,14 +852,14 @@ def parameter_present( ret["comment"] = os.linesep.join( [ ret["comment"], - "Parameters {} for group {} are changed.".format(changed, name), + f"Parameters {changed} for group {name} are changed.", ] ) else: ret["comment"] = os.linesep.join( [ ret["comment"], - "Parameters {} for group {} are present.".format(params, name), + f"Parameters {params} for group {name} are present.", ] ) return ret diff --git a/salt/states/boto_route53.py b/salt/states/boto_route53.py index 2f2792c6449..39ed57aca52 100644 --- a/salt/states/boto_route53.py +++ b/salt/states/boto_route53.py @@ -210,13 +210,13 @@ def present( identifier, ) except SaltInvocationError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" ret["result"] = False return ret if isinstance(record, dict) and not record: if __opts__["test"]: - ret["comment"] = "Route53 record {} set to be added.".format(name) + ret["comment"] = f"Route53 record {name} set to be added." ret["result"] = None return ret added = __salt__["boto_route53.add_record"]( @@ -243,10 +243,10 @@ def present( "ttl": ttl, "identifier": identifier, } - ret["comment"] = "Added {} Route53 record.".format(name) + ret["comment"] = f"Added {name} Route53 record." else: ret["result"] = False - ret["comment"] = "Failed to add {} Route53 record.".format(name) + ret["comment"] = f"Failed to add {name} Route53 record." return ret elif record: need_to_update = False @@ -267,7 +267,7 @@ def present( need_to_update = True if need_to_update: if __opts__["test"]: - ret["comment"] = "Route53 record {} set to be updated.".format(name) + ret["comment"] = f"Route53 record {name} set to be updated." ret["result"] = None return ret updated = __salt__["boto_route53.update_record"]( @@ -294,12 +294,12 @@ def present( "ttl": ttl, "identifier": identifier, } - ret["comment"] = "Updated {} Route53 record.".format(name) + ret["comment"] = f"Updated {name} Route53 record." else: ret["result"] = False - ret["comment"] = "Failed to update {} Route53 record.".format(name) + ret["comment"] = f"Failed to update {name} Route53 record." else: - ret["comment"] = "{} exists.".format(name) + ret["comment"] = f"{name} exists." return ret @@ -375,7 +375,7 @@ def absent( ) if record: if __opts__["test"]: - ret["comment"] = "Route53 record {} set to be deleted.".format(name) + ret["comment"] = f"Route53 record {name} set to be deleted." ret["result"] = None return ret deleted = __salt__["boto_route53.delete_record"]( @@ -395,12 +395,12 @@ def absent( if deleted: ret["changes"]["old"] = record ret["changes"]["new"] = None - ret["comment"] = "Deleted {} Route53 record.".format(name) + ret["comment"] = f"Deleted {name} Route53 record." else: ret["result"] = False - ret["comment"] = "Failed to delete {} Route53 record.".format(name) + ret["comment"] = f"Failed to delete {name} Route53 record." else: - ret["comment"] = "{} does not exist.".format(name) + ret["comment"] = f"{name} does not exist." return ret @@ -574,13 +574,13 @@ def hosted_zone_present( profile=profile, ) if res: - msg = "Hosted Zone {} successfully created".format(domain_name) + msg = f"Hosted Zone {domain_name} successfully created" log.info(msg) ret["comment"] = msg ret["changes"]["old"] = None ret["changes"]["new"] = res else: - ret["comment"] = "Creating Hosted Zone {} failed".format(domain_name) + ret["comment"] = f"Creating Hosted Zone {domain_name} failed" ret["result"] = False return ret @@ -608,11 +608,11 @@ def hosted_zone_absent( domain_name=domain_name, region=region, key=key, keyid=keyid, profile=profile ) if not deets: - ret["comment"] = "Hosted Zone {} already absent".format(domain_name) + ret["comment"] = f"Hosted Zone {domain_name} already absent" log.info(ret["comment"]) return ret if __opts__["test"]: - ret["comment"] = "Route53 Hosted Zone {} set to be deleted.".format(domain_name) + ret["comment"] = f"Route53 Hosted Zone {domain_name} set to be deleted." ret["result"] = None return ret # Not entirely comfortable with this - no safety checks around pub/priv, VPCs @@ -621,7 +621,7 @@ def hosted_zone_absent( if __salt__["boto_route53.delete_zone"]( zone=domain_name, region=region, key=key, keyid=keyid, profile=profile ): - ret["comment"] = "Route53 Hosted Zone {} deleted".format(domain_name) + ret["comment"] = f"Route53 Hosted Zone {domain_name} deleted" log.info(ret["comment"]) ret["changes"]["old"] = deets ret["changes"]["new"] = None diff --git a/salt/states/boto_s3.py b/salt/states/boto_s3.py index d5ab644a661..e80f25c8539 100644 --- a/salt/states/boto_s3.py +++ b/salt/states/boto_s3.py @@ -176,7 +176,7 @@ def object_present( combined_extra_args_keys = frozenset(combined_extra_args.keys()) extra_keys = combined_extra_args_keys - supported_args if extra_keys: - msg = "extra_args keys {} are not supported".format(extra_keys) + msg = f"extra_args keys {extra_keys} are not supported" return {"error": msg} # Get the hash of the local file @@ -252,7 +252,7 @@ def object_present( } if s3_metadata == desired_metadata: ret["result"] = True - ret["comment"] = "S3 object {} is present.".format(name) + ret["comment"] = f"S3 object {name} is present." return ret action = "update" else: @@ -276,8 +276,8 @@ def object_present( if __opts__["test"]: ret["result"] = None - ret["comment"] = "S3 object {} set to be {}d.".format(name, action) - ret["comment"] += "\nChanges:\n{}".format(changes_diff) + ret["comment"] = f"S3 object {name} set to be {action}d." + ret["comment"] += f"\nChanges:\n{changes_diff}" ret["changes"] = {"diff": changes_diff} return ret @@ -300,7 +300,7 @@ def object_present( return ret ret["result"] = True - ret["comment"] = "S3 object {} {}d.".format(name, action) - ret["comment"] += "\nChanges:\n{}".format(changes_diff) + ret["comment"] = f"S3 object {name} {action}d." + ret["comment"] += f"\nChanges:\n{changes_diff}" ret["changes"] = {"diff": changes_diff} return ret diff --git a/salt/states/boto_s3_bucket.py b/salt/states/boto_s3_bucket.py index d3a4067dd47..9baee1f5350 100644 --- a/salt/states/boto_s3_bucket.py +++ b/salt/states/boto_s3_bucket.py @@ -298,7 +298,7 @@ def _get_role_arn(name, region=None, key=None, keyid=None, profile=None): region = profile["region"] if region is None: region = "us-east-1" - return "arn:aws:iam::{}:role/{}".format(account_id, name) + return f"arn:aws:iam::{account_id}:role/{name}" def _compare_json(current, desired, region, key, keyid, profile): @@ -439,7 +439,7 @@ def present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "S3 bucket {} is set to be created.".format(Bucket) + ret["comment"] = f"S3 bucket {Bucket} is set to be created." ret["result"] = None return ret r = __salt__["boto_s3_bucket.create"]( @@ -480,13 +480,13 @@ def present( ("put_website", Website, Website), ): if testval is not None: - r = __salt__["boto_s3_bucket.{}".format(setter)]( + r = __salt__[f"boto_s3_bucket.{setter}"]( Bucket=Bucket, region=region, key=key, keyid=keyid, profile=profile, - **funcargs + **funcargs, ) if not r.get("updated"): ret["result"] = False @@ -500,14 +500,12 @@ def present( ) ret["changes"]["old"] = {"bucket": None} ret["changes"]["new"] = _describe - ret["comment"] = "S3 bucket {} created.".format(Bucket) + ret["comment"] = f"S3 bucket {Bucket} created." return ret # bucket exists, ensure config matches - ret["comment"] = " ".join( - [ret["comment"], "S3 bucket {} is present.".format(Bucket)] - ) + ret["comment"] = " ".join([ret["comment"], f"S3 bucket {Bucket} is present."]) ret["changes"] = {} _describe = __salt__["boto_s3_bucket.describe"]( Bucket=Bucket, region=region, key=key, keyid=keyid, profile=profile @@ -646,7 +644,7 @@ def present( if not __opts__["test"]: if deleter and desired is None: # Setting can be deleted, so use that to unset it - r = __salt__["boto_s3_bucket.{}".format(deleter)]( + r = __salt__[f"boto_s3_bucket.{deleter}"]( Bucket=Bucket, region=region, key=key, @@ -661,13 +659,13 @@ def present( ret["changes"] = {} return ret else: - r = __salt__["boto_s3_bucket.{}".format(setter)]( + r = __salt__[f"boto_s3_bucket.{setter}"]( Bucket=Bucket, region=region, key=key, keyid=keyid, profile=profile, - **(desired or {}) + **(desired or {}), ) if not r.get("updated"): ret["result"] = False @@ -677,7 +675,7 @@ def present( ret["changes"] = {} return ret if update and __opts__["test"]: - msg = "S3 bucket {} set to be modified.".format(Bucket) + msg = f"S3 bucket {Bucket} set to be modified." ret["comment"] = msg ret["result"] = None return ret @@ -692,7 +690,7 @@ def present( ) log.warning(msg) ret["result"] = False - ret["comment"] = "Failed to update bucket: {}.".format(msg) + ret["comment"] = f"Failed to update bucket: {msg}." return ret return ret @@ -736,11 +734,11 @@ def absent(name, Bucket, Force=False, region=None, key=None, keyid=None, profile return ret if r and not r["exists"]: - ret["comment"] = "S3 bucket {} does not exist.".format(Bucket) + ret["comment"] = f"S3 bucket {Bucket} does not exist." return ret if __opts__["test"]: - ret["comment"] = "S3 bucket {} is set to be removed.".format(Bucket) + ret["comment"] = f"S3 bucket {Bucket} is set to be removed." ret["result"] = None return ret r = __salt__["boto_s3_bucket.delete"]( @@ -752,5 +750,5 @@ def absent(name, Bucket, Force=False, region=None, key=None, keyid=None, profile return ret ret["changes"]["old"] = {"bucket": Bucket} ret["changes"]["new"] = {"bucket": None} - ret["comment"] = "S3 bucket {} deleted.".format(Bucket) + ret["comment"] = f"S3 bucket {Bucket} deleted." return ret diff --git a/salt/states/boto_secgroup.py b/salt/states/boto_secgroup.py index 983ef5b80e5..23ef79e32f9 100644 --- a/salt/states/boto_secgroup.py +++ b/salt/states/boto_secgroup.py @@ -283,7 +283,7 @@ def _security_group_present( ) if not exists: if __opts__["test"]: - ret["comment"] = "Security group {} is set to be created.".format(name) + ret["comment"] = f"Security group {name} is set to be created." ret["result"] = None return ret created = __salt__["boto_secgroup.create"]( @@ -309,12 +309,12 @@ def _security_group_present( vpc_name=vpc_name, ) ret["changes"]["new"] = {"secgroup": sg} - ret["comment"] = "Security group {} created.".format(name) + ret["comment"] = f"Security group {name} created." else: ret["result"] = False - ret["comment"] = "Failed to create {} security group.".format(name) + ret["comment"] = f"Failed to create {name} security group." else: - ret["comment"] = "Security group {} present.".format(name) + ret["comment"] = f"Security group {name} present." return ret @@ -422,7 +422,7 @@ def _get_rule_changes(rules, _rules): -1, ] if ip_protocol not in supported_protocols and ( - not "{}".format(ip_protocol).isdigit() or int(ip_protocol) > 255 + not f"{ip_protocol}".isdigit() or int(ip_protocol) > 255 ): raise SaltInvocationError( "Invalid ip_protocol {} specified in security group rule.".format( @@ -509,9 +509,7 @@ def _rules_present( vpc_name=vpc_name, ) if not sg: - ret["comment"] = ( - "{} security group configuration could not be retrieved.".format(name) - ) + ret["comment"] = f"{name} security group configuration could not be retrieved." ret["result"] = False return ret rules = _split_rules(rules) @@ -568,12 +566,12 @@ def _rules_present( key=key, keyid=keyid, profile=profile, - **rule + **rule, ) if not _deleted: deleted = False if deleted: - ret["comment"] = "Removed rules on {} security group.".format(name) + ret["comment"] = f"Removed rules on {name} security group." else: ret["comment"] = "Failed to remove rules on {} security group.".format( name @@ -590,7 +588,7 @@ def _rules_present( key=key, keyid=keyid, profile=profile, - **rule + **rule, ) if not _created: created = False @@ -598,14 +596,14 @@ def _rules_present( ret["comment"] = " ".join( [ ret["comment"], - "Created rules on {} security group.".format(name), + f"Created rules on {name} security group.", ] ) else: ret["comment"] = " ".join( [ ret["comment"], - "Failed to create rules on {} security group.".format(name), + f"Failed to create rules on {name} security group.", ] ) ret["result"] = False @@ -654,9 +652,7 @@ def _rules_egress_present( vpc_name=vpc_name, ) if not sg: - ret["comment"] = ( - "{} security group configuration could not be retrieved.".format(name) - ) + ret["comment"] = f"{name} security group configuration could not be retrieved." ret["result"] = False return ret rules_egress = _split_rules(rules_egress) @@ -714,7 +710,7 @@ def _rules_egress_present( keyid=keyid, profile=profile, egress=True, - **rule + **rule, ) if not _deleted: deleted = False @@ -722,7 +718,7 @@ def _rules_egress_present( ret["comment"] = " ".join( [ ret["comment"], - "Removed egress rule on {} security group.".format(name), + f"Removed egress rule on {name} security group.", ] ) else: @@ -747,7 +743,7 @@ def _rules_egress_present( keyid=keyid, profile=profile, egress=True, - **rule + **rule, ) if not _created: created = False @@ -755,7 +751,7 @@ def _rules_egress_present( ret["comment"] = " ".join( [ ret["comment"], - "Created egress rules on {} security group.".format(name), + f"Created egress rules on {name} security group.", ] ) else: @@ -831,7 +827,7 @@ def absent( if sg: if __opts__["test"]: - ret["comment"] = "Security group {} is set to be removed.".format(name) + ret["comment"] = f"Security group {name} is set to be removed." ret["result"] = None return ret deleted = __salt__["boto_secgroup.delete"]( @@ -847,12 +843,12 @@ def absent( if deleted: ret["changes"]["old"] = {"secgroup": sg} ret["changes"]["new"] = {"secgroup": None} - ret["comment"] = "Security group {} deleted.".format(name) + ret["comment"] = f"Security group {name} deleted." else: ret["result"] = False - ret["comment"] = "Failed to delete {} security group.".format(name) + ret["comment"] = f"Failed to delete {name} security group." else: - ret["comment"] = "{} security group does not exist.".format(name) + ret["comment"] = f"{name} security group does not exist." return ret @@ -883,7 +879,7 @@ def _tags_present( ) if not sg: ret["comment"] = ( - "{} security group configuration could not be retrieved.".format(name) + f"{name} security group configuration could not be retrieved." ) ret["result"] = False return ret diff --git a/salt/states/boto_sns.py b/salt/states/boto_sns.py index d4e4c05133b..387a29868c9 100644 --- a/salt/states/boto_sns.py +++ b/salt/states/boto_sns.py @@ -106,10 +106,10 @@ def present(name, subscriptions=None, region=None, key=None, keyid=None, profile ) if is_present: ret["result"] = True - ret["comment"] = "AWS SNS topic {} present.".format(name) + ret["comment"] = f"AWS SNS topic {name} present." else: if __opts__["test"]: - msg = "AWS SNS topic {} is set to be created.".format(name) + msg = f"AWS SNS topic {name} is set to be created." ret["comment"] = msg ret["result"] = None return ret @@ -118,13 +118,13 @@ def present(name, subscriptions=None, region=None, key=None, keyid=None, profile name, region=region, key=key, keyid=keyid, profile=profile ) if created: - msg = "AWS SNS topic {} created.".format(name) + msg = f"AWS SNS topic {name} created." ret["comment"] = msg ret["changes"]["old"] = None ret["changes"]["new"] = {"topic": name, "subscriptions": []} ret["result"] = True else: - ret["comment"] = "Failed to create {} AWS SNS topic".format(name) + ret["comment"] = f"Failed to create {name} AWS SNS topic" ret["result"] = False return ret @@ -264,7 +264,7 @@ def absent(name, region=None, key=None, keyid=None, profile=None, unsubscribe=Fa name, region=region, key=key, keyid=keyid, profile=profile ) if deleted: - ret["comment"] = "AWS SNS topic {} deleted.".format(name) + ret["comment"] = f"AWS SNS topic {name} deleted." ret["changes"]["new"] = None if unsubscribe is False: ret["changes"]["old"] = {"topic": name} @@ -276,8 +276,8 @@ def absent(name, region=None, key=None, keyid=None, profile=None, unsubscribe=Fa } else: ret["result"] = False - ret["comment"] = "Failed to delete {} AWS SNS topic.".format(name) + ret["comment"] = f"Failed to delete {name} AWS SNS topic." else: - ret["comment"] = "AWS SNS topic {} does not exist.".format(name) + ret["comment"] = f"AWS SNS topic {name} does not exist." return ret diff --git a/salt/states/boto_sqs.py b/salt/states/boto_sqs.py index 0c3784070c9..6f0e4b3a61a 100644 --- a/salt/states/boto_sqs.py +++ b/salt/states/boto_sqs.py @@ -124,12 +124,12 @@ def present( return ret if r["result"]: - ret["comment"].append("SQS queue {} present.".format(name)) + ret["comment"].append(f"SQS queue {name} present.") else: if __opts__["test"]: ret["result"] = None ret["comment"].append( - "SQS queue {} is set to be created.".format(name), + f"SQS queue {name} is set to be created.", ) ret["changes"] = {"old": None, "new": name} return ret @@ -149,7 +149,7 @@ def present( ) return ret - ret["comment"].append("SQS queue {} created.".format(name)) + ret["comment"].append(f"SQS queue {name} created.") ret["changes"]["old"] = None ret["changes"]["new"] = name # Return immediately, as the create call also set all attributes @@ -238,7 +238,7 @@ def present( return ret ret["comment"].append( - "Updated SQS queue attribute(s) {}.".format(attr_names), + f"Updated SQS queue attribute(s) {attr_names}.", ) ret["changes"]["attributes"] = {"diff": attributes_diff} return ret @@ -293,7 +293,7 @@ def absent( if __opts__["test"]: ret["result"] = None - ret["comment"] = "SQS queue {} is set to be removed.".format(name) + ret["comment"] = f"SQS queue {name} is set to be removed." ret["changes"] = {"old": name, "new": None} return ret @@ -309,7 +309,7 @@ def absent( ret["comment"] = str(r["error"]) return ret - ret["comment"] = "SQS queue {} was deleted.".format(name) + ret["comment"] = f"SQS queue {name} was deleted." ret["changes"]["old"] = name ret["changes"]["new"] = None return ret diff --git a/salt/states/boto_vpc.py b/salt/states/boto_vpc.py index d0a567fad35..d65d3ca7255 100644 --- a/salt/states/boto_vpc.py +++ b/salt/states/boto_vpc.py @@ -227,7 +227,7 @@ def present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "VPC {} is set to be created.".format(name) + ret["comment"] = f"VPC {name} is set to be created." ret["result"] = None return ret r = __salt__["boto_vpc.create"]( @@ -251,7 +251,7 @@ def present( ) ret["changes"]["old"] = {"vpc": None} ret["changes"]["new"] = _describe - ret["comment"] = "VPC {} created.".format(name) + ret["comment"] = f"VPC {name} created." return ret ret["comment"] = "VPC present." return ret @@ -293,11 +293,11 @@ def absent(name, tags=None, region=None, key=None, keyid=None, profile=None): _id = r.get("id") if not _id: - ret["comment"] = "{} VPC does not exist.".format(name) + ret["comment"] = f"{name} VPC does not exist." return ret if __opts__["test"]: - ret["comment"] = "VPC {} is set to be removed.".format(name) + ret["comment"] = f"VPC {name} is set to be removed." ret["result"] = None return ret r = __salt__["boto_vpc.delete"]( @@ -309,7 +309,7 @@ def absent(name, tags=None, region=None, key=None, keyid=None, profile=None): return ret ret["changes"]["old"] = {"vpc": _id} ret["changes"]["new"] = {"vpc": None} - ret["comment"] = "VPC {} deleted.".format(name) + ret["comment"] = f"VPC {name} deleted." return ret @@ -428,7 +428,7 @@ def dhcp_options_present( return ret else: if __opts__["test"]: - ret["comment"] = "DHCP options {} are set to be created.".format(name) + ret["comment"] = f"DHCP options {name} are set to be created." ret["result"] = None return ret @@ -456,7 +456,7 @@ def dhcp_options_present( ret["changes"]["old"] = {"dhcp_options": None} ret["changes"]["new"] = {"dhcp_options": _new} - ret["comment"] = "DHCP options {} created.".format(name) + ret["comment"] = f"DHCP options {name} created." return ret @@ -508,11 +508,11 @@ def dhcp_options_absent( _id = r.get("id") if not _id: - ret["comment"] = "DHCP options {} do not exist.".format(name) + ret["comment"] = f"DHCP options {name} do not exist." return ret if __opts__["test"]: - ret["comment"] = "DHCP options {} are set to be deleted.".format(name) + ret["comment"] = f"DHCP options {name} are set to be deleted." ret["result"] = None return ret @@ -528,7 +528,7 @@ def dhcp_options_absent( ret["changes"]["old"] = {"dhcp_options": _id} ret["changes"]["new"] = {"dhcp_options": None} - ret["comment"] = "DHCP options {} deleted.".format(name) + ret["comment"] = f"DHCP options {name} deleted." return ret @@ -667,7 +667,7 @@ def subnet_present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Subnet {} is set to be created.".format(name) + ret["comment"] = f"Subnet {name} is set to be created." ret["result"] = None return ret r = __salt__["boto_vpc.create_subnet"]( @@ -692,7 +692,7 @@ def subnet_present( ) ret["changes"]["old"] = {"subnet": None} ret["changes"]["new"] = _describe - ret["comment"] = "Subnet {} created.".format(name) + ret["comment"] = f"Subnet {name} created." else: ret["comment"] = "Subnet present." @@ -703,7 +703,7 @@ def subnet_present( ) if not _verify_subnet_association(route_table_desc, _describe["subnet"]["id"]): if __opts__["test"]: - msg = "Subnet is set to be associated with route table {}".format(rtid) + msg = f"Subnet is set to be associated with route table {rtid}" ret["comment"] = " ".join([ret["comment"], msg]) ret["result"] = None return ret @@ -741,7 +741,7 @@ def subnet_present( ret["result"] = False return ret else: - msg = "Subnet successfully associated with route table {}.".format(rtid) + msg = f"Subnet successfully associated with route table {rtid}." ret["comment"] = " ".join([ret["comment"], msg]) if "new" not in ret["changes"]: ret["changes"]["new"] = __salt__["boto_vpc.describe_subnet"]( @@ -759,7 +759,7 @@ def subnet_present( ret["comment"] = " ".join( [ ret["comment"], - "Subnet is already associated with route table {}".format(rtid), + f"Subnet is already associated with route table {rtid}", ] ) return ret @@ -821,7 +821,7 @@ def subnet_absent( _id = r.get("id") if not _id: - ret["comment"] = "{} subnet does not exist.".format(name) + ret["comment"] = f"{name} subnet does not exist." return ret if __opts__["test"]: @@ -839,7 +839,7 @@ def subnet_absent( ret["changes"]["old"] = {"subnet": _id} ret["changes"]["new"] = {"subnet": None} - ret["comment"] = "Subnet {} deleted.".format(name) + ret["comment"] = f"Subnet {name} deleted." return ret @@ -902,7 +902,7 @@ def internet_gateway_present( if not r.get("exists"): if __opts__["test"]: - ret["comment"] = "Internet gateway {} is set to be created.".format(name) + ret["comment"] = f"Internet gateway {name} is set to be created." ret["result"] = None return ret r = __salt__["boto_vpc.create_internet_gateway"]( @@ -924,9 +924,9 @@ def internet_gateway_present( ret["changes"]["old"] = {"internet_gateway": None} ret["changes"]["new"] = {"internet_gateway": r["id"]} - ret["comment"] = "Internet gateway {} created.".format(name) + ret["comment"] = f"Internet gateway {name} created." return ret - ret["comment"] = "Internet gateway {} present.".format(name) + ret["comment"] = f"Internet gateway {name} present." return ret @@ -975,11 +975,11 @@ def internet_gateway_absent( igw_id = r["id"] if not igw_id: - ret["comment"] = "Internet gateway {} does not exist.".format(name) + ret["comment"] = f"Internet gateway {name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Internet gateway {} is set to be removed.".format(name) + ret["comment"] = f"Internet gateway {name} is set to be removed." ret["result"] = None return ret r = __salt__["boto_vpc.delete_internet_gateway"]( @@ -998,7 +998,7 @@ def internet_gateway_absent( return ret ret["changes"]["old"] = {"internet_gateway": igw_id} ret["changes"]["new"] = {"internet_gateway": None} - ret["comment"] = "Internet gateway {} deleted.".format(name) + ret["comment"] = f"Internet gateway {name} deleted." return ret @@ -1160,7 +1160,7 @@ def _route_table_present( if not _id: if __opts__["test"]: - msg = "Route table {} is set to be created.".format(name) + msg = f"Route table {name} is set to be created." ret["comment"] = msg ret["result"] = None return ret @@ -1184,9 +1184,9 @@ def _route_table_present( ret["changes"]["old"] = {"route_table": None} ret["changes"]["new"] = {"route_table": r["id"]} - ret["comment"] = "Route table {} created.".format(name) + ret["comment"] = f"Route table {name} created." return ret - ret["comment"] = "Route table {} ({}) present.".format(name, _id) + ret["comment"] = f"Route table {name} ({_id}) present." return ret @@ -1245,7 +1245,7 @@ def _routes_present( ret["result"] = False return ret if r["id"] is None: - msg = "Internet gateway {} does not exist.".format(i) + msg = f"Internet gateway {i} does not exist." ret["comment"] = msg ret["result"] = False return ret @@ -1269,7 +1269,7 @@ def _routes_present( ret["result"] = False return ret if r["id"] is None: - msg = "VPC peering connection {} does not exist.".format(i) + msg = f"VPC peering connection {i} does not exist." ret["comment"] = msg ret["result"] = False return ret @@ -1323,7 +1323,7 @@ def _routes_present( to_delete.append(route) if to_create or to_delete: if __opts__["test"]: - msg = "Route table {} set to have routes modified.".format(route_table_name) + msg = f"Route table {route_table_name} set to have routes modified." ret["comment"] = msg ret["result"] = None return ret @@ -1357,7 +1357,7 @@ def _routes_present( key=key, keyid=keyid, profile=profile, - **r + **r, ) if not res["created"]: msg = "Failed to create route {} in route table {}: {}.".format( @@ -1412,7 +1412,7 @@ def _subnets_present( ret["result"] = False return ret if r["id"] is None: - msg = "Subnet {} does not exist.".format(i) + msg = f"Subnet {i} does not exist." ret["comment"] = msg ret["result"] = False return ret @@ -1536,11 +1536,11 @@ def route_table_absent(name, region=None, key=None, keyid=None, profile=None): rtbl_id = r["id"] if not rtbl_id: - ret["comment"] = "Route table {} does not exist.".format(name) + ret["comment"] = f"Route table {name} does not exist." return ret if __opts__["test"]: - ret["comment"] = "Route table {} is set to be removed.".format(name) + ret["comment"] = f"Route table {name} is set to be removed." ret["result"] = None return ret @@ -1555,7 +1555,7 @@ def route_table_absent(name, region=None, key=None, keyid=None, profile=None): return ret ret["changes"]["old"] = {"route_table": rtbl_id} ret["changes"]["new"] = {"route_table": None} - ret["comment"] = "Route table {} deleted.".format(name) + ret["comment"] = f"Route table {name} deleted." return ret @@ -1650,7 +1650,7 @@ def nat_gateway_present( inst = r[0] _id = inst.get("NatGatewayId") - ret["comment"] = "Nat gateway {} present.".format(_id) + ret["comment"] = f"Nat gateway {_id} present." return ret @@ -1740,9 +1740,7 @@ def nat_gateway_absent( r["error"]["message"] ) return ret - ret["comment"] = ", ".join( - (ret["comment"], "Nat gateway {} deleted.".format(rtbl_id)) - ) + ret["comment"] = ", ".join((ret["comment"], f"Nat gateway {rtbl_id} deleted.")) ret["changes"]["old"] = {"nat_gateway": rtbl_id} ret["changes"]["new"] = {"nat_gateway": None} return ret diff --git a/salt/states/bower.py b/salt/states/bower.py index f6185825b04..e7966345273 100644 --- a/salt/states/bower.py +++ b/salt/states/bower.py @@ -87,7 +87,7 @@ def installed(name, dir, pkgs=None, user=None, env=None): installed_pkgs = __salt__["bower.list"](dir=dir, runas=user, env=env) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error looking up '{}': {}".format(name, err) + ret["comment"] = f"Error looking up '{name}': {err}" return ret else: installed_pkgs = {p: info for p, info in installed_pkgs.items()} @@ -105,7 +105,7 @@ def installed(name, dir, pkgs=None, user=None, env=None): if pkg_name in installed_pkgs: installed_pkg = installed_pkgs[pkg_name] installed_pkg_ver = installed_pkg.get("pkgMeta").get("version") - installed_name_ver = "{}#{}".format(pkg_name, installed_pkg_ver) + installed_name_ver = f"{pkg_name}#{installed_pkg_ver}" # If given an explicit version check the installed version matches. if pkg_ver: @@ -199,30 +199,30 @@ def removed(name, dir, user=None): installed_pkgs = __salt__["bower.list"](dir=dir, runas=user) except (CommandExecutionError, CommandNotFoundError) as err: ret["result"] = False - ret["comment"] = "Error removing '{}': {}".format(name, err) + ret["comment"] = f"Error removing '{name}': {err}" return ret if name not in installed_pkgs: ret["result"] = True - ret["comment"] = "Package '{}' is not installed".format(name) + ret["comment"] = f"Package '{name}' is not installed" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Package '{}' is set to be removed".format(name) + ret["comment"] = f"Package '{name}' is set to be removed" return ret try: if __salt__["bower.uninstall"](pkg=name, dir=dir, runas=user): ret["result"] = True ret["changes"] = {name: "Removed"} - ret["comment"] = "Package '{}' was successfully removed".format(name) + ret["comment"] = f"Package '{name}' was successfully removed" else: ret["result"] = False - ret["comment"] = "Error removing '{}'".format(name) + ret["comment"] = f"Error removing '{name}'" except (CommandExecutionError, CommandNotFoundError) as err: ret["result"] = False - ret["comment"] = "Error removing '{}': {}".format(name, err) + ret["comment"] = f"Error removing '{name}': {err}" return ret @@ -241,14 +241,14 @@ def bootstrap(name, user=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Directory '{}' is set to be bootstrapped".format(name) + ret["comment"] = f"Directory '{name}' is set to be bootstrapped" return ret try: call = __salt__["bower.install"](pkg=None, dir=name, runas=user) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error bootstrapping '{}': {}".format(name, err) + ret["comment"] = f"Error bootstrapping '{name}': {err}" return ret if not call: @@ -279,21 +279,21 @@ def pruned(name, user=None, env=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Directory '{}' is set to be pruned".format(name) + ret["comment"] = f"Directory '{name}' is set to be pruned" return ret try: call = __salt__["bower.prune"](dir=name, runas=user, env=env) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error pruning '{}': {}".format(name, err) + ret["comment"] = f"Error pruning '{name}': {err}" return ret ret["result"] = True if call: - ret["comment"] = "Directory '{}' was successfully pruned".format(name) + ret["comment"] = f"Directory '{name}' was successfully pruned" ret["changes"] = {"old": [], "new": call} else: - ret["comment"] = "No packages were pruned from directory '{}'".format(name) + ret["comment"] = f"No packages were pruned from directory '{name}'" return ret diff --git a/salt/states/btrfs.py b/salt/states/btrfs.py index 68ab8f869c9..2c17192754e 100644 --- a/salt/states/btrfs.py +++ b/salt/states/btrfs.py @@ -97,7 +97,7 @@ def __mount_device(action): if device: dest = _mount(device, use_default) if not dest: - msg = "Device {} cannot be mounted".format(device) + msg = f"Device {device} cannot be mounted" ret["comment"].append(msg) kwargs["__dest"] = dest ret = action(*args, **kwargs) @@ -157,7 +157,7 @@ def subvolume_created( exists = __salt__["btrfs.subvolume_exists"](path) if exists: - ret["comment"].append("Subvolume {} already present".format(name)) + ret["comment"].append(f"Subvolume {name} already present") # Resolve first the test case. The check is not complete, but at # least we will report if a subvolume needs to be created. Can @@ -166,7 +166,7 @@ def subvolume_created( if __opts__["test"]: ret["result"] = None if not exists: - ret["changes"][name] = "Subvolume {} will be created".format(name) + ret["changes"][name] = f"Subvolume {name} will be created" return ret if not exists: @@ -174,16 +174,16 @@ def subvolume_created( _path = os.path.dirname(path) res = __states__["file.directory"](_path, makedirs=True) if not res["result"]: - ret["comment"].append("Error creating {} directory".format(_path)) + ret["comment"].append(f"Error creating {_path} directory") return ret try: __salt__["btrfs.subvolume_create"](name, dest=__dest, qgroupids=qgroupids) except CommandExecutionError: - ret["comment"].append("Error creating subvolume {}".format(name)) + ret["comment"].append(f"Error creating subvolume {name}") return ret - ret["changes"][name] = "Created subvolume {}".format(name) + ret["changes"][name] = f"Created subvolume {name}" # If the volume was already present, we can opt-out the check for # default subvolume. @@ -227,12 +227,12 @@ def subvolume_deleted(name, device, commit=False, __dest=None): exists = __salt__["btrfs.subvolume_exists"](path) if not exists: - ret["comment"].append("Subvolume {} already missing".format(name)) + ret["comment"].append(f"Subvolume {name} already missing") if __opts__["test"]: ret["result"] = None if exists: - ret["changes"][name] = "Subvolume {} will be removed".format(name) + ret["changes"][name] = f"Subvolume {name} will be removed" return ret # If commit is set, we wait until all is over @@ -242,10 +242,10 @@ def subvolume_deleted(name, device, commit=False, __dest=None): try: __salt__["btrfs.subvolume_delete"](path, commit=commit) except CommandExecutionError: - ret["comment"].append("Error removing subvolume {}".format(name)) + ret["comment"].append(f"Error removing subvolume {name}") return ret - ret["changes"][name] = "Removed subvolume {}".format(name) + ret["changes"][name] = f"Removed subvolume {name}" ret["result"] = True return ret @@ -320,7 +320,7 @@ def properties(name, device, use_default=False, __dest=None, **properties): path = name if not os.path.exists(path): - ret["comment"].append("Object {} not found".format(name)) + ret["comment"].append(f"Object {name} not found") return ret # Convert the booleans to lowercase @@ -332,14 +332,14 @@ def properties(name, device, use_default=False, __dest=None, **properties): try: current_properties = __salt__["btrfs.properties"](path) except CommandExecutionError as e: - ret["comment"].append("Error reading properties from {}".format(name)) - ret["comment"].append("Current error {}".format(e)) + ret["comment"].append(f"Error reading properties from {name}") + ret["comment"].append(f"Current error {e}") return ret try: properties_to_set = _diff_properties(properties, current_properties) except KeyError: - ret["comment"].append("Some property not found in {}".format(name)) + ret["comment"].append(f"Some property not found in {name}") return ret if __opts__["test"]: @@ -347,14 +347,12 @@ def properties(name, device, use_default=False, __dest=None, **properties): if properties_to_set: ret["changes"] = properties_to_set else: - msg = "No properties will be changed in {}".format(name) + msg = f"No properties will be changed in {name}" ret["comment"].append(msg) return ret if properties_to_set: - _properties = ",".join( - "{}={}".format(k, v) for k, v in properties_to_set.items() - ) + _properties = ",".join(f"{k}={v}" for k, v in properties_to_set.items()) __salt__["btrfs.properties"](path, set=_properties) current_properties = __salt__["btrfs.properties"](path) @@ -366,10 +364,10 @@ def properties(name, device, use_default=False, __dest=None, **properties): ret["comment"].append(msg) return ret - ret["comment"].append("Properties changed in {}".format(name)) + ret["comment"].append(f"Properties changed in {name}") ret["changes"] = properties_to_set else: - ret["comment"].append("Properties not changed in {}".format(name)) + ret["comment"].append(f"Properties not changed in {name}") ret["result"] = True return ret diff --git a/salt/states/cabal.py b/salt/states/cabal.py index 4b38de6eda7..5190d850a9a 100644 --- a/salt/states/cabal.py +++ b/salt/states/cabal.py @@ -83,7 +83,7 @@ def installed(name, pkgs=None, user=None, install_global=False, env=None): call = __salt__["cabal.update"](user=user, env=env) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Could not run cabal update {}".format(err) + ret["comment"] = f"Could not run cabal update {err}" return ret if pkgs is not None: @@ -95,7 +95,7 @@ def installed(name, pkgs=None, user=None, install_global=False, env=None): installed_pkgs = __salt__["cabal.list"](user=user, installed=True, env=env) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error looking up '{}': {}".format(name, err) + ret["comment"] = f"Error looking up '{name}': {err}" return ret pkgs_satisfied = [] @@ -180,24 +180,24 @@ def removed(name, user=None, env=None): installed_pkgs = __salt__["cabal.list"](user=user, installed=True, env=env) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error looking up '{}': {}".format(name, err) + ret["comment"] = f"Error looking up '{name}': {err}" if name not in installed_pkgs: ret["result"] = True - ret["comment"] = "Package '{}' is not installed".format(name) + ret["comment"] = f"Package '{name}' is not installed" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Package '{}' is set to be removed".format(name) + ret["comment"] = f"Package '{name}' is set to be removed" return ret if __salt__["cabal.uninstall"](pkg=name, user=user, env=env): ret["result"] = True ret["changes"][name] = "Removed" - ret["comment"] = "Package '{}' was successfully removed".format(name) + ret["comment"] = f"Package '{name}' was successfully removed" else: ret["result"] = False - ret["comment"] = "Error removing package '{}'".format(name) + ret["comment"] = f"Error removing package '{name}'" return ret diff --git a/salt/states/chronos_job.py b/salt/states/chronos_job.py index 7bea17b8335..dc016eb3718 100644 --- a/salt/states/chronos_job.py +++ b/salt/states/chronos_job.py @@ -97,7 +97,7 @@ def config(name, config): # if test report there will be an update if __opts__["test"]: ret["result"] = None - ret["comment"] = "Chronos job {} is set to be updated".format(name) + ret["comment"] = f"Chronos job {name} is set to be updated" return ret update_result = __salt__["chronos.update_job"](name, update_config) @@ -110,10 +110,10 @@ def config(name, config): return ret else: ret["result"] = True - ret["comment"] = "Updated job config for {}".format(name) + ret["comment"] = f"Updated job config for {name}" return ret ret["result"] = True - ret["comment"] = "Chronos job {} configured correctly".format(name) + ret["comment"] = f"Chronos job {name} configured correctly" return ret @@ -127,18 +127,18 @@ def absent(name): ret = {"name": name, "changes": {}, "result": False, "comment": ""} if not __salt__["chronos.has_job"](name): ret["result"] = True - ret["comment"] = "Job {} already absent".format(name) + ret["comment"] = f"Job {name} already absent" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Job {} is set to be removed".format(name) + ret["comment"] = f"Job {name} is set to be removed" return ret if __salt__["chronos.rm_job"](name): ret["changes"] = {"job": name} ret["result"] = True - ret["comment"] = "Removed job {}".format(name) + ret["comment"] = f"Removed job {name}" return ret else: ret["result"] = False - ret["comment"] = "Failed to remove job {}".format(name) + ret["comment"] = f"Failed to remove job {name}" return ret diff --git a/salt/states/cloud.py b/salt/states/cloud.py index 5cc287db906..8b7afc71c0d 100644 --- a/salt/states/cloud.py +++ b/salt/states/cloud.py @@ -102,11 +102,11 @@ def present(name, cloud_provider, onlyif=None, unless=None, opts=None, **kwargs) # need to ensure ALL providers don't have the instance if __salt__["cloud.has_instance"](name=name, provider=None): ret["result"] = True - ret["comment"] = "Already present instance {}".format(name) + ret["comment"] = f"Already present instance {name}" return ret if __opts__["test"]: - ret["comment"] = "Instance {} needs to be created".format(name) + ret["comment"] = f"Instance {name} needs to be created" return ret info = __salt__["cloud.create"](cloud_provider, name, opts=opts, **kwargs) @@ -172,18 +172,18 @@ def absent(name, onlyif=None, unless=None): if not __salt__["cloud.has_instance"](name=name, provider=None): ret["result"] = True - ret["comment"] = "Already absent instance {}".format(name) + ret["comment"] = f"Already absent instance {name}" return ret if __opts__["test"]: - ret["comment"] = "Instance {} needs to be destroyed".format(name) + ret["comment"] = f"Instance {name} needs to be destroyed" return ret info = __salt__["cloud.destroy"](name) if info and "Error" not in info: ret["changes"] = info ret["result"] = True - ret["comment"] = "Destroyed instance {}".format(name) + ret["comment"] = f"Destroyed instance {name}" elif "Error" in info: ret["result"] = False ret["comment"] = "Failed to destroy instance {}: {}".format( @@ -192,7 +192,7 @@ def absent(name, onlyif=None, unless=None): ) else: ret["result"] = False - ret["comment"] = "Failed to destroy instance {}".format(name) + ret["comment"] = f"Failed to destroy instance {name}" return ret @@ -243,11 +243,11 @@ def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs): instance = _get_instance([name]) if instance and not any("Not Actioned" in key for key in instance): ret["result"] = True - ret["comment"] = "Already present instance {}".format(name) + ret["comment"] = f"Already present instance {name}" return ret if __opts__["test"]: - ret["comment"] = "Instance {} needs to be created".format(name) + ret["comment"] = f"Instance {name} needs to be created" return ret info = __salt__["cloud.profile"](profile, name, vm_overrides=kwargs, opts=opts) @@ -280,7 +280,7 @@ def profile(name, profile, onlyif=None, unless=None, opts=None, **kwargs): ret["comment"] = "Failed to create instance {} using profile {}: {}".format( name, profile, - "{}\n{}\n".format(main_error, name_error).strip(), + f"{main_error}\n{name_error}\n".strip(), ) else: ret["result"] = False @@ -302,22 +302,22 @@ def volume_present(name, provider=None, **kwargs): volumes = __salt__["cloud.volume_list"](provider=provider) if name in volumes: - ret["comment"] = "Volume exists: {}".format(name) + ret["comment"] = f"Volume exists: {name}" ret["result"] = True return ret elif __opts__["test"]: - ret["comment"] = "Volume {} will be created.".format(name) + ret["comment"] = f"Volume {name} will be created." ret["result"] = None return ret response = __salt__["cloud.volume_create"](names=name, provider=provider, **kwargs) if response: ret["result"] = True - ret["comment"] = "Volume {} was created".format(name) + ret["comment"] = f"Volume {name} was created" ret["changes"] = {"old": None, "new": response} else: ret["result"] = False - ret["comment"] = "Volume {} failed to create.".format(name) + ret["comment"] = f"Volume {name} failed to create." return ret @@ -336,18 +336,18 @@ def volume_absent(name, provider=None, **kwargs): ret["result"] = True return ret elif __opts__["test"]: - ret["comment"] = "Volume {} will be deleted.".format(name) + ret["comment"] = f"Volume {name} will be deleted." ret["result"] = None return ret response = __salt__["cloud.volume_delete"](names=name, provider=provider, **kwargs) if response: ret["result"] = True - ret["comment"] = "Volume {} was deleted".format(name) + ret["comment"] = f"Volume {name} was deleted" ret["changes"] = {"old": volumes[name], "new": response} else: ret["result"] = False - ret["comment"] = "Volume {} failed to delete.".format(name) + ret["comment"] = f"Volume {name} failed to delete." return ret @@ -374,15 +374,15 @@ def volume_attached(name, server_name, provider=None, **kwargs): ret["result"] = True return ret elif name not in volumes: - ret["comment"] = "Volume {} does not exist".format(name) + ret["comment"] = f"Volume {name} does not exist" ret["result"] = False return ret elif not instance: - ret["comment"] = "Server {} does not exist".format(server_name) + ret["comment"] = f"Server {server_name} does not exist" ret["result"] = False return ret elif __opts__["test"]: - ret["comment"] = "Volume {} will be will be attached.".format(name) + ret["comment"] = f"Volume {name} will be will be attached." ret["result"] = None return ret @@ -391,11 +391,11 @@ def volume_attached(name, server_name, provider=None, **kwargs): ) if response: ret["result"] = True - ret["comment"] = "Volume {} was created".format(name) + ret["comment"] = f"Volume {name} was created" ret["changes"] = {"old": volumes[name], "new": response} else: ret["result"] = False - ret["comment"] = "Volume {} failed to attach.".format(name) + ret["comment"] = f"Volume {name} failed to attach." return ret @@ -428,15 +428,15 @@ def volume_detached(name, server_name=None, provider=None, **kwargs): ret["result"] = True return ret elif name not in volumes: - ret["comment"] = "Volume {} does not exist".format(name) + ret["comment"] = f"Volume {name} does not exist" ret["result"] = True return ret elif not instance and server_name is not None: - ret["comment"] = "Server {} does not exist".format(server_name) + ret["comment"] = f"Server {server_name} does not exist" ret["result"] = True return ret elif __opts__["test"]: - ret["comment"] = "Volume {} will be will be detached.".format(name) + ret["comment"] = f"Volume {name} will be will be detached." ret["result"] = None return ret @@ -445,9 +445,9 @@ def volume_detached(name, server_name=None, provider=None, **kwargs): ) if response: ret["result"] = True - ret["comment"] = "Volume {} was created".format(name) + ret["comment"] = f"Volume {name} was created" ret["changes"] = {"old": volumes[name], "new": response} else: ret["result"] = False - ret["comment"] = "Volume {} failed to detach.".format(name) + ret["comment"] = f"Volume {name} failed to detach." return ret diff --git a/salt/states/cmd.py b/salt/states/cmd.py index 8518659061f..df0aec96ef8 100644 --- a/salt/states/cmd.py +++ b/salt/states/cmd.py @@ -316,7 +316,7 @@ def _is_true(val): return True elif str(val).lower() in ("false", "no", "0"): return False - raise ValueError("Failed parsing boolean value: {}".format(val)) + raise ValueError(f"Failed parsing boolean value: {val}") def wait( @@ -333,7 +333,7 @@ def wait( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Run the given command only if the watch statement calls it. @@ -484,7 +484,7 @@ def wait_script( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Download a script from a remote source and execute it only if a watch @@ -629,7 +629,7 @@ def run( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Run a command if certain circumstances are met. Use ``cmd.wait`` if you @@ -847,12 +847,12 @@ def run( if __opts__["test"] and not test_name: ret["result"] = None - ret["comment"] = 'Command "{}" would have been executed'.format(name) + ret["comment"] = f'Command "{name}" would have been executed' ret["changes"] = {"cmd": name} return _reinterpreted_state(ret) if stateful else ret if cwd and not os.path.isdir(cwd): - ret["comment"] = 'Desired working directory "{}" is not available'.format(cwd) + ret["comment"] = f'Desired working directory "{cwd}" is not available' return ret # Wow, we passed the test, run this sucker! @@ -867,7 +867,7 @@ def run( ret["changes"] = cmd_all ret["result"] = not bool(cmd_all["retcode"]) - ret["comment"] = 'Command "{}" run'.format(name) + ret["comment"] = f'Command "{name}" run' # Ignore timeout errors if asked (for nohups) and treat cmd as a success if ignore_timeout: @@ -904,7 +904,7 @@ def script( success_retcodes=None, success_stdout=None, success_stderr=None, - **kwargs + **kwargs, ): """ Download a script and execute it with specified arguments. @@ -1154,11 +1154,11 @@ def script( if __opts__["test"] and not test_name: ret["result"] = None - ret["comment"] = "Command '{}' would have been executed".format(name) + ret["comment"] = f"Command '{name}' would have been executed" return _reinterpreted_state(ret) if stateful else ret if cwd and not os.path.isdir(cwd): - ret["comment"] = 'Desired working directory "{}" is not available'.format(cwd) + ret["comment"] = f'Desired working directory "{cwd}" is not available' return ret # Wow, we passed the test, run this sucker! @@ -1178,7 +1178,7 @@ def script( source, __env__ ) else: - ret["comment"] = "Command '{}' run".format(name) + ret["comment"] = f"Command '{name}' run" if stateful: ret = _reinterpreted_state(ret) if __opts__["test"] and cmd_all["retcode"] == 0 and ret["changes"]: @@ -1194,7 +1194,7 @@ def call( output_loglevel="debug", hide_output=False, use_vt=False, - **kwargs + **kwargs, ): """ Invoke a pre-defined Python function with arguments specified in the state @@ -1257,7 +1257,7 @@ def wait_call( use_vt=False, output_loglevel="debug", hide_output=False, - **kwargs + **kwargs, ): # Ignoring our arguments is intentional. return {"name": name, "changes": {}, "result": True, "comment": ""} diff --git a/salt/states/composer.py b/salt/states/composer.py index 79629271c17..9578507066b 100644 --- a/salt/states/composer.py +++ b/salt/states/composer.py @@ -137,10 +137,10 @@ def installed( else: install_status = "not " - ret["comment"] = 'The state of "{}" will be changed.'.format(name) + ret["comment"] = f'The state of "{name}" will be changed.' ret["changes"] = { - "old": "composer install has {}been run in {}".format(install_status, name), - "new": "composer install will be run in {}".format(name), + "old": f"composer install has {install_status}been run in {name}", + "new": f"composer install will be run in {name}", } ret["result"] = None return ret @@ -163,7 +163,7 @@ def installed( ) except SaltException as err: ret["result"] = False - ret["comment"] = "Error executing composer in '{}': {}".format(name, err) + ret["comment"] = f"Error executing composer in '{name}': {err}" return ret # If composer retcode != 0 then an exception was thrown and we dealt with it. @@ -250,17 +250,17 @@ def update( # Check if composer.lock exists, if so we already ran `composer install` is_installed = __salt__["composer.did_composer_install"](name) if is_installed: - old_status = "composer install has not yet been run in {}".format(name) + old_status = f"composer install has not yet been run in {name}" else: - old_status = "composer install has been run in {}".format(name) + old_status = f"composer install has been run in {name}" # The state of the system does need to be changed. Check if we're running # in ``test=true`` mode. if __opts__["test"] is True: - ret["comment"] = 'The state of "{}" will be changed.'.format(name) + ret["comment"] = f'The state of "{name}" will be changed.' ret["changes"] = { "old": old_status, - "new": "composer install/update will be run in {}".format(name), + "new": f"composer install/update will be run in {name}", } ret["result"] = None return ret @@ -283,7 +283,7 @@ def update( ) except SaltException as err: ret["result"] = False - ret["comment"] = "Error executing composer in '{}': {}".format(name, err) + ret["comment"] = f"Error executing composer in '{name}': {err}" return ret # If composer retcode != 0 then an exception was thrown and we dealt with it. diff --git a/salt/states/consul.py b/salt/states/consul.py index 181ebc9ea9d..f76bac8f7c9 100644 --- a/salt/states/consul.py +++ b/salt/states/consul.py @@ -104,7 +104,7 @@ def acl_present( "name": name, "changes": {}, "result": True, - "comment": 'ACL "{}" exists and is up to date'.format(name), + "comment": f'ACL "{name}" exists and is up to date', } exists = _acl_exists(name, id, token, consul_url) @@ -181,7 +181,7 @@ def acl_absent(name, id=None, token=None, consul_url="http://localhost:8500"): "name": id, "changes": {}, "result": True, - "comment": 'ACL "{}" does not exist'.format(id), + "comment": f'ACL "{id}" does not exist', } exists = _acl_exists(name, id, token, consul_url) diff --git a/salt/states/cron.py b/salt/states/cron.py index c8576727190..c06980fccfe 100644 --- a/salt/states/cron.py +++ b/salt/states/cron.py @@ -346,12 +346,12 @@ def present( ) ret["result"] = None if status == "absent": - ret["comment"] = "Cron {} is set to be added".format(name) + ret["comment"] = f"Cron {name} is set to be added" elif status == "present": ret["result"] = True - ret["comment"] = "Cron {} already present".format(name) + ret["comment"] = f"Cron {name} already present" elif status == "update": - ret["comment"] = "Cron {} is set to be updated".format(name) + ret["comment"] = f"Cron {name} is set to be updated" return ret if special is None: @@ -377,16 +377,16 @@ def present( identifier=identifier, ) if data == "present": - ret["comment"] = "Cron {} already present".format(name) + ret["comment"] = f"Cron {name} already present" return ret if data == "new": - ret["comment"] = "Cron {} added to {}'s crontab".format(name, user) + ret["comment"] = f"Cron {name} added to {user}'s crontab" ret["changes"] = {user: name} return ret if data == "updated": - ret["comment"] = "Cron {} updated".format(name) + ret["comment"] = f"Cron {name} updated" ret["changes"] = {user: name} return ret ret["comment"] = "Cron {} for user {} failed to commit with error \n{}".format( @@ -432,9 +432,9 @@ def absent(name, user="root", identifier=False, special=None, **kwargs): ret["result"] = None if status == "absent": ret["result"] = True - ret["comment"] = "Cron {} is absent".format(name) + ret["comment"] = f"Cron {name} is absent" elif status == "present" or status == "update": - ret["comment"] = "Cron {} is set to be removed".format(name) + ret["comment"] = f"Cron {name} is set to be removed" return ret if special is None: @@ -445,10 +445,10 @@ def absent(name, user="root", identifier=False, special=None, **kwargs): ) if data == "absent": - ret["comment"] = "Cron {} already absent".format(name) + ret["comment"] = f"Cron {name} already absent" return ret if data == "removed": - ret["comment"] = "Cron {} removed from {}'s crontab".format(name, user) + ret["comment"] = f"Cron {name} removed from {user}'s crontab" ret["changes"] = {user: name} return ret ret["comment"] = "Cron {} for user {} failed to commit with error {}".format( @@ -468,7 +468,7 @@ def file( replace=True, defaults=None, backup="", - **kwargs + **kwargs, ): """ Provides file.managed-like functionality (templating, etc.) for a pre-made @@ -559,7 +559,7 @@ def file( except Exception: # pylint: disable=broad-except ret = { "changes": {}, - "comment": "Could not identify group for user {}".format(user), + "comment": f"Could not identify group for user {user}", "name": name, "result": False, } @@ -569,7 +569,7 @@ def file( with salt.utils.files.fopen(cron_path, "w+") as fp_: raw_cron = __salt__["cron.raw_cron"](user) if not raw_cron.endswith("\n"): - raw_cron = "{}\n".format(raw_cron) + raw_cron = f"{raw_cron}\n" fp_.write(salt.utils.stringutils.to_str(raw_cron)) ret = {"changes": {}, "comment": "", "name": name, "result": True} @@ -579,7 +579,7 @@ def file( source = name if not replace and os.stat(cron_path).st_size > 0: - ret["comment"] = "User {} already has a crontab. No changes made".format(user) + ret["comment"] = f"User {user} already has a crontab. No changes made" os.unlink(cron_path) return ret @@ -597,7 +597,7 @@ def file( context=context, defaults=defaults, saltenv=__env__, - **kwargs + **kwargs, ) ret["result"], ret["comment"] = fcm os.unlink(cron_path) @@ -622,12 +622,12 @@ def file( context=context, defaults=defaults, skip_verify=False, # skip_verify - **kwargs + **kwargs, ) except Exception as exc: # pylint: disable=broad-except ret["result"] = False ret["changes"] = {} - ret["comment"] = "Unable to manage file: {}".format(exc) + ret["comment"] = f"Unable to manage file: {exc}" return ret if comment: @@ -653,7 +653,7 @@ def file( except Exception as exc: # pylint: disable=broad-except ret["result"] = False ret["changes"] = {} - ret["comment"] = "Unable to manage file: {}".format(exc) + ret["comment"] = f"Unable to manage file: {exc}" return ret cron_ret = None @@ -661,7 +661,7 @@ def file( cron_ret = __salt__["cron.write_cron_file_verbose"](user, cron_path) # Check cmd return code and show success or failure if cron_ret["retcode"] == 0: - ret["comment"] = "Crontab for user {} was updated".format(user) + ret["comment"] = f"Crontab for user {user} was updated" ret["result"] = True ret["changes"] = ret["changes"] else: @@ -671,7 +671,7 @@ def file( ret["result"] = False ret["changes"] = {} elif ret["result"]: - ret["comment"] = "Crontab for user {} is in the correct state".format(user) + ret["comment"] = f"Crontab for user {user} is in the correct state" ret["changes"] = {} os.unlink(cron_path) @@ -698,26 +698,26 @@ def env_present(name, value=None, user="root"): status = _check_cron_env(user, name, value=value) ret["result"] = None if status == "absent": - ret["comment"] = "Cron env {} is set to be added".format(name) + ret["comment"] = f"Cron env {name} is set to be added" elif status == "present": ret["result"] = True - ret["comment"] = "Cron env {} already present".format(name) + ret["comment"] = f"Cron env {name} already present" elif status == "update": - ret["comment"] = "Cron env {} is set to be updated".format(name) + ret["comment"] = f"Cron env {name} is set to be updated" return ret data = __salt__["cron.set_env"](user, name, value=value) if data == "present": - ret["comment"] = "Cron env {} already present".format(name) + ret["comment"] = f"Cron env {name} already present" return ret if data == "new": - ret["comment"] = "Cron env {} added to {}'s crontab".format(name, user) + ret["comment"] = f"Cron env {name} added to {user}'s crontab" ret["changes"] = {user: name} return ret if data == "updated": - ret["comment"] = "Cron env {} updated".format(name) + ret["comment"] = f"Cron env {name} updated" ret["changes"] = {user: name} return ret ret["comment"] = "Cron env {} for user {} failed to commit with error \n{}".format( @@ -748,17 +748,17 @@ def env_absent(name, user="root"): ret["result"] = None if status == "absent": ret["result"] = True - ret["comment"] = "Cron env {} is absent".format(name) + ret["comment"] = f"Cron env {name} is absent" elif status == "present" or status == "update": - ret["comment"] = "Cron env {} is set to be removed".format(name) + ret["comment"] = f"Cron env {name} is set to be removed" return ret data = __salt__["cron.rm_env"](user, name) if data == "absent": - ret["comment"] = "Cron env {} already absent".format(name) + ret["comment"] = f"Cron env {name} already absent" return ret if data == "removed": - ret["comment"] = "Cron env {} removed from {}'s crontab".format(name, user) + ret["comment"] = f"Cron env {name} removed from {user}'s crontab" ret["changes"] = {user: name} return ret ret["comment"] = "Cron env {} for user {} failed to commit with error {}".format( diff --git a/salt/states/cryptdev.py b/salt/states/cryptdev.py index 54a167f7018..d0f7f069af3 100644 --- a/salt/states/cryptdev.py +++ b/salt/states/cryptdev.py @@ -128,7 +128,7 @@ def mapped( ) if crypttab_result: if crypttab_result == "new": - ret["changes"]["crypttab"] = "Entry added in {}".format(config) + ret["changes"]["crypttab"] = f"Entry added in {config}" if crypttab_result == "change": ret["changes"]["crypttab"] = "Existing entry in {} changed".format( @@ -136,7 +136,7 @@ def mapped( ) else: - ret["changes"]["crypttab"] = "Unable to set entry in {}".format(config) + ret["changes"]["crypttab"] = f"Unable to set entry in {config}" ret["result"] = False return ret @@ -183,10 +183,10 @@ def unmapped(name, config="/etc/crypttab", persist=True, immediate=False): crypttab_result = __salt__["cryptdev.rm_crypttab"](name, config=config) if crypttab_result: if crypttab_result == "change": - ret["changes"]["crypttab"] = "Entry removed from {}".format(config) + ret["changes"]["crypttab"] = f"Entry removed from {config}" else: - ret["changes"]["crypttab"] = "Unable to remove entry in {}".format(config) + ret["changes"]["crypttab"] = f"Unable to remove entry in {config}" ret["result"] = False return ret diff --git a/salt/states/csf.py b/salt/states/csf.py index 4a66377031c..57118c75d02 100644 --- a/salt/states/csf.py +++ b/salt/states/csf.py @@ -107,8 +107,8 @@ def rule_present( return ret else: if ttl: - method = "temp{}".format(method) - func = __salt__["csf.{}".format(method)] + method = f"temp{method}" + func = __salt__[f"csf.{method}"] rule = func( ip, port=port, @@ -387,7 +387,7 @@ def option_present(name, value, reload=False): if current_option: l = __salt__["csf.split_option"](current_option) option_value = l[1] - if '"{}"'.format(value) == option_value: + if f'"{value}"' == option_value: return ret else: result = __salt__["csf.set_option"](option, value) @@ -395,7 +395,7 @@ def option_present(name, value, reload=False): ret["changes"]["Option"] = "Changed" else: result = __salt__["file.append"]( - "/etc/csf/csf.conf", args='{} = "{}"'.format(option, value) + "/etc/csf/csf.conf", args=f'{option} = "{value}"' ) ret["comment"] = "Option not present. Appended to csf.conf" ret["changes"]["Option"] = "Changed." diff --git a/salt/states/cyg.py b/salt/states/cyg.py index 957b194c724..e4ea5925979 100644 --- a/salt/states/cyg.py +++ b/salt/states/cyg.py @@ -72,7 +72,7 @@ def installed(name, cyg_arch="x86_64", mirrors=None): return ret if __opts__["test"]: - ret["comment"] = "The package {} would have been installed".format(name) + ret["comment"] = f"The package {name} would have been installed" return ret if __salt__["cyg.install"](name, cyg_arch=cyg_arch, mirrors=mirrors): @@ -131,7 +131,7 @@ def removed(name, cyg_arch="x86_64", mirrors=None): return ret if __opts__["test"]: - ret["comment"] = "The package {} would have been removed".format(name) + ret["comment"] = f"The package {name} would have been removed" return ret if __salt__["cyg.uninstall"](name, cyg_arch): ret["result"] = True diff --git a/salt/states/ddns.py b/salt/states/ddns.py index 8fd2e9c0508..0260fc10916 100644 --- a/salt/states/ddns.py +++ b/salt/states/ddns.py @@ -64,7 +64,7 @@ def present(name, zone, ttl, data, rdtype="A", **kwargs): if __opts__["test"]: ret["result"] = None - ret["comment"] = '{} record "{}" will be updated'.format(rdtype, name) + ret["comment"] = f'{rdtype} record "{name}" will be updated' return ret status = __salt__["ddns.update"](zone, name, ttl, rdtype, data, **kwargs) @@ -76,7 +76,7 @@ def present(name, zone, ttl, data, rdtype="A", **kwargs): ) elif status: ret["result"] = True - ret["comment"] = 'Updated {} record for "{}"'.format(rdtype, name) + ret["comment"] = f'Updated {rdtype} record for "{name}"' ret["changes"] = { "name": name, "zone": zone, @@ -122,7 +122,7 @@ def absent(name, zone, data=None, rdtype=None, **kwargs): if __opts__["test"]: ret["result"] = None - ret["comment"] = '{} record "{}" will be deleted'.format(rdtype, name) + ret["comment"] = f'{rdtype} record "{name}" will be deleted' return ret status = __salt__["ddns.delete"](zone, name, rdtype, data, **kwargs) diff --git a/salt/states/debconfmod.py b/salt/states/debconfmod.py index 0006e9696fa..4d399408341 100644 --- a/salt/states/debconfmod.py +++ b/salt/states/debconfmod.py @@ -198,7 +198,7 @@ def set(name, data, **kwargs): if current is not None and [key, args["type"], str(args["value"])] in current: if ret["comment"] == "": ret["comment"] = "Unchanged answers: " - ret["comment"] += "{} ".format(key) + ret["comment"] += f"{key} " else: if __opts__["test"]: ret["result"] = None diff --git a/salt/states/dellchassis.py b/salt/states/dellchassis.py index 6f95f4f20df..23487b6dfad 100644 --- a/salt/states/dellchassis.py +++ b/salt/states/dellchassis.py @@ -700,9 +700,9 @@ def switch( if any([password_ret, snmp_ret, net_ret, dhcp_ret]) is False: ret["result"] = False - ret["comment"] = "There was an error setting the switch {}.".format(name) + ret["comment"] = f"There was an error setting the switch {name}." - ret["comment"] = "Dell chassis switch {} was updated.".format(name) + ret["comment"] = f"Dell chassis switch {name} was updated." return ret @@ -755,7 +755,7 @@ def firmware_update(hosts=None, directory=""): ret["changes"].update( { "host": { - "comment": "Firmware update submitted for {}".format(host), + "comment": f"Firmware update submitted for {host}", "success": True, } } @@ -765,7 +765,7 @@ def firmware_update(hosts=None, directory=""): ret["changes"].update( { "host": { - "comment": "FAILED to update firmware for {}".format(host), + "comment": f"FAILED to update firmware for {host}", "success": False, "reason": str(err), } diff --git a/salt/states/disk.py b/salt/states/disk.py index 255cc225383..47d7177b59b 100644 --- a/salt/states/disk.py +++ b/salt/states/disk.py @@ -62,7 +62,7 @@ def _validate_int(name, value, limits=(), strip="%"): value = value.strip(" " + strip) value = int(value) except (TypeError, ValueError): - comment += "{} must be an integer ".format(name) + comment += f"{name} must be an integer " # Must be in range else: if len(limits) == 2: @@ -219,7 +219,7 @@ def status(name, maximum=None, minimum=None, absolute=False, free=False): # Validate name if name not in data: - ret["comment"] += "Disk mount {} not present. ".format(name) + ret["comment"] += f"Disk mount {name} not present. " return _status_path(name, ret, minimum, maximum, absolute, free) else: return _status_mount(name, ret, minimum, maximum, absolute, free, data) diff --git a/salt/states/docker_container.py b/salt/states/docker_container.py index 040e8553fd3..4cecd87230c 100644 --- a/salt/states/docker_container.py +++ b/salt/states/docker_container.py @@ -163,7 +163,7 @@ def _parse_networks(networks): ] except CommandExecutionError as exc: raise CommandExecutionError( - "Failed to get list of existing networks: {}.".format(exc) + f"Failed to get list of existing networks: {exc}." ) else: missing_networks = [x for x in sorted(networks) if x not in all_networks] @@ -192,7 +192,7 @@ def _resolve_image(ret, image, client_timeout): client_timeout=client_timeout, ) except Exception as exc: # pylint: disable=broad-except - raise CommandExecutionError("Failed to pull {}: {}".format(image, exc)) + raise CommandExecutionError(f"Failed to pull {image}: {exc}") else: ret["changes"]["image"] = pull_result # Try resolving again now that we've pulled @@ -218,7 +218,7 @@ def running( shutdown_timeout=None, client_timeout=salt.utils.dockermod.CLIENT_TIMEOUT, networks=None, - **kwargs + **kwargs, ): """ Ensure that a container with a specific configuration is present and @@ -1740,7 +1740,7 @@ def running( ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, client_timeout=client_timeout, - **kwargs + **kwargs, ) temp_container_name = temp_container["Name"] except KeyError as exc: @@ -1779,9 +1779,9 @@ def running( result = __salt__["docker.rename"](new, orig) except CommandExecutionError as exc: result = False - comments.append("Failed to rename temp container: {}".format(exc)) + comments.append(f"Failed to rename temp container: {exc}") if result: - comments.append("Replaced container '{}'".format(orig)) + comments.append(f"Replaced container '{orig}'") else: comments.append("Failed to replace container '{0}'") return result @@ -1887,22 +1887,18 @@ def running( if send_signal: if __opts__["test"]: comments.append( - "Signal {} would be sent to container".format(watch_action) + f"Signal {watch_action} would be sent to container" ) else: try: __salt__["docker.signal"](name, signal=watch_action) except CommandExecutionError as exc: ret["result"] = False - comments.append( - "Failed to signal container: {}".format(exc) - ) + comments.append(f"Failed to signal container: {exc}") return _format_comments(ret, comments) else: ret["changes"]["signal"] = watch_action - comments.append( - "Sent signal {} to container".format(watch_action) - ) + comments.append(f"Sent signal {watch_action} to container") elif container_changes: if not comments: log.warning( @@ -1920,7 +1916,7 @@ def running( # existing container and the temp container were detected, # and no signal was sent to the container. comments.append( - "Container '{}' is already configured as specified".format(name) + f"Container '{name}' is already configured as specified" ) if net_changes: @@ -1981,11 +1977,9 @@ def running( "configuration".format(net_name) ) elif disconnected: - comments.append( - "Disconnected from network '{}'".format(net_name) - ) + comments.append(f"Disconnected from network '{net_name}'") elif connected: - comments.append("Connected to network '{}'".format(net_name)) + comments.append(f"Connected to network '{net_name}'") if network_failure: ret["result"] = False @@ -1996,7 +1990,7 @@ def running( if skip_comparison: if not exists: - comments.append("Created container '{}'".format(name)) + comments.append(f"Created container '{name}'") else: if not _replace(name, temp_container): ret["result"] = False @@ -2023,9 +2017,7 @@ def running( post_state = __salt__["docker.start"](name)["state"]["new"] except Exception as exc: # pylint: disable=broad-except ret["result"] = False - comments.append( - "Failed to start container '{}': '{}'".format(name, exc) - ) + comments.append(f"Failed to start container '{name}': '{exc}'") return _format_comments(ret, comments) else: post_state = __salt__["docker.state"](name) @@ -2070,9 +2062,7 @@ def running( if pre_state != post_state: ret["changes"]["state"] = {"old": pre_state, "new": post_state} if pre_state is not None: - comments.append( - "State changed from '{}' to '{}'".format(pre_state, post_state) - ) + comments.append(f"State changed from '{pre_state}' to '{post_state}'") if exists and current_image_id != image_id: comments.append("Container has a new image") @@ -2096,7 +2086,7 @@ def run( ignore_collisions=False, validate_ip_addrs=True, client_timeout=salt.utils.dockermod.CLIENT_TIMEOUT, - **kwargs + **kwargs, ): """ .. versionadded:: 2018.3.0 @@ -2186,7 +2176,7 @@ def run( for unsupported in ("watch_action", "start", "shutdown_timeout", "follow"): if unsupported in kwargs: ret["result"] = False - ret["comment"] = "The '{}' argument is not supported".format(unsupported) + ret["comment"] = f"The '{unsupported}' argument is not supported" return ret if image is None: @@ -2259,12 +2249,12 @@ def run( bg=bg, replace=replace, force=force, - **kwargs + **kwargs, ) except Exception as exc: # pylint: disable=broad-except log.exception("Encountered error running container") ret["result"] = False - ret["comment"] = "Encountered error running container: {}".format(exc) + ret["comment"] = f"Encountered error running container: {exc}" else: if bg: ret["comment"] = "Container was run in the background" @@ -2276,7 +2266,7 @@ def run( else: ret["result"] = False if failhard and retcode != 0 else True ret["comment"] = ( - "Container ran and exited with a return code of {}".format(retcode) + f"Container ran and exited with a return code of {retcode}" ) if remove: @@ -2286,7 +2276,7 @@ def run( __salt__["docker.rm"](ret["changes"]["Id"]) except CommandExecutionError as exc: ret.setdefault("warnings", []).append( - "Failed to auto_remove container: {}".format(exc) + f"Failed to auto_remove container: {exc}" ) return ret @@ -2298,7 +2288,7 @@ def stopped( shutdown_timeout=None, unpause=False, error_on_absent=True, - **kwargs + **kwargs, ): """ Ensure that a container (or containers) is stopped @@ -2402,7 +2392,7 @@ def stopped( if not to_stop: ret["result"] = True if len(targets) == 1: - ret["comment"] = "Container '{}' is ".format(targets[0]) + ret["comment"] = f"Container '{targets[0]}' is " else: ret["comment"] = "All specified containers are " if "absent" in containers: @@ -2429,7 +2419,7 @@ def stopped( if "comment" in changes: stop_errors.append(changes["comment"]) else: - stop_errors.append("Failed to stop container '{}'".format(target)) + stop_errors.append(f"Failed to stop container '{target}'") if stop_errors: ret["comment"] = "; ".join(stop_errors) @@ -2470,7 +2460,7 @@ def absent(name, force=False): if name not in __salt__["docker.list_containers"](all=True): ret["result"] = True - ret["comment"] = "Container '{}' does not exist".format(name) + ret["comment"] = f"Container '{name}' does not exist" return ret pre_state = __salt__["docker.state"](name) @@ -2480,23 +2470,23 @@ def absent(name, force=False): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Container '{}' will be removed".format(name) + ret["comment"] = f"Container '{name}' will be removed" return ret try: ret["changes"]["removed"] = __salt__["docker.rm"](name, force=force) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to remove container '{}': {}".format(name, exc) + ret["comment"] = f"Failed to remove container '{name}': {exc}" return ret if name in __salt__["docker.list_containers"](all=True): - ret["comment"] = "Failed to remove container '{}'".format(name) + ret["comment"] = f"Failed to remove container '{name}'" else: if force and pre_state != "stopped": method = "Forcibly" else: method = "Successfully" - ret["comment"] = "{} removed container '{}'".format(method, name) + ret["comment"] = f"{method} removed container '{name}'" ret["result"] = True return ret @@ -2530,5 +2520,5 @@ def mod_watch(name, sfun=None, **kwargs): "name": name, "changes": {}, "result": False, - "comment": "watch requisite is not implemented for {}".format(sfun), + "comment": f"watch requisite is not implemented for {sfun}", } diff --git a/salt/states/docker_image.py b/salt/states/docker_image.py index b2b887ffea3..b55790de68a 100644 --- a/salt/states/docker_image.py +++ b/salt/states/docker_image.py @@ -72,7 +72,7 @@ def present( saltenv="base", pillarenv=None, pillar=None, - **kwargs + **kwargs, ): """ .. versionchanged:: 2018.3.0 @@ -241,7 +241,7 @@ def present( full_image = ":".join((name, tag)) else: if tag: - name = "{}:{}".format(name, tag) + name = f"{name}:{tag}" full_image = name try: @@ -259,7 +259,7 @@ def present( # Specified image is present if not force: ret["result"] = True - ret["comment"] = "Image {} already present".format(full_image) + ret["comment"] = f"Image {full_image} already present" return ret if build or sls: @@ -272,7 +272,7 @@ def present( if __opts__["test"]: ret["result"] = None if (image_info is not None and force) or image_info is None: - ret["comment"] = "Image {} will be {}".format(full_image, action) + ret["comment"] = f"Image {full_image} will be {action}" return ret if build: @@ -336,7 +336,7 @@ def present( name, insecure_registry=insecure_registry, client_timeout=client_timeout ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Encountered error pulling {}: {}".format(full_image, exc) + ret["comment"] = f"Encountered error pulling {full_image}: {exc}" return ret if ( image_info is not None @@ -370,7 +370,7 @@ def present( name, action ) else: - ret["comment"] = "Image '{}' was {}".format(full_image, action) + ret["comment"] = f"Image '{full_image}' was {action}" return ret @@ -450,7 +450,7 @@ def absent(name=None, images=None, force=False): if not to_delete: ret["result"] = True if len(targets) == 1: - ret["comment"] = "Image {} is not present".format(name) + ret["comment"] = f"Image {name} is not present" else: ret["comment"] = "All specified images are not present" return ret @@ -458,7 +458,7 @@ def absent(name=None, images=None, force=False): if __opts__["test"]: ret["result"] = None if len(to_delete) == 1: - ret["comment"] = "Image {} will be removed".format(to_delete[0]) + ret["comment"] = f"Image {to_delete[0]} will be removed" else: ret["comment"] = "The following images will be removed: {}".format( ", ".join(to_delete) @@ -484,7 +484,7 @@ def absent(name=None, images=None, force=False): else: ret["changes"] = result if len(to_delete) == 1: - ret["comment"] = "Image {} was removed".format(to_delete[0]) + ret["comment"] = f"Image {to_delete[0]} was removed" else: ret["comment"] = "The following images were removed: {}".format( ", ".join(to_delete) @@ -513,5 +513,5 @@ def mod_watch(name, sfun=None, **kwargs): "name": name, "changes": {}, "result": False, - "comment": "watch requisite is not implemented for {}".format(sfun), + "comment": f"watch requisite is not implemented for {sfun}", } diff --git a/salt/states/docker_network.py b/salt/states/docker_network.py index 4ff8c95382c..f041155dd13 100644 --- a/salt/states/docker_network.py +++ b/salt/states/docker_network.py @@ -65,7 +65,7 @@ def _normalize_pools(existing, desired): for pool in desired["Config"]: subnet = ipaddress.ip_network(pool.get("Subnet")) if pools["desired"][subnet.version] is not None: - raise ValueError("Only one IPv{} pool is permitted".format(subnet.version)) + raise ValueError(f"Only one IPv{subnet.version} pool is permitted") else: pools["desired"][subnet.version] = pool @@ -91,7 +91,7 @@ def present( validate_ip_addrs=True, containers=None, reconnect=True, - **kwargs + **kwargs, ): """ .. versionchanged:: 2018.3.0 @@ -575,7 +575,7 @@ def present( skip_translate=skip_translate, ignore_collisions=ignore_collisions, validate_ip_addrs=validate_ip_addrs, - **__utils__["args.clean_kwargs"](**kwargs) + **__utils__["args.clean_kwargs"](**kwargs), ) except Exception as exc: # pylint: disable=broad-except ret["comment"] = str(exc) @@ -620,7 +620,7 @@ def present( # Set the comment now to say that it already exists, if we need to # recreate the network with new config we'll update the comment later. ret["comment"] = ( - "Network '{}' already exists, and is configured as specified".format(name) + f"Network '{name}' already exists, and is configured as specified" ) log.trace("Details of docker network '%s': %s", name, network) @@ -658,7 +658,7 @@ def present( temp_net_name, skip_translate=True, # No need to translate (already did) enable_ipv6=False, - **kwargs_tmp + **kwargs_tmp, ) except CommandExecutionError as exc: ret["comment"] = "Failed to create temp network for comparison: {}".format( @@ -674,7 +674,7 @@ def present( try: temp_net_info = __salt__["docker.inspect_network"](temp_net_name) except CommandExecutionError as exc: - ret["comment"] = "Failed to inspect temp network: {}".format(str(exc)) + ret["comment"] = f"Failed to inspect temp network: {str(exc)}" return ret else: temp_net_info["EnableIPv6"] = bool(enable_ipv6) @@ -773,7 +773,7 @@ def present( __salt__["docker.remove_network"](temp_net_name) except CommandExecutionError as exc: ret.setdefault("warnings", []).append( - "Failed to remove temp network '{}': {}.".format(temp_net_name, exc) + f"Failed to remove temp network '{temp_net_name}': {exc}." ) if create_network: @@ -795,10 +795,10 @@ def present( __salt__["docker.create_network"]( name, skip_translate=True, # No need to translate (already did) - **kwargs + **kwargs, ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to create network '{}': {}".format(name, exc) + ret["comment"] = f"Failed to create network '{name}': {exc}" return ret else: action = "recreated" if network is not None else "created" @@ -922,12 +922,12 @@ def absent(name): if network is None: ret["result"] = True - ret["comment"] = "Network '{}' already absent".format(name) + ret["comment"] = f"Network '{name}' already absent" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Network '{}' will be removed".format(name) + ret["comment"] = f"Network '{name}' will be removed" return ret return _remove_network(network) @@ -952,7 +952,7 @@ def _remove_network(network): try: __salt__["docker.disconnect_container_from_network"](cid, network["Name"]) except CommandExecutionError as exc: - errors = "Failed to disconnect container '{}' : {}".format(cname, exc) + errors = f"Failed to disconnect container '{cname}' : {exc}" else: ret["changes"].setdefault("disconnected", []).append(cname) @@ -963,7 +963,7 @@ def _remove_network(network): try: __salt__["docker.remove_network"](network["Name"]) except CommandExecutionError as exc: - ret["comment"] = "Failed to remove network: {}".format(exc) + ret["comment"] = f"Failed to remove network: {exc}" else: ret["changes"]["removed"] = True ret["result"] = True diff --git a/salt/states/docker_volume.py b/salt/states/docker_volume.py index 86497b5dbd5..1d46a064c9d 100644 --- a/salt/states/docker_volume.py +++ b/salt/states/docker_volume.py @@ -135,14 +135,14 @@ def present(name, driver=None, driver_opts=None, force=False): if not volume: if __opts__["test"]: ret["result"] = None - ret["comment"] = "The volume '{}' will be created".format(name) + ret["comment"] = f"The volume '{name}' will be created" return ret try: ret["changes"]["created"] = __salt__["docker.create_volume"]( name, driver=driver, driver_opts=driver_opts ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to create volume '{}': {}".format(name, exc) + ret["comment"] = f"Failed to create volume '{name}': {exc}" return ret else: result = True @@ -168,7 +168,7 @@ def present(name, driver=None, driver_opts=None, force=False): try: ret["changes"]["removed"] = __salt__["docker.remove_volume"](name) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to remove volume '{}': {}".format(name, exc) + ret["comment"] = f"Failed to remove volume '{name}': {exc}" return ret else: try: @@ -176,7 +176,7 @@ def present(name, driver=None, driver_opts=None, force=False): name, driver=driver, driver_opts=driver_opts ) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to create volume '{}': {}".format(name, exc) + ret["comment"] = f"Failed to create volume '{name}': {exc}" return ret else: result = True @@ -184,7 +184,7 @@ def present(name, driver=None, driver_opts=None, force=False): return ret ret["result"] = True - ret["comment"] = "Volume '{}' already exists.".format(name) + ret["comment"] = f"Volume '{name}' already exists." return ret @@ -212,12 +212,12 @@ def absent(name, driver=None): volume = _find_volume(name) if not volume: ret["result"] = True - ret["comment"] = "Volume '{}' already absent".format(name) + ret["comment"] = f"Volume '{name}' already absent" return ret try: ret["changes"]["removed"] = __salt__["docker.remove_volume"](name) ret["result"] = True except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to remove volume '{}': {}".format(name, exc) + ret["comment"] = f"Failed to remove volume '{name}': {exc}" return ret diff --git a/salt/states/drac.py b/salt/states/drac.py index 29a3a6fa7a6..c3a7b4258de 100644 --- a/salt/states/drac.py +++ b/salt/states/drac.py @@ -68,18 +68,18 @@ def present(name, password, permission): if __opts__["test"]: if name in users: - ret["comment"] = "`{}` already exists".format(name) + ret["comment"] = f"`{name}` already exists" else: - ret["comment"] = "`{}` will be created".format(name) + ret["comment"] = f"`{name}` will be created" ret["changes"] = {name: "will be created"} return ret if name in users: - ret["comment"] = "`{}` already exists".format(name) + ret["comment"] = f"`{name}` already exists" else: if __salt__["drac.create_user"](name, password, permission, users): - ret["comment"] = "`{}` user created".format(name) + ret["comment"] = f"`{name}` user created" ret["changes"] = {name: "new user created"} else: ret["comment"] = "Unable to create user" @@ -101,22 +101,22 @@ def absent(name): if __opts__["test"]: if name in users: - ret["comment"] = "`{}` is set to be deleted".format(name) + ret["comment"] = f"`{name}` is set to be deleted" ret["changes"] = {name: "will be deleted"} else: - ret["comment"] = "`{}` does not exist".format(name) + ret["comment"] = f"`{name}` does not exist" return ret if name in users: if __salt__["drac.delete_user"](name, users[name]["index"]): - ret["comment"] = "`{}` deleted".format(name) + ret["comment"] = f"`{name}` deleted" ret["changes"] = {name: "deleted"} else: ret["comment"] = "Unable to delete user" ret["result"] = False else: - ret["comment"] = "`{}` does not exist".format(name) + ret["comment"] = f"`{name}` does not exist" return ret diff --git a/salt/states/dvs.py b/salt/states/dvs.py index 5b757c13678..6333395c490 100644 --- a/salt/states/dvs.py +++ b/salt/states/dvs.py @@ -257,7 +257,7 @@ def _get_datacenter_name(): details = __salt__["esxdatacenter.get_details"]() if not details: raise salt.exceptions.CommandExecutionError( - "details for proxy type '{}' not loaded".format(proxy_type) + f"details for proxy type '{proxy_type}' not loaded" ) return details["datacenter"] @@ -475,7 +475,7 @@ def _get_val2_dict_from_diff_dict(diff_dict): ret_dict = {} for p in diff_dict.keys(): if not isinstance(diff_dict[p], dict): - raise ValueError("Unexpected diff difct '{}'".format(diff_dict)) + raise ValueError(f"Unexpected diff difct '{diff_dict}'") if "val2" in diff_dict[p].keys(): ret_dict.update({p: diff_dict[p]["val2"]}) else: @@ -490,7 +490,7 @@ def _get_val1_dict_from_diff_dict(diff_dict): ret_dict = {} for p in diff_dict.keys(): if not isinstance(diff_dict[p], dict): - raise ValueError("Unexpected diff difct '{}'".format(diff_dict)) + raise ValueError(f"Unexpected diff difct '{diff_dict}'") if "val1" in diff_dict[p].keys(): ret_dict.update({p: diff_dict[p]["val1"]}) else: @@ -507,7 +507,7 @@ def _get_changes_from_diff_dict(diff_dict): changes_strings = [] for p in diff_dict.keys(): if not isinstance(diff_dict[p], dict): - raise ValueError("Unexpected diff difct '{}'".format(diff_dict)) + raise ValueError(f"Unexpected diff difct '{diff_dict}'") if sorted(diff_dict[p].keys()) == ["val1", "val2"]: # Some string formatting from_str = diff_dict[p]["val1"] @@ -520,12 +520,12 @@ def _get_changes_from_diff_dict(diff_dict): to_str = "'{}'".format(diff_dict[p]["val2"]) elif isinstance(diff_dict[p]["val2"], list): to_str = "'{}'".format(", ".join(diff_dict[p]["val2"])) - changes_strings.append("{} from {} to {}".format(p, from_str, to_str)) + changes_strings.append(f"{p} from {from_str} to {to_str}") else: sub_changes = _get_changes_from_diff_dict(diff_dict[p]) if sub_changes: - changes_strings.append("{}:".format(p)) - changes_strings.extend(["\t{}".format(c) for c in sub_changes]) + changes_strings.append(f"{p}:") + changes_strings.extend([f"\t{c}" for c in sub_changes]) return changes_strings @@ -608,7 +608,7 @@ def portgroups_configured(name, dvs, portgroups): pg_name, dvs, datacenter, - "\n".join(["\t{}".format(c) for c in changes_strings]), + "\n".join([f"\t{c}" for c in changes_strings]), ) ) else: @@ -734,7 +734,7 @@ def uplink_portgroup_configured(name, dvs, uplink_portgroup): name, dvs, datacenter, - "\n".join(["\t{}".format(c) for c in changes_strings]), + "\n".join([f"\t{c}" for c in changes_strings]), ) ) else: diff --git a/salt/states/elasticsearch.py b/salt/states/elasticsearch.py index ae9a37c3e8e..962ac1d8ddf 100644 --- a/salt/states/elasticsearch.py +++ b/salt/states/elasticsearch.py @@ -25,20 +25,20 @@ def index_absent(name): index = __salt__["elasticsearch.index_get"](index=name) if index and name in index: if __opts__["test"]: - ret["comment"] = "Index {} will be removed".format(name) + ret["comment"] = f"Index {name} will be removed" ret["changes"]["old"] = index[name] ret["result"] = None else: ret["result"] = __salt__["elasticsearch.index_delete"](index=name) if ret["result"]: - ret["comment"] = "Successfully removed index {}".format(name) + ret["comment"] = f"Successfully removed index {name}" ret["changes"]["old"] = index[name] else: ret["comment"] = ( - "Failed to remove index {} for unknown reasons".format(name) + f"Failed to remove index {name} for unknown reasons" ) else: - ret["comment"] = "Index {} is already absent".format(name) + ret["comment"] = f"Index {name} is already absent" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -88,15 +88,15 @@ def index_present(name, definition=None): index=name, body=definition ) if output: - ret["comment"] = "Successfully created index {}".format(name) + ret["comment"] = f"Successfully created index {name}" ret["changes"] = { "new": __salt__["elasticsearch.index_get"](index=name)[name] } else: ret["result"] = False - ret["comment"] = "Cannot create index {}, {}".format(name, output) + ret["comment"] = f"Cannot create index {name}, {output}" else: - ret["comment"] = "Index {} is already present".format(name) + ret["comment"] = f"Index {name} is already present" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -136,7 +136,7 @@ def alias_absent(name, index): ) if ret["result"]: ret["comment"] = ( - "Successfully removed alias {} for index {}".format(name, index) + f"Successfully removed alias {name} for index {index}" ) ret["changes"]["old"] = ( alias.get(index, {}).get("aliases", {}).get(name, {}) @@ -256,7 +256,7 @@ def index_template_absent(name): index_template = __salt__["elasticsearch.index_template_get"](name=name) if index_template and name in index_template: if __opts__["test"]: - ret["comment"] = "Index template {} will be removed".format(name) + ret["comment"] = f"Index template {name} will be removed" ret["changes"]["old"] = index_template[name] ret["result"] = None else: @@ -275,7 +275,7 @@ def index_template_absent(name): ) ) else: - ret["comment"] = "Index template {} is already absent".format(name) + ret["comment"] = f"Index template {name} is already absent" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -316,7 +316,7 @@ def index_template_present(name, definition, check_definition=False): if not index_template_exists: if __opts__["test"]: ret["comment"] = ( - "Index template {} does not exist and will be created".format(name) + f"Index template {name} does not exist and will be created" ) ret["changes"] = {"new": definition} ret["result"] = None @@ -369,7 +369,7 @@ def index_template_present(name, definition, check_definition=False): ) if output: ret["comment"] = ( - "Successfully updated index template {}".format(name) + f"Successfully updated index template {name}" ) ret["changes"] = diff else: @@ -386,7 +386,7 @@ def index_template_present(name, definition, check_definition=False): ) ) else: - ret["comment"] = "Index template {} is already present".format(name) + ret["comment"] = f"Index template {name} is already present" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -408,20 +408,20 @@ def pipeline_absent(name): pipeline = __salt__["elasticsearch.pipeline_get"](id=name) if pipeline and name in pipeline: if __opts__["test"]: - ret["comment"] = "Pipeline {} will be removed".format(name) + ret["comment"] = f"Pipeline {name} will be removed" ret["changes"]["old"] = pipeline[name] ret["result"] = None else: ret["result"] = __salt__["elasticsearch.pipeline_delete"](id=name) if ret["result"]: - ret["comment"] = "Successfully removed pipeline {}".format(name) + ret["comment"] = f"Successfully removed pipeline {name}" ret["changes"]["old"] = pipeline[name] else: ret["comment"] = ( - "Failed to remove pipeline {} for unknown reasons".format(name) + f"Failed to remove pipeline {name} for unknown reasons" ) else: - ret["comment"] = "Pipeline {} is already absent".format(name) + ret["comment"] = f"Pipeline {name} is already absent" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -465,7 +465,7 @@ def pipeline_present(name, definition): if __opts__["test"]: if not pipeline: ret["comment"] = ( - "Pipeline {} does not exist and will be created".format(name) + f"Pipeline {name} does not exist and will be created" ) else: ret["comment"] = ( @@ -480,7 +480,7 @@ def pipeline_present(name, definition): ) if output: if not pipeline: - ret["comment"] = "Successfully created pipeline {}".format(name) + ret["comment"] = f"Successfully created pipeline {name}" else: ret["comment"] = "Successfully replaced pipeline {}".format( name @@ -491,7 +491,7 @@ def pipeline_present(name, definition): name, output ) else: - ret["comment"] = "Pipeline {} is already present".format(name) + ret["comment"] = f"Pipeline {name} is already present" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -513,7 +513,7 @@ def search_template_absent(name): template = __salt__["elasticsearch.search_template_get"](id=name) if template: if __opts__["test"]: - ret["comment"] = "Search template {} will be removed".format(name) + ret["comment"] = f"Search template {name} will be removed" ret["changes"]["old"] = salt.utils.json.loads(template["template"]) ret["result"] = None else: @@ -532,7 +532,7 @@ def search_template_absent(name): ) ) else: - ret["comment"] = "Search template {} is already absent".format(name) + ret["comment"] = f"Search template {name} is already absent" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -592,20 +592,16 @@ def search_template_present(name, definition): ) if output: if not template: - ret["comment"] = ( - "Successfully created search template {}".format(name) - ) + ret["comment"] = f"Successfully created search template {name}" else: - ret["comment"] = ( - "Successfully replaced search template {}".format(name) - ) + ret["comment"] = f"Successfully replaced search template {name}" else: ret["result"] = False ret["comment"] = "Cannot create search template {}, {}".format( name, output ) else: - ret["comment"] = "Search template {} is already present".format(name) + ret["comment"] = f"Search template {name} is already present" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) diff --git a/salt/states/elasticsearch_index.py b/salt/states/elasticsearch_index.py index 48fcbf891c1..dcf0d442579 100644 --- a/salt/states/elasticsearch_index.py +++ b/salt/states/elasticsearch_index.py @@ -25,20 +25,20 @@ def absent(name): index = __salt__["elasticsearch.index_get"](index=name) if index and name in index: if __opts__["test"]: - ret["comment"] = "Index {} will be removed".format(name) + ret["comment"] = f"Index {name} will be removed" ret["changes"]["old"] = index[name] ret["result"] = None else: ret["result"] = __salt__["elasticsearch.index_delete"](index=name) if ret["result"]: - ret["comment"] = "Successfully removed index {}".format(name) + ret["comment"] = f"Successfully removed index {name}" ret["changes"]["old"] = index[name] else: ret["comment"] = ( - "Failed to remove index {} for unknown reasons".format(name) + f"Failed to remove index {name} for unknown reasons" ) else: - ret["comment"] = "Index {} is already absent".format(name) + ret["comment"] = f"Index {name} is already absent" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -93,15 +93,15 @@ def present(name, definition=None): index=name, body=definition ) if output: - ret["comment"] = "Successfully created index {}".format(name) + ret["comment"] = f"Successfully created index {name}" ret["changes"] = { "new": __salt__["elasticsearch.index_get"](index=name)[name] } else: ret["result"] = False - ret["comment"] = "Cannot create index {}, {}".format(name, output) + ret["comment"] = f"Cannot create index {name}, {output}" else: - ret["comment"] = "Index {} is already present".format(name) + ret["comment"] = f"Index {name} is already present" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) diff --git a/salt/states/elasticsearch_index_template.py b/salt/states/elasticsearch_index_template.py index 61ae82e1838..c4574bd9dc7 100644 --- a/salt/states/elasticsearch_index_template.py +++ b/salt/states/elasticsearch_index_template.py @@ -25,7 +25,7 @@ def absent(name): index_template = __salt__["elasticsearch.index_template_get"](name=name) if index_template and name in index_template: if __opts__["test"]: - ret["comment"] = "Index template {} will be removed".format(name) + ret["comment"] = f"Index template {name} will be removed" ret["changes"]["old"] = index_template[name] ret["result"] = None else: @@ -44,7 +44,7 @@ def absent(name): ) ) else: - ret["comment"] = "Index template {} is already absent".format(name) + ret["comment"] = f"Index template {name} is already absent" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) @@ -88,7 +88,7 @@ def present(name, definition): if not index_template_exists: if __opts__["test"]: ret["comment"] = ( - "Index template {} does not exist and will be created".format(name) + f"Index template {name} does not exist and will be created" ) ret["changes"] = {"new": definition} ret["result"] = None @@ -111,7 +111,7 @@ def present(name, definition): name, output ) else: - ret["comment"] = "Index template {} is already present".format(name) + ret["comment"] = f"Index template {name} is already present" except Exception as err: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(err) diff --git a/salt/states/eselect.py b/salt/states/eselect.py index 36246efdd99..2b5196cea17 100644 --- a/salt/states/eselect.py +++ b/salt/states/eselect.py @@ -59,7 +59,7 @@ def set_(name, target, module_parameter=None, action_parameter=None): ) ret["result"] = False elif __opts__["test"]: - ret["comment"] = "Target '{}' will be set on '{}' module.".format(target, name) + ret["comment"] = f"Target '{target}' will be set on '{name}' module." ret["result"] = None else: result = __salt__["eselect.set_target"]( @@ -70,7 +70,7 @@ def set_(name, target, module_parameter=None, action_parameter=None): ) if result: ret["changes"][name] = {"old": old_target, "new": target} - ret["comment"] = "Target '{}' set on '{}' module.".format(target, name) + ret["comment"] = f"Target '{target}' set on '{name}' module." else: ret["comment"] = "Target '{}' failed to be set on '{}' module.".format( target, name diff --git a/salt/states/esxcluster.py b/salt/states/esxcluster.py index b8509b4a329..f4cd626f292 100644 --- a/salt/states/esxcluster.py +++ b/salt/states/esxcluster.py @@ -139,7 +139,7 @@ def _get_vsan_datastore(si, cluster_name): if not vsan_datastores: raise salt.exceptions.VMwareObjectRetrievalError( - "No vSAN datastores where retrieved for cluster '{}'".format(cluster_name) + f"No vSAN datastores where retrieved for cluster '{cluster_name}'" ) return vsan_datastores[0] @@ -200,9 +200,7 @@ def cluster_configured(name, cluster_config): __salt__["esxcluster.get_details"]()["datacenter"], ) else: - raise salt.exceptions.CommandExecutionError( - "Unsupported proxy {}".format(proxy_type) - ) + raise salt.exceptions.CommandExecutionError(f"Unsupported proxy {proxy_type}") log.info( "Running %s for cluster '%s' in datacenter '%s'", name, @@ -287,13 +285,11 @@ def cluster_configured(name, cluster_config): changes_required = True changes_str = "" if diff.diffs: - changes_str = "{}{}".format(changes_str, diff.changes_str) + changes_str = f"{changes_str}{diff.changes_str}" if ldiff and ldiff.diffs: changes_str = "{}\nha:\n options:\n{}".format( changes_str, - "\n".join( - [" {}".format(l) for l in ldiff.changes_str2.split("\n")] - ), + "\n".join([f" {l}" for l in ldiff.changes_str2.split("\n")]), ) # Apply the changes if __opts__["test"]: @@ -354,7 +350,7 @@ def vsan_datastore_configured(name, datastore_name): __salt__["esxcluster.get_details"]()["cluster"], __salt__["esxcluster.get_details"]()["datacenter"], ) - display_name = "{}/{}".format(datacenter_name, cluster_name) + display_name = f"{datacenter_name}/{cluster_name}" log.info("Running vsan_datastore_configured for '%s'", display_name) ret = {"name": name, "changes": {}, "result": None, "comment": "Default"} comments = [] @@ -393,9 +389,7 @@ def vsan_datastore_configured(name, datastore_name): new_datastore_name=datastore_name, service_instance=si, ) - comments.append( - "Renamed vSAN datastore to '{}'.".format(datastore_name) - ) + comments.append(f"Renamed vSAN datastore to '{datastore_name}'.") changes = { "vsan_datastore": { "new": {"name": datastore_name}, @@ -445,7 +439,7 @@ def licenses_configured(name, licenses=None): __salt__["esxcluster.get_details"]()["cluster"], __salt__["esxcluster.get_details"]()["datacenter"], ) - display_name = "{}/{}".format(datacenter_name, cluster_name) + display_name = f"{datacenter_name}/{cluster_name}" log.info("Running licenses configured for '%s'", display_name) log.trace("licenses = %s", licenses) entity = {"type": "cluster", "datacenter": datacenter_name, "cluster": cluster_name} @@ -495,7 +489,7 @@ def licenses_configured(name, licenses=None): log.error(comments[-1]) has_errors = True continue - comments.append("Added license '{}'.".format(license_name)) + comments.append(f"Added license '{license_name}'.") log.info(comments[-1]) else: # License exists let's check if it's assigned to the cluster diff --git a/salt/states/esxdatacenter.py b/salt/states/esxdatacenter.py index b341a1ed9bb..cce5b52024f 100644 --- a/salt/states/esxdatacenter.py +++ b/salt/states/esxdatacenter.py @@ -128,16 +128,16 @@ def datacenter_configured(name): ) if not dcs: if __opts__["test"]: - comments.append("State will create datacenter '{}'.".format(dc_name)) + comments.append(f"State will create datacenter '{dc_name}'.") else: log.debug("Creating datacenter '%s'", dc_name) __salt__["vsphere.create_datacenter"](dc_name, si) - comments.append("Created datacenter '{}'.".format(dc_name)) + comments.append(f"Created datacenter '{dc_name}'.") log.info(comments[-1]) ret["changes"].update({"new": {"name": dc_name}}) else: comments.append( - "Datacenter '{}' already exists. Nothing to be done.".format(dc_name) + f"Datacenter '{dc_name}' already exists. Nothing to be done." ) log.info(comments[-1]) __salt__["vsphere.disconnect"](si) diff --git a/salt/states/esxi.py b/salt/states/esxi.py index 566396e5e7b..7f0df24664f 100644 --- a/salt/states/esxi.py +++ b/salt/states/esxi.py @@ -226,7 +226,7 @@ def coredump_configured(name, enabled, dump_ip, host_vnic="vmk0", dump_port=6500 current_config = __salt__[esxi_cmd]("get_coredump_network_config").get(host) error = current_config.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret current_config = current_config.get("Coredump Config") @@ -242,7 +242,7 @@ def coredump_configured(name, enabled, dump_ip, host_vnic="vmk0", dump_port=6500 ).get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret # Allow users to disable core dump, but then return since @@ -295,7 +295,7 @@ def coredump_configured(name, enabled, dump_ip, host_vnic="vmk0", dump_port=6500 msg = response.get("stderr") if not msg: msg = response.get("stdout") - ret["comment"] = "Error: {}".format(msg) + ret["comment"] = f"Error: {msg}" return ret ret["result"] = True @@ -354,7 +354,7 @@ def password_present(name, password): __salt__[esxi_cmd]("update_host_password", new_password=password) except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret return ret @@ -427,7 +427,7 @@ def ntp_configured( ntp_running = __salt__[esxi_cmd]("get_service_running", service_name=ntpd).get(host) error = ntp_running.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ntp_running = ntp_running.get(ntpd) @@ -440,7 +440,7 @@ def ntp_configured( ).get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret # Set changes dictionary for ntp_servers ret["changes"].update({"ntp_servers": {"old": ntp_config, "new": ntp_servers}}) @@ -456,7 +456,7 @@ def ntp_configured( ) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret # Stop ntpd if service_running=False else: @@ -465,7 +465,7 @@ def ntp_configured( ) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( {"service_running": {"old": ntp_running, "new": service_running}} @@ -478,7 +478,7 @@ def ntp_configured( ).get(host) error = current_service_policy.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret current_service_policy = current_service_policy.get(ntpd) @@ -492,7 +492,7 @@ def ntp_configured( ).get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( { @@ -510,7 +510,7 @@ def ntp_configured( response = __salt__[esxi_cmd]("update_host_datetime").get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( {"update_datetime": {"old": "", "new": "Host datetime was updated."}} @@ -525,7 +525,7 @@ def ntp_configured( ) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( {"service_restart": {"old": "", "new": "NTP Daemon Restarted."}} @@ -587,14 +587,14 @@ def vmotion_configured(name, enabled, device="vmk0"): response = __salt__[esxi_cmd]("vmotion_enable", device=device).get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret # Disable VMotion if enabled=False else: response = __salt__[esxi_cmd]("vmotion_disable").get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( {"enabled": {"old": current_vmotion_enabled, "new": enabled}} @@ -647,7 +647,7 @@ def vsan_configured(name, enabled, add_disks_to_vsan=False): current_vsan_enabled = __salt__[esxi_cmd]("get_vsan_enabled").get(host) error = current_vsan_enabled.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret current_vsan_enabled = current_vsan_enabled.get("VSAN Enabled") @@ -660,14 +660,14 @@ def vsan_configured(name, enabled, add_disks_to_vsan=False): response = __salt__[esxi_cmd]("vsan_enable").get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret # Disable VSAN if enabled=False else: response = __salt__[esxi_cmd]("vsan_disable").get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( {"enabled": {"old": current_vsan_enabled, "new": enabled}} @@ -678,7 +678,7 @@ def vsan_configured(name, enabled, add_disks_to_vsan=False): current_eligible_disks = __salt__[esxi_cmd]("get_vsan_eligible_disks").get(host) error = current_eligible_disks.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret disks = current_eligible_disks.get("Eligible") @@ -688,7 +688,7 @@ def vsan_configured(name, enabled, add_disks_to_vsan=False): response = __salt__[esxi_cmd]("vsan_add_disks").get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update({"add_disks_to_vsan": {"old": "", "new": disks}}) @@ -779,7 +779,7 @@ def ssh_configured( ssh_running = __salt__[esxi_cmd]("get_service_running", service_name=ssh).get(host) error = ssh_running.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ssh_running = ssh_running.get(ssh) @@ -792,14 +792,14 @@ def ssh_configured( enable = __salt__[esxi_cmd]("service_start", service_name=ssh).get(host) error = enable.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret # Disable SSH if service_running=False else: disable = __salt__[esxi_cmd]("service_stop", service_name=ssh).get(host) error = disable.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( @@ -815,7 +815,7 @@ def ssh_configured( ) error = current_ssh_key.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret current_ssh_key = current_ssh_key.get("key") if current_ssh_key: @@ -854,7 +854,7 @@ def ssh_configured( ) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( { @@ -872,7 +872,7 @@ def ssh_configured( ).get(host) error = current_service_policy.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret current_service_policy = current_service_policy.get(ssh) @@ -886,7 +886,7 @@ def ssh_configured( ).get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( { @@ -904,7 +904,7 @@ def ssh_configured( response = __salt__[esxi_cmd]("service_restart", service_name=ssh).get(host) error = response.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret ret["changes"].update( {"service_restart": {"old": "", "new": "SSH service restarted."}} @@ -1008,7 +1008,7 @@ def syslog_configured( "There was an error resetting a syslog config '{}'." "Please check debug logs.".format(val) ) - ret["comment"] = "Error: {}".format(msg) + ret["comment"] = f"Error: {msg}" return ret ret["changes"].update( @@ -1018,7 +1018,7 @@ def syslog_configured( current_firewall = __salt__[esxi_cmd]("get_firewall_status").get(host) error = current_firewall.get("Error") if error: - ret["comment"] = "Error: {}".format(error) + ret["comment"] = f"Error: {error}" return ret current_firewall = current_firewall.get("rulesets").get("syslog") @@ -1033,7 +1033,7 @@ def syslog_configured( if enabled.get("retcode") != 0: err = enabled.get("stderr") out = enabled.get("stdout") - ret["comment"] = "Error: {}".format(err if err else out) + ret["comment"] = f"Error: {err if err else out}" return ret ret["changes"].update({"firewall": {"old": current_firewall, "new": firewall}}) @@ -1045,7 +1045,7 @@ def syslog_configured( try: lookup_key = _lookup_syslog_config(key) except KeyError: - ret["comment"] = "'{}' is not a valid config variable.".format(key) + ret["comment"] = f"'{key}' is not a valid config variable." return ret current_val = current_syslog_config[lookup_key] @@ -1158,7 +1158,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): host_disks = __salt__["vsphere.list_disks"](service_instance=si) if not host_disks: raise VMwareObjectRetrievalError( - "No disks retrieved from host '{}'".format(hostname) + f"No disks retrieved from host '{hostname}'" ) scsi_addr_to_disk_map = {d["scsi_address"]: d for d in host_disks} log.trace("scsi_addr_to_disk_map = %s", scsi_addr_to_disk_map) @@ -1199,14 +1199,12 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): bad_scsi_addrs.append(scsi_addr) continue capacity_disk_ids.append(scsi_addr_to_disk_map[scsi_addr]["id"]) - capacity_disk_displays.append( - "{} (id:{})".format(scsi_addr, capacity_disk_ids[-1]) - ) + capacity_disk_displays.append(f"{scsi_addr} (id:{capacity_disk_ids[-1]})") if bad_scsi_addrs: comments.append( "Error in diskgroup #{}: capacity disks with scsi addresses {} " "were not found.".format( - idx, ", ".join(["'{}'".format(a) for a in bad_scsi_addrs]) + idx, ", ".join([f"'{a}'" for a in bad_scsi_addrs]) ) ) log.error(comments[-1]) @@ -1227,9 +1225,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): name, idx, cache_disk_display, - ", ".join( - ["'{}'".format(a) for a in capacity_disk_displays] - ), + ", ".join([f"'{a}'" for a in capacity_disk_displays]), ) ) else: @@ -1244,9 +1240,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): "{}".format( idx, cache_disk_display, - ", ".join( - ["'{}'".format(a) for a in capacity_disk_displays] - ), + ", ".join([f"'{a}'" for a in capacity_disk_displays]), ) ) log.info(comments[-1]) @@ -1259,7 +1253,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): name, idx, cache_disk_display, - ", ".join(["'{}'".format(a) for a in capacity_disk_displays]), + ", ".join([f"'{a}'" for a in capacity_disk_displays]), ) ) log.info(comments[-1]) @@ -1273,12 +1267,12 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): service_instance=si, ) except VMwareSaltError as err: - comments.append("Error creating disk group #{}: {}.".format(idx, err)) + comments.append(f"Error creating disk group #{idx}: {err}.") log.error(comments[-1]) errors = True continue - comments.append("Created disk group #'{}'.".format(idx)) + comments.append(f"Created disk group #'{idx}'.") log.info(comments[-1]) diskgroup_changes[str(idx)] = { "new": {"cache": cache_disk_display, "capacity": capacity_disk_displays} @@ -1311,9 +1305,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): d["scsi_address"] for d in host_disks if d["id"] == disk_id ][0] added_capacity_disk_ids.append(disk_id) - added_capacity_disk_displays.append( - "{} (id:{})".format(disk_scsi_addr, disk_id) - ) + added_capacity_disk_displays.append(f"{disk_scsi_addr} (id:{disk_id})") for disk_id in existing_diskgroup["capacity_disks"]: if disk_id not in capacity_disk_ids: disk_scsi_addr = [ @@ -1321,7 +1313,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): ][0] removed_capacity_disk_ids.append(disk_id) removed_capacity_disk_displays.append( - "{} (id:{})".format(disk_scsi_addr, disk_id) + f"{disk_scsi_addr} (id:{disk_id})" ) log.debug( @@ -1339,9 +1331,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): "Error removing capacity disk(s) {} from disk group #{}; " "operation is not supported." "".format( - ", ".join( - ["'{}'".format(id) for id in removed_capacity_disk_displays] - ), + ", ".join([f"'{id}'" for id in removed_capacity_disk_displays]), idx, ) ) @@ -1354,7 +1344,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): # Building a string representation of the capacity disks # that need to be added - s = ", ".join(["'{}'".format(id) for id in added_capacity_disk_displays]) + s = ", ".join([f"'{id}'" for id in added_capacity_disk_displays]) if __opts__["test"]: comments.append( "State {} will add capacity disk(s) {} to disk group #{}.".format( @@ -1381,7 +1371,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): errors = True continue - com = "Added capacity disk(s) {} to disk group #{}".format(s, idx) + com = f"Added capacity disk(s) {s} to disk group #{idx}" log.info(com) comments.append(com) diskgroup_changes[str(idx)] = { @@ -1398,7 +1388,7 @@ def diskgroups_configured(name, diskgroups, erase_disks=False): continue # No capacity needs to be added - s = "Disk group #{} is correctly configured. Nothing to be done.".format(idx) + s = f"Disk group #{idx} is correctly configured. Nothing to be done." log.info(s) comments.append(s) __salt__["vsphere.disconnect"](si) @@ -1662,7 +1652,7 @@ def host_cache_configured( backing_disk["id"], ", ".join( [ - "'{}'".format(disk) + f"'{disk}'" for disk in existing_datastores[0]["backing_disk_ids"] ] ), @@ -1710,8 +1700,8 @@ def host_cache_configured( changes.update( { "swap_size": { - "old": "{}GiB".format(existing_swap_size_MiB / 1024), - "new": "{}GiB".format(swap_size_MiB / 1024), + "old": f"{existing_swap_size_MiB / 1024}GiB", + "new": f"{swap_size_MiB / 1024}GiB", } } ) @@ -1746,7 +1736,7 @@ def host_cache_configured( swap_size_MiB=swap_size_MiB, service_instance=si, ) - comments.append("Host cache configured on host '{}'.".format(hostname)) + comments.append(f"Host cache configured on host '{hostname}'.") else: comments.append( "Host cache on host '{}' is already correctly " @@ -1766,7 +1756,7 @@ def host_cache_configured( ret.update( { "result": False if not __opts__["test"] else None, - "comment": "{}.".format(err), + "comment": f"{err}.", } ) return ret diff --git a/salt/states/esxvm.py b/salt/states/esxvm.py index 3a429aa8bd6..59df063745d 100644 --- a/salt/states/esxvm.py +++ b/salt/states/esxvm.py @@ -466,7 +466,7 @@ def vm_updated( { "result": True, "changes": {}, - "comment": "Virtual machine {} is already up to date".format(vm_name), + "comment": f"Virtual machine {vm_name} is already up to date", } ) return result @@ -531,7 +531,7 @@ def vm_updated( "name": name, "result": True, "changes": changes, - "comment": "Virtual machine {} was updated successfully".format(vm_name), + "comment": f"Virtual machine {vm_name} was updated successfully", } return result @@ -564,7 +564,7 @@ def vm_created( result = {"name": name, "result": None, "changes": {}, "comment": ""} if __opts__["test"]: - result["comment"] = "Virtual machine {} will be created".format(vm_name) + result["comment"] = f"Virtual machine {vm_name} will be created" return result service_instance = __salt__["vsphere.get_service_instance_via_proxy"]() @@ -614,7 +614,7 @@ def vm_created( "name": name, "result": True, "changes": changes, - "comment": "Virtual machine {} created successfully".format(vm_name), + "comment": f"Virtual machine {vm_name} created successfully", } return result @@ -628,7 +628,7 @@ def vm_registered(vm_name, datacenter, placement, vm_file, power_on=False): """ result = {"name": vm_name, "result": None, "changes": {}, "comment": ""} - vmx_path = "{}{}".format(vm_file.folderPath, vm_file.file[0].path) + vmx_path = f"{vm_file.folderPath}{vm_file.file[0].path}" log.trace("Registering virtual machine with vmx file: %s", vmx_path) service_instance = __salt__["vsphere.get_service_instance_via_proxy"]() try: @@ -664,7 +664,7 @@ def vm_registered(vm_name, datacenter, placement, vm_file, power_on=False): { "result": True, "changes": {"name": vm_name, "power_on": power_on}, - "comment": "Virtual machine {} registered successfully".format(vm_name), + "comment": f"Virtual machine {vm_name} registered successfully", } ) diff --git a/salt/states/etcd_mod.py b/salt/states/etcd_mod.py index 5bf2c0e9175..b86e89680c7 100644 --- a/salt/states/etcd_mod.py +++ b/salt/states/etcd_mod.py @@ -186,7 +186,7 @@ def __virtual__(): def _etcd_action(*, action, key, profile, value=None, **kwargs): try: - ret = __salt__["etcd.{}".format(action)]( + ret = __salt__[f"etcd.{action}"]( key=key, profile=profile, value=value, **kwargs ) except Exception: # pylint: disable=broad-except diff --git a/salt/states/ethtool.py b/salt/states/ethtool.py index 2d735fd37dc..25367cd8e48 100644 --- a/salt/states/ethtool.py +++ b/salt/states/ethtool.py @@ -86,7 +86,7 @@ def coalesce(name, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Network device {} coalescing settings are up to date.".format(name), + "comment": f"Network device {name} coalescing settings are up to date.", } apply_coalescing = False if "test" not in kwargs: @@ -109,7 +109,7 @@ def coalesce(name, **kwargs): for key, value in kwargs.items(): if key in old and value != old[key]: new.update({key: value}) - diff.append("{}: {}".format(key, value)) + diff.append(f"{key}: {value}") # Dry run if kwargs["test"]: @@ -127,7 +127,7 @@ def coalesce(name, **kwargs): # Prepare return output if new: apply_coalescing = True - ret["comment"] = "Device {} coalescing settings updated.".format(name) + ret["comment"] = f"Device {name} coalescing settings updated." ret["changes"]["ethtool_coalesce"] = "\n".join(diff) except AttributeError as error: @@ -171,7 +171,7 @@ def ring(name, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Network device {} ring parameters are up to date.".format(name), + "comment": f"Network device {name} ring parameters are up to date.", } apply_ring = False if "test" not in kwargs: @@ -182,7 +182,7 @@ def ring(name, **kwargs): old = __salt__["ethtool.show_ring"](name) if not isinstance(old, dict): ret["result"] = False - ret["comment"] = "Device {} ring parameters are not supported".format(name) + ret["comment"] = f"Device {name} ring parameters are not supported" return ret new = {} @@ -192,11 +192,11 @@ def ring(name, **kwargs): for key, value in kwargs.items(): if key in old: if value == "max": - value = old["{}_max".format(key)] + value = old[f"{key}_max"] if value != old[key]: new.update({key: value}) - diff.append("{}: {}".format(key, value)) + diff.append(f"{key}: {value}") # Dry run if kwargs["test"]: @@ -214,7 +214,7 @@ def ring(name, **kwargs): # Prepare return output if new: apply_ring = True - ret["comment"] = "Device {} ring parameters updated.".format(name) + ret["comment"] = f"Device {name} ring parameters updated." ret["changes"]["ethtool_ring"] = "\n".join(diff) except AttributeError as error: @@ -253,7 +253,7 @@ def offload(name, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Network device {} offload settings are up to date.".format(name), + "comment": f"Network device {name} offload settings are up to date.", } apply_offload = False if "test" not in kwargs: @@ -264,7 +264,7 @@ def offload(name, **kwargs): old = __salt__["ethtool.show_offload"](name) if not isinstance(old, dict): ret["result"] = False - ret["comment"] = "Device {} offload settings are not supported".format(name) + ret["comment"] = f"Device {name} offload settings are not supported" return ret new = {} @@ -275,7 +275,7 @@ def offload(name, **kwargs): value = value and "on" or "off" if key in old and value != old[key]: new.update({key: value}) - diff.append("{}: {}".format(key, value)) + diff.append(f"{key}: {value}") # Dry run if kwargs["test"]: @@ -293,7 +293,7 @@ def offload(name, **kwargs): # Prepare return output if new: apply_offload = True - ret["comment"] = "Device {} offload settings updated.".format(name) + ret["comment"] = f"Device {name} offload settings updated." ret["changes"]["ethtool_offload"] = "\n".join(diff) except AttributeError as error: @@ -336,7 +336,7 @@ def pause(name, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Network device {} pause parameters are up to date.".format(name), + "comment": f"Network device {name} pause parameters are up to date.", } apply_pause = False @@ -345,7 +345,7 @@ def pause(name, **kwargs): old = __salt__["ethtool.show_pause"](name) except CommandExecutionError: ret["result"] = False - ret["comment"] = "Device {} pause parameters are not supported".format(name) + ret["comment"] = f"Device {name} pause parameters are not supported" return ret # map ethtool command input to output text @@ -368,7 +368,7 @@ def pause(name, **kwargs): value = "on" elif value is False: value = "off" - diff.append("{}: {}".format(key, value)) + diff.append(f"{key}: {value}") if not new: return ret @@ -385,7 +385,7 @@ def pause(name, **kwargs): try: __salt__["ethtool.set_pause"](name, **new) # Prepare return output - ret["comment"] = "Device {} pause parameters updated.".format(name) + ret["comment"] = f"Device {name} pause parameters updated." ret["changes"]["ethtool_pause"] = "\n".join(diff) except CommandExecutionError as exc: ret["result"] = False diff --git a/salt/states/file.py b/salt/states/file.py index 5c084634350..e81dafa4a59 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -384,11 +384,11 @@ def _check_user(user, group): if user: uid = __salt__["file.user_to_uid"](user) if uid == "": - err += "User {} is not available ".format(user) + err += f"User {user} is not available " if group: gid = __salt__["file.group_to_gid"](group) if gid == "": - err += "Group {} is not available".format(group) + err += f"Group {group} is not available" if err and __opts__["test"]: # Write the warning with error message, but prevent failing, # in case of applying the state in test mode. @@ -644,10 +644,10 @@ def _check_file(name): if not os.path.isabs(name): ret = False - msg = "Specified file {} is not an absolute path".format(name) + msg = f"Specified file {name} is not an absolute path" elif not os.path.exists(name): ret = False - msg = "{}: file not found".format(name) + msg = f"{name}: file not found" return ret, msg @@ -741,7 +741,7 @@ def _check_directory( try: recurse_set = _get_recurse_set(recurse) except (TypeError, ValueError) as exc: - return False, "{}".format(exc), changes + return False, f"{exc}", changes if "user" not in recurse_set: user = None if "group" not in recurse_set: @@ -827,9 +827,9 @@ def _check_directory( comments = ["The following files will be changed:\n"] for fn_ in changes: for key, val in changes[fn_].items(): - comments.append("{}: {} - {}\n".format(fn_, key, val)) + comments.append(f"{fn_}: {key} - {val}\n") return None, "".join(comments), changes - return True, "The directory {} is in the correct state".format(name), changes + return True, f"The directory {name} is in the correct state", changes def _check_directory_win( @@ -859,9 +859,9 @@ def _check_directory_win( )["changes"] if changes: - return None, 'The directory "{}" will be changed'.format(name), changes + return None, f'The directory "{name}" will be changed', changes - return True, "The directory {} is in the correct state".format(name), changes + return True, f"The directory {name} is in the correct state", changes def _check_dir_meta(name, user, group, mode, follow_symlinks=False): @@ -909,17 +909,17 @@ def _check_touch(name, atime, mtime): "changes": {"new": name}, } if not os.path.exists(name): - ret["comment"] = "File {} is set to be created".format(name) + ret["comment"] = f"File {name} is set to be created" else: stats = __salt__["file.stats"](name, follow_symlinks=False) if (atime is not None and str(atime) != str(stats["atime"])) or ( mtime is not None and str(mtime) != str(stats["mtime"]) ): - ret["comment"] = "Times set to be updated on file {}".format(name) + ret["comment"] = f"Times set to be updated on file {name}" ret["changes"] = {"touched": name} else: ret["result"] = True - ret["comment"] = "File {} exists and has the correct times".format(name) + ret["comment"] = f"File {name} exists and has the correct times" return ret @@ -972,7 +972,7 @@ def _symlink_check(name, target, force, user, group, win_owner): changes["new"] = name return ( None, - "Symlink {} to {} is set for creation".format(name, target), + f"Symlink {name} to {target} is set for creation", changes, ) if __salt__["file.is_link"](name): @@ -980,12 +980,12 @@ def _symlink_check(name, target, force, user, group, win_owner): changes["change"] = name return ( None, - "Link {} target is set to be changed to {}".format(name, target), + f"Link {name} target is set to be changed to {target}", changes, ) else: result = True - msg = "The symlink {} is present".format(name) + msg = f"The symlink {name} is present" if not _check_symlink_ownership(name, user, group, win_owner): result = None changes["ownership"] = "{}:{}".format(*_get_symlink_ownership(name)) @@ -1035,28 +1035,28 @@ def _hardlink_check(name, target, force): """ changes = {} if not os.path.exists(target): - msg = "Target {} for hard link does not exist".format(target) + msg = f"Target {target} for hard link does not exist" return False, msg, changes elif os.path.isdir(target): - msg = "Unable to hard link from directory {}".format(target) + msg = f"Unable to hard link from directory {target}" return False, msg, changes if os.path.isdir(name): - msg = "Unable to hard link to directory {}".format(name) + msg = f"Unable to hard link to directory {name}" return False, msg, changes elif not os.path.exists(name): - msg = "Hard link {} to {} is set for creation".format(name, target) + msg = f"Hard link {name} to {target} is set for creation" changes["new"] = name return None, msg, changes elif __salt__["file.is_hardlink"](name): if _hardlink_same(name, target): - msg = "The hard link {} is presently targetting {}".format(name, target) + msg = f"The hard link {name} is presently targetting {target}" return True, msg, changes - msg = "Link {} target is set to be changed to {}".format(name, target) + msg = f"Link {name} target is set to be changed to {target}" changes["change"] = name return None, msg, changes @@ -1164,7 +1164,7 @@ def _get_template_texts( return _error(ret, msg) txtl.append("".join(tmplines)) else: - msg = "Failed to load template file {}".format(source) + msg = f"Failed to load template file {source}" log.debug(msg) ret["name"] = source return _error(ret, msg) @@ -1228,7 +1228,7 @@ def _shortcut_check( changes["new"] = name return ( None, - 'Shortcut "{}" to "{}" is set for creation'.format(name, target), + f'Shortcut "{name}" to "{target}" is set for creation', changes, ) @@ -1261,10 +1261,10 @@ def _shortcut_check( ) else: result = True - msg = 'The shortcut "{}" is present'.format(name) + msg = f'The shortcut "{name}" is present' if not _check_shortcut_ownership(name, user): result = None - changes["ownership"] = "{}".format(_get_shortcut_ownership(name)) + changes["ownership"] = f"{_get_shortcut_ownership(name)}" msg += ( ", but the ownership of the shortcut would be changed " "from {1} to {0}".format(user, _get_shortcut_ownership(name)) @@ -1416,20 +1416,16 @@ def hardlink( gid = __salt__["file.group_to_gid"](group) if uid == "": - preflight_errors.append("User {} does not exist".format(user)) + preflight_errors.append(f"User {user} does not exist") if gid == "": - preflight_errors.append("Group {} does not exist".format(group)) + preflight_errors.append(f"Group {group} does not exist") if not os.path.isabs(name): - preflight_errors.append( - "Specified file {} is not an absolute path".format(name) - ) + preflight_errors.append(f"Specified file {name} is not an absolute path") if not os.path.isabs(target): - preflight_errors.append( - "Specified target {} is not an absolute path".format(target) - ) + preflight_errors.append(f"Specified target {target} is not an absolute path") if preflight_errors: msg = ". ".join(preflight_errors) @@ -1448,11 +1444,11 @@ def hardlink( # tracker that complains about not linking the zip builtin. for direction, item in zip_longest(["to", "from"], [name, target]): if os.path.isdir(item): - msg = "Unable to hard link {} directory {}".format(direction, item) + msg = f"Unable to hard link {direction} directory {item}" return _error(ret, msg) if not os.path.exists(target): - msg = "Target {} for hard link does not exist".format(target) + msg = f"Target {target} for hard link does not exist" return _error(ret, msg) # Check that the directory to write the hard link to exists @@ -1480,9 +1476,7 @@ def hardlink( # Otherwise throw an error else: - return _error( - ret, "File exists where the hard link {} should be".format(name) - ) + return _error(ret, f"File exists where the hard link {name} should be") # If the file is a hard link, then we can simply rewrite its target since # nothing is really being lost here. @@ -1514,7 +1508,7 @@ def hardlink( # Good to go ret["result"] = True - ret["comment"] = "Set target of hard link {} -> {}".format(name, target) + ret["comment"] = f"Set target of hard link {name} -> {target}" ret["changes"]["new"] = name # The link is not present, so simply make it @@ -1532,7 +1526,7 @@ def hardlink( # Made a new hard link, things are ok ret["result"] = True - ret["comment"] = "Created new hard link {} -> {}".format(name, target) + ret["comment"] = f"Created new hard link {name} -> {target}" ret["changes"]["new"] = name return ret @@ -1724,7 +1718,7 @@ def symlink( try: salt.utils.win_functions.get_sid_from_name(win_owner) except CommandExecutionError as exc: - preflight_errors.append("User {} does not exist".format(win_owner)) + preflight_errors.append(f"User {win_owner} does not exist") # Make sure users passed in win_perms exist if win_perms: @@ -1732,7 +1726,7 @@ def symlink( try: salt.utils.win_functions.get_sid_from_name(name_check) except CommandExecutionError as exc: - preflight_errors.append("User {} does not exist".format(name_check)) + preflight_errors.append(f"User {name_check} does not exist") # Make sure users passed in win_deny_perms exist if win_deny_perms: @@ -1740,21 +1734,19 @@ def symlink( try: salt.utils.win_functions.get_sid_from_name(name_check) except CommandExecutionError as exc: - preflight_errors.append("User {} does not exist".format(name_check)) + preflight_errors.append(f"User {name_check} does not exist") else: uid = __salt__["file.user_to_uid"](user) gid = __salt__["file.group_to_gid"](group) if uid == "": - preflight_errors.append("User {} does not exist".format(user)) + preflight_errors.append(f"User {user} does not exist") if gid == "": - preflight_errors.append("Group {} does not exist".format(group)) + preflight_errors.append(f"Group {group} does not exist") if not os.path.isabs(name): - preflight_errors.append( - "Specified file {} is not an absolute path".format(name) - ) + preflight_errors.append(f"Specified file {name} is not an absolute path") if preflight_errors: msg = ". ".join(preflight_errors) @@ -1769,7 +1761,7 @@ def symlink( if not os.path.isdir(os.path.dirname(name)): if makedirs: if __opts__["test"]: - tcomment += "\n{} will be created".format(os.path.dirname(name)) + tcomment += f"\n{os.path.dirname(name)} will be created" else: try: _makedirs( @@ -1783,7 +1775,7 @@ def symlink( win_inheritance=win_inheritance, ) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") else: if __opts__["test"]: tcomment += "\nDirectory {} for symlink is not present".format( @@ -1831,7 +1823,7 @@ def symlink( ret["comment"] = "Set ownership of symlink {} to {}:{}".format( name, user, group ) - ret["changes"]["ownership"] = "{}:{}".format(user, group) + ret["changes"]["ownership"] = f"{user}:{group}" else: ret["result"] = False if salt.utils.platform.is_windows(): @@ -1900,7 +1892,7 @@ def symlink( ) return _error( ret, - "{} exists where the symlink {} should be".format(fs_entry_type, name), + f"{fs_entry_type} exists where the symlink {name} should be", ) try: @@ -1912,7 +1904,7 @@ def symlink( ) return ret else: - ret["comment"] = "Created new symlink {} -> {}".format(name, target) + ret["comment"] = f"Created new symlink {name} -> {target}" ret["changes"]["new"] = name if not _check_symlink_ownership(name, user, group, win_owner): @@ -1942,38 +1934,38 @@ def absent(name, **kwargs): if not name: return _error(ret, "Must provide name to file.absent") if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") if name == "/": return _error(ret, 'Refusing to make "/" absent') if os.path.isfile(name) or os.path.islink(name): if __opts__["test"]: ret["result"] = None ret["changes"]["removed"] = name - ret["comment"] = "File {} is set for removal".format(name) + ret["comment"] = f"File {name} is set for removal" return ret try: __salt__["file.remove"](name, force=True) - ret["comment"] = "Removed file {}".format(name) + ret["comment"] = f"Removed file {name}" ret["changes"]["removed"] = name return ret except CommandExecutionError as exc: - return _error(ret, "{}".format(exc)) + return _error(ret, f"{exc}") elif os.path.isdir(name): if __opts__["test"]: ret["result"] = None ret["changes"]["removed"] = name - ret["comment"] = "Directory {} is set for removal".format(name) + ret["comment"] = f"Directory {name} is set for removal" return ret try: __salt__["file.remove"](name, force=True) - ret["comment"] = "Removed directory {}".format(name) + ret["comment"] = f"Removed directory {name}" ret["changes"]["removed"] = name return ret except OSError: - return _error(ret, "Failed to remove directory {}".format(name)) + return _error(ret, f"Failed to remove directory {name}") - ret["comment"] = "File {} is not present".format(name) + ret["comment"] = f"File {name} is not present" return ret @@ -2104,9 +2096,9 @@ def tidied( # Check preconditions if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") if not os.path.isdir(name): - return _error(ret, "{} does not exist or is not a directory.".format(name)) + return _error(ret, f"{name} does not exist or is not a directory.") # Check time_comparison parameter poss_comp = ["atime", "ctime", "mtime"] @@ -2203,7 +2195,7 @@ def tidied( if todelete: if __opts__["test"]: ret["result"] = None - ret["comment"] = "{} is set for tidy".format(name) + ret["comment"] = f"{name} is set for tidy" ret["changes"] = {"removed": todelete} return ret ret["changes"]["removed"] = [] @@ -2213,14 +2205,14 @@ def tidied( __salt__["file.remove"](path) ret["changes"]["removed"].append(path) except CommandExecutionError as exc: - return _error(ret, "{}".format(exc)) + return _error(ret, f"{exc}") # Set comment for the summary ret["comment"] = "Removed {} files or directories from directory {}".format( len(todelete), name ) else: # Set comment in case there was nothing to remove - ret["comment"] = "Nothing to remove from directory {}".format(name) + ret["comment"] = f"Nothing to remove from directory {name}" return ret @@ -2243,9 +2235,9 @@ def exists(name, **kwargs): if not name: return _error(ret, "Must provide name to file.exists") if not os.path.exists(name): - return _error(ret, "Specified path {} does not exist".format(name)) + return _error(ret, f"Specified path {name} does not exist") - ret["comment"] = "Path {} exists".format(name) + ret["comment"] = f"Path {name} exists" return ret @@ -2263,9 +2255,9 @@ def missing(name, **kwargs): if not name: return _error(ret, "Must provide name to file.missing") if os.path.exists(name): - return _error(ret, "Specified path {} exists".format(name)) + return _error(ret, f"Specified path {name} exists") - ret["comment"] = "Path {} is missing".format(name) + ret["comment"] = f"Path {name} is missing" return ret @@ -2994,7 +2986,7 @@ def managed( nextp, __NOT_FOUND, delimiter=contents_delimiter ) if nextc is __NOT_FOUND: - return _error(ret, "Pillar {} does not exist".format(nextp)) + return _error(ret, f"Pillar {nextp} does not exist") list_contents.append(nextc) use_contents = os.linesep.join(list_contents) else: @@ -3002,7 +2994,7 @@ def managed( contents_pillar, __NOT_FOUND, delimiter=contents_delimiter ) if use_contents is __NOT_FOUND: - return _error(ret, "Pillar {} does not exist".format(contents_pillar)) + return _error(ret, f"Pillar {contents_pillar} does not exist") elif contents_grains is not None: if isinstance(contents_grains, list): @@ -3012,7 +3004,7 @@ def managed( nextg, __NOT_FOUND, delimiter=contents_delimiter ) if nextc is __NOT_FOUND: - return _error(ret, "Grain {} does not exist".format(nextc)) + return _error(ret, f"Grain {nextc} does not exist") list_contents.append(nextc) use_contents = os.linesep.join(list_contents) else: @@ -3020,7 +3012,7 @@ def managed( contents_grains, __NOT_FOUND, delimiter=contents_delimiter ) if use_contents is __NOT_FOUND: - return _error(ret, "Grain {} does not exist".format(contents_grains)) + return _error(ret, f"Grain {contents_grains} does not exist") elif contents is not None: use_contents = contents @@ -3031,9 +3023,9 @@ def managed( if use_contents is not None: if not allow_empty and not use_contents: if contents_pillar: - contents_id = "contents_pillar {}".format(contents_pillar) + contents_id = f"contents_pillar {contents_pillar}" elif contents_grains: - contents_id = "contents_grains {}".format(contents_grains) + contents_id = f"contents_grains {contents_grains}" else: contents_id = "'contents'" return _error( @@ -3110,19 +3102,17 @@ def managed( if not create: if not os.path.isfile(name): # Don't create a file that is not already present - ret["comment"] = ( - "File {} is not present and is not set for creation".format(name) - ) + ret["comment"] = f"File {name} is not present and is not set for creation" return ret u_check = _check_user(user, group) if u_check: # The specified user or group do not exist return _error(ret, u_check) if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") if os.path.isdir(name): - ret["comment"] = "Specified target {} is a directory".format(name) + ret["comment"] = f"Specified target {name} is a directory" ret["result"] = False return ret @@ -3173,10 +3163,10 @@ def managed( "state of {}".format(name, mode, ret_perms["lmode"]) ) else: - ret["comment"] = "File {} not updated".format(name) + ret["comment"] = f"File {name} not updated" elif not ret["changes"] and ret["result"]: ret["comment"] = ( - "File {} exists with proper permissions. No changes made.".format(name) + f"File {name} exists with proper permissions. No changes made." ) return ret @@ -3236,7 +3226,7 @@ def managed( ret["changes"] = {} elif ret["changes"]: ret["result"] = None - ret["comment"] = "The file {} is set to be changed".format(name) + ret["comment"] = f"The file {name} is set to be changed" ret["comment"] += ( "\nNote: No changes made, actual changes may\n" "be different due to other states." @@ -3245,7 +3235,7 @@ def managed( ret["changes"]["diff"] = "" else: ret["result"] = True - ret["comment"] = "The file {} is in the correct state".format(name) + ret["comment"] = f"The file {name} is in the correct state" return ret @@ -3253,7 +3243,7 @@ def managed( source, source_hash = __salt__["file.source_list"](source, source_hash, __env__) except CommandExecutionError as exc: ret["result"] = False - ret["comment"] = "Unable to manage file: {}".format(exc) + ret["comment"] = f"Unable to manage file: {exc}" return ret # Gather the source file from the server @@ -3279,7 +3269,7 @@ def managed( except Exception as exc: # pylint: disable=broad-except ret["changes"] = {} log.debug(traceback.format_exc()) - return _error(ret, "Unable to manage file: {}".format(exc)) + return _error(ret, f"Unable to manage file: {exc}") tmp_filename = None @@ -3293,7 +3283,7 @@ def managed( except Exception as exc: # pylint: disable=broad-except return _error( ret, - "Unable to copy file {} to {}: {}".format(name, tmp_filename, exc), + f"Unable to copy file {name} to {tmp_filename}: {exc}", ) try: @@ -3346,7 +3336,7 @@ def managed( sfn = __salt__["cp.is_cached"](source, __env__) if sfn: salt.utils.files.remove(sfn) - return _error(ret, "Unable to check_cmd file: {}".format(exc)) + return _error(ret, f"Unable to check_cmd file: {exc}") # file being updated to verify using check_cmd if ret["changes"]: @@ -3413,7 +3403,7 @@ def managed( except Exception as exc: # pylint: disable=broad-except ret["changes"] = {} log.debug(traceback.format_exc()) - return _error(ret, "Unable to manage file: {}".format(exc)) + return _error(ret, f"Unable to manage file: {exc}") finally: if tmp_filename: salt.utils.files.remove(tmp_filename) @@ -3450,7 +3440,7 @@ def _get_recurse_set(recurse): if recurse_set is None or not set(_RECURSE_TYPES) >= recurse_set: raise ValueError( 'Types for "recurse" limited to {}.'.format( - ", ".join('"{}"'.format(rtype) for rtype in _RECURSE_TYPES) + ", ".join(f'"{rtype}"' for rtype in _RECURSE_TYPES) ) ) if "ignore_files" in recurse_set and "ignore_dirs" in recurse_set: @@ -3883,7 +3873,7 @@ def directory( # Must be an absolute path if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") # Check for existing file or symlink if ( @@ -3927,13 +3917,9 @@ def directory( ret["changes"]["forced"] = "Directory was forcibly replaced" else: if os.path.isfile(name): - return _error( - ret, "Specified location {} exists and is a file".format(name) - ) + return _error(ret, f"Specified location {name} exists and is a file") elif os.path.islink(name): - return _error( - ret, "Specified location {} exists and is a symlink".format(name) - ) + return _error(ret, f"Specified location {name} exists and is a symlink") # Check directory? if salt.utils.platform.is_windows(): @@ -3995,9 +3981,9 @@ def directory( win_inheritance=win_inheritance, ) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") else: - return _error(ret, "No directory to create {} in".format(name)) + return _error(ret, f"No directory to create {name} in") if salt.utils.platform.is_windows(): __salt__["file.mkdir"]( @@ -4012,7 +3998,7 @@ def directory( __salt__["file.mkdir"](name, user=user, group=group, mode=dir_mode) if not os.path.isdir(name): - return _error(ret, "Failed to create directory {}".format(name)) + return _error(ret, f"Failed to create directory {name}") ret["changes"][name] = {"directory": "new"} return ret @@ -4050,7 +4036,7 @@ def directory( recurse_set = _get_recurse_set(recurse) except (TypeError, ValueError) as exc: ret["result"] = False - ret["comment"] = "{}".format(exc) + ret["comment"] = f"{exc}" # NOTE: Should this be enough to stop the whole check altogether? if recurse_set: if "user" in recurse_set: @@ -4082,7 +4068,7 @@ def directory( if isinstance(gid, str): ret["result"] = False ret["comment"] = ( - "Failed to enforce group ownership for group {}".format(group) + f"Failed to enforce group ownership for group {group}" ) else: ret["result"] = False @@ -4155,24 +4141,24 @@ def directory( removed = _clean_dir(name, list(keep), exclude_pat) if removed: ret["changes"]["removed"] = removed - ret["comment"] = "Files cleaned from directory {}".format(name) + ret["comment"] = f"Files cleaned from directory {name}" # issue 32707: reflect children_only selection in comments if not ret["comment"]: if children_only: - ret["comment"] = "Directory {}/* updated".format(name) + ret["comment"] = f"Directory {name}/* updated" else: if ret["changes"]: - ret["comment"] = "Directory {} updated".format(name) + ret["comment"] = f"Directory {name} updated" if __opts__["test"]: - ret["comment"] = "Directory {} not updated".format(name) + ret["comment"] = f"Directory {name} not updated" elif not ret["changes"] and ret["result"]: orig_comment = None if ret["comment"]: orig_comment = ret["comment"] - ret["comment"] = "Directory {} is in the correct state".format(name) + ret["comment"] = f"Directory {name} is in the correct state" if orig_comment: ret["comment"] = "\n".join([ret["comment"], orig_comment]) @@ -4180,7 +4166,7 @@ def directory( ret["result"] = False ret["comment"] += "\n\nThe following errors were encountered:\n" for error in errors: - ret["comment"] += "\n- {}".format(error) + ret["comment"] += f"\n- {error}" return ret @@ -4472,7 +4458,7 @@ def recurse( # The specified user or group do not exist return _error(ret, u_check) if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") # expand source into source_list source_list = _validate_str_list(source) @@ -4484,7 +4470,7 @@ def recurse( if not precheck.startswith("salt://"): return _error( ret, - "Invalid source '{}' (must be a salt:// URI)".format(precheck), + f"Invalid source '{precheck}' (must be a salt:// URI)", ) # Select the first source in source_list that exists @@ -4492,7 +4478,7 @@ def recurse( source, source_hash = __salt__["file.source_list"](source_list, "", __env__) except CommandExecutionError as exc: ret["result"] = False - ret["comment"] = "Recurse failed: {}".format(exc) + ret["comment"] = f"Recurse failed: {exc}" return ret # Check source path relative to fileserver root, make sure it is a @@ -4513,7 +4499,7 @@ def recurse( if not os.path.isdir(name): if os.path.exists(name): # it is not a dir, but it exists - fail out - return _error(ret, "The path {} exists and is not a directory".format(name)) + return _error(ret, f"The path {name} exists and is not a directory") if not __opts__["test"]: if salt.utils.platform.is_windows(): win_owner = win_owner if win_owner else user @@ -4552,7 +4538,7 @@ def recurse( if clean and os.path.exists(path) and os.path.isdir(path) and replace: _ret = {"name": name, "changes": {}, "result": True, "comment": ""} if __opts__["test"]: - _ret["comment"] = "Replacing directory {} with a file".format(path) + _ret["comment"] = f"Replacing directory {path} with a file" _ret["result"] = None merge_ret(path, _ret) return @@ -4592,7 +4578,7 @@ def recurse( if clean and os.path.exists(path) and not os.path.isdir(path): _ret = {"name": name, "changes": {}, "result": True, "comment": ""} if __opts__["test"]: - _ret["comment"] = "Replacing {} with a directory".format(path) + _ret["comment"] = f"Replacing {path} with a directory" _ret["result"] = None merge_ret(path, _ret) return @@ -4656,10 +4642,10 @@ def recurse( ).strip() if not ret["comment"]: - ret["comment"] = "Recursively updated {}".format(name) + ret["comment"] = f"Recursively updated {name}" if not ret["changes"] and ret["result"]: - ret["comment"] = "The directory {} is in the correct state".format(name) + ret["comment"] = f"The directory {name} is in the correct state" return ret @@ -5188,7 +5174,7 @@ def line( if mode not in modeswithemptycontent and content is None: return _error( ret, - "Content can only be empty if mode is {}".format(modeswithemptycontent), + f"Content can only be empty if mode is {modeswithemptycontent}", ) del modeswithemptycontent @@ -5584,7 +5570,7 @@ def keyvalue( with salt.utils.files.fopen(name, "r") as fd: file_contents = fd.readlines() except OSError: - ret["comment"] = "unable to open {n}".format(n=name) + ret["comment"] = f"unable to open {name}" ret["result"] = True if ignore_if_missing else False return ret @@ -5673,7 +5659,7 @@ def keyvalue( # the old line always needs to go, so that will be # reflected in the diff (this is the original line from # the file being read) - diff.append("- {}".format(line)) + diff.append(f"- {line}") line = line[:0] # any non-zero value means something needs to go back in @@ -5696,7 +5682,7 @@ def keyvalue( ) ) else: - diff.append("+ {}".format(line)) + diff.append(f"+ {line}") changes += 1 # subtract one from the count if it was larger than 0, so # next lines are removed. if it is less than 0 then count is @@ -5721,7 +5707,7 @@ def keyvalue( for key, value in key_values.items(): if diff_count[key] > 0: line = tmpl.format(key=key, sep=separator, value=value) - tmpdiff.append("+ {}".format(line)) + tmpdiff.append(f"+ {line}") content.append(line) changes += 1 if tmpdiff: @@ -5739,7 +5725,7 @@ def keyvalue( if not did_diff: diff.insert(0, " " + os.linesep) did_diff = True - diff.insert(1, "+ {}".format(line)) + diff.insert(1, f"+ {line}") content.insert(0, line) changes += 1 @@ -5765,7 +5751,7 @@ def keyvalue( # otherwise return the actual diff lines else: - ret["comment"] = "Changed {c} lines".format(c=changes) + ret["comment"] = f"Changed {changes} lines" if show_changes: ret["changes"]["diff"] = "".join(diff) else: @@ -5781,7 +5767,7 @@ def keyvalue( fd.close() except OSError: # return an error if the file was not writable - ret["comment"] = "{n} not writable".format(n=name) + ret["comment"] = f"{name} not writable" ret["result"] = False return ret # if all went well, then set result to true @@ -6086,7 +6072,7 @@ def blockreplace( except Exception as exc: # pylint: disable=broad-except log.exception("Encountered error managing block") ret["comment"] = ( - "Encountered error managing block: {}. See the log for details.".format(exc) + f"Encountered error managing block: {exc}. See the log for details." ) return ret @@ -6177,11 +6163,11 @@ def comment(name, regex, char="#", backup=".bak", ignore_missing=False): ret["result"] = True return ret else: - return _error(ret, "{}: Pattern not found".format(unanchor_regex)) + return _error(ret, f"{unanchor_regex}: Pattern not found") if __opts__["test"]: ret["changes"][name] = "updated" - ret["comment"] = "File {} is set to be updated".format(name) + ret["comment"] = f"File {name} is set to be updated" ret["result"] = None return ret @@ -6275,11 +6261,11 @@ def uncomment(name, regex, char="#", backup=".bak"): ret["result"] = True return ret else: - return _error(ret, "{}: Pattern not found".format(regex)) + return _error(ret, f"{regex}: Pattern not found") if __opts__["test"]: ret["changes"][name] = "updated" - ret["comment"] = "File {} is set to be updated".format(name) + ret["comment"] = f"File {name} is set to be updated" ret["result"] = None return ret @@ -6482,14 +6468,14 @@ def append( if makedirs is True: dirname = os.path.dirname(name) if __opts__["test"]: - ret["comment"] = "Directory {} is set to be updated".format(dirname) + ret["comment"] = f"Directory {dirname} is set to be updated" ret["result"] = None else: if not __salt__["file.directory_exists"](dirname): try: _makedirs(name=name) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") check_res, check_msg, check_changes = ( _check_directory_win(dirname) @@ -6541,13 +6527,13 @@ def append( continue for line_item in chunk.splitlines(): - append_lines.append("{}".format(line_item)) + append_lines.append(f"{line_item}") except TypeError: return _error(ret, "No text found to append. Nothing appended") if __opts__["test"]: - ret["comment"] = "File {} is set to be updated".format(name) + ret["comment"] = f"File {name} is set to be updated" ret["result"] = None nlines = list(slines) nlines.extend(append_lines) @@ -6558,15 +6544,15 @@ def append( # Changes happened, add them ret["changes"]["diff"] = "\n".join(difflib.unified_diff(slines, nlines)) else: - ret["comment"] = "File {} is in correct state".format(name) + ret["comment"] = f"File {name} is in correct state" ret["result"] = True return ret if append_lines: __salt__["file.append"](name, args=append_lines) - ret["comment"] = "Appended {} lines".format(len(append_lines)) + ret["comment"] = f"Appended {len(append_lines)} lines" else: - ret["comment"] = "File {} is in correct state".format(name) + ret["comment"] = f"File {name} is in correct state" with salt.utils.files.fopen(name, "rb") as fp_: nlines = fp_.read() @@ -6767,14 +6753,14 @@ def prepend( if makedirs is True: dirname = os.path.dirname(name) if __opts__["test"]: - ret["comment"] = "Directory {} is set to be updated".format(dirname) + ret["comment"] = f"Directory {dirname} is set to be updated" ret["result"] = None else: if not __salt__["file.directory_exists"](dirname): try: _makedirs(name=name) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") check_res, check_msg, check_changes = ( _check_directory_win(dirname) @@ -6831,9 +6817,9 @@ def prepend( for line in lines: if __opts__["test"]: - ret["comment"] = "File {} is set to be updated".format(name) + ret["comment"] = f"File {name} is set to be updated" ret["result"] = None - test_lines.append("{}\n".format(line)) + test_lines.append(f"{line}\n") else: preface.append(line) count += 1 @@ -6848,7 +6834,7 @@ def prepend( ret["changes"]["diff"] = "".join(difflib.unified_diff(slines, nlines)) ret["result"] = None else: - ret["comment"] = "File {} is in correct state".format(name) + ret["comment"] = f"File {name} is in correct state" ret["result"] = True return ret @@ -6887,9 +6873,9 @@ def prepend( ret["changes"]["diff"] = "".join(difflib.unified_diff(slines, nlines)) if count: - ret["comment"] = "Prepended {} lines".format(count) + ret["comment"] = f"Prepended {count} lines" else: - ret["comment"] = "File {} is in correct state".format(name) + ret["comment"] = f"File {name} is in correct state" ret["result"] = True return ret @@ -7048,14 +7034,14 @@ def patch( try: name = os.path.expanduser(name) except Exception: # pylint: disable=broad-except - ret["comment"] = "Invalid path '{}'".format(name) + ret["comment"] = f"Invalid path '{name}'" return ret else: if not os.path.isabs(name): - ret["comment"] = "{} is not an absolute path".format(name) + ret["comment"] = f"{name} is not an absolute path" return ret elif not os.path.exists(name): - ret["comment"] = "{} does not exist".format(name) + ret["comment"] = f"{name} does not exist" return ret else: is_dir = os.path.isdir(name) @@ -7072,11 +7058,11 @@ def patch( try: reject_file_parent = os.path.dirname(reject_file) except Exception: # pylint: disable=broad-except - ret["comment"] = "Invalid path '{}' for reject_file".format(reject_file) + ret["comment"] = f"Invalid path '{reject_file}' for reject_file" return ret else: if not os.path.isabs(reject_file_parent): - ret["comment"] = "'{}' is not an absolute path".format(reject_file) + ret["comment"] = f"'{reject_file}' is not an absolute path" return ret elif not os.path.isdir(reject_file_parent): ret["comment"] = ( @@ -7176,7 +7162,7 @@ def patch( "included in the source URL." ) else: - source_match += "?saltenv={}".format(saltenv) + source_match += f"?saltenv={saltenv}" cleanup = [] @@ -7249,7 +7235,7 @@ def patch( # then remove. patch_opts = ["-N", "-r", patch_rejects, "-o", patch_output] if is_dir and strip is not None: - patch_opts.append("-p{}".format(strip)) + patch_opts.append(f"-p{strip}") pre_check = _patch(patch_file, patch_opts) if pre_check["retcode"] != 0: @@ -7300,7 +7286,7 @@ def patch( # If we've made it here, the patch should apply cleanly patch_opts = [] if is_dir and strip is not None: - patch_opts.append("-p{}".format(strip)) + patch_opts.append(f"-p{strip}") ret["changes"] = _patch(patch_file, patch_opts) if ret["changes"]["retcode"] == 0: @@ -7365,7 +7351,7 @@ def touch(name, atime=None, mtime=None, makedirs=False): if not name: return _error(ret, "Must provide name to file.touch") if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") if __opts__["test"]: ret.update(_check_touch(name, atime, mtime)) @@ -7375,15 +7361,15 @@ def touch(name, atime=None, mtime=None, makedirs=False): try: _makedirs(name=name) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") if not os.path.isdir(os.path.dirname(name)): - return _error(ret, "Directory not present to touch file {}".format(name)) + return _error(ret, f"Directory not present to touch file {name}") extant = os.path.exists(name) ret["result"] = __salt__["file.touch"](name, atime, mtime) if not extant and ret["result"]: - ret["comment"] = "Created empty file {}".format(name) + ret["comment"] = f"Created empty file {name}" ret["changes"]["new"] = name elif extant and ret["result"]: ret["comment"] = "Updated times on {} {}".format( @@ -7500,7 +7486,7 @@ def copy_( ret = { "name": name, "changes": {}, - "comment": 'Copied "{}" to "{}"'.format(source, name), + "comment": f'Copied "{source}" to "{name}"', "result": True, } if not name: @@ -7508,10 +7494,10 @@ def copy_( changed = True if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") if not os.path.exists(source): - return _error(ret, 'Source file "{}" is not present'.format(source)) + return _error(ret, f'Source file "{source}" is not present') if preserve: user = __salt__["file.get_user"](source) @@ -7570,7 +7556,7 @@ def copy_( except OSError: return _error( ret, - 'Failed to delete "{}" in preparation for forced move'.format(name), + f'Failed to delete "{name}" in preparation for forced move', ) if __opts__["test"]: @@ -7581,15 +7567,13 @@ def copy_( ret["result"] = None else: ret["comment"] = ( - 'The target file "{}" exists and will not be overwritten'.format(name) + f'The target file "{name}" exists and will not be overwritten' ) ret["result"] = True return ret if not changed: - ret["comment"] = ( - 'The target file "{}" exists and will not be overwritten'.format(name) - ) + ret["comment"] = f'The target file "{name}" exists and will not be overwritten' ret["result"] = True return ret @@ -7610,9 +7594,9 @@ def copy_( try: _makedirs(name=name, user=user, group=group, dir_mode=dir_mode) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") else: - return _error(ret, "The target directory {} is not present".format(dname)) + return _error(ret, f"The target directory {dname} is not present") # All tests pass, move the file into place try: if os.path.isdir(source): @@ -7640,7 +7624,7 @@ def copy_( ret["result"] = check_ret["result"] ret["comment"] = check_ret["comment"] except OSError: - return _error(ret, 'Failed to copy "{}" to "{}"'.format(source, name)) + return _error(ret, f'Failed to copy "{source}" to "{name}"') return ret @@ -7674,7 +7658,7 @@ def rename(name, source, force=False, makedirs=False, **kwargs): return _error(ret, "Must provide name to file.rename") if not os.path.isabs(name): - return _error(ret, "Specified file {} is not an absolute path".format(name)) + return _error(ret, f"Specified file {name} is not an absolute path") if not os.path.lexists(source): ret["comment"] = 'Source file "{}" has already been moved out of place'.format( @@ -7685,7 +7669,7 @@ def rename(name, source, force=False, makedirs=False, **kwargs): if os.path.lexists(source) and os.path.lexists(name): if not force: ret["comment"] = ( - 'The target file "{}" exists and will not be overwritten'.format(name) + f'The target file "{name}" exists and will not be overwritten' ) return ret elif not __opts__["test"]: @@ -7695,11 +7679,11 @@ def rename(name, source, force=False, makedirs=False, **kwargs): except OSError: return _error( ret, - 'Failed to delete "{}" in preparation for forced move'.format(name), + f'Failed to delete "{name}" in preparation for forced move', ) if __opts__["test"]: - ret["comment"] = 'File "{}" is set to be moved to "{}"'.format(source, name) + ret["comment"] = f'File "{source}" is set to be moved to "{name}"' ret["result"] = None return ret @@ -7710,9 +7694,9 @@ def rename(name, source, force=False, makedirs=False, **kwargs): try: _makedirs(name=name) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") else: - return _error(ret, "The target directory {} is not present".format(dname)) + return _error(ret, f"The target directory {dname} is not present") # All tests pass, move the file into place try: if os.path.islink(source): @@ -7722,9 +7706,9 @@ def rename(name, source, force=False, makedirs=False, **kwargs): else: shutil.move(source, name) except OSError: - return _error(ret, 'Failed to move "{}" to "{}"'.format(source, name)) + return _error(ret, f'Failed to move "{source}" to "{name}"') - ret["comment"] = 'Moved "{}" to "{}"'.format(source, name) + ret["comment"] = f'Moved "{source}" to "{name}"' ret["changes"] = {name: source} return ret @@ -8054,9 +8038,7 @@ def serialize( if not create: if not os.path.isfile(name): # Don't create a file that is not already present - ret["comment"] = ( - "File {} is not present and is not set for creation".format(name) - ) + ret["comment"] = f"File {name} is not present and is not set for creation" return ret formatter = kwargs.pop("formatter", None) @@ -8082,8 +8064,8 @@ def serialize( ) group = user - serializer_name = "{}.serialize".format(serializer) - deserializer_name = "{}.deserialize".format(serializer) + serializer_name = f"{serializer}.serialize" + deserializer_name = f"{serializer}.deserialize" if serializer_name not in __serializers__: return { @@ -8141,7 +8123,7 @@ def serialize( ) if existing_data == merged_data: ret["result"] = True - ret["comment"] = "The file {} is in the correct state".format(name) + ret["comment"] = f"The file {name} is in the correct state" return ret dataset = merged_data else: @@ -8196,7 +8178,7 @@ def serialize( ret["changes"]["diff"] = "" else: ret["result"] = True - ret["comment"] = "The file {} is in the correct state".format(name) + ret["comment"] = f"The file {name} is in the correct state" else: ret = __salt__["file.manage_file"]( name=name, @@ -8313,7 +8295,7 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): # Check if it is a character device elif not __salt__["file.is_chrdev"](name): if __opts__["test"]: - ret["comment"] = "Character device {} is set to be created".format(name) + ret["comment"] = f"Character device {name} is set to be created" ret["result"] = None else: ret = __salt__["file.mknod"]( @@ -8334,9 +8316,7 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): else: ret = __salt__["file.check_perms"](name, None, user, group, mode)[0] if not ret["changes"]: - ret["comment"] = ( - "Character device {} is in the correct state".format(name) - ) + ret["comment"] = f"Character device {name} is in the correct state" elif ntype == "b": # Check for file existence @@ -8350,7 +8330,7 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): # Check if it is a block device elif not __salt__["file.is_blkdev"](name): if __opts__["test"]: - ret["comment"] = "Block device {} is set to be created".format(name) + ret["comment"] = f"Block device {name} is set to be created" ret["result"] = None else: ret = __salt__["file.mknod"]( @@ -8385,7 +8365,7 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): # Check if it is a fifo elif not __salt__["file.is_fifo"](name): if __opts__["test"]: - ret["comment"] = "Fifo pipe {} is set to be created".format(name) + ret["comment"] = f"Fifo pipe {name} is set to be created" ret["result"] = None else: ret = __salt__["file.mknod"]( @@ -8396,7 +8376,7 @@ def mknod(name, ntype, major=0, minor=0, user=None, group=None, mode="0600"): else: ret = __salt__["file.check_perms"](name, None, user, group, mode)[0] if not ret["changes"]: - ret["comment"] = "Fifo pipe {} is in the correct state".format(name) + ret["comment"] = f"Fifo pipe {name} is in the correct state" else: ret["comment"] = ( @@ -8416,7 +8396,7 @@ def mod_run_check_cmd(cmd, filename, **check_cmd_opts): """ log.debug("running our check_cmd") - _cmd = "{} {}".format(cmd, filename) + _cmd = f"{cmd} {filename}" cret = __salt__["cmd.run_all"](_cmd, **check_cmd_opts) if cret["retcode"] != 0: ret = { @@ -8659,12 +8639,10 @@ def shortcut( uid = __salt__["file.user_to_uid"](user) if uid == "": - preflight_errors.append("User {} does not exist".format(user)) + preflight_errors.append(f"User {user} does not exist") if not os.path.isabs(name): - preflight_errors.append( - "Specified file {} is not an absolute path".format(name) - ) + preflight_errors.append(f"Specified file {name} is not an absolute path") if preflight_errors: msg = ". ".join(preflight_errors) @@ -8686,7 +8664,7 @@ def shortcut( try: _makedirs(name=name, user=user) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") else: return _error( ret, @@ -8715,7 +8693,7 @@ def shortcut( try: _makedirs(name=backupname) except CommandExecutionError as exc: - return _error(ret, "Drive {} is not mapped".format(exc.message)) + return _error(ret, f"Drive {exc.message} is not mapped") else: return _error( ret, @@ -8773,7 +8751,7 @@ def shortcut( ret["comment"] = "Set ownership of shortcut {} to {}".format( name, user ) - ret["changes"]["ownership"] = "{}".format(user) + ret["changes"]["ownership"] = f"{user}" else: ret["result"] = False ret[ @@ -8803,7 +8781,7 @@ def shortcut( ) return ret else: - ret["comment"] = "Created new shortcut {} -> {}".format(name, target) + ret["comment"] = f"Created new shortcut {name} -> {target}" ret["changes"]["new"] = name if not _check_shortcut_ownership(name, user): @@ -8971,15 +8949,13 @@ def cached( if source_sum: hash = __salt__["file.get_hash"](local_copy, __opts__["hash_type"]) if hash == source_sum["hsum"]: - ret["comment"] = "File already cached: {}".format(name) + ret["comment"] = f"File already cached: {name}" else: - ret["comment"] = ( - "Hashes don't match.\nFile will be cached: {}".format(name) - ) + ret["comment"] = f"Hashes don't match.\nFile will be cached: {name}" else: - ret["comment"] = "No hash found. File will be cached: {}".format(name) + ret["comment"] = f"No hash found. File will be cached: {name}" else: - ret["comment"] = "File will be cached: {}".format(name) + ret["comment"] = f"File will be cached: {name}" ret["changes"] = {} ret["result"] = None return ret @@ -9010,10 +8986,10 @@ def cached( return ret else: ret["result"] = True - ret["comment"] = "File {} is present on the minion".format(full_path) + ret["comment"] = f"File {full_path} is present on the minion" return ret else: - ret["comment"] = "File {} is not present on the minion".format(full_path) + ret["comment"] = f"File {full_path} is not present on the minion" return ret local_copy = __salt__["cp.is_cached"](name, saltenv=saltenv) @@ -9091,7 +9067,7 @@ def cached( # We're not enforcing a hash, and we already know that the file was # successfully cached, so we know the state was successful. ret["result"] = True - ret["comment"] = "File is cached to {}".format(local_copy) + ret["comment"] = f"File is cached to {local_copy}" return ret @@ -9139,14 +9115,14 @@ def not_cached(name, saltenv="base"): try: os.remove(local_copy) except Exception as exc: # pylint: disable=broad-except - ret["comment"] = "Failed to delete {}: {}".format(local_copy, exc) + ret["comment"] = f"Failed to delete {local_copy}: {exc}" else: ret["result"] = True ret["changes"]["deleted"] = True - ret["comment"] = "{} was deleted".format(local_copy) + ret["comment"] = f"{local_copy} was deleted" else: ret["result"] = True - ret["comment"] = "{} is not cached".format(name) + ret["comment"] = f"{name} is not cached" return ret @@ -9177,7 +9153,7 @@ def mod_beacon(name, **kwargs): data["recurse"] = _beacon_data.get("recurse", True) data["exclude"] = _beacon_data.get("exclude", []) - beacon_name = "beacon_{}_{}".format(beacon_module, name) + beacon_name = f"beacon_{beacon_module}_{name}" beacon_kwargs = { "name": beacon_name, "files": {name: data}, @@ -9246,7 +9222,7 @@ def pruned(name, recurse=False, ignore_errors=False, older_than=None): if __opts__["test"]: ret["result"] = None ret["changes"]["deleted"] = name - ret["comment"] = "Directory {} is set for removal".format(name) + ret["comment"] = f"Directory {name} is set for removal" return ret res = __salt__["file.rmdir"]( @@ -9256,12 +9232,10 @@ def pruned(name, recurse=False, ignore_errors=False, older_than=None): if result: if recurse and res["deleted"]: - ret["comment"] = ( - "Recursively removed empty directories under {}".format(name) - ) + ret["comment"] = f"Recursively removed empty directories under {name}" ret["changes"]["deleted"] = sorted(res["deleted"]) elif not recurse: - ret["comment"] = "Removed directory {}".format(name) + ret["comment"] = f"Removed directory {name}" ret["changes"]["deleted"] = name return ret elif ignore_errors and res["deleted"]: @@ -9273,8 +9247,8 @@ def pruned(name, recurse=False, ignore_errors=False, older_than=None): ret["result"] = result ret["changes"] = res - ret["comment"] = "Failed to remove directory {}".format(name) + ret["comment"] = f"Failed to remove directory {name}" return ret - ret["comment"] = "Directory {} is not present".format(name) + ret["comment"] = f"Directory {name} is not present" return ret diff --git a/salt/states/firewalld.py b/salt/states/firewalld.py index 2e090326ebc..ac299bcdbe5 100644 --- a/salt/states/firewalld.py +++ b/salt/states/firewalld.py @@ -302,7 +302,7 @@ def service(name, ports=None, protocols=None): try: _current_ports = __salt__["firewalld.get_service_ports"](name) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_ports = set(ports) - set(_current_ports) @@ -313,7 +313,7 @@ def service(name, ports=None, protocols=None): try: __salt__["firewalld.add_service_port"](name, port) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret for port in old_ports: @@ -321,7 +321,7 @@ def service(name, ports=None, protocols=None): try: __salt__["firewalld.remove_service_port"](name, port) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_ports or old_ports: @@ -332,7 +332,7 @@ def service(name, ports=None, protocols=None): try: _current_protocols = __salt__["firewalld.get_service_protocols"](name) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_protocols = set(protocols) - set(_current_protocols) @@ -343,7 +343,7 @@ def service(name, ports=None, protocols=None): try: __salt__["firewalld.add_service_protocol"](name, protocol) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret for protocol in old_protocols: @@ -351,7 +351,7 @@ def service(name, ports=None, protocols=None): try: __salt__["firewalld.remove_service_protocol"](name, protocol) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_protocols or old_protocols: @@ -364,15 +364,15 @@ def service(name, ports=None, protocols=None): ret["result"] = True if ret["changes"] == {}: - ret["comment"] = "'{}' is already in the desired state.".format(name) + ret["comment"] = f"'{name}' is already in the desired state." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Configuration for '{}' will change.".format(name) + ret["comment"] = f"Configuration for '{name}' will change." return ret - ret["comment"] = "'{}' was configured.".format(name) + ret["comment"] = f"'{name}' was configured." return ret @@ -405,7 +405,7 @@ def _present( try: zones = __salt__["firewalld.get_zones"](permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if name not in zones: @@ -413,7 +413,7 @@ def _present( try: __salt__["firewalld.new_zone"](name) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({name: {"old": zones, "new": name}}) @@ -428,14 +428,14 @@ def _present( name, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if block_icmp: try: _valid_icmp_types = __salt__["firewalld.get_icmp_types"](permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret # log errors for invalid ICMP types in block_icmp input @@ -451,7 +451,7 @@ def _present( name, icmp_type, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_block_icmp: @@ -466,7 +466,7 @@ def _present( name, icmp_type, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_icmp_types or old_icmp_types: @@ -484,21 +484,21 @@ def _present( try: default_zone = __salt__["firewalld.default_zone"]() except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if name != default_zone: if not __opts__["test"]: try: __salt__["firewalld.set_default_zone"](name) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({"default": {"old": default_zone, "new": name}}) try: masquerade_ret = __salt__["firewalld.get_masquerade"](name, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if masquerade and not masquerade_ret: @@ -506,7 +506,7 @@ def _present( try: __salt__["firewalld.add_masquerade"](name, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update( {"masquerade": {"old": "", "new": "Masquerading successfully set."}} @@ -516,7 +516,7 @@ def _present( try: __salt__["firewalld.remove_masquerade"](name, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update( {"masquerade": {"old": "", "new": "Masquerading successfully disabled."}} @@ -527,7 +527,7 @@ def _present( try: _current_ports = __salt__["firewalld.list_ports"](name, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_ports = set(ports) - set(_current_ports) @@ -540,7 +540,7 @@ def _present( name, port, permanent=True, force_masquerade=False ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_ports: @@ -550,7 +550,7 @@ def _present( try: __salt__["firewalld.remove_port"](name, port, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_ports or old_ports: @@ -567,7 +567,7 @@ def _present( name, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret port_fwd = [_parse_forward(fwd) for fwd in port_fwd] @@ -597,7 +597,7 @@ def _present( force_masquerade=False, ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_port_fwd: @@ -614,7 +614,7 @@ def _present( permanent=True, ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_port_fwd or old_port_fwd: @@ -638,7 +638,7 @@ def _present( name, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_services = set(services) - set(_current_services) @@ -649,7 +649,7 @@ def _present( try: __salt__["firewalld.add_service"](new_service, name, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_services: @@ -661,7 +661,7 @@ def _present( old_service, name, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_services or old_services: @@ -680,7 +680,7 @@ def _present( name, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_interfaces = set(interfaces) - set(_current_interfaces) @@ -691,7 +691,7 @@ def _present( try: __salt__["firewalld.add_interface"](name, interface, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_interfaces: @@ -703,7 +703,7 @@ def _present( name, interface, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_interfaces or old_interfaces: @@ -720,7 +720,7 @@ def _present( try: _current_sources = __salt__["firewalld.get_sources"](name, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_sources = set(sources) - set(_current_sources) @@ -731,7 +731,7 @@ def _present( try: __salt__["firewalld.add_source"](name, source, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_sources: @@ -743,7 +743,7 @@ def _present( name, source, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_sources or old_sources: @@ -762,7 +762,7 @@ def _present( name, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_rich_rules = set(rich_rules) - set(_current_rich_rules) @@ -773,7 +773,7 @@ def _present( try: __salt__["firewalld.add_rich_rule"](name, rich_rule, permanent=True) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if prune_rich_rules: @@ -785,7 +785,7 @@ def _present( name, rich_rule, permanent=True ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if new_rich_rules or old_rich_rules: @@ -800,7 +800,7 @@ def _present( # No changes if ret["changes"] == {}: ret["result"] = True - ret["comment"] = "'{}' is already in the desired state.".format(name) + ret["comment"] = f"'{name}' is already in the desired state." return ret # test=True and changes predicted @@ -809,7 +809,7 @@ def _present( # build comment string nested.__opts__ = __opts__ comment = [] - comment.append("Configuration for '{}' will change:".format(name)) + comment.append(f"Configuration for '{name}' will change:") comment.append(nested.output(ret["changes"]).rstrip()) ret["comment"] = "\n".join(comment) ret["changes"] = {} @@ -817,5 +817,5 @@ def _present( # Changes were made successfully ret["result"] = True - ret["comment"] = "'{}' was configured.".format(name) + ret["comment"] = f"'{name}' was configured." return ret diff --git a/salt/states/gem.py b/salt/states/gem.py index e5a1ab26b8b..66477e60cff 100644 --- a/salt/states/gem.py +++ b/salt/states/gem.py @@ -118,7 +118,7 @@ def installed( return ret if __opts__["test"]: - ret["comment"] = "The gem {} would have been installed".format(name) + ret["comment"] = f"The gem {name} would have been installed" return ret if __salt__["gem.install"]( name, @@ -169,7 +169,7 @@ def removed(name, ruby=None, user=None, gem_bin=None): return ret if __opts__["test"]: - ret["comment"] = "The gem {} would have been removed".format(name) + ret["comment"] = f"The gem {name} would have been removed" return ret if __salt__["gem.uninstall"](name, ruby, gem_bin=gem_bin, runas=user): ret["result"] = True @@ -203,7 +203,7 @@ def sources_add(name, ruby=None, user=None): ret["comment"] = "Gem source is already added." return ret if __opts__["test"]: - ret["comment"] = "The gem source {} would have been added.".format(name) + ret["comment"] = f"The gem source {name} would have been added." return ret if __salt__["gem.sources_add"](source_uri=name, ruby=ruby, runas=user): ret["result"] = True diff --git a/salt/states/github.py b/salt/states/github.py index b1d3e480f2b..e632cf679a5 100644 --- a/salt/states/github.py +++ b/salt/states/github.py @@ -55,15 +55,15 @@ def present(name, profile="github", **kwargs): # If the user has a valid github handle and is not in the org already if not target: ret["result"] = False - ret["comment"] = "Couldnt find user {}".format(name) + ret["comment"] = f"Couldnt find user {name}" elif isinstance(target, bool) and target: - ret["comment"] = "User {} is already in the org ".format(name) + ret["comment"] = f"User {name} is already in the org " ret["result"] = True elif ( not target.get("in_org", False) and target.get("membership_state") != "pending" ): if __opts__["test"]: - ret["comment"] = "User {} will be added to the org".format(name) + ret["comment"] = f"User {name} will be added to the org" return ret # add the user @@ -71,15 +71,13 @@ def present(name, profile="github", **kwargs): if result: ret["changes"].setdefault("old", None) - ret["changes"].setdefault( - "new", "User {} exists in the org now".format(name) - ) + ret["changes"].setdefault("new", f"User {name} exists in the org now") ret["result"] = True else: ret["result"] = False - ret["comment"] = "Failed to add user {} to the org".format(name) + ret["comment"] = f"Failed to add user {name} to the org" else: - ret["comment"] = "User {} has already been invited.".format(name) + ret["comment"] = f"User {name} has already been invited." ret["result"] = True return ret @@ -110,7 +108,7 @@ def absent(name, profile="github", **kwargs): "name": name, "changes": {}, "result": None, - "comment": "User {} is absent.".format(name), + "comment": f"User {name} is absent.", } target = __salt__["github.get_user"](name, profile=profile, **kwargs) @@ -118,25 +116,25 @@ def absent(name, profile="github", **kwargs): if target: if isinstance(target, bool) or target.get("in_org", False): if __opts__["test"]: - ret["comment"] = "User {} will be deleted".format(name) + ret["comment"] = f"User {name} will be deleted" ret["result"] = None return ret result = __salt__["github.remove_user"](name, profile=profile, **kwargs) if result: - ret["comment"] = "Deleted user {}".format(name) - ret["changes"].setdefault("old", "User {} exists".format(name)) - ret["changes"].setdefault("new", "User {} deleted".format(name)) + ret["comment"] = f"Deleted user {name}" + ret["changes"].setdefault("old", f"User {name} exists") + ret["changes"].setdefault("new", f"User {name} deleted") ret["result"] = True else: - ret["comment"] = "Failed to delete {}".format(name) + ret["comment"] = f"Failed to delete {name}" ret["result"] = False else: - ret["comment"] = "User {} has already been deleted!".format(name) + ret["comment"] = f"User {name} has already been deleted!" ret["result"] = True else: - ret["comment"] = "User {} does not exist".format(name) + ret["comment"] = f"User {name} does not exist" ret["result"] = True return ret @@ -153,7 +151,7 @@ def team_present( enforce_mfa=False, no_mfa_grace_seconds=0, profile="github", - **kwargs + **kwargs, ): """ Ensure a team is present @@ -229,7 +227,7 @@ def team_present( if len(parameters) > 0: if __opts__["test"]: test_comments.append( - "Team properties are set to be edited: {}".format(parameters) + f"Team properties are set to be edited: {parameters}" ) ret["result"] = None else: @@ -238,7 +236,7 @@ def team_present( ) if result: ret["changes"]["team"] = { - "old": "Team properties were {}".format(target), + "old": f"Team properties were {target}", "new": "Team properties (that changed) are {}".format( parameters ), @@ -272,8 +270,8 @@ def team_present( ) if result: ret["changes"][repo_name] = { - "old": "Repo {} is not in team {}".format(repo_name, name), - "new": "Repo {} is in team {}".format(repo_name, name), + "old": f"Repo {repo_name} is not in team {name}", + "new": f"Repo {repo_name} is in team {name}", } else: ret["result"] = False @@ -297,8 +295,8 @@ def team_present( ) if result: ret["changes"][repo_name] = { - "old": "Repo {} is in team {}".format(repo_name, name), - "new": "Repo {} is not in team {}".format(repo_name, name), + "old": f"Repo {repo_name} is in team {name}", + "new": f"Repo {repo_name} is not in team {name}", } else: ret["result"] = False @@ -311,7 +309,7 @@ def team_present( else: # Team does not exist - it will be created. if __opts__["test"]: - ret["comment"] = "Team {} is set to be created.".format(name) + ret["comment"] = f"Team {name} is set to be created." ret["result"] = None return ret @@ -322,15 +320,15 @@ def team_present( permission=permission, privacy=privacy, profile=profile, - **kwargs + **kwargs, ) if result: ret["changes"]["team"] = {} ret["changes"]["team"]["old"] = None - ret["changes"]["team"]["new"] = "Team {} has been created".format(name) + ret["changes"]["team"]["new"] = f"Team {name} has been created" else: ret["result"] = False - ret["comment"] = "Failed to create team {}.".format(name) + ret["comment"] = f"Failed to create team {name}." return ret manage_members = members is not None @@ -363,9 +361,7 @@ def team_present( else: # Add to team member_change = True if __opts__["test"]: - test_comments.append( - "User {} set to be added to the team.".format(member) - ) + test_comments.append(f"User {member} set to be added to the team.") ret["result"] = None else: result = __salt__["github.add_team_member"]( @@ -373,9 +369,9 @@ def team_present( ) if result: ret["changes"][member] = {} - ret["changes"][member]["old"] = ( - "User {} is not in team {}".format(member, name) - ) + ret["changes"][member][ + "old" + ] = f"User {member} is not in team {name}" ret["changes"][member]["new"] = "User {} is in team {}".format( member, name ) @@ -407,7 +403,7 @@ def team_present( ) else: test_comments.append( - "User {} set to be removed from the team.".format(member) + f"User {member} set to be removed from the team." ) ret["result"] = None else: @@ -417,7 +413,7 @@ def team_present( if result: extra_changes = " due to MFA violation" if mfa_violation else "" ret["changes"][member] = { - "old": "User {} is in team {}".format(member, name), + "old": f"User {member} is in team {name}", "new": "User {} is not in team {}{}".format( member, name, extra_changes ), @@ -473,24 +469,24 @@ def team_absent(name, profile="github", **kwargs): target = __salt__["github.get_team"](name, profile=profile, **kwargs) if not target: - ret["comment"] = "Team {} does not exist".format(name) + ret["comment"] = f"Team {name} does not exist" ret["result"] = True return ret else: if __opts__["test"]: - ret["comment"] = "Team {} will be deleted".format(name) + ret["comment"] = f"Team {name} will be deleted" ret["result"] = None return ret result = __salt__["github.remove_team"](name, profile=profile, **kwargs) if result: - ret["comment"] = "Deleted team {}".format(name) - ret["changes"].setdefault("old", "Team {} exists".format(name)) - ret["changes"].setdefault("new", "Team {} deleted".format(name)) + ret["comment"] = f"Deleted team {name}" + ret["changes"].setdefault("old", f"Team {name} exists") + ret["changes"].setdefault("new", f"Team {name} deleted") ret["result"] = True else: - ret["comment"] = "Failed to delete {}".format(name) + ret["comment"] = f"Failed to delete {name}" ret["result"] = False return ret @@ -508,7 +504,7 @@ def repo_present( license_template=None, teams=None, profile="github", - **kwargs + **kwargs, ): """ Ensure a repository is present @@ -605,8 +601,8 @@ def repo_present( if len(parameters) > 0: repo_change = { - "old": "Repo properties were {}".format(old_parameters), - "new": "Repo properties (that changed) are {}".format(parameters), + "old": f"Repo properties were {old_parameters}", + "new": f"Repo properties (that changed) are {parameters}", } if __opts__["test"]: ret["changes"]["repo"] = repo_change @@ -623,7 +619,7 @@ def repo_present( return ret else: # Repo does not exist - it will be created. - repo_change = {"old": None, "new": "Repo {} has been created".format(name)} + repo_change = {"old": None, "new": f"Repo {name} has been created"} if __opts__["test"]: ret["changes"]["repo"] = repo_change ret["result"] = None @@ -634,7 +630,7 @@ def repo_present( if not result: ret["result"] = False - ret["comment"] = "Failed to create repo {}.".format(name) + ret["comment"] = f"Failed to create repo {name}." return ret # Turns out that trying to fetch teams for a new repo can 404 immediately @@ -652,7 +648,7 @@ def repo_present( if current_teams is None: ret["result"] = False - ret["comment"] = "Failed to verify repo {} after creation.".format(name) + ret["comment"] = f"Failed to verify repo {name} after creation." return ret ret["changes"]["repo"] = repo_change @@ -669,8 +665,8 @@ def repo_present( for team_name in current_team_names: if team_name not in teams: team_change = { - "old": "Repo {} is in team {}".format(name, team_name), - "new": "Repo {} is not in team {}".format(name, team_name), + "old": f"Repo {name} is in team {team_name}", + "new": f"Repo {name} is not in team {team_name}", } if __opts__["test"]: @@ -695,8 +691,8 @@ def repo_present( for team_name, permission in teams.items(): if team_name not in current_team_names: # Need to add repo to team team_change = { - "old": "Repo {} is not in team {}".format(name, team_name), - "new": "Repo {} is in team {}".format(name, team_name), + "old": f"Repo {name} is not in team {team_name}", + "new": f"Repo {name} is in team {team_name}", } if __opts__["test"]: ret["changes"][team_name] = team_change @@ -783,21 +779,21 @@ def repo_absent(name, profile="github", **kwargs): target = None if not target: - ret["comment"] = "Repo {} does not exist".format(name) + ret["comment"] = f"Repo {name} does not exist" ret["result"] = True return ret else: if __opts__["test"]: - ret["comment"] = "Repo {} will be deleted".format(name) + ret["comment"] = f"Repo {name} will be deleted" ret["result"] = None return ret result = __salt__["github.remove_repo"](name, profile=profile, **kwargs) if result: - ret["comment"] = "Deleted repo {}".format(name) - ret["changes"].setdefault("old", "Repo {} exists".format(name)) - ret["changes"].setdefault("new", "Repo {} deleted".format(name)) + ret["comment"] = f"Deleted repo {name}" + ret["changes"].setdefault("old", f"Repo {name} exists") + ret["changes"].setdefault("new", f"Repo {name} deleted") ret["result"] = True else: ret["comment"] = ( diff --git a/salt/states/glance_image.py b/salt/states/glance_image.py index 385244cb7be..b65ec5f353c 100644 --- a/salt/states/glance_image.py +++ b/salt/states/glance_image.py @@ -60,7 +60,7 @@ def present(name, auth=None, **kwargs): if __opts__["test"]: ret["result"] = None ret["changes"] = kwargs - ret["comment"] = "Image {} will be created.".format(name) + ret["comment"] = f"Image {name} will be created." return ret kwargs["name"] = name @@ -90,7 +90,7 @@ def absent(name, auth=None): if __opts__["test"]: ret["result"] = None ret["changes"] = {"name": name} - ret["comment"] = "Image {} will be deleted.".format(name) + ret["comment"] = f"Image {name} will be deleted." return ret __salt__["glanceng.image_delete"](name=image) diff --git a/salt/states/glassfish.py b/salt/states/glassfish.py index 913b7da2fb5..30778d17729 100644 --- a/salt/states/glassfish.py +++ b/salt/states/glassfish.py @@ -82,7 +82,7 @@ def _do_element_present(name, elem_type, data, server=None): """ ret = {"changes": {}, "update": False, "create": False, "error": None} try: - elements = __salt__["glassfish.enum_{}".format(elem_type)]() + elements = __salt__[f"glassfish.enum_{elem_type}"]() except requests.ConnectionError as error: if __opts__["test"]: ret["changes"] = {"Name": name, "Params": data} @@ -97,23 +97,19 @@ def _do_element_present(name, elem_type, data, server=None): ret["create"] = True if not __opts__["test"]: try: - __salt__["glassfish.create_{}".format(elem_type)]( - name, server=server, **data - ) + __salt__[f"glassfish.create_{elem_type}"](name, server=server, **data) except CommandExecutionError as error: ret["error"] = error return ret elif elements and any(data): - current_data = __salt__["glassfish.get_{}".format(elem_type)]( - name, server=server - ) + current_data = __salt__[f"glassfish.get_{elem_type}"](name, server=server) data_diff = _is_updated(current_data, data) if data_diff: ret["update"] = True ret["changes"] = data_diff if not __opts__["test"]: try: - __salt__["glassfish.update_{}".format(elem_type)]( + __salt__[f"glassfish.update_{elem_type}"]( name, server=server, **data ) except CommandExecutionError as error: @@ -127,7 +123,7 @@ def _do_element_absent(name, elem_type, data, server=None): """ ret = {"delete": False, "error": None} try: - elements = __salt__["glassfish.enum_{}".format(elem_type)]() + elements = __salt__[f"glassfish.enum_{elem_type}"]() except requests.ConnectionError as error: if __opts__["test"]: ret["create"] = True @@ -140,9 +136,7 @@ def _do_element_absent(name, elem_type, data, server=None): ret["delete"] = True if not __opts__["test"]: try: - __salt__["glassfish.delete_{}".format(elem_type)]( - name, server=server, **data - ) + __salt__[f"glassfish.delete_{elem_type}"](name, server=server, **data) except CommandExecutionError as error: ret["error"] = error return ret @@ -208,7 +202,7 @@ def connection_factory_present( # Manage parameters pool_data = {} res_data = {} - pool_name = "{}-Connection-Pool".format(name) + pool_name = f"{name}-Connection-Pool" if restype == "topic_connection_factory": pool_data["connectionDefinitionName"] = "javax.jms.TopicConnectionFactory" elif restype == "queue_connection_factory": @@ -285,7 +279,7 @@ def connection_factory_absent(name, both=True, server=None): Delete both the pool and the resource, defaults to ``true`` """ ret = {"name": name, "result": None, "comment": None, "changes": {}} - pool_name = "{}-Connection-Pool".format(name) + pool_name = f"{name}-Connection-Pool" pool_ret = _do_element_absent( pool_name, "connector_c_pool", {"cascade": both}, server ) @@ -466,7 +460,7 @@ def jdbc_datasource_present( ret = {"name": name, "result": None, "comment": None, "changes": {}} # Manage parameters - res_name = "jdbc/{}".format(name) + res_name = f"jdbc/{name}" pool_data = {} pool_data_properties = {} res_data = {} diff --git a/salt/states/glusterfs.py b/salt/states/glusterfs.py index aefe8499960..331053d2550 100644 --- a/salt/states/glusterfs.py +++ b/salt/states/glusterfs.py @@ -83,11 +83,11 @@ def peered(name): if peers and any(name in v["hostnames"] for v in peers.values()): ret["result"] = True - ret["comment"] = "Host {} already peered".format(name) + ret["comment"] = f"Host {name} already peered" return ret if __opts__["test"]: - ret["comment"] = "Peer {} will be added.".format(name) + ret["comment"] = f"Peer {name} will be added." ret["result"] = None return ret @@ -101,7 +101,7 @@ def peered(name): newpeers = __salt__["glusterfs.peer_status"]() if newpeers and any(name in v["hostnames"] for v in newpeers.values()): ret["result"] = True - ret["comment"] = "Host {} successfully peered".format(name) + ret["comment"] = f"Host {name} successfully peered" ret["changes"] = {"new": newpeers, "old": peers} else: ret["comment"] = ( @@ -181,7 +181,7 @@ def volume_present( volumes = __salt__["glusterfs.list_volumes"]() if name not in volumes: if __opts__["test"]: - comment = "Volume {} will be created".format(name) + comment = f"Volume {name} will be created" if start: comment += " and started" ret["comment"] = comment @@ -193,16 +193,16 @@ def volume_present( ) if not vol_created: - ret["comment"] = "Creation of volume {} failed".format(name) + ret["comment"] = f"Creation of volume {name} failed" return ret old_volumes = volumes volumes = __salt__["glusterfs.list_volumes"]() if name in volumes: ret["changes"] = {"new": volumes, "old": old_volumes} - ret["comment"] = "Volume {} is created".format(name) + ret["comment"] = f"Volume {name} is created" else: - ret["comment"] = "Volume {} already exists".format(name) + ret["comment"] = f"Volume {name} already exists" if start: if __opts__["test"]: @@ -251,26 +251,26 @@ def started(name): volinfo = __salt__["glusterfs.info"]() if name not in volinfo: ret["result"] = False - ret["comment"] = "Volume {} does not exist".format(name) + ret["comment"] = f"Volume {name} does not exist" return ret if int(volinfo[name]["status"]) == 1: - ret["comment"] = "Volume {} is already started".format(name) + ret["comment"] = f"Volume {name} is already started" ret["result"] = True return ret elif __opts__["test"]: - ret["comment"] = "Volume {} will be started".format(name) + ret["comment"] = f"Volume {name} will be started" ret["result"] = None return ret vol_started = __salt__["glusterfs.start_volume"](name) if vol_started: ret["result"] = True - ret["comment"] = "Volume {} is started".format(name) + ret["comment"] = f"Volume {name} is started" ret["change"] = {"new": "started", "old": "stopped"} else: ret["result"] = False - ret["comment"] = "Failed to start volume {}".format(name) + ret["comment"] = f"Failed to start volume {name}" return ret @@ -304,23 +304,23 @@ def add_volume_bricks(name, bricks): volinfo = __salt__["glusterfs.info"]() if name not in volinfo: - ret["comment"] = "Volume {} does not exist".format(name) + ret["comment"] = f"Volume {name} does not exist" return ret if int(volinfo[name]["status"]) != 1: - ret["comment"] = "Volume {} is not started".format(name) + ret["comment"] = f"Volume {name} is not started" return ret current_bricks = [brick["path"] for brick in volinfo[name]["bricks"].values()] if not set(bricks) - set(current_bricks): ret["result"] = True - ret["comment"] = "Bricks already added in volume {}".format(name) + ret["comment"] = f"Bricks already added in volume {name}" return ret bricks_added = __salt__["glusterfs.add_volume_bricks"](name, bricks) if bricks_added: ret["result"] = True - ret["comment"] = "Bricks successfully added to volume {}".format(name) + ret["comment"] = f"Bricks successfully added to volume {name}" new_bricks = [ brick["path"] for brick in __salt__["glusterfs.info"]()[name]["bricks"].values() @@ -328,7 +328,7 @@ def add_volume_bricks(name, bricks): ret["changes"] = {"new": new_bricks, "old": current_bricks} return ret - ret["comment"] = "Adding bricks to volume {} failed".format(name) + ret["comment"] = f"Adding bricks to volume {name} failed" return ret diff --git a/salt/states/gnomedesktop.py b/salt/states/gnomedesktop.py index 24c9df87796..6fb3c222a1b 100644 --- a/salt/states/gnomedesktop.py +++ b/salt/states/gnomedesktop.py @@ -68,12 +68,12 @@ def _do(name, gnome_kwargs, preferences): gnome_kwargs.update({"key": key, "value": value}) if _check_current_value(gnome_kwargs, value): - messages.append("{} is already set to {}".format(key, value)) + messages.append(f"{key} is already set to {value}") else: result = __salt__["gnome.set"](**gnome_kwargs) if result["retcode"] == 0: - messages.append("Setting {} to {}".format(key, value)) - ret["changes"][key] = "{}:{}".format(key, value) + messages.append(f"Setting {key} to {value}") + ret["changes"][key] = f"{key}:{value}" ret["result"] = True else: messages.append(result["stdout"]) @@ -108,7 +108,7 @@ def wm_preferences( visual_bell=None, visual_bell_type=None, workspace_names=None, - **kwargs + **kwargs, ): """ wm_preferences: sets values in the org.gnome.desktop.wm.preferences schema @@ -160,7 +160,7 @@ def desktop_lockdown( disable_save_to_disk=None, disable_user_switching=None, user_administration_disabled=None, - **kwargs + **kwargs, ): """ desktop_lockdown: sets values in the org.gnome.desktop.lockdown schema @@ -227,7 +227,7 @@ def desktop_interface( toolbar_icons_size=None, toolbar_style=None, toolkit_accessibility=None, - **kwargs + **kwargs, ): """ desktop_interface: sets values in the org.gnome.desktop.interface schema diff --git a/salt/states/gpg.py b/salt/states/gpg.py index bde4b3beeda..fb964f7425b 100644 --- a/salt/states/gpg.py +++ b/salt/states/gpg.py @@ -91,7 +91,7 @@ def present( ret["comment"].append(result["comment"]) else: ret["comment"].append( - "Set trust level for {} to {}".format(key, trust) + f"Set trust level for {key} to {trust}" ) else: ret["comment"].append( @@ -100,9 +100,9 @@ def present( ) ) else: - ret["comment"].append("Invalid trust level {}".format(trust)) + ret["comment"].append(f"Invalid trust level {trust}") - ret["comment"].append("GPG Public Key {} already in keychain ".format(key)) + ret["comment"].append(f"GPG Public Key {key} already in keychain ") else: result = __salt__["gpg.receive_keys"]( @@ -115,7 +115,7 @@ def present( ret["result"] = result["result"] ret["comment"].append(result["comment"]) else: - ret["comment"].append("Adding {} to GPG keychain".format(name)) + ret["comment"].append(f"Adding {name} to GPG keychain") if trust: if trust in _VALID_TRUST_VALUES: @@ -128,11 +128,9 @@ def present( ret["result"] = result["result"] ret["comment"].append(result["comment"]) else: - ret["comment"].append( - "Set trust level for {} to {}".format(key, trust) - ) + ret["comment"].append(f"Set trust level for {key} to {trust}") else: - ret["comment"].append("Invalid trust level {}".format(trust)) + ret["comment"].append(f"Invalid trust level {trust}") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -181,8 +179,8 @@ def absent(name, keys=None, user=None, gnupghome=None, **kwargs): ret["result"] = result["result"] ret["comment"].append(result["comment"]) else: - ret["comment"].append("Deleting {} from GPG keychain".format(name)) + ret["comment"].append(f"Deleting {name} from GPG keychain") else: - ret["comment"].append("{} not found in GPG keychain".format(name)) + ret["comment"].append(f"{name} not found in GPG keychain") ret["comment"] = "\n".join(ret["comment"]) return ret diff --git a/salt/states/grafana.py b/salt/states/grafana.py index e061b916fb2..b25a1d93d3c 100644 --- a/salt/states/grafana.py +++ b/salt/states/grafana.py @@ -189,7 +189,7 @@ def _parse_profile(profile): if isinstance(profile, str): _profile = __salt__["config.option"](profile) if not _profile: - msg = "Pillar key for profile {} not found.".format(profile) + msg = f"Pillar key for profile {profile} not found." raise SaltInvocationError(msg) else: _profile = profile @@ -292,7 +292,7 @@ def dashboard_present( " dashboard template was provided." ) if __opts__["test"]: - ret["comment"] = "Dashboard {} is set to be created.".format(name) + ret["comment"] = f"Dashboard {name} is set to be created." ret["result"] = None return ret _dashboard = dashboard @@ -330,12 +330,12 @@ def dashboard_present( update_rows.append(title) if not update_rows: ret["result"] = True - ret["comment"] = "Dashboard {} is up to date".format(name) + ret["comment"] = f"Dashboard {name} is up to date" return ret if __opts__["test"]: - msg = "Dashboard {} is set to be updated.".format(name) + msg = f"Dashboard {name} is set to be updated." if update_rows: - msg = "{} The following rows set to be updated: {}".format(msg, update_rows) + msg = f"{msg} The following rows set to be updated: {update_rows}" ret["comment"] = msg return ret body = { @@ -350,13 +350,13 @@ def dashboard_present( if updated: ret["result"] = True ret["changes"]["changed"] = name - msg = "Updated dashboard {}.".format(name) + msg = f"Updated dashboard {name}." if update_rows: - msg = "{} The following rows were updated: {}".format(msg, update_rows) + msg = f"{msg} The following rows were updated: {update_rows}" ret["comment"] = msg else: ret["result"] = False - msg = "Failed to update dashboard {}.".format(name) + msg = f"Failed to update dashboard {name}." ret["comment"] = msg return ret @@ -385,7 +385,7 @@ def dashboard_absent(name, hosts=None, profile="grafana"): if exists: if __opts__["test"]: - ret["comment"] = "Dashboard {} is set to be removed.".format(name) + ret["comment"] = f"Dashboard {name} is set to be removed." return ret deleted = __salt__["elasticsearch.delete"]( index=index, doc_type="dashboard", id=name, hosts=hosts @@ -396,9 +396,9 @@ def dashboard_absent(name, hosts=None, profile="grafana"): ret["changes"]["new"] = None else: ret["result"] = False - ret["comment"] = "Failed to delete {} dashboard.".format(name) + ret["comment"] = f"Failed to delete {name} dashboard." else: ret["result"] = True - ret["comment"] = "Dashboard {} does not exist.".format(name) + ret["comment"] = f"Dashboard {name} does not exist." return ret diff --git a/salt/states/grafana4_dashboard.py b/salt/states/grafana4_dashboard.py index fa3414ae6b4..43d88734852 100644 --- a/salt/states/grafana4_dashboard.py +++ b/salt/states/grafana4_dashboard.py @@ -138,15 +138,15 @@ def present( if not old_dashboard: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Dashboard {} is set to be created.".format(name) + ret["comment"] = f"Dashboard {name} is set to be created." return ret response = __salt__["grafana4.create_update_dashboard"]( dashboard=new_dashboard, overwrite=True, profile=profile ) if response.get("status") == "success": - ret["comment"] = "Dashboard {} created.".format(name) - ret["changes"]["new"] = "Dashboard {} created.".format(name) + ret["comment"] = f"Dashboard {name} created." + ret["changes"]["new"] = f"Dashboard {name} created." else: ret["result"] = False ret["comment"] = "Failed to create dashboard {}, response={}".format( @@ -191,7 +191,7 @@ def present( dashboard_diff = DictDiffer( _cleaned(updated_dashboard), _cleaned(old_dashboard) ) - ret["comment"] = "Dashboard {} updated.".format(name) + ret["comment"] = f"Dashboard {name} updated." ret["changes"] = _dashboard_diff( _cleaned(new_dashboard), _cleaned(old_dashboard) ) @@ -229,12 +229,12 @@ def absent(name, orgname=None, profile="grafana"): if existing_dashboard: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Dashboard {} is set to be deleted.".format(name) + ret["comment"] = f"Dashboard {name} is set to be deleted." return ret __salt__["grafana4.delete_dashboard"](name, profile=profile) - ret["comment"] = "Dashboard {} deleted.".format(name) - ret["changes"]["new"] = "Dashboard {} deleted.".format(name) + ret["comment"] = f"Dashboard {name} deleted." + ret["changes"]["new"] = f"Dashboard {name} deleted." return ret ret["comment"] = "Dashboard absent" diff --git a/salt/states/grafana4_datasource.py b/salt/states/grafana4_datasource.py index b0ebe8d02d3..b3b2503071c 100644 --- a/salt/states/grafana4_datasource.py +++ b/salt/states/grafana4_datasource.py @@ -152,12 +152,12 @@ def present( if not datasource: if __opts__["test"]: - ret["comment"] = "Datasource {} will be created".format(name) + ret["comment"] = f"Datasource {name} will be created" return ret __salt__["grafana4.create_datasource"](profile=profile, **data) datasource = __salt__["grafana4.get_datasource"](name, profile=profile) ret["result"] = True - ret["comment"] = "New data source {} added".format(name) + ret["comment"] = f"New data source {name} added" ret["changes"] = data return ret @@ -168,16 +168,16 @@ def present( datasource[key] = None if data == datasource: - ret["comment"] = "Data source {} already up-to-date".format(name) + ret["comment"] = f"Data source {name} already up-to-date" return ret if __opts__["test"]: - ret["comment"] = "Datasource {} will be updated".format(name) + ret["comment"] = f"Datasource {name} will be updated" return ret __salt__["grafana4.update_datasource"](datasource["id"], profile=profile, **data) ret["result"] = True ret["changes"] = deep_diff(datasource, data, ignore=["id", "orgId", "readOnly"]) - ret["comment"] = "Data source {} updated".format(name) + ret["comment"] = f"Data source {name} updated" return ret @@ -203,17 +203,17 @@ def absent(name, orgname=None, profile="grafana"): if not datasource: ret["result"] = True - ret["comment"] = "Data source {} already absent".format(name) + ret["comment"] = f"Data source {name} already absent" return ret if __opts__["test"]: - ret["comment"] = "Datasource {} will be deleted".format(name) + ret["comment"] = f"Datasource {name} will be deleted" return ret __salt__["grafana4.delete_datasource"](datasource["id"], profile=profile) ret["result"] = True ret["changes"][name] = "Absent" - ret["comment"] = "Data source {} was deleted".format(name) + ret["comment"] = f"Data source {name} was deleted" return ret diff --git a/salt/states/grafana4_org.py b/salt/states/grafana4_org.py index 8d4aa5e1da9..c0167637e8e 100644 --- a/salt/states/grafana4_org.py +++ b/salt/states/grafana4_org.py @@ -130,12 +130,12 @@ def present( if create: if __opts__["test"]: - ret["comment"] = "Org {} will be created".format(name) + ret["comment"] = f"Org {name} will be created" return ret __salt__["grafana4.create_org"](profile=profile, name=name) org = __salt__["grafana4.get_org"](name, profile) ret["changes"] = org - ret["comment"] = "New org {} added".format(name) + ret["comment"] = f"New org {name} added" data = _get_json_data( address1=address1, @@ -148,7 +148,7 @@ def present( ) if data != org["address"]: if __opts__["test"]: - ret["comment"] = "Org {} address will be updated".format(name) + ret["comment"] = f"Org {name} address will be updated" return ret __salt__["grafana4.update_org_address"](name, profile=profile, **data) if create: @@ -165,7 +165,7 @@ def present( ) if data != prefs: if __opts__["test"]: - ret["comment"] = "Org {} prefs will be updated".format(name) + ret["comment"] = f"Org {name} prefs will be updated" return ret __salt__["grafana4.update_org_prefs"](name, profile=profile, **data) if create: @@ -227,10 +227,10 @@ def present( ret["result"] = True if not create: if ret["changes"]: - ret["comment"] = "Org {} updated".format(name) + ret["comment"] = f"Org {name} updated" else: ret["changes"] = {} - ret["comment"] = "Org {} already up-to-date".format(name) + ret["comment"] = f"Org {name} already up-to-date" return ret @@ -254,17 +254,17 @@ def absent(name, profile="grafana"): if not org: ret["result"] = True - ret["comment"] = "Org {} already absent".format(name) + ret["comment"] = f"Org {name} already absent" return ret if __opts__["test"]: - ret["comment"] = "Org {} will be deleted".format(name) + ret["comment"] = f"Org {name} will be deleted" return ret __salt__["grafana4.delete_org"](org["id"], profile=profile) ret["result"] = True ret["changes"][name] = "Absent" - ret["comment"] = "Org {} was deleted".format(name) + ret["comment"] = f"Org {name} was deleted" return ret diff --git a/salt/states/grafana4_user.py b/salt/states/grafana4_user.py index 813c4e5aae4..30c4c1e83f3 100644 --- a/salt/states/grafana4_user.py +++ b/salt/states/grafana4_user.py @@ -85,7 +85,7 @@ def present( if create: if __opts__["test"]: - ret["comment"] = "User {} will be created".format(name) + ret["comment"] = f"User {name} will be created" return ret __salt__["grafana4.create_user"]( login=name, password=password, email=email, name=fullname, profile=profile @@ -101,7 +101,7 @@ def present( login=None, email=None, name=None, theme=None, defaults=user_data ): if __opts__["test"]: - ret["comment"] = "User {} will be updated".format(name) + ret["comment"] = f"User {name} will be updated" return ret __salt__["grafana4.update_user"](user["id"], profile=profile, **data) dictupdate.update( @@ -111,7 +111,7 @@ def present( if user["isAdmin"] != is_admin: if __opts__["test"]: - ret["comment"] = "User {} isAdmin status will be updated".format(name) + ret["comment"] = f"User {name} isAdmin status will be updated" return ret __salt__["grafana4.update_user_permissions"]( user["id"], isGrafanaAdmin=is_admin, profile=profile @@ -124,13 +124,13 @@ def present( ret["result"] = True if create: ret["changes"] = ret["changes"]["new"] - ret["comment"] = "New user {} added".format(name) + ret["comment"] = f"New user {name} added" else: if ret["changes"]: - ret["comment"] = "User {} updated".format(name) + ret["comment"] = f"User {name} updated" else: ret["changes"] = {} - ret["comment"] = "User {} already up-to-date".format(name) + ret["comment"] = f"User {name} already up-to-date" return ret @@ -154,7 +154,7 @@ def absent(name, profile="grafana"): if user: if __opts__["test"]: - ret["comment"] = "User {} will be deleted".format(name) + ret["comment"] = f"User {name} will be deleted" return ret orgs = __salt__["grafana4.get_user_orgs"](user["id"], profile=profile) __salt__["grafana4.delete_user"](user["id"], profile=profile) @@ -171,12 +171,12 @@ def absent(name, profile="grafana"): ) else: ret["result"] = True - ret["comment"] = "User {} already absent".format(name) + ret["comment"] = f"User {name} already absent" return ret ret["result"] = True ret["changes"][name] = "Absent" - ret["comment"] = "User {} was deleted".format(name) + ret["comment"] = f"User {name} was deleted" return ret diff --git a/salt/states/grafana_dashboard.py b/salt/states/grafana_dashboard.py index 143eb35c134..4a1dc14ae54 100644 --- a/salt/states/grafana_dashboard.py +++ b/salt/states/grafana_dashboard.py @@ -121,18 +121,18 @@ def present( _ensure_annotations(new_dashboard) # Create dashboard if it does not exist - url = "db/{}".format(name) + url = f"db/{name}" old_dashboard = _get(url, profile) if not old_dashboard: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Dashboard {} is set to be created.".format(name) + ret["comment"] = f"Dashboard {name} is set to be created." return ret response = _update(new_dashboard, profile) if response.get("status") == "success": - ret["comment"] = "Dashboard {} created.".format(name) - ret["changes"]["new"] = "Dashboard {} created.".format(name) + ret["comment"] = f"Dashboard {name} created." + ret["changes"]["new"] = f"Dashboard {name} created." else: ret["result"] = False ret["comment"] = "Failed to create dashboard {}, response={}".format( @@ -173,7 +173,7 @@ def present( dashboard_diff = DictDiffer( _cleaned(updated_dashboard), _cleaned(old_dashboard) ) - ret["comment"] = "Dashboard {} updated.".format(name) + ret["comment"] = f"Dashboard {name} updated." ret["changes"] = _dashboard_diff( _cleaned(new_dashboard), _cleaned(old_dashboard) ) @@ -203,17 +203,17 @@ def absent(name, profile="grafana"): if isinstance(profile, str): profile = __salt__["config.option"](profile) - url = "db/{}".format(name) + url = f"db/{name}" existing_dashboard = _get(url, profile) if existing_dashboard: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Dashboard {} is set to be deleted.".format(name) + ret["comment"] = f"Dashboard {name} is set to be deleted." return ret _delete(url, profile) - ret["comment"] = "Dashboard {} deleted.".format(name) - ret["changes"]["new"] = "Dashboard {} deleted.".format(name) + ret["comment"] = f"Dashboard {name} deleted." + ret["changes"]["new"] = f"Dashboard {name} deleted." return ret ret["comment"] = "Dashboard absent" diff --git a/salt/states/grafana_datasource.py b/salt/states/grafana_datasource.py index e513802c890..9daf0efa79f 100644 --- a/salt/states/grafana_datasource.py +++ b/salt/states/grafana_datasource.py @@ -110,10 +110,10 @@ def present( ret["result"] = True ret["changes"] = _diff(datasource, data) if ret["changes"]["new"] or ret["changes"]["old"]: - ret["comment"] = "Data source {} updated".format(name) + ret["comment"] = f"Data source {name} updated" else: ret["changes"] = {} - ret["comment"] = "Data source {} already up-to-date".format(name) + ret["comment"] = f"Data source {name} already up-to-date" else: requests.post( "{}/api/datasources".format(profile["grafana_url"]), @@ -122,7 +122,7 @@ def present( timeout=profile.get("grafana_timeout", 3), ) ret["result"] = True - ret["comment"] = "New data source {} added".format(name) + ret["comment"] = f"New data source {name} added" ret["changes"] = data return ret @@ -143,7 +143,7 @@ def absent(name, profile="grafana"): if not datasource: ret["result"] = True - ret["comment"] = "Data source {} already absent".format(name) + ret["comment"] = f"Data source {name} already absent" return ret requests.delete( @@ -153,7 +153,7 @@ def absent(name, profile="grafana"): ) ret["result"] = True - ret["comment"] = "Data source {} was deleted".format(name) + ret["comment"] = f"Data source {name} was deleted" return ret diff --git a/salt/states/grains.py b/salt/states/grains.py index 8ffe5fe3cc9..2dd675255c7 100644 --- a/salt/states/grains.py +++ b/salt/states/grains.py @@ -125,15 +125,15 @@ def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False): if __opts__["test"]: ret["result"] = None if existing is _non_existent: - ret["comment"] = "Grain {} is set to be added".format(name) + ret["comment"] = f"Grain {name} is set to be added" ret["changes"] = {"new": name} else: - ret["comment"] = "Grain {} is set to be changed".format(name) + ret["comment"] = f"Grain {name} is set to be changed" ret["changes"] = {"changed": {name: value}} return ret ret = __salt__["grains.set"](name, value, force=force) if ret["result"] is True and ret["changes"] != {}: - ret["comment"] = "Set grain {} to {}".format(name, value) + ret["comment"] = f"Set grain {name} to {value}" ret["name"] = name return ret @@ -182,13 +182,13 @@ def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM): # check whether grain is a list if not isinstance(grain, list): ret["result"] = False - ret["comment"] = "Grain {} is not a valid list".format(name) + ret["comment"] = f"Grain {name} is not a valid list" return ret if isinstance(value, list): if make_hashable(value).issubset( make_hashable(__salt__["grains.get"](name)) ): - ret["comment"] = "Value {1} is already in grain {0}".format(name, value) + ret["comment"] = f"Value {value} is already in grain {name}" return ret elif name in __context__.get("pending_grains", {}): # elements common to both @@ -211,7 +211,7 @@ def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM): __context__["pending_grains"][name].update(value) else: if value in grain: - ret["comment"] = "Value {1} is already in grain {0}".format(name, value) + ret["comment"] = f"Value {value} is already in grain {name}" return ret if __opts__["test"]: ret["result"] = None @@ -223,21 +223,21 @@ def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Grain {} is set to be added".format(name) + ret["comment"] = f"Grain {name} is set to be added" ret["changes"] = {"new": grain} return ret new_grains = __salt__["grains.append"](name, value) if isinstance(value, list): if not set(value).issubset(set(__salt__["grains.get"](name))): ret["result"] = False - ret["comment"] = "Failed append value {1} to grain {0}".format(name, value) + ret["comment"] = f"Failed append value {value} to grain {name}" return ret else: if value not in __salt__["grains.get"](name, delimiter=DEFAULT_TARGET_DELIM): ret["result"] = False - ret["comment"] = "Failed append value {1} to grain {0}".format(name, value) + ret["comment"] = f"Failed append value {value} to grain {name}" return ret - ret["comment"] = "Append value {1} to grain {0}".format(name, value) + ret["comment"] = f"Append value {value} to grain {name}" ret["changes"] = {"new": new_grains} return ret @@ -288,22 +288,16 @@ def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): value = [value] for val in value: if val not in grain: - comments.append( - "Value {1} is absent from grain {0}".format(name, val) - ) + comments.append(f"Value {val} is absent from grain {name}") elif __opts__["test"]: ret["result"] = None - comments.append( - "Value {1} in grain {0} is set to be deleted".format(name, val) - ) + comments.append(f"Value {val} in grain {name} is set to be deleted") if "deleted" not in ret["changes"]: ret["changes"] = {"deleted": []} ret["changes"]["deleted"].append(val) elif val in grain: __salt__["grains.remove"](name, val) - comments.append( - "Value {1} was deleted from grain {0}".format(name, val) - ) + comments.append(f"Value {val} was deleted from grain {name}") if "deleted" not in ret["changes"]: ret["changes"] = {"deleted": []} ret["changes"]["deleted"].append(val) @@ -311,9 +305,9 @@ def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM): return ret else: ret["result"] = False - ret["comment"] = "Grain {} is not a valid list".format(name) + ret["comment"] = f"Grain {name} is not a valid list" else: - ret["comment"] = "Grain {} does not exist".format(name) + ret["comment"] = f"Grain {name} does not exist" return ret @@ -362,38 +356,36 @@ def absent(name, destructive=False, delimiter=DEFAULT_TARGET_DELIM, force=False) if __opts__["test"]: ret["result"] = None if destructive is True: - ret["comment"] = "Grain {} is set to be deleted".format(name) + ret["comment"] = f"Grain {name} is set to be deleted" ret["changes"] = {"deleted": name} return ret ret = __salt__["grains.set"](name, None, destructive=destructive, force=force) if ret["result"]: if destructive is True: - ret["comment"] = "Grain {} was deleted".format(name) + ret["comment"] = f"Grain {name} was deleted" ret["changes"] = {"deleted": name} ret["name"] = name elif grain is not _non_existent: if __opts__["test"]: ret["result"] = None if destructive is True: - ret["comment"] = "Grain {} is set to be deleted".format(name) + ret["comment"] = f"Grain {name} is set to be deleted" ret["changes"] = {"deleted": name} else: - ret["comment"] = ( - "Value for grain {} is set to be deleted (None)".format(name) - ) + ret["comment"] = f"Value for grain {name} is set to be deleted (None)" ret["changes"] = {"grain": name, "value": None} return ret ret = __salt__["grains.set"](name, None, destructive=destructive, force=force) if ret["result"]: if destructive is True: - ret["comment"] = "Grain {} was deleted".format(name) + ret["comment"] = f"Grain {name} was deleted" ret["changes"] = {"deleted": name} else: - ret["comment"] = "Value for grain {} was set to None".format(name) + ret["comment"] = f"Value for grain {name} was set to None" ret["changes"] = {"grain": name, "value": None} ret["name"] = name else: - ret["comment"] = "Grain {} does not exist".format(name) + ret["comment"] = f"Grain {name} does not exist" return ret @@ -437,7 +429,7 @@ def append(name, value, convert=False, delimiter=DEFAULT_TARGET_DELIM): if isinstance(grain, list): if value in grain: ret["comment"] = ( - "Value {1} is already in the list for grain {0}".format(name, value) + f"Value {value} is already in the list for grain {name}" ) return ret if __opts__["test"]: @@ -448,7 +440,7 @@ def append(name, value, convert=False, delimiter=DEFAULT_TARGET_DELIM): ret["changes"] = {"added": value} return ret __salt__["grains.append"](name, value) - ret["comment"] = "Value {1} was added to grain {0}".format(name, value) + ret["comment"] = f"Value {value} was added to grain {name}" ret["changes"] = {"added": value} else: if convert is True: @@ -464,12 +456,12 @@ def append(name, value, convert=False, delimiter=DEFAULT_TARGET_DELIM): grain = [] if grain is None else [grain] grain.append(value) __salt__["grains.setval"](name, grain) - ret["comment"] = "Value {1} was added to grain {0}".format(name, value) + ret["comment"] = f"Value {value} was added to grain {name}" ret["changes"] = {"added": value} else: ret["result"] = False - ret["comment"] = "Grain {} is not a valid list".format(name) + ret["comment"] = f"Grain {name} is not a valid list" else: ret["result"] = False - ret["comment"] = "Grain {} does not exist".format(name) + ret["comment"] = f"Grain {name} does not exist" return ret diff --git a/salt/states/group.py b/salt/states/group.py index 6180b661a6b..b0a70ac9abb 100644 --- a/salt/states/group.py +++ b/salt/states/group.py @@ -172,7 +172,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Group {} is present and up to date".format(name), + "comment": f"Group {name} is present and up to date", } if members is not None and (addusers is not None or delusers is not None): @@ -196,7 +196,7 @@ def present( if changes: ret["comment"] = "The following group attributes are set to be changed:\n" for key, val in changes.items(): - ret["comment"] += "{}: {}\n".format(key, val) + ret["comment"] += f"{key}: {val}\n" if __opts__["test"]: ret["result"] = None @@ -233,7 +233,7 @@ def present( # The group is not present, make it! if __opts__["test"]: ret["result"] = None - ret["comment"] = "Group {} set to be added".format(name) + ret["comment"] = f"Group {name} set to be added" return ret grps = __salt__["group.getent"]() @@ -267,7 +267,7 @@ def present( sys.modules[__salt__["test.ping"].__module__].__context__.pop( "group.getent", None ) - ret["comment"] = "New group {} created".format(name) + ret["comment"] = f"New group {name} created" ret["changes"] = __salt__["group.info"](name) changes = _changes(name, gid, addusers, delusers, members) if changes: @@ -279,7 +279,7 @@ def present( ret["changes"] = {"Failed": changes} else: ret["result"] = False - ret["comment"] = "Failed to create new group {}".format(name) + ret["comment"] = f"Failed to create new group {name}" return ret @@ -305,15 +305,15 @@ def absent(name): # Group already exists. Remove the group. if __opts__["test"]: ret["result"] = None - ret["comment"] = "Group {} is set for removal".format(name) + ret["comment"] = f"Group {name} is set for removal" return ret ret["result"] = __salt__["group.delete"](name) if ret["result"]: ret["changes"] = {name: ""} - ret["comment"] = "Removed group {}".format(name) + ret["comment"] = f"Removed group {name}" return ret else: - ret["comment"] = "Failed to remove group {}".format(name) + ret["comment"] = f"Failed to remove group {name}" return ret else: ret["comment"] = "Group not present" diff --git a/salt/states/heat.py b/salt/states/heat.py index c4a63133ee4..2e86486c972 100644 --- a/salt/states/heat.py +++ b/salt/states/heat.py @@ -108,7 +108,7 @@ def deployed( timeout=60, update=False, profile=None, - **connection_args + **connection_args, ): """ Deploy stack with the specified properties @@ -168,7 +168,7 @@ def deployed( existing_stack = __salt__["heat.show_stack"](name, profile=profile) if existing_stack["result"] and not update: - ret["comment"] = "Stack {} is deployed".format(name) + ret["comment"] = f"Stack {name} is deployed" return ret if existing_stack["result"] and update: if template: @@ -223,7 +223,7 @@ def deployed( salt.utils.files.safe_rm(template_tmp_file) except ValueError as ex: ret["result"] = False - ret["comment"] = "Error parsing template {}".format(ex) + ret["comment"] = f"Error parsing template {ex}" else: ret["result"] = False ret["comment"] = "Can not open template: {} {}".format( @@ -245,13 +245,13 @@ def deployed( checksum_stack = __salt__["hashutil.digest"](template_stack["template"]) except salt.exceptions.CommandExecutionError as cmdexc: ret["result"] = False - ret["comment"] = "{}".format(cmdexc) + ret["comment"] = f"{cmdexc}" if ret["result"] is True: if checksum_template == checksum_stack: if __opts__["test"]: ret["result"] = True - ret["comment"] = "Stack {} is deployed".format(name) + ret["comment"] = f"Stack {name} is deployed" return ret else: ret["result"] = False @@ -263,7 +263,7 @@ def deployed( if __opts__["test"]: stack = { "result": None, - "comment": "Stack {} is set to be updated".format(name), + "comment": f"Stack {name} is set to be updated", } else: stack = __salt__["heat.update_stack"]( @@ -282,7 +282,7 @@ def deployed( if __opts__["test"]: stack = { "result": None, - "comment": "Stack {} is set to be created".format(name), + "comment": f"Stack {name} is set to be created", } else: stack = __salt__["heat.create_stack"]( @@ -337,7 +337,7 @@ def absent(name, poll=5, timeout=60, profile=None): return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Stack {} is set to be removed".format(name) + ret["comment"] = f"Stack {name} is set to be removed" return ret stack = __salt__["heat.delete_stack"]( diff --git a/salt/states/helm.py b/salt/states/helm.py index f80a766a956..95d1e393655 100644 --- a/salt/states/helm.py +++ b/salt/states/helm.py @@ -99,7 +99,7 @@ def repo_managed( except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Failed to add some repositories: {}.".format(err) + ret["comment"] = f"Failed to add some repositories: {err}." return ret @@ -154,7 +154,7 @@ def repo_updated(name, namespace=None, flags=None, kvflags=None): except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Failed to update some repositories: {}.".format(err) + ret["comment"] = f"Failed to update some repositories: {err}." return ret @@ -226,7 +226,7 @@ def release_present( "name": name, "changes": {}, "result": True, - "comment": "Helm release {} is present".format(name), + "comment": f"Helm release {name} is present", } if "helm.status" not in __salt__: @@ -332,7 +332,7 @@ def release_absent(name, namespace=None, flags=None, kvflags=None): "name": name, "changes": {}, "result": True, - "comment": "Helm release {} is absent.".format(name), + "comment": f"Helm release {name} is absent.", } if "helm.uninstall" not in __salt__: diff --git a/salt/states/hg.py b/salt/states/hg.py index f4c5592a41f..f4045514e38 100644 --- a/salt/states/hg.py +++ b/salt/states/hg.py @@ -32,7 +32,7 @@ def __virtual__(): """ if __salt__["cmd.has_exec"](HG_BINARY): return True - return (False, "Command {} not found".format(HG_BINARY)) + return (False, f"Command {HG_BINARY} not found") def latest( @@ -88,7 +88,7 @@ def latest( if not target: return _fail(ret, '"target option is required') - is_repository = os.path.isdir(target) and os.path.isdir("{}/.hg".format(target)) + is_repository = os.path.isdir(target) and os.path.isdir(f"{target}/.hg") if is_repository: ret = _update_repo( @@ -103,7 +103,7 @@ def latest( log.debug('target %s is not found, "hg clone" is required', target) if __opts__["test"]: return _neutral_test( - ret, "Repository {} is about to be cloned to {}".format(name, target) + ret, f"Repository {name} is about to be cloned to {target}" ) _clone_repo(ret, target, name, user, identity, rev, opts) return ret @@ -117,7 +117,7 @@ def _update_repo(ret, name, target, clean, user, identity, rev, opts, update_hea current_rev = __salt__["hg.revision"](target, user=user, rev=".") if not current_rev: - return _fail(ret, "Seems that {} is not a valid hg repo".format(target)) + return _fail(ret, f"Seems that {target} is not a valid hg repo") if __opts__["test"]: return _neutral_test( @@ -167,12 +167,12 @@ def _update_repo(ret, name, target, clean, user, identity, rev, opts, update_hea new_rev = __salt__["hg.revision"](cwd=target, user=user, rev=".") if current_rev != new_rev: - revision_text = "{} => {}".format(current_rev, new_rev) + revision_text = f"{current_rev} => {new_rev}" log.info("Repository %s updated: %s", target, revision_text) - ret["comment"] = "Repository {} updated.".format(target) + ret["comment"] = f"Repository {target} updated." ret["changes"]["revision"] = revision_text elif "error:" in pull_out: - return _fail(ret, "An error was thrown by hg:\n{}".format(pull_out)) + return _fail(ret, f"An error was thrown by hg:\n{pull_out}") return ret @@ -216,7 +216,7 @@ def _clone_repo(ret, target, name, user, identity, rev, opts): return ret new_rev = __salt__["hg.revision"](cwd=target, user=user) - message = "Repository {} cloned to {}".format(name, target) + message = f"Repository {name} cloned to {target}" log.info(message) ret["comment"] = message diff --git a/salt/states/highstate_doc.py b/salt/states/highstate_doc.py index 83bc4db149e..8af62692521 100644 --- a/salt/states/highstate_doc.py +++ b/salt/states/highstate_doc.py @@ -35,7 +35,7 @@ def note(name, source=None, contents=None, **kwargs): """ comment = "" if source: - comment += "include file: {}\n".format(source) + comment += f"include file: {source}\n" if contents and len(contents) < 200: comment += contents return {"name": name, "result": True, "comment": comment, "changes": {}} diff --git a/salt/states/host.py b/salt/states/host.py index eadb30c00a2..078e4b9f0dc 100644 --- a/salt/states/host.py +++ b/salt/states/host.py @@ -144,7 +144,7 @@ def present(name, ip, comment="", clean=False): # pylint: disable=C0103 update_comment.add((addr, comment)) else: # No changes needed for this IP address and hostname - comments.append("Host {} ({}) already present".format(name, addr)) + comments.append(f"Host {name} ({addr}) already present") else: # IP address listed in hosts file, but hostname is not present. # We will need to add it. @@ -154,32 +154,30 @@ def present(name, ip, comment="", clean=False): # pylint: disable=C0103 update_comment.add((addr, comment)) else: ret["result"] = False - comments.append("Invalid IP Address for {} ({})".format(name, addr)) + comments.append(f"Invalid IP Address for {name} ({addr})") for addr, name in to_add: if __opts__["test"]: ret["result"] = None - comments.append("Host {} ({}) would be added".format(name, addr)) + comments.append(f"Host {name} ({addr}) would be added") else: if __salt__["hosts.add_host"](addr, name): - comments.append("Added host {} ({})".format(name, addr)) + comments.append(f"Added host {name} ({addr})") else: ret["result"] = False - comments.append("Failed to add host {} ({})".format(name, addr)) + comments.append(f"Failed to add host {name} ({addr})") continue ret["changes"].setdefault("added", {}).setdefault(addr, []).append(name) for addr, comment in update_comment: if __opts__["test"]: - comments.append("Comment for {} ({}) would be added".format(addr, comment)) + comments.append(f"Comment for {addr} ({comment}) would be added") else: if __salt__["hosts.set_comment"](addr, comment): - comments.append("Set comment for host {} ({})".format(addr, comment)) + comments.append(f"Set comment for host {addr} ({comment})") else: ret["result"] = False - comments.append( - "Failed to add comment for host {} ({})".format(addr, comment) - ) + comments.append(f"Failed to add comment for host {addr} ({comment})") continue ret["changes"].setdefault("comment_added", {}).setdefault(addr, []).append( comment @@ -188,13 +186,13 @@ def present(name, ip, comment="", clean=False): # pylint: disable=C0103 for addr, name in to_remove: if __opts__["test"]: ret["result"] = None - comments.append("Host {} ({}) would be removed".format(name, addr)) + comments.append(f"Host {name} ({addr}) would be removed") else: if __salt__["hosts.rm_host"](addr, name): - comments.append("Removed host {} ({})".format(name, addr)) + comments.append(f"Removed host {name} ({addr})") else: ret["result"] = False - comments.append("Failed to remove host {} ({})".format(name, addr)) + comments.append(f"Failed to remove host {name} ({addr})") continue ret["changes"].setdefault("removed", {}).setdefault(addr, []).append(name) @@ -221,15 +219,15 @@ def absent(name, ip): # pylint: disable=C0103 for _ip in ip: if not __salt__["hosts.has_pair"](_ip, name): ret["result"] = True - comments.append("Host {} ({}) already absent".format(name, _ip)) + comments.append(f"Host {name} ({_ip}) already absent") else: if __opts__["test"]: - comments.append("Host {} ({}) needs to be removed".format(name, _ip)) + comments.append(f"Host {name} ({_ip}) needs to be removed") else: if __salt__["hosts.rm_host"](_ip, name): ret["changes"] = {"host": name} ret["result"] = True - comments.append("Removed host {} ({})".format(name, _ip)) + comments.append(f"Removed host {name} ({_ip})") else: ret["result"] = False comments.append("Failed to remove host") @@ -263,12 +261,12 @@ def only(name, hostnames): new = " ".join(x.strip() for x in hostnames) if old == new: - ret["comment"] = 'IP address {} already set to "{}"'.format(name, new) + ret["comment"] = f'IP address {name} already set to "{new}"' ret["result"] = True return ret if __opts__["test"]: - ret["comment"] = 'Would change {} from "{}" to "{}"'.format(name, old, new) + ret["comment"] = f'Would change {name} from "{old}" to "{new}"' return ret ret["result"] = __salt__["hosts.set_host"](name, new) @@ -278,6 +276,6 @@ def only(name, hostnames): ) return ret - ret["comment"] = 'successfully changed {} from "{}" to "{}"'.format(name, old, new) + ret["comment"] = f'successfully changed {name} from "{old}" to "{new}"' ret["changes"] = {name: {"old": old, "new": new}} return ret diff --git a/salt/states/http.py b/salt/states/http.py index bef03f01309..3cb5485e0c3 100644 --- a/salt/states/http.py +++ b/salt/states/http.py @@ -25,7 +25,7 @@ def query( status=None, status_type="string", wait_for=None, - **kwargs + **kwargs, ): """ Perform an HTTP query and statefully return the result @@ -129,48 +129,48 @@ def query( if match_type == "string": if str(match) in data.get("text", ""): ret["result"] = True - ret["comment"] += ' Match text "{}" was found.'.format(match) + ret["comment"] += f' Match text "{match}" was found.' else: ret["result"] = False - ret["comment"] += ' Match text "{}" was not found.'.format(match) + ret["comment"] += f' Match text "{match}" was not found.' elif match_type == "pcre": if re.search(str(match), str(data.get("text", ""))): ret["result"] = True - ret["comment"] += ' Match pattern "{}" was found.'.format(match) + ret["comment"] += f' Match pattern "{match}" was found.' else: ret["result"] = False - ret["comment"] += ' Match pattern "{}" was not found.'.format(match) + ret["comment"] += f' Match pattern "{match}" was not found.' if status is not None: # Deals with case of status_type as a list of strings representing statuses if status_type == "list": for stat in status: if str(data.get("status", "")) == str(stat): - ret["comment"] += " Status {} was found.".format(stat) + ret["comment"] += f" Status {stat} was found." if ret["result"] is None: ret["result"] = True if ret["result"] is not True: - ret["comment"] += " Statuses {} were not found.".format(status) + ret["comment"] += f" Statuses {status} were not found." ret["result"] = False # Deals with the case of status_type representing a regex elif status_type == "pcre": if re.search(str(status), str(data.get("status", ""))): - ret["comment"] += ' Status pattern "{}" was found.'.format(status) + ret["comment"] += f' Status pattern "{status}" was found.' if ret["result"] is None: ret["result"] = True else: - ret["comment"] += ' Status pattern "{}" was not found.'.format(status) + ret["comment"] += f' Status pattern "{status}" was not found.' ret["result"] = False # Deals with the case of status_type as a single string representing a status elif status_type == "string": if str(data.get("status", "")) == str(status): - ret["comment"] += " Status {} was found.".format(status) + ret["comment"] += f" Status {status} was found." if ret["result"] is None: ret["result"] = True else: - ret["comment"] += " Status {} was not found.".format(status) + ret["comment"] += f" Status {status} was not found." ret["result"] = False # cleanup spaces in comment diff --git a/salt/states/icinga2.py b/salt/states/icinga2.py index f8134630cc1..a764cc4f7f6 100644 --- a/salt/states/icinga2.py +++ b/salt/states/icinga2.py @@ -97,7 +97,7 @@ def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): return ret elif output: if not overwrite and os.path.isfile(output): - ret["comment"] = "No execution needed. File {} already set".format(output) + ret["comment"] = f"No execution needed. File {output} already set" return ret elif __opts__["test"]: ret["result"] = None @@ -121,7 +121,7 @@ def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): if output == "grain": if grain and not key: __salt__["grains.setval"](grain, ticket) - ret["changes"]["ticket"] = "Executed. Output into grain: {}".format(grain) + ret["changes"]["ticket"] = f"Executed. Output into grain: {grain}" elif grain: if grain in __salt__["grains.ls"](): grain_value = __salt__["grains.get"](grain) @@ -133,7 +133,7 @@ def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): grain, key ) elif output: - ret["changes"]["ticket"] = "Executed. Output into {}".format(output) + ret["changes"]["ticket"] = f"Executed. Output into {output}" with salt.utils.files.fopen(output, "w") as output_file: output_file.write(salt.utils.stringutils.to_str(ticket)) else: @@ -150,8 +150,8 @@ def generate_cert(name): The domain name for which this certificate and key will be generated """ ret = {"name": name, "changes": {}, "result": True, "comment": ""} - cert = "{}{}.crt".format(get_certs_path(), name) - key = "{}{}.key".format(get_certs_path(), name) + cert = f"{get_certs_path()}{name}.crt" + key = f"{get_certs_path()}{name}.key" # Checking if execution is needed. if os.path.isfile(cert) and os.path.isfile(key): @@ -170,8 +170,8 @@ def generate_cert(name): cert_save = __salt__["icinga2.generate_cert"](name) if not cert_save["retcode"]: ret["comment"] = "Certificate and key generated" - ret["changes"]["cert"] = "Executed. Certificate saved: {}".format(cert) - ret["changes"]["key"] = "Executed. Key saved: {}".format(key) + ret["changes"]["cert"] = f"Executed. Certificate saved: {cert}" + ret["changes"]["key"] = f"Executed. Key saved: {key}" return ret @@ -186,11 +186,11 @@ def save_cert(name, master): Icinga2 master node for which this certificate will be saved """ ret = {"name": name, "changes": {}, "result": True, "comment": ""} - cert = "{}trusted-master.crt".format(get_certs_path()) + cert = f"{get_certs_path()}trusted-master.crt" # Checking if execution is needed. if os.path.isfile(cert): - ret["comment"] = "No execution needed. Cert: {} already saved.".format(cert) + ret["comment"] = f"No execution needed. Cert: {cert} already saved." return ret if __opts__["test"]: ret["result"] = None @@ -201,7 +201,7 @@ def save_cert(name, master): cert_save = __salt__["icinga2.save_cert"](name, master) if not cert_save["retcode"]: ret["comment"] = "Certificate for icinga2 master saved" - ret["changes"]["cert"] = "Executed. Certificate saved: {}".format(cert) + ret["changes"]["cert"] = f"Executed. Certificate saved: {cert}" return ret @@ -222,11 +222,11 @@ def request_cert(name, master, ticket, port="5665"): Icinga2 port, defaults to 5665 """ ret = {"name": name, "changes": {}, "result": True, "comment": ""} - cert = "{}ca.crt".format(get_certs_path()) + cert = f"{get_certs_path()}ca.crt" # Checking if execution is needed. if os.path.isfile(cert): - ret["comment"] = "No execution needed. Cert: {} already exists.".format(cert) + ret["comment"] = f"No execution needed. Cert: {cert} already exists." return ret if __opts__["test"]: ret["result"] = None @@ -237,7 +237,7 @@ def request_cert(name, master, ticket, port="5665"): cert_request = __salt__["icinga2.request_cert"](name, master, ticket, port) if not cert_request["retcode"]: ret["comment"] = "Certificate request from icinga2 master executed" - ret["changes"]["cert"] = "Executed. Certificate requested: {}".format(cert) + ret["changes"]["cert"] = f"Executed. Certificate requested: {cert}" return ret ret["comment"] = "FAILED. Certificate requested failed with output: {}".format( @@ -261,8 +261,8 @@ def node_setup(name, master, ticket): Authentication ticket generated on icinga2 master """ ret = {"name": name, "changes": {}, "result": True, "comment": ""} - cert = "{}{}.crt.orig".format(get_certs_path(), name) - key = "{}{}.key.orig".format(get_certs_path(), name) + cert = f"{get_certs_path()}{name}.crt.orig" + key = f"{get_certs_path()}{name}.key.orig" # Checking if execution is needed. if os.path.isfile(cert) and os.path.isfile(cert): diff --git a/salt/states/idem.py b/salt/states/idem.py index a7caba30ecd..b324f885671 100644 --- a/salt/states/idem.py +++ b/salt/states/idem.py @@ -30,13 +30,13 @@ def _get_refs(sources, tree): sls_sources = [] SLSs = [] if tree: - sls_sources.append("file://{}".format(tree)) + sls_sources.append(f"file://{tree}") for sls in sources: path = pathlib.Path(sls) if path.is_file(): ref = str(path.stem if path.suffix == ".sls" else path.name) SLSs.append(ref) - implied = "file://{}".format(path.parent) + implied = f"file://{path.parent}" if implied not in sls_sources: sls_sources.append(implied) else: @@ -152,7 +152,7 @@ def state( return { "name": name, "result": success, - "comment": "Ran {} idem states".format(len(running)) if success else errors, + "comment": f"Ran {len(running)} idem states" if success else errors, "changes": {}, "sub_state_run": running, } diff --git a/salt/states/ifttt.py b/salt/states/ifttt.py index f7378576783..4ab7f68df02 100644 --- a/salt/states/ifttt.py +++ b/salt/states/ifttt.py @@ -80,8 +80,8 @@ def trigger_event(name, event, value1=None, value2=None, value3=None): if ret and ret["result"]: ret["result"] = True - ret["comment"] = "Triggered Event: {}".format(name) + ret["comment"] = f"Triggered Event: {name}" else: - ret["comment"] = "Failed to trigger event: {}".format(name) + ret["comment"] = f"Failed to trigger event: {name}" return ret diff --git a/salt/states/incron.py b/salt/states/incron.py index 6baad30808f..d290ca7b681 100644 --- a/salt/states/incron.py +++ b/salt/states/incron.py @@ -119,26 +119,26 @@ def present(name, path, mask, cmd, user="root"): status = _check_cron(user, path, mask, cmd) ret["result"] = None if status == "absent": - ret["comment"] = "Incron {} is set to be added".format(name) + ret["comment"] = f"Incron {name} is set to be added" elif status == "present": ret["result"] = True - ret["comment"] = "Incron {} already present".format(name) + ret["comment"] = f"Incron {name} already present" elif status == "update": - ret["comment"] = "Incron {} is set to be updated".format(name) + ret["comment"] = f"Incron {name} is set to be updated" return ret data = __salt__["incron.set_job"](user=user, path=path, mask=mask, cmd=cmd) if data == "present": - ret["comment"] = "Incron {} already present".format(name) + ret["comment"] = f"Incron {name} already present" return ret if data == "new": - ret["comment"] = "Incron {} added to {}'s incrontab".format(name, user) + ret["comment"] = f"Incron {name} added to {user}'s incrontab" ret["changes"] = {user: name} return ret if data == "updated": - ret["comment"] = "Incron {} updated".format(name) + ret["comment"] = f"Incron {name} updated" ret["changes"] = {user: name} return ret ret["comment"] = "Incron {} for user {} failed to commit with error \n{}".format( @@ -180,17 +180,17 @@ def absent(name, path, mask, cmd, user="root"): ret["result"] = None if status == "absent": ret["result"] = True - ret["comment"] = "Incron {} is absent".format(name) + ret["comment"] = f"Incron {name} is absent" elif status == "present" or status == "update": - ret["comment"] = "Incron {} is set to be removed".format(name) + ret["comment"] = f"Incron {name} is set to be removed" return ret data = __salt__["incron.rm_job"](user=user, path=path, mask=mask, cmd=cmd) if data == "absent": - ret["comment"] = "Incron {} already absent".format(name) + ret["comment"] = f"Incron {name} already absent" return ret if data == "removed": - ret["comment"] = "Incron {} removed from {}'s crontab".format(name, user) + ret["comment"] = f"Incron {name} removed from {user}'s crontab" ret["changes"] = {user: name} return ret ret["comment"] = "Incron {} for user {} failed to commit with error {}".format( diff --git a/salt/states/influxdb08_database.py b/salt/states/influxdb08_database.py index fac790a0824..e2bfe5989d0 100644 --- a/salt/states/influxdb08_database.py +++ b/salt/states/influxdb08_database.py @@ -49,16 +49,16 @@ def present(name, user=None, password=None, host=None, port=None): ) return ret if __salt__["influxdb08.db_create"](name, user, password, host, port): - ret["comment"] = "Database {} has been created".format(name) + ret["comment"] = f"Database {name} has been created" ret["changes"][name] = "Present" return ret else: - ret["comment"] = "Failed to create database {}".format(name) + ret["comment"] = f"Failed to create database {name}" ret["result"] = False return ret # fallback - ret["comment"] = "Database {} is already present, so cannot be created".format(name) + ret["comment"] = f"Database {name} is already present, so cannot be created" return ret @@ -93,14 +93,14 @@ def absent(name, user=None, password=None, host=None, port=None): ) return ret if __salt__["influxdb08.db_remove"](name, user, password, host, port): - ret["comment"] = "Database {} has been removed".format(name) + ret["comment"] = f"Database {name} has been removed" ret["changes"][name] = "Absent" return ret else: - ret["comment"] = "Failed to remove database {}".format(name) + ret["comment"] = f"Failed to remove database {name}" ret["result"] = False return ret # fallback - ret["comment"] = "Database {} is not present, so it cannot be removed".format(name) + ret["comment"] = f"Database {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/influxdb08_user.py b/salt/states/influxdb08_user.py index 19865232692..e482287e6dc 100644 --- a/salt/states/influxdb08_user.py +++ b/salt/states/influxdb08_user.py @@ -53,7 +53,7 @@ def present( database, user, password, host, port ): ret["result"] = False - ret["comment"] = "Database {} does not exist".format(database) + ret["comment"] = f"Database {database} does not exist" return ret # check if user exists @@ -70,16 +70,16 @@ def present( if __salt__["influxdb08.user_create"]( name, passwd, database, user, password, host, port ): - ret["comment"] = "User {} has been created".format(name) + ret["comment"] = f"User {name} has been created" ret["changes"][name] = "Present" return ret else: - ret["comment"] = "Failed to create user {}".format(name) + ret["comment"] = f"Failed to create user {name}" ret["result"] = False return ret # fallback - ret["comment"] = "User {} is already present".format(name) + ret["comment"] = f"User {name} is already present" return ret @@ -112,19 +112,19 @@ def absent(name, database=None, user=None, password=None, host=None, port=None): if __salt__["influxdb08.user_exists"](name, database, user, password, host, port): if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} is present and needs to be removed".format(name) + ret["comment"] = f"User {name} is present and needs to be removed" return ret if __salt__["influxdb08.user_remove"]( name, database, user, password, host, port ): - ret["comment"] = "User {} has been removed".format(name) + ret["comment"] = f"User {name} has been removed" ret["changes"][name] = "Absent" return ret else: - ret["comment"] = "Failed to remove user {}".format(name) + ret["comment"] = f"Failed to remove user {name}" ret["result"] = False return ret # fallback - ret["comment"] = "User {} is not present, so it cannot be removed".format(name) + ret["comment"] = f"User {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/influxdb_continuous_query.py b/salt/states/influxdb_continuous_query.py index d769c4d865c..c21dde4e5e0 100644 --- a/salt/states/influxdb_continuous_query.py +++ b/salt/states/influxdb_continuous_query.py @@ -42,7 +42,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "continuous query {} is already present".format(name), + "comment": f"continuous query {name} is already present", } if not __salt__["influxdb.continuous_query_exists"]( @@ -50,16 +50,16 @@ def present( ): if __opts__["test"]: ret["result"] = None - ret["comment"] = " {} is absent and will be created".format(name) + ret["comment"] = f" {name} is absent and will be created" return ret if __salt__["influxdb.create_continuous_query"]( database, name, query, resample_time, coverage_period, **client_args ): - ret["comment"] = "continuous query {} has been created".format(name) + ret["comment"] = f"continuous query {name} has been created" ret["changes"][name] = "Present" return ret else: - ret["comment"] = "Failed to create continuous query {}".format(name) + ret["comment"] = f"Failed to create continuous query {name}" ret["result"] = False return ret @@ -80,22 +80,22 @@ def absent(name, database, **client_args): "name": name, "changes": {}, "result": True, - "comment": "continuous query {} is not present".format(name), + "comment": f"continuous query {name} is not present", } if __salt__["influxdb.continuous_query_exists"](database, name, **client_args): if __opts__["test"]: ret["result"] = None ret["comment"] = ( - "continuous query {} is present and needs to be removed".format(name) + f"continuous query {name} is present and needs to be removed" ) return ret if __salt__["influxdb.drop_continuous_query"](database, name, **client_args): - ret["comment"] = "continuous query {} has been removed".format(name) + ret["comment"] = f"continuous query {name} has been removed" ret["changes"][name] = "Absent" return ret else: - ret["comment"] = "Failed to remove continuous query {}".format(name) + ret["comment"] = f"Failed to remove continuous query {name}" ret["result"] = False return ret diff --git a/salt/states/influxdb_database.py b/salt/states/influxdb_database.py index cfa2a1c9d47..1a99df01801 100644 --- a/salt/states/influxdb_database.py +++ b/salt/states/influxdb_database.py @@ -26,20 +26,20 @@ def present(name, **client_args): "name": name, "changes": {}, "result": True, - "comment": "Database {} is already present".format(name), + "comment": f"Database {name} is already present", } if not __salt__["influxdb.db_exists"](name, **client_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Database {} is absent and will be created".format(name) + ret["comment"] = f"Database {name} is absent and will be created" return ret if __salt__["influxdb.create_db"](name, **client_args): - ret["comment"] = "Database {} has been created".format(name) + ret["comment"] = f"Database {name} has been created" ret["changes"][name] = "Present" return ret else: - ret["comment"] = "Failed to create database {}".format(name) + ret["comment"] = f"Failed to create database {name}" ret["result"] = False return ret @@ -57,7 +57,7 @@ def absent(name, **client_args): "name": name, "changes": {}, "result": True, - "comment": "Database {} is not present".format(name), + "comment": f"Database {name} is not present", } if __salt__["influxdb.db_exists"](name, **client_args): @@ -68,11 +68,11 @@ def absent(name, **client_args): ) return ret if __salt__["influxdb.drop_db"](name, **client_args): - ret["comment"] = "Database {} has been removed".format(name) + ret["comment"] = f"Database {name} has been removed" ret["changes"][name] = "Absent" return ret else: - ret["comment"] = "Failed to remove database {}".format(name) + ret["comment"] = f"Failed to remove database {name}" ret["result"] = False return ret diff --git a/salt/states/influxdb_retention_policy.py b/salt/states/influxdb_retention_policy.py index 2c4e7fae9ba..f63ffd24c21 100644 --- a/salt/states/influxdb_retention_policy.py +++ b/salt/states/influxdb_retention_policy.py @@ -59,7 +59,7 @@ def present(name, database, duration="7d", replication=1, default=False, **clien "name": name, "changes": {}, "result": True, - "comment": "retention policy {} is already present".format(name), + "comment": f"retention policy {name} is already present", } if not __salt__["influxdb.retention_policy_exists"]( @@ -67,16 +67,16 @@ def present(name, database, duration="7d", replication=1, default=False, **clien ): if __opts__["test"]: ret["result"] = None - ret["comment"] = " {} is absent and will be created".format(name) + ret["comment"] = f" {name} is absent and will be created" return ret if __salt__["influxdb.create_retention_policy"]( database, name, duration, replication, default, **client_args ): - ret["comment"] = "retention policy {} has been created".format(name) + ret["comment"] = f"retention policy {name} has been created" ret["changes"][name] = "Present" return ret else: - ret["comment"] = "Failed to create retention policy {}".format(name) + ret["comment"] = f"Failed to create retention policy {name}" ret["result"] = False return ret @@ -106,16 +106,16 @@ def present(name, database, duration="7d", replication=1, default=False, **clien if update_policy: if __opts__["test"]: ret["result"] = None - ret["comment"] = " {} is present and set to be changed".format(name) + ret["comment"] = f" {name} is present and set to be changed" return ret else: if __salt__["influxdb.alter_retention_policy"]( database, name, duration, replication, default, **client_args ): - ret["comment"] = "retention policy {} has been changed".format(name) + ret["comment"] = f"retention policy {name} has been changed" return ret else: - ret["comment"] = "Failed to update retention policy {}".format(name) + ret["comment"] = f"Failed to update retention policy {name}" ret["result"] = False return ret @@ -136,22 +136,22 @@ def absent(name, database, **client_args): "name": name, "changes": {}, "result": True, - "comment": "retention policy {} is not present".format(name), + "comment": f"retention policy {name} is not present", } if __salt__["influxdb.retention_policy_exists"](database, name, **client_args): if __opts__["test"]: ret["result"] = None ret["comment"] = ( - "retention policy {} is present and needs to be removed".format(name) + f"retention policy {name} is present and needs to be removed" ) return ret if __salt__["influxdb.drop_retention_policy"](database, name, **client_args): - ret["comment"] = "retention policy {} has been removed".format(name) + ret["comment"] = f"retention policy {name} has been removed" ret["changes"][name] = "Absent" return ret else: - ret["comment"] = "Failed to remove retention policy {}".format(name) + ret["comment"] = f"Failed to remove retention policy {name}" ret["result"] = False return ret diff --git a/salt/states/influxdb_user.py b/salt/states/influxdb_user.py index 7088a84ed8a..ea48c6854d4 100644 --- a/salt/states/influxdb_user.py +++ b/salt/states/influxdb_user.py @@ -55,20 +55,20 @@ def present(name, passwd, admin=False, grants=None, **client_args): "name": name, "changes": {}, "result": True, - "comment": "User {} is present and up to date".format(name), + "comment": f"User {name} is present and up to date", } if not __salt__["influxdb.user_exists"](name, **client_args): create = True if __opts__["test"]: - ret["comment"] = "User {} will be created".format(name) + ret["comment"] = f"User {name} will be created" ret["result"] = None return ret else: if not __salt__["influxdb.create_user"]( name, passwd, admin=admin, **client_args ): - ret["comment"] = "Failed to create user {}".format(name) + ret["comment"] = f"Failed to create user {name}" ret["result"] = False return ret else: @@ -104,7 +104,7 @@ def present(name, passwd, admin=False, grants=None, **client_args): del db_privileges[database] if database not in db_privileges: ret["changes"][ - "Grant on database {} to user {}".format(database, name) + f"Grant on database {database} to user {name}" ] = privilege if not __opts__["test"]: __salt__["influxdb.grant_privilege"]( @@ -113,19 +113,19 @@ def present(name, passwd, admin=False, grants=None, **client_args): if ret["changes"]: if create: - ret["comment"] = "Created user {}".format(name) + ret["comment"] = f"Created user {name}" ret["changes"][name] = "User created" else: if __opts__["test"]: ret["result"] = None ret["comment"] = ( - "User {} will be updated with the following changes:".format(name) + f"User {name} will be updated with the following changes:" ) for k, v in ret["changes"].items(): - ret["comment"] += "\n{} => {}".format(k, v) + ret["comment"] += f"\n{k} => {v}" ret["changes"] = {} else: - ret["comment"] = "Updated user {}".format(name) + ret["comment"] = f"Updated user {name}" return ret @@ -141,21 +141,21 @@ def absent(name, **client_args): "name": name, "changes": {}, "result": True, - "comment": "User {} is not present".format(name), + "comment": f"User {name} is not present", } if __salt__["influxdb.user_exists"](name, **client_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} will be removed".format(name) + ret["comment"] = f"User {name} will be removed" return ret else: if __salt__["influxdb.remove_user"](name, **client_args): - ret["comment"] = "Removed user {}".format(name) + ret["comment"] = f"Removed user {name}" ret["changes"][name] = "removed" return ret else: - ret["comment"] = "Failed to remove user {}".format(name) + ret["comment"] = f"Failed to remove user {name}" ret["result"] = False return ret return ret diff --git a/salt/states/infoblox_host_record.py b/salt/states/infoblox_host_record.py index 49f6f0fb15f..3b1cace0ed3 100644 --- a/salt/states/infoblox_host_record.py +++ b/salt/states/infoblox_host_record.py @@ -131,7 +131,7 @@ def present(name=None, data=None, ensure_data=True, **api_opts): if __opts__["test"]: ret["result"] = None - ret["comment"] = "would attempt to create infoblox record {}".format(name) + ret["comment"] = f"would attempt to create infoblox record {name}" return ret new_obj_ref = __salt__["infoblox.create_host"](data=data, **api_opts) diff --git a/salt/states/infoblox_range.py b/salt/states/infoblox_range.py index 6eb0d193ebd..20783323420 100644 --- a/salt/states/infoblox_range.py +++ b/salt/states/infoblox_range.py @@ -132,7 +132,7 @@ def present(name=None, start_addr=None, end_addr=None, data=None, **api_opts): if __opts__["test"]: ret["result"] = None - ret["comment"] = "would attempt to create record {}".format(name) + ret["comment"] = f"would attempt to create record {name}" return ret new_obj_ref = __salt__["infoblox.create_ipv4_range"](data, **api_opts) @@ -199,7 +199,7 @@ def absent(name=None, start_addr=None, end_addr=None, data=None, **api_opts): if __salt__["infoblox.delete_object"](objref=obj["_ref"]): ret["result"] = True ret["changes"] = { - "old": "Found {} - {}".format(start_addr, end_addr), + "old": f"Found {start_addr} - {end_addr}", "new": "Removed", } return ret diff --git a/salt/states/ini_manage.py b/salt/states/ini_manage.py index 5d5e7159bf9..9851d792734 100644 --- a/salt/states/ini_manage.py +++ b/salt/states/ini_manage.py @@ -70,12 +70,12 @@ def options_present(name, sections=None, separator="=", strict=False): for option in options: if option in original_top_level_opts: if str(original_top_level_opts[option]) == str(options[option]): - ret["comment"] += "Unchanged key {}.\n".format(option) + ret["comment"] += f"Unchanged key {option}.\n" else: - ret["comment"] += "Changed key {}.\n".format(option) + ret["comment"] += f"Changed key {option}.\n" ret["result"] = None else: - ret["comment"] += "Changed key {}.\n".format(option) + ret["comment"] += f"Changed key {option}.\n" ret["result"] = None else: options_updated = __salt__["ini.set_option"](name, options, separator) @@ -83,7 +83,7 @@ def options_present(name, sections=None, separator="=", strict=False): if strict: for opt_to_remove in set(original_top_level_opts).difference(options): if __opts__["test"]: - ret["comment"] += "Removed key {}.\n".format(opt_to_remove) + ret["comment"] += f"Removed key {opt_to_remove}.\n" ret["result"] = None else: __salt__["ini.remove_option"]( @@ -150,7 +150,7 @@ def options_present(name, sections=None, separator="=", strict=False): if not __opts__["test"]: changes = __salt__["ini.set_option"](name, sections, separator) except (OSError, KeyError) as err: - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" ret["result"] = False return ret if "error" in changes: @@ -198,7 +198,7 @@ def options_absent(name, sections=None, separator="="): try: cur_section = __salt__["ini.get_section"](name, section, separator) except OSError as err: - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" ret["result"] = False return ret except AttributeError: @@ -211,14 +211,14 @@ def options_absent(name, sections=None, separator="="): key, section_name ) continue - ret["comment"] += "Deleted key {}{}.\n".format(key, section_name) + ret["comment"] += f"Deleted key {key}{section_name}.\n" ret["result"] = None else: option = section if not __salt__["ini.get_option"](name, None, option, separator): - ret["comment"] += "Key {} does not exist.\n".format(option) + ret["comment"] += f"Key {option} does not exist.\n" continue - ret["comment"] += "Deleted key {}.\n".format(option) + ret["comment"] += f"Deleted key {option}.\n" ret["result"] = None if ret["comment"] == "": @@ -232,7 +232,7 @@ def options_absent(name, sections=None, separator="="): name, section, key, separator ) except OSError as err: - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" ret["result"] = False return ret if not current_value: @@ -277,14 +277,14 @@ def sections_present(name, sections=None, separator="="): cur_ini = __salt__["ini.get_ini"](name, separator) except OSError as err: ret["result"] = False - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" return ret for section in sections or {}: if section in cur_ini: - ret["comment"] += "Section unchanged {}.\n".format(section) + ret["comment"] += f"Section unchanged {section}.\n" continue else: - ret["comment"] += "Created new section {}.\n".format(section) + ret["comment"] += f"Created new section {section}.\n" ret["result"] = None if ret["comment"] == "": ret["comment"] = "No changes detected." @@ -296,7 +296,7 @@ def sections_present(name, sections=None, separator="="): changes = __salt__["ini.set_option"](name, section_to_update, separator) except OSError as err: ret["result"] = False - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" return ret if "error" in changes: ret["result"] = False @@ -334,13 +334,13 @@ def sections_absent(name, sections=None, separator="="): cur_ini = __salt__["ini.get_ini"](name, separator) except OSError as err: ret["result"] = False - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" return ret for section in sections or []: if section not in cur_ini: - ret["comment"] += "Section {} does not exist.\n".format(section) + ret["comment"] += f"Section {section} does not exist.\n" continue - ret["comment"] += "Deleted section {}.\n".format(section) + ret["comment"] += f"Deleted section {section}.\n" ret["result"] = None if ret["comment"] == "": ret["comment"] = "No changes detected." @@ -350,7 +350,7 @@ def sections_absent(name, sections=None, separator="="): cur_section = __salt__["ini.remove_section"](name, section, separator) except OSError as err: ret["result"] = False - ret["comment"] = "{}".format(err) + ret["comment"] = f"{err}" return ret if not cur_section: continue diff --git a/salt/states/ipmi.py b/salt/states/ipmi.py index 3f408590b49..51448b66329 100644 --- a/salt/states/ipmi.py +++ b/salt/states/ipmi.py @@ -131,7 +131,7 @@ def power(name="power_on", wait=300, **kwargs): return ret if __opts__["test"]: - ret["comment"] = "would power: {} system".format(name) + ret["comment"] = f"would power: {name} system" ret["result"] = None ret["changes"] = {"old": org, "new": name} return ret @@ -152,7 +152,7 @@ def user_present( link_auth=True, ipmi_msg=True, privilege_level="administrator", - **kwargs + **kwargs, ): """ Ensure IPMI user and user privileges. @@ -259,7 +259,7 @@ def user_present( link_auth, ipmi_msg, privilege_level, - **kwargs + **kwargs, ) current_user = __salt__["ipmi.get_user"](uid=uid, channel=channel, **kwargs) ret["comment"] = "(re)created user" diff --git a/salt/states/ipset.py b/salt/states/ipset.py index dd8535a4d28..8132e0b5f19 100644 --- a/salt/states/ipset.py +++ b/salt/states/ipset.py @@ -87,17 +87,17 @@ def set_present(name, set_type, family="ipv4", **kwargs): set_check = __salt__["ipset.check_set"](name) if set_check is True: ret["result"] = True - ret["comment"] = "ipset set {} already exists for {}".format(name, family) + ret["comment"] = f"ipset set {name} already exists for {family}" return ret if __opts__["test"]: - ret["comment"] = "ipset set {} would be added for {}".format(name, family) + ret["comment"] = f"ipset set {name} would be added for {family}" return ret command = __salt__["ipset.new_set"](name, set_type, family, **kwargs) if command is True: ret["changes"] = {"locale": name} ret["result"] = True - ret["comment"] = "ipset set {} created successfully for {}".format(name, family) + ret["comment"] = f"ipset set {name} created successfully for {family}" return ret else: ret["result"] = False @@ -122,10 +122,10 @@ def set_absent(name, family="ipv4", **kwargs): set_check = __salt__["ipset.check_set"](name, family) if not set_check: ret["result"] = True - ret["comment"] = "ipset set {} for {} is already absent".format(name, family) + ret["comment"] = f"ipset set {name} for {family} is already absent" return ret if __opts__["test"]: - ret["comment"] = "ipset set {} for {} would be removed".format(name, family) + ret["comment"] = f"ipset set {name} for {family} would be removed" return ret flush_set = __salt__["ipset.flush"](name, family) if flush_set: @@ -310,7 +310,7 @@ def flush(name, family="ipv4", **kwargs): set_check = __salt__["ipset.check_set"](name) if set_check is False: ret["result"] = False - ret["comment"] = "ipset set {} does not exist for {}".format(name, family) + ret["comment"] = f"ipset set {name} does not exist for {family}" return ret if __opts__["test"]: @@ -321,7 +321,7 @@ def flush(name, family="ipv4", **kwargs): if __salt__["ipset.flush"](name, family): ret["changes"] = {"locale": name} ret["result"] = True - ret["comment"] = "Flushed ipset entries from set {} for {}".format(name, family) + ret["comment"] = f"Flushed ipset entries from set {name} for {family}" return ret else: ret["result"] = False diff --git a/salt/states/iptables.py b/salt/states/iptables.py index 8917f624087..57c8b287cb0 100644 --- a/salt/states/iptables.py +++ b/salt/states/iptables.py @@ -737,7 +737,7 @@ def delete(name, table="filter", family="ipv4", **kwargs): if not result: ret["changes"] = {"locale": name} ret["result"] = True - ret["comment"] = "Delete iptables rule for {} {}".format(name, command.strip()) + ret["comment"] = f"Delete iptables rule for {name} {command.strip()}" if "save" in kwargs and kwargs["save"]: if kwargs["save"] is not True: filename = kwargs["save"] diff --git a/salt/states/jboss7.py b/salt/states/jboss7.py index 1b018196244..9f1dfdb4c30 100644 --- a/salt/states/jboss7.py +++ b/salt/states/jboss7.py @@ -578,7 +578,7 @@ def __get_artifact(salt_source): except Exception as e: # pylint: disable=broad-except log.debug(traceback.format_exc()) - comment = "Unable to manage file: {}".format(e) + comment = f"Unable to manage file: {e}" else: resolved_source = salt_source["target_file"] @@ -674,9 +674,7 @@ def __check_dict_contains(dct, dict_name, keys, comment="", result=True): for key in keys: if key not in dct.keys(): result = False - comment = __append_comment( - "Missing {} in {}".format(key, dict_name), comment - ) + comment = __append_comment(f"Missing {key} in {dict_name}", comment) return result, comment diff --git a/salt/states/jenkins.py b/salt/states/jenkins.py index 4386577a420..b55b05a3716 100644 --- a/salt/states/jenkins.py +++ b/salt/states/jenkins.py @@ -55,7 +55,7 @@ def present(name, config=None, **kwargs): "name": name, "result": True, "changes": {}, - "comment": ["Job {} is up to date.".format(name)], + "comment": [f"Job {name} is up to date."], } if __salt__["jenkins.job_exists"](name): @@ -78,7 +78,7 @@ def present(name, config=None, **kwargs): return _fail(ret, exc.strerror) else: ret["changes"] = "".join(diff) - ret["comment"].append("Job '{}' updated.".format(name)) + ret["comment"].append(f"Job '{name}' updated.") else: cached_source_path = __salt__["cp.cache_file"](config, __env__) @@ -93,7 +93,7 @@ def present(name, config=None, **kwargs): buf = io.StringIO(new_config_xml) diff = difflib.unified_diff("", buf.readlines(), lineterm="") ret["changes"][name] = "".join(diff) - ret["comment"].append("Job '{}' added.".format(name)) + ret["comment"].append(f"Job '{name}' added.") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -114,7 +114,7 @@ def absent(name, **kwargs): except CommandExecutionError as exc: return _fail(ret, exc.strerror) else: - ret["comment"] = "Job '{}' deleted.".format(name) + ret["comment"] = f"Job '{name}' deleted." else: - ret["comment"] = "Job '{}' already absent.".format(name) + ret["comment"] = f"Job '{name}' already absent." return ret diff --git a/salt/states/kapacitor.py b/salt/states/kapacitor.py index 07d33b2457c..94dc7477c49 100644 --- a/salt/states/kapacitor.py +++ b/salt/states/kapacitor.py @@ -75,7 +75,7 @@ def task_present( if not dbrps: dbrps = [] if database and retention_policy: - dbrp = "{}.{}".format(database, retention_policy) + dbrp = f"{database}.{retention_policy}" dbrps.append(dbrp) task_dbrps = [ {"db": dbrp[0], "rp": dbrp[1]} for dbrp in (dbrp.split(".") for dbrp in dbrps) diff --git a/salt/states/keyboard.py b/salt/states/keyboard.py index 0670a431c08..d8c0ede0d61 100644 --- a/salt/states/keyboard.py +++ b/salt/states/keyboard.py @@ -37,15 +37,15 @@ def system(name): ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __salt__["keyboard.get_sys"]() == name: ret["result"] = True - ret["comment"] = "System layout {} already set".format(name) + ret["comment"] = f"System layout {name} already set" return ret if __opts__["test"]: - ret["comment"] = "System layout {} needs to be set".format(name) + ret["comment"] = f"System layout {name} needs to be set" return ret if __salt__["keyboard.set_sys"](name): ret["changes"] = {"layout": name} ret["result"] = True - ret["comment"] = "Set system keyboard layout {}".format(name) + ret["comment"] = f"Set system keyboard layout {name}" return ret else: ret["result"] = False @@ -63,15 +63,15 @@ def xorg(name): ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __salt__["keyboard.get_x"]() == name: ret["result"] = True - ret["comment"] = "XOrg layout {} already set".format(name) + ret["comment"] = f"XOrg layout {name} already set" return ret if __opts__["test"]: - ret["comment"] = "XOrg layout {} needs to be set".format(name) + ret["comment"] = f"XOrg layout {name} needs to be set" return ret if __salt__["keyboard.set_x"](name): ret["changes"] = {"layout": name} ret["result"] = True - ret["comment"] = "Set XOrg keyboard layout {}".format(name) + ret["comment"] = f"Set XOrg keyboard layout {name}" return ret else: ret["result"] = False diff --git a/salt/states/keystone.py b/salt/states/keystone.py index eeab1ce27c4..f3ea1f5ceaa 100644 --- a/salt/states/keystone.py +++ b/salt/states/keystone.py @@ -112,7 +112,7 @@ def user_present( profile=None, password_reset=True, project=None, - **connection_args + **connection_args, ): """ Ensure that the keystone user is present with the specified properties. @@ -162,7 +162,7 @@ def user_present( "name": name, "changes": {}, "result": True, - "comment": 'User "{}" will be updated'.format(name), + "comment": f'User "{name}" will be updated', } _api_version(profile=profile, **connection_args) @@ -177,7 +177,7 @@ def user_present( ) if "Error" in tenantdata: ret["result"] = False - ret["comment"] = 'Tenant / project "{}" does not exist'.format(tenant) + ret["comment"] = f'Tenant / project "{tenant}" does not exist' return ret tenant_id = tenantdata[tenant]["id"] else: @@ -213,52 +213,52 @@ def user_present( change_email or change_enabled or change_tenant or change_password ): ret["result"] = None - ret["comment"] = 'User "{}" will be updated'.format(name) + ret["comment"] = f'User "{name}" will be updated' if change_email is True: ret["changes"]["Email"] = "Will be updated" if change_enabled is True: ret["changes"]["Enabled"] = "Will be True" if change_tenant is True: - ret["changes"]["Tenant"] = 'Will be added to "{}" tenant'.format(tenant) + ret["changes"]["Tenant"] = f'Will be added to "{tenant}" tenant' if change_password is True: ret["changes"]["Password"] = "Will be updated" return ret - ret["comment"] = 'User "{}" is already present'.format(name) + ret["comment"] = f'User "{name}" is already present' if change_email: __salt__["keystone.user_update"]( name=name, email=email, profile=profile, **connection_args ) - ret["comment"] = 'User "{}" has been updated'.format(name) + ret["comment"] = f'User "{name}" has been updated' ret["changes"]["Email"] = "Updated" if change_enabled: __salt__["keystone.user_update"]( name=name, enabled=enabled, profile=profile, **connection_args ) - ret["comment"] = 'User "{}" has been updated'.format(name) - ret["changes"]["Enabled"] = "Now {}".format(enabled) + ret["comment"] = f'User "{name}" has been updated' + ret["changes"]["Enabled"] = f"Now {enabled}" if change_tenant: __salt__["keystone.user_update"]( name=name, tenant=tenant, profile=profile, **connection_args ) - ret["comment"] = 'User "{}" has been updated'.format(name) - ret["changes"]["Tenant"] = 'Added to "{}" tenant'.format(tenant) + ret["comment"] = f'User "{name}" has been updated' + ret["changes"]["Tenant"] = f'Added to "{tenant}" tenant' if change_password: __salt__["keystone.user_password_update"]( name=name, password=password, profile=profile, **connection_args ) - ret["comment"] = 'User "{}" has been updated'.format(name) + ret["comment"] = f'User "{name}" has been updated' ret["changes"]["Password"] = "Updated" if roles: for tenant in roles: args = dict( {"user_name": name, "tenant_name": tenant, "profile": profile}, - **connection_args + **connection_args, ) tenant_roles = __salt__["keystone.user_role_list"](**args) for role in roles[tenant]: @@ -276,7 +276,7 @@ def user_present( "tenant": tenant, "profile": profile, }, - **connection_args + **connection_args, ) newrole = __salt__["keystone.user_role_add"](**addargs) if "roles" in ret["changes"]: @@ -298,7 +298,7 @@ def user_present( "tenant": tenant, "profile": profile, }, - **connection_args + **connection_args, ) oldrole = __salt__["keystone.user_role_remove"](**addargs) if "roles" in ret["changes"]: @@ -309,7 +309,7 @@ def user_present( # Create that user! if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Keystone user "{}" will be added'.format(name) + ret["comment"] = f'Keystone user "{name}" will be added' ret["changes"]["User"] = "Will be created" return ret __salt__["keystone.user_create"]( @@ -319,7 +319,7 @@ def user_present( tenant_id=tenant_id, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) if roles: for tenant in roles: @@ -329,9 +329,9 @@ def user_present( role=role, tenant=tenant, profile=profile, - **connection_args + **connection_args, ) - ret["comment"] = "Keystone user {} has been added".format(name) + ret["comment"] = f"Keystone user {name} has been added" ret["changes"]["User"] = "Created" return ret @@ -348,7 +348,7 @@ def user_absent(name, profile=None, **connection_args): "name": name, "changes": {}, "result": True, - "comment": 'User "{}" is already absent'.format(name), + "comment": f'User "{name}" is already absent', } # Check if user is present @@ -356,11 +356,11 @@ def user_absent(name, profile=None, **connection_args): if "Error" not in user: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'User "{}" will be deleted'.format(name) + ret["comment"] = f'User "{name}" will be deleted' return ret # Delete that user! __salt__["keystone.user_delete"](name=name, profile=profile, **connection_args) - ret["comment"] = 'User "{}" has been deleted'.format(name) + ret["comment"] = f'User "{name}" has been deleted' ret["changes"]["User"] = "Deleted" return ret @@ -385,7 +385,7 @@ def tenant_present( "name": name, "changes": {}, "result": True, - "comment": 'Tenant / project "{}" already exists'.format(name), + "comment": f'Tenant / project "{name}" already exists', } _api_version(profile=profile, **connection_args) @@ -399,7 +399,7 @@ def tenant_present( if tenant[name].get("description", None) != description: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Tenant / project "{}" will be updated'.format(name) + ret["comment"] = f'Tenant / project "{name}" will be updated' ret["changes"]["Description"] = "Will be updated" return ret __salt__["keystone.tenant_update"]( @@ -407,29 +407,29 @@ def tenant_present( description=description, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) - ret["comment"] = 'Tenant / project "{}" has been updated'.format(name) + ret["comment"] = f'Tenant / project "{name}" has been updated' ret["changes"]["Description"] = "Updated" if tenant[name].get("enabled", None) != enabled: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Tenant / project "{}" will be updated'.format(name) - ret["changes"]["Enabled"] = "Will be {}".format(enabled) + ret["comment"] = f'Tenant / project "{name}" will be updated' + ret["changes"]["Enabled"] = f"Will be {enabled}" return ret __salt__["keystone.tenant_update"]( name=name, description=description, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) - ret["comment"] = 'Tenant / project "{}" has been updated'.format(name) - ret["changes"]["Enabled"] = "Now {}".format(enabled) + ret["comment"] = f'Tenant / project "{name}" has been updated' + ret["changes"]["Enabled"] = f"Now {enabled}" else: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Tenant / project "{}" will be added'.format(name) + ret["comment"] = f'Tenant / project "{name}" will be added' ret["changes"]["Tenant"] = "Will be created" return ret # Create tenant @@ -440,7 +440,7 @@ def tenant_present( description=description, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) else: created = __salt__["keystone.tenant_create"]( @@ -448,11 +448,11 @@ def tenant_present( description=description, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) ret["changes"]["Tenant"] = "Created" if created is True else "Failed" ret["result"] = created - ret["comment"] = 'Tenant / project "{}" has been added'.format(name) + ret["comment"] = f'Tenant / project "{name}" has been added' return ret @@ -467,7 +467,7 @@ def tenant_absent(name, profile=None, **connection_args): "name": name, "changes": {}, "result": True, - "comment": 'Tenant / project "{}" is already absent'.format(name), + "comment": f'Tenant / project "{name}" is already absent', } # Check if tenant is present @@ -477,13 +477,13 @@ def tenant_absent(name, profile=None, **connection_args): if "Error" not in tenant: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Tenant / project "{}" will be deleted'.format(name) + ret["comment"] = f'Tenant / project "{name}" will be deleted' return ret # Delete tenant __salt__["keystone.tenant_delete"]( name=name, profile=profile, **connection_args ) - ret["comment"] = 'Tenant / project "{}" has been deleted'.format(name) + ret["comment"] = f'Tenant / project "{name}" has been deleted' ret["changes"]["Tenant/Project"] = "Deleted" return ret @@ -522,7 +522,7 @@ def project_present( description=description, enabled=enabled, profile=profile, - **connection_args + **connection_args, ) @@ -558,7 +558,7 @@ def role_present(name, profile=None, **connection_args): "name": name, "changes": {}, "result": True, - "comment": 'Role "{}" already exists'.format(name), + "comment": f'Role "{name}" already exists', } # Check if role is already present @@ -569,11 +569,11 @@ def role_present(name, profile=None, **connection_args): else: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Role "{}" will be added'.format(name) + ret["comment"] = f'Role "{name}" will be added' return ret # Create role __salt__["keystone.role_create"](name, profile=profile, **connection_args) - ret["comment"] = 'Role "{}" has been added'.format(name) + ret["comment"] = f'Role "{name}" has been added' ret["changes"]["Role"] = "Created" return ret @@ -589,7 +589,7 @@ def role_absent(name, profile=None, **connection_args): "name": name, "changes": {}, "result": True, - "comment": 'Role "{}" is already absent'.format(name), + "comment": f'Role "{name}" is already absent', } # Check if role is present @@ -597,11 +597,11 @@ def role_absent(name, profile=None, **connection_args): if "Error" not in role: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Role "{}" will be deleted'.format(name) + ret["comment"] = f'Role "{name}" will be deleted' return ret # Delete role __salt__["keystone.role_delete"](name=name, profile=profile, **connection_args) - ret["comment"] = 'Role "{}" has been deleted'.format(name) + ret["comment"] = f'Role "{name}" has been deleted' ret["changes"]["Role"] = "Deleted" return ret @@ -626,7 +626,7 @@ def service_present( "name": name, "changes": {}, "result": True, - "comment": 'Service "{}" already exists'.format(name), + "comment": f'Service "{name}" already exists', } # Check if service is already present @@ -639,13 +639,13 @@ def service_present( else: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Service "{}" will be added'.format(name) + ret["comment"] = f'Service "{name}" will be added' return ret # Create service __salt__["keystone.service_create"]( name, service_type, description, profile=profile, **connection_args ) - ret["comment"] = 'Service "{}" has been added'.format(name) + ret["comment"] = f'Service "{name}" has been added' ret["changes"]["Service"] = "Created" return ret @@ -662,7 +662,7 @@ def service_absent(name, profile=None, **connection_args): "name": name, "changes": {}, "result": True, - "comment": 'Service "{}" is already absent'.format(name), + "comment": f'Service "{name}" is already absent', } # Check if service is present @@ -672,13 +672,13 @@ def service_absent(name, profile=None, **connection_args): if "Error" not in role: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Service "{}" will be deleted'.format(name) + ret["comment"] = f'Service "{name}" will be deleted' return ret # Delete service __salt__["keystone.service_delete"]( name=name, profile=profile, **connection_args ) - ret["comment"] = 'Service "{}" has been deleted'.format(name) + ret["comment"] = f'Service "{name}" has been deleted' ret["changes"]["Service"] = "Deleted" return ret @@ -693,7 +693,7 @@ def endpoint_present( profile=None, url=None, interface=None, - **connection_args + **connection_args, ): """ Ensure the specified endpoints exists for service @@ -740,7 +740,7 @@ def endpoint_present( url=url, interface=interface, profile=profile, - **connection_args + **connection_args, ) else: ret["changes"] = __salt__["keystone.endpoint_create"]( @@ -750,7 +750,7 @@ def endpoint_present( adminurl=adminurl, internalurl=internalurl, profile=profile, - **connection_args + **connection_args, ) if endpoint and "Error" not in endpoint and endpoint.get("region") == region: @@ -844,20 +844,20 @@ def endpoint_present( name, region, profile=profile, interface=interface, **connection_args ) _create_endpoint() - ret["comment"] += 'Endpoint for service "{}" has been updated'.format(name) + ret["comment"] += f'Endpoint for service "{name}" has been updated' else: # Add new endpoint if __opts__.get("test"): ret["result"] = None ret["changes"]["Endpoint"] = "Will be created" - ret["comment"] = 'Endpoint for service "{}" will be added'.format(name) + ret["comment"] = f'Endpoint for service "{name}" will be added' return ret _create_endpoint() - ret["comment"] = 'Endpoint for service "{}" has been added'.format(name) + ret["comment"] = f'Endpoint for service "{name}" has been added' if ret["comment"] == "": # => no changes - ret["comment"] = 'Endpoint for service "{}" already exists'.format(name) + ret["comment"] = f'Endpoint for service "{name}" already exists' return ret @@ -881,7 +881,7 @@ def endpoint_absent(name, region=None, profile=None, interface=None, **connectio "result": True, "comment": 'Endpoint for service "{}"{} is already absent'.format( name, - ', interface "{}",'.format(interface) if interface is not None else "", + f', interface "{interface}",' if interface is not None else "", ), } @@ -894,7 +894,7 @@ def endpoint_absent(name, region=None, profile=None, interface=None, **connectio else: if __opts__.get("test"): ret["result"] = None - ret["comment"] = 'Endpoint for service "{}" will be deleted'.format(name) + ret["comment"] = f'Endpoint for service "{name}" will be deleted' return ret # Delete service __salt__["keystone.endpoint_delete"]( @@ -902,7 +902,7 @@ def endpoint_absent(name, region=None, profile=None, interface=None, **connectio ) ret["comment"] = 'Endpoint for service "{}"{} has been deleted'.format( name, - ', interface "{}",'.format(interface) if interface is not None else "", + f', interface "{interface}",' if interface is not None else "", ) ret["changes"]["endpoint"] = "Deleted" return ret diff --git a/salt/states/keystone_domain.py b/salt/states/keystone_domain.py index a639aec50f3..b722238ae73 100644 --- a/salt/states/keystone_domain.py +++ b/salt/states/keystone_domain.py @@ -64,7 +64,7 @@ def present(name, auth=None, **kwargs): if __opts__["test"]: ret["result"] = None ret["changes"] = kwargs - ret["comment"] = "Domain {} will be created.".format(name) + ret["comment"] = f"Domain {name} will be created." return ret kwargs["name"] = name @@ -78,7 +78,7 @@ def present(name, auth=None, **kwargs): if __opts__["test"]: ret["result"] = None ret["changes"] = changes - ret["comment"] = "Domain {} will be updated.".format(name) + ret["comment"] = f"Domain {name} will be updated." return ret kwargs["domain_id"] = domain.id @@ -106,7 +106,7 @@ def absent(name, auth=None): if __opts__["test"] is True: ret["result"] = None ret["changes"] = {"name": name} - ret["comment"] = "Domain {} will be deleted.".format(name) + ret["comment"] = f"Domain {name} will be deleted." return ret __salt__["keystoneng.domain_delete"](name=domain) diff --git a/salt/states/keystore.py b/salt/states/keystore.py index de1586e1a5f..9e6abb72769 100644 --- a/salt/states/keystore.py +++ b/salt/states/keystore.py @@ -146,12 +146,12 @@ def managed(name, passphrase, entries, force_remove=False): log.debug("Will remove: %s", remove_list) for alias_name in remove_list: if __opts__["test"]: - ret["comment"] += "Alias {} would have been removed".format(alias_name) + ret["comment"] += f"Alias {alias_name} would have been removed" ret["result"] = None else: __salt__["keystore.remove"](alias_name, name, passphrase) ret["changes"][alias_name] = "Removed" - ret["comment"] += "Alias {} removed.\n".format(alias_name) + ret["comment"] += f"Alias {alias_name} removed.\n" if not ret["changes"] and not ret["comment"]: ret["comment"] = "No changes made.\n" diff --git a/salt/states/kmod.py b/salt/states/kmod.py index 0bb257412f3..92b8cb8e7b7 100644 --- a/salt/states/kmod.py +++ b/salt/states/kmod.py @@ -84,7 +84,7 @@ def present(name, persist=False, mods=None): # Intersection of loaded and proposed modules already_loaded = list(set(loaded_mods) & set(mods)) if len(already_loaded) == 1: - comment = "Kernel module {} is already present".format(already_loaded[0]) + comment = f"Kernel module {already_loaded[0]} is already present" _append_comment(ret, comment) elif len(already_loaded) > 1: comment = "Kernel modules {} are already present".format( @@ -103,7 +103,7 @@ def present(name, persist=False, mods=None): if ret["comment"]: ret["comment"] += "\n" if len(not_loaded) == 1: - comment = "Kernel module {} is set to be loaded".format(not_loaded[0]) + comment = f"Kernel module {not_loaded[0]} is set to be loaded" else: comment = "Kernel modules {} are set to be loaded".format( ", ".join(not_loaded) @@ -115,7 +115,7 @@ def present(name, persist=False, mods=None): unavailable = list(set(not_loaded) - set(__salt__["kmod.available"]())) if unavailable: if len(unavailable) == 1: - comment = "Kernel module {} is unavailable".format(unavailable[0]) + comment = f"Kernel module {unavailable[0]} is unavailable" else: comment = "Kernel modules {} are unavailable".format(", ".join(unavailable)) _append_comment(ret, comment) @@ -161,7 +161,7 @@ def present(name, persist=False, mods=None): if loaded["failed"]: for mod, msg in loaded["failed"]: - _append_comment(ret, "Failed to load kernel module {}: {}".format(mod, msg)) + _append_comment(ret, f"Failed to load kernel module {mod}: {msg}") return ret @@ -205,7 +205,7 @@ def absent(name, persist=False, comment=True, mods=None): ret["result"] = None if len(to_unload) == 1: _append_comment( - ret, "Kernel module {} is set to be removed".format(to_unload[0]) + ret, f"Kernel module {to_unload[0]} is set to be removed" ) elif len(to_unload) > 1: _append_comment( @@ -252,15 +252,13 @@ def absent(name, persist=False, comment=True, mods=None): if unloaded["failed"]: for mod, msg in unloaded["failed"]: - _append_comment( - ret, "Failed to remove kernel module {}: {}".format(mod, msg) - ) + _append_comment(ret, f"Failed to remove kernel module {mod}: {msg}") return ret else: if len(mods) == 1: - ret["comment"] = "Kernel module {} is already removed".format(mods[0]) + ret["comment"] = f"Kernel module {mods[0]} is already removed" else: ret["comment"] = "Kernel modules {} are already removed".format( ", ".join(mods) diff --git a/salt/states/kubernetes.py b/salt/states/kubernetes.py index ed78f34ab30..687ead546f0 100644 --- a/salt/states/kubernetes.py +++ b/salt/states/kubernetes.py @@ -136,7 +136,7 @@ def deployment_absent(name, namespace="default", **kwargs): ret["changes"] = {"kubernetes.deployment": {"new": "absent", "old": "present"}} ret["comment"] = res["message"] else: - ret["comment"] = "Something went wrong, response: {}".format(res) + ret["comment"] = f"Something went wrong, response: {res}" return ret @@ -148,7 +148,7 @@ def deployment_present( spec=None, source="", template="", - **kwargs + **kwargs, ): """ Ensures that the named deployment is present inside of the specified @@ -203,9 +203,9 @@ def deployment_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) - ret["changes"]["{}.{}".format(namespace, name)] = {"old": {}, "new": res} + ret["changes"][f"{namespace}.{name}"] = {"old": {}, "new": res} else: if __opts__["test"]: ret["result"] = None @@ -222,7 +222,7 @@ def deployment_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) ret["changes"] = {"metadata": metadata, "spec": spec} @@ -237,7 +237,7 @@ def service_present( spec=None, source="", template="", - **kwargs + **kwargs, ): """ Ensures that the named service is present inside of the specified namespace @@ -292,9 +292,9 @@ def service_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) - ret["changes"]["{}.{}".format(namespace, name)] = {"old": {}, "new": res} + ret["changes"][f"{namespace}.{name}"] = {"old": {}, "new": res} else: if __opts__["test"]: ret["result"] = None @@ -312,7 +312,7 @@ def service_present( template=template, old_service=service, saltenv=__env__, - **kwargs + **kwargs, ) ret["changes"] = {"metadata": metadata, "spec": spec} @@ -351,7 +351,7 @@ def service_absent(name, namespace="default", **kwargs): ret["changes"] = {"kubernetes.service": {"new": "absent", "old": "present"}} ret["comment"] = res["message"] else: - ret["comment"] = "Something went wrong, response: {}".format(res) + ret["comment"] = f"Something went wrong, response: {res}" return ret @@ -391,7 +391,7 @@ def namespace_absent(name, **kwargs): else: ret["comment"] = "Terminating" else: - ret["comment"] = "Something went wrong, response: {}".format(res) + ret["comment"] = f"Something went wrong, response: {res}" return ret @@ -506,9 +506,9 @@ def secret_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) - ret["changes"]["{}.{}".format(namespace, name)] = {"old": {}, "new": res} + ret["changes"][f"{namespace}.{name}"] = {"old": {}, "new": res} else: if __opts__["test"]: ret["result"] = None @@ -525,7 +525,7 @@ def secret_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) ret["changes"] = { @@ -620,9 +620,9 @@ def configmap_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) - ret["changes"]["{}.{}".format(namespace, name)] = {"old": {}, "new": res} + ret["changes"][f"{namespace}.{name}"] = {"old": {}, "new": res} else: if __opts__["test"]: ret["result"] = None @@ -639,7 +639,7 @@ def configmap_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) ret["changes"] = {"data": res["data"]} @@ -681,7 +681,7 @@ def pod_absent(name, namespace="default", **kwargs): else: ret["comment"] = res["message"] else: - ret["comment"] = "Something went wrong, response: {}".format(res) + ret["comment"] = f"Something went wrong, response: {res}" return ret @@ -693,7 +693,7 @@ def pod_present( spec=None, source="", template="", - **kwargs + **kwargs, ): """ Ensures that the named pod is present inside of the specified @@ -748,9 +748,9 @@ def pod_present( source=source, template=template, saltenv=__env__, - **kwargs + **kwargs, ) - ret["changes"]["{}.{}".format(namespace, name)] = {"old": {}, "new": res} + ret["changes"][f"{namespace}.{name}"] = {"old": {}, "new": res} else: if __opts__["test"]: ret["result"] = None @@ -896,7 +896,7 @@ def node_label_present(name, node, value, **kwargs): old_labels = copy.copy(labels) labels[name] = value - ret["changes"]["{}.{}".format(node, name)] = {"old": old_labels, "new": labels} + ret["changes"][f"{node}.{name}"] = {"old": old_labels, "new": labels} ret["result"] = True return ret diff --git a/salt/states/layman.py b/salt/states/layman.py index 00d65c458be..6a7a552f12a 100644 --- a/salt/states/layman.py +++ b/salt/states/layman.py @@ -31,15 +31,15 @@ def present(name): # Overlay already present if name in __salt__["layman.list_local"](): - ret["comment"] = "Overlay {} already present".format(name) + ret["comment"] = f"Overlay {name} already present" elif __opts__["test"]: - ret["comment"] = "Overlay {} is set to be added".format(name) + ret["comment"] = f"Overlay {name} is set to be added" ret["result"] = None return ret else: # Does the overlay exist? if name not in __salt__["layman.list_all"](): - ret["comment"] = "Overlay {} not found".format(name) + ret["comment"] = f"Overlay {name} not found" ret["result"] = False else: # Attempt to add the overlay @@ -47,12 +47,12 @@ def present(name): # The overlay failed to add if len(changes) < 1: - ret["comment"] = "Overlay {} failed to add".format(name) + ret["comment"] = f"Overlay {name} failed to add" ret["result"] = False # Success else: ret["changes"]["added"] = changes - ret["comment"] = "Overlay {} added.".format(name) + ret["comment"] = f"Overlay {name} added." return ret @@ -68,9 +68,9 @@ def absent(name): # Overlay is already absent if name not in __salt__["layman.list_local"](): - ret["comment"] = "Overlay {} already absent".format(name) + ret["comment"] = f"Overlay {name} already absent" elif __opts__["test"]: - ret["comment"] = "Overlay {} is set to be deleted".format(name) + ret["comment"] = f"Overlay {name} is set to be deleted" ret["result"] = None return ret else: @@ -79,11 +79,11 @@ def absent(name): # The overlay failed to delete if len(changes) < 1: - ret["comment"] = "Overlay {} failed to delete".format(name) + ret["comment"] = f"Overlay {name} failed to delete" ret["result"] = False # Success else: ret["changes"]["deleted"] = changes - ret["comment"] = "Overlay {} deleted.".format(name) + ret["comment"] = f"Overlay {name} deleted." return ret diff --git a/salt/states/libcloud_dns.py b/salt/states/libcloud_dns.py index a78a5d17dde..d9d6c41ff08 100644 --- a/salt/states/libcloud_dns.py +++ b/salt/states/libcloud_dns.py @@ -185,6 +185,6 @@ def record_absent(name, zone, type, data, profile): matching_zone["id"], record["id"], profile ) ) - return state_result(all(result), "Removed {} records".format(len(result)), name) + return state_result(all(result), f"Removed {len(result)} records", name) else: return state_result(True, "Records already absent", name) diff --git a/salt/states/linux_acl.py b/salt/states/linux_acl.py index 582b6bb8b7d..9143c91bd52 100644 --- a/salt/states/linux_acl.py +++ b/salt/states/linux_acl.py @@ -105,7 +105,7 @@ def present(name, acl_type, acl_name="", perms="", recurse=False, force=False): _octal_lookup = {0: "-", 1: "r", 2: "w", 4: "x"} if not os.path.exists(name): - ret["comment"] = "{} does not exist".format(name) + ret["comment"] = f"{name} does not exist" ret["result"] = False return ret @@ -220,7 +220,7 @@ def present(name, acl_type, acl_name="", perms="", recurse=False, force=False): ) ret.update( { - "comment": "Updated permissions for {}".format(acl_name), + "comment": f"Updated permissions for {acl_name}", "result": True, "changes": changes, } @@ -261,7 +261,7 @@ def present(name, acl_type, acl_name="", perms="", recurse=False, force=False): ) ret.update( { - "comment": "Applied new permissions for {}".format(acl_name), + "comment": f"Applied new permissions for {acl_name}", "result": True, "changes": changes, } @@ -305,7 +305,7 @@ def absent(name, acl_type, acl_name="", perms="", recurse=False): ret = {"name": name, "result": True, "changes": {}, "comment": ""} if not os.path.exists(name): - ret["comment"] = "{} does not exist".format(name) + ret["comment"] = f"{name} does not exist" ret["result"] = False return ret @@ -403,7 +403,7 @@ def list_present(name, acl_type, acl_names=None, perms="", recurse=False, force= _octal = {"r": 4, "w": 2, "x": 1, "-": 0} _octal_perms = sum(_octal.get(i, i) for i in perms) if not os.path.exists(name): - ret["comment"] = "{} does not exist".format(name) + ret["comment"] = f"{name} does not exist" ret["result"] = False return ret @@ -692,7 +692,7 @@ def list_absent(name, acl_type, acl_names=None, recurse=False): ret = {"name": name, "result": True, "changes": {}, "comment": ""} if not os.path.exists(name): - ret["comment"] = "{} does not exist".format(name) + ret["comment"] = f"{name} does not exist" ret["result"] = False return ret diff --git a/salt/states/locale.py b/salt/states/locale.py index 856e17d2747..2fd35a4a29f 100644 --- a/salt/states/locale.py +++ b/salt/states/locale.py @@ -40,23 +40,23 @@ def system(name): try: if __salt__["locale.get_locale"]() == name: ret["result"] = True - ret["comment"] = "System locale {} already set".format(name) + ret["comment"] = f"System locale {name} already set" return ret if __opts__["test"]: - ret["comment"] = "System locale {} needs to be set".format(name) + ret["comment"] = f"System locale {name} needs to be set" return ret if __salt__["locale.set_locale"](name): ret["changes"] = {"locale": name} ret["result"] = True - ret["comment"] = "Set system locale {}".format(name) + ret["comment"] = f"Set system locale {name}" return ret else: ret["result"] = False - ret["comment"] = "Failed to set system locale to {}".format(name) + ret["comment"] = f"Failed to set system locale to {name}" return ret except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Failed to set system locale: {}".format(err) + ret["comment"] = f"Failed to set system locale: {err}" return ret @@ -73,17 +73,17 @@ def present(name): ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __salt__["locale.avail"](name): ret["result"] = True - ret["comment"] = "Locale {} is already present".format(name) + ret["comment"] = f"Locale {name} is already present" return ret if __opts__["test"]: - ret["comment"] = "Locale {} needs to be generated".format(name) + ret["comment"] = f"Locale {name} needs to be generated" return ret if __salt__["locale.gen_locale"](name): ret["changes"] = {"locale": name} ret["result"] = True - ret["comment"] = "Generated locale {}".format(name) + ret["comment"] = f"Generated locale {name}" return ret else: ret["result"] = False - ret["comment"] = "Failed to generate locale {}".format(name) + ret["comment"] = f"Failed to generate locale {name}" return ret diff --git a/salt/states/logadm.py b/salt/states/logadm.py index d2b33e32b4f..e1f81b4e014 100644 --- a/salt/states/logadm.py +++ b/salt/states/logadm.py @@ -152,12 +152,12 @@ def remove(name, log_file=None): res = __salt__["logadm.remove"](name if name else log_file) ret["result"] = "Error" not in res if ret["result"]: - ret["comment"] = "Configuration for {} removed.".format(log_file) + ret["comment"] = f"Configuration for {log_file} removed." ret["changes"][log_file] = None else: ret["comment"] = res["Error"] else: ret["result"] = True - ret["comment"] = "No configuration for {} present.".format(log_file) + ret["comment"] = f"No configuration for {log_file} present." return ret diff --git a/salt/states/logrotate.py b/salt/states/logrotate.py index aaeb49cec0f..d65d2ce28ac 100644 --- a/salt/states/logrotate.py +++ b/salt/states/logrotate.py @@ -84,10 +84,10 @@ def set_(name, key, value, setting=None, conf_file=_DEFAULT_CONF): value = _convert_if_int(value) if current_value == value: - ret["comment"] = "Command '{}' already has value: {}".format(key, value) + ret["comment"] = f"Command '{key}' already has value: {value}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Command '{}' will be set to value: {}".format(key, value) + ret["comment"] = f"Command '{key}' will be set to value: {value}" ret["changes"] = {"old": current_value, "new": value} else: ret["changes"] = {"old": current_value, "new": value} @@ -95,7 +95,7 @@ def set_(name, key, value, setting=None, conf_file=_DEFAULT_CONF): key=key, value=value, conf_file=conf_file ) if ret["result"]: - ret["comment"] = "Set command '{}' value: {}".format(key, value) + ret["comment"] = f"Set command '{key}' value: {value}" else: ret["comment"] = "Unable to set command '{}' value: {}".format( key, value diff --git a/salt/states/loop.py b/salt/states/loop.py index e99ab55abbe..a2434daeff2 100644 --- a/salt/states/loop.py +++ b/salt/states/loop.py @@ -95,7 +95,7 @@ def until(name, m_args=None, m_kwargs=None, condition=None, period=1, timeout=60 m_kwargs = {} if name not in __salt__: - ret["comment"] = "Cannot find module {}".format(name) + ret["comment"] = f"Cannot find module {name}" elif condition is None: ret["comment"] = "An exit condition must be specified" elif not isinstance(period, (int, float)): @@ -103,7 +103,7 @@ def until(name, m_args=None, m_kwargs=None, condition=None, period=1, timeout=60 elif not isinstance(timeout, (int, float)): ret["comment"] = "Timeout must be specified as a float in seconds" elif __opts__["test"]: - ret["comment"] = "The execution module {} will be run".format(name) + ret["comment"] = f"The execution module {name} will be run" ret["result"] = None else: if m_args is None: @@ -116,7 +116,7 @@ def until(name, m_args=None, m_kwargs=None, condition=None, period=1, timeout=60 m_ret = __salt__[name](*m_args, **m_kwargs) if eval(condition): # pylint: disable=W0123 ret["result"] = True - ret["comment"] = "Condition {} was met".format(condition) + ret["comment"] = f"Condition {condition} was met" break time.sleep(period) else: @@ -161,7 +161,7 @@ def until_no_eval( """ ret = {"name": name, "comment": "", "changes": {}, "result": False} if name not in __salt__: - ret["comment"] = 'Module.function "{}" is unavailable.'.format(name) + ret["comment"] = f'Module.function "{name}" is unavailable.' elif not isinstance(period, (int, float)): ret["comment"] = "Period must be specified as a float in seconds" elif not isinstance(timeout, (int, float)): @@ -171,7 +171,7 @@ def until_no_eval( elif compare_operator in __utils__: comparator = __utils__[compare_operator] elif not hasattr(operator, compare_operator): - ret["comment"] = 'Invalid operator "{}" supplied.'.format(compare_operator) + ret["comment"] = f'Invalid operator "{compare_operator}" supplied.' else: comparator = getattr(operator, compare_operator) if __opts__["test"]: diff --git a/salt/states/lvm.py b/salt/states/lvm.py index a7a1df8b609..5b4bdad8696 100644 --- a/salt/states/lvm.py +++ b/salt/states/lvm.py @@ -50,7 +50,7 @@ def _convert_to_mb(size): if str_size[-1:].isdigit(): size = int(str_size) else: - raise salt.exceptions.ArgumentValueError("Size {} is invalid.".format(size)) + raise salt.exceptions.ArgumentValueError(f"Size {size} is invalid.") if unit == "s": target_size = size / 2048 @@ -63,7 +63,7 @@ def _convert_to_mb(size): elif unit == "p": target_size = size * 1024 * 1024 * 1024 else: - raise salt.exceptions.ArgumentValueError("Unit {} is invalid.".format(unit)) + raise salt.exceptions.ArgumentValueError(f"Unit {unit} is invalid.") return target_size @@ -81,19 +81,19 @@ def pv_present(name, **kwargs): ret = {"changes": {}, "comment": "", "name": name, "result": True} if __salt__["lvm.pvdisplay"](name, quiet=True): - ret["comment"] = "Physical Volume {} already present".format(name) + ret["comment"] = f"Physical Volume {name} already present" elif __opts__["test"]: - ret["comment"] = "Physical Volume {} is set to be created".format(name) + ret["comment"] = f"Physical Volume {name} is set to be created" ret["result"] = None return ret else: changes = __salt__["lvm.pvcreate"](name, **kwargs) if __salt__["lvm.pvdisplay"](name): - ret["comment"] = "Created Physical Volume {}".format(name) + ret["comment"] = f"Created Physical Volume {name}" ret["changes"]["created"] = changes else: - ret["comment"] = "Failed to create Physical Volume {}".format(name) + ret["comment"] = f"Failed to create Physical Volume {name}" ret["result"] = False return ret @@ -108,19 +108,19 @@ def pv_absent(name): ret = {"changes": {}, "comment": "", "name": name, "result": True} if not __salt__["lvm.pvdisplay"](name, quiet=True): - ret["comment"] = "Physical Volume {} does not exist".format(name) + ret["comment"] = f"Physical Volume {name} does not exist" elif __opts__["test"]: - ret["comment"] = "Physical Volume {} is set to be removed".format(name) + ret["comment"] = f"Physical Volume {name} is set to be removed" ret["result"] = None return ret else: changes = __salt__["lvm.pvremove"](name) if __salt__["lvm.pvdisplay"](name, quiet=True): - ret["comment"] = "Failed to remove Physical Volume {}".format(name) + ret["comment"] = f"Failed to remove Physical Volume {name}" ret["result"] = False else: - ret["comment"] = "Removed Physical Volume {}".format(name) + ret["comment"] = f"Removed Physical Volume {name}" ret["changes"]["removed"] = changes return ret @@ -144,23 +144,23 @@ def vg_present(name, devices=None, **kwargs): devices = devices.split(",") if __salt__["lvm.vgdisplay"](name, quiet=True): - ret["comment"] = "Volume Group {} already present".format(name) + ret["comment"] = f"Volume Group {name} already present" for device in devices: realdev = os.path.realpath(device) pvs = __salt__["lvm.pvdisplay"](realdev, real=True) if pvs and pvs.get(realdev, None): if pvs[realdev]["Volume Group Name"] == name: ret["comment"] = "{}\n{}".format( - ret["comment"], "{} is part of Volume Group".format(device) + ret["comment"], f"{device} is part of Volume Group" ) elif pvs[realdev]["Volume Group Name"] in ["", "#orphans_lvm2"]: __salt__["lvm.vgextend"](name, device) pvs = __salt__["lvm.pvdisplay"](realdev, real=True) if pvs[realdev]["Volume Group Name"] == name: - ret["changes"].update({device: "added to {}".format(name)}) + ret["changes"].update({device: f"added to {name}"}) else: ret["comment"] = "{}\n{}".format( - ret["comment"], "{} could not be added".format(device) + ret["comment"], f"{device} could not be added" ) ret["result"] = False else: @@ -173,21 +173,21 @@ def vg_present(name, devices=None, **kwargs): ret["result"] = False else: ret["comment"] = "{}\n{}".format( - ret["comment"], "pv {} is not present".format(device) + ret["comment"], f"pv {device} is not present" ) ret["result"] = False elif __opts__["test"]: - ret["comment"] = "Volume Group {} is set to be created".format(name) + ret["comment"] = f"Volume Group {name} is set to be created" ret["result"] = None return ret else: changes = __salt__["lvm.vgcreate"](name, devices, **kwargs) if __salt__["lvm.vgdisplay"](name): - ret["comment"] = "Created Volume Group {}".format(name) + ret["comment"] = f"Created Volume Group {name}" ret["changes"]["created"] = changes else: - ret["comment"] = "Failed to create Volume Group {}".format(name) + ret["comment"] = f"Failed to create Volume Group {name}" ret["result"] = False return ret @@ -202,19 +202,19 @@ def vg_absent(name): ret = {"changes": {}, "comment": "", "name": name, "result": True} if not __salt__["lvm.vgdisplay"](name, quiet=True): - ret["comment"] = "Volume Group {} already absent".format(name) + ret["comment"] = f"Volume Group {name} already absent" elif __opts__["test"]: - ret["comment"] = "Volume Group {} is set to be removed".format(name) + ret["comment"] = f"Volume Group {name} is set to be removed" ret["result"] = None return ret else: changes = __salt__["lvm.vgremove"](name) if not __salt__["lvm.vgdisplay"](name, quiet=True): - ret["comment"] = "Removed Volume Group {}".format(name) + ret["comment"] = f"Removed Volume Group {name}" ret["changes"]["removed"] = changes else: - ret["comment"] = "Failed to remove Volume Group {}".format(name) + ret["comment"] = f"Failed to remove Volume Group {name}" ret["result"] = False return ret @@ -230,7 +230,7 @@ def lv_present( thinpool=False, force=False, resizefs=False, - **kwargs + **kwargs, ): """ Ensure that a Logical Volume is present, creating it if absent. @@ -299,14 +299,14 @@ def lv_present( if thinvolume: lvpath = "/dev/{}/{}".format(vgname.split("/")[0], name) else: - lvpath = "/dev/{}/{}".format(vgname, name) + lvpath = f"/dev/{vgname}/{name}" lv_info = __salt__["lvm.lvdisplay"](lvpath, quiet=True) lv_info = lv_info.get(lvpath) if not lv_info: if __opts__["test"]: - ret["comment"] = "Logical Volume {} is set to be created".format(name) + ret["comment"] = f"Logical Volume {name} is set to be created" ret["result"] = None return ret else: @@ -320,11 +320,11 @@ def lv_present( thinvolume=thinvolume, thinpool=thinpool, force=force, - **kwargs + **kwargs, ) if __salt__["lvm.lvdisplay"](lvpath): - ret["comment"] = "Created Logical Volume {}".format(name) + ret["comment"] = f"Created Logical Volume {name}" ret["changes"]["created"] = changes else: ret["comment"] = "Failed to create Logical Volume {}. Error: {}".format( @@ -332,7 +332,7 @@ def lv_present( ) ret["result"] = False else: - ret["comment"] = "Logical Volume {} already present".format(name) + ret["comment"] = f"Logical Volume {name} already present" if size or extents: old_extents = int(lv_info["Current Logical Extents Associated"]) @@ -386,7 +386,7 @@ def lv_present( lv_info = __salt__["lvm.lvdisplay"](lvpath, quiet=True)[lvpath] new_size_mb = _convert_to_mb(lv_info["Logical Volume Size"] + "s") if new_size_mb != old_size_mb: - ret["comment"] = "Resized Logical Volume {}".format(name) + ret["comment"] = f"Resized Logical Volume {name}" ret["changes"]["resized"] = changes else: ret["comment"] = ( @@ -410,20 +410,20 @@ def lv_absent(name, vgname=None): """ ret = {"changes": {}, "comment": "", "name": name, "result": True} - lvpath = "/dev/{}/{}".format(vgname, name) + lvpath = f"/dev/{vgname}/{name}" if not __salt__["lvm.lvdisplay"](lvpath, quiet=True): - ret["comment"] = "Logical Volume {} already absent".format(name) + ret["comment"] = f"Logical Volume {name} already absent" elif __opts__["test"]: - ret["comment"] = "Logical Volume {} is set to be removed".format(name) + ret["comment"] = f"Logical Volume {name} is set to be removed" ret["result"] = None return ret else: changes = __salt__["lvm.lvremove"](name, vgname) if not __salt__["lvm.lvdisplay"](lvpath, quiet=True): - ret["comment"] = "Removed Logical Volume {}".format(name) + ret["comment"] = f"Removed Logical Volume {name}" ret["changes"]["removed"] = changes else: - ret["comment"] = "Failed to remove Logical Volume {}".format(name) + ret["comment"] = f"Failed to remove Logical Volume {name}" ret["result"] = False return ret diff --git a/salt/states/lvs_service.py b/salt/states/lvs_service.py index 8aee6a062f0..5a1981d4426 100644 --- a/salt/states/lvs_service.py +++ b/salt/states/lvs_service.py @@ -53,7 +53,7 @@ def present( protocol=protocol, service_address=service_address, scheduler=scheduler ) if service_rule_check is True: - ret["comment"] = "LVS Service {} is present".format(name) + ret["comment"] = f"LVS Service {name} is present" return ret else: if __opts__["test"]: @@ -71,17 +71,17 @@ def present( scheduler=scheduler, ) if service_edit is True: - ret["comment"] = "LVS Service {} has been updated".format(name) + ret["comment"] = f"LVS Service {name} has been updated" ret["changes"][name] = "Update" return ret else: ret["result"] = False - ret["comment"] = "LVS Service {} update failed".format(name) + ret["comment"] = f"LVS Service {name} update failed" return ret else: if __opts__["test"]: ret["comment"] = ( - "LVS Service {} is not present and needs to be created".format(name) + f"LVS Service {name} is not present and needs to be created" ) ret["result"] = None return ret @@ -90,7 +90,7 @@ def present( protocol=protocol, service_address=service_address, scheduler=scheduler ) if service_add is True: - ret["comment"] = "LVS Service {} has been created".format(name) + ret["comment"] = f"LVS Service {name} has been created" ret["changes"][name] = "Present" return ret else: @@ -131,7 +131,7 @@ def absent(name, protocol=None, service_address=None): protocol=protocol, service_address=service_address ) if service_delete is True: - ret["comment"] = "LVS Service {} has been removed".format(name) + ret["comment"] = f"LVS Service {name} has been removed" ret["changes"][name] = "Absent" return ret else: @@ -141,8 +141,6 @@ def absent(name, protocol=None, service_address=None): ret["result"] = False return ret else: - ret["comment"] = ( - "LVS Service {} is not present, so it cannot be removed".format(name) - ) + ret["comment"] = f"LVS Service {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/lxc.py b/salt/states/lxc.py index 98ccd67fcb2..05b7081d122 100644 --- a/salt/states/lxc.py +++ b/salt/states/lxc.py @@ -150,7 +150,7 @@ def present( ret = { "name": name, "result": True, - "comment": "Container '{}' already exists".format(name), + "comment": f"Container '{name}' already exists", "changes": {}, } @@ -178,17 +178,17 @@ def present( # Sanity check(s) if clone_from and not __salt__["lxc.exists"](clone_from, path=path): ret["result"] = False - ret["comment"] = "Clone source '{}' does not exist".format(clone_from) + ret["comment"] = f"Clone source '{clone_from}' does not exist" if not ret["result"]: return ret - action = "cloned from {}".format(clone_from) if clone_from else "created" + action = f"cloned from {clone_from}" if clone_from else "created" state = {"old": __salt__["lxc.state"](name, path=path)} if __opts__["test"]: if state["old"] is None: ret["comment"] = "Container '{}' will be {}".format( - name, "cloned from {}".format(clone_from) if clone_from else "created" + name, f"cloned from {clone_from}" if clone_from else "created" ) ret["result"] = None return ret @@ -209,7 +209,7 @@ def present( return ret else: if state["old"] in ("frozen", "running"): - ret["comment"] = "Container '{}' would be stopped".format(name) + ret["comment"] = f"Container '{name}' would be stopped" ret["result"] = None return ret else: @@ -256,7 +256,7 @@ def present( clone_from, name ) else: - ret["comment"] = "Created container '{}'".format(name) + ret["comment"] = f"Created container '{name}'" state["new"] = result["state"]["new"] if ret["result"] is True: @@ -278,7 +278,7 @@ def present( ret["comment"] += error except (SaltInvocationError, CommandExecutionError) as exc: ret["result"] = False - ret["comment"] += "{}: {}".format(error, exc) + ret["comment"] += f"{error}: {exc}" else: if state["old"] is None: ret["comment"] += ", and the container was started" @@ -301,12 +301,12 @@ def present( ret["comment"] += error except (SaltInvocationError, CommandExecutionError) as exc: ret["result"] = False - ret["comment"] += "{}: {}".format(error, exc) + ret["comment"] += f"{error}: {exc}" else: if state["old"] is None: ret["comment"] += ", and the container was stopped" else: - ret["comment"] = "Container '{}' was stopped".format(name) + ret["comment"] = f"Container '{name}' was stopped" if "new" not in state: # Make sure we know the final state of the container before we return @@ -345,7 +345,7 @@ def absent(name, stop=False, path=None): "name": name, "changes": {}, "result": True, - "comment": "Container '{}' does not exist".format(name), + "comment": f"Container '{name}' does not exist", } if not __salt__["lxc.exists"](name, path=path): @@ -353,17 +353,17 @@ def absent(name, stop=False, path=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Container '{}' would be destroyed".format(name) + ret["comment"] = f"Container '{name}' would be destroyed" return ret try: result = __salt__["lxc.destroy"](name, stop=stop, path=path) except (SaltInvocationError, CommandExecutionError) as exc: ret["result"] = False - ret["comment"] = "Failed to destroy container: {}".format(exc) + ret["comment"] = f"Failed to destroy container: {exc}" else: ret["changes"]["state"] = result["state"] - ret["comment"] = "Container '{}' was destroyed".format(name) + ret["comment"] = f"Container '{name}' was destroyed" return ret @@ -407,14 +407,14 @@ def running(name, restart=False, path=None): ret = { "name": name, "result": True, - "comment": "Container '{}' is already running".format(name), + "comment": f"Container '{name}' is already running", "changes": {}, } state = {"old": __salt__["lxc.state"](name, path=path)} if state["old"] is None: ret["result"] = False - ret["comment"] = "Container '{}' does not exist".format(name) + ret["comment"] = f"Container '{name}' does not exist" return ret elif state["old"] == "running" and not restart: return ret @@ -435,7 +435,7 @@ def running(name, restart=False, path=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Container '{}' would be {}".format(name, action[1]) + ret["comment"] = f"Container '{name}' would be {action[1]}" return ret try: @@ -454,7 +454,7 @@ def running(name, restart=False, path=None): state["new"] = result["state"]["new"] if state["new"] != "running": ret["result"] = False - ret["comment"] = "Unable to {} container '{}'".format(action[0], name) + ret["comment"] = f"Unable to {action[0]} container '{name}'" else: ret["comment"] = "Container '{}' was successfully {}".format( name, action[1] @@ -507,17 +507,17 @@ def frozen(name, start=True, path=None): ret = { "name": name, "result": True, - "comment": "Container '{}' is already frozen".format(name), + "comment": f"Container '{name}' is already frozen", "changes": {}, } state = {"old": __salt__["lxc.state"](name, path=path)} if state["old"] is None: ret["result"] = False - ret["comment"] = "Container '{}' does not exist".format(name) + ret["comment"] = f"Container '{name}' does not exist" elif state["old"] == "stopped" and not start: ret["result"] = False - ret["comment"] = "Container '{}' is stopped".format(name) + ret["comment"] = f"Container '{name}' is stopped" if ret["result"] is False or state["old"] == "frozen": return ret @@ -529,7 +529,7 @@ def frozen(name, start=True, path=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Container '{}' would be {}".format(name, action[1]) + ret["comment"] = f"Container '{name}' would be {action[1]}" return ret try: @@ -542,7 +542,7 @@ def frozen(name, start=True, path=None): state["new"] = result["state"]["new"] if state["new"] != "frozen": ret["result"] = False - ret["comment"] = "Unable to {} container '{}'".format(action[0], name) + ret["comment"] = f"Unable to {action[0]} container '{name}'" else: ret["comment"] = "Container '{}' was successfully {}".format( name, action[1] @@ -594,14 +594,14 @@ def stopped(name, kill=False, path=None): ret = { "name": name, "result": True, - "comment": "Container '{}' is already stopped".format(name), + "comment": f"Container '{name}' is already stopped", "changes": {}, } state = {"old": __salt__["lxc.state"](name, path=path)} if state["old"] is None: ret["result"] = False - ret["comment"] = "Container '{}' does not exist".format(name) + ret["comment"] = f"Container '{name}' does not exist" return ret elif state["old"] == "stopped": return ret @@ -613,7 +613,7 @@ def stopped(name, kill=False, path=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Container '{}' would be {}".format(name, action[1]) + ret["comment"] = f"Container '{name}' would be {action[1]}" return ret try: @@ -626,7 +626,7 @@ def stopped(name, kill=False, path=None): state["new"] = result["state"]["new"] if state["new"] != "stopped": ret["result"] = False - ret["comment"] = "Unable to {} container '{}'".format(action[0], name) + ret["comment"] = f"Unable to {action[0]} container '{name}'" else: ret["comment"] = "Container '{}' was successfully {}".format( name, action[1] @@ -707,7 +707,7 @@ def edited_conf(name, lxc_conf=None, lxc_conf_unset=None): if __opts__["test"]: return { "name": name, - "comment": "{} lxc.conf will be edited".format(name), + "comment": f"{name} lxc.conf will be edited", "result": True, "changes": {}, } diff --git a/salt/states/lxd.py b/salt/states/lxd.py index 30991ab1e8d..35b87ea8371 100644 --- a/salt/states/lxd.py +++ b/salt/states/lxd.py @@ -172,7 +172,7 @@ def config_managed(name, value, force_password=False): ) elif str(value) == current_value: - return _success(ret, '"{}" is already set to "{}"'.format(name, value)) + return _success(ret, f'"{name}" is already set to "{value}"') if __opts__["test"]: if name == _password_config_key: @@ -180,7 +180,7 @@ def config_managed(name, value, force_password=False): ret["changes"] = {"password": msg} return _unchanged(ret, msg) else: - msg = 'Would set the "{}" to "{}"'.format(name, value) + msg = f'Would set the "{name}" to "{value}"' ret["changes"] = {name: msg} return _unchanged(ret, msg) @@ -190,9 +190,7 @@ def config_managed(name, value, force_password=False): if name == _password_config_key: ret["changes"] = {name: "Changed the password"} else: - ret["changes"] = { - name: 'Changed from "{}" to {}"'.format(current_value, value) - } + ret["changes"] = {name: f'Changed from "{current_value}" to {value}"'} except CommandExecutionError as e: return _error(ret, str(e)) @@ -265,9 +263,9 @@ def authenticate(name, remote_addr, password, cert, key, verify_cert=True): return _error(ret, str(e)) if result is not True: - return _error(ret, "Failed to authenticate with peer: {}".format(remote_addr)) + return _error(ret, f"Failed to authenticate with peer: {remote_addr}") - msg = "Successfully authenticated with peer: {}".format(remote_addr) + msg = f"Successfully authenticated with peer: {remote_addr}" ret["changes"] = msg return _success(ret, msg) diff --git a/salt/states/lxd_container.py b/salt/states/lxd_container.py index 065e267c5fd..a1f894c6ac5 100644 --- a/salt/states/lxd_container.py +++ b/salt/states/lxd_container.py @@ -218,7 +218,7 @@ def present( if container is None: if __opts__["test"]: # Test is on, just return that we would create the container - msg = 'Would create the container "{}"'.format(name) + msg = f'Would create the container "{name}"' ret["changes"] = {"created": msg} if running is True: msg = msg + " and start it." @@ -248,7 +248,7 @@ def present( except CommandExecutionError as e: return _error(ret, str(e)) - msg = 'Created the container "{}"'.format(name) + msg = f'Created the container "{name}"' ret["changes"] = {"created": msg} if running is True: @@ -260,7 +260,7 @@ def present( return _error(ret, str(e)) msg = msg + " and started it." - ret["changes"] = {"started": 'Started the container "{}"'.format(name)} + ret["changes"] = {"started": f'Started the container "{name}"'} return _success(ret, msg) @@ -274,18 +274,18 @@ def present( # Removed profiles for k in old_profiles.difference(new_profiles): if not __opts__["test"]: - profile_changes.append('Removed profile "{}"'.format(k)) + profile_changes.append(f'Removed profile "{k}"') old_profiles.discard(k) else: - profile_changes.append('Would remove profile "{}"'.format(k)) + profile_changes.append(f'Would remove profile "{k}"') # Added profiles for k in new_profiles.difference(old_profiles): if not __opts__["test"]: - profile_changes.append('Added profile "{}"'.format(k)) + profile_changes.append(f'Added profile "{k}"') old_profiles.add(k) else: - profile_changes.append('Would add profile "{}"'.format(k)) + profile_changes.append(f'Would add profile "{k}"') if profile_changes: container_changed = True @@ -315,7 +315,7 @@ def present( changes["running"] = "Would start the container" return _unchanged( ret, - 'Container "{}" would get changed and started.'.format(name), + f'Container "{name}" would get changed and started.', ) else: container.start(wait=True) @@ -326,7 +326,7 @@ def present( changes["stopped"] = "Would stopped the container" return _unchanged( ret, - 'Container "{}" would get changed and stopped.'.format(name), + f'Container "{name}" would get changed and stopped.', ) else: container.stop(wait=True) @@ -341,17 +341,17 @@ def present( if __opts__["test"]: changes["restarted"] = "Would restart the container" - return _unchanged(ret, 'Would restart the container "{}"'.format(name)) + return _unchanged(ret, f'Would restart the container "{name}"') else: container.restart(wait=True) - changes["restarted"] = 'Container "{}" has been restarted'.format(name) - return _success(ret, 'Container "{}" has been restarted'.format(name)) + changes["restarted"] = f'Container "{name}" has been restarted' + return _success(ret, f'Container "{name}" has been restarted') if not container_changed: return _success(ret, "No changes") if __opts__["test"]: - return _unchanged(ret, 'Container "{}" would get changed.'.format(name)) + return _unchanged(ret, f'Container "{name}" would get changed.') return _success(ret, "{} changes".format(len(ret["changes"].keys()))) @@ -410,10 +410,10 @@ def absent(name, stop=False, remote_addr=None, cert=None, key=None, verify_cert= return _error(ret, str(e)) except SaltInvocationError as e: # Container not found - return _success(ret, 'Container "{}" not found.'.format(name)) + return _success(ret, f'Container "{name}" not found.') if __opts__["test"]: - ret["changes"] = {"removed": 'Container "{}" would get deleted.'.format(name)} + ret["changes"] = {"removed": f'Container "{name}" would get deleted.'} return _unchanged(ret, ret["changes"]["removed"]) if stop and container.status_code == CONTAINER_STATUS_RUNNING: @@ -421,7 +421,7 @@ def absent(name, stop=False, remote_addr=None, cert=None, key=None, verify_cert= container.delete(wait=True) - ret["changes"]["deleted"] = 'Container "{}" has been deleted.'.format(name) + ret["changes"]["deleted"] = f'Container "{name}" has been deleted.' return _success(ret, ret["changes"]["deleted"]) @@ -480,13 +480,13 @@ def running( return _error(ret, str(e)) except SaltInvocationError as e: # Container not found - return _error(ret, 'Container "{}" not found'.format(name)) + return _error(ret, f'Container "{name}" not found') is_running = container.status_code == CONTAINER_STATUS_RUNNING if is_running: if not restart: - return _success(ret, 'The container "{}" is already running'.format(name)) + return _success(ret, f'The container "{name}" is already running') else: if __opts__["test"]: ret["changes"]["restarted"] = 'Would restart the container "{}"'.format( @@ -501,11 +501,11 @@ def running( return _success(ret, ret["changes"]["restarted"]) if __opts__["test"]: - ret["changes"]["started"] = 'Would start the container "{}"'.format(name) + ret["changes"]["started"] = f'Would start the container "{name}"' return _unchanged(ret, ret["changes"]["started"]) container.start(wait=True) - ret["changes"]["started"] = 'Started the container "{}"'.format(name) + ret["changes"]["started"] = f'Started the container "{name}"' return _success(ret, ret["changes"]["started"]) @@ -562,10 +562,10 @@ def frozen(name, start=True, remote_addr=None, cert=None, key=None, verify_cert= return _error(ret, str(e)) except SaltInvocationError as e: # Container not found - return _error(ret, 'Container "{}" not found'.format(name)) + return _error(ret, f'Container "{name}" not found') if container.status_code == CONTAINER_STATUS_FROZEN: - return _success(ret, 'Container "{}" is alredy frozen'.format(name)) + return _success(ret, f'Container "{name}" is alredy frozen') is_running = container.status_code == CONTAINER_STATUS_RUNNING @@ -579,20 +579,20 @@ def frozen(name, start=True, remote_addr=None, cert=None, key=None, verify_cert= elif not is_running and start: if __opts__["test"]: - ret["changes"]["started"] = ( - 'Would start the container "{}" and freeze it after'.format(name) - ) + ret["changes"][ + "started" + ] = f'Would start the container "{name}" and freeze it after' return _unchanged(ret, ret["changes"]["started"]) else: container.start(wait=True) - ret["changes"]["started"] = 'Start the container "{}"'.format(name) + ret["changes"]["started"] = f'Start the container "{name}"' if __opts__["test"]: - ret["changes"]["frozen"] = 'Would freeze the container "{}"'.format(name) + ret["changes"]["frozen"] = f'Would freeze the container "{name}"' return _unchanged(ret, ret["changes"]["frozen"]) container.freeze(wait=True) - ret["changes"]["frozen"] = 'Froze the container "{}"'.format(name) + ret["changes"]["frozen"] = f'Froze the container "{name}"' return _success(ret, ret["changes"]["frozen"]) @@ -650,17 +650,17 @@ def stopped(name, kill=False, remote_addr=None, cert=None, key=None, verify_cert return _error(ret, str(e)) except SaltInvocationError as e: # Container not found - return _error(ret, 'Container "{}" not found'.format(name)) + return _error(ret, f'Container "{name}" not found') if container.status_code == CONTAINER_STATUS_STOPPED: - return _success(ret, 'Container "{}" is already stopped'.format(name)) + return _success(ret, f'Container "{name}" is already stopped') if __opts__["test"]: - ret["changes"]["stopped"] = 'Would stop the container "{}"'.format(name) + ret["changes"]["stopped"] = f'Would stop the container "{name}"' return _unchanged(ret, ret["changes"]["stopped"]) container.stop(force=kill, wait=True) - ret["changes"]["stopped"] = 'Stopped the container "{}"'.format(name) + ret["changes"]["stopped"] = f'Stopped the container "{name}"' return _success(ret, ret["changes"]["stopped"]) @@ -763,7 +763,7 @@ def migrated( pass if dest_container is not None: - return _success(ret, 'Container "{}" exists on the destination'.format(name)) + return _success(ret, f'Container "{name}" exists on the destination') if src_verify_cert is None: src_verify_cert = verify_cert @@ -776,7 +776,7 @@ def migrated( return _error(ret, str(e)) except SaltInvocationError as e: # Container not found - return _error(ret, 'Source Container "{}" not found'.format(name)) + return _error(ret, f'Source Container "{name}" not found') if __opts__["test"]: ret["changes"]["migrated"] = ( diff --git a/salt/states/lxd_image.py b/salt/states/lxd_image.py index 5fc991b6466..923726e7b26 100644 --- a/salt/states/lxd_image.py +++ b/salt/states/lxd_image.py @@ -180,7 +180,7 @@ def present( if image is None: if __opts__["test"]: # Test is on, just return that we would create the image - msg = 'Would create the image "{}"'.format(name) + msg = f'Would create the image "{name}"' ret["changes"] = {"created": msg} return _unchanged(ret, msg) @@ -258,17 +258,17 @@ def present( for k in old_aliases.difference(new_aliases): if not __opts__["test"]: __salt__["lxd.image_alias_delete"](image, k) - alias_changes.append('Removed alias "{}"'.format(k)) + alias_changes.append(f'Removed alias "{k}"') else: - alias_changes.append('Would remove alias "{}"'.format(k)) + alias_changes.append(f'Would remove alias "{k}"') # New aliases for k in new_aliases.difference(old_aliases): if not __opts__["test"]: __salt__["lxd.image_alias_add"](image, k, "") - alias_changes.append('Added alias "{}"'.format(k)) + alias_changes.append(f'Added alias "{k}"') else: - alias_changes.append('Would add alias "{}"'.format(k)) + alias_changes.append(f'Would add alias "{k}"') if alias_changes: ret["changes"]["aliases"] = alias_changes @@ -276,11 +276,11 @@ def present( # Set public if public is not None and image.public != public: if not __opts__["test"]: - ret["changes"]["public"] = "Setting the image public to {!s}".format(public) + ret["changes"]["public"] = f"Setting the image public to {public!s}" image.public = public __salt__["lxd.pylxd_save_object"](image) else: - ret["changes"]["public"] = "Would set public to {!s}".format(public) + ret["changes"]["public"] = f"Would set public to {public!s}" if __opts__["test"] and ret["changes"]: return _unchanged(ret, "Would do {} changes".format(len(ret["changes"].keys()))) @@ -341,15 +341,15 @@ def absent(name, remote_addr=None, cert=None, key=None, verify_cert=True): except CommandExecutionError as e: return _error(ret, str(e)) except SaltInvocationError as e: - return _success(ret, 'Image "{}" not found.'.format(name)) + return _success(ret, f'Image "{name}" not found.') if __opts__["test"]: - ret["changes"] = {"removed": 'Image "{}" would get deleted.'.format(name)} + ret["changes"] = {"removed": f'Image "{name}" would get deleted.'} return _success(ret, ret["changes"]["removed"]) __salt__["lxd.image_delete"](image) - ret["changes"] = {"removed": 'Image "{}" has been deleted.'.format(name)} + ret["changes"] = {"removed": f'Image "{name}" has been deleted.'} return _success(ret, ret["changes"]["removed"]) diff --git a/salt/states/lxd_profile.py b/salt/states/lxd_profile.py index 35c781941b7..a699252b4d7 100644 --- a/salt/states/lxd_profile.py +++ b/salt/states/lxd_profile.py @@ -132,7 +132,7 @@ def present( if profile is None: if __opts__["test"]: # Test is on, just return that we would create the profile - msg = 'Would create the profile "{}"'.format(name) + msg = f'Would create the profile "{name}"' ret["changes"] = {"created": msg} return _unchanged(ret, msg) @@ -145,7 +145,7 @@ def present( except CommandExecutionError as e: return _error(ret, str(e)) - msg = 'Profile "{}" has been created'.format(name) + msg = f'Profile "{name}" has been created' ret["changes"] = {"created": msg} return _success(ret, msg) @@ -172,7 +172,7 @@ def present( return _success(ret, "No changes") if __opts__["test"]: - return _unchanged(ret, 'Profile "{}" would get changed.'.format(name)) + return _unchanged(ret, f'Profile "{name}" would get changed.') try: __salt__["lxd.pylxd_save_object"](profile) @@ -233,9 +233,9 @@ def absent(name, remote_addr=None, cert=None, key=None, verify_cert=True): return _error(ret, str(e)) except SaltInvocationError as e: # Profile not found - return _success(ret, 'Profile "{}" not found.'.format(name)) + return _success(ret, f'Profile "{name}" not found.') - ret["changes"] = {"removed": 'Profile "{}" would get deleted.'.format(name)} + ret["changes"] = {"removed": f'Profile "{name}" would get deleted.'} return _success(ret, ret["changes"]["removed"]) try: @@ -244,9 +244,9 @@ def absent(name, remote_addr=None, cert=None, key=None, verify_cert=True): return _error(ret, str(e)) except SaltInvocationError as e: # Profile not found - return _success(ret, 'Profile "{}" not found.'.format(name)) + return _success(ret, f'Profile "{name}" not found.') - ret["changes"] = {"removed": 'Profile "{}" has been deleted.'.format(name)} + ret["changes"] = {"removed": f'Profile "{name}" has been deleted.'} return _success(ret, ret["changes"]["removed"]) diff --git a/salt/states/mac_assistive.py b/salt/states/mac_assistive.py index 8aee4ccffec..ad0de154452 100644 --- a/salt/states/mac_assistive.py +++ b/salt/states/mac_assistive.py @@ -53,12 +53,12 @@ def installed(name, enabled=True): if enabled != is_enabled: __salt__["assistive.enable"](name, enabled) - ret["comment"] = "Updated enable to {}".format(enabled) + ret["comment"] = f"Updated enable to {enabled}" else: ret["comment"] = "Already in the correct state" else: __salt__["assistive.install"](name, enabled) - ret["comment"] = "Installed {} into the assistive access panel".format(name) + ret["comment"] = f"Installed {name} into the assistive access panel" return ret diff --git a/salt/states/mac_keychain.py b/salt/states/mac_keychain.py index 7126a95b01c..fd1af09623b 100644 --- a/salt/states/mac_keychain.py +++ b/salt/states/mac_keychain.py @@ -95,9 +95,9 @@ def installed(name, password, keychain="/Library/Keychains/System.keychain", **k ret["changes"]["installed"] = friendly_name else: ret["result"] = False - ret["comment"] += "Failed to install {}".format(friendly_name) + ret["comment"] += f"Failed to install {friendly_name}" else: - ret["comment"] += "{} already installed.".format(friendly_name) + ret["comment"] += f"{friendly_name} already installed." return ret @@ -150,9 +150,9 @@ def uninstalled( ret["changes"]["uninstalled"] = friendly_name else: ret["result"] = False - ret["comment"] += "Failed to uninstall {}".format(friendly_name) + ret["comment"] += f"Failed to uninstall {friendly_name}" else: - ret["comment"] += "{} already uninstalled.".format(friendly_name) + ret["comment"] += f"{friendly_name} already uninstalled." return ret @@ -175,18 +175,18 @@ def default_keychain(name, domain="user", user=None): if not os.path.exists(name): ret["result"] = False - ret["comment"] += "Keychain not found at {}".format(name) + ret["comment"] += f"Keychain not found at {name}" else: out = __salt__["keychain.get_default_keychain"](user, domain) if name in out: - ret["comment"] += "{} was already the default keychain.".format(name) + ret["comment"] += f"{name} was already the default keychain." else: out = __salt__["keychain.set_default_keychain"](name, domain, user) if len(out) == 0: ret["changes"]["default"] = name else: ret["result"] = False - ret["comment"] = "Failed to install keychain. {}".format(out) + ret["comment"] = f"Failed to install keychain. {out}" return ret diff --git a/salt/states/macdefaults.py b/salt/states/macdefaults.py index 67383eaffcd..05e83c2a4d6 100644 --- a/salt/states/macdefaults.py +++ b/salt/states/macdefaults.py @@ -58,20 +58,20 @@ def write(name, domain, value, vtype="string", user=None): (value in [True, "TRUE", "YES"] and current_value == "1") or (value in [False, "FALSE", "NO"] and current_value == "0") ): - ret["comment"] += "{} {} is already set to {}".format(domain, name, value) + ret["comment"] += f"{domain} {name} is already set to {value}" elif vtype in ["int", "integer"] and safe_cast(current_value, int) == safe_cast( value, int ): - ret["comment"] += "{} {} is already set to {}".format(domain, name, value) + ret["comment"] += f"{domain} {name} is already set to {value}" elif current_value == value: - ret["comment"] += "{} {} is already set to {}".format(domain, name, value) + ret["comment"] += f"{domain} {name} is already set to {value}" else: out = __salt__["macdefaults.write"](domain, name, value, vtype, user) if out["retcode"] != 0: ret["result"] = False ret["comment"] = "Failed to write default. {}".format(out["stdout"]) else: - ret["changes"]["written"] = "{} {} is set to {}".format(domain, name, value) + ret["changes"]["written"] = f"{domain} {name} is set to {value}" return ret @@ -96,8 +96,8 @@ def absent(name, domain, user=None): out = __salt__["macdefaults.delete"](domain, name, user) if out["retcode"] != 0: - ret["comment"] += "{} {} is already absent".format(domain, name) + ret["comment"] += f"{domain} {name} is already absent" else: - ret["changes"]["absent"] = "{} {} is now absent".format(domain, name) + ret["changes"]["absent"] = f"{domain} {name} is now absent" return ret diff --git a/salt/states/macpackage.py b/salt/states/macpackage.py index 95650438286..feb12560911 100644 --- a/salt/states/macpackage.py +++ b/salt/states/macpackage.py @@ -113,7 +113,7 @@ def installed( version_out = "" if re.match(expected_version, version_out) is not None: - ret["comment"] += "Version already matches {}".format(expected_version) + ret["comment"] += f"Version already matches {expected_version}" return ret else: ret["comment"] += "Version {} doesn't match {}. ".format( @@ -129,7 +129,7 @@ def installed( out, mount_point = __salt__["macpackage.mount"](name) if "attach failed" in out: ret["result"] = False - ret["comment"] += "Unable to mount {}".format(name) + ret["comment"] += f"Unable to mount {name}" return ret if app: @@ -149,7 +149,7 @@ def installed( if ".app" not in out: ret["result"] = False - ret["comment"] += "Unable to find .app in {}".format(mount_point) + ret["comment"] += f"Unable to find .app in {mount_point}" return ret else: pkg_ids = out.split("\n") @@ -190,7 +190,7 @@ def installed( def failed_pkg(f_pkg): ret["result"] = False - ret["comment"] += "{} failed to install: {}".format(name, out) + ret["comment"] += f"{name} failed to install: {out}" if "failed" in ret["changes"]: ret["changes"]["failed"].append(f_pkg) @@ -208,7 +208,7 @@ def installed( if len(out) != 0: failed_pkg(app) else: - ret["comment"] += "{} installed".format(app) + ret["comment"] += f"{app} installed" if "installed" in ret["changes"]: ret["changes"]["installed"].append(app) else: @@ -223,9 +223,9 @@ def installed( if out["retcode"] != 0: ret["result"] = False - ret["comment"] += ". {} failed to install: {}".format(name, out) + ret["comment"] += f". {name} failed to install: {out}" else: - ret["comment"] += "{} installed".format(name) + ret["comment"] += f"{name} installed" ret["changes"]["installed"] = installing finally: diff --git a/salt/states/makeconf.py b/salt/states/makeconf.py index 632a11b2c43..9e5a19261c1 100644 --- a/salt/states/makeconf.py +++ b/salt/states/makeconf.py @@ -131,11 +131,11 @@ def present(name, value=None, contains=None, excludes=None): ret["comment"] = msg.format(name) else: if __opts__["test"]: - msg = "Variable {} is set to".format(name) + msg = f"Variable {name} is set to" if len(to_append) > 0: - msg += ' append "{}"'.format(list(to_append)) + msg += f' append "{list(to_append)}"' if len(to_trim) > 0: - msg += ' trim "{}"'.format(list(to_trim)) + msg += f' trim "{list(to_trim)}"' msg += " in make.conf" ret["comment"] = msg ret["result"] = None diff --git a/salt/states/marathon_app.py b/salt/states/marathon_app.py index 3d44503db61..95339b1d148 100644 --- a/salt/states/marathon_app.py +++ b/salt/states/marathon_app.py @@ -66,7 +66,7 @@ def config(name, config): # if test, report there will be an update if __opts__["test"]: ret["result"] = None - ret["comment"] = "Marathon app {} is set to be updated".format(name) + ret["comment"] = f"Marathon app {name} is set to be updated" return ret update_result = __salt__["marathon.update_app"](name, update_config) @@ -79,10 +79,10 @@ def config(name, config): return ret else: ret["result"] = True - ret["comment"] = "Updated app config for {}".format(name) + ret["comment"] = f"Updated app config for {name}" return ret ret["result"] = True - ret["comment"] = "Marathon app {} configured correctly".format(name) + ret["comment"] = f"Marathon app {name} configured correctly" return ret @@ -96,20 +96,20 @@ def absent(name): ret = {"name": name, "changes": {}, "result": False, "comment": ""} if not __salt__["marathon.has_app"](name): ret["result"] = True - ret["comment"] = "App {} already absent".format(name) + ret["comment"] = f"App {name} already absent" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "App {} is set to be removed".format(name) + ret["comment"] = f"App {name} is set to be removed" return ret if __salt__["marathon.rm_app"](name): ret["changes"] = {"app": name} ret["result"] = True - ret["comment"] = "Removed app {}".format(name) + ret["comment"] = f"Removed app {name}" return ret else: ret["result"] = False - ret["comment"] = "Failed to remove app {}".format(name) + ret["comment"] = f"Failed to remove app {name}" return ret @@ -125,12 +125,12 @@ def running(name, restart=False, force=True): ret = {"name": name, "changes": {}, "result": False, "comment": ""} if not __salt__["marathon.has_app"](name): ret["result"] = False - ret["comment"] = "App {} cannot be restarted because it is absent".format(name) + ret["comment"] = f"App {name} cannot be restarted because it is absent" return ret if __opts__["test"]: ret["result"] = None qualifier = "is" if restart else "is not" - ret["comment"] = "App {} {} set to be restarted".format(name, qualifier) + ret["comment"] = f"App {name} {qualifier} set to be restarted" return ret restart_result = __salt__["marathon.restart_app"](name, restart, force) if "exception" in restart_result: @@ -143,5 +143,5 @@ def running(name, restart=False, force=True): ret["changes"] = restart_result ret["result"] = True qualifier = "Restarted" if restart else "Did not restart" - ret["comment"] = "{} app {}".format(qualifier, name) + ret["comment"] = f"{qualifier} app {name}" return ret diff --git a/salt/states/mdadm_raid.py b/salt/states/mdadm_raid.py index 9d7fb7e9557..76396d858dd 100644 --- a/salt/states/mdadm_raid.py +++ b/salt/states/mdadm_raid.py @@ -130,7 +130,7 @@ def present(name, level, devices, **kwargs): verb = "assembled" else: if len(new_devices) == 0: - ret["comment"] = "All devices are missing: {}.".format(missing) + ret["comment"] = f"All devices are missing: {missing}." ret["result"] = False return ret do_assemble = False @@ -149,22 +149,22 @@ def present(name, level, devices, **kwargs): level, new_devices + ["missing"] * len(missing), test_mode=True, - **kwargs + **kwargs, ) if present: - ret["comment"] = "Raid {} already present.".format(name) + ret["comment"] = f"Raid {name} already present." if do_assemble or do_create: - ret["comment"] = "Raid will be {} with: {}".format(verb, res) + ret["comment"] = f"Raid will be {verb} with: {res}" ret["result"] = None if (do_assemble or present) and len(new_devices) > 0: - ret["comment"] += " New devices will be added: {}".format(new_devices) + ret["comment"] += f" New devices will be added: {new_devices}" ret["result"] = None if len(missing) > 0: - ret["comment"] += " Missing devices: {}".format(missing) + ret["comment"] += f" Missing devices: {missing}" return ret @@ -180,29 +180,29 @@ def present(name, level, devices, **kwargs): raids = __salt__["raid.list"]() changes = raids.get(name) if changes: - ret["comment"] = "Raid {} {}.".format(name, verb) + ret["comment"] = f"Raid {name} {verb}." ret["changes"] = changes # Saving config __salt__["raid.save_config"]() else: - ret["comment"] = "Raid {} failed to be {}.".format(name, verb) + ret["comment"] = f"Raid {name} failed to be {verb}." ret["result"] = False else: - ret["comment"] = "Raid {} already present.".format(name) + ret["comment"] = f"Raid {name} already present." if (do_assemble or present) and len(new_devices) > 0 and ret["result"]: for d in new_devices: res = __salt__["raid.add"](name, d) if not res: - ret["comment"] += " Unable to add {} to {}.\n".format(d, name) + ret["comment"] += f" Unable to add {d} to {name}.\n" ret["result"] = False else: - ret["comment"] += " Added new device {} to {}.\n".format(d, name) + ret["comment"] += f" Added new device {d} to {name}.\n" if ret["result"]: ret["changes"]["added"] = new_devices if len(missing) > 0: - ret["comment"] += " Missing devices: {}".format(missing) + ret["comment"] += f" Missing devices: {missing}" return ret @@ -224,10 +224,10 @@ def absent(name): # Raid does not exist if name not in __salt__["raid.list"](): - ret["comment"] = "Raid {} already absent".format(name) + ret["comment"] = f"Raid {name} already absent" return ret elif __opts__["test"]: - ret["comment"] = "Raid {} is set to be destroyed".format(name) + ret["comment"] = f"Raid {name} is set to be destroyed" ret["result"] = None return ret else: @@ -235,7 +235,7 @@ def absent(name): ret["result"] = __salt__["raid.destroy"](name) if ret["result"]: - ret["comment"] = "Raid {} has been destroyed".format(name) + ret["comment"] = f"Raid {name} has been destroyed" else: - ret["comment"] = "Raid {} failed to be destroyed".format(name) + ret["comment"] = f"Raid {name} failed to be destroyed" return ret diff --git a/salt/states/memcached.py b/salt/states/memcached.py index 14cfd6771c2..3499961671b 100644 --- a/salt/states/memcached.py +++ b/salt/states/memcached.py @@ -20,7 +20,7 @@ def __virtual__(): """ Only load if memcache module is available """ - if "{}.status".format(__virtualname__) in __salt__: + if f"{__virtualname__}.status" in __salt__: return __virtualname__ return (False, "memcached module could not be loaded") @@ -65,15 +65,15 @@ def managed( if cur == value: ret["result"] = True - ret["comment"] = "Key '{}' does not need to be updated".format(name) + ret["comment"] = f"Key '{name}' does not need to be updated" return ret if __opts__["test"]: ret["result"] = None if cur is None: - ret["comment"] = "Key '{}' would be added".format(name) + ret["comment"] = f"Key '{name}' would be added" else: - ret["comment"] = "Value of key '{}' would be changed".format(name) + ret["comment"] = f"Value of key '{name}' would be changed" return ret try: @@ -84,13 +84,13 @@ def managed( ret["comment"] = str(exc) else: if ret["result"]: - ret["comment"] = "Successfully set key '{}'".format(name) + ret["comment"] = f"Successfully set key '{name}'" if cur is not None: ret["changes"] = {"old": cur, "new": value} else: ret["changes"] = {"key added": name, "value": value} else: - ret["comment"] = "Failed to set key '{}'".format(name) + ret["comment"] = f"Failed to set key '{name}'" return ret @@ -138,12 +138,12 @@ def absent(name, value=None, host=DEFAULT_HOST, port=DEFAULT_PORT, time=DEFAULT_ return ret if cur is None: ret["result"] = True - ret["comment"] = "Key '{}' does not exist".format(name) + ret["comment"] = f"Key '{name}' does not exist" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Key '{}' would be deleted".format(name) + ret["comment"] = f"Key '{name}' would be deleted" return ret try: @@ -152,8 +152,8 @@ def absent(name, value=None, host=DEFAULT_HOST, port=DEFAULT_PORT, time=DEFAULT_ ret["comment"] = str(exc) else: if ret["result"]: - ret["comment"] = "Successfully deleted key '{}'".format(name) + ret["comment"] = f"Successfully deleted key '{name}'" ret["changes"] = {"key deleted": name, "value": cur} else: - ret["comment"] = "Failed to delete key '{}'".format(name) + ret["comment"] = f"Failed to delete key '{name}'" return ret diff --git a/salt/states/modjk.py b/salt/states/modjk.py index 0932715b129..f41a84010ab 100644 --- a/salt/states/modjk.py +++ b/salt/states/modjk.py @@ -26,7 +26,7 @@ def _bulk_state(saltfunc, lbn, workers, profile): if not isinstance(workers, list): ret["result"] = False - ret["comment"] = "workers should be a list not a {}".format(type(workers)) + ret["comment"] = f"workers should be a list not a {type(workers)}" return ret if __opts__["test"]: @@ -38,7 +38,7 @@ def _bulk_state(saltfunc, lbn, workers, profile): cmdret = __salt__[saltfunc](workers, lbn, profile=profile) except KeyError: ret["result"] = False - ret["comment"] = "unsupported function {}".format(saltfunc) + ret["comment"] = f"unsupported function {saltfunc}" return ret errors = [] @@ -49,7 +49,7 @@ def _bulk_state(saltfunc, lbn, workers, profile): ret["changes"] = {"status": cmdret} if errors: ret["result"] = False - ret["comment"] = "{} failed on some workers".format(saltfunc) + ret["comment"] = f"{saltfunc} failed on some workers" return ret diff --git a/salt/states/modjk_worker.py b/salt/states/modjk_worker.py index 120531356b3..5cefeac1d63 100644 --- a/salt/states/modjk_worker.py +++ b/salt/states/modjk_worker.py @@ -44,7 +44,7 @@ def _send_command(cmd, worker, lbn, target, profile="default", tgt_type="glob"): } # Send the command to target - func = "modjk.{}".format(cmd) + func = f"modjk.{cmd}" args = [worker, lbn, profile] response = __salt__["publish.publish"](target, func, args, tgt_type) @@ -58,7 +58,7 @@ def _send_command(cmd, worker, lbn, target, profile="default", tgt_type="glob"): # parse response if not response: - ret["msg"] = "no servers answered the published command {}".format(cmd) + ret["msg"] = f"no servers answered the published command {cmd}" return ret elif len(errors) > 0: ret["msg"] = "the following minions return False" diff --git a/salt/states/module.py b/salt/states/module.py index e6422e146f8..262e38b96d6 100644 --- a/salt/states/module.py +++ b/salt/states/module.py @@ -460,7 +460,7 @@ def _run(**kwargs): ) ) if func_ret is False: - failures.append("'{}': {}".format(func, func_ret)) + failures.append(f"'{func}': {func_ret}") else: success.append( "{}: {}".format( @@ -474,7 +474,7 @@ def _run(**kwargs): ) ret["changes"][func] = func_ret except (SaltInvocationError, TypeError) as ex: - failures.append("'{}' failed: {}".format(func, ex)) + failures.append(f"'{func}' failed: {ex}") ret["comment"] = ", ".join(failures + success) ret["result"] = not bool(failures) @@ -530,12 +530,12 @@ def _legacy_run(name, **kwargs): """ ret = {"name": name, "changes": {}, "comment": "", "result": None} if name not in __salt__: - ret["comment"] = "Module function {} is not available".format(name) + ret["comment"] = f"Module function {name} is not available" ret["result"] = False return ret if __opts__["test"]: - ret["comment"] = "Module function {} is set to execute".format(name) + ret["comment"] = f"Module function {name} is set to execute" return ret aspec = salt.utils.args.get_function_argspec(__salt__[name]) @@ -593,7 +593,7 @@ def _legacy_run(name, **kwargs): if missing: comment = "The following arguments are missing:" for arg in missing: - comment += " {}".format(arg) + comment += f" {arg}" ret["comment"] = comment ret["result"] = False return ret @@ -657,7 +657,7 @@ def _legacy_run(name, **kwargs): returners = salt.loader.returners(__opts__, __salt__) if kwargs["returner"] in returners: returners[kwargs["returner"]](ret_ret) - ret["comment"] = "Module function {} executed".format(name) + ret["comment"] = f"Module function {name} executed" ret["result"] = _get_result(mret, ret["changes"]) return ret diff --git a/salt/states/mongodb_database.py b/salt/states/mongodb_database.py index 4df6c4297ed..5445b3b880d 100644 --- a/salt/states/mongodb_database.py +++ b/salt/states/mongodb_database.py @@ -53,9 +53,9 @@ def absent(name, user=None, password=None, host=None, port=None, authdb=None): if __salt__["mongodb.db_remove"]( name, user, password, host, port, authdb=authdb ): - ret["comment"] = "Database {} has been removed".format(name) + ret["comment"] = f"Database {name} has been removed" ret["changes"][name] = "Absent" return ret - ret["comment"] = "Database {} is not present".format(name) + ret["comment"] = f"Database {name} is not present" return ret diff --git a/salt/states/mongodb_user.py b/salt/states/mongodb_user.py index a83cd9b5686..6494b0018a9 100644 --- a/salt/states/mongodb_user.py +++ b/salt/states/mongodb_user.py @@ -81,7 +81,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "User {} is already present".format(name), + "comment": f"User {name} is already present", } # setup default empty roles if not provided to preserve previous API interface @@ -93,7 +93,7 @@ def present( port = int(port) except TypeError: ret["result"] = False - ret["comment"] = "Port ({}) is not an integer.".format(port) + ret["comment"] = f"Port ({port}) is not an integer." return ret # check if user exists @@ -106,7 +106,7 @@ def present( # users= (False, 'not authorized on admin to execute command { usersInfo: "root" }') if not users[0]: ret["result"] = False - ret["comment"] = "Mongo Err: {}".format(users[1]) + ret["comment"] = f"Mongo Err: {users[1]}" return ret # check each user occurrence @@ -152,7 +152,7 @@ def present( if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} is not present and needs to be created".format(name) + ret["comment"] = f"User {name} is not present and needs to be created" return ret # The user is not present, make it! if __salt__["mongodb.user_create"]( @@ -166,10 +166,10 @@ def present( authdb=authdb, roles=roles, ): - ret["comment"] = "User {} has been created".format(name) + ret["comment"] = f"User {name} has been created" ret["changes"][name] = "Present" else: - ret["comment"] = "Failed to create database {}".format(name) + ret["comment"] = f"Failed to create database {name}" ret["result"] = False return ret @@ -212,12 +212,12 @@ def absent( if user_exists is True: if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} is present and needs to be removed".format(name) + ret["comment"] = f"User {name} is present and needs to be removed" return ret if __salt__["mongodb.user_remove"]( name, user, password, host, port, database=database, authdb=authdb ): - ret["comment"] = "User {} has been removed".format(name) + ret["comment"] = f"User {name} has been removed" ret["changes"][name] = "Absent" return ret @@ -229,5 +229,5 @@ def absent( return ret # fallback - ret["comment"] = "User {} is not present".format(name) + ret["comment"] = f"User {name} is not present" return ret diff --git a/salt/states/monit.py b/salt/states/monit.py index b6de50d307f..4e1cd7dd514 100644 --- a/salt/states/monit.py +++ b/salt/states/monit.py @@ -40,20 +40,20 @@ def monitor(name): try: for key, value in result.items(): if "Running" in value[name]: - ret["comment"] = "{} is being being monitored.".format(name) + ret["comment"] = f"{name} is being being monitored." ret["result"] = True else: if __opts__["test"]: - ret["comment"] = "Service {} is set to be monitored.".format(name) + ret["comment"] = f"Service {name} is set to be monitored." ret["result"] = None return ret __salt__["monit.monitor"](name) - ret["comment"] = "{} started to be monitored.".format(name) + ret["comment"] = f"{name} started to be monitored." ret["changes"][name] = "Running" ret["result"] = True break except KeyError: - ret["comment"] = "{} not found in configuration.".format(name) + ret["comment"] = f"{name} not found in configuration." ret["result"] = False return ret @@ -70,20 +70,20 @@ def unmonitor(name): try: for key, value in result.items(): if "Not monitored" in value[name]: - ret["comment"] = "{} is not being monitored.".format(name) + ret["comment"] = f"{name} is not being monitored." ret["result"] = True else: if __opts__["test"]: - ret["comment"] = "Service {} is set to be unmonitored.".format(name) + ret["comment"] = f"Service {name} is set to be unmonitored." ret["result"] = None return ret __salt__["monit.unmonitor"](name) - ret["comment"] = "{} stopped being monitored.".format(name) + ret["comment"] = f"{name} stopped being monitored." ret["changes"][name] = "Not monitored" ret["result"] = True break except KeyError: - ret["comment"] = "{} not found in configuration.".format(name) + ret["comment"] = f"{name} not found in configuration." ret["result"] = False return ret diff --git a/salt/states/mount.py b/salt/states/mount.py index c820d268325..35777c6b403 100644 --- a/salt/states/mount.py +++ b/salt/states/mount.py @@ -71,7 +71,7 @@ def mounted( extra_mount_translate_options=None, hidden_opts=None, bind_mount_copy_active_opts=True, - **kwargs + **kwargs, ): """ Verify that a device is mounted @@ -282,10 +282,10 @@ def mounted( real_device = device.split("=")[1].strip('"').lower() elif device.upper().startswith("LABEL="): _label = device.split("=")[1] - cmd = "blkid -t LABEL={}".format(_label) - res = __salt__["cmd.run_all"]("{}".format(cmd)) + cmd = f"blkid -t LABEL={_label}" + res = __salt__["cmd.run_all"](f"{cmd}") if res["retcode"] > 0: - ret["comment"] = "Unable to find device with label {}.".format(_label) + ret["comment"] = f"Unable to find device with label {_label}." ret["result"] = False return ret else: @@ -432,7 +432,7 @@ def mounted( ) if size_match: converted_size = _size_convert(size_match) - opt = "size={}k".format(converted_size) + opt = f"size={converted_size}k" # make cifs option user synonym for option username which is reported by /proc/mounts if fstype in ["cifs"] and opt.split("=")[0] == "user": opt = "username={}".format(opt.split("=")[1]) @@ -460,9 +460,9 @@ def mounted( ) if size_match: converted_size = _size_convert(size_match) - opt = "size={}k".format(converted_size) + opt = f"size={converted_size}k" _active_superopts.remove(_active_opt) - _active_opt = "size={}k".format(converted_size) + _active_opt = f"size={converted_size}k" _active_superopts.append(_active_opt) if ( @@ -551,7 +551,7 @@ def mounted( if fstype in ["nfs", "cvfs"] or fstype.startswith("fuse"): ret["changes"]["umount"] = ( "Forced unmount and mount because " - + "options ({}) changed".format(opt) + + f"options ({opt}) changed" ) unmount_result = __salt__["mount.umount"](real_name) if unmount_result is True: @@ -572,7 +572,7 @@ def mounted( else: ret["changes"]["umount"] = ( "Forced remount because " - + "options ({}) changed".format(opt) + + f"options ({opt}) changed" ) remount_result = __salt__["mount.remount"]( real_name, @@ -638,13 +638,11 @@ def mounted( if __opts__["test"]: ret["result"] = None if os.path.exists(name): - ret["comment"] = "{} would be mounted".format(name) + ret["comment"] = f"{name} would be mounted" elif mkmnt: - ret["comment"] = "{} would be created and mounted".format(name) + ret["comment"] = f"{name} would be created and mounted" else: - ret["comment"] = ( - "{} does not exist and would not be created".format(name) - ) + ret["comment"] = f"{name} does not exist and would not be created" return ret if not os.path.exists(name) and not mkmnt: @@ -668,7 +666,7 @@ def mounted( if __opts__["test"]: ret["result"] = None if mkmnt: - ret["comment"] = "{} would be created, but not mounted".format(name) + ret["comment"] = f"{name} would be created, but not mounted" else: ret["comment"] = ( "{} does not exist and would neither be created nor mounted".format( @@ -677,14 +675,14 @@ def mounted( ) elif mkmnt: __salt__["file.mkdir"](name, user=user) - ret["comment"] = "{} was created, not mounted".format(name) + ret["comment"] = f"{name} was created, not mounted" else: - ret["comment"] = "{} not present and not mounted".format(name) + ret["comment"] = f"{name} not present and not mounted" else: if __opts__["test"]: - ret["comment"] = "{} would not be mounted".format(name) + ret["comment"] = f"{name} would not be mounted" else: - ret["comment"] = "{} not mounted".format(name) + ret["comment"] = f"{name} not mounted" if persist: if "/etc/fstab" == config: @@ -745,7 +743,7 @@ def mounted( name ) else: - comment = "The {} fstab entry must be updated.".format(name) + comment = f"The {name} fstab entry must be updated." else: ret["result"] = False comment = ( @@ -824,25 +822,25 @@ def swap(name, persist=True, config="/etc/fstab"): if __salt__["file.is_link"](name): real_swap_device = __salt__["file.readlink"](name) if not real_swap_device.startswith("/"): - real_swap_device = "/dev/{}".format(os.path.basename(real_swap_device)) + real_swap_device = f"/dev/{os.path.basename(real_swap_device)}" else: real_swap_device = name if real_swap_device in on_: - ret["comment"] = "Swap {} already active".format(name) + ret["comment"] = f"Swap {name} already active" elif __opts__["test"]: ret["result"] = None - ret["comment"] = "Swap {} is set to be activated".format(name) + ret["comment"] = f"Swap {name} is set to be activated" else: __salt__["mount.swapon"](real_swap_device) on_ = __salt__["mount.swaps"]() if real_swap_device in on_: - ret["comment"] = "Swap {} activated".format(name) + ret["comment"] = f"Swap {name} activated" ret["changes"] = on_[real_swap_device] else: - ret["comment"] = "Swap {} failed to activate".format(name) + ret["comment"] = f"Swap {name} failed to activate" ret["result"] = False if persist: @@ -949,7 +947,7 @@ def unmounted( # The mount is present! Unmount it if __opts__["test"]: ret["result"] = None - ret["comment"] = "Mount point {} is mounted but should not be".format(name) + ret["comment"] = f"Mount point {name} is mounted but should not be" return ret if device: out = __salt__["mount.umount"](name, device, user=user) @@ -1041,10 +1039,10 @@ def mod_watch(name, user=None, **kwargs): name, kwargs["device"], False, kwargs["fstype"], kwargs["opts"], user=user ) if out: - ret["comment"] = "{} remounted".format(name) + ret["comment"] = f"{name} remounted" else: ret["result"] = False - ret["comment"] = "{} failed to remount: {}".format(name, out) + ret["comment"] = f"{name} failed to remount: {out}" else: ret["comment"] = "Watch not supported in {} at this time".format(kwargs["sfun"]) return ret @@ -1064,7 +1062,7 @@ def _convert_to(maybe_device, convert_to): if ( not convert_to or (convert_to == "device" and maybe_device.startswith("/")) - or maybe_device.startswith("{}=".format(convert_to.upper())) + or maybe_device.startswith(f"{convert_to.upper()}=") ): return maybe_device @@ -1080,7 +1078,7 @@ def _convert_to(maybe_device, convert_to): result = next(iter(blkid)) else: key = convert_to.upper() - result = "{}={}".format(key, next(iter(blkid.values()))[key]) + result = f"{key}={next(iter(blkid.values()))[key]}" return result @@ -1232,7 +1230,7 @@ def fstab_present( msg = "{} entry will be written in {}." ret["comment"].append(msg.format(fs_file, config)) if mount: - msg = "Will mount {} on {}".format(name, fs_file) + msg = f"Will mount {name} on {fs_file}" ret["comment"].append(msg) elif out == "change": msg = "{} entry will be updated in {}." @@ -1290,7 +1288,7 @@ def fstab_present( ret["result"] = False msg = "Error while mounting {}".format(out.split(":", maxsplit=1)[1]) else: - msg = "Mounted {} on {}".format(name, fs_file) + msg = f"Mounted {name} on {fs_file}" ret["comment"].append(msg) elif out == "change": ret["changes"]["persist"] = out diff --git a/salt/states/mssql_database.py b/salt/states/mssql_database.py index 532a93fa5b7..f3f44f0bd64 100644 --- a/salt/states/mssql_database.py +++ b/salt/states/mssql_database.py @@ -25,7 +25,7 @@ def __virtual__(): def _normalize_options(options): if type(options) in [dict, collections.OrderedDict]: - return ["{}={}".format(k, v) for k, v in options.items()] + return [f"{k}={v}" for k, v in options.items()] if type(options) is list and (not options or type(options[0]) is str): return options # Invalid options @@ -59,14 +59,14 @@ def present(name, containment="NONE", options=None, **kwargs): return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Database {} is set to be added".format(name) + ret["comment"] = f"Database {name} is set to be added" return ret db_created = __salt__["mssql.db_create"]( name, containment=containment, new_database_options=_normalize_options(options), - **kwargs + **kwargs, ) if ( db_created is not True @@ -76,7 +76,7 @@ def present(name, containment="NONE", options=None, **kwargs): name, db_created ) return ret - ret["comment"] += "Database {} has been added".format(name) + ret["comment"] += f"Database {name} has been added" ret["changes"][name] = "Present" return ret @@ -91,17 +91,17 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": True, "comment": ""} if not __salt__["mssql.db_exists"](name): - ret["comment"] = "Database {} is not present".format(name) + ret["comment"] = f"Database {name} is not present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Database {} is set to be removed".format(name) + ret["comment"] = f"Database {name} is set to be removed" return ret if __salt__["mssql.db_remove"](name, **kwargs): - ret["comment"] = "Database {} has been removed".format(name) + ret["comment"] = f"Database {name} has been removed" ret["changes"][name] = "Absent" return ret # else: ret["result"] = False - ret["comment"] = "Database {} failed to be removed".format(name) + ret["comment"] = f"Database {name} failed to be removed" return ret diff --git a/salt/states/mssql_login.py b/salt/states/mssql_login.py index d635a3c42e0..56316db60f4 100644 --- a/salt/states/mssql_login.py +++ b/salt/states/mssql_login.py @@ -26,7 +26,7 @@ def __virtual__(): def _normalize_options(options): if type(options) in [dict, collections.OrderedDict]: - return ["{}={}".format(k, v) for k, v in options.items()] + return [f"{k}={v}" for k, v in options.items()] if type(options) is list and (not options or type(options[0]) is str): return options # Invalid options @@ -75,7 +75,7 @@ def present( return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Login {} is set to be added".format(name) + ret["comment"] = f"Login {name} is set to be added" return ret login_created = __salt__["mssql.login_create"]( @@ -84,14 +84,14 @@ def present( new_login_domain=domain, new_login_roles=server_roles, new_login_options=_normalize_options(options), - **kwargs + **kwargs, ) # Non-empty strings are also evaluated to True, so we cannot use if not login_created: if login_created is not True: ret["result"] = False - ret["comment"] = "Login {} failed to be added: {}".format(name, login_created) + ret["comment"] = f"Login {name} failed to be added: {login_created}" return ret - ret["comment"] = "Login {} has been added. ".format(name) + ret["comment"] = f"Login {name} has been added. " ret["changes"][name] = "Present" return ret @@ -106,17 +106,17 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": True, "comment": ""} if not __salt__["mssql.login_exists"](name): - ret["comment"] = "Login {} is not present".format(name) + ret["comment"] = f"Login {name} is not present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Login {} is set to be removed".format(name) + ret["comment"] = f"Login {name} is set to be removed" return ret if __salt__["mssql.login_remove"](name, **kwargs): - ret["comment"] = "Login {} has been removed".format(name) + ret["comment"] = f"Login {name} has been removed" ret["changes"][name] = "Absent" return ret # else: ret["result"] = False - ret["comment"] = "Login {} failed to be removed".format(name) + ret["comment"] = f"Login {name} failed to be removed" return ret diff --git a/salt/states/mssql_role.py b/salt/states/mssql_role.py index 5434c226512..2bd540233f0 100644 --- a/salt/states/mssql_role.py +++ b/salt/states/mssql_role.py @@ -43,7 +43,7 @@ def present(name, owner=None, grants=None, **kwargs): return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Role {} is set to be added".format(name) + ret["comment"] = f"Role {name} is set to be added" return ret role_created = __salt__["mssql.role_create"]( @@ -53,9 +53,9 @@ def present(name, owner=None, grants=None, **kwargs): role_created is not True ): # Non-empty strings are also evaluated to True, so we cannot use if not role_created: ret["result"] = False - ret["comment"] += "Role {} failed to be created: {}".format(name, role_created) + ret["comment"] += f"Role {name} failed to be created: {role_created}" return ret - ret["comment"] += "Role {} has been added".format(name) + ret["comment"] += f"Role {name} has been added" ret["changes"][name] = "Present" return ret @@ -70,17 +70,17 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": True, "comment": ""} if not __salt__["mssql.role_exists"](name): - ret["comment"] = "Role {} is not present".format(name) + ret["comment"] = f"Role {name} is not present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Role {} is set to be removed".format(name) + ret["comment"] = f"Role {name} is set to be removed" return ret if __salt__["mssql.role_remove"](name, **kwargs): - ret["comment"] = "Role {} has been removed".format(name) + ret["comment"] = f"Role {name} has been removed" ret["changes"][name] = "Absent" return ret # else: ret["result"] = False - ret["comment"] = "Role {} failed to be removed".format(name) + ret["comment"] = f"Role {name} failed to be removed" return ret diff --git a/salt/states/mssql_user.py b/salt/states/mssql_user.py index f7acf30489e..60f8987d518 100644 --- a/salt/states/mssql_user.py +++ b/salt/states/mssql_user.py @@ -26,7 +26,7 @@ def __virtual__(): def _normalize_options(options): if type(options) in [dict, collections.OrderedDict]: - return ["{}={}".format(k, v) for k, v in options.items()] + return [f"{k}={v}" for k, v in options.items()] if type(options) is list and (not options or type(options[0]) is str): return options # Invalid options @@ -74,7 +74,7 @@ def present( return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} is set to be added".format(name) + ret["comment"] = f"User {name} is set to be added" return ret user_created = __salt__["mssql.user_create"]( @@ -84,15 +84,15 @@ def present( database=database, roles=roles, options=_normalize_options(options), - **kwargs + **kwargs, ) if ( user_created is not True ): # Non-empty strings are also evaluated to True, so we cannot use if not user_created: ret["result"] = False - ret["comment"] += "User {} failed to be added: {}".format(name, user_created) + ret["comment"] += f"User {name} failed to be added: {user_created}" return ret - ret["comment"] += "User {} has been added".format(name) + ret["comment"] += f"User {name} has been added" ret["changes"][name] = "Present" return ret @@ -107,17 +107,17 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": True, "comment": ""} if not __salt__["mssql.user_exists"](name): - ret["comment"] = "User {} is not present".format(name) + ret["comment"] = f"User {name} is not present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} is set to be removed".format(name) + ret["comment"] = f"User {name} is set to be removed" return ret if __salt__["mssql.user_remove"](name, **kwargs): - ret["comment"] = "User {} has been removed".format(name) + ret["comment"] = f"User {name} has been removed" ret["changes"][name] = "Absent" return ret # else: ret["result"] = False - ret["comment"] = "User {} failed to be removed".format(name) + ret["comment"] = f"User {name} failed to be removed" return ret diff --git a/salt/states/msteams.py b/salt/states/msteams.py index d061051c5d0..a4438825797 100644 --- a/salt/states/msteams.py +++ b/salt/states/msteams.py @@ -69,7 +69,7 @@ def post_card(name, message, hook_url=None, title=None, theme_color=None): return ret if not message: - ret["comment"] = "Teams message is missing: {}".format(message) + ret["comment"] = f"Teams message is missing: {message}" return ret try: @@ -80,11 +80,11 @@ def post_card(name, message, hook_url=None, title=None, theme_color=None): theme_color=theme_color, ) except SaltInvocationError as sie: - ret["comment"] = "Failed to send message ({}): {}".format(sie, name) + ret["comment"] = f"Failed to send message ({sie}): {name}" else: if isinstance(result, bool) and result: ret["result"] = True - ret["comment"] = "Sent message: {}".format(name) + ret["comment"] = f"Sent message: {name}" else: ret["comment"] = "Failed to send message ({}): {}".format( result["message"], name diff --git a/salt/states/mysql_database.py b/salt/states/mysql_database.py index c7561cf14db..0c0ce030ff4 100644 --- a/salt/states/mysql_database.py +++ b/salt/states/mysql_database.py @@ -52,7 +52,7 @@ def present(name, character_set=None, collate=None, **connection_args): "name": name, "changes": {}, "result": True, - "comment": "Database {} is already present".format(name), + "comment": f"Database {name} is already present", } # check if database exists existing = __salt__["mysql.db_get"](name, **connection_args) @@ -91,20 +91,20 @@ def present(name, character_set=None, collate=None, **connection_args): ) if __opts__.get("test", False): ret["result"] = None - ret["comment"] += "\n{}".format(comment) + ret["comment"] += f"\n{comment}" return ret else: - ret["comment"] += "\n{}".format(comment) + ret["comment"] += f"\n{comment}" if alter_charset or alter_collate: if __opts__.get("test", False): - ret["comment"] += "\nDatabase {} is going to be updated".format(name) + ret["comment"] += f"\nDatabase {name} is going to be updated" else: __salt__["mysql.alter_db"]( name, character_set=character_set, collate=collate, - **connection_args + **connection_args, ) current = __salt__["mysql.db_get"](name, **connection_args) @@ -145,13 +145,13 @@ def present(name, character_set=None, collate=None, **connection_args): if __salt__["mysql.db_create"]( name, character_set=character_set, collate=collate, **connection_args ): - ret["comment"] = "The database {} has been created".format(name) + ret["comment"] = f"The database {name} has been created" ret["changes"][name] = "Present" else: - ret["comment"] = "Failed to create database {}".format(name) + ret["comment"] = f"Failed to create database {name}" err = _get_mysql_error() if err is not None: - ret["comment"] += " ({})".format(err) + ret["comment"] += f" ({err})" ret["result"] = False return ret @@ -175,13 +175,13 @@ def absent(name, **connection_args): ) return ret if __salt__["mysql.db_remove"](name, **connection_args): - ret["comment"] = "Database {} has been removed".format(name) + ret["comment"] = f"Database {name} has been removed" ret["changes"][name] = "Absent" return ret else: err = _get_mysql_error() if err is not None: - ret["comment"] = "Unable to remove database {} ({})".format(name, err) + ret["comment"] = f"Unable to remove database {name} ({err})" ret["result"] = False return ret else: @@ -192,5 +192,5 @@ def absent(name, **connection_args): return ret # fallback - ret["comment"] = "Database {} is not present, so it cannot be removed".format(name) + ret["comment"] = f"Database {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/mysql_grants.py b/salt/states/mysql_grants.py index cefba9465bc..74e1c8346b5 100644 --- a/salt/states/mysql_grants.py +++ b/salt/states/mysql_grants.py @@ -77,7 +77,7 @@ def present( escape=True, revoke_first=False, ssl_option=False, - **connection_args + **connection_args, ): """ Ensure that the grant is present with the specified properties @@ -182,14 +182,14 @@ def present( host=host, grant_option=grant_option, escape=escape, - **connection_args + **connection_args, ) # The grant is not present, make it! if __opts__["test"]: # there is probably better things to make in test mode ret["result"] = None - ret["comment"] = "MySQL grant {} is set to be created".format(name) + ret["comment"] = f"MySQL grant {name} is set to be created" return ret if __salt__["mysql.grant_add"]( grant, database, user, host, grant_option, escape, ssl_option, **connection_args @@ -202,7 +202,7 @@ def present( ret["comment"] = ret["comment"].format(grant, database, user, host) err = _get_mysql_error() if err is not None: - ret["comment"] += " ({})".format(err) + ret["comment"] += f" ({err})" ret["result"] = False return ret @@ -215,7 +215,7 @@ def absent( host="localhost", grant_option=False, escape=True, - **connection_args + **connection_args, ): """ Ensure that the grant is absent @@ -244,7 +244,7 @@ def absent( if __opts__["test"]: ret["result"] = None - ret["comment"] = "MySQL grant {} is set to be revoked".format(name) + ret["comment"] = f"MySQL grant {name} is set to be revoked" return ret if __salt__["mysql.grant_revoke"]( grant, database, user, host, grant_option, **connection_args diff --git a/salt/states/mysql_query.py b/salt/states/mysql_query.py index 46bac68c201..d0bc6bedfc9 100644 --- a/salt/states/mysql_query.py +++ b/salt/states/mysql_query.py @@ -56,7 +56,7 @@ def run_file( saltenv=None, check_db_exists=True, client_flags=None, - **connection_args + **connection_args, ): """ Execute an arbitrary query on the specified database @@ -103,7 +103,7 @@ def run_file( "name": name, "changes": {}, "result": True, - "comment": "Database {} is already present".format(database), + "comment": f"Database {database} is already present", } if client_flags is None: @@ -124,7 +124,7 @@ def run_file( query_file = __salt__["cp.cache_file"](query_file, saltenv=saltenv or __env__) if not os.path.exists(query_file): - ret["comment"] = "File {} does not exist".format(query_file) + ret["comment"] = f"File {query_file} does not exist" ret["result"] = False return ret @@ -137,7 +137,7 @@ def run_file( return ret ret["result"] = None - ret["comment"] = "Database {} is not present".format(database) + ret["comment"] = f"Database {database} is not present" return ret # Check if execution needed @@ -252,7 +252,7 @@ def run( overwrite=True, check_db_exists=True, client_flags=None, - **connection_args + **connection_args, ): """ Execute an arbitrary query on the specified database @@ -294,7 +294,7 @@ def run( "name": name, "changes": {}, "result": True, - "comment": "Database {} is already present".format(database), + "comment": f"Database {database} is already present", } if client_flags is None: @@ -315,7 +315,7 @@ def run( return ret ret["result"] = None - ret["comment"] = "Database {} is not present".format(name) + ret["comment"] = f"Database {name} is not present" return ret # Check if execution needed @@ -413,7 +413,7 @@ def run( else: for col, val in query_result.items(): output_file.write( - salt.utils.stringutils.to_str("{}:{}\n".format(col, val)) + salt.utils.stringutils.to_str(f"{col}:{val}\n") ) else: ret["changes"]["query"] = "Executed" diff --git a/salt/states/mysql_user.py b/salt/states/mysql_user.py index 61f2caa936a..1c54de4ec5c 100644 --- a/salt/states/mysql_user.py +++ b/salt/states/mysql_user.py @@ -73,7 +73,7 @@ def present( unix_socket=False, password_column=None, auth_plugin="mysql_native_password", - **connection_args + **connection_args, ): """ Ensure that the named user is present with the specified properties. A @@ -117,7 +117,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "User {}@{} is already present".format(name, host), + "comment": f"User {name}@{host} is already present", } passwordless = not any((password, password_hash)) @@ -138,7 +138,7 @@ def present( passwordless=True, unix_socket=unix_socket, password_column=password_column, - **connection_args + **connection_args, ): if allow_passwordless: ret["comment"] += " with passwordless login" @@ -157,7 +157,7 @@ def present( password_hash, unix_socket=unix_socket, password_column=password_column, - **connection_args + **connection_args, ): if auth_plugin == "mysql_native_password": ret["comment"] += " with the desired password" @@ -180,7 +180,7 @@ def present( # The user is present, change the password if __opts__["test"]: - ret["comment"] = "Password for user {}@{} is set to be ".format(name, host) + ret["comment"] = f"Password for user {name}@{host} is set to be " ret["result"] = None if passwordless: ret["comment"] += "cleared" @@ -198,7 +198,7 @@ def present( password_hash, allow_passwordless, unix_socket, - **connection_args + **connection_args, ): ret["comment"] = "Password for user {}@{} has been {}".format( name, host, "cleared" if passwordless else "changed" @@ -210,7 +210,7 @@ def present( ) err = _get_mysql_error() if err is not None: - ret["comment"] += " ({})".format(err) + ret["comment"] += f" ({err})" if passwordless and not salt.utils.data.is_true(allow_passwordless): ret["comment"] += ( ". Note: allow_passwordless must be True " @@ -227,7 +227,7 @@ def present( # The user is not present, make it! if __opts__["test"]: - ret["comment"] = "User {}@{} is set to be added".format(name, host) + ret["comment"] = f"User {name}@{host} is set to be added" ret["result"] = None if allow_passwordless: ret["comment"] += " with passwordless login" @@ -247,19 +247,19 @@ def present( unix_socket=unix_socket, password_column=password_column, auth_plugin=auth_plugin, - **connection_args + **connection_args, ): - ret["comment"] = "The user {}@{} has been added".format(name, host) + ret["comment"] = f"The user {name}@{host} has been added" if allow_passwordless: ret["comment"] += " with passwordless login" if unix_socket: ret["comment"] += " using unix_socket" ret["changes"][name] = "Present" else: - ret["comment"] = "Failed to create user {}@{}".format(name, host) + ret["comment"] = f"Failed to create user {name}@{host}" err = _get_mysql_error() if err is not None: - ret["comment"] += " ({})".format(err) + ret["comment"] += f" ({err})" ret["result"] = False return ret @@ -278,10 +278,10 @@ def absent(name, host="localhost", **connection_args): if __salt__["mysql.user_exists"](name, host, **connection_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {}@{} is set to be removed".format(name, host) + ret["comment"] = f"User {name}@{host} is set to be removed" return ret if __salt__["mysql.user_remove"](name, host, **connection_args): - ret["comment"] = "User {}@{} has been removed".format(name, host) + ret["comment"] = f"User {name}@{host} has been removed" ret["changes"][name] = "Absent" return ret else: diff --git a/salt/states/netconfig.py b/salt/states/netconfig.py index 2b050e8abee..17870ab4afd 100644 --- a/salt/states/netconfig.py +++ b/salt/states/netconfig.py @@ -67,7 +67,7 @@ def _update_config( commit=True, debug=False, replace=False, - **template_vars + **template_vars, ): """ Call the necessary functions in order to execute the state. @@ -92,7 +92,7 @@ def _update_config( commit=commit, debug=debug, replace=replace, - **template_vars + **template_vars, ) @@ -275,7 +275,7 @@ def saved( win_deny_perms=None, win_inheritance=True, win_perms_reset=False, - **kwargs + **kwargs, ): """ .. versionadded:: 2019.2.0 @@ -452,7 +452,7 @@ def saved( win_deny_perms=win_deny_perms, win_inheritance=win_inheritance, win_perms_reset=win_perms_reset, - **kwargs + **kwargs, ) @@ -475,7 +475,7 @@ def managed( commit_at=None, revert_in=None, revert_at=None, - **template_vars + **template_vars, ): """ Manages the configuration on network devices. @@ -851,7 +851,7 @@ def managed( revert_at=revert_at, debug=debug, replace=replace, - **template_vars + **template_vars, ) return salt.utils.napalm.loaded_ret(ret, config_update_ret, test, debug) @@ -877,7 +877,7 @@ def commit_cancelled(name): """ cancelled = {"name": name, "result": None, "changes": {}, "comment": ""} if __opts__["test"]: - cancelled["comment"] = "It would cancel commit #{}".format(name) + cancelled["comment"] = f"It would cancel commit #{name}" return cancelled ret = __salt__["net.cancel_commit"](name) cancelled.update(ret) @@ -904,7 +904,7 @@ def commit_confirmed(name): """ confirmed = {"name": name, "result": None, "changes": {}, "comment": ""} if __opts__["test"]: - confirmed["comment"] = "It would confirm commit #{}".format(name) + confirmed["comment"] = f"It would confirm commit #{name}" return confirmed ret = __salt__["net.confirm_commit"](name) confirmed.update(ret) diff --git a/salt/states/netntp.py b/salt/states/netntp.py index e0efb1b14a5..561b5bbda12 100644 --- a/salt/states/netntp.py +++ b/salt/states/netntp.py @@ -178,7 +178,7 @@ def _check_diff_and_configure(fun_name, peers_servers, name="peers"): if name not in _options: return _ret - _retrieve_fun = "_retrieve_ntp_{what}".format(what=name) + _retrieve_fun = f"_retrieve_ntp_{name}" ntp_list_output = _exec_fun( _retrieve_fun ) # contains only IP Addresses as dictionary keys @@ -195,7 +195,7 @@ def _check_diff_and_configure(fun_name, peers_servers, name="peers"): if configured_ntp_list == desired_ntp_list: _ret.update( { - "comment": "NTP {what} already configured as needed.".format(what=name), + "comment": f"NTP {name} already configured as needed.", "result": True, } ) @@ -231,7 +231,7 @@ def _check_diff_and_configure(fun_name, peers_servers, name="peers"): comment = "" if list_to_set: - _set_fun = "_set_ntp_{what}".format(what=name) + _set_fun = f"_set_ntp_{name}" _set = _exec_fun(_set_fun, list_to_set) if _set.get("result"): expected_config_change = True @@ -242,7 +242,7 @@ def _check_diff_and_configure(fun_name, peers_servers, name="peers"): ) if list_to_delete: - _delete_fun = "_delete_ntp_{what}".format(what=name) + _delete_fun = f"_delete_ntp_{name}" _removed = _exec_fun(_delete_fun, list_to_delete) if _removed.get("result"): expected_config_change = True diff --git a/salt/states/netsnmp.py b/salt/states/netsnmp.py index 325ca88e9f7..f18dbd8b44f 100644 --- a/salt/states/netsnmp.py +++ b/salt/states/netsnmp.py @@ -246,7 +246,7 @@ def _configure(changes): _chassis_id = _updated_changes.get("chassis_id", "") if key == "removed": fun = "remove_config" - _ret = __salt__["snmp.{fun}".format(fun=fun)]( + _ret = __salt__[f"snmp.{fun}"]( location=_location, contact=_contact, community=_community, diff --git a/salt/states/netusers.py b/salt/states/netusers.py index 98b589cfb90..350fe5b471c 100644 --- a/salt/states/netusers.py +++ b/salt/states/netusers.py @@ -83,7 +83,7 @@ def _check_users(users): for user, user_details in users.items(): if not user_details: valid = False - messg += "Please provide details for username {user}.\n".format(user=user) + messg += f"Please provide details for username {user}.\n" continue if not ( isinstance(user_details.get("level"), int) diff --git a/salt/states/network.py b/salt/states/network.py index d3a2a2e203d..383b1b69243 100644 --- a/salt/states/network.py +++ b/salt/states/network.py @@ -482,7 +482,7 @@ def managed(name, enabled=True, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Interface {} is up to date.".format(name), + "comment": f"Interface {name} is up to date.", } if "test" not in kwargs: kwargs["test"] = __opts__.get("test", False) @@ -513,7 +513,7 @@ def managed(name, enabled=True, **kwargs): pass if not old and new: ret["result"] = None - ret["comment"] = "Interface {} is set to be added.".format(name) + ret["comment"] = f"Interface {name} is set to be added." elif old != new: diff = difflib.unified_diff(old, new, lineterm="") ret["result"] = None @@ -522,12 +522,12 @@ def managed(name, enabled=True, **kwargs): ) else: if not old and new: - ret["comment"] = "Interface {} added.".format(name) + ret["comment"] = f"Interface {name} added." ret["changes"]["interface"] = "Added network interface." apply_ranged_setting = True elif old != new: diff = difflib.unified_diff(old, new, lineterm="") - ret["comment"] = "Interface {} updated.".format(name) + ret["comment"] = f"Interface {name} updated." ret["changes"]["interface"] = "\n".join(diff) apply_ranged_setting = True except AttributeError as error: @@ -561,12 +561,12 @@ def managed(name, enabled=True, **kwargs): ) else: if not old and new: - ret["comment"] = "Bond interface {} added.".format(name) - ret["changes"]["bond"] = "Added bond {}.".format(name) + ret["comment"] = f"Bond interface {name} added." + ret["changes"]["bond"] = f"Added bond {name}." apply_ranged_setting = True elif old != new: diff = difflib.unified_diff(old, new, lineterm="") - ret["comment"] = "Bond interface {} updated.".format(name) + ret["comment"] = f"Bond interface {name} updated." ret["changes"]["bond"] = "\n".join(diff) apply_ranged_setting = True except AttributeError as error: @@ -626,17 +626,17 @@ def managed(name, enabled=True, **kwargs): # Interface should restart to validate if it's up __salt__["ip.down"](name, iface_type) __salt__["ip.up"](name, iface_type) - ret["changes"]["status"] = ( - "Interface {} restart to validate".format(name) - ) + ret["changes"][ + "status" + ] = f"Interface {name} restart to validate" else: __salt__["ip.up"](name, iface_type) - ret["changes"]["status"] = "Interface {} is up".format(name) + ret["changes"]["status"] = f"Interface {name} is up" else: if "noifupdown" not in kwargs: if interface_status: __salt__["ip.down"](name, iface_type) - ret["changes"]["status"] = "Interface {} down".format(name) + ret["changes"]["status"] = f"Interface {name} down" except Exception as error: # pylint: disable=broad-except ret["result"] = False ret["comment"] = str(error) @@ -648,7 +648,7 @@ def managed(name, enabled=True, **kwargs): if "slaves" in kwargs and kwargs["slaves"]: # Check that there are new slaves for this master present_slaves = __salt__["cmd.run"]( - ["cat", "/sys/class/net/{}/bonding/slaves".format(name)] + ["cat", f"/sys/class/net/{name}/bonding/slaves"] ).split() if isinstance(kwargs["slaves"], list): desired_slaves = kwargs["slaves"] @@ -706,7 +706,7 @@ def routes(name, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Interface {} routes are up to date.".format(name), + "comment": f"Interface {name} routes are up to date.", } apply_routes = False if "test" not in kwargs: @@ -721,7 +721,7 @@ def routes(name, **kwargs): return ret if not old and new: ret["result"] = None - ret["comment"] = "Interface {} routes are set to be added.".format(name) + ret["comment"] = f"Interface {name} routes are set to be added." return ret elif old != new: diff = difflib.unified_diff(old, new, lineterm="") @@ -734,12 +734,12 @@ def routes(name, **kwargs): return ret if not old and new: apply_routes = True - ret["comment"] = "Interface {} routes added.".format(name) - ret["changes"]["network_routes"] = "Added interface {} routes.".format(name) + ret["comment"] = f"Interface {name} routes added." + ret["changes"]["network_routes"] = f"Added interface {name} routes." elif old != new: diff = difflib.unified_diff(old, new, lineterm="") apply_routes = True - ret["comment"] = "Interface {} routes updated.".format(name) + ret["comment"] = f"Interface {name} routes updated." ret["changes"]["network_routes"] = "\n".join(diff) except AttributeError as error: ret["result"] = False diff --git a/salt/states/neutron_network.py b/salt/states/neutron_network.py index 3361675749a..2dc5bc0a3a0 100644 --- a/salt/states/neutron_network.py +++ b/salt/states/neutron_network.py @@ -98,7 +98,7 @@ def present(name, auth=None, **kwargs): del kwargs["project"] else: ret["result"] = False - ret["comment"] = "Project:{} not found.".format(projectname) + ret["comment"] = f"Project:{projectname} not found." return ret network = __salt__["neutronng.network_create"](**kwargs) diff --git a/salt/states/neutron_secgroup_rule.py b/salt/states/neutron_secgroup_rule.py index 3c65fc34308..219455a8447 100644 --- a/salt/states/neutron_secgroup_rule.py +++ b/salt/states/neutron_secgroup_rule.py @@ -95,7 +95,7 @@ def present(name, auth=None, **kwargs): if secgroup is None: ret["result"] = False ret["changes"] = ({},) - ret["comment"] = "Security Group does not exist {}".format(name) + ret["comment"] = f"Security Group does not exist {name}" return ret # we have to search through all secgroup rules for a possible match diff --git a/salt/states/nfs_export.py b/salt/states/nfs_export.py index ad572739d7f..27d6b853d54 100644 --- a/salt/states/nfs_export.py +++ b/salt/states/nfs_export.py @@ -140,14 +140,14 @@ def present(name, clients=None, hosts=None, options=None, exports="/etc/exports" if path in old: if old[path] == clients: ret["result"] = True - ret["comment"] = "Export {} already configured".format(path) + ret["comment"] = f"Export {path} already configured" return ret ret["changes"]["new"] = clients ret["changes"]["old"] = old[path] if __opts__["test"]: ret["result"] = None - ret["comment"] = "Export {} would be changed".format(path) + ret["comment"] = f"Export {path} would be changed" return ret __salt__["nfs3.del_export"](exports, path) @@ -157,7 +157,7 @@ def present(name, clients=None, hosts=None, options=None, exports="/etc/exports" ret["changes"]["new"] = clients if __opts__["test"]: ret["result"] = None - ret["comment"] = "Export {} would be added".format(path) + ret["comment"] = f"Export {path} would be added" return ret add_export = __salt__["nfs3.add_export"] @@ -186,7 +186,7 @@ def absent(name, exports="/etc/exports"): old = __salt__["nfs3.list_exports"](exports) if path in old: if __opts__["test"]: - ret["comment"] = "Export {} would be removed".format(path) + ret["comment"] = f"Export {path} would be removed" ret["changes"][path] = old[path] ret["result"] = None return ret @@ -196,12 +196,12 @@ def absent(name, exports="/etc/exports"): if not try_reload["result"]: ret["comment"] = try_reload["stderr"] else: - ret["comment"] = "Export {} removed".format(path) + ret["comment"] = f"Export {path} removed" ret["result"] = try_reload["result"] ret["changes"][path] = old[path] else: - ret["comment"] = "Export {} already absent".format(path) + ret["comment"] = f"Export {path} already absent" ret["result"] = True return ret diff --git a/salt/states/nftables.py b/salt/states/nftables.py index 2088e51efea..fa9a33fb929 100644 --- a/salt/states/nftables.py +++ b/salt/states/nftables.py @@ -438,7 +438,7 @@ def delete(name, family="ipv4", **kwargs): if res["result"]: ret["changes"] = {"locale": name} ret["result"] = True - ret["comment"] = "Delete nftables rule for {} {}".format(name, command.strip()) + ret["comment"] = f"Delete nftables rule for {name} {command.strip()}" if "save" in kwargs: if kwargs["save"]: __salt__["nftables.save"](filename=None, family=family) @@ -642,7 +642,7 @@ def table_present(name, family="ipv4", **kwargs): ) else: ret["result"] = False - ret["comment"] = "Failed to create table {} for family {}".format(name, family) + ret["comment"] = f"Failed to create table {name} for family {family}" return ret @@ -687,6 +687,6 @@ def table_absent(name, family="ipv4", **kwargs): ) else: ret["result"] = False - ret["comment"] = "Failed to delete table {} from family {}".format(name, family) + ret["comment"] = f"Failed to delete table {name} from family {family}" return ret diff --git a/salt/states/npm.py b/salt/states/npm.py index 8f7415d1f58..1e8b942f90c 100644 --- a/salt/states/npm.py +++ b/salt/states/npm.py @@ -94,7 +94,7 @@ def installed( installed_pkgs = __salt__["npm.list"](dir=dir, runas=user, env=env, depth=0) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error looking up '{}': {}".format(name, err) + ret["comment"] = f"Error looking up '{name}': {err}" return ret else: installed_pkgs = {p: info for p, info in installed_pkgs.items()} @@ -238,26 +238,26 @@ def removed(name, dir=None, user=None): installed_pkgs = __salt__["npm.list"](dir=dir, depth=0) except (CommandExecutionError, CommandNotFoundError) as err: ret["result"] = False - ret["comment"] = "Error uninstalling '{}': {}".format(name, err) + ret["comment"] = f"Error uninstalling '{name}': {err}" return ret if name not in installed_pkgs: ret["result"] = True - ret["comment"] = "Package '{}' is not installed".format(name) + ret["comment"] = f"Package '{name}' is not installed" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Package '{}' is set to be removed".format(name) + ret["comment"] = f"Package '{name}' is set to be removed" return ret if __salt__["npm.uninstall"](pkg=name, dir=dir, runas=user): ret["result"] = True ret["changes"][name] = "Removed" - ret["comment"] = "Package '{}' was successfully removed".format(name) + ret["comment"] = f"Package '{name}' was successfully removed" else: ret["result"] = False - ret["comment"] = "Error removing package '{}'".format(name) + ret["comment"] = f"Error removing package '{name}'" return ret @@ -283,20 +283,20 @@ def bootstrap(name, user=None, silent=True): if call: ret["result"] = None ret["changes"] = {"old": [], "new": call} - ret["comment"] = "{} is set to be bootstrapped".format(name) + ret["comment"] = f"{name} is set to be bootstrapped" else: ret["result"] = True - ret["comment"] = "{} is already bootstrapped".format(name) + ret["comment"] = f"{name} is already bootstrapped" except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error Bootstrapping '{}': {}".format(name, err) + ret["comment"] = f"Error Bootstrapping '{name}': {err}" return ret try: call = __salt__["npm.install"](dir=name, runas=user, pkg=None, silent=silent) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error Bootstrapping '{}': {}".format(name, err) + ret["comment"] = f"Error Bootstrapping '{name}': {err}" return ret if not call: @@ -350,11 +350,11 @@ def cache_cleaned(name=None, user=None, force=False): all_cached_pkgs = __salt__["npm.cache_list"](path=None, runas=user) # The first package is always the cache path cache_root_path = all_cached_pkgs[0] - specific_pkg = "{}/{}/".format(cache_root_path, name) + specific_pkg = f"{cache_root_path}/{name}/" if specific_pkg not in cached_pkgs: ret["result"] = True - ret["comment"] = "Package {} is not in the cache".format(name) + ret["comment"] = f"Package {name} is not in the cache" return ret if __opts__["test"]: diff --git a/salt/states/nxos.py b/salt/states/nxos.py index 6888413e859..6d413d45548 100644 --- a/salt/states/nxos.py +++ b/salt/states/nxos.py @@ -352,7 +352,7 @@ def replace(name, repl, full_match=False): ret = {"name": name, "result": False, "changes": {}, "comment": ""} if full_match is False: - search = "^.*{}.*$".format(name) + search = f"^.*{name}.*$" else: search = name @@ -376,7 +376,7 @@ def replace(name, repl, full_match=False): if matches: ret["result"] = False - ret["comment"] = 'Failed to replace all instances of "{}"'.format(name) + ret["comment"] = f'Failed to replace all instances of "{name}"' else: ret["result"] = True ret["comment"] = 'Successfully replaced all instances of "{}" with "{}"'.format( diff --git a/salt/states/nxos_upgrade.py b/salt/states/nxos_upgrade.py index daa22f6fcfc..f4960b777be 100644 --- a/salt/states/nxos_upgrade.py +++ b/salt/states/nxos_upgrade.py @@ -90,7 +90,7 @@ def image_running(name, system_image, kickstart_image=None, issu=True, **kwargs) system_image=system_image, kickstart_image=kickstart_image, issu=issu, - **kwargs + **kwargs, ) if upgrade["upgrade_in_progress"]: @@ -99,7 +99,7 @@ def image_running(name, system_image, kickstart_image=None, issu=True, **kwargs) ret["comment"] = "NX-OS Device Now Being Upgraded - See Change Details Below" elif upgrade["succeeded"]: ret["result"] = upgrade["succeeded"] - ret["comment"] = "NX-OS Device Running Image: {}".format(_version_info()) + ret["comment"] = f"NX-OS Device Running Image: {_version_info()}" else: ret["comment"] = "Upgrade Failed: {}.".format(upgrade["error_data"]) diff --git a/salt/states/openstack_config.py b/salt/states/openstack_config.py index e635366f696..bad221a802a 100644 --- a/salt/states/openstack_config.py +++ b/salt/states/openstack_config.py @@ -112,7 +112,7 @@ def absent(name, filename, section, parameter=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Value '{}' is set to be deleted.".format(old_value) + ret["comment"] = f"Value '{old_value}' is set to be deleted." return ret __salt__["openstack_config.delete"]( diff --git a/salt/states/openvswitch_bridge.py b/salt/states/openvswitch_bridge.py index 13c4109598d..2949dc53dbd 100644 --- a/salt/states/openvswitch_bridge.py +++ b/salt/states/openvswitch_bridge.py @@ -32,16 +32,16 @@ def present(name, parent=None, vlan=None): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_bridge_created = "Bridge {} created.".format(name) - comment_bridge_notcreated = "Unable to create bridge: {}.".format(name) - comment_bridge_exists = "Bridge {} already exists.".format(name) + comment_bridge_created = f"Bridge {name} created." + comment_bridge_notcreated = f"Unable to create bridge: {name}." + comment_bridge_exists = f"Bridge {name} already exists." comment_bridge_mismatch = ( "Bridge {} already exists, but has a different" " parent or VLAN ID." ).format(name) changes_bridge_created = { name: { - "old": "Bridge {} does not exist.".format(name), - "new": "Bridge {} created".format(name), + "old": f"Bridge {name} does not exist.", + "new": f"Bridge {name} created", } } @@ -103,13 +103,13 @@ def absent(name): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_bridge_deleted = "Bridge {} deleted.".format(name) - comment_bridge_notdeleted = "Unable to delete bridge: {}.".format(name) - comment_bridge_notexists = "Bridge {} does not exist.".format(name) + comment_bridge_deleted = f"Bridge {name} deleted." + comment_bridge_notdeleted = f"Unable to delete bridge: {name}." + comment_bridge_notexists = f"Bridge {name} does not exist." changes_bridge_deleted = { name: { - "old": "Bridge {} exists.".format(name), - "new": "Bridge {} deleted.".format(name), + "old": f"Bridge {name} exists.", + "new": f"Bridge {name} deleted.", } } diff --git a/salt/states/openvswitch_port.py b/salt/states/openvswitch_port.py index efacfe5800f..a4591c6da12 100644 --- a/salt/states/openvswitch_port.py +++ b/salt/states/openvswitch_port.py @@ -47,18 +47,18 @@ def present( comments = {} - comments["comment_bridge_notexists"] = "Bridge {} does not exist.".format(bridge) - comments["comment_port_exists"] = "Port {} already exists.".format(name) + comments["comment_bridge_notexists"] = f"Bridge {bridge} does not exist." + comments["comment_port_exists"] = f"Port {name} already exists." comments["comment_port_created"] = "Port {} created on bridge {}.".format( name, bridge ) comments["comment_port_notcreated"] = ( - "Unable to create port {} on bridge {}.".format(name, bridge) + f"Unable to create port {name} on bridge {bridge}." ) comments["changes_port_created"] = { name: { - "old": "No port named {} present.".format(name), - "new": "Created port {1} on bridge {0}.".format(bridge, name), + "old": f"No port named {name} present.", + "new": f"Created port {name} on bridge {bridge}.", } } comments["comment_port_internal"] = ( @@ -77,7 +77,7 @@ def present( if tunnel_type == "vlan": comments["comment_vlan_invalid_id"] = "VLANs id must be between 0 and 4095." comments["comment_vlan_invalid_name"] = ( - "Could not find network interface {}.".format(name) + f"Could not find network interface {name}." ) comments["comment_vlan_port_exists"] = ( "Port {} with access to VLAN {} already exists on bridge {}.".format( @@ -234,11 +234,7 @@ def present( 'dst_port="' + str(dst_port) + '", ' if 0 < dst_port <= 65535 else "" ) interface_attroptions = ( - '{{{0}key="'.format(opt_port) - + str(id) - + '", remote_ip="' - + str(remote) - + '"}' + f'{{{opt_port}key="' + str(id) + '", remote_ip="' + str(remote) + '"}' ) try: if ( @@ -388,16 +384,16 @@ def absent(name, bridge=None): # Comment and change messages comments = {} - comments["comment_bridge_notexists"] = "Bridge {} does not exist.".format(bridge) + comments["comment_bridge_notexists"] = f"Bridge {bridge} does not exist." comments["comment_port_notexists"] = "Port {} does not exist on bridge {}.".format( name, bridge ) - comments["comment_port_deleted"] = "Port {} deleted.".format(name) - comments["comment_port_notdeleted"] = "Unable to delete port {}.".format(name) + comments["comment_port_deleted"] = f"Port {name} deleted." + comments["comment_port_notdeleted"] = f"Unable to delete port {name}." comments["changes_port_deleted"] = { name: { - "old": "Port named {} may exist.".format(name), - "new": "Deleted port {}.".format(name), + "old": f"Port named {name} may exist.", + "new": f"Deleted port {name}.", } } diff --git a/salt/states/pagerduty.py b/salt/states/pagerduty.py index bfdd82f28ac..2be04eff915 100644 --- a/salt/states/pagerduty.py +++ b/salt/states/pagerduty.py @@ -57,7 +57,7 @@ def create_event(name, details, service_key, profile): """ ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __opts__["test"]: - ret["comment"] = "Need to create event: {}".format(name) + ret["comment"] = f"Need to create event: {name}" return ret __salt__["pagerduty.create_event"]( description=name, @@ -66,5 +66,5 @@ def create_event(name, details, service_key, profile): profile=profile, ) ret["result"] = True - ret["comment"] = "Created event: {}".format(name) + ret["comment"] = f"Created event: {name}" return ret diff --git a/salt/states/pagerduty_escalation_policy.py b/salt/states/pagerduty_escalation_policy.py index 44e663e4ea3..3b3594587d4 100644 --- a/salt/states/pagerduty_escalation_policy.py +++ b/salt/states/pagerduty_escalation_policy.py @@ -96,7 +96,7 @@ def present(profile="pagerduty", subdomain=None, api_key=None, **kwargs): if schedule: target_id = schedule["schedule"]["id"] if target_id is None: - raise Exception("unidentified target: {}".format(target)) + raise Exception(f"unidentified target: {target}") target["id"] = target_id r = __salt__["pagerduty_util.resource_present"]( @@ -106,7 +106,7 @@ def present(profile="pagerduty", subdomain=None, api_key=None, **kwargs): profile, subdomain, api_key, - **kwargs + **kwargs, ) return r @@ -143,7 +143,7 @@ def _diff(state_data, resource_object): else: resource_value = resource_object[k] if v != resource_value: - objects_differ = "{} {} {}".format(k, v, resource_value) + objects_differ = f"{k} {v} {resource_value}" break if objects_differ: diff --git a/salt/states/pagerduty_schedule.py b/salt/states/pagerduty_schedule.py index 75f705f6086..5947dbc4b0a 100644 --- a/salt/states/pagerduty_schedule.py +++ b/salt/states/pagerduty_schedule.py @@ -65,7 +65,7 @@ def present(profile="pagerduty", subdomain=None, api_key=None, **kwargs): api_key=api_key, ) if u is None: - raise Exception("unknown user: {}".format(user)) + raise Exception(f"unknown user: {user}") user["user"]["id"] = u["id"] r = __salt__["pagerduty_util.resource_present"]( "schedules", ["name", "id"], _diff, profile, subdomain, api_key, **kwargs diff --git a/salt/states/pagerduty_service.py b/salt/states/pagerduty_service.py index f615aff7a7b..f17c7ef6087 100644 --- a/salt/states/pagerduty_service.py +++ b/salt/states/pagerduty_service.py @@ -110,7 +110,7 @@ def _diff(state_data, resource_object): else: resource_value = resource_object[k] if v != resource_value: - objects_differ = "{} {} {}".format(k, v, resource_value) + objects_differ = f"{k} {v} {resource_value}" break if objects_differ: diff --git a/salt/states/panos.py b/salt/states/panos.py index fb915bbdb78..5ea57dbf0dd 100644 --- a/salt/states/panos.py +++ b/salt/states/panos.py @@ -108,10 +108,10 @@ def _build_members(members, anycheck=False): return "any" response = "" for m in members: - response += "{}".format(m) + response += f"{m}" return response else: - return "{}".format(members) + return f"{members}" def _default_ret(name): @@ -354,19 +354,19 @@ def address_exists( # Verify the arguments if ipnetmask: - element = "{}".format(ipnetmask) + element = f"{ipnetmask}" elif iprange: - element = "{}".format(iprange) + element = f"{iprange}" elif fqdn: - element = "{}".format(fqdn) + element = f"{fqdn}" else: ret.update({"comment": "A valid address type must be specified."}) return ret if description: - element += "{}".format(description) + element += f"{description}" - full_element = "{}".format(addressname, element) + full_element = f"{element}" new_address = xml.to_dict(ET.fromstring(full_element), True) @@ -467,15 +467,15 @@ def address_group_exists( # Verify the arguments if members: - element = "{}".format(_build_members(members, True)) + element = f"{_build_members(members, True)}" else: ret.update({"comment": "The group members must be provided."}) return ret if description: - element += "{}".format(description) + element += f"{description}" - full_element = "{}".format(groupname, element) + full_element = f"{element}" new_group = xml.to_dict(ET.fromstring(full_element), True) @@ -1117,19 +1117,19 @@ def security_rule_exists( # Build the rule element element = "" if sourcezone: - element += "{}".format(_build_members(sourcezone, True)) + element += f"{_build_members(sourcezone, True)}" else: ret.update({"comment": "The sourcezone field must be provided."}) return ret if destinationzone: - element += "{}".format(_build_members(destinationzone, True)) + element += f"{_build_members(destinationzone, True)}" else: ret.update({"comment": "The destinationzone field must be provided."}) return ret if source: - element += "{}".format(_build_members(source, True)) + element += f"{_build_members(source, True)}" else: ret.update({"comment": "The source field must be provided."}) return @@ -1151,13 +1151,13 @@ def security_rule_exists( return ret if service: - element += "{}".format(_build_members(service, True)) + element += f"{_build_members(service, True)}" else: ret.update({"comment": "The service field must be provided."}) return ret if action: - element += "{}".format(action) + element += f"{action}" else: ret.update({"comment": "The action field must be provided."}) return ret @@ -1169,10 +1169,10 @@ def security_rule_exists( element += "no" if description: - element += "{}".format(description) + element += f"{description}" if logsetting: - element += "{}".format(logsetting) + element += f"{logsetting}" if logstart is not None: if logstart: @@ -1201,7 +1201,7 @@ def security_rule_exists( # Build the profile settings profile_string = None if profilegroup: - profile_string = "{}".format(profilegroup) + profile_string = f"{profilegroup}" else: member_string = "" if datafilter: @@ -1212,16 +1212,16 @@ def security_rule_exists( ) if fileblock: member_string += ( - "{}".format(fileblock) + f"{fileblock}" ) if spyware: - member_string += "{}".format(spyware) + member_string += f"{spyware}" if urlfilter: member_string += ( - "{}".format(urlfilter) + f"{urlfilter}" ) if virus: - member_string += "{}".format(virus) + member_string += f"{virus}" if vulnerability: member_string += ( "{}".format( @@ -1235,12 +1235,12 @@ def security_rule_exists( ) ) if member_string != "": - profile_string = "{}".format(member_string) + profile_string = f"{member_string}" if profile_string: - element += "{}".format(profile_string) + element += f"{profile_string}" - full_element = "{}".format(rulename, element) + full_element = f"{element}" new_rule = xml.to_dict(ET.fromstring(full_element), True) @@ -1380,9 +1380,9 @@ def service_exists( element = "<{0}>{1}".format(protocol, port) if description: - element += "{}".format(description) + element += f"{description}" - full_element = "{}".format(servicename, element) + full_element = f"{element}" new_service = xml.to_dict(ET.fromstring(full_element), True) @@ -1483,15 +1483,15 @@ def service_group_exists( # Verify the arguments if members: - element = "{}".format(_build_members(members, True)) + element = f"{_build_members(members, True)}" else: ret.update({"comment": "The group members must be provided."}) return ret if description: - element += "{}".format(description) + element += f"{description}" - full_element = "{}".format(groupname, element) + full_element = f"{element}" new_group = xml.to_dict(ET.fromstring(full_element), True) diff --git a/salt/states/pbm.py b/salt/states/pbm.py index 6e761f41957..8b2c3eb2a4b 100644 --- a/salt/states/pbm.py +++ b/salt/states/pbm.py @@ -152,7 +152,7 @@ def default_vsan_policy_configured(name, policy): # All allowed proxies have a shim execution module with the same # name which implementes a get_details function # All allowed proxies have a vcenter detail - vcenter = __salt__["{}.get_details".format(proxy_type)]()["vcenter"] + vcenter = __salt__[f"{proxy_type}.get_details"]()["vcenter"] log.info("Running %s on vCenter '%s'", name, vcenter) log.trace("policy = %s", policy) changes_required = False @@ -214,7 +214,7 @@ def default_vsan_policy_configured(name, policy): if subprofile_differ.diffs: str_changes.extend( [ - " {}".format(change) + f" {change}" for change in subprofile_differ.changes_str.split("\n") ] ) @@ -222,7 +222,7 @@ def default_vsan_policy_configured(name, policy): str_changes.append(" capabilities:") str_changes.extend( [ - " {}".format(change) + f" {change}" for change in capabilities_differ.changes_str2.split( "\n" ) @@ -240,7 +240,7 @@ def default_vsan_policy_configured(name, policy): service_instance=si, ) comments.append( - "Updated the default VSAN policy in vCenter '{}'".format(vcenter) + f"Updated the default VSAN policy in vCenter '{vcenter}'" ) log.info(comments[-1]) @@ -319,7 +319,7 @@ def storage_policies_configured(name, policies): # All allowed proxies have a shim execution module with the same # name which implementes a get_details function # All allowed proxies have a vcenter detail - vcenter = __salt__["{}.get_details".format(proxy_type)]()["vcenter"] + vcenter = __salt__[f"{proxy_type}.get_details"]()["vcenter"] log.info("Running state '%s' on vCenter '%s'", name, vcenter) si = __salt__["vsphere.get_service_instance_via_proxy"]() current_policies = __salt__["vsphere.list_storage_policies"]( @@ -401,7 +401,7 @@ def storage_policies_configured(name, policies): if subprofile_differ.diffs: str_changes.extend( [ - " {}".format(change) + f" {change}" for change in subprofile_differ.changes_str.split( "\n" ) @@ -411,7 +411,7 @@ def storage_policies_configured(name, policies): str_changes.append(" capabilities:") str_changes.extend( [ - " {}".format(change) + f" {change}" for change in capabilities_differ.changes_str2.split( "\n" ) diff --git a/salt/states/pcs.py b/salt/states/pcs.py index cd124c1a82a..662d8935134 100644 --- a/salt/states/pcs.py +++ b/salt/states/pcs.py @@ -229,7 +229,7 @@ def _get_cibfile_tmp(cibname): """ Get the full path of a temporary CIB-file with the name of the CIB """ - cibfile_tmp = "{}.tmp".format(_get_cibfile(cibname)) + cibfile_tmp = f"{_get_cibfile(cibname)}.tmp" log.trace("cibfile_tmp: %s", cibfile_tmp) return cibfile_tmp @@ -238,7 +238,7 @@ def _get_cibfile_cksum(cibname): """ Get the full path of the file containing a checksum of a CIB-file with the name of the CIB """ - cibfile_cksum = "{}.cksum".format(_get_cibfile(cibname)) + cibfile_cksum = f"{_get_cibfile(cibname)}.cksum" log.trace("cibfile_cksum: %s", cibfile_cksum) return cibfile_cksum @@ -336,7 +336,7 @@ def _item_present( # constraints match on '(id:)' elif item in ["constraint"]: for line in is_existing["stdout"].splitlines(): - if "(id:{})".format(item_id) in line: + if f"(id:{item_id})" in line: item_create_required = False # item_id was provided, @@ -370,7 +370,7 @@ def _item_present( log.trace("Output of pcs.item_create: %s", item_create) if item_create["retcode"] in [0]: - ret["comment"] += "Created {} {} ({})\n".format(item, item_id, item_type) + ret["comment"] += f"Created {item} {item_id} ({item_type})\n" ret["changes"].update({item_id: {"old": "", "new": str(item_id)}}) else: ret["result"] = False @@ -435,11 +435,11 @@ def auth(name, nodes, pcsuser="hacluster", pcspasswd="hacluster", extra_args=Non authorized_dict[node] == "Already authorized" or authorized_dict[node] == "Authorized" ): - ret["comment"] += "Node {} is already authorized\n".format(node) + ret["comment"] += f"Node {node} is already authorized\n" else: auth_required = True if __opts__["test"]: - ret["comment"] += "Node is set to authorize: {}\n".format(node) + ret["comment"] += f"Node is set to authorize: {node}\n" if not auth_required: return ret @@ -463,7 +463,7 @@ def auth(name, nodes, pcsuser="hacluster", pcspasswd="hacluster", extra_args=Non for node in nodes: if node in authorize_dict and authorize_dict[node] == "Authorized": - ret["comment"] += "Authorized {}\n".format(node) + ret["comment"] += f"Authorized {node}\n" ret["changes"].update({node: {"old": "", "new": "Authorized"}}) else: ret["result"] = False @@ -604,13 +604,13 @@ def cluster_setup( "Success", "Cluster enabled", ]: - ret["comment"] += "Set up {}\n".format(node) + ret["comment"] += f"Set up {node}\n" ret["changes"].update({node: {"old": "", "new": "Setup"}}) else: ret["result"] = False - ret["comment"] += "Failed to setup {}\n".format(node) + ret["comment"] += f"Failed to setup {node}\n" if node in setup_dict: - ret["comment"] += "{}: setup_dict: {}\n".format(node, setup_dict[node]) + ret["comment"] += f"{node}: setup_dict: {setup_dict[node]}\n" ret["comment"] += str(setup) log.trace("ret: %s", ret) @@ -664,7 +664,7 @@ def cluster_node_present(name, node, extra_args=None): node_add_required = False ret[ "comment" - ] += "Node {} is already member of the cluster\n".format(node) + ] += f"Node {node} is already member of the cluster\n" else: current_nodes += value.split() @@ -673,7 +673,7 @@ def cluster_node_present(name, node, extra_args=None): if __opts__["test"]: ret["result"] = None - ret["comment"] += "Node {} is set to be added to the cluster\n".format(node) + ret["comment"] += f"Node {node} is set to be added to the cluster\n" return ret if not isinstance(extra_args, (list, tuple)): @@ -710,11 +710,11 @@ def cluster_node_present(name, node, extra_args=None): ) if node in node_add_dict and node_add_dict[node] in ["Succeeded", "Success"]: - ret["comment"] += "Added node {}\n".format(node) + ret["comment"] += f"Added node {node}\n" ret["changes"].update({node: {"old": "", "new": "Added"}}) else: ret["result"] = False - ret["comment"] += "Failed to add node{}\n".format(node) + ret["comment"] += f"Failed to add node{node}\n" if node in node_add_dict: ret["comment"] += "{}: node_add_dict: {}\n".format( node, node_add_dict[node] @@ -806,10 +806,10 @@ def cib_present(name, cibname, scope=None, extra_args=None): if not cib_create_required: __salt__["file.remove"](cibfile_tmp) - ret["comment"] += "CIB {} is already equal to the live CIB\n".format(cibname) + ret["comment"] += f"CIB {cibname} is already equal to the live CIB\n" if not cib_cksum_required: - ret["comment"] += "CIB {} checksum is correct\n".format(cibname) + ret["comment"] += f"CIB {cibname} checksum is correct\n" if not cib_required: return ret @@ -818,7 +818,7 @@ def cib_present(name, cibname, scope=None, extra_args=None): __salt__["file.remove"](cibfile_tmp) ret["result"] = None if cib_create_required: - ret["comment"] += "CIB {} is set to be created/updated\n".format(cibname) + ret["comment"] += f"CIB {cibname} is set to be created/updated\n" if cib_cksum_required: ret["comment"] += "CIB {} checksum is set to be created/updated\n".format( cibname @@ -829,11 +829,11 @@ def cib_present(name, cibname, scope=None, extra_args=None): __salt__["file.move"](cibfile_tmp, cibfile) if __salt__["file.check_hash"](path=cibfile, file_hash=cib_hash_live): - ret["comment"] += "Created/updated CIB {}\n".format(cibname) + ret["comment"] += f"Created/updated CIB {cibname}\n" ret["changes"].update({"cibfile": cibfile}) else: ret["result"] = False - ret["comment"] += "Failed to create/update CIB {}\n".format(cibname) + ret["comment"] += f"Failed to create/update CIB {cibname}\n" if cib_cksum_required: _file_write(cibfile_cksum, cib_hash_live) @@ -894,7 +894,7 @@ def cib_pushed(name, cibname, scope=None, extra_args=None): if not os.path.exists(cibfile): ret["result"] = False - ret["comment"] += "CIB-file {} does not exist\n".format(cibfile) + ret["comment"] += f"CIB-file {cibfile} does not exist\n" return ret cib_hash_cibfile = "{}:{}".format( @@ -926,11 +926,11 @@ def cib_pushed(name, cibname, scope=None, extra_args=None): log.trace("Output of pcs.cib_push: %s", cib_push) if cib_push["retcode"] in [0]: - ret["comment"] += "Pushed CIB {}\n".format(cibname) + ret["comment"] += f"Pushed CIB {cibname}\n" ret["changes"].update({"cibfile_pushed": cibfile}) else: ret["result"] = False - ret["comment"] += "Failed to push CIB {}\n".format(cibname) + ret["comment"] += f"Failed to push CIB {cibname}\n" log.trace("ret: %s", ret) @@ -968,7 +968,7 @@ def prop_has_value(name, prop, value, extra_args=None, cibname=None): return _item_present( name=name, item="property", - item_id="{}={}".format(prop, value), + item_id=f"{prop}={value}", item_type=None, create="set", extra_args=extra_args, @@ -1008,7 +1008,7 @@ def resource_defaults_to(name, default, value, extra_args=None, cibname=None): return _item_present( name=name, item="resource", - item_id="{}={}".format(default, value), + item_id=f"{default}={value}", item_type=None, show="defaults", create="defaults", @@ -1049,7 +1049,7 @@ def resource_op_defaults_to(name, op_default, value, extra_args=None, cibname=No return _item_present( name=name, item="resource", - item_id="{}={}".format(op_default, value), + item_id=f"{op_default}={value}", item_type=None, show=["op", "defaults"], create=["op", "defaults"], diff --git a/salt/states/pdbedit.py b/salt/states/pdbedit.py index 8a2848f4d39..ea144b69866 100644 --- a/salt/states/pdbedit.py +++ b/salt/states/pdbedit.py @@ -63,7 +63,7 @@ def absent(name): elif res[name] not in ["absent"]: # oops something went wrong ret["result"] = False else: - ret["comment"] = "account {login} is absent".format(login=name) + ret["comment"] = f"account {name} is absent" return ret diff --git a/salt/states/pecl.py b/salt/states/pecl.py index a69a2ca1cb1..e690b5a01e9 100644 --- a/salt/states/pecl.py +++ b/salt/states/pecl.py @@ -73,25 +73,25 @@ def installed( version is None or version in installed_pecls[package] ) and preferred_state in installed_pecls[package]: ret["result"] = True - ret["comment"] = "Pecl extension {} is already installed.".format(name) + ret["comment"] = f"Pecl extension {name} is already installed." return ret if version is not None: # Modify the name to include the version and proceed. - name = "{}-{}".format(name, version) + name = f"{name}-{version}" if __opts__["test"]: - ret["comment"] = "Pecl extension {} would have been installed".format(name) + ret["comment"] = f"Pecl extension {name} would have been installed" return ret if __salt__["pecl.install"]( name, defaults=defaults, force=force, preferred_state=preferred_state ): ret["result"] = True ret["changes"][name] = "Installed" - ret["comment"] = "Pecl extension {} was successfully installed".format(name) + ret["comment"] = f"Pecl extension {name} was successfully installed" else: ret["result"] = False - ret["comment"] = "Could not install pecl extension {}.".format(name) + ret["comment"] = f"Could not install pecl extension {name}." return ret @@ -106,17 +106,17 @@ def removed(name): ret = {"name": name, "result": None, "comment": "", "changes": {}} if name not in __salt__["pecl.list"](): ret["result"] = True - ret["comment"] = "Pecl extension {} is not installed.".format(name) + ret["comment"] = f"Pecl extension {name} is not installed." return ret if __opts__["test"]: - ret["comment"] = "Pecl extension {} would have been removed".format(name) + ret["comment"] = f"Pecl extension {name} would have been removed" return ret if __salt__["pecl.uninstall"](name): ret["result"] = True ret["changes"][name] = "Removed" - ret["comment"] = "Pecl extension {} was successfully removed.".format(name) + ret["comment"] = f"Pecl extension {name} was successfully removed." else: ret["result"] = False - ret["comment"] = "Could not remove pecl extension {}.".format(name) + ret["comment"] = f"Could not remove pecl extension {name}." return ret diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index 917d2748778..97fcdff3930 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -197,7 +197,7 @@ def _check_pkg_version_format(pkg): for vcs in supported_vcs: if pkg.startswith(vcs): from_vcs = True - install_req = _from_line(pkg.split("{}+".format(vcs))[-1]) + install_req = _from_line(pkg.split(f"{vcs}+")[-1]) break else: install_req = _from_line(pkg) @@ -752,7 +752,7 @@ def installed( cur_version = __salt__["pip.version"](bin_env) except (CommandNotFoundError, CommandExecutionError) as err: ret["result"] = False - ret["comment"] = "Error installing '{}': {}".format(name, err) + ret["comment"] = f"Error installing '{name}': {err}" return ret # Check that the pip binary supports the 'use_wheel' option if use_wheel: @@ -845,7 +845,7 @@ def installed( # TODO: Check requirements file against currently-installed # packages to provide more accurate state output. comments.append( - "Requirements file '{}' will be processed.".format(requirements) + f"Requirements file '{requirements}' will be processed." ) if editable: comments.append( @@ -950,7 +950,7 @@ def installed( # Call to install the package. Actual installation takes place here pip_install_call = __salt__["pip.install"]( - pkgs="{}".format(pkgs_str) if pkgs_str else "", + pkgs=f"{pkgs_str}" if pkgs_str else "", requirements=requirements, bin_env=bin_env, use_wheel=use_wheel, @@ -1077,10 +1077,10 @@ def installed( and prefix.lower() not in already_installed_packages ): ver = pipsearch[prefix] - ret["changes"]["{}=={}".format(prefix, ver)] = "Installed" + ret["changes"][f"{prefix}=={ver}"] = "Installed" # Case for packages that are an URL else: - ret["changes"]["{}==???".format(state_name)] = "Installed" + ret["changes"][f"{state_name}==???"] = "Installed" # Set comments aicomms = "\n".join(already_installed_comments) @@ -1105,19 +1105,15 @@ def installed( if requirements or editable: comments = [] if requirements: - comments.append( - 'Unable to process requirements file "{}"'.format(requirements) - ) + comments.append(f'Unable to process requirements file "{requirements}"') if editable: - comments.append( - "Unable to install from VCS checkout {}.".format(editable) - ) + comments.append(f"Unable to install from VCS checkout {editable}.") comments.append(error) ret["comment"] = " ".join(comments) else: pkgs_str = ", ".join([state_name for _, state_name in target_pkgs]) aicomms = "\n".join(already_installed_comments) - error_comm = "Failed to install packages: {}. {}".format(pkgs_str, error) + error_comm = f"Failed to install packages: {pkgs_str}. {error}" ret["comment"] = aicomms + ("\n" if aicomms else "") + error_comm else: ret["result"] = False @@ -1155,7 +1151,7 @@ def removed( pip_list = __salt__["pip.list"](bin_env=bin_env, user=user, cwd=cwd) except (CommandExecutionError, CommandNotFoundError) as err: ret["result"] = False - ret["comment"] = "Error uninstalling '{}': {}".format(name, err) + ret["comment"] = f"Error uninstalling '{name}': {err}" return ret if name not in pip_list: @@ -1165,7 +1161,7 @@ def removed( if __opts__["test"]: ret["result"] = None - ret["comment"] = "Package {} is set to be removed".format(name) + ret["comment"] = f"Package {name} is set to be removed" return ret if __salt__["pip.uninstall"]( diff --git a/salt/states/pkg.py b/salt/states/pkg.py index df57a7477a2..b0ab5f7ef73 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -310,7 +310,7 @@ def _find_download_targets( "name": name, "changes": {}, "result": True, - "comment": "Package {} is already downloaded".format(name), + "comment": f"Package {name} is already downloaded", } version_spec = False @@ -402,7 +402,7 @@ def _find_advisory_targets(name=None, advisory_ids=None, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "Advisory patch {} is already installed".format(name), + "comment": f"Advisory patch {name} is already installed", } # Find out which advisory patches will be targeted in the call to pkg.install @@ -613,7 +613,7 @@ def _find_install_targets( "name": name, "changes": {}, "result": False, - "comment": "Package {} not found in the repository.".format(name), + "comment": f"Package {name} not found in the repository.", } if version is None: # pylint: disable=not-callable @@ -657,7 +657,7 @@ def _find_install_targets( "name": name, "changes": {}, "result": True, - "comment": "Package {} is already installed".format(name), + "comment": f"Package {name} is already installed", } version_spec = False @@ -773,13 +773,11 @@ def _find_install_targets( problems.append(err.format(version_string, "file not found")) continue elif not os.path.exists(cached_path): - problems.append("{} does not exist on minion".format(version_string)) + problems.append(f"{version_string} does not exist on minion") continue source_info = __salt__["lowpkg.bin_pkg_info"](cached_path) if source_info is None: - warnings.append( - "Failed to parse metadata for {}".format(version_string) - ) + warnings.append(f"Failed to parse metadata for {version_string}") continue else: verstr = source_info["version"] @@ -1815,7 +1813,7 @@ def installed( summary = ", ".join(targets) changes.update({x: {"new": "installed", "old": ""} for x in targets}) comment.append( - "The following packages would be installed/updated: {}".format(summary) + f"The following packages would be installed/updated: {summary}" ) if to_unpurge: comment.append( @@ -1990,9 +1988,7 @@ def installed( else: summary = ", ".join([_get_desired_pkg(x, desired) for x in modified]) if len(summary) < 20: - comment.append( - "The following packages were installed/updated: {}".format(summary) - ) + comment.append(f"The following packages were installed/updated: {summary}") else: comment.append( "{} targeted package{} {} installed/updated.".format( @@ -2025,9 +2021,7 @@ def installed( else: summary = ", ".join([_get_desired_pkg(x, desired) for x in not_modified]) if len(not_modified) <= 20: - comment.append( - "The following packages were already installed: {}".format(summary) - ) + comment.append(f"The following packages were already installed: {summary}") else: comment.append( "{} targeted package{} {} already installed".format( @@ -2048,9 +2042,7 @@ def installed( summary = ", ".join(failed) else: summary = ", ".join([_get_desired_pkg(x, desired) for x in failed]) - comment.insert( - 0, "The following packages failed to install/update: {}".format(summary) - ) + comment.insert(0, f"The following packages failed to install/update: {summary}") result = False if failed_hold: @@ -2113,7 +2105,7 @@ def installed( pkgstr = modified_pkg else: pkgstr = _get_desired_pkg(modified_pkg, desired) - msg = "Package {} was reinstalled.".format(pkgstr) + msg = f"Package {pkgstr} was reinstalled." if modified_pkg in altered_files: msg += " The following files were remediated:" comment.append(msg) @@ -2128,7 +2120,7 @@ def installed( pkgstr = failed_pkg else: pkgstr = _get_desired_pkg(failed_pkg, desired) - msg = "Reinstall was not successful for package {}.".format(pkgstr) + msg = f"Reinstall was not successful for package {pkgstr}." if failed_pkg in altered_files: msg += " The following files could not be remediated:" comment.append(msg) @@ -2300,7 +2292,7 @@ def downloaded( else: ret["changes"] = {} ret["comment"] = ( - "An error was encountered while downloading package(s): {}".format(exc) + f"An error was encountered while downloading package(s): {exc}" ) return ret @@ -2310,7 +2302,7 @@ def downloaded( if failed: summary = ", ".join([_get_desired_pkg(x, targets) for x in failed]) ret["result"] = False - ret["comment"] = "The following packages failed to download: {}".format(summary) + ret["comment"] = f"The following packages failed to download: {summary}" if not ret["changes"] and not ret["comment"]: ret["result"] = True @@ -2380,7 +2372,7 @@ def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs): if __opts__["test"]: summary = ", ".join(targets) ret["comment"] = ( - "The following advisory patches would be downloaded: {}".format(summary) + f"The following advisory patches would be downloaded: {summary}" ) return ret @@ -2399,7 +2391,7 @@ def patch_installed(name, advisory_ids=None, downloadonly=None, **kwargs): else: ret["changes"] = {} ret["comment"] = ( - "An error was encountered while downloading package(s): {}".format(exc) + f"An error was encountered while downloading package(s): {exc}" ) return ret @@ -2689,7 +2681,7 @@ def latest( # Package either a) is up-to-date, or b) does not exist if not cur.get(pkg): # Package does not exist - msg = "No information found for '{}'.".format(pkg) + msg = f"No information found for '{pkg}'." log.error(msg) problems.append(msg) elif ( @@ -2734,13 +2726,11 @@ def latest( if up_to_date_count <= 10: comments.append( "The following packages are already up-to-date: " - + ", ".join( - ["{} ({})".format(x, cur[x]) for x in sorted(up_to_date)] - ) + + ", ".join([f"{x} ({cur[x]})" for x in sorted(up_to_date)]) ) else: comments.append( - "{} packages are already up-to-date".format(up_to_date_count) + f"{up_to_date_count} packages are already up-to-date" ) return { @@ -2815,7 +2805,7 @@ def latest( ", ".join(sorted(up_to_date)) ) else: - msg = "{} packages were already up-to-date ".format(len(up_to_date)) + msg = f"{len(up_to_date)} packages were already up-to-date " comments.append(msg) return { @@ -2861,13 +2851,13 @@ def latest( } else: if len(desired_pkgs) > 10: - comment = "All {} packages are up-to-date.".format(len(desired_pkgs)) + comment = f"All {len(desired_pkgs)} packages are up-to-date." elif len(desired_pkgs) > 1: comment = "All packages are up-to-date ({}).".format( ", ".join(sorted(desired_pkgs)) ) else: - comment = "Package {} is already up-to-date".format(desired_pkgs[0]) + comment = f"Package {desired_pkgs[0]} is already up-to-date" return {"name": name, "changes": {}, "result": True, "comment": comment} @@ -2889,7 +2879,7 @@ def _uninstall( "name": name, "changes": {}, "result": False, - "comment": "Invalid action '{}'. This is probably a bug.".format(action), + "comment": f"Invalid action '{action}'. This is probably a bug.", } try: @@ -2901,7 +2891,7 @@ def _uninstall( "name": name, "changes": {}, "result": False, - "comment": "An error was encountered while parsing targets: {}".format(exc), + "comment": f"An error was encountered while parsing targets: {exc}", } targets = _find_remove_targets( name, version, pkgs, normalize, ignore_epoch=ignore_epoch, **kwargs @@ -2944,7 +2934,7 @@ def _uninstall( if __opts__["test"]: _changes = {} - _changes.update({x: {"new": "{}d".format(action), "old": ""} for x in targets}) + _changes.update({x: {"new": f"{action}d", "old": ""} for x in targets}) return { "name": name, @@ -2955,7 +2945,7 @@ def _uninstall( ), } - changes = __salt__["pkg.{}".format(action)]( + changes = __salt__[f"pkg.{action}"]( name, pkgs=pkgs, version=version, split_arch=False, **kwargs ) new = __salt__["pkg.list_pkgs"](versions_as_list=True, **kwargs) @@ -2999,7 +2989,7 @@ def _uninstall( "The following packages were {}d: {}.".format(action, ", ".join(targets)) ) else: - comments.append("All targeted packages were {}d.".format(action)) + comments.append(f"All targeted packages were {action}d.") return { "name": name, @@ -3096,7 +3086,7 @@ def removed(name, version=None, pkgs=None, normalize=True, ignore_epoch=None, ** else: ret["changes"] = {} ret["comment"] = ( - "An error was encountered while removing package(s): {}".format(exc) + f"An error was encountered while removing package(s): {exc}" ) return ret @@ -3187,9 +3177,7 @@ def purged(name, version=None, pkgs=None, normalize=True, ignore_epoch=None, **k ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret["comment"] = ( - "An error was encountered while purging package(s): {}".format(exc) - ) + ret["comment"] = f"An error was encountered while purging package(s): {exc}" return ret @@ -3279,9 +3267,7 @@ def uptodate(name, refresh=False, pkgs=None, **kwargs): ret["comment"] = exc.strerror_without_changes else: ret["changes"] = {} - ret["comment"] = ( - "An error was encountered while updating packages: {}".format(exc) - ) + ret["comment"] = f"An error was encountered while updating packages: {exc}" return ret # If a package list was provided, ensure those packages were updated @@ -3448,7 +3434,7 @@ def group_installed(name, skip=None, include=None, **kwargs): if not targets: ret["result"] = True - ret["comment"] = "Group '{}' is already installed".format(name) + ret["comment"] = f"Group '{name}' is already installed" return ret partially_installed = ( @@ -3461,10 +3447,10 @@ def group_installed(name, skip=None, include=None, **kwargs): ret["result"] = None if partially_installed: ret["comment"] = ( - "Group '{}' is partially installed and will be updated".format(name) + f"Group '{name}' is partially installed and will be updated" ) else: - ret["comment"] = "Group '{}' will be installed".format(name) + ret["comment"] = f"Group '{name}' will be installed" return ret try: @@ -3613,7 +3599,7 @@ def mod_watch(name, **kwargs): return { "name": name, "changes": {}, - "comment": "pkg.{} does not work with the watch requisite".format(sfun), + "comment": f"pkg.{sfun} does not work with the watch requisite", "result": False, } @@ -3637,7 +3623,7 @@ def mod_beacon(name, **kwargs): if kwargs.get("beacon"): beacon_module = "pkg" - beacon_name = "beacon_{}_{}".format(beacon_module, name) + beacon_name = f"beacon_{beacon_module}_{name}" beacon_kwargs = { "name": beacon_name, @@ -3741,10 +3727,8 @@ def held(name, version=None, pkgs=None, replace=False, **kwargs): if epoch == "0": epoch = "" else: - epoch = "{}:".format(epoch) - locks.update( - {match.group(1): {"version": "{}{}".format(epoch, match.group(3))}} - ) + epoch = f"{epoch}:" + locks.update({match.group(1): {"version": f"{epoch}{match.group(3)}"}}) else: locks.update({lock: {}}) elif "pkg.get_selections" in __salt__: @@ -3789,14 +3773,14 @@ def held(name, version=None, pkgs=None, replace=False, **kwargs): comments.append( "The following package's hold rule would be updated: {}{}".format( pkg_name, - "" if not pkg_ver else " (version = {})".format(pkg_ver), + "" if not pkg_ver else f" (version = {pkg_ver})", ) ) else: comments.append( "The following package would be held: {}{}".format( pkg_name, - "" if not pkg_ver else " (version = {})".format(pkg_ver), + "" if not pkg_ver else f" (version = {pkg_ver})", ) ) else: @@ -3812,13 +3796,11 @@ def held(name, version=None, pkgs=None, replace=False, **kwargs): and hold_ret and hold_ret.get(pkg_name, {}).get("result", False) ): - comments.append( - "Package {} was updated with hold rule".format(pkg_name) - ) + comments.append(f"Package {pkg_name} was updated with hold rule") elif hold_ret and hold_ret.get(pkg_name, {}).get("result", False): - comments.append("Package {} is now being held".format(pkg_name)) + comments.append(f"Package {pkg_name} is now being held") else: - comments.append("Package {} was not held".format(pkg_name)) + comments.append(f"Package {pkg_name} was not held") ret["changes"].update(hold_ret) if replace: @@ -3828,7 +3810,7 @@ def held(name, version=None, pkgs=None, replace=False, **kwargs): if __opts__["test"]: if pkg_name not in held_pkgs: comments.append( - "The following package would be unheld: {}".format(pkg_name) + f"The following package would be unheld: {pkg_name}" ) else: if pkg_name not in held_pkgs: @@ -3919,10 +3901,8 @@ def unheld(name, version=None, pkgs=None, all=False, **kwargs): if epoch == "0": epoch = "" else: - epoch = "{}:".format(epoch) - locks.update( - {match.group(1): {"version": "{}{}".format(epoch, match.group(3))}} - ) + epoch = f"{epoch}:" + locks.update({match.group(1): {"version": f"{epoch}{match.group(3)}"}}) else: locks.update({lock: {}}) elif "pkg.get_selections" in __salt__: @@ -3961,11 +3941,7 @@ def unheld(name, version=None, pkgs=None, all=False, **kwargs): comments.append( "The following package would be unheld: {}{}".format( pkg_name, - ( - "" - if not dpkgs.get(pkg_name) - else " (version = {})".format(lock_ver) - ), + ("" if not dpkgs.get(pkg_name) else f" (version = {lock_ver})"), ) ) else: diff --git a/salt/states/pkgbuild.py b/salt/states/pkgbuild.py index 68725fc362b..7888e97bb59 100644 --- a/salt/states/pkgbuild.py +++ b/salt/states/pkgbuild.py @@ -330,7 +330,7 @@ def repo( if __opts__["test"] is True: ret["result"] = None - ret["comment"] = "Package repo metadata at {} will be refreshed".format(name) + ret["comment"] = f"Package repo metadata at {name} will be refreshed" return ret # Need the check for None here, if env is not provided then it falls back diff --git a/salt/states/pkgrepo.py b/salt/states/pkgrepo.py index 3aaa5791a27..35b8d3896b8 100644 --- a/salt/states/pkgrepo.py +++ b/salt/states/pkgrepo.py @@ -462,7 +462,7 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs): pre = __salt__["pkg.get_repo"](repo=repo, **kwargs) except CommandExecutionError as exc: ret["result"] = False - ret["comment"] = "Failed to examine repo '{}': {}".format(name, exc) + ret["comment"] = f"Failed to examine repo '{name}': {exc}" return ret # This is because of how apt-sources works. This pushes distro logic @@ -544,7 +544,7 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs): break else: ret["result"] = True - ret["comment"] = "Package repo '{}' already configured".format(name) + ret["comment"] = f"Package repo '{name}' already configured" return ret if __opts__["test"]: @@ -579,7 +579,7 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs): # This is another way to pass information back from the mod_repo # function. ret["result"] = False - ret["comment"] = "Failed to configure repo '{}': {}".format(name, exc) + ret["comment"] = f"Failed to configure repo '{name}': {exc}" return ret try: @@ -595,10 +595,10 @@ def managed(name, ppa=None, copr=None, aptkey=True, **kwargs): ret["changes"] = {"repo": repo} ret["result"] = True - ret["comment"] = "Configured package repo '{}'".format(name) + ret["comment"] = f"Configured package repo '{name}'" except Exception as exc: # pylint: disable=broad-except ret["result"] = False - ret["comment"] = "Failed to confirm config of repo '{}': {}".format(name, exc) + ret["comment"] = f"Failed to confirm config of repo '{name}': {exc}" # Clear cache of available packages, if present, since changes to the # repositories may change the packages that are available. @@ -704,7 +704,7 @@ def absent(name, **kwargs): repo = __salt__["pkg.get_repo"](stripname, **kwargs) except CommandExecutionError as exc: ret["result"] = False - ret["comment"] = "Failed to configure repo '{}': {}".format(name, exc) + ret["comment"] = f"Failed to configure repo '{name}': {exc}" return ret if repo and ( @@ -725,7 +725,7 @@ def absent(name, **kwargs): repo = {} if not repo: - ret["comment"] = "Package repo {} is absent".format(name) + ret["comment"] = f"Package repo {name} is absent" ret["result"] = True return ret @@ -748,7 +748,7 @@ def absent(name, **kwargs): repos = __salt__["pkg.list_repos"]() if stripname not in repos: ret["changes"]["repo"] = name - ret["comment"] = "Removed repo {}".format(name) + ret["comment"] = f"Removed repo {name}" if not remove_key: ret["result"] = True @@ -757,13 +757,13 @@ def absent(name, **kwargs): removed_keyid = __salt__["pkg.del_repo_key"](stripname, **kwargs) except (CommandExecutionError, SaltInvocationError) as exc: ret["result"] = False - ret["comment"] += ", but failed to remove key: {}".format(exc) + ret["comment"] += f", but failed to remove key: {exc}" else: ret["result"] = True ret["changes"]["keyid"] = removed_keyid - ret["comment"] += ", and keyid {}".format(removed_keyid) + ret["comment"] += f", and keyid {removed_keyid}" else: ret["result"] = False - ret["comment"] = "Failed to remove repo {}".format(name) + ret["comment"] = f"Failed to remove repo {name}" return ret diff --git a/salt/states/ports.py b/salt/states/ports.py index 2d9acff696e..072bb7bf4f4 100644 --- a/salt/states/ports.py +++ b/salt/states/ports.py @@ -49,7 +49,7 @@ def _get_option_list(options): Returns the key/value pairs in the passed dict in a commaspace-delimited list in the format "key=value". """ - return ", ".join(["{}={}".format(x, y) for x, y in options.items()]) + return ", ".join([f"{x}={y}" for x, y in options.items()]) def _build_option_string(options): @@ -57,7 +57,7 @@ def _build_option_string(options): Common function to get a string to append to the end of the state comment """ if options: - return "with the following build options: {}".format(_get_option_list(options)) + return f"with the following build options: {_get_option_list(options)}" else: return "with the default build options" @@ -89,7 +89,7 @@ def installed(name, options=None): "name": name, "changes": {}, "result": True, - "comment": "{} is already installed".format(name), + "comment": f"{name} is already installed", } try: current_options = __salt__["ports.showconfig"]( @@ -137,7 +137,7 @@ def installed(name, options=None): else: if __opts__["test"]: ret["result"] = None - ret["comment"] = "{} will be installed".format(name) + ret["comment"] = f"{name} will be installed" return ret else: bad_opts = [x for x in options if x not in default_options] @@ -152,20 +152,20 @@ def installed(name, options=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "{} will be installed ".format(name) + ret["comment"] = f"{name} will be installed " ret["comment"] += _build_option_string(options) return ret if options: if not __salt__["ports.config"](name, reset=True, **options): ret["result"] = False - ret["comment"] = "Unable to set options for {}".format(name) + ret["comment"] = f"Unable to set options for {name}" return ret else: __salt__["ports.rmconfig"](name) if _options_file_exists(name): ret["result"] = False - ret["comment"] = "Unable to clear options for {}".format(name) + ret["comment"] = f"Unable to clear options for {name}" return ret ret["changes"] = __salt__["ports.install"](name) @@ -178,11 +178,11 @@ def installed(name, options=None): if err or name not in ports_post: ret["result"] = False if ret["result"]: - ret["comment"] = "Successfully installed {}".format(name) + ret["comment"] = f"Successfully installed {name}" if default_options: ret["comment"] += " " + _build_option_string(options) else: - ret["comment"] = "Failed to install {}".format(name) + ret["comment"] = f"Failed to install {name}" if err: - ret["comment"] += ". Error message:\n{}".format(err) + ret["comment"] += f". Error message:\n{err}" return ret diff --git a/salt/states/postgres_cluster.py b/salt/states/postgres_cluster.py index de98d5ab92f..bbcf42eb5ce 100644 --- a/salt/states/postgres_cluster.py +++ b/salt/states/postgres_cluster.py @@ -70,13 +70,13 @@ def present( .. versionadded:: 2016.3.0 """ - msg = "Cluster {}/{} is already present".format(version, name) + msg = f"Cluster {version}/{name} is already present" ret = {"name": name, "changes": {}, "result": True, "comment": msg} if __salt__["postgres.cluster_exists"](version, name): # check cluster config is correct infos = __salt__["postgres.cluster_list"](verbose=True) - info = infos["{}/{}".format(version, name)] + info = infos[f"{version}/{name}"] # TODO: check locale en encoding configs also if any( ( @@ -111,7 +111,7 @@ def present( if cluster: msg = "The cluster {0}/{1} has been created" ret["comment"] = msg.format(version, name) - ret["changes"]["{}/{}".format(version, name)] = "Present" + ret["changes"][f"{version}/{name}"] = "Present" else: msg = "Failed to create cluster {0}/{1}" ret["comment"] = msg.format(version, name) diff --git a/salt/states/postgres_database.py b/salt/states/postgres_database.py index b5de4fa1f97..831bbecc068 100644 --- a/salt/states/postgres_database.py +++ b/salt/states/postgres_database.py @@ -89,7 +89,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Database {} is already present".format(name), + "comment": f"Database {name} is already present", } db_args = { @@ -140,10 +140,10 @@ def present( if __opts__["test"]: ret["result"] = None if name not in dbs: - ret["comment"] = "Database {} is set to be created".format(name) + ret["comment"] = f"Database {name} is set to be created" else: ret["comment"] = ( - "Database {} exists, but parameters need to be changed".format(name) + f"Database {name} exists, but parameters need to be changed" ) return ret if name not in dbs and __salt__["postgres.db_create"]( @@ -154,20 +154,20 @@ def present( lc_ctype=lc_ctype, owner=owner, template=template, - **db_args + **db_args, ): - ret["comment"] = "The database {} has been created".format(name) + ret["comment"] = f"The database {name} has been created" ret["changes"][name] = "Present" elif name in dbs and __salt__["postgres.db_alter"]( name, tablespace=tablespace, owner=owner, owner_recurse=owner_recurse, **db_args ): - ret["comment"] = "Parameters for database {} have been changed".format(name) + ret["comment"] = f"Parameters for database {name} have been changed" ret["changes"][name] = "Parameters changed" elif name in dbs: - ret["comment"] = "Failed to change parameters for database {}".format(name) + ret["comment"] = f"Failed to change parameters for database {name}" ret["result"] = False else: - ret["comment"] = "Failed to create database {}".format(name) + ret["comment"] = f"Failed to create database {name}" ret["result"] = False return ret @@ -219,13 +219,13 @@ def absent( if __salt__["postgres.db_exists"](name, **db_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Database {} is set to be removed".format(name) + ret["comment"] = f"Database {name} is set to be removed" return ret if __salt__["postgres.db_remove"](name, **db_args): - ret["comment"] = "Database {} has been removed".format(name) + ret["comment"] = f"Database {name} has been removed" ret["changes"][name] = "Absent" return ret # fallback - ret["comment"] = "Database {} is not present, so it cannot be removed".format(name) + ret["comment"] = f"Database {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/postgres_extension.py b/salt/states/postgres_extension.py index 963b9caa5ff..91726fbd58e 100644 --- a/salt/states/postgres_extension.py +++ b/salt/states/postgres_extension.py @@ -93,7 +93,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Extension {} is already present".format(name), + "comment": f"Extension {name} is already present", } db_args = { "maintenance_db": maintenance_db, @@ -135,17 +135,17 @@ def present( schema=schema, ext_version=ext_version, from_version=from_version, - **db_args + **db_args, ) if cret: if mode.endswith("e"): suffix = "d" else: suffix = "ed" - ret["comment"] = "The extension {} has been {}{}".format(name, mode, suffix) - ret["changes"][name] = "{}{}".format(mode.capitalize(), suffix) + ret["comment"] = f"The extension {name} has been {mode}{suffix}" + ret["changes"][name] = f"{mode.capitalize()}{suffix}" elif cret is not None: - ret["comment"] = "Failed to {1} extension {0}".format(name, mode) + ret["comment"] = f"Failed to {mode} extension {name}" ret["result"] = False return ret @@ -210,17 +210,17 @@ def absent( if exists: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Extension {} is set to be removed".format(name) + ret["comment"] = f"Extension {name} is set to be removed" return ret if __salt__["postgres.drop_extension"]( name, if_exists=if_exists, restrict=restrict, cascade=cascade, **db_args ): - ret["comment"] = "Extension {} has been removed".format(name) + ret["comment"] = f"Extension {name} has been removed" ret["changes"][name] = "Absent" return ret else: ret["result"] = False - ret["comment"] = "Extension {} failed to be removed".format(name) + ret["comment"] = f"Extension {name} failed to be removed" return ret else: ret["comment"] = "Extension {} is not present, so it cannot be removed".format( diff --git a/salt/states/postgres_group.py b/salt/states/postgres_group.py index 01209ddfd43..2668f01bc90 100644 --- a/salt/states/postgres_group.py +++ b/salt/states/postgres_group.py @@ -138,7 +138,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Group {} is already present".format(name), + "comment": f"Group {name} is already present", } # default to encrypted passwords @@ -210,9 +210,9 @@ def present( if update: ret["changes"][name] = update ret["result"] = None - ret["comment"] = "Group {} is set to be {}d".format(name, mode) + ret["comment"] = f"Group {name} is set to be {mode}d" return ret - cret = __salt__["postgres.group_{}".format(mode)]( + cret = __salt__[f"postgres.group_{mode}"]( groupname=name, createdb=createdb, createroles=createroles, @@ -223,19 +223,19 @@ def present( replication=replication, rolepassword=password, groups=groups, - **db_args + **db_args, ) else: cret = None if cret: - ret["comment"] = "The group {} has been {}d".format(name, mode) + ret["comment"] = f"The group {name} has been {mode}d" if update: ret["changes"][name] = update else: ret["changes"][name] = "Present" elif cret is not None: - ret["comment"] = "Failed to {} group {}".format(mode, name) + ret["comment"] = f"Failed to {mode} group {name}" ret["result"] = False else: ret["result"] = True @@ -289,17 +289,17 @@ def absent( if __salt__["postgres.user_exists"](name, **db_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Group {} is set to be removed".format(name) + ret["comment"] = f"Group {name} is set to be removed" return ret if __salt__["postgres.group_remove"](name, **db_args): - ret["comment"] = "Group {} has been removed".format(name) + ret["comment"] = f"Group {name} has been removed" ret["changes"][name] = "Absent" return ret else: ret["result"] = False - ret["comment"] = "Group {} failed to be removed".format(name) + ret["comment"] = f"Group {name} failed to be removed" return ret else: - ret["comment"] = "Group {} is not present, so it cannot be removed".format(name) + ret["comment"] = f"Group {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/postgres_initdb.py b/salt/states/postgres_initdb.py index bde59f925eb..bb1a85474e4 100644 --- a/salt/states/postgres_initdb.py +++ b/salt/states/postgres_initdb.py @@ -83,13 +83,13 @@ def present( runas The system user the operation should be performed on behalf of """ - _cmt = "Postgres data directory {} is already present".format(name) + _cmt = f"Postgres data directory {name} is already present" ret = {"name": name, "changes": {}, "result": True, "comment": _cmt} if not __salt__["postgres.datadir_exists"](name=name): if __opts__["test"]: ret["result"] = None - _cmt = "Postgres data directory {} is set to be initialized".format(name) + _cmt = f"Postgres data directory {name} is set to be initialized" ret["comment"] = _cmt return ret @@ -105,11 +105,11 @@ def present( ) if __salt__["postgres.datadir_init"](name, **kwargs): - _cmt = "Postgres data directory {} has been initialized".format(name) + _cmt = f"Postgres data directory {name} has been initialized" ret["comment"] = _cmt ret["changes"][name] = "Present" else: - _cmt = "Postgres data directory {} initialization failed".format(name) + _cmt = f"Postgres data directory {name} initialization failed" ret["result"] = False ret["comment"] = _cmt diff --git a/salt/states/postgres_language.py b/salt/states/postgres_language.py index 3a06476c975..d8c5665ddf4 100644 --- a/salt/states/postgres_language.py +++ b/salt/states/postgres_language.py @@ -72,7 +72,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Language {} is already installed".format(name), + "comment": f"Language {name} is already installed", } dbargs = { @@ -88,14 +88,14 @@ def present( if name not in languages: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Language {} is set to be installed".format(name) + ret["comment"] = f"Language {name} is set to be installed" return ret if __salt__["postgres.language_create"](name, maintenance_db, **dbargs): - ret["comment"] = "Language {} has been installed".format(name) + ret["comment"] = f"Language {name} has been installed" ret["changes"][name] = "Present" else: - ret["comment"] = "Failed to install language {}".format(name) + ret["comment"] = f"Failed to install language {name}" ret["result"] = False return ret @@ -148,15 +148,15 @@ def absent( if __salt__["postgres.language_exists"](name, maintenance_db, **dbargs): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Language {} is set to be removed".format(name) + ret["comment"] = f"Language {name} is set to be removed" return ret if __salt__["postgres.language_remove"](name, **dbargs): - ret["comment"] = "Language {} has been removed".format(name) + ret["comment"] = f"Language {name} has been removed" ret["changes"][name] = "Absent" return ret else: - ret["comment"] = "Failed to remove language {}".format(name) + ret["comment"] = f"Failed to remove language {name}" ret["result"] = False - ret["comment"] = "Language {} is not present so it cannot be removed".format(name) + ret["comment"] = f"Language {name} is not present so it cannot be removed" return ret diff --git a/salt/states/postgres_schema.py b/salt/states/postgres_schema.py index 7e77da04642..0052f4da1d7 100644 --- a/salt/states/postgres_schema.py +++ b/salt/states/postgres_schema.py @@ -66,7 +66,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Schema {} is already present in database {}".format(name, dbname), + "comment": f"Schema {name} is already present in database {dbname}", } db_args = { @@ -163,7 +163,7 @@ def absent( return ret else: ret["result"] = False - ret["comment"] = "Schema {} failed to be removed".format(name) + ret["comment"] = f"Schema {name} failed to be removed" return ret else: ret["comment"] = ( diff --git a/salt/states/postgres_tablespace.py b/salt/states/postgres_tablespace.py index a946b1b65fc..84da41f99ec 100644 --- a/salt/states/postgres_tablespace.py +++ b/salt/states/postgres_tablespace.py @@ -93,7 +93,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "Tablespace {} is already present".format(name), + "comment": f"Tablespace {name} is already present", } dbargs = { "maintenance_db": maintenance_db, @@ -108,12 +108,12 @@ def present( # not there, create it if __opts__["test"]: ret["result"] = None - ret["comment"] = "Tablespace {} is set to be created".format(name) + ret["comment"] = f"Tablespace {name} is set to be created" return ret if __salt__["postgres.tablespace_create"]( name, directory, options, owner, **dbargs ): - ret["comment"] = "The tablespace {} has been created".format(name) + ret["comment"] = f"The tablespace {name} has been created" ret["changes"][name] = "Present" return ret @@ -131,12 +131,12 @@ def present( if owner and not tblspaces[name]["Owner"] == owner: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Tablespace {} owner to be altered".format(name) + ret["comment"] = f"Tablespace {name} owner to be altered" if ( __salt__["postgres.tablespace_alter"](name, new_owner=owner) and not __opts__["test"] ): - ret["comment"] = "Tablespace {} owner changed".format(name) + ret["comment"] = f"Tablespace {name} owner changed" ret["changes"][name] = {"owner": owner} ret["result"] = True @@ -148,7 +148,7 @@ def present( # TODO remove options that exist if possible for k, v in options.items(): # if 'seq_page_cost=1.1' not in '{seq_page_cost=1.1,...}' - if "{}={}".format(k, v) not in tblspaces[name]["Opts"]: + if f"{k}={v}" not in tblspaces[name]["Opts"]: if __opts__["test"]: ret["result"] = None ret["comment"] = ( @@ -159,7 +159,7 @@ def present( ) break # we know it's going to be altered, no reason to cont if __salt__["postgres.tablespace_alter"](name, set_option={k: v}): - ret["comment"] = "Tablespace {} opts changed".format(name) + ret["comment"] = f"Tablespace {name} opts changed" dictupdate.update(ret["changes"], {name: {"options": {k: v}}}) ret["result"] = True @@ -213,10 +213,10 @@ def absent( if __salt__["postgres.tablespace_exists"](name, **db_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Tablespace {} is set to be removed".format(name) + ret["comment"] = f"Tablespace {name} is set to be removed" return ret if __salt__["postgres.tablespace_remove"](name, **db_args): - ret["comment"] = "Tablespace {} has been removed".format(name) + ret["comment"] = f"Tablespace {name} has been removed" ret["changes"][name] = "Absent" return ret diff --git a/salt/states/postgres_user.py b/salt/states/postgres_user.py index f76e5e38403..fa5f5f9ecbf 100644 --- a/salt/states/postgres_user.py +++ b/salt/states/postgres_user.py @@ -149,7 +149,7 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "User {} is already present".format(name), + "comment": f"User {name} is already present", } db_args = { @@ -214,7 +214,7 @@ def present( "SELECT '{}'::timestamp(0) as dt;".format( valid_until.replace("'", "''") ), - **db_args + **db_args, )[0]["dt"] try: valid_until_dt = datetime.datetime.strptime( @@ -238,9 +238,9 @@ def present( if update: ret["changes"][name] = update ret["result"] = None - ret["comment"] = "User {} is set to be {}d".format(name, mode) + ret["comment"] = f"User {name} is set to be {mode}d" return ret - cret = __salt__["postgres.user_{}".format(mode)]( + cret = __salt__[f"postgres.user_{mode}"]( username=name, createdb=createdb, createroles=createroles, @@ -252,19 +252,19 @@ def present( rolepassword=password, valid_until=valid_until, groups=groups, - **db_args + **db_args, ) else: cret = None if cret: - ret["comment"] = "The user {} has been {}d".format(name, mode) + ret["comment"] = f"The user {name} has been {mode}d" if update: ret["changes"][name] = update else: ret["changes"][name] = "Present" elif cret is not None: - ret["comment"] = "Failed to {} user {}".format(mode, name) + ret["comment"] = f"Failed to {mode} user {name}" ret["result"] = False else: ret["result"] = True @@ -318,17 +318,17 @@ def absent( if __salt__["postgres.user_exists"](name, **db_args): if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} is set to be removed".format(name) + ret["comment"] = f"User {name} is set to be removed" return ret if __salt__["postgres.user_remove"](name, **db_args): - ret["comment"] = "User {} has been removed".format(name) + ret["comment"] = f"User {name} has been removed" ret["changes"][name] = "Absent" return ret else: ret["result"] = False - ret["comment"] = "User {} failed to be removed".format(name) + ret["comment"] = f"User {name} failed to be removed" return ret else: - ret["comment"] = "User {} is not present, so it cannot be removed".format(name) + ret["comment"] = f"User {name} is not present, so it cannot be removed" return ret diff --git a/salt/states/powerpath.py b/salt/states/powerpath.py index 829a6359e5c..0ee13997d0a 100644 --- a/salt/states/powerpath.py +++ b/salt/states/powerpath.py @@ -31,12 +31,12 @@ def license_present(name): if name in licenses: ret["result"] = True - ret["comment"] = "License key {} already present".format(name) + ret["comment"] = f"License key {name} already present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "License key {} is set to be added".format(name) + ret["comment"] = f"License key {name} is set to be added" return ret data = __salt__["powerpath.add_license"](name) @@ -70,12 +70,12 @@ def license_absent(name): if name not in licenses: ret["result"] = True - ret["comment"] = "License key {} not present".format(name) + ret["comment"] = f"License key {name} not present" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "License key {} is set to be removed".format(name) + ret["comment"] = f"License key {name} is set to be removed" return ret data = __salt__["powerpath.remove_license"](name) diff --git a/salt/states/process.py b/salt/states/process.py index d4b40f81f01..b75a7f7cd7f 100644 --- a/salt/states/process.py +++ b/salt/states/process.py @@ -37,7 +37,7 @@ def absent(name, user=None, signal=None): running = __salt__["ps.pgrep"](name, user=user) ret["result"] = None if running: - ret["comment"] = "{} processes will be killed".format(len(running)) + ret["comment"] = f"{len(running)} processes will be killed" else: ret["comment"] = "No matching processes running" return ret diff --git a/salt/states/proxy.py b/salt/states/proxy.py index e951e97e133..231cba04195 100644 --- a/salt/states/proxy.py +++ b/salt/states/proxy.py @@ -78,13 +78,13 @@ def managed( ret["changes"] = {"new": []} for service in services: - current_settings = __salt__["proxy.get_{}_proxy".format(service)]() + current_settings = __salt__[f"proxy.get_{service}_proxy"]() if current_settings.get("server") == name and current_settings.get( "port" ) == str(port): - ret["comment"] += "{} proxy settings already set.\n".format(service) - elif __salt__["proxy.set_{}_proxy".format(service)]( + ret["comment"] += f"{service} proxy settings already set.\n" + elif __salt__[f"proxy.set_{service}_proxy"]( name, port, user, password, network_service ): ret["comment"] += "{} proxy settings updated correctly\n".format( diff --git a/salt/states/pushover.py b/salt/states/pushover.py index cda8117a281..5b366153784 100644 --- a/salt/states/pushover.py +++ b/salt/states/pushover.py @@ -109,11 +109,11 @@ def post_message( return ret if not user: - ret["comment"] = "PushOver user is missing: {}".format(user) + ret["comment"] = f"PushOver user is missing: {user}" return ret if not message: - ret["comment"] = "PushOver message is missing: {}".format(message) + ret["comment"] = f"PushOver message is missing: {message}" return ret result = __salt__["pushover.post_message"]( @@ -129,8 +129,8 @@ def post_message( if result: ret["result"] = True - ret["comment"] = "Sent message: {}".format(name) + ret["comment"] = f"Sent message: {name}" else: - ret["comment"] = "Failed to send message: {}".format(name) + ret["comment"] = f"Failed to send message: {name}" return ret diff --git a/salt/states/pyenv.py b/salt/states/pyenv.py index f68dd947970..0d2a30020ab 100644 --- a/salt/states/pyenv.py +++ b/salt/states/pyenv.py @@ -122,7 +122,7 @@ def installed(name, default=False, user=None): name = re.sub(r"^python-", "", name) if __opts__["test"]: - ret["comment"] = "python {} is set to be installed".format(name) + ret["comment"] = f"python {name} is set to be installed" return ret ret = _check_pyenv(ret, user) @@ -156,7 +156,7 @@ def _check_and_uninstall_python(ret, python, user=None): return ret else: ret["result"] = True - ret["comment"] = "python {} is already absent".format(python) + ret["comment"] = f"python {python} is already absent" return ret @@ -182,13 +182,13 @@ def absent(name, user=None): name = re.sub(r"^python-", "", name) if __opts__["test"]: - ret["comment"] = "python {} is set to be uninstalled".format(name) + ret["comment"] = f"python {name} is set to be uninstalled" return ret ret = _check_pyenv(ret, user) if ret["result"] is False: ret["result"] = True - ret["comment"] = "pyenv not installed, {} not either".format(name) + ret["comment"] = f"pyenv not installed, {name} not either" return ret else: return _check_and_uninstall_python(ret, name, user=user) diff --git a/salt/states/pyrax_queues.py b/salt/states/pyrax_queues.py index f1c951a510c..7aba6a2750b 100644 --- a/salt/states/pyrax_queues.py +++ b/salt/states/pyrax_queues.py @@ -53,7 +53,7 @@ def present(name, provider): if not is_present: if __opts__["test"]: - msg = "Rackspace queue {} is set to be created.".format(name) + msg = f"Rackspace queue {name} is set to be created." ret["comment"] = msg ret["result"] = None return ret @@ -68,10 +68,10 @@ def present(name, provider): ret["changes"]["new"] = {"queue": queue} else: ret["result"] = False - ret["comment"] = "Failed to create {} Rackspace queue.".format(name) + ret["comment"] = f"Failed to create {name} Rackspace queue." return ret else: - ret["comment"] = "{} present.".format(name) + ret["comment"] = f"{name} present." return ret @@ -98,7 +98,7 @@ def absent(name, provider): if is_present: if __opts__["test"]: - ret["comment"] = "Rackspace queue {} is set to be removed.".format(name) + ret["comment"] = f"Rackspace queue {name} is set to be removed." ret["result"] = None return ret queue = __salt__["cloud.action"]("queues_show", provider=provider, name=name) @@ -110,8 +110,8 @@ def absent(name, provider): ret["changes"]["new"] = {} else: ret["result"] = False - ret["comment"] = "Failed to delete {} Rackspace queue.".format(name) + ret["comment"] = f"Failed to delete {name} Rackspace queue." else: - ret["comment"] = "{} does not exist.".format(name) + ret["comment"] = f"{name} does not exist." return ret diff --git a/salt/states/quota.py b/salt/states/quota.py index 07fe25a87ee..6c032e42ddb 100644 --- a/salt/states/quota.py +++ b/salt/states/quota.py @@ -41,17 +41,17 @@ def mode(name, mode, quotatype): fun = "on" if __salt__["quota.get_mode"](name)[name][quotatype] == fun: ret["result"] = True - ret["comment"] = "Quota for {} already set to {}".format(name, fun) + ret["comment"] = f"Quota for {name} already set to {fun}" return ret if __opts__["test"]: - ret["comment"] = "Quota for {} needs to be set to {}".format(name, fun) + ret["comment"] = f"Quota for {name} needs to be set to {fun}" return ret - if __salt__["quota.{}".format(fun)](name): + if __salt__[f"quota.{fun}"](name): ret["changes"] = {"quota": name} ret["result"] = True - ret["comment"] = "Set quota for {} to {}".format(name, fun) + ret["comment"] = f"Set quota for {name} to {fun}" return ret else: ret["result"] = False - ret["comment"] = "Failed to set quota for {} to {}".format(name, fun) + ret["comment"] = f"Failed to set quota for {name} to {fun}" return ret diff --git a/salt/states/rabbitmq_cluster.py b/salt/states/rabbitmq_cluster.py index 8a845006dba..6af09e26099 100644 --- a/salt/states/rabbitmq_cluster.py +++ b/salt/states/rabbitmq_cluster.py @@ -48,7 +48,7 @@ def joined(name, host, user="rabbit", ram_node=None, runas="root"): ret = {"name": name, "result": True, "comment": "", "changes": {}} status = __salt__["rabbitmq.cluster_status"]() - if "{}@{}".format(user, host) in status: + if f"{user}@{host}" in status: ret["comment"] = "Already in cluster" return ret @@ -62,11 +62,11 @@ def joined(name, host, user="rabbit", ram_node=None, runas="root"): ret["comment"] = result["Join"] # If we've reached this far before returning, we have changes. - ret["changes"] = {"old": "", "new": "{}@{}".format(user, host)} + ret["changes"] = {"old": "", "new": f"{user}@{host}"} if __opts__["test"]: ret["result"] = None - ret["comment"] = "Node is set to join cluster {}@{}".format(user, host) + ret["comment"] = f"Node is set to join cluster {user}@{host}" return ret diff --git a/salt/states/rabbitmq_plugin.py b/salt/states/rabbitmq_plugin.py index 4994e52f95f..76342b87b54 100644 --- a/salt/states/rabbitmq_plugin.py +++ b/salt/states/rabbitmq_plugin.py @@ -44,11 +44,11 @@ def enabled(name, runas=None): plugin_enabled = __salt__["rabbitmq.plugin_is_enabled"](name, runas=runas) except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if plugin_enabled: - ret["comment"] = "Plugin '{}' is already enabled.".format(name) + ret["comment"] = f"Plugin '{name}' is already enabled." return ret if not __opts__["test"]: @@ -56,16 +56,16 @@ def enabled(name, runas=None): __salt__["rabbitmq.enable_plugin"](name, runas=runas) except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({"old": "", "new": name}) if __opts__["test"] and ret["changes"]: ret["result"] = None - ret["comment"] = "Plugin '{}' is set to be enabled.".format(name) + ret["comment"] = f"Plugin '{name}' is set to be enabled." return ret - ret["comment"] = "Plugin '{}' was enabled.".format(name) + ret["comment"] = f"Plugin '{name}' was enabled." return ret @@ -85,11 +85,11 @@ def disabled(name, runas=None): plugin_enabled = __salt__["rabbitmq.plugin_is_enabled"](name, runas=runas) except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if not plugin_enabled: - ret["comment"] = "Plugin '{}' is already disabled.".format(name) + ret["comment"] = f"Plugin '{name}' is already disabled." return ret if not __opts__["test"]: @@ -97,14 +97,14 @@ def disabled(name, runas=None): __salt__["rabbitmq.disable_plugin"](name, runas=runas) except CommandExecutionError as err: ret["result"] = False - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({"old": name, "new": ""}) if __opts__["test"] and ret["changes"]: ret["result"] = None - ret["comment"] = "Plugin '{}' is set to be disabled.".format(name) + ret["comment"] = f"Plugin '{name}' is set to be disabled." return ret - ret["comment"] = "Plugin '{}' was disabled.".format(name) + ret["comment"] = f"Plugin '{name}' was disabled." return ret diff --git a/salt/states/rabbitmq_policy.py b/salt/states/rabbitmq_policy.py index 120b6ec6f57..2e17f2fbc8e 100644 --- a/salt/states/rabbitmq_policy.py +++ b/salt/states/rabbitmq_policy.py @@ -79,13 +79,13 @@ def present( updates.append("Priority") if policy and not updates: - ret["comment"] = "Policy {} {} is already present".format(vhost, name) + ret["comment"] = f"Policy {vhost} {name} is already present" return ret if not policy: ret["changes"].update({"old": {}, "new": name}) if __opts__["test"]: - ret["comment"] = "Policy {} {} is set to be created".format(vhost, name) + ret["comment"] = f"Policy {vhost} {name} is set to be created" else: log.debug("Policy doesn't exist - Creating") result = __salt__["rabbitmq.set_policy"]( @@ -100,7 +100,7 @@ def present( elif updates: ret["changes"].update({"old": policy, "new": updates}) if __opts__["test"]: - ret["comment"] = "Policy {} {} is set to be updated".format(vhost, name) + ret["comment"] = f"Policy {vhost} {name} is set to be updated" else: log.debug("Policy exists but needs updating") result = __salt__["rabbitmq.set_policy"]( @@ -117,7 +117,7 @@ def present( ret["result"] = False ret["comment"] = result["Error"] elif ret["changes"] == {}: - ret["comment"] = "'{}' is already in the desired state.".format(name) + ret["comment"] = f"'{name}' is already in the desired state." elif __opts__["test"]: ret["result"] = None elif "Set" in result: @@ -142,7 +142,7 @@ def absent(name, vhost="/", runas=None): policy_exists = __salt__["rabbitmq.policy_exists"](vhost, name, runas=runas) if not policy_exists: - ret["comment"] = "Policy '{} {}' is not present.".format(vhost, name) + ret["comment"] = f"Policy '{vhost} {name}' is not present." return ret if not __opts__["test"]: @@ -159,6 +159,6 @@ def absent(name, vhost="/", runas=None): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Policy '{} {}' will be removed.".format(vhost, name) + ret["comment"] = f"Policy '{vhost} {name}' will be removed." return ret diff --git a/salt/states/rabbitmq_upstream.py b/salt/states/rabbitmq_upstream.py index 35e0b008454..21f39cc6ac2 100644 --- a/salt/states/rabbitmq_upstream.py +++ b/salt/states/rabbitmq_upstream.py @@ -121,7 +121,7 @@ def present( try: current_upstreams = __salt__["rabbitmq.list_upstreams"](runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_config = salt.utils.data.filter_falsey( { @@ -146,7 +146,7 @@ def present( action = "update" else: ret["result"] = True - ret["comment"] = 'Upstream "{}" already present as specified.'.format(name) + ret["comment"] = f'Upstream "{name}" already present as specified.' else: action = "create" diff_config = {"old": None, "new": new_config} @@ -154,7 +154,7 @@ def present( if action: if __opts__["test"]: ret["result"] = None - ret["comment"] = 'Upstream "{}" would have been {}d.'.format(name, action) + ret["comment"] = f'Upstream "{name}" would have been {action}d.' else: try: res = __salt__["rabbitmq.set_upstream"]( @@ -173,10 +173,10 @@ def present( runas=runas, ) ret["result"] = res - ret["comment"] = 'Upstream "{}" {}d.'.format(name, action) + ret["comment"] = f'Upstream "{name}" {action}d.' ret["changes"] = diff_config except CommandExecutionError as exp: - ret["comment"] = "Error trying to {} upstream: {}".format(action, exp) + ret["comment"] = f"Error trying to {action} upstream: {exp}" return ret @@ -194,23 +194,23 @@ def absent(name, runas=None): try: upstream_exists = __salt__["rabbitmq.upstream_exists"](name, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if upstream_exists: if __opts__["test"]: ret["result"] = None - ret["comment"] = 'Upstream "{}" would have been deleted.'.format(name) + ret["comment"] = f'Upstream "{name}" would have been deleted.' else: try: res = __salt__["rabbitmq.delete_upstream"](name, runas=runas) if res: ret["result"] = True - ret["comment"] = 'Upstream "{}" has been deleted.'.format(name) + ret["comment"] = f'Upstream "{name}" has been deleted.' ret["changes"] = {"old": name, "new": None} except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" else: ret["result"] = True - ret["comment"] = 'The upstream "{}" is already absent.'.format(name) + ret["comment"] = f'The upstream "{name}" is already absent.' return ret diff --git a/salt/states/rabbitmq_user.py b/salt/states/rabbitmq_user.py index fcd14ce3757..ce29c5da1c9 100644 --- a/salt/states/rabbitmq_user.py +++ b/salt/states/rabbitmq_user.py @@ -105,7 +105,7 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): try: user = __salt__["rabbitmq.user_exists"](name, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret passwd_reqs_update = False @@ -115,7 +115,7 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): passwd_reqs_update = True log.debug("RabbitMQ user %s password update required", name) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if user and not any((force, perms, tags, passwd_reqs_update)): @@ -123,7 +123,7 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): "RabbitMQ user '%s' exists, password is up to date and force is not set.", name, ) - ret["comment"] = "User '{}' is already present.".format(name) + ret["comment"] = f"User '{name}' is already present." ret["result"] = True return ret @@ -131,14 +131,14 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): ret["changes"].update({"user": {"old": "", "new": name}}) if __opts__["test"]: ret["result"] = None - ret["comment"] = "User '{}' is set to be created.".format(name) + ret["comment"] = f"User '{name}' is set to be created." return ret log.debug("RabbitMQ user '%s' doesn't exist - Creating.", name) try: __salt__["rabbitmq.add_user"](name, password, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret else: log.debug("RabbitMQ user '%s' exists", name) @@ -150,7 +150,7 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): name, password, runas=runas ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({"password": {"old": "", "new": "Set password."}}) else: @@ -159,7 +159,7 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): try: __salt__["rabbitmq.clear_password"](name, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update( {"password": {"old": "Removed password.", "new": ""}} @@ -176,13 +176,13 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): try: __salt__["rabbitmq.set_user_tags"](name, tags, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({"tags": {"old": current_tags, "new": tags}}) try: existing_perms = __salt__["rabbitmq.list_user_permissions"](name, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if _check_perms_changes(name, perms, runas=runas, existing=existing_perms): @@ -194,7 +194,7 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): vhost, name, perm[0], perm[1], perm[2], runas=runas ) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret new_perms = { vhost: {"configure": perm[0], "write": perm[1], "read": perm[2]} @@ -211,15 +211,15 @@ def present(name, password=None, force=False, tags=None, perms=(), runas=None): ret["result"] = True if ret["changes"] == {}: - ret["comment"] = "'{}' is already in the desired state.".format(name) + ret["comment"] = f"'{name}' is already in the desired state." return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Configuration for '{}' will change.".format(name) + ret["comment"] = f"Configuration for '{name}' will change." return ret - ret["comment"] = "'{}' was configured.".format(name) + ret["comment"] = f"'{name}' was configured." return ret @@ -237,7 +237,7 @@ def absent(name, runas=None): try: user_exists = __salt__["rabbitmq.user_exists"](name, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret if user_exists: @@ -245,19 +245,19 @@ def absent(name, runas=None): try: __salt__["rabbitmq.delete_user"](name, runas=runas) except CommandExecutionError as err: - ret["comment"] = "Error: {}".format(err) + ret["comment"] = f"Error: {err}" return ret ret["changes"].update({"name": {"old": name, "new": ""}}) else: ret["result"] = True - ret["comment"] = "The user '{}' is not present.".format(name) + ret["comment"] = f"The user '{name}' is not present." return ret if __opts__["test"] and ret["changes"]: ret["result"] = None - ret["comment"] = "The user '{}' will be removed.".format(name) + ret["comment"] = f"The user '{name}' will be removed." return ret ret["result"] = True - ret["comment"] = "The user '{}' was removed.".format(name) + ret["comment"] = f"The user '{name}' was removed." return ret diff --git a/salt/states/rabbitmq_vhost.py b/salt/states/rabbitmq_vhost.py index 3aba14a55d1..5fb68e6d764 100644 --- a/salt/states/rabbitmq_vhost.py +++ b/salt/states/rabbitmq_vhost.py @@ -69,7 +69,7 @@ def present(name): vhost_exists = __salt__["rabbitmq.vhost_exists"](name) if vhost_exists: - ret["comment"] = "Virtual Host '{}' already exists.".format(name) + ret["comment"] = f"Virtual Host '{name}' already exists." return ret if not __opts__["test"]: @@ -86,7 +86,7 @@ def present(name): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Virtual Host '{}' will be created.".format(name) + ret["comment"] = f"Virtual Host '{name}' will be created." return ret @@ -107,7 +107,7 @@ def absent(name): vhost_exists = __salt__["rabbitmq.vhost_exists"](name) if not vhost_exists: - ret["comment"] = "Virtual Host '{}' is not present.".format(name) + ret["comment"] = f"Virtual Host '{name}' is not present." return ret if not __opts__["test"]: @@ -124,6 +124,6 @@ def absent(name): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Virtual Host '{}' will be removed.".format(name) + ret["comment"] = f"Virtual Host '{name}' will be removed." return ret diff --git a/salt/states/rbac_solaris.py b/salt/states/rbac_solaris.py index 551e5b9df83..74476640b33 100644 --- a/salt/states/rbac_solaris.py +++ b/salt/states/rbac_solaris.py @@ -41,7 +41,7 @@ def __virtual__(): else: return ( False, - "{} state module can only be loaded on Solaris".format(__virtualname__), + f"{__virtualname__} state module can only be loaded on Solaris", ) @@ -70,7 +70,7 @@ def managed(name, roles=None, profiles=None, authorizations=None): ## check properties if name not in __salt__["user.list_users"](): ret["result"] = False - ret["comment"] = "User {} does not exist!".format(name) + ret["comment"] = f"User {name} does not exist!" return ret if roles and not isinstance(roles, (list)): ret["result"] = False diff --git a/salt/states/rbenv.py b/salt/states/rbenv.py index c9c721f7104..34bce97ca80 100644 --- a/salt/states/rbenv.py +++ b/salt/states/rbenv.py @@ -130,9 +130,9 @@ def installed(name, default=False, user=None): if __opts__["test"]: ret = _ruby_installed(ret, name, user=user) if not ret["result"]: - ret["comment"] = "Ruby {} is set to be installed".format(name) + ret["comment"] = f"Ruby {name} is set to be installed" else: - ret["comment"] = "Ruby {} is already installed".format(name) + ret["comment"] = f"Ruby {name} is already installed" return ret rbenv_installed_ret = _check_and_install_rbenv(rbenv_installed_ret, user) @@ -164,7 +164,7 @@ def _check_and_uninstall_ruby(ret, ruby, user=None): return ret else: ret["result"] = True - ret["comment"] = "Ruby {} is already absent".format(ruby) + ret["comment"] = f"Ruby {ruby} is already absent" return ret @@ -192,17 +192,17 @@ def absent(name, user=None): ret = _check_rbenv(ret, user) if ret["result"] is False: ret["result"] = True - ret["comment"] = "Rbenv not installed, {} not either".format(name) + ret["comment"] = f"Rbenv not installed, {name} not either" return ret else: if __opts__["test"]: ret = _ruby_installed(ret, name, user=user) if ret["result"]: ret["result"] = None - ret["comment"] = "Ruby {} is set to be uninstalled".format(name) + ret["comment"] = f"Ruby {name} is set to be uninstalled" else: ret["result"] = True - ret["comment"] = "Ruby {} is already uninstalled".format(name) + ret["comment"] = f"Ruby {name} is already uninstalled" return ret return _check_and_uninstall_ruby(ret, name, user=user) diff --git a/salt/states/redismod.py b/salt/states/redismod.py index 4ff14c61881..47a4ac776c1 100644 --- a/salt/states/redismod.py +++ b/salt/states/redismod.py @@ -74,10 +74,10 @@ def string(name, value, expire=None, expireat=None, **connection_args): if expireat: __salt__["redis.expireat"](name, expireat, **connection_args) - ret["changes"]["expireat"] = "Key expires at {}".format(expireat) + ret["changes"]["expireat"] = f"Key expires at {expireat}" elif expire: __salt__["redis.expire"](name, expire, **connection_args) - ret["changes"]["expire"] = "TTL set to {} seconds".format(expire) + ret["changes"]["expire"] = f"TTL set to {expire} seconds" return ret @@ -126,7 +126,7 @@ def slaveof( sentinel_host=None, sentinel_port=None, sentinel_password=None, - **connection_args + **connection_args, ): """ Set this redis instance as a slave. @@ -156,13 +156,13 @@ def slaveof( ) if sentinel_master["master_host"] in __salt__["network.ip_addrs"](): ret["result"] = True - ret["comment"] = "Minion is the master: {}".format(name) + ret["comment"] = f"Minion is the master: {name}" return ret first_master = __salt__["redis.get_master_ip"](**connection_args) if first_master == sentinel_master: ret["result"] = True - ret["comment"] = "Minion already slave of master: {}".format(name) + ret["comment"] = f"Minion already slave of master: {name}" return ret if __opts__["test"] is True: @@ -184,6 +184,6 @@ def slaveof( "old": first_master, "new": current_master, } - ret["comment"] = "Minion successfully connected to master: {}".format(name) + ret["comment"] = f"Minion successfully connected to master: {name}" return ret diff --git a/salt/states/rsync.py b/salt/states/rsync.py index 79be3def583..4e01eb2e8dd 100644 --- a/salt/states/rsync.py +++ b/salt/states/rsync.py @@ -143,7 +143,7 @@ def synchronized( if not os.path.exists(name) and not force and not prepare: ret["result"] = False - ret["comment"] = "Destination directory {dest} was not found.".format(dest=name) + ret["comment"] = f"Destination directory {name} was not found." else: if not os.path.exists(name) and prepare: os.makedirs(name) diff --git a/salt/states/rvm.py b/salt/states/rvm.py index 5b7c4fa8e22..f593447093b 100644 --- a/salt/states/rvm.py +++ b/salt/states/rvm.py @@ -150,7 +150,7 @@ def _check_ruby(ret, ruby, user=None): for impl, version, default in __salt__["rvm.list"](runas=user): if impl != "ruby": - version = "{impl}-{version}".format(impl=impl, version=version) + version = f"{impl}-{version}" if not match_micro_version: version = micro_version_regex.sub("", version) if not match_version: @@ -188,7 +188,7 @@ def installed(name, default=False, user=None, opts=None, env=None): ret = {"name": name, "result": None, "comment": "", "changes": {}} if __opts__["test"]: - ret["comment"] = "Ruby {} is set to be installed".format(name) + ret["comment"] = f"Ruby {name} is set to be installed" return ret ret = _check_rvm(ret, user) @@ -241,7 +241,7 @@ def gemset_present(name, ruby="default", user=None): else: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Set to install gemset {}".format(name) + ret["comment"] = f"Set to install gemset {name}" return ret if __salt__["rvm.gemset_create"](ruby, name, runas=user): ret["result"] = True diff --git a/salt/states/salt_proxy.py b/salt/states/salt_proxy.py index 8a6ef6e2675..005ae65d24d 100644 --- a/salt/states/salt_proxy.py +++ b/salt/states/salt_proxy.py @@ -52,5 +52,5 @@ def configure_proxy(name, proxyname="p8000", start=True): """ ret = __salt__["salt_proxy.configure_proxy"](proxyname, start=start) - ret.update({"name": name, "comment": "{} config messages".format(name)}) + ret.update({"name": name, "comment": f"{name} config messages"}) return ret diff --git a/salt/states/saltmod.py b/salt/states/saltmod.py index e120e418875..fdd4692c0f4 100644 --- a/salt/states/saltmod.py +++ b/salt/states/saltmod.py @@ -664,7 +664,7 @@ def wait_for_event(name, id_list, event_id="id", timeout=300, node="master"): ret = {"name": name, "changes": {}, "comment": "", "result": False} if __opts__.get("test"): - ret["comment"] = "Orchestration would wait for event '{}'".format(name) + ret["comment"] = f"Orchestration would wait for event '{name}'" ret["result"] = None return ret @@ -796,7 +796,7 @@ def runner(name, **kwargs): "name": name, "result": None, "changes": {}, - "comment": "Runner function '{}' would be executed.".format(name), + "comment": f"Runner function '{name}' would be executed.", } return ret @@ -921,7 +921,7 @@ def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argumen "result": False, "success": False, "changes": {}, - "comment": "One of the runners raised an exception: {}".format(exc), + "comment": f"One of the runners raised an exception: {exc}", } # We bundle the results of the runners with the IDs of the runners so that # we can easily identify which output belongs to which runner. At the same @@ -1000,7 +1000,7 @@ def parallel_runners(name, runners, **kwargs): # pylint: disable=unused-argumen comment = "All runner functions executed successfully." else: if len(failed_runners) == 1: - comment = "Runner {} failed.".format(failed_runners[0]) + comment = f"Runner {failed_runners[0]} failed." else: comment = "Runners {} failed.".format(", ".join(failed_runners)) changes = {"ret": {runner_id: out for runner_id, out in outputs.items()}} @@ -1046,7 +1046,7 @@ def wheel(name, **kwargs): if __opts__.get("test", False): ret["result"] = None ret["changes"] = {} - ret["comment"] = "Wheel function '{}' would be executed.".format(name) + ret["comment"] = f"Wheel function '{name}' would be executed." return ret out = __salt__["saltutil.wheel"]( diff --git a/salt/states/saltutil.py b/salt/states/saltutil.py index 9442c5019cc..faacf85888e 100644 --- a/salt/states/saltutil.py +++ b/salt/states/saltutil.py @@ -29,18 +29,18 @@ def _sync_single(name, module, **kwargs): if __opts__["test"]: ret["result"] = None - ret["comment"] = "saltutil.sync_{} would have been run".format(module) + ret["comment"] = f"saltutil.sync_{module} would have been run" return ret try: - sync_status = __salt__["saltutil.sync_{}".format(module)](**kwargs) + sync_status = __salt__[f"saltutil.sync_{module}"](**kwargs) if sync_status: ret["changes"][module] = sync_status - ret["comment"] = "Updated {}.".format(module) + ret["comment"] = f"Updated {module}." except Exception as e: # pylint: disable=broad-except log.error("Failed to run saltutil.sync_%s: %s", module, e) ret["result"] = False - ret["comment"] = "Failed to run sync_{}: {}".format(module, e) + ret["comment"] = f"Failed to run sync_{module}: {e}" return ret if not ret["changes"]: @@ -76,7 +76,7 @@ def sync_all(name, **kwargs): except Exception as e: # pylint: disable=broad-except log.error("Failed to run saltutil.sync_all: %s", e) ret["result"] = False - ret["comment"] = "Failed to run sync_all: {}".format(e) + ret["comment"] = f"Failed to run sync_all: {e}" return ret if not ret["changes"]: diff --git a/salt/states/schedule.py b/salt/states/schedule.py index f7d9d56e2b1..7d05aed727b 100644 --- a/salt/states/schedule.py +++ b/salt/states/schedule.py @@ -241,7 +241,7 @@ def present(name, **kwargs): new_item["enabled"] = True if new_item == current_schedule[name]: - ret["comment"].append("Job {} in correct state".format(name)) + ret["comment"].append(f"Job {name} in correct state") else: if "test" in __opts__ and __opts__["test"]: kwargs["test"] = True @@ -255,7 +255,7 @@ def present(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Modifying job {} in schedule".format(name)) + ret["comment"].append(f"Modifying job {name} in schedule") ret["changes"] = result["changes"] else: if "test" in __opts__ and __opts__["test"]: @@ -269,7 +269,7 @@ def present(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Adding new job {} to schedule".format(name)) + ret["comment"].append(f"Adding new job {name} to schedule") ret["changes"] = result["changes"] ret["comment"] = "\n".join(ret["comment"]) @@ -308,10 +308,10 @@ def absent(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Removed job {} from schedule".format(name)) + ret["comment"].append(f"Removed job {name} from schedule") ret["changes"] = result["changes"] else: - ret["comment"].append("Job {} not present in schedule".format(name)) + ret["comment"].append(f"Job {name} not present in schedule") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -345,9 +345,9 @@ def enabled(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Enabled job {} from schedule".format(name)) + ret["comment"].append(f"Enabled job {name} from schedule") else: - ret["comment"].append("Job {} not present in schedule".format(name)) + ret["comment"].append(f"Job {name} not present in schedule") ret["comment"] = "\n".join(ret["comment"]) return ret @@ -384,9 +384,9 @@ def disabled(name, **kwargs): ret["comment"] = result["comment"] return ret else: - ret["comment"].append("Disabled job {} from schedule".format(name)) + ret["comment"].append(f"Disabled job {name} from schedule") else: - ret["comment"].append("Job {} not present in schedule".format(name)) + ret["comment"].append(f"Job {name} not present in schedule") ret["comment"] = "\n".join(ret["comment"]) return ret diff --git a/salt/states/selinux.py b/salt/states/selinux.py index 08b2830fef7..24c48acd01b 100644 --- a/salt/states/selinux.py +++ b/salt/states/selinux.py @@ -88,7 +88,7 @@ def mode(name): ret = {"name": name, "result": False, "comment": "", "changes": {}} tmode = _refine_mode(name) if tmode == "unknown": - ret["comment"] = "{} is not an accepted mode".format(name) + ret["comment"] = f"{name} is not an accepted mode" return ret # Either the current mode in memory or a non-matching config value # will trigger setenforce @@ -100,11 +100,11 @@ def mode(name): if mode == tmode: ret["result"] = True - ret["comment"] = "SELinux is already in {} mode".format(tmode) + ret["comment"] = f"SELinux is already in {tmode} mode" return ret # The mode needs to change... if __opts__["test"]: - ret["comment"] = "SELinux mode is set to be changed to {}".format(tmode) + ret["comment"] = f"SELinux mode is set to be changed to {tmode}" ret["result"] = None ret["changes"] = {"old": mode, "new": tmode} return ret @@ -114,10 +114,10 @@ def mode(name): tmode == "Disabled" and __salt__["selinux.getconfig"]() == tmode ): ret["result"] = True - ret["comment"] = "SELinux has been set to {} mode".format(tmode) + ret["comment"] = f"SELinux has been set to {tmode} mode" ret["changes"] = {"old": oldmode, "new": mode} return ret - ret["comment"] = "Failed to set SELinux to {} mode".format(tmode) + ret["comment"] = f"Failed to set SELinux to {tmode} mode" return ret @@ -138,12 +138,12 @@ def boolean(name, value, persist=False): ret = {"name": name, "result": True, "comment": "", "changes": {}} bools = __salt__["selinux.list_sebool"]() if name not in bools: - ret["comment"] = "Boolean {} is not available".format(name) + ret["comment"] = f"Boolean {name} is not available" ret["result"] = False return ret rvalue = _refine_value(value) if rvalue is None: - ret["comment"] = "{} is not a valid value for the boolean".format(value) + ret["comment"] = f"{value} is not a valid value for the boolean" ret["result"] = False return ret state = bools[name]["State"] == rvalue @@ -158,19 +158,19 @@ def boolean(name, value, persist=False): return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Boolean {} is set to be changed to {}".format(name, rvalue) + ret["comment"] = f"Boolean {name} is set to be changed to {rvalue}" return ret ret["result"] = __salt__["selinux.setsebool"](name, rvalue, persist) if ret["result"]: - ret["comment"] = "Boolean {} has been set to {}".format(name, rvalue) + ret["comment"] = f"Boolean {name} has been set to {rvalue}" ret["changes"].update({"State": {"old": bools[name]["State"], "new": rvalue}}) if persist and not default: ret["changes"].update( {"Default": {"old": bools[name]["Default"], "new": rvalue}} ) return ret - ret["comment"] = "Failed to set the boolean {} to {}".format(name, rvalue) + ret["comment"] = f"Failed to set the boolean {name} to {rvalue}" return ret @@ -213,7 +213,7 @@ def module(name, module_state="Enabled", version="any", **opts): return module_remove(name) modules = __salt__["selinux.list_semod"]() if name not in modules: - ret["comment"] = "Module {} is not available".format(name) + ret["comment"] = f"Module {name} is not available" ret["result"] = False return ret rmodule_state = _refine_module_state(module_state) @@ -235,7 +235,7 @@ def module(name, module_state="Enabled", version="any", **opts): return ret current_module_state = _refine_module_state(modules[name]["Enabled"]) if rmodule_state == current_module_state: - ret["comment"] = "Module {} is in the desired state".format(name) + ret["comment"] = f"Module {name} is in the desired state" return ret if __opts__["test"]: ret["result"] = None @@ -245,10 +245,10 @@ def module(name, module_state="Enabled", version="any", **opts): return ret if __salt__["selinux.setsemod"](name, rmodule_state): - ret["comment"] = "Module {} has been set to {}".format(name, module_state) + ret["comment"] = f"Module {name} has been set to {module_state}" return ret ret["result"] = False - ret["comment"] = "Failed to set the Module {} to {}".format(name, module_state) + ret["comment"] = f"Failed to set the Module {name} to {module_state}" return ret @@ -263,10 +263,10 @@ def module_install(name): """ ret = {"name": name, "result": True, "comment": "", "changes": {}} if __salt__["selinux.install_semod"](name): - ret["comment"] = "Module {} has been installed".format(name) + ret["comment"] = f"Module {name} has been installed" return ret ret["result"] = False - ret["comment"] = "Failed to install module {}".format(name) + ret["comment"] = f"Failed to install module {name}" return ret @@ -282,14 +282,14 @@ def module_remove(name): ret = {"name": name, "result": True, "comment": "", "changes": {}} modules = __salt__["selinux.list_semod"]() if name not in modules: - ret["comment"] = "Module {} is not available".format(name) + ret["comment"] = f"Module {name} is not available" ret["result"] = False return ret if __salt__["selinux.remove_semod"](name): - ret["comment"] = "Module {} has been removed".format(name) + ret["comment"] = f"Module {name} has been removed" return ret ret["result"] = False - ret["comment"] = "Failed to remove module {}".format(name) + ret["comment"] = f"Failed to remove module {name}" return ret @@ -343,7 +343,7 @@ def fcontext_policy_present( sel_level=sel_level, ) if add_ret["retcode"] != 0: - ret.update({"comment": "Error adding new rule: {}".format(add_ret)}) + ret.update({"comment": f"Error adding new rule: {add_ret}"}) else: ret.update({"result": True}) else: @@ -354,7 +354,7 @@ def fcontext_policy_present( ret.update( { "result": True, - "comment": 'SELinux policy for "{}" already present '.format(name) + "comment": f'SELinux policy for "{name}" already present ' + 'with specified filetype "{}" and sel_type "{}".'.format( filetype_str, sel_type ), @@ -375,7 +375,7 @@ def fcontext_policy_present( sel_level=sel_level, ) if change_ret["retcode"] != 0: - ret.update({"comment": "Error adding new rule: {}".format(change_ret)}) + ret.update({"comment": f"Error adding new rule: {change_ret}"}) else: ret.update({"result": True}) if ret["result"] and (new_state or old_state): @@ -423,7 +423,7 @@ def fcontext_policy_absent( ret.update( { "result": True, - "comment": 'SELinux policy for "{}" already absent '.format(name) + "comment": f'SELinux policy for "{name}" already absent ' + 'with specified filetype "{}" and sel_type "{}".'.format( filetype, sel_type ), @@ -444,7 +444,7 @@ def fcontext_policy_absent( sel_level=sel_level, ) if remove_ret["retcode"] != 0: - ret.update({"comment": "Error removing policy: {}".format(remove_ret)}) + ret.update({"comment": f"Error removing policy: {remove_ret}"}) else: ret.update({"result": True}) return ret @@ -516,7 +516,7 @@ def port_policy_present(name, sel_type, protocol=None, port=None, sel_range=None ret.update( { "result": True, - "comment": 'SELinux policy for "{}" already present '.format(name) + "comment": f'SELinux policy for "{name}" already present ' + 'with specified sel_type "{}", protocol "{}" and port "{}".'.format( sel_type, protocol, port ), @@ -534,7 +534,7 @@ def port_policy_present(name, sel_type, protocol=None, port=None, sel_range=None sel_range=sel_range, ) if add_ret["retcode"] != 0: - ret.update({"comment": "Error adding new policy: {}".format(add_ret)}) + ret.update({"comment": f"Error adding new policy: {add_ret}"}) else: ret.update({"result": True}) new_state = __salt__["selinux.port_get_policy"]( @@ -577,7 +577,7 @@ def port_policy_absent(name, sel_type=None, protocol=None, port=None): ret.update( { "result": True, - "comment": 'SELinux policy for "{}" already absent '.format(name) + "comment": f'SELinux policy for "{name}" already absent ' + 'with specified sel_type "{}", protocol "{}" and port "{}".'.format( sel_type, protocol, port ), @@ -593,7 +593,7 @@ def port_policy_absent(name, sel_type=None, protocol=None, port=None): port=port, ) if delete_ret["retcode"] != 0: - ret.update({"comment": "Error deleting policy: {}".format(delete_ret)}) + ret.update({"comment": f"Error deleting policy: {delete_ret}"}) else: ret.update({"result": True}) new_state = __salt__["selinux.port_get_policy"]( diff --git a/salt/states/service.py b/salt/states/service.py index 650def38a38..ab14ed0abf1 100644 --- a/salt/states/service.py +++ b/salt/states/service.py @@ -190,13 +190,13 @@ def _enable(name, started, result=True, **kwargs): ) ) else: - ret["comment"] = "Service {} is already enabled, and is dead".format(name) + ret["comment"] = f"Service {name} is already enabled, and is dead" return ret # Service needs to be enabled if __opts__["test"]: ret["result"] = None - ret["comment"] = "Service {} set to be enabled".format(name) + ret["comment"] = f"Service {name} set to be enabled" return ret try: @@ -220,7 +220,7 @@ def _enable(name, started, result=True, **kwargs): ) ) else: - ret["comment"] = "Service {} has been enabled, and is dead".format(name) + ret["comment"] = f"Service {name} has been enabled, and is dead" return ret except CommandExecutionError as exc: enable_error = exc.strerror @@ -247,7 +247,7 @@ def _enable(name, started, result=True, **kwargs): ) if enable_error: - ret["comment"] += ". Additional information follows:\n\n{}".format(enable_error) + ret["comment"] += f". Additional information follows:\n\n{enable_error}" return ret @@ -316,13 +316,13 @@ def _disable(name, started, result=True, **kwargs): ) ) else: - ret["comment"] = "Service {} is already disabled, and is dead".format(name) + ret["comment"] = f"Service {name} is already disabled, and is dead" return ret # Service needs to be disabled if __opts__["test"]: ret["result"] = None - ret["comment"] = "Service {} set to be disabled".format(name) + ret["comment"] = f"Service {name} set to be disabled" return ret if __salt__["service.disable"](name, **kwargs): @@ -335,13 +335,13 @@ def _disable(name, started, result=True, **kwargs): if before_toggle_disable_status != after_toggle_disable_status: ret["changes"][name] = True if started is True: - ret["comment"] = "Service {} has been disabled, and is running".format(name) + ret["comment"] = f"Service {name} has been disabled, and is running" elif started is None: ret["comment"] = ( - "Service {} has been disabled, and is in the desired state".format(name) + f"Service {name} has been disabled, and is in the desired state" ) else: - ret["comment"] = "Service {} has been disabled, and is dead".format(name) + ret["comment"] = f"Service {name} has been disabled, and is dead" return ret # Service failed to be disabled @@ -380,7 +380,7 @@ def _available(name, ret): avail = name in __salt__["service.get_all"]() if not avail: ret["result"] = False - ret["comment"] = "The named service {} is not available".format(name) + ret["comment"] = f"The named service {name} is not available" return avail @@ -505,7 +505,7 @@ def running(name, enable=None, sig=None, init_delay=None, **kwargs): [ _f for _f in [ - "The service {} is already running".format(name), + f"The service {name} is already running", unmask_ret["comment"], ] if _f @@ -524,7 +524,7 @@ def running(name, enable=None, sig=None, init_delay=None, **kwargs): [ _f for _f in [ - "Service {} is set to start".format(name), + f"Service {name} is set to start", unmask_ret["comment"], ] if _f @@ -566,7 +566,7 @@ def running(name, enable=None, sig=None, init_delay=None, **kwargs): if not func_ret: ret["result"] = False - ret["comment"] = "Service {} failed to start".format(name) + ret["comment"] = f"Service {name} failed to start" if enable is True: ret.update(_enable(name, False, result=False, **kwargs)) elif enable is False: @@ -589,9 +589,9 @@ def running(name, enable=None, sig=None, init_delay=None, **kwargs): ret["changes"][name] = after_toggle_status if after_toggle_status: - ret["comment"] = "Started service {}".format(name) + ret["comment"] = f"Started service {name}" else: - ret["comment"] = "Service {} failed to start".format(name) + ret["comment"] = f"Service {name} failed to start" ret["result"] = False if enable is True: @@ -708,7 +708,7 @@ def dead(name, enable=None, sig=None, init_delay=None, **kwargs): # See if the service is already dead if not before_toggle_status: - ret["comment"] = "The service {} is already dead".format(name) + ret["comment"] = f"The service {name} is already dead" if enable is True and not before_toggle_enable_status: ret.update(_enable(name, None, **kwargs)) elif enable is False and before_toggle_enable_status: @@ -718,7 +718,7 @@ def dead(name, enable=None, sig=None, init_delay=None, **kwargs): # Run the tests if __opts__["test"]: ret["result"] = None - ret["comment"] = "Service {} is set to be killed".format(name) + ret["comment"] = f"Service {name} is set to be killed" return ret # Conditionally add systemd-specific args to call to service.start @@ -732,7 +732,7 @@ def dead(name, enable=None, sig=None, init_delay=None, **kwargs): func_ret = __salt__["service.stop"](name, **stop_kwargs) if not func_ret: ret["result"] = False - ret["comment"] = "Service {} failed to die".format(name) + ret["comment"] = f"Service {name} failed to die" if enable is True: ret.update(_enable(name, True, result=False, **kwargs)) elif enable is False: @@ -757,9 +757,9 @@ def dead(name, enable=None, sig=None, init_delay=None, **kwargs): # be sure to stop, in case we mis detected in the check if after_toggle_status: ret["result"] = False - ret["comment"] = "Service {} failed to die".format(name) + ret["comment"] = f"Service {name} failed to die" else: - ret["comment"] = "Service {} was killed".format(name) + ret["comment"] = f"Service {name} was killed" if enable is True: ret.update( @@ -791,9 +791,10 @@ def enabled(name, **kwargs): __context__["service.state"] = "enabled" ret.update(_enable(name, None, **kwargs)) - if __opts__.get("test") and ret.get( - "comment" - ) == "The named service {} is not available".format(name): + if ( + __opts__.get("test") + and ret.get("comment") == f"The named service {name} is not available" + ): ret["result"] = None ret["comment"] = ( "Service {} not present; if created in this state run, " @@ -885,16 +886,16 @@ def masked(name, runtime=False): if __opts__["test"]: ret["result"] = None ret["changes"] = expected_changes - ret["comment"] = "Service {} would be {}".format(name, mask_type) + ret["comment"] = f"Service {name} would be {mask_type}" return ret __salt__["service.mask"](name, runtime) if __salt__["service.masked"](name, runtime): ret["changes"] = expected_changes - ret["comment"] = "Service {} was {}".format(name, mask_type) + ret["comment"] = f"Service {name} was {mask_type}" else: - ret["comment"] = "Failed to mask service {}".format(name) + ret["comment"] = f"Failed to mask service {name}" return ret except CommandExecutionError as exc: @@ -943,22 +944,22 @@ def unmasked(name, runtime=False): try: if not __salt__["service.masked"](name, runtime): - ret["comment"] = "Service {} was already {}".format(name, action) + ret["comment"] = f"Service {name} was already {action}" return ret if __opts__["test"]: ret["result"] = None ret["changes"] = expected_changes - ret["comment"] = "Service {} would be {}".format(name, action) + ret["comment"] = f"Service {name} would be {action}" return ret __salt__["service.unmask"](name, runtime) if not __salt__["service.masked"](name, runtime): ret["changes"] = expected_changes - ret["comment"] = "Service {} was {}".format(name, action) + ret["comment"] = f"Service {name} was {action}" else: - ret["comment"] = "Failed to unmask service {}".format(name) + ret["comment"] = f"Failed to unmask service {name}" return ret except CommandExecutionError as exc: @@ -975,7 +976,7 @@ def mod_watch( full_restart=False, init_delay=None, force=False, - **kwargs + **kwargs, ): """ The service watcher, called to invoke the watch command. @@ -1027,7 +1028,7 @@ def mod_watch( func = __salt__["service.stop"] else: ret["result"] = True - ret["comment"] = "Service is already {}".format(past_participle) + ret["comment"] = f"Service is already {past_participle}" return ret elif sfun == "running": if __salt__["service.status"](name, sig, **status_kwargs): @@ -1050,13 +1051,13 @@ def mod_watch( if not past_participle: past_participle = verb + "ed" else: - ret["comment"] = "Unable to trigger watch for service.{}".format(sfun) + ret["comment"] = f"Unable to trigger watch for service.{sfun}" ret["result"] = False return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Service is set to be {}".format(past_participle) + ret["comment"] = f"Service is set to be {past_participle}" return ret if verb == "start" and "service.stop" in __salt__: @@ -1080,9 +1081,7 @@ def mod_watch( ret["changes"] = {name: result} ret["result"] = result ret["comment"] = ( - "Service {}".format(past_participle) - if result - else "Failed to {} the service".format(verb) + f"Service {past_participle}" if result else f"Failed to {verb} the service" ) return ret @@ -1112,7 +1111,7 @@ def mod_beacon(name, **kwargs): data["emitatstartup"] = _beacon_data.get("emitatstartup", False) data["uncleanshutdown"] = _beacon_data.get("emitatstartup", None) - beacon_name = "beacon_{}_{}".format(beacon_module, name) + beacon_name = f"beacon_{beacon_module}_{name}" beacon_kwargs = { "name": beacon_name, diff --git a/salt/states/slack.py b/salt/states/slack.py index 1ba0f4b4e59..df271f2be1c 100644 --- a/salt/states/slack.py +++ b/salt/states/slack.py @@ -161,11 +161,11 @@ def post_message(name, **kwargs): ) except SaltInvocationError as sie: - ret["comment"] = "Failed to send message ({}): {}".format(sie, name) + ret["comment"] = f"Failed to send message ({sie}): {name}" else: if isinstance(result, bool) and result: ret["result"] = True - ret["comment"] = "Sent message: {}".format(name) + ret["comment"] = f"Sent message: {name}" else: ret["comment"] = "Failed to send message ({}): {}".format( result["message"], name diff --git a/salt/states/smartos.py b/salt/states/smartos.py index 29c2bb72352..1309ad00c72 100644 --- a/salt/states/smartos.py +++ b/salt/states/smartos.py @@ -213,9 +213,9 @@ def _write_config(config): if not config[prop].startswith('"') or not config[prop].endswith( '"' ): - config[prop] = '"{}"'.format(config[prop]) + config[prop] = f'"{config[prop]}"' config_file.write( - salt.utils.stringutils.to_str("{}={}\n".format(prop, config[prop])) + salt.utils.stringutils.to_str(f"{prop}={config[prop]}\n") ) log.debug("smartos.config - wrote /usbkey/config: %s", config) except OSError: @@ -299,7 +299,7 @@ def _copy_lx_vars(vmconfig): for var in imgtags.get("docker:config", {}): val = imgtags["docker:config"][var] - var = "docker:{}".format(var.lower()) + var = f"docker:{var.lower()}" # NOTE: skip empty values if not val: @@ -321,7 +321,7 @@ def _copy_lx_vars(vmconfig): ): config_env_var = config_env_var.split("=") for img_env_var in val: - if img_env_var.startswith("{}=".format(config_env_var[0])): + if img_env_var.startswith(f"{config_env_var[0]}="): val.remove(img_env_var) val.append("=".join(config_env_var)) elif var in vmconfig["internal_metadata"]: @@ -362,17 +362,17 @@ def config_present(name, value): if str(config[name]) == str(value): # we're good ret["result"] = True - ret["comment"] = 'property {} already has value "{}"'.format(name, value) + ret["comment"] = f'property {name} already has value "{value}"' else: # update property ret["result"] = True - ret["comment"] = 'updated property {} with value "{}"'.format(name, value) + ret["comment"] = f'updated property {name} with value "{value}"' ret["changes"][name] = value config[name] = value else: # add property ret["result"] = True - ret["comment"] = 'added property {} with value "{}"'.format(name, value) + ret["comment"] = f'added property {name} with value "{value}"' ret["changes"][name] = value config[name] = value @@ -407,13 +407,13 @@ def config_absent(name): if name in config: # delete property ret["result"] = True - ret["comment"] = "property {} deleted".format(name) + ret["comment"] = f"property {name} deleted" ret["changes"][name] = None del config[name] else: # we're good ret["result"] = True - ret["comment"] = "property {} is absent".format(name) + ret["comment"] = f"property {name} is absent" # apply change if needed if not __opts__["test"] and ret["changes"]: @@ -436,7 +436,7 @@ def source_present(name, source_type="imgapi"): if name in __salt__["imgadm.sources"](): # source is present ret["result"] = True - ret["comment"] = "image source {} is present".format(name) + ret["comment"] = f"image source {name} is present" else: # add new source if __opts__["test"]: @@ -447,10 +447,10 @@ def source_present(name, source_type="imgapi"): ret["result"] = name in res if ret["result"]: - ret["comment"] = "image source {} added".format(name) + ret["comment"] = f"image source {name} added" ret["changes"][name] = "added" else: - ret["comment"] = "image source {} not added".format(name) + ret["comment"] = f"image source {name} not added" if "Error" in res: ret["comment"] = "{}: {}".format(ret["comment"], res["Error"]) @@ -469,7 +469,7 @@ def source_absent(name): if name not in __salt__["imgadm.sources"](): # source is absent ret["result"] = True - ret["comment"] = "image source {} is absent".format(name) + ret["comment"] = f"image source {name} is absent" else: # remove source if __opts__["test"]: @@ -480,10 +480,10 @@ def source_absent(name): ret["result"] = name not in res if ret["result"]: - ret["comment"] = "image source {} deleted".format(name) + ret["comment"] = f"image source {name} deleted" ret["changes"][name] = "deleted" else: - ret["comment"] = "image source {} not deleted".format(name) + ret["comment"] = f"image source {name} not deleted" if "Error" in res: ret["comment"] = "{}: {}".format(ret["comment"], res["Error"]) @@ -509,7 +509,7 @@ def image_present(name): elif name in __salt__["imgadm.list"](): # image was already imported ret["result"] = True - ret["comment"] = "image {} is present".format(name) + ret["comment"] = f"image {name} is present" else: # add image if _is_docker_uuid(name): @@ -533,13 +533,13 @@ def image_present(name): elif _is_docker_uuid(name): ret["result"] = __salt__["imgadm.docker_to_uuid"](name) is not None if ret["result"]: - ret["comment"] = "image {} imported".format(name) + ret["comment"] = f"image {name} imported" ret["changes"] = res else: - ret["comment"] = "image {} was unable to be imported".format(name) + ret["comment"] = f"image {name} was unable to be imported" else: ret["result"] = False - ret["comment"] = "image {} does not exists".format(name) + ret["comment"] = f"image {name} does not exists" return ret @@ -567,12 +567,12 @@ def image_absent(name): if not uuid or uuid not in __salt__["imgadm.list"](): # image not imported ret["result"] = True - ret["comment"] = "image {} is absent".format(name) + ret["comment"] = f"image {name} is absent" else: # check if image in use by vm if uuid in __salt__["vmadm.list"](order="image_uuid"): ret["result"] = False - ret["comment"] = "image {} currently in use by a vm".format(name) + ret["comment"] = f"image {name} currently in use by a vm" else: # delete image if __opts__["test"]: @@ -599,7 +599,7 @@ def image_absent(name): name, image_count ) else: - ret["comment"] = "image {} deleted".format(name) + ret["comment"] = f"image {name} deleted" ret["changes"][name] = None return ret @@ -905,7 +905,7 @@ def vm_present(name, vmconfig, config=None): continue # enforcement - enforce = config["enforce_{}".format(collection)] + enforce = config[f"enforce_{collection}"] log.debug("smartos.vm_present::enforce_%s = %s", collection, enforce) # dockerinit handling @@ -940,13 +940,13 @@ def vm_present(name, vmconfig, config=None): continue # create set_ dict - if "set_{}".format(collection) not in vmconfig["changed"]: - vmconfig["changed"]["set_{}".format(collection)] = {} + if f"set_{collection}" not in vmconfig["changed"]: + vmconfig["changed"][f"set_{collection}"] = {} # add property to changeset - vmconfig["changed"]["set_{}".format(collection)][prop] = vmconfig[ - "state" - ][collection][prop] + vmconfig["changed"][f"set_{collection}"][prop] = vmconfig["state"][ + collection + ][prop] # process remove for collection if ( @@ -964,11 +964,11 @@ def vm_present(name, vmconfig, config=None): continue # create remove_ array - if "remove_{}".format(collection) not in vmconfig["changed"]: - vmconfig["changed"]["remove_{}".format(collection)] = [] + if f"remove_{collection}" not in vmconfig["changed"]: + vmconfig["changed"][f"remove_{collection}"] = [] # remove property - vmconfig["changed"]["remove_{}".format(collection)].append(prop) + vmconfig["changed"][f"remove_{collection}"].append(prop) # process instances for instance in vmconfig_type["instance"]: @@ -1018,28 +1018,23 @@ def vm_present(name, vmconfig, config=None): # update instance if update_cfg: # create update_ array - if ( - "update_{}".format(instance) - not in vmconfig["changed"] - ): - vmconfig["changed"][ - "update_{}".format(instance) - ] = [] + if f"update_{instance}" not in vmconfig["changed"]: + vmconfig["changed"][f"update_{instance}"] = [] update_cfg[vmconfig_type["instance"][instance]] = ( state_cfg[vmconfig_type["instance"][instance]] ) - vmconfig["changed"][ - "update_{}".format(instance) - ].append(update_cfg) + vmconfig["changed"][f"update_{instance}"].append( + update_cfg + ) if add_instance: # create add_ array - if "add_{}".format(instance) not in vmconfig["changed"]: - vmconfig["changed"]["add_{}".format(instance)] = [] + if f"add_{instance}" not in vmconfig["changed"]: + vmconfig["changed"][f"add_{instance}"] = [] # add instance - vmconfig["changed"]["add_{}".format(instance)].append(state_cfg) + vmconfig["changed"][f"add_{instance}"].append(state_cfg) # remove instances if ( @@ -1067,11 +1062,11 @@ def vm_present(name, vmconfig, config=None): if remove_instance: # create remove_ array - if "remove_{}".format(instance) not in vmconfig["changed"]: - vmconfig["changed"]["remove_{}".format(instance)] = [] + if f"remove_{instance}" not in vmconfig["changed"]: + vmconfig["changed"][f"remove_{instance}"] = [] # remove instance - vmconfig["changed"]["remove_{}".format(instance)].append( + vmconfig["changed"][f"remove_{instance}"].append( current_cfg[vmconfig_type["instance"][instance]] ) @@ -1221,7 +1216,7 @@ def vm_absent(name, archive=False): if name not in __salt__["vmadm.list"](order="hostname"): # we're good ret["result"] = True - ret["comment"] = "vm {} is absent".format(name) + ret["comment"] = f"vm {name} is absent" else: # delete vm if not __opts__["test"]: @@ -1237,9 +1232,9 @@ def vm_absent(name, archive=False): if not isinstance(ret["result"], bool) and ret["result"].get("Error"): ret["result"] = False - ret["comment"] = "failed to delete vm {}".format(name) + ret["comment"] = f"failed to delete vm {name}" else: - ret["comment"] = "vm {} deleted".format(name) + ret["comment"] = f"vm {name} deleted" ret["changes"][name] = None return ret @@ -1263,7 +1258,7 @@ def vm_running(name): if name in __salt__["vmadm.list"](order="hostname", search="state=running"): # we're good ret["result"] = True - ret["comment"] = "vm {} already running".format(name) + ret["comment"] = f"vm {name} already running" else: # start the vm ret["result"] = ( @@ -1271,10 +1266,10 @@ def vm_running(name): ) if not isinstance(ret["result"], bool) and ret["result"].get("Error"): ret["result"] = False - ret["comment"] = "failed to start {}".format(name) + ret["comment"] = f"failed to start {name}" else: ret["changes"][name] = "running" - ret["comment"] = "vm {} started".format(name) + ret["comment"] = f"vm {name} started" return ret @@ -1297,7 +1292,7 @@ def vm_stopped(name): if name in __salt__["vmadm.list"](order="hostname", search="state=stopped"): # we're good ret["result"] = True - ret["comment"] = "vm {} already stopped".format(name) + ret["comment"] = f"vm {name} already stopped" else: # stop the vm ret["result"] = ( @@ -1305,9 +1300,9 @@ def vm_stopped(name): ) if not isinstance(ret["result"], bool) and ret["result"].get("Error"): ret["result"] = False - ret["comment"] = "failed to stop {}".format(name) + ret["comment"] = f"failed to stop {name}" else: ret["changes"][name] = "stopped" - ret["comment"] = "vm {} stopped".format(name) + ret["comment"] = f"vm {name} stopped" return ret diff --git a/salt/states/smtp.py b/salt/states/smtp.py index 2c8068363e7..1dd9fd9c799 100644 --- a/salt/states/smtp.py +++ b/salt/states/smtp.py @@ -86,8 +86,8 @@ def send_msg( recipient, name, atts ) else: - ret["comment"] = "Sent message to {}: {}".format(recipient, name) + ret["comment"] = f"Sent message to {recipient}: {name}" else: ret["result"] = False - ret["comment"] = "Unable to send message to {}: {}".format(recipient, name) + ret["comment"] = f"Unable to send message to {recipient}: {name}" return ret diff --git a/salt/states/snapper.py b/salt/states/snapper.py index 6a6a7d66973..2c61ab9722c 100644 --- a/salt/states/snapper.py +++ b/salt/states/snapper.py @@ -177,9 +177,7 @@ def baseline_snapshot( if tag: snapshot = _get_baseline_from_tag(config, tag) if not snapshot: - ret.update( - {"result": False, "comment": 'Baseline tag "{}" not found'.format(tag)} - ) + ret.update({"result": False, "comment": f'Baseline tag "{tag}" not found'}) return ret number = snapshot["id"] diff --git a/salt/states/solrcloud.py b/salt/states/solrcloud.py index edbb6baf74b..4858ecf84f5 100644 --- a/salt/states/solrcloud.py +++ b/salt/states/solrcloud.py @@ -38,11 +38,11 @@ def alias(name, collections, **kwargs): return ret if __opts__["test"]: - ret["comment"] = 'The alias "{}" will be updated.'.format(name) + ret["comment"] = f'The alias "{name}" will be updated.' ret["result"] = None else: __salt__["solrcloud.alias_set_collections"](name, collections, **kwargs) - ret["comment"] = 'The alias "{}" has been updated.'.format(name) + ret["comment"] = f'The alias "{name}" has been updated.' ret["result"] = True ret["changes"] = { @@ -52,11 +52,11 @@ def alias(name, collections, **kwargs): else: if __opts__["test"]: - ret["comment"] = 'The alias "{}" will be created.'.format(name) + ret["comment"] = f'The alias "{name}" will be created.' ret["result"] = None else: __salt__["solrcloud.alias_set_collections"](name, collections, **kwargs) - ret["comment"] = 'The alias "{}" has been created.'.format(name) + ret["comment"] = f'The alias "{name}" has been created.' ret["result"] = True ret["changes"] = { @@ -120,7 +120,7 @@ def collection(name, options=None, **kwargs): else: if __opts__["test"]: - ret["comment"] = 'Collection options "{}" will be changed.'.format(name) + ret["comment"] = f'Collection options "{name}" will be changed.' ret["result"] = None else: __salt__["solrcloud.collection_set_options"](name, diff, **kwargs) @@ -145,11 +145,11 @@ def collection(name, options=None, **kwargs): options, sort_keys=True, indent=4, separators=(",", ": ") ) if __opts__["test"]: - ret["comment"] = 'The collection "{}" will be created.'.format(name) + ret["comment"] = f'The collection "{name}" will be created.' ret["result"] = None else: __salt__["solrcloud.collection_create"](name, options, **kwargs) - ret["comment"] = 'The collection "{}" has been created.'.format(name) + ret["comment"] = f'The collection "{name}" has been created.' ret["result"] = True ret["changes"] = { diff --git a/salt/states/splunk.py b/salt/states/splunk.py index 272a516ff4a..54c175f5490 100644 --- a/salt/states/splunk.py +++ b/salt/states/splunk.py @@ -50,22 +50,22 @@ def present(email, profile="splunk", **kwargs): if not target: if __opts__["test"]: - ret["comment"] = "User {} will be created".format(name) + ret["comment"] = f"User {name} will be created" return ret # create the user result = __salt__["splunk.create_user"](email, profile=profile, **kwargs) if result: ret["changes"].setdefault("old", None) - ret["changes"].setdefault("new", "User {} exists".format(name)) + ret["changes"].setdefault("new", f"User {name} exists") ret["result"] = True else: ret["result"] = False - ret["comment"] = "Failed to create {}".format(name) + ret["comment"] = f"Failed to create {name}" return ret else: - ret["comment"] = "User {} set to be updated.".format(name) + ret["comment"] = f"User {name} set to be updated." if __opts__["test"]: ret["result"] = None return ret @@ -130,31 +130,31 @@ def absent(email, profile="splunk", **kwargs): "name": user_identity, "changes": {}, "result": None, - "comment": "User {} is absent.".format(user_identity), + "comment": f"User {user_identity} is absent.", } target = __salt__["splunk.get_user"](email, profile=profile) if not target: - ret["comment"] = "User {} does not exist".format(user_identity) + ret["comment"] = f"User {user_identity} does not exist" ret["result"] = True return ret if __opts__["test"]: - ret["comment"] = "User {} is all set to be deleted".format(user_identity) + ret["comment"] = f"User {user_identity} is all set to be deleted" ret["result"] = None return ret result = __salt__["splunk.delete_user"](email, profile=profile) if result: - ret["comment"] = "Deleted user {}".format(user_identity) - ret["changes"].setdefault("old", "User {} exists".format(user_identity)) - ret["changes"].setdefault("new", "User {} deleted".format(user_identity)) + ret["comment"] = f"Deleted user {user_identity}" + ret["changes"].setdefault("old", f"User {user_identity} exists") + ret["changes"].setdefault("new", f"User {user_identity} deleted") ret["result"] = True else: - ret["comment"] = "Failed to delete {}".format(user_identity) + ret["comment"] = f"Failed to delete {user_identity}" ret["result"] = False return ret diff --git a/salt/states/splunk_search.py b/salt/states/splunk_search.py index a12ca481e29..8c00b217e45 100644 --- a/salt/states/splunk_search.py +++ b/salt/states/splunk_search.py @@ -44,7 +44,7 @@ def present(name, profile="splunk", **kwargs): target = __salt__["splunk_search.get"](name, profile=profile) if target: if __opts__["test"]: - ret["comment"] = "Would update {}".format(name) + ret["comment"] = f"Would update {name}" return ret # found a search... updating result = __salt__["splunk_search.update"](name, profile=profile, **kwargs) @@ -64,7 +64,7 @@ def present(name, profile="splunk", **kwargs): ret["changes"]["new"] = newvalues else: if __opts__["test"]: - ret["comment"] = "Would create {}".format(name) + ret["comment"] = f"Would create {name}" return ret # creating a new search result = __salt__["splunk_search.create"](name, profile=profile, **kwargs) @@ -74,7 +74,7 @@ def present(name, profile="splunk", **kwargs): ret["changes"]["new"] = kwargs else: ret["result"] = False - ret["comment"] = "Failed to create {}".format(name) + ret["comment"] = f"Failed to create {name}" return ret @@ -96,7 +96,7 @@ def absent(name, profile="splunk"): "name": name, "changes": {}, "result": True, - "comment": "{} is absent.".format(name), + "comment": f"{name} is absent.", } target = __salt__["splunk_search.get"](name, profile=profile) @@ -104,14 +104,14 @@ def absent(name, profile="splunk"): if __opts__["test"]: ret = {} ret["name"] = name - ret["comment"] = "Would delete {}".format(name) + ret["comment"] = f"Would delete {name}" ret["result"] = None return ret result = __salt__["splunk_search.delete"](name, profile=profile) if result: - ret["comment"] = "{} was deleted".format(name) + ret["comment"] = f"{name} was deleted" else: - ret["comment"] = "Failed to delete {}".format(name) + ret["comment"] = f"Failed to delete {name}" ret["result"] = False return ret diff --git a/salt/states/ssh_known_hosts.py b/salt/states/ssh_known_hosts.py index 262c9cadb32..9502e827bff 100644 --- a/salt/states/ssh_known_hosts.py +++ b/salt/states/ssh_known_hosts.py @@ -148,18 +148,18 @@ def present( ) except CommandNotFoundError as err: ret["result"] = False - ret["comment"] = "ssh.check_known_host error: {}".format(err) + ret["comment"] = f"ssh.check_known_host error: {err}" return ret if result == "exists": - comment = "Host {} is already in {}".format(name, config) + comment = f"Host {name} is already in {config}" ret["result"] = True return dict(ret, comment=comment) elif result == "add": - comment = "Key for {} is set to be added to {}".format(name, config) + comment = f"Key for {name} is set to be added to {config}" return dict(ret, comment=comment) else: # 'update' - comment = "Key for {} is set to be updated in {}".format(name, config) + comment = f"Key for {name} is set to be updated in {config}" return dict(ret, comment=comment) result = __salt__["ssh.set_known_host"]( @@ -175,7 +175,7 @@ def present( fingerprint_hash_type=fingerprint_hash_type, ) if result["status"] == "exists": - return dict(ret, comment="{} already exists in {}".format(name, config)) + return dict(ret, comment=f"{name} already exists in {config}") elif result["status"] == "error": return dict(ret, result=False, comment=result["error"]) else: # 'updated' @@ -184,7 +184,7 @@ def present( return dict( ret, changes={"old": result["old"], "new": result["new"]}, - comment="{}'s key saved to {} (key: {})".format(name, config, new_key), + comment=f"{name}'s key saved to {config} (key: {new_key})", ) else: fingerprint = result["new"][0]["fingerprint"] @@ -235,7 +235,7 @@ def absent(name, user=None, config=None): return dict(ret, comment="Host is already absent") if __opts__["test"]: - comment = "Key for {} is set to be removed from {}".format(name, config) + comment = f"Key for {name} is set to be removed from {config}" ret["result"] = None return dict(ret, comment=comment) diff --git a/salt/states/status.py b/salt/states/status.py index 98cdffb3f08..5f84d07e16b 100644 --- a/salt/states/status.py +++ b/salt/states/status.py @@ -28,7 +28,7 @@ def loadavg(name, maximum=None, minimum=None): data = __salt__["status.loadavg"]() if name not in data: ret["result"] = False - ret["comment"] += "Requested load average {} not available ".format(name) + ret["comment"] += f"Requested load average {name} not available " return ret if minimum and maximum and minimum >= maximum: ret["comment"] += "Min must be less than max" @@ -44,7 +44,7 @@ def loadavg(name, maximum=None, minimum=None): return ret if maximum: if cap > float(maximum): - ret["comment"] = "Load avg above maximum of {} at {}".format(maximum, cap) + ret["comment"] = f"Load avg above maximum of {maximum} at {cap}" return ret ret["comment"] = "Load avg in acceptable range" ret["result"] = True @@ -69,9 +69,9 @@ def process(name): data = __salt__["status.pid"](name) if not data: ret["result"] = False - ret["comment"] += 'Process signature "{}" not found '.format(name) + ret["comment"] += f'Process signature "{name}" not found ' return ret ret["data"] = data - ret["comment"] += 'Process signature "{}" was found '.format(name) + ret["comment"] += f'Process signature "{name}" was found ' ret["result"] = True return ret diff --git a/salt/states/statuspage.py b/salt/states/statuspage.py index e8961aceca8..7d478ae82c9 100644 --- a/salt/states/statuspage.py +++ b/salt/states/statuspage.py @@ -207,7 +207,7 @@ def create( page_id=None, api_key=None, api_version=None, - **kwargs + **kwargs, ): """ Insert a new entry under a specific endpoint. @@ -259,14 +259,14 @@ def create( page_id=page_id, api_key=api_key, api_version=api_version, - **kwargs + **kwargs, ) if not sp_create.get("result"): ret["comment"] = "Unable to create {endpoint}: {msg}".format( endpoint=endpoint_sg, msg=sp_create.get("comment") ) else: - ret["comment"] = "{endpoint} created!".format(endpoint=endpoint_sg) + ret["comment"] = f"{endpoint_sg} created!" ret["result"] = True ret["changes"] = sp_create.get("out") @@ -279,7 +279,7 @@ def update( page_id=None, api_key=None, api_version=None, - **kwargs + **kwargs, ): """ Update attribute(s) of a specific endpoint. @@ -337,14 +337,14 @@ def update( page_id=page_id, api_key=api_key, api_version=api_version, - **kwargs + **kwargs, ) if not sp_update.get("result"): ret["comment"] = "Unable to update {endpoint} #{id}: {msg}".format( endpoint=endpoint_sg, id=id, msg=sp_update.get("comment") ) else: - ret["comment"] = "{endpoint} #{id} updated!".format(endpoint=endpoint_sg, id=id) + ret["comment"] = f"{endpoint_sg} #{id} updated!" ret["result"] = True ret["changes"] = sp_update.get("out") @@ -411,7 +411,7 @@ def delete( endpoint=endpoint_sg, id=id, msg=sp_delete.get("comment") ) else: - ret["comment"] = "{endpoint} #{id} deleted!".format(endpoint=endpoint_sg, id=id) + ret["comment"] = f"{endpoint_sg} #{id} deleted!" ret["result"] = True @@ -544,7 +544,7 @@ def managed( page_id=page_id, api_key=api_key, api_version=api_version, - **new_endpoint + **new_endpoint, ) if not adding.get("result"): ret.update({"comment": adding.get("comment")}) @@ -563,7 +563,7 @@ def managed( page_id=page_id, api_key=api_key, api_version=api_version, - **update_endpoint + **update_endpoint, ) if not updating.get("result"): ret.update({"comment": updating.get("comment")}) diff --git a/salt/states/supervisord.py b/salt/states/supervisord.py index 68ec8717ad6..4b0c7bbf23c 100644 --- a/salt/states/supervisord.py +++ b/salt/states/supervisord.py @@ -116,7 +116,7 @@ def running( # Process group if len(to_start) == len(matches): ret["comment"] = ( - "All services in group '{}' will be started".format(name) + f"All services in group '{name}' will be started" ) else: ret["comment"] = ( @@ -126,23 +126,23 @@ def running( ) else: # Single program - ret["comment"] = "Service {} will be started".format(name) + ret["comment"] = f"Service {name} will be started" else: if name.endswith(":"): # Process group ret["comment"] = ( - "All services in group '{}' are already running".format(name) + f"All services in group '{name}' are already running" ) else: - ret["comment"] = "Service {} is already running".format(name) + ret["comment"] = f"Service {name} is already running" else: ret["result"] = None # Process/group needs to be added if name.endswith(":"): - _type = "Group '{}'".format(name) + _type = f"Group '{name}'" else: - _type = "Service {}".format(name) - ret["comment"] = "{} will be added and started".format(_type) + _type = f"Service {name}" + ret["comment"] = f"{_type} will be added and started" return ret changes = [] @@ -162,11 +162,11 @@ def running( ret.update(_check_error(result, comment)) log.debug(comment) - if "{}: updated".format(name) in result: + if f"{name}: updated" in result: just_updated = True elif to_add: # Not sure if this condition is precise enough. - comment = "Adding service: {}".format(name) + comment = f"Adding service: {name}" __salt__["supervisord.reread"](user=user, conf_file=conf_file, bin_env=bin_env) # Causes supervisorctl to throw `ERROR: process group already active` # if process group exists. At this moment, I'm not sure how to handle @@ -205,7 +205,7 @@ def running( if is_stopped is False: if restart and not just_updated: comment = "Restarting{}: {}".format( - process_type is not None and " {}".format(process_type) or "", name + process_type is not None and f" {process_type}" or "", name ) log.debug(comment) result = __salt__["supervisord.restart"]( @@ -215,20 +215,20 @@ def running( changes.append(comment) elif just_updated: comment = "Not starting updated{}: {}".format( - process_type is not None and " {}".format(process_type) or "", name + process_type is not None and f" {process_type}" or "", name ) result = comment ret.update({"comment": comment}) else: comment = "Not starting already running{}: {}".format( - process_type is not None and " {}".format(process_type) or "", name + process_type is not None and f" {process_type}" or "", name ) result = comment ret.update({"comment": comment}) elif not just_updated: comment = "Starting{}: {}".format( - process_type is not None and " {}".format(process_type) or "", name + process_type is not None and f" {process_type}" or "", name ) changes.append(comment) log.debug(comment) @@ -268,9 +268,9 @@ def dead(name, user=None, conf_file=None, bin_env=None, **kwargs): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Service {} is set to be stopped".format(name) + ret["comment"] = f"Service {name} is set to be stopped" else: - comment = "Stopping service: {}".format(name) + comment = f"Stopping service: {name}" log.debug(comment) all_processes = __salt__["supervisord.status"]( @@ -303,11 +303,11 @@ def dead(name, user=None, conf_file=None, bin_env=None, **kwargs): is_stopped = False else: # process name doesn't exist - ret["comment"] = "Service {} doesn't exist".format(name) + ret["comment"] = f"Service {name} doesn't exist" return ret if is_stopped is True: - ret["comment"] = "Service {} is not running".format(name) + ret["comment"] = f"Service {name} is not running" else: result = { name: __salt__["supervisord.stop"]( diff --git a/salt/states/svn.py b/salt/states/svn.py index c041d4f27a6..aac0dca9fa9 100644 --- a/salt/states/svn.py +++ b/salt/states/svn.py @@ -101,7 +101,7 @@ def latest( opts = tuple() if os.path.exists(target) and not os.path.isdir(target): - return _fail(ret, 'The path "{}" exists and is not a directory.'.format(target)) + return _fail(ret, f'The path "{target}" exists and is not a directory.') if __opts__["test"]: if rev: @@ -123,11 +123,11 @@ def latest( ) svn_cmd = "svn.diff" except exceptions.CommandExecutionError: - return _fail(ret, "{} exists but is not a svn working copy.".format(target)) + return _fail(ret, f"{target} exists but is not a svn working copy.") current_rev = current_info[0]["Revision"] - opts += ("-r", "{}:{}".format(current_rev, new_rev)) + opts += ("-r", f"{current_rev}:{new_rev}") if trust: opts += ("--trust-server-cert",) @@ -173,7 +173,7 @@ def latest( fmt="dict", )[0]["Revision"] if current_rev != new_rev: - ret["changes"]["revision"] = "{} => {}".format(current_rev, new_rev) + ret["changes"]["revision"] = f"{current_rev} => {new_rev}" else: out = __salt__[svn_cmd](cwd, name, basename, user, username, password, *opts) @@ -260,11 +260,11 @@ def export( opts = () if not overwrite and os.path.exists(target) and not os.path.isdir(target): - return _fail(ret, 'The path "{}" exists and is not a directory.'.format(target)) + return _fail(ret, f'The path "{target}" exists and is not a directory.') if __opts__["test"]: if not os.path.exists(target): return _neutral_test( - ret, "{} doesn't exist and is set to be checked out.".format(target) + ret, f"{target} doesn't exist and is set to be checked out." ) svn_cmd = "svn.list" rev = "HEAD" @@ -288,7 +288,7 @@ def export( out = __salt__[svn_cmd](cwd, name, basename, user, username, password, rev, *opts) ret["changes"]["new"] = name - ret["changes"]["comment"] = "{} was Exported to {}".format(name, target) + ret["changes"]["comment"] = f"{name} was Exported to {target}" ret["comment"] = out return ret diff --git a/salt/states/sysctl.py b/salt/states/sysctl.py index 4498e672758..a417512bd1f 100644 --- a/salt/states/sysctl.py +++ b/salt/states/sysctl.py @@ -98,20 +98,20 @@ def present(name, value, config=None): return ret # otherwise, we don't have it set anywhere and need to set it ret["result"] = None - ret["comment"] = "Sysctl option {} would be changed to {}".format(name, value) + ret["comment"] = f"Sysctl option {name} would be changed to {value}" return ret try: update = __salt__["sysctl.persist"](name, value, config) except CommandExecutionError as exc: ret["result"] = False - ret["comment"] = "Failed to set {} to {}: {}".format(name, value, exc) + ret["comment"] = f"Failed to set {name} to {value}: {exc}" return ret if update == "Updated": ret["changes"] = {name: value} - ret["comment"] = "Updated sysctl value {} = {}".format(name, value) + ret["comment"] = f"Updated sysctl value {name} = {value}" elif update == "Already set": - ret["comment"] = "Sysctl value {} = {} is already set".format(name, value) + ret["comment"] = f"Sysctl value {name} = {value} is already set" return ret diff --git a/salt/states/sysfs.py b/salt/states/sysfs.py index afcaf609fbe..e63c6499bc9 100644 --- a/salt/states/sysfs.py +++ b/salt/states/sysfs.py @@ -41,33 +41,33 @@ def present(name, value, config=None): current = __salt__["sysfs.read"](name) if current is False: ret["result"] = False - ret["comment"] = "SysFS attribute {} doesn't exist.".format(name) + ret["comment"] = f"SysFS attribute {name} doesn't exist." else: # if the return is a dict, the "name" is an object not an attribute if isinstance(current, dict): ret["result"] = False - ret["comment"] = "{} is not a SysFS attribute.".format(name) + ret["comment"] = f"{name} is not a SysFS attribute." else: # some attribute files lists all available options and the selected one between [] if isinstance(current, str): current = re.sub(r"(.*\[|\].*)", "", current) if value == current: ret["result"] = True - ret["comment"] = "SysFS attribute {} is already set.".format(name) + ret["comment"] = f"SysFS attribute {name} is already set." else: ret["result"] = None if ret["result"] is None: if __opts__["test"]: - ret["comment"] = "SysFS attribute {} set to be changed.".format(name) + ret["comment"] = f"SysFS attribute {name} set to be changed." else: update = __salt__["sysfs.write"](name, value) if not update: ret["result"] = False - ret["comment"] = "Failed to set {} to {}".format(name, value) + ret["comment"] = f"Failed to set {name} to {value}" else: ret["result"] = True ret["changes"] = {name: value} - ret["comment"] = "Updated SysFS attribute {} to {}".format(name, value) + ret["comment"] = f"Updated SysFS attribute {name} to {value}" return ret diff --git a/salt/states/sysrc.py b/salt/states/sysrc.py index 2a620b4cc93..4c7b0d2a57f 100644 --- a/salt/states/sysrc.py +++ b/salt/states/sysrc.py @@ -47,11 +47,11 @@ def managed(name, value, **kwargs): for rcname, rcdict in current_state.items(): if rcdict[name] == value: ret["result"] = True - ret["comment"] = "{} is already set to the desired value.".format(name) + ret["comment"] = f"{name} is already set to the desired value." return ret if __opts__["test"] is True: - ret["comment"] = 'The value of "{}" will be changed!'.format(name) + ret["comment"] = f'The value of "{name}" will be changed!' ret["changes"] = { "old": current_state, "new": name + " = " + value + " will be set.", @@ -64,7 +64,7 @@ def managed(name, value, **kwargs): new_state = __salt__["sysrc.set"](name=name, value=value, **kwargs) - ret["comment"] = 'The value of "{}" was changed!'.format(name) + ret["comment"] = f'The value of "{name}" was changed!' ret["changes"] = {"old": current_state, "new": new_state} @@ -91,14 +91,14 @@ def absent(name, **kwargs): current_state = __salt__["sysrc.get"](name=name, **kwargs) if current_state is None: ret["result"] = True - ret["comment"] = '"{}" is already absent.'.format(name) + ret["comment"] = f'"{name}" is already absent.' return ret if __opts__["test"] is True: - ret["comment"] = '"{}" will be removed!'.format(name) + ret["comment"] = f'"{name}" will be removed!' ret["changes"] = { "old": current_state, - "new": '"{}" will be removed.'.format(name), + "new": f'"{name}" will be removed.', } # When test=true return none @@ -108,7 +108,7 @@ def absent(name, **kwargs): new_state = __salt__["sysrc.remove"](name=name, **kwargs) - ret["comment"] = '"{}" was removed!'.format(name) + ret["comment"] = f'"{name}" was removed!' ret["changes"] = {"old": current_state, "new": new_state} diff --git a/salt/states/telemetry_alert.py b/salt/states/telemetry_alert.py index eb94cb86b3e..18ec2bc40ed 100644 --- a/salt/states/telemetry_alert.py +++ b/salt/states/telemetry_alert.py @@ -96,7 +96,7 @@ def present( # del saved_alert_config["_id"] for k, v in post_body.items(): if k not in saved_alert_config: - difference.append("{}={} (new)".format(k, v)) + difference.append(f"{k}={v} (new)") continue v2 = saved_alert_config[k] @@ -108,7 +108,7 @@ def present( continue if isinstance(v, int) and v == int(v2): continue - difference.append("{}='{}' was: '{}'".format(k, v, v2)) + difference.append(f"{k}='{v}' was: '{v2}'") else: difference.append("new alert config") @@ -122,10 +122,10 @@ def present( if saved_alert_config: # alert config is present. update, or do nothing # check to see if attributes matches is_present. If so, do nothing. if len(difference) == 0: - ret["comment"] = "alert config {} present and matching".format(metric_name) + ret["comment"] = f"alert config {metric_name} present and matching" return ret if __opts__["test"]: - msg = "alert config {} is to be updated.".format(metric_name) + msg = f"alert config {metric_name} is to be updated." ret["comment"] = msg ret["result"] = "\n".join(difference) return ret @@ -142,7 +142,7 @@ def present( ) else: # alert config is absent. create it. if __opts__["test"]: - msg = "alert config {} is to be created.".format(metric_name) + msg = f"alert config {metric_name} is to be created." ret["comment"] = msg ret["result"] = None return ret diff --git a/salt/states/test.py b/salt/states/test.py index 18af36920bf..a09f6a2d28f 100644 --- a/salt/states/test.py +++ b/salt/states/test.py @@ -460,17 +460,17 @@ def check_pillar( fine[key] = key_type for key, key_type in failed.items(): - comment = 'Pillar key "{}" '.format(key) + comment = f'Pillar key "{key}" ' if key_type is None: comment += "is missing.\n" else: - comment += "is not {}.\n".format(key_type) + comment += f"is not {key_type}.\n" ret["comment"] += comment if verbose and fine: comment = "Those keys passed the check:\n" for key, key_type in fine.items(): - comment += "- {} ({})\n".format(key, key_type) + comment += f"- {key} ({key_type})\n" ret["comment"] += comment return ret diff --git a/salt/states/testinframod.py b/salt/states/testinframod.py index 493fc8ef2eb..d0107ae79d9 100644 --- a/salt/states/testinframod.py +++ b/salt/states/testinframod.py @@ -40,7 +40,7 @@ def _generate_functions(): modules_ = [module_ for module_ in modules.modules] for module_name in modules_: - func_name = "testinfra.{}".format(module_name) + func_name = f"testinfra.{module_name}" __all__.append(module_name) log.debug( "Generating state for module %s as function %s", module_name, func_name diff --git a/salt/states/timezone.py b/salt/states/timezone.py index 558cd1d6486..208d18e5f0b 100644 --- a/salt/states/timezone.py +++ b/salt/states/timezone.py @@ -73,7 +73,7 @@ def system(name, utc=True): # Check the time zone if compzone is True: ret["result"] = True - messages.append("Timezone {} already set".format(name)) + messages.append(f"Timezone {name} already set") else: do_zone = True @@ -82,7 +82,7 @@ def system(name, utc=True): ret["result"] = None do_utc = True elif utc and utc == myutc: - messages.append("UTC already set to {}".format(name)) + messages.append(f"UTC already set to {name}") if ret["result"] is True: ret["comment"] = ", ".join(messages) @@ -91,9 +91,9 @@ def system(name, utc=True): if __opts__["test"]: messages = [] if compzone is False: - messages.append("Timezone {} needs to be set".format(name)) + messages.append(f"Timezone {name} needs to be set") if utc and myutc != utc: - messages.append("UTC needs to be set to {}".format(utc)) + messages.append(f"UTC needs to be set to {utc}") ret["comment"] = ", ".join(messages) return ret @@ -102,7 +102,7 @@ def system(name, utc=True): if do_zone: if __salt__["timezone.set_zone"](name): ret["changes"]["timezone"] = name - messages.append("Set timezone {}".format(name)) + messages.append(f"Set timezone {name}") ret["result"] = True else: messages.append("Failed to set timezone") @@ -114,10 +114,10 @@ def system(name, utc=True): clock = "UTC" if __salt__["timezone.set_hwclock"](clock): ret["changes"]["utc"] = utc - messages.append("Set UTC to {}".format(utc)) + messages.append(f"Set UTC to {utc}") ret["result"] = True else: - messages.append("Failed to set UTC to {}".format(utc)) + messages.append(f"Failed to set UTC to {utc}") ret["result"] = False ret["comment"] = ", ".join(messages) diff --git a/salt/states/tls.py b/salt/states/tls.py index 9881505d124..9c0fc451711 100644 --- a/salt/states/tls.py +++ b/salt/states/tls.py @@ -30,7 +30,7 @@ def valid_certificate(name, weeks=0, days=0, hours=0, minutes=0, seconds=0): try: cert_info = __salt__["tls.cert_info"](name) except OSError as exc: - ret["comment"] = "{}".format(exc) + ret["comment"] = f"{exc}" ret["result"] = False log.error(ret["comment"]) return ret @@ -62,5 +62,5 @@ def valid_certificate(name, weeks=0, days=0, hours=0, minutes=0, seconds=0): return ret ret["result"] = True - ret["comment"] = "Certificate is valid for {}".format(delta_remaining) + ret["comment"] = f"Certificate is valid for {delta_remaining}" return ret diff --git a/salt/states/tomcat.py b/salt/states/tomcat.py index d4511911fd4..5b74573c143 100644 --- a/salt/states/tomcat.py +++ b/salt/states/tomcat.py @@ -142,7 +142,7 @@ def war_deployed( status = True # Gathered/specified new WAR version string - specified_ver = "version {}".format(version) if version else "no version" + specified_ver = f"version {version}" if version else "no version" # Determine what to do try: @@ -172,13 +172,13 @@ def war_deployed( name, specified_ver ) if webapps[name]["mode"] != "running": - ret["changes"]["start"] = "starting {}".format(name) + ret["changes"]["start"] = f"starting {name}" status = False else: return ret except Exception: # pylint: disable=broad-except deploy = True - ret["changes"]["deploy"] = "deployed {} with {}".format(name, specified_ver) + ret["changes"]["deploy"] = f"deployed {name} with {specified_ver}" # Test if __opts__["test"]: @@ -216,7 +216,7 @@ def war_deployed( if deploy_res.startswith("OK"): ret["result"] = True ret["comment"] = str(__salt__["tomcat.ls"](url, timeout)[name]) - ret["changes"]["deploy"] = "deployed {} with {}".format(name, specified_ver) + ret["changes"]["deploy"] = f"deployed {name} with {specified_ver}" else: ret["result"] = False ret["comment"] = deploy_res diff --git a/salt/states/trafficserver.py b/salt/states/trafficserver.py index c491f176bac..55edcd35836 100644 --- a/salt/states/trafficserver.py +++ b/salt/states/trafficserver.py @@ -209,7 +209,7 @@ def config(name, value): __salt__["trafficserver.set_config"](name, value) ret["result"] = True - ret["comment"] = "Configured {} to {}".format(name, value) + ret["comment"] = f"Configured {name} to {value}" return ret @@ -345,11 +345,11 @@ def offline(name, path): ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __opts__["test"]: - ret["comment"] = "Setting {} to offline".format(path) + ret["comment"] = f"Setting {path} to offline" return ret __salt__["trafficserver.offline"](path) ret["result"] = True - ret["comment"] = "Set {} as offline".format(path) + ret["comment"] = f"Set {path} as offline" return ret diff --git a/salt/states/tuned.py b/salt/states/tuned.py index 91759ddb76f..fb5bd832771 100644 --- a/salt/states/tuned.py +++ b/salt/states/tuned.py @@ -51,10 +51,10 @@ def profile(name): # test mode if __opts__["test"] is True: - ret["comment"] = 'The state of "{}" will be changed.'.format(current_state) + ret["comment"] = f'The state of "{current_state}" will be changed.' ret["changes"] = { "old": current_state, - "new": "Profile will be set to {}".format(profile), + "new": f"Profile will be set to {profile}", } # return None when testing @@ -66,7 +66,7 @@ def profile(name): new_state = __salt__["tuned.profile"](profile) # create the comment data structure - ret["comment"] = 'The state of "{}" was changed!'.format(profile) + ret["comment"] = f'The state of "{profile}" was changed!' # fill in the ret data structure ret["changes"] = { @@ -108,7 +108,7 @@ def off(name=None): # test mode if __opts__["test"] is True: - ret["comment"] = 'The state of "{}" will be changed.'.format(current_state) + ret["comment"] = f'The state of "{current_state}" will be changed.' ret["changes"] = { "old": current_state, "new": "Profile will be set to off", diff --git a/salt/states/uptime.py b/salt/states/uptime.py index 590d1017066..5c284eeb2f1 100644 --- a/salt/states/uptime.py +++ b/salt/states/uptime.py @@ -53,7 +53,7 @@ def monitored(name, **params): ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __salt__["uptime.check_exists"](name=name): ret["result"] = True - ret["comment"] = "URL {} is already monitored".format(name) + ret["comment"] = f"URL {name} is already monitored" ret["changes"] = {} return ret if not __opts__["test"]: @@ -65,7 +65,7 @@ def monitored(name, **params): ret["changes"] = {"url_monitored": url_monitored} else: ret["result"] = False - ret["comment"] = "Failed to add {} to uptime".format(name) + ret["comment"] = f"Failed to add {name} to uptime" ret["changes"] = {} else: msg = "URL {0} is going to be added to uptime" diff --git a/salt/states/user.py b/salt/states/user.py index 83693a809ac..5b968025772 100644 --- a/salt/states/user.py +++ b/salt/states/user.py @@ -577,14 +577,14 @@ def present( "name": name, "changes": {}, "result": True, - "comment": "User {} is present and up to date".format(name), + "comment": f"User {name} is present and up to date", } # the comma is used to separate field in GECOS, thus resulting into # salt adding the end of fullname each time this function is called for gecos_field in [fullname, roomnumber, workphone]: if isinstance(gecos_field, str) and "," in gecos_field: - ret["comment"] = "Unsupported char ',' in {}".format(gecos_field) + ret["comment"] = f"Unsupported char ',' in {gecos_field}" ret["result"] = False return ret @@ -676,7 +676,7 @@ def present( val = "XXX-REDACTED-XXX" elif key == "group" and not remove_groups: key = "ensure groups" - ret["comment"] += "{}: {}\n".format(key, val) + ret["comment"] += f"{key}: {val}\n" return ret # The user is present if "shadow.info" in __salt__: @@ -774,11 +774,9 @@ def present( # NOTE: list(changes) required here to avoid modifying dictionary # during iteration. for key in [ - x - for x in list(changes) - if x != "groups" and "user.ch{}".format(x) in __salt__ + x for x in list(changes) if x != "groups" and f"user.ch{x}" in __salt__ ]: - __salt__["user.ch{}".format(key)](name, changes.pop(key)) + __salt__[f"user.ch{key}"](name, changes.pop(key)) # Do group changes last if "groups" in changes: @@ -809,7 +807,7 @@ def present( if __grains__["kernel"] in ("OpenBSD", "FreeBSD") and lcpost != lcpre: ret["changes"]["loginclass"] = lcpost if ret["changes"]: - ret["comment"] = "Updated user {}".format(name) + ret["comment"] = f"Updated user {name}" changes = _changes( name, uid, @@ -849,7 +847,7 @@ def present( # first time we ran _changes(). if changes: - ret["comment"] = "These values could not be changed: {}".format(changes) + ret["comment"] = f"These values could not be changed: {changes}" ret["result"] = False return ret @@ -857,7 +855,7 @@ def present( # The user is not present, make it! if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} set to be added".format(name) + ret["comment"] = f"User {name} set to be added" return ret if groups and present_optgroups: groups.extend(present_optgroups) @@ -900,7 +898,7 @@ def present( } result = __salt__["user.add"](**params) if result is True: - ret["comment"] = "New user {} created".format(name) + ret["comment"] = f"New user {name} created" ret["changes"] = __salt__["user.info"](name) if not createhome: # pwd incorrectly reports presence of home @@ -926,7 +924,7 @@ def present( spost = __salt__["shadow.info"](name) if spost["passwd"] != "": ret["comment"] = ( - "User {} created but failed to empty password".format(name) + f"User {name} created but failed to empty password" ) ret["result"] = False ret["changes"]["password"] = "" @@ -1034,7 +1032,7 @@ def present( if isinstance(result, str): ret["comment"] = result else: - ret["comment"] = "Failed to create new user {}".format(name) + ret["comment"] = f"Failed to create new user {name}" ret["result"] = False return ret @@ -1062,7 +1060,7 @@ def absent(name, purge=False, force=False): # The user is present, make it not present if __opts__["test"]: ret["result"] = None - ret["comment"] = "User {} set for removal".format(name) + ret["comment"] = f"User {name} set for removal" return ret beforegroups = set(salt.utils.user.get_group_list(name)) ret["result"] = __salt__["user.delete"](name, purge, force) @@ -1070,14 +1068,14 @@ def absent(name, purge=False, force=False): if ret["result"]: ret["changes"] = {} for g in beforegroups - aftergroups: - ret["changes"]["{} group".format(g)] = "removed" + ret["changes"][f"{g} group"] = "removed" ret["changes"][name] = "removed" - ret["comment"] = "Removed user {}".format(name) + ret["comment"] = f"Removed user {name}" else: ret["result"] = False - ret["comment"] = "Failed to remove user {}".format(name) + ret["comment"] = f"Failed to remove user {name}" return ret - ret["comment"] = "User {} is not present".format(name) + ret["comment"] = f"User {name} is not present" return ret diff --git a/salt/states/vagrant.py b/salt/states/vagrant.py index 4210715f92e..93650d54de0 100644 --- a/salt/states/vagrant.py +++ b/salt/states/vagrant.py @@ -103,7 +103,7 @@ def _vagrant_call(node, function, section, comment, status_when_done=None, **kwa except (IndexError, SaltInvocationError, CommandExecutionError): pass try: - response = __salt__["vagrant.{}".format(function)](node, **kwargs) + response = __salt__[f"vagrant.{function}"](node, **kwargs) if isinstance(response, dict): response = response["name"] changed_nodes.append({"node": node, function: response}) @@ -170,7 +170,7 @@ def running(name, **kwargs): "name": name, "changes": {}, "result": True, - "comment": "{} is already running".format(name), + "comment": f"{name} is already running", } try: @@ -178,14 +178,14 @@ def running(name, **kwargs): if info[0]["state"] != "running": __salt__["vagrant.start"](name) ret["changes"][name] = "Machine started" - ret["comment"] = "Node {} started".format(name) + ret["comment"] = f"Node {name} started" except (SaltInvocationError, CommandExecutionError): # there was no viable existing machine to start ret, kwargs = _find_init_change(name, ret, **kwargs) kwargs["start"] = True __salt__["vagrant.init"](name, **kwargs) ret["changes"][name] = "Node defined and started" - ret["comment"] = "Node {} defined and started".format(name) + ret["comment"] = f"Node {name} defined and started" return ret @@ -272,7 +272,7 @@ def initialized(name, **kwargs): kwargs["start"] = False __salt__["vagrant.init"](name, **kwargs) ret["changes"][name] = "Node initialized" - ret["comment"] = "Node {} defined but not started.".format(name) + ret["comment"] = f"Node {name} defined but not started." return ret diff --git a/salt/states/vault.py b/salt/states/vault.py index 54de5b8f435..7239d20897d 100644 --- a/salt/states/vault.py +++ b/salt/states/vault.py @@ -41,7 +41,7 @@ def policy_present(name, rules): } """ - url = "v1/sys/policy/{}".format(name) + url = f"v1/sys/policy/{name}" response = __utils__["vault.make_request"]("GET", url) try: if response.status_code == 200: @@ -55,7 +55,7 @@ def policy_present(name, rules): "name": name, "changes": {}, "result": False, - "comment": "Failed to get policy: {}".format(e), + "comment": f"Failed to get policy: {e}", } @@ -69,14 +69,14 @@ def _create_new_policy(name, rules): } payload = {"rules": rules} - url = "v1/sys/policy/{}".format(name) + url = f"v1/sys/policy/{name}" response = __utils__["vault.make_request"]("PUT", url, json=payload) if response.status_code not in [200, 204]: return { "name": name, "changes": {}, "result": False, - "comment": "Failed to create policy: {}".format(response.reason), + "comment": f"Failed to create policy: {response.reason}", } return { @@ -108,14 +108,14 @@ def _handle_existing_policy(name, new_rules, existing_rules): payload = {"rules": new_rules} - url = "v1/sys/policy/{}".format(name) + url = f"v1/sys/policy/{name}" response = __utils__["vault.make_request"]("PUT", url, json=payload) if response.status_code not in [200, 204]: return { "name": name, "changes": {}, "result": False, - "comment": "Failed to change policy: {}".format(response.reason), + "comment": f"Failed to change policy: {response.reason}", } ret["result"] = True diff --git a/salt/states/victorops.py b/salt/states/victorops.py index 54cf5353a2c..f89265fe2cb 100644 --- a/salt/states/victorops.py +++ b/salt/states/victorops.py @@ -93,7 +93,7 @@ def create_event(name, message_type, routing_key="everyone", **kwargs): ret = {"name": name, "changes": {}, "result": None, "comment": ""} if __opts__["test"]: - ret["comment"] = "Need to create event: {}".format(name) + ret["comment"] = f"Need to create event: {name}" return ret res = __salt__["victorops.create_event"]( diff --git a/salt/states/virt.py b/salt/states/virt.py index 2565be0af4a..33f35b0d8c8 100644 --- a/salt/states/virt.py +++ b/salt/states/virt.py @@ -94,7 +94,7 @@ def keys(name, basepath="/etc/pki", **kwargs): # overriding anything existing pillar_kwargs = {} for key, value in kwargs.items(): - pillar_kwargs["ext_pillar_virt.{}".format(key)] = value + pillar_kwargs[f"ext_pillar_virt.{key}"] = value pillar = __salt__["pillar.ext"]({"libvirt": "_"}, pillar_kwargs) paths = { @@ -106,7 +106,7 @@ def keys(name, basepath="/etc/pki", **kwargs): } for key in paths: - p_key = "libvirt.{}.pem".format(key) + p_key = f"libvirt.{key}.pem" if p_key not in pillar: continue if not os.path.exists(os.path.dirname(paths[key])): @@ -127,9 +127,7 @@ def keys(name, basepath="/etc/pki", **kwargs): else: for key in ret["changes"]: with salt.utils.files.fopen(paths[key], "w+") as fp_: - fp_.write( - salt.utils.stringutils.to_str(pillar["libvirt.{}.pem".format(key)]) - ) + fp_.write(salt.utils.stringutils.to_str(pillar[f"libvirt.{key}.pem"])) ret["comment"] = "Updated libvirt certs and keys" @@ -145,7 +143,7 @@ def _virt_call( connection=None, username=None, password=None, - **kwargs + **kwargs, ): """ Helper to call the virt functions. Wildcards supported. @@ -173,12 +171,12 @@ def _virt_call( if action_needed: response = True if not __opts__["test"]: - response = __salt__["virt.{}".format(function)]( + response = __salt__[f"virt.{function}"]( targeted_domain, connection=connection, username=username, password=password, - **kwargs + **kwargs, ) if isinstance(response, dict): response = response["name"] @@ -676,14 +674,12 @@ def defined( ret["changes"][name] = status if not status.get("definition"): ret["changes"] = {} - ret["comment"] = "Domain {} unchanged".format(name) + ret["comment"] = f"Domain {name} unchanged" ret["result"] = True elif status.get("errors"): - ret["comment"] = ( - "Domain {} updated with live update(s) failures".format(name) - ) + ret["comment"] = f"Domain {name} updated with live update(s) failures" else: - ret["comment"] = "Domain {} updated".format(name) + ret["comment"] = f"Domain {name} updated" else: if not __opts__["test"]: __salt__["virt.init"]( @@ -717,7 +713,7 @@ def defined( host_devices=host_devices, ) ret["changes"][name] = {"definition": True} - ret["comment"] = "Domain {} defined".format(name) + ret["comment"] = f"Domain {name} defined" except libvirt.libvirtError as err: # Something bad happened when defining / updating the VM, report it ret["comment"] = str(err) @@ -1049,7 +1045,7 @@ def running( username=username, password=password, ) - comment = "Domain {} started".format(name) + comment = f"Domain {name} started" if not ret["comment"].endswith("unchanged"): comment = "{} and started".format(ret["comment"]) ret["comment"] = comment @@ -1057,7 +1053,7 @@ def running( ret["changes"][name] = {} ret["changes"][name]["started"] = True elif not changed: - ret["comment"] = "Domain {} exists and is running".format(name) + ret["comment"] = f"Domain {name} exists and is running" except libvirt.libvirtError as err: # Something bad happened when starting / updating the VM, report it @@ -1206,7 +1202,7 @@ def reverted( try: domains = fnmatch.filter(__salt__["virt.list_domains"](), name) if not domains: - ret["comment"] = 'No domains found for criteria "{}"'.format(name) + ret["comment"] = f'No domains found for criteria "{name}"' else: ignored_domains = list() if len(domains) > 1: @@ -1515,10 +1511,10 @@ def network_defined( password=password, ) action = ", autostart flag changed" if needs_autostart else "" - ret["changes"][name] = "Network updated{}".format(action) - ret["comment"] = "Network {} updated{}".format(name, action) + ret["changes"][name] = f"Network updated{action}" + ret["comment"] = f"Network {name} updated{action}" else: - ret["comment"] = "Network {} unchanged".format(name) + ret["comment"] = f"Network {name} unchanged" ret["result"] = True else: needs_autostart = autostart @@ -1546,10 +1542,10 @@ def network_defined( ) if needs_autostart: ret["changes"][name] = "Network defined, marked for autostart" - ret["comment"] = "Network {} defined, marked for autostart".format(name) + ret["comment"] = f"Network {name} defined, marked for autostart" else: ret["changes"][name] = "Network defined" - ret["comment"] = "Network {} defined".format(name) + ret["comment"] = f"Network {name} defined" if needs_autostart: if not __opts__["test"]: @@ -1974,15 +1970,13 @@ def pool_defined( action = ", built" action = ( - "{}, autostart flag changed".format(action) - if needs_autostart - else action + f"{action}, autostart flag changed" if needs_autostart else action ) - ret["changes"][name] = "Pool updated{}".format(action) - ret["comment"] = "Pool {} updated{}".format(name, action) + ret["changes"][name] = f"Pool updated{action}" + ret["comment"] = f"Pool {name} updated{action}" else: - ret["comment"] = "Pool {} unchanged".format(name) + ret["comment"] = f"Pool {name} unchanged" ret["result"] = True else: needs_autostart = autostart @@ -2025,10 +2019,10 @@ def pool_defined( ) if needs_autostart: ret["changes"][name] = "Pool defined, marked for autostart" - ret["comment"] = "Pool {} defined, marked for autostart".format(name) + ret["comment"] = f"Pool {name} defined, marked for autostart" else: ret["changes"][name] = "Pool defined" - ret["comment"] = "Pool {} defined".format(name) + ret["comment"] = f"Pool {name} defined" if needs_autostart: if not __opts__["test"]: @@ -2146,7 +2140,7 @@ def pool_running( username=username, password=password, ) - action = "built, {}".format(action) + action = f"built, {action}" else: action = "already running" result = True @@ -2160,16 +2154,16 @@ def pool_running( password=password, ) - comment = "Pool {}".format(name) + comment = f"Pool {name}" change = "Pool" if name in ret["changes"]: comment = "{},".format(ret["comment"]) change = "{},".format(ret["changes"][name]) if action != "already running": - ret["changes"][name] = "{} {}".format(change, action) + ret["changes"][name] = f"{change} {action}" - ret["comment"] = "{} {}".format(comment, action) + ret["comment"] = f"{comment} {action}" ret["result"] = result except libvirt.libvirtError as err: @@ -2301,9 +2295,9 @@ def pool_deleted(name, purge=False, connection=None, username=None, password=Non info[name]["type"], ", ".join(unsupported) ) else: - ret["comment"] = "Storage pool could not be found: {}".format(name) + ret["comment"] = f"Storage pool could not be found: {name}" except libvirt.libvirtError as err: - ret["comment"] = "Failed deleting pool: {}".format(err.get_error_message()) + ret["comment"] = f"Failed deleting pool: {err.get_error_message()}" ret["result"] = False return ret @@ -2389,7 +2383,7 @@ def volume_defined( connection=connection, username=username, password=password ) if pool not in pools: - raise SaltInvocationError("Storage pool {} not existing".format(pool)) + raise SaltInvocationError(f"Storage pool {pool} not existing") vol_infos = ( __salt__["virt.volume_infos"]( @@ -2449,7 +2443,7 @@ def volume_defined( ret["comment"] = "Volume {} {}defined in pool {}".format( name, test_comment, pool ) - ret["changes"] = {"{}/{}".format(pool, name): {"old": "", "new": "defined"}} + ret["changes"] = {f"{pool}/{name}": {"old": "", "new": "defined"}} except libvirt.libvirtError as err: ret["comment"] = err.get_error_message() ret["result"] = False diff --git a/salt/states/virtualenv_mod.py b/salt/states/virtualenv_mod.py index 729e16a8e28..957f44265bc 100644 --- a/salt/states/virtualenv_mod.py +++ b/salt/states/virtualenv_mod.py @@ -57,7 +57,7 @@ def managed( pip_cache_dir=None, process_dependency_links=False, no_binary=None, - **kwargs + **kwargs, ): """ Create a virtualenv and optionally manage it with pip @@ -171,21 +171,19 @@ def managed( # If it already exists, grab the version for posterity if venv_exists and clear: ret["changes"]["cleared_packages"] = __salt__["pip.freeze"](bin_env=name) - ret["changes"]["old"] = __salt__["cmd.run_stderr"]( - "{} -V".format(venv_py) - ).strip("\n") + ret["changes"]["old"] = __salt__["cmd.run_stderr"](f"{venv_py} -V").strip("\n") # Create (or clear) the virtualenv if __opts__["test"]: if venv_exists and clear: ret["result"] = None - ret["comment"] = "Virtualenv {} is set to be cleared".format(name) + ret["comment"] = f"Virtualenv {name} is set to be cleared" return ret if venv_exists and not clear: - ret["comment"] = "Virtualenv {} is already created".format(name) + ret["comment"] = f"Virtualenv {name} is already created" return ret ret["result"] = None - ret["comment"] = "Virtualenv {} is set to be created".format(name) + ret["comment"] = f"Virtualenv {name} is set to be created" return ret if not venv_exists or (venv_exists and clear): @@ -202,11 +200,11 @@ def managed( prompt=prompt, user=user, use_vt=use_vt, - **kwargs + **kwargs, ) except CommandNotFoundError as err: ret["result"] = False - ret["comment"] = "Failed to create virtualenv: {}".format(err) + ret["comment"] = f"Failed to create virtualenv: {err}" return ret if venv_ret["retcode"] != 0: @@ -215,9 +213,7 @@ def managed( return ret ret["result"] = True - ret["changes"]["new"] = __salt__["cmd.run_stderr"]( - "{} -V".format(venv_py) - ).strip("\n") + ret["changes"]["new"] = __salt__["cmd.run_stderr"](f"{venv_py} -V").strip("\n") if clear: ret["comment"] = "Cleared existing virtualenv" @@ -328,7 +324,7 @@ def managed( env_vars=env_vars, no_cache_dir=pip_no_cache_dir, cache_dir=pip_cache_dir, - **kwargs + **kwargs, ) ret["result"] &= pip_ret["retcode"] == 0 if pip_ret["retcode"] > 0: diff --git a/salt/states/webutil.py b/salt/states/webutil.py index d988c4e30e0..d83190f8ac9 100644 --- a/salt/states/webutil.py +++ b/salt/states/webutil.py @@ -66,9 +66,7 @@ def user_exists( ret = {"name": name, "changes": {}, "comment": "", "result": None} if __salt__["file.file_exists"](htpasswd_file): - exists = ( - __salt__["file.grep"](htpasswd_file, "^{}:".format(name))["retcode"] == 0 - ) + exists = __salt__["file.grep"](htpasswd_file, f"^{name}:")["retcode"] == 0 else: exists = False @@ -126,7 +124,7 @@ def user_absent(name, htpasswd_file=None, runas=None): """ ret = {"name": name, "changes": {}, "comment": "", "result": None} - exists = __salt__["file.grep"](htpasswd_file, "^{}:".format(name))["retcode"] == 0 + exists = __salt__["file.grep"](htpasswd_file, f"^{name}:")["retcode"] == 0 if not exists: if __opts__["test"]: diff --git a/salt/states/win_certutil.py b/salt/states/win_certutil.py index 392139d8a49..fa3c78e4af3 100644 --- a/salt/states/win_certutil.py +++ b/salt/states/win_certutil.py @@ -61,38 +61,38 @@ def add_store(name, store, saltenv="base"): cert_file = __salt__["cp.cache_file"](name, saltenv) if cert_file is False: - ret["comment"] = "Certificate file not found: {}".format(name) + ret["comment"] = f"Certificate file not found: {name}" ret["result"] = False return ret cert_serial = __salt__["certutil.get_cert_serial"](name) if cert_serial is None: - ret["comment"] = "Invalid certificate file: {}".format(name) + ret["comment"] = f"Invalid certificate file: {name}" ret["result"] = False return ret old_serials = __salt__["certutil.get_stored_cert_serials"](store=store) if cert_serial in old_serials: - ret["comment"] = "Certificate already present: {}".format(name) + ret["comment"] = f"Certificate already present: {name}" return ret if __opts__["test"]: - ret["comment"] = "Certificate will be added: {}".format(name) + ret["comment"] = f"Certificate will be added: {name}" ret["result"] = None return ret retcode = __salt__["certutil.add_store"](name, store, retcode=True) if retcode != 0: - ret["comment"] = "Error adding certificate: {}".format(name) + ret["comment"] = f"Error adding certificate: {name}" ret["result"] = False return ret new_serials = __salt__["certutil.get_stored_cert_serials"](store=store) if cert_serial in new_serials: ret["changes"]["added"] = name - ret["comment"] = "Added certificate: {}".format(name) + ret["comment"] = f"Added certificate: {name}" else: - ret["comment"] = "Failed to add certificate: {}".format(name) + ret["comment"] = f"Failed to add certificate: {name}" ret["result"] = False return ret @@ -131,38 +131,38 @@ def del_store(name, store, saltenv="base"): cert_file = __salt__["cp.cache_file"](name, saltenv) if cert_file is False: - ret["comment"] = "Certificate file not found: {}".format(name) + ret["comment"] = f"Certificate file not found: {name}" ret["result"] = False return ret cert_serial = __salt__["certutil.get_cert_serial"](name) if cert_serial is None: - ret["comment"] = "Invalid certificate file: {}".format(name) + ret["comment"] = f"Invalid certificate file: {name}" ret["result"] = False return ret old_serials = __salt__["certutil.get_stored_cert_serials"](store=store) if cert_serial not in old_serials: - ret["comment"] = "Certificate already absent: {}".format(name) + ret["comment"] = f"Certificate already absent: {name}" return ret if __opts__["test"]: - ret["comment"] = "Certificate will be removed: {}".format(name) + ret["comment"] = f"Certificate will be removed: {name}" ret["result"] = None return ret retcode = __salt__["certutil.del_store"](name, store, retcode=True) if retcode != 0: - ret["comment"] = "Error removing certificate: {}".format(name) + ret["comment"] = f"Error removing certificate: {name}" ret["result"] = False return ret new_serials = __salt__["certutil.get_stored_cert_serials"](store=store) if cert_serial not in new_serials: ret["changes"]["removed"] = name - ret["comment"] = "Removed certificate: {}".format(name) + ret["comment"] = f"Removed certificate: {name}" else: - ret["comment"] = "Failed to remove certificate: {}".format(name) + ret["comment"] = f"Failed to remove certificate: {name}" ret["result"] = False return ret diff --git a/salt/states/win_dism.py b/salt/states/win_dism.py index 486ff9720c0..b48aafdb703 100644 --- a/salt/states/win_dism.py +++ b/salt/states/win_dism.py @@ -64,11 +64,11 @@ def capability_installed( old = __salt__["dism.installed_capabilities"]() if name in old: - ret["comment"] = "The capability {} is already installed".format(name) + ret["comment"] = f"The capability {name} is already installed" return ret if __opts__["test"]: - ret["changes"]["capability"] = "{} will be installed".format(name) + ret["changes"]["capability"] = f"{name} will be installed" ret["result"] = None return ret @@ -83,7 +83,7 @@ def capability_installed( changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Installed {}".format(name) + ret["comment"] = f"Installed {name}" ret["changes"] = status ret["changes"]["capability"] = changes @@ -117,11 +117,11 @@ def capability_removed(name, image=None, restart=False): old = __salt__["dism.installed_capabilities"]() if name not in old: - ret["comment"] = "The capability {} is already removed".format(name) + ret["comment"] = f"The capability {name} is already removed" return ret if __opts__["test"]: - ret["changes"]["capability"] = "{} will be removed".format(name) + ret["changes"]["capability"] = f"{name} will be removed" ret["result"] = None return ret @@ -136,7 +136,7 @@ def capability_removed(name, image=None, restart=False): changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Removed {}".format(name) + ret["comment"] = f"Removed {name}" ret["changes"] = status ret["changes"]["capability"] = changes @@ -185,11 +185,11 @@ def feature_installed( old = __salt__["dism.installed_features"]() if name in old: - ret["comment"] = "The feature {} is already installed".format(name) + ret["comment"] = f"The feature {name} is already installed" return ret if __opts__["test"]: - ret["changes"]["feature"] = "{} will be installed".format(name) + ret["changes"]["feature"] = f"{name} will be installed" ret["result"] = None return ret @@ -206,7 +206,7 @@ def feature_installed( changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Installed {}".format(name) + ret["comment"] = f"Installed {name}" ret["changes"] = status ret["changes"]["feature"] = changes @@ -243,11 +243,11 @@ def feature_removed(name, remove_payload=False, image=None, restart=False): old = __salt__["dism.installed_features"]() if name not in old: - ret["comment"] = "The feature {} is already removed".format(name) + ret["comment"] = f"The feature {name} is already removed" return ret if __opts__["test"]: - ret["changes"]["feature"] = "{} will be removed".format(name) + ret["changes"]["feature"] = f"{name} will be removed" ret["result"] = None return ret @@ -262,7 +262,7 @@ def feature_removed(name, remove_payload=False, image=None, restart=False): changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Removed {}".format(name) + ret["comment"] = f"Removed {name}" ret["changes"] = status ret["changes"]["feature"] = changes @@ -303,7 +303,7 @@ def package_installed( ret["result"] = None else: ret["result"] = False - ret["comment"] = "Package path {} does not exist".format(name) + ret["comment"] = f"Package path {name} does not exist" return ret old = __salt__["dism.installed_packages"]() @@ -318,7 +318,7 @@ def package_installed( return ret if __opts__["test"]: - ret["changes"]["package"] = "{} will be installed".format(name) + ret["changes"]["package"] = f"{name} will be installed" ret["result"] = None return ret @@ -335,7 +335,7 @@ def package_installed( changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Installed {}".format(name) + ret["comment"] = f"Installed {name}" ret["changes"] = status ret["changes"]["package"] = changes @@ -379,7 +379,7 @@ def package_removed(name, image=None, restart=False): ret["result"] = None else: ret["result"] = False - ret["comment"] = "Package path {} does not exist".format(name) + ret["comment"] = f"Package path {name} does not exist" return ret old = __salt__["dism.installed_packages"]() @@ -393,11 +393,11 @@ def package_removed(name, image=None, restart=False): "Package Identity" not in package_info or package_info["Package Identity"] not in old ): - ret["comment"] = "The package {} is already removed".format(name) + ret["comment"] = f"The package {name} is already removed" return ret if __opts__["test"]: - ret["changes"]["package"] = "{} will be removed".format(name) + ret["changes"]["package"] = f"{name} will be removed" ret["result"] = None return ret @@ -412,7 +412,7 @@ def package_removed(name, image=None, restart=False): changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Removed {}".format(name) + ret["comment"] = f"Removed {name}" ret["changes"] = status ret["changes"]["package"] = changes @@ -454,11 +454,11 @@ def kb_removed(name, image=None, restart=False): # If pkg_name is None, the package is not installed if pkg_name is None: - ret["comment"] = "{} is not installed".format(name) + ret["comment"] = f"{name} is not installed" return ret if __opts__["test"]: - ret["changes"]["package"] = "{} will be removed".format(name) + ret["changes"]["package"] = f"{name} will be removed" ret["result"] = None return ret @@ -477,7 +477,7 @@ def kb_removed(name, image=None, restart=False): changes = salt.utils.data.compare_lists(old, new) if changes: - ret["comment"] = "Removed {}".format(name) + ret["comment"] = f"Removed {name}" ret["changes"] = status ret["changes"]["package"] = changes diff --git a/salt/states/win_dns_client.py b/salt/states/win_dns_client.py index 48d045bbd76..dcd56a4eada 100644 --- a/salt/states/win_dns_client.py +++ b/salt/states/win_dns_client.py @@ -53,7 +53,7 @@ def dns_exists(name, servers=None, interface="Local Area Connection", replace=Fa # Do nothing is already configured configured_list = __salt__["win_dns_client.get_dns_servers"](interface) if configured_list == servers: - ret["comment"] = "{} are already configured".format(servers) + ret["comment"] = f"{servers} are already configured" ret["changes"] = {} ret["result"] = True return ret @@ -90,7 +90,7 @@ def dns_exists(name, servers=None, interface="Local Area Connection", replace=Fa else: if not __salt__["win_dns_client.rm_dns"](server, interface): ret["comment"] = ( - "Failed to remove {} from DNS server list".format(server) + f"Failed to remove {server} from DNS server list" ) ret["result"] = False return ret @@ -109,7 +109,7 @@ def dns_dhcp(name, interface="Local Area Connection"): # Check the config config = __salt__["win_dns_client.get_dns_config"](interface) if config == "dhcp": - ret["comment"] = "{} already configured with DNS from DHCP".format(interface) + ret["comment"] = f"{interface} already configured with DNS from DHCP" return ret else: ret["changes"] = {"dns": "configured from DHCP"} @@ -208,7 +208,7 @@ def primary_suffix(name, suffix=None, updates=False): return ret # Changes to update policy needed else: - ret["comment"] = "{} suffix updates".format(updates_operation) + ret["comment"] = f"{updates_operation} suffix updates" ret["changes"] = { "old": {"updates": reg_data["updates"]["old"]}, "new": {"updates": reg_data["updates"]["new"]}, @@ -234,7 +234,7 @@ def primary_suffix(name, suffix=None, updates=False): } # No changes to updates policy needed else: - ret["comment"] = "Updated primary DNS suffix ({})".format(suffix) + ret["comment"] = f"Updated primary DNS suffix ({suffix})" ret["changes"] = { "old": {"suffix": reg_data["suffix"]["old"]}, "new": {"suffix": reg_data["suffix"]["new"]}, diff --git a/salt/states/win_firewall.py b/salt/states/win_firewall.py index 959021ede74..151519f8ee0 100644 --- a/salt/states/win_firewall.py +++ b/salt/states/win_firewall.py @@ -52,12 +52,12 @@ def disabled(name="allprofiles"): # Make sure the profile name is valid if name not in profile_map: - raise SaltInvocationError("Invalid profile name: {}".format(name)) + raise SaltInvocationError(f"Invalid profile name: {name}") current_config = __salt__["firewall.get_config"]() if name != "allprofiles" and profile_map[name] not in current_config: ret["result"] = False - ret["comment"] = "Profile {} does not exist in firewall.get_config".format(name) + ret["comment"] = f"Profile {name} does not exist in firewall.get_config" return ret for key in current_config: @@ -83,7 +83,7 @@ def disabled(name="allprofiles"): if name == "allprofiles": msg = "All the firewall profiles are disabled" else: - msg = "Firewall profile {} is disabled".format(name) + msg = f"Firewall profile {name} is disabled" ret["comment"] = msg return ret @@ -211,12 +211,12 @@ def enabled(name="allprofiles"): # Make sure the profile name is valid if name not in profile_map: - raise SaltInvocationError("Invalid profile name: {}".format(name)) + raise SaltInvocationError(f"Invalid profile name: {name}") current_config = __salt__["firewall.get_config"]() if name != "allprofiles" and profile_map[name] not in current_config: ret["result"] = False - ret["comment"] = "Profile {} does not exist in firewall.get_config".format(name) + ret["comment"] = f"Profile {name} does not exist in firewall.get_config" return ret for key in current_config: @@ -242,7 +242,7 @@ def enabled(name="allprofiles"): if name == "allprofiles": msg = "All the firewall profiles are enabled" else: - msg = "Firewall profile {} is enabled".format(name) + msg = f"Firewall profile {name} is enabled" ret["comment"] = msg return ret diff --git a/salt/states/win_iis.py b/salt/states/win_iis.py index 4c19e823e77..1f8c6a80d61 100644 --- a/salt/states/win_iis.py +++ b/salt/states/win_iis.py @@ -84,13 +84,13 @@ def deployed( current_sites = __salt__["win_iis.list_sites"]() if name in current_sites: - ret["comment"] = "Site already present: {}".format(name) + ret["comment"] = f"Site already present: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Site will be created: {}".format(name) + ret["comment"] = f"Site will be created: {name}" ret["changes"] = {"old": None, "new": name} else: - ret["comment"] = "Created site: {}".format(name) + ret["comment"] = f"Created site: {name}" ret["changes"] = {"old": None, "new": name} ret["result"] = __salt__["win_iis.create_site"]( name, sourcepath, apppool, hostheader, ipaddress, port, protocol @@ -118,13 +118,13 @@ def remove_site(name): current_sites = __salt__["win_iis.list_sites"]() if name not in current_sites: - ret["comment"] = "Site has already been removed: {}".format(name) + ret["comment"] = f"Site has already been removed: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Site will be removed: {}".format(name) + ret["comment"] = f"Site will be removed: {name}" ret["changes"] = {"old": name, "new": None} else: - ret["comment"] = "Removed site: {}".format(name) + ret["comment"] = f"Removed site: {name}" ret["changes"] = {"old": name, "new": None} ret["result"] = __salt__["win_iis.remove_site"](name) return ret @@ -176,13 +176,13 @@ def create_binding( current_bindings = __salt__["win_iis.list_bindings"](site) if binding_info in current_bindings: - ret["comment"] = "Binding already present: {}".format(binding_info) + ret["comment"] = f"Binding already present: {binding_info}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Binding will be created: {}".format(binding_info) + ret["comment"] = f"Binding will be created: {binding_info}" ret["changes"] = {"old": None, "new": binding_info} else: - ret["comment"] = "Created binding: {}".format(binding_info) + ret["comment"] = f"Created binding: {binding_info}" ret["changes"] = {"old": None, "new": binding_info} ret["result"] = __salt__["win_iis.create_binding"]( site, hostheader, ipaddress, port, protocol, sslflags @@ -224,13 +224,13 @@ def remove_binding(name, site, hostheader="", ipaddress="*", port=80): current_bindings = __salt__["win_iis.list_bindings"](site) if binding_info not in current_bindings: - ret["comment"] = "Binding has already been removed: {}".format(binding_info) + ret["comment"] = f"Binding has already been removed: {binding_info}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Binding will be removed: {}".format(binding_info) + ret["comment"] = f"Binding will be removed: {binding_info}" ret["changes"] = {"old": binding_info, "new": None} else: - ret["comment"] = "Removed binding: {}".format(binding_info) + ret["comment"] = f"Removed binding: {binding_info}" ret["changes"] = {"old": binding_info, "new": None} ret["result"] = __salt__["win_iis.remove_binding"]( site, hostheader, ipaddress, port @@ -286,7 +286,7 @@ def create_cert_binding(name, site, hostheader="", ipaddress="*", port=443, sslf current_name = current_cert_bindings[binding_info]["certificatehash"] if name == current_name: - ret["comment"] = "Certificate binding already present: {}".format(name) + ret["comment"] = f"Certificate binding already present: {name}" ret["result"] = True return ret ret["comment"] = ( @@ -295,10 +295,10 @@ def create_cert_binding(name, site, hostheader="", ipaddress="*", port=443, sslf ) ret["result"] = False elif __opts__["test"]: - ret["comment"] = "Certificate binding will be created: {}".format(name) + ret["comment"] = f"Certificate binding will be created: {name}" ret["changes"] = {"old": None, "new": name} else: - ret["comment"] = "Created certificate binding: {}".format(name) + ret["comment"] = f"Created certificate binding: {name}" ret["changes"] = {"old": None, "new": name} ret["result"] = __salt__["win_iis.create_cert_binding"]( name, site, hostheader, ipaddress, port, sslflags @@ -350,16 +350,16 @@ def remove_cert_binding(name, site, hostheader="", ipaddress="*", port=443): current_cert_bindings = __salt__["win_iis.list_cert_bindings"](site) if binding_info not in current_cert_bindings: - ret["comment"] = "Certificate binding has already been removed: {}".format(name) + ret["comment"] = f"Certificate binding has already been removed: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Certificate binding will be removed: {}".format(name) + ret["comment"] = f"Certificate binding will be removed: {name}" ret["changes"] = {"old": name, "new": None} else: current_name = current_cert_bindings[binding_info]["certificatehash"] if name == current_name: - ret["comment"] = "Removed certificate binding: {}".format(name) + ret["comment"] = f"Removed certificate binding: {name}" ret["changes"] = {"old": name, "new": None} ret["result"] = __salt__["win_iis.remove_cert_binding"]( name, site, hostheader, ipaddress, port @@ -393,13 +393,13 @@ def create_apppool(name): current_apppools = __salt__["win_iis.list_apppools"]() if name in current_apppools: - ret["comment"] = "Application pool already present: {}".format(name) + ret["comment"] = f"Application pool already present: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Application pool will be created: {}".format(name) + ret["comment"] = f"Application pool will be created: {name}" ret["changes"] = {"old": None, "new": name} else: - ret["comment"] = "Created application pool: {}".format(name) + ret["comment"] = f"Created application pool: {name}" ret["changes"] = {"old": None, "new": name} ret["result"] = __salt__["win_iis.create_apppool"](name) return ret @@ -426,13 +426,13 @@ def remove_apppool(name): current_apppools = __salt__["win_iis.list_apppools"]() if name not in current_apppools: - ret["comment"] = "Application pool has already been removed: {}".format(name) + ret["comment"] = f"Application pool has already been removed: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Application pool will be removed: {}".format(name) + ret["comment"] = f"Application pool will be removed: {name}" ret["changes"] = {"old": name, "new": None} else: - ret["comment"] = "Removed application pool: {}".format(name) + ret["comment"] = f"Removed application pool: {name}" ret["changes"] = {"old": name, "new": None} ret["result"] = __salt__["win_iis.remove_apppool"](name) return ret @@ -605,13 +605,13 @@ def create_app(name, site, sourcepath, apppool=None): current_apps = __salt__["win_iis.list_apps"](site) if name in current_apps: - ret["comment"] = "Application already present: {}".format(name) + ret["comment"] = f"Application already present: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Application will be created: {}".format(name) + ret["comment"] = f"Application will be created: {name}" ret["changes"] = {"old": None, "new": name} else: - ret["comment"] = "Created application: {}".format(name) + ret["comment"] = f"Created application: {name}" ret["changes"] = {"old": None, "new": name} ret["result"] = __salt__["win_iis.create_app"](name, site, sourcepath, apppool) return ret @@ -638,13 +638,13 @@ def remove_app(name, site): current_apps = __salt__["win_iis.list_apps"](site) if name not in current_apps: - ret["comment"] = "Application has already been removed: {}".format(name) + ret["comment"] = f"Application has already been removed: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Application will be removed: {}".format(name) + ret["comment"] = f"Application will be removed: {name}" ret["changes"] = {"old": name, "new": None} else: - ret["comment"] = "Removed application: {}".format(name) + ret["comment"] = f"Removed application: {name}" ret["changes"] = {"old": name, "new": None} ret["result"] = __salt__["win_iis.remove_app"](name, site) return ret @@ -691,13 +691,13 @@ def create_vdir(name, site, sourcepath, app="/"): current_vdirs = __salt__["win_iis.list_vdirs"](site, app) if name in current_vdirs: - ret["comment"] = "Virtual directory already present: {}".format(name) + ret["comment"] = f"Virtual directory already present: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Virtual directory will be created: {}".format(name) + ret["comment"] = f"Virtual directory will be created: {name}" ret["changes"] = {"old": None, "new": name} else: - ret["comment"] = "Created virtual directory: {}".format(name) + ret["comment"] = f"Created virtual directory: {name}" ret["changes"] = {"old": None, "new": name} ret["result"] = __salt__["win_iis.create_vdir"](name, site, sourcepath, app) @@ -736,13 +736,13 @@ def remove_vdir(name, site, app="/"): current_vdirs = __salt__["win_iis.list_vdirs"](site, app) if name not in current_vdirs: - ret["comment"] = "Virtual directory has already been removed: {}".format(name) + ret["comment"] = f"Virtual directory has already been removed: {name}" ret["result"] = True elif __opts__["test"]: - ret["comment"] = "Virtual directory will be removed: {}".format(name) + ret["comment"] = f"Virtual directory will be removed: {name}" ret["changes"] = {"old": name, "new": None} else: - ret["comment"] = "Removed virtual directory: {}".format(name) + ret["comment"] = f"Removed virtual directory: {name}" ret["changes"] = {"old": name, "new": None} ret["result"] = __salt__["win_iis.remove_vdir"](name, site, app) diff --git a/salt/states/win_lgpo.py b/salt/states/win_lgpo.py index 125b1e9e895..669a3d44dae 100644 --- a/salt/states/win_lgpo.py +++ b/salt/states/win_lgpo.py @@ -429,7 +429,7 @@ def set_( ) deprecation_comments.append(msg) else: - msg = "Invalid element name: {}".format(e_name) + msg = f"Invalid element name: {e_name}" ret["comment"] = "\n".join( [ret["comment"], msg] ).strip() @@ -526,7 +526,7 @@ def set_( ) policy_changes.append(p_name) else: - msg = '"{}" is already set'.format(p_name) + msg = f'"{p_name}" is already set' log.debug(msg) else: policy_changes.append(p_name) diff --git a/salt/states/win_lgpo_reg.py b/salt/states/win_lgpo_reg.py index 7bd3919b350..1a01ea17c0f 100644 --- a/salt/states/win_lgpo_reg.py +++ b/salt/states/win_lgpo_reg.py @@ -252,7 +252,7 @@ def value_disabled(name, key, policy_class="Machine"): old = _get_current(key=key, name=name, policy_class=policy_class) - pol_correct = old["pol"].get("data", "") == "**del.{}".format(name) + pol_correct = old["pol"].get("data", "") == f"**del.{name}" reg_correct = old["reg"] == {} if pol_correct and reg_correct: @@ -274,7 +274,7 @@ def value_disabled(name, key, policy_class="Machine"): new = _get_current(key=key, name=name, policy_class=policy_class) - pol_correct = new["pol"].get("data", "") == "**del.{}".format(name) + pol_correct = new["pol"].get("data", "") == f"**del.{name}" reg_correct = new["reg"] == {} if pol_correct and reg_correct: diff --git a/salt/states/win_network.py b/salt/states/win_network.py index b0549ba6dab..c35ee8ed6ad 100644 --- a/salt/states/win_network.py +++ b/salt/states/win_network.py @@ -137,7 +137,7 @@ def _validate(dns_proto, dns_servers, ip_proto, ip_addrs, gateway): # Validate default gateway if gateway is not None: if not salt.utils.validate.net.ipv4_addr(gateway): - errors.append("Gateway IP {} is invalid".format(gateway)) + errors.append(f"Gateway IP {gateway} is invalid") return errors @@ -198,7 +198,7 @@ def managed( ip_addrs=None, gateway=None, enabled=True, - **kwargs + **kwargs, ): """ Ensure that the named interface is configured properly. @@ -262,7 +262,7 @@ def managed( "name": name, "changes": {}, "result": True, - "comment": "Interface '{}' is up to date".format(name), + "comment": f"Interface '{name}' is up to date", } dns_proto = str(dns_proto).lower() @@ -296,11 +296,11 @@ def managed( if currently_enabled: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Interface '{}' will be disabled".format(name) + ret["comment"] = f"Interface '{name}' will be disabled" else: ret["result"] = __salt__["ip.disable"](name) if not ret["result"]: - ret["comment"] = "Failed to disable interface '{}'".format(name) + ret["comment"] = f"Failed to disable interface '{name}'" else: ret["comment"] += " (already disabled)" return ret @@ -308,12 +308,12 @@ def managed( if not currently_enabled: if __opts__["test"]: ret["result"] = None - ret["comment"] = "Interface '{}' will be enabled".format(name) + ret["comment"] = f"Interface '{name}' will be enabled" else: if not __salt__["ip.enable"](name): ret["result"] = False ret["comment"] = ( - "Failed to enable interface '{}' to make changes".format(name) + f"Failed to enable interface '{name}' to make changes" ) return ret @@ -331,7 +331,7 @@ def managed( if not old: ret["result"] = False ret["comment"] = ( - "Unable to get current configuration for interface '{}'".format(name) + f"Unable to get current configuration for interface '{name}'" ) return ret @@ -432,6 +432,6 @@ def managed( ) else: ret["comment"] = ( - "Successfully updated configuration for interface '{}'".format(name) + f"Successfully updated configuration for interface '{name}'" ) return ret diff --git a/salt/states/win_path.py b/salt/states/win_path.py index 5463cacfdcd..8b3d76ff391 100644 --- a/salt/states/win_path.py +++ b/salt/states/win_path.py @@ -35,21 +35,21 @@ def absent(name): ret = {"name": name, "result": True, "changes": {}, "comment": ""} if not __salt__["win_path.exists"](name): - ret["comment"] = "{} is not in the PATH".format(name) + ret["comment"] = f"{name} is not in the PATH" return ret if __opts__["test"]: - ret["comment"] = "{} would be removed from the PATH".format(name) + ret["comment"] = f"{name} would be removed from the PATH" ret["result"] = None return ret __salt__["win_path.remove"](name) if __salt__["win_path.exists"](name): - ret["comment"] = "Failed to remove {} from the PATH".format(name) + ret["comment"] = f"Failed to remove {name} from the PATH" ret["result"] = False else: - ret["comment"] = "Removed {} from the PATH".format(name) + ret["comment"] = f"Removed {name} from the PATH" ret["changes"]["removed"] = name return ret @@ -143,13 +143,11 @@ def exists(name, index=None): if index is None: # We're not enforcing the index, and the directory is in the PATH. # There's nothing to do here. - comments.append("{} already exists in the PATH.".format(name)) + comments.append(f"{name} already exists in the PATH.") return _format_comments(ret, comments) else: if index == old_index: - comments.append( - "{} already exists in the PATH at index {}.".format(name, index) - ) + comments.append(f"{name} already exists in the PATH at index {index}.") return _format_comments(ret, comments) else: if __opts__["test"]: @@ -168,7 +166,7 @@ def exists(name, index=None): ret["result"] = None comments.append( "{} would be added to the PATH{}.".format( - name, " at index {}".format(index) if index is not None else "" + name, f" at index {index}" if index is not None else "" ) ) ret["changes"] = _changes(old_index, index) @@ -177,7 +175,7 @@ def exists(name, index=None): try: ret["result"] = __salt__["win_path.add"](name, index=index, rehash=False) except Exception as exc: # pylint: disable=broad-except - comments.append("Encountered error: {}.".format(exc)) + comments.append(f"Encountered error: {exc}.") ret["result"] = False if ret["result"]: @@ -203,7 +201,7 @@ def exists(name, index=None): "{} {} to the PATH{}.".format( "Added" if ret["result"] else "Failed to add", name, - " at index {}".format(index) if index is not None else "", + f" at index {index}" if index is not None else "", ) ) diff --git a/salt/states/win_pki.py b/salt/states/win_pki.py index 658d979bef8..0e0724209f1 100644 --- a/salt/states/win_pki.py +++ b/salt/states/win_pki.py @@ -64,7 +64,7 @@ def import_cert( """ ret = {"name": name, "changes": dict(), "comment": "", "result": None} - store_path = r"Cert:\{}\{}".format(context, store) + store_path = rf"Cert:\{context}\{store}" cached_source_path = __salt__["cp.cache_file"](name, saltenv) current_certs = __salt__["win_pki.get_certs"](context=context, store=store) @@ -139,7 +139,7 @@ def remove_cert(name, thumbprint, context=_DEFAULT_CONTEXT, store=_DEFAULT_STORE """ ret = {"name": name, "changes": dict(), "comment": "", "result": None} - store_path = r"Cert:\{}\{}".format(context, store) + store_path = rf"Cert:\{context}\{store}" current_certs = __salt__["win_pki.get_certs"](context=context, store=store) if thumbprint not in current_certs: diff --git a/salt/states/win_powercfg.py b/salt/states/win_powercfg.py index c65b80ad0ed..46aba50985f 100644 --- a/salt/states/win_powercfg.py +++ b/salt/states/win_powercfg.py @@ -88,7 +88,7 @@ def set_timeout(name, value, power="ac", scheme=None): name = name.lower() if name not in ["monitor", "disk", "standby", "hibernate"]: ret["result"] = False - ret["comment"] = '"{}" is not a valid setting'.format(name) + ret["comment"] = f'"{name}" is not a valid setting' log.debug(ret["comment"]) return ret @@ -96,12 +96,12 @@ def set_timeout(name, value, power="ac", scheme=None): power = power.lower() if power not in ["ac", "dc"]: ret["result"] = False - ret["comment"] = '"{}" is not a power type'.format(power) + ret["comment"] = f'"{power}" is not a power type' log.debug(ret["comment"]) return ret # Get current settings - old = __salt__["powercfg.get_{}_timeout".format(name)](scheme=scheme) + old = __salt__[f"powercfg.get_{name}_timeout"](scheme=scheme) # Check current settings if old[power] == value: @@ -120,12 +120,10 @@ def set_timeout(name, value, power="ac", scheme=None): return ret # Set the timeout value - __salt__["powercfg.set_{}_timeout".format(name)]( - timeout=value, power=power, scheme=scheme - ) + __salt__[f"powercfg.set_{name}_timeout"](timeout=value, power=power, scheme=scheme) # Get the setting after the change - new = __salt__["powercfg.get_{}_timeout".format(name)](scheme=scheme) + new = __salt__[f"powercfg.get_{name}_timeout"](scheme=scheme) changes = salt.utils.data.compare_dicts(old, new) diff --git a/salt/states/win_servermanager.py b/salt/states/win_servermanager.py index 2e77012df18..6f91f166742 100644 --- a/salt/states/win_servermanager.py +++ b/salt/states/win_servermanager.py @@ -28,7 +28,7 @@ def installed( restart=False, source=None, exclude=None, - **kwargs + **kwargs, ): """ Install the windows feature. To install a single feature, use the ``name`` @@ -137,7 +137,7 @@ def installed( for feature in features: if feature not in old: - ret["changes"][feature] = "Will be installed recurse={}".format(recurse) + ret["changes"][feature] = f"Will be installed recurse={recurse}" elif recurse: ret["changes"][feature] = "Already installed but might install sub-features" else: @@ -168,13 +168,13 @@ def installed( for feature in status["Features"]: # Features that failed to install or be removed if not status["Features"][feature].get("Success", True): - fail_feat.append("- {}".format(feature)) + fail_feat.append(f"- {feature}") # Features that installed elif "(exclude)" not in status["Features"][feature]["Message"]: - new_feat.append("- {}".format(feature)) + new_feat.append(f"- {feature}") # Show items that were removed because they were part of `exclude` elif "(exclude)" in status["Features"][feature]["Message"]: - rem_feat.append("- {}".format(feature)) + rem_feat.append(f"- {feature}") if fail_feat: fail_feat.insert(0, "Failed to install the following:") @@ -302,10 +302,10 @@ def removed(name, features=None, remove_payload=False, restart=False): # feature is already uninstalled if not status["Features"][feature].get("Success", True): # Show items that failed to uninstall - fail_feat.append("- {}".format(feature)) + fail_feat.append(f"- {feature}") else: # Show items that uninstalled - rem_feat.append("- {}".format(feature)) + rem_feat.append(f"- {feature}") if fail_feat: fail_feat.insert(0, "Failed to remove the following:") diff --git a/salt/states/win_shortcut.py b/salt/states/win_shortcut.py index 3f14d1f6a4d..a1fa46a2f9e 100644 --- a/salt/states/win_shortcut.py +++ b/salt/states/win_shortcut.py @@ -188,10 +188,10 @@ def present( if __opts__["test"]: if changes: - ret["comment"] = "Shortcut will be modified: {}".format(name) + ret["comment"] = f"Shortcut will be modified: {name}" ret["changes"] = changes else: - ret["comment"] = "Shortcut will be created: {}".format(name) + ret["comment"] = f"Shortcut will be created: {name}" ret["result"] = None return ret @@ -213,7 +213,7 @@ def present( user=user, ) except CommandExecutionError as exc: - ret["comment"] = ["Failed to create the shortcut: {}".format(name)] + ret["comment"] = [f"Failed to create the shortcut: {name}"] ret["comment"].append(exc.message) ret["result"] = False return ret @@ -221,7 +221,7 @@ def present( try: new = __salt__["shortcut.get"](name) except CommandExecutionError as exc: - ret["comment"] = ["Failed to create the shortcut: {}".format(name)] + ret["comment"] = [f"Failed to create the shortcut: {name}"] ret["comment"].append(exc.message) ret["result"] = False return ret @@ -234,9 +234,9 @@ def present( return ret if changes: - ret["comment"] = "Shortcut modified: {}".format(name) + ret["comment"] = f"Shortcut modified: {name}" ret["changes"] = changes else: - ret["comment"] = "Shortcut created: {}".format(name) + ret["comment"] = f"Shortcut created: {name}" return ret diff --git a/salt/states/win_smtp_server.py b/salt/states/win_smtp_server.py index fa5a9a76bbe..91df2a6586a 100644 --- a/salt/states/win_smtp_server.py +++ b/salt/states/win_smtp_server.py @@ -38,7 +38,7 @@ def _normalize_server_settings(**settings): if isinstance(settings[setting], dict): value_from_key = next(iter(settings[setting].keys())) - ret[setting] = "{{{0}}}".format(value_from_key) + ret[setting] = f"{{{value_from_key}}}" else: ret[setting] = settings[setting] return ret diff --git a/salt/states/win_snmp.py b/salt/states/win_snmp.py index 0b5dfac12d8..9d70ebc1b8e 100644 --- a/salt/states/win_snmp.py +++ b/salt/states/win_snmp.py @@ -104,13 +104,13 @@ def auth_traps_enabled(name, status=True): current_status = __salt__["win_snmp.get_auth_traps_enabled"]() if status == current_status: - ret["comment"] = "{} already contains the provided value.".format(vname) + ret["comment"] = f"{vname} already contains the provided value." ret["result"] = True elif __opts__["test"]: - ret["comment"] = "{} will be changed.".format(vname) + ret["comment"] = f"{vname} will be changed." ret["changes"] = {"old": current_status, "new": status} else: - ret["comment"] = "Set {} to contain the provided value.".format(vname) + ret["comment"] = f"Set {vname} to contain the provided value." ret["changes"] = {"old": current_status, "new": status} ret["result"] = __salt__["win_snmp.set_auth_traps_enabled"](status=status) diff --git a/salt/states/win_system.py b/salt/states/win_system.py index 1e8d66ec81e..0aa5438b0ec 100644 --- a/salt/states/win_system.py +++ b/salt/states/win_system.py @@ -52,7 +52,7 @@ def computer_desc(name): "name": name, "changes": {}, "result": True, - "comment": "Computer description already set to '{}'".format(name), + "comment": f"Computer description already set to '{name}'", } before_desc = __salt__["system.get_computer_desc"]() @@ -62,7 +62,7 @@ def computer_desc(name): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Computer description will be changed to '{}'".format(name) + ret["comment"] = f"Computer description will be changed to '{name}'" return ret result = __salt__["system.set_computer_desc"](name) @@ -73,7 +73,7 @@ def computer_desc(name): ret["changes"] = {"old": before_desc, "new": name} else: ret["result"] = False - ret["comment"] = "Unable to set computer description to '{}'".format(name) + ret["comment"] = f"Unable to set computer description to '{name}'" return ret @@ -96,7 +96,7 @@ def computer_name(name): "name": name, "changes": {}, "result": True, - "comment": "Computer name already set to '{}'".format(name), + "comment": f"Computer name already set to '{name}'", } before_name = __salt__["system.get_computer_name"]() @@ -113,7 +113,7 @@ def computer_name(name): if __opts__["test"]: ret["result"] = None - ret["comment"] = "Computer name will be changed to '{}'".format(name) + ret["comment"] = f"Computer name will be changed to '{name}'" return ret result = __salt__["system.set_computer_name"](name) @@ -123,13 +123,13 @@ def computer_name(name): if (after_pending is not None and after_pending == name) or ( after_pending is None and after_name == name ): - ret["comment"] = "Computer name successfully set to '{}'".format(name) + ret["comment"] = f"Computer name successfully set to '{name}'" if after_pending is not None: ret["comment"] += " (reboot required for change to take effect)" ret["changes"] = {"old": before_name, "new": name} else: ret["result"] = False - ret["comment"] = "Unable to set computer name to '{}'".format(name) + ret["comment"] = f"Unable to set computer name to '{name}'" return ret @@ -147,7 +147,7 @@ def hostname(name): current_hostname = __salt__["system.get_hostname"]() if current_hostname.upper() == name.upper(): - ret["comment"] = "Hostname is already set to '{}'".format(name) + ret["comment"] = f"Hostname is already set to '{name}'" return ret out = __salt__["system.set_hostname"](name) @@ -197,14 +197,14 @@ def workgroup(name): # Notify the user if the requested workgroup is the same if current_workgroup.upper() == name.upper(): ret["result"] = True - ret["comment"] = "Workgroup is already set to '{}'".format(name.upper()) + ret["comment"] = f"Workgroup is already set to '{name.upper()}'" return ret # If being run in test-mode, inform the user what is supposed to happen if __opts__["test"]: ret["result"] = None ret["changes"] = {} - ret["comment"] = "Computer will be joined to workgroup '{}'".format(name) + ret["comment"] = f"Computer will be joined to workgroup '{name}'" return ret # Set our new workgroup, and then immediately ask the machine what it @@ -295,7 +295,7 @@ def join_domain( "name": name, "changes": {}, "result": True, - "comment": "Computer already added to '{}'".format(name), + "comment": f"Computer already added to '{name}'", } current_domain_dic = __salt__["system.get_domain_workgroup"]() @@ -307,12 +307,12 @@ def join_domain( current_domain = None if name.lower() == current_domain.lower(): - ret["comment"] = "Computer already added to '{}'".format(name) + ret["comment"] = f"Computer already added to '{name}'" return ret if __opts__["test"]: ret["result"] = None - ret["comment"] = "Computer will be added to '{}'".format(name) + ret["comment"] = f"Computer will be added to '{name}'" return ret result = __salt__["system.join_domain"]( @@ -324,14 +324,14 @@ def join_domain( restart=restart, ) if result is not False: - ret["comment"] = "Computer added to '{}'".format(name) + ret["comment"] = f"Computer added to '{name}'" if restart: ret["comment"] += "\nSystem will restart" else: ret["comment"] += "\nSystem needs to be restarted" ret["changes"] = {"old": current_domain, "new": name} else: - ret["comment"] = "Computer failed to join '{}'".format(name) + ret["comment"] = f"Computer failed to join '{name}'" ret["result"] = False return ret @@ -458,7 +458,7 @@ def shutdown( if only_on_pending_reboot and not __salt__["system.get_pending_reboot"](): if __opts__["test"]: ret["comment"] = ( - "System {} will be skipped because no reboot is pending".format(action) + f"System {action} will be skipped because no reboot is pending" ) else: ret["comment"] = ( @@ -470,7 +470,7 @@ def shutdown( if __opts__["test"]: ret["result"] = None - ret["comment"] = "Will attempt to schedule a {}".format(action) + ret["comment"] = f"Will attempt to schedule a {action}" return ret ret["result"] = __salt__["system.shutdown"]( @@ -485,9 +485,9 @@ def shutdown( if ret["result"]: ret["changes"] = { "old": "No reboot or shutdown was scheduled", - "new": "A {} has been scheduled".format(action), + "new": f"A {action} has been scheduled", } - ret["comment"] = "Request to {} was successful".format(action) + ret["comment"] = f"Request to {action} was successful" else: - ret["comment"] = "Request to {} failed".format(action) + ret["comment"] = f"Request to {action} failed" return ret diff --git a/salt/states/win_wusa.py b/salt/states/win_wusa.py index 17996c0bde7..70cf1f00436 100644 --- a/salt/states/win_wusa.py +++ b/salt/states/win_wusa.py @@ -61,13 +61,13 @@ def installed(name, source): # Is the KB already installed if __salt__["wusa.is_installed"](name): ret["result"] = True - ret["comment"] = "{} already installed".format(name) + ret["comment"] = f"{name} already installed" return ret # Check for test=True if __opts__["test"] is True: ret["result"] = None - ret["comment"] = "{} would be installed".format(name) + ret["comment"] = f"{name} would be installed" ret["result"] = None return ret @@ -91,11 +91,11 @@ def installed(name, source): # Verify successful install if __salt__["wusa.is_installed"](name): - ret["comment"] = "{} was installed. {}".format(name, additional_comment) + ret["comment"] = f"{name} was installed. {additional_comment}" ret["changes"] = {"old": False, "new": True} ret["result"] = True else: - ret["comment"] = "{} failed to install. {}".format(name, additional_comment) + ret["comment"] = f"{name} failed to install. {additional_comment}" return ret @@ -121,13 +121,13 @@ def uninstalled(name): # Is the KB already uninstalled if not __salt__["wusa.is_installed"](name): ret["result"] = True - ret["comment"] = "{} already uninstalled".format(name) + ret["comment"] = f"{name} already uninstalled" return ret # Check for test=True if __opts__["test"] is True: ret["result"] = None - ret["comment"] = "{} would be uninstalled".format(name) + ret["comment"] = f"{name} would be uninstalled" ret["result"] = None return ret @@ -136,10 +136,10 @@ def uninstalled(name): # Verify successful uninstall if not __salt__["wusa.is_installed"](name): - ret["comment"] = "{} was uninstalled".format(name) + ret["comment"] = f"{name} was uninstalled" ret["changes"] = {"old": True, "new": False} ret["result"] = True else: - ret["comment"] = "{} failed to uninstall".format(name) + ret["comment"] = f"{name} failed to uninstall" return ret diff --git a/salt/states/winrepo.py b/salt/states/winrepo.py index 23858551592..241c66c1ca6 100644 --- a/salt/states/winrepo.py +++ b/salt/states/winrepo.py @@ -60,11 +60,11 @@ def genrepo(name, force=False, allow_empty=False): if not force: if not os.path.exists(winrepo_dir): ret["result"] = False - ret["comment"] = "{} is missing".format(winrepo_dir) + ret["comment"] = f"{winrepo_dir} is missing" return ret elif not os.path.exists(winrepo_cachefile): execute = True - ret["comment"] = "{} is missing".format(winrepo_cachefile) + ret["comment"] = f"{winrepo_cachefile} is missing" else: winrepo_cachefile_mtime = os.stat(winrepo_cachefile)[stat.ST_MTIME] for root, dirs, files in salt.utils.path.os_walk(winrepo_dir): diff --git a/salt/states/wordpress.py b/salt/states/wordpress.py index e672e30be4a..5e208458ef7 100644 --- a/salt/states/wordpress.py +++ b/salt/states/wordpress.py @@ -53,11 +53,11 @@ def installed(name, user, admin_user, admin_password, admin_email, title, url): if check: ret["result"] = True - ret["comment"] = "Wordpress is already installed: {}".format(name) + ret["comment"] = f"Wordpress is already installed: {name}" return ret elif __opts__["test"]: ret["result"] = None - ret["comment"] = "Wordpress will be installed: {}".format(name) + ret["comment"] = f"Wordpress will be installed: {name}" return ret resp = __salt__["wordpress.install"]( @@ -65,10 +65,10 @@ def installed(name, user, admin_user, admin_password, admin_email, title, url): ) if resp: ret["result"] = True - ret["comment"] = "Wordpress Installed: {}".format(name) + ret["comment"] = f"Wordpress Installed: {name}" ret["changes"] = {"new": resp} else: - ret["comment"] = "Failed to install wordpress: {}".format(name) + ret["comment"] = f"Failed to install wordpress: {name}" return ret @@ -99,30 +99,30 @@ def activated(name, path, user): if check["status"] == "active": ret["result"] = True - ret["comment"] = "Plugin already activated: {}".format(name) + ret["comment"] = f"Plugin already activated: {name}" return ret elif __opts__["test"]: ret["result"] = None - ret["comment"] = "Plugin will be activated: {}".format(name) + ret["comment"] = f"Plugin will be activated: {name}" return ret resp = __salt__["wordpress.activate"](name, path, user) if resp is True: ret["result"] = True - ret["comment"] = "Plugin activated: {}".format(name) + ret["comment"] = f"Plugin activated: {name}" ret["changes"] = { "old": check, "new": __salt__["wordpress.show_plugin"](name, path, user), } elif resp is None: ret["result"] = True - ret["comment"] = "Plugin already activated: {}".format(name) + ret["comment"] = f"Plugin already activated: {name}" ret["changes"] = { "old": check, "new": __salt__["wordpress.show_plugin"](name, path, user), } else: - ret["comment"] = "Plugin failed to activate: {}".format(name) + ret["comment"] = f"Plugin failed to activate: {name}" return ret @@ -153,29 +153,29 @@ def deactivated(name, path, user): if check["status"] == "inactive": ret["result"] = True - ret["comment"] = "Plugin already deactivated: {}".format(name) + ret["comment"] = f"Plugin already deactivated: {name}" return ret elif __opts__["test"]: ret["result"] = None - ret["comment"] = "Plugin will be deactivated: {}".format(name) + ret["comment"] = f"Plugin will be deactivated: {name}" return ret resp = __salt__["wordpress.deactivate"](name, path, user) if resp is True: ret["result"] = True - ret["comment"] = "Plugin deactivated: {}".format(name) + ret["comment"] = f"Plugin deactivated: {name}" ret["changes"] = { "old": check, "new": __salt__["wordpress.show_plugin"](name, path, user), } elif resp is None: ret["result"] = True - ret["comment"] = "Plugin already deactivated: {}".format(name) + ret["comment"] = f"Plugin already deactivated: {name}" ret["changes"] = { "old": check, "new": __salt__["wordpress.show_plugin"](name, path, user), } else: - ret["comment"] = "Plugin failed to deactivate: {}".format(name) + ret["comment"] = f"Plugin failed to deactivate: {name}" return ret diff --git a/salt/states/x509.py b/salt/states/x509.py index 0a8d988fa0f..14e3edff640 100644 --- a/salt/states/x509.py +++ b/salt/states/x509.py @@ -286,7 +286,7 @@ def private_key_managed( new=False, overwrite=False, verbose=True, - **kwargs + **kwargs, ): """ Manage a private key's existence. @@ -390,7 +390,7 @@ def csr_managed(name, **kwargs): try: old = __salt__["x509.read_csr"](name) except salt.exceptions.SaltInvocationError: - old = "{} is not a valid csr.".format(name) + old = f"{name} is not a valid csr." file_args, kwargs = _get_file_args(name, **kwargs) file_args["contents"] = __salt__["x509.create_csr"](text=True, **kwargs) @@ -517,7 +517,7 @@ def _certificate_is_valid(name, days_remaining, append_certs, **cert_spec): If False, also provide a message explaining why. """ if not os.path.isfile(name): - return False, "{} does not exist".format(name), {} + return False, f"{name} does not exist", {} try: cert_info = __salt__["x509.read_certificate"](certificate=name) @@ -569,7 +569,7 @@ def _certificate_is_valid(name, days_remaining, append_certs, **cert_spec): return True, "", cert_info except salt.exceptions.SaltInvocationError as e: - return False, "{} is not a valid certificate: {}".format(name, str(e)), {} + return False, f"{name} is not a valid certificate: {str(e)}", {} def _certificate_file_managed(ret, file_args): @@ -698,7 +698,7 @@ def certificate_managed(name, days_remaining=90, append_certs=None, **kwargs): ret = _certificate_file_managed(ret, file_args) ret["result"] = None - ret["comment"] = "Certificate {} will be created".format(name) + ret["comment"] = f"Certificate {name} will be created" ret["changes"]["Status"] = { "Old": invalid_reason, "New": "Certificate will be valid and up to date", @@ -763,7 +763,7 @@ def crl_managed( digest="", days_remaining=30, include_expired=False, - **kwargs + **kwargs, ): """ Manage a Certificate Revocation List @@ -845,9 +845,9 @@ def crl_managed( if days_remaining == 0: days_remaining = current_days_remaining - 1 except salt.exceptions.SaltInvocationError: - current = "{} is not a valid CRL.".format(name) + current = f"{name} is not a valid CRL." else: - current = "{} does not exist.".format(name) + current = f"{name} does not exist." new_crl = __salt__["x509.create_crl"]( text=True, diff --git a/salt/states/xml.py b/salt/states/xml.py index 67cf30a825b..48bcb4eb5db 100644 --- a/salt/states/xml.py +++ b/salt/states/xml.py @@ -51,20 +51,20 @@ def value_present(name, xpath, value, **kwargs): current_value = __salt__["xml.get_value"](name, xpath) if not current_value: ret["result"] = False - ret["comment"] = "xpath query {} not found in {}".format(xpath, name) + ret["comment"] = f"xpath query {xpath} not found in {name}" return ret if current_value != value: if kwargs["test"]: ret["result"] = None - ret["comment"] = "{} will be updated".format(name) + ret["comment"] = f"{name} will be updated" ret["changes"] = {name: {"old": current_value, "new": value}} else: results = __salt__["xml.set_value"](name, xpath, value) ret["result"] = results - ret["comment"] = "{} updated".format(name) + ret["comment"] = f"{name} updated" ret["changes"] = {name: {"old": current_value, "new": value}} else: - ret["comment"] = "{} is already present".format(value) + ret["comment"] = f"{value} is already present" return ret diff --git a/salt/states/xmpp.py b/salt/states/xmpp.py index 2186c37bbca..84b4a6a3017 100644 --- a/salt/states/xmpp.py +++ b/salt/states/xmpp.py @@ -54,7 +54,7 @@ def send_msg(name, recipient, profile): profile=profile, ) ret["result"] = True - ret["comment"] = "Sent message to {}: {}".format(recipient, name) + ret["comment"] = f"Sent message to {recipient}: {name}" return ret @@ -84,10 +84,10 @@ def send_msg_multi(name, profile, recipients=None, rooms=None): comment = "" if recipients: - comment += " users {}".format(recipients) + comment += f" users {recipients}" if rooms: - comment += " rooms {}".format(rooms) - comment += ", message: {}".format(name) + comment += f" rooms {rooms}" + comment += f", message: {name}" if __opts__["test"]: ret["comment"] = "Need to send" + comment diff --git a/salt/states/zabbix_action.py b/salt/states/zabbix_action.py index c3ff6a05054..159da05f169 100644 --- a/salt/states/zabbix_action.py +++ b/salt/states/zabbix_action.py @@ -127,7 +127,7 @@ def present(name, params, **kwargs): if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" would be fixed.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" would be fixed.' ret["changes"] = { name: { "old": ( @@ -151,14 +151,14 @@ def present(name, params, **kwargs): ) if action_update: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" updated.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" updated.' ret["changes"] = { name: { "old": ( 'Zabbix Action "{}" differed ' "in following parameters: {}".format(name, diff_params) ), - "new": 'Zabbix Action "{}" fixed.'.format(name), + "new": f'Zabbix Action "{name}" fixed.', } } @@ -173,10 +173,10 @@ def present(name, params, **kwargs): else: if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" would be created.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" would be created.' ret["changes"] = { name: { - "old": 'Zabbix Action "{}" does not exist.'.format(name), + "old": f'Zabbix Action "{name}" does not exist.', "new": ( 'Zabbix Action "{}" would be created according definition.'.format( name @@ -193,10 +193,10 @@ def present(name, params, **kwargs): if action_create: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" created.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" created.' ret["changes"] = { name: { - "old": 'Zabbix Action "{}" did not exist.'.format(name), + "old": f'Zabbix Action "{name}" did not exist.', "new": ( 'Zabbix Action "{}" created according definition.'.format( name @@ -235,15 +235,15 @@ def absent(name, **kwargs): if not object_id: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" does not exist.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" does not exist.' else: if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" would be deleted.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" would be deleted.' ret["changes"] = { name: { - "old": 'Zabbix Action "{}" exists.'.format(name), - "new": 'Zabbix Action "{}" would be deleted.'.format(name), + "old": f'Zabbix Action "{name}" exists.', + "new": f'Zabbix Action "{name}" would be deleted.', } } else: @@ -253,11 +253,11 @@ def absent(name, **kwargs): if action_delete: ret["result"] = True - ret["comment"] = 'Zabbix Action "{}" deleted.'.format(name) + ret["comment"] = f'Zabbix Action "{name}" deleted.' ret["changes"] = { name: { - "old": 'Zabbix Action "{}" existed.'.format(name), - "new": 'Zabbix Action "{}" deleted.'.format(name), + "old": f'Zabbix Action "{name}" existed.', + "new": f'Zabbix Action "{name}" deleted.', } } diff --git a/salt/states/zabbix_host.py b/salt/states/zabbix_host.py index 0ec5204c435..a065c6a7aef 100644 --- a/salt/states/zabbix_host.py +++ b/salt/states/zabbix_host.py @@ -85,14 +85,14 @@ def present(host, groups, interfaces, **kwargs): ret = {"name": host, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_host_created = "Host {} created.".format(host) - comment_host_updated = "Host {} updated.".format(host) - comment_host_notcreated = "Unable to create host: {}. ".format(host) - comment_host_exists = "Host {} already exists.".format(host) + comment_host_created = f"Host {host} created." + comment_host_updated = f"Host {host} updated." + comment_host_notcreated = f"Unable to create host: {host}. " + comment_host_exists = f"Host {host} already exists." changes_host_created = { host: { - "old": "Host {} does not exist.".format(host), - "new": "Host {} created.".format(host), + "old": f"Host {host} does not exist.", + "new": f"Host {host} created.", } } @@ -206,7 +206,7 @@ def present(host, groups, interfaces, **kwargs): try: groupids.append(int(groupid[0]["groupid"])) except TypeError: - ret["comment"] = "Invalid group {}".format(group) + ret["comment"] = f"Invalid group {group}" return ret else: groupids.append(group) @@ -224,23 +224,23 @@ def present(host, groups, interfaces, **kwargs): { "output": "proxyid", "selectInterface": "extend", - "filter": {"host": "{}".format(proxy_host)}, + "filter": {"host": f"{proxy_host}"}, }, - **connection_args + **connection_args, )[0]["proxyid"] except TypeError: - ret["comment"] = "Invalid proxy_host {}".format(proxy_host) + ret["comment"] = f"Invalid proxy_host {proxy_host}" return ret # Otherwise lookup proxy_host as proxyid else: try: proxy_hostid = __salt__["zabbix.run_query"]( "proxy.get", - {"proxyids": "{}".format(proxy_host), "output": "proxyid"}, - **connection_args + {"proxyids": f"{proxy_host}", "output": "proxyid"}, + **connection_args, )[0]["proxyid"] except TypeError: - ret["comment"] = "Invalid proxy_host {}".format(proxy_host) + ret["comment"] = f"Invalid proxy_host {proxy_host}" return ret # Selects if the current inventory should be substituted by the new one @@ -459,7 +459,7 @@ def present(host, groups, interfaces, **kwargs): useip=interface["useip"], port=interface["port"], details=interface["details"], - **connection_args + **connection_args, ) else: interfaceid = interfaceid_by_type[interface["type"]].pop(0) @@ -472,7 +472,7 @@ def present(host, groups, interfaces, **kwargs): useip=interface["useip"], port=interface["port"], details=interface["details"], - **connection_args + **connection_args, ) return ret @@ -516,7 +516,7 @@ def present(host, groups, interfaces, **kwargs): proxy_hostid=proxy_hostid, inventory=new_inventory, visible_name=visible_name, - **sum_kwargs + **sum_kwargs, ) if "error" not in host_create: @@ -556,13 +556,13 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_host_deleted = "Host {} deleted.".format(name) - comment_host_notdeleted = "Unable to delete host: {}. ".format(name) - comment_host_notexists = "Host {} does not exist.".format(name) + comment_host_deleted = f"Host {name} deleted." + comment_host_notdeleted = f"Unable to delete host: {name}. " + comment_host_notexists = f"Host {name} does not exist." changes_host_deleted = { name: { - "old": "Host {} exists.".format(name), - "new": "Host {} deleted.".format(name), + "old": f"Host {name} exists.", + "new": f"Host {name} deleted.", } } connection_args = {} @@ -670,7 +670,7 @@ def assign_templates(host, templates, **kwargs): hostids=hostid, output='[{"hostid"}]', selectParentTemplates='["templateid"]', - **connection_args + **connection_args, ) for template_id in host_templates[0]["parentTemplates"]: curr_template_ids.append(template_id["templateid"]) @@ -684,7 +684,7 @@ def assign_templates(host, templates, **kwargs): requested_template_ids.append(template_id) except TypeError: ret["result"] = False - ret["comment"] = "Unable to find template: {}.".format(template) + ret["comment"] = f"Unable to find template: {template}." return ret # remove any duplications diff --git a/salt/states/zabbix_hostgroup.py b/salt/states/zabbix_hostgroup.py index 9822f160eec..052ba60fda2 100644 --- a/salt/states/zabbix_hostgroup.py +++ b/salt/states/zabbix_hostgroup.py @@ -45,13 +45,13 @@ def present(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_hostgroup_created = "Host group {} created.".format(name) - comment_hostgroup_notcreated = "Unable to create host group: {}. ".format(name) - comment_hostgroup_exists = "Host group {} already exists.".format(name) + comment_hostgroup_created = f"Host group {name} created." + comment_hostgroup_notcreated = f"Unable to create host group: {name}. " + comment_hostgroup_exists = f"Host group {name} already exists." changes_hostgroup_created = { name: { - "old": "Host group {} does not exist.".format(name), - "new": "Host group {} created.".format(name), + "old": f"Host group {name} does not exist.", + "new": f"Host group {name} created.", } } @@ -109,13 +109,13 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_hostgroup_deleted = "Host group {} deleted.".format(name) - comment_hostgroup_notdeleted = "Unable to delete host group: {}. ".format(name) - comment_hostgroup_notexists = "Host group {} does not exist.".format(name) + comment_hostgroup_deleted = f"Host group {name} deleted." + comment_hostgroup_notdeleted = f"Unable to delete host group: {name}. " + comment_hostgroup_notexists = f"Host group {name} does not exist." changes_hostgroup_deleted = { name: { - "old": "Host group {} exists.".format(name), - "new": "Host group {} deleted.".format(name), + "old": f"Host group {name} exists.", + "new": f"Host group {name} deleted.", } } diff --git a/salt/states/zabbix_mediatype.py b/salt/states/zabbix_mediatype.py index 4c29914adab..81417d58f72 100644 --- a/salt/states/zabbix_mediatype.py +++ b/salt/states/zabbix_mediatype.py @@ -49,14 +49,14 @@ def present(name, mediatype, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_mediatype_created = "Mediatype {} created.".format(name) - comment_mediatype_updated = "Mediatype {} updated.".format(name) - comment_mediatype_notcreated = "Unable to create mediatype: {}. ".format(name) - comment_mediatype_exists = "Mediatype {} already exists.".format(name) + comment_mediatype_created = f"Mediatype {name} created." + comment_mediatype_updated = f"Mediatype {name} updated." + comment_mediatype_notcreated = f"Unable to create mediatype: {name}. " + comment_mediatype_exists = f"Mediatype {name} already exists." changes_mediatype_created = { name: { - "old": "Mediatype {} does not exist.".format(name), - "new": "Mediatype {} created.".format(name), + "old": f"Mediatype {name} does not exist.", + "new": f"Mediatype {name} created.", } } @@ -214,7 +214,7 @@ def present(name, mediatype, **kwargs): smtp_server=kwargs["smtp_server"], smtp_helo=kwargs["smtp_helo"], smtp_email=kwargs["smtp_email"], - **connection_args + **connection_args, ) if "error" in updated_email: error.append(updated_email["error"]) @@ -236,7 +236,7 @@ def present(name, mediatype, **kwargs): updated_email_security = __salt__["zabbix.mediatype_update"]( mediatypeid, smtp_security=kwargs["smtp_security"], - **connection_args + **connection_args, ) if "error" in updated_email_security: error.append(updated_email_security["error"]) @@ -247,7 +247,7 @@ def present(name, mediatype, **kwargs): updated_email_verify_peer = __salt__["zabbix.mediatype_update"]( mediatypeid, smtp_verify_peer=kwargs["smtp_verify_peer"], - **connection_args + **connection_args, ) if "error" in updated_email_verify_peer: error.append(updated_email_verify_peer["error"]) @@ -258,7 +258,7 @@ def present(name, mediatype, **kwargs): updated_email_verify_host = __salt__["zabbix.mediatype_update"]( mediatypeid, smtp_verify_host=kwargs["smtp_verify_host"], - **connection_args + **connection_args, ) if "error" in updated_email_verify_host: error.append(updated_email_verify_host["error"]) @@ -271,7 +271,7 @@ def present(name, mediatype, **kwargs): username=kwargs["username"], passwd=kwargs["passwd"], smtp_authentication=kwargs["smtp_authentication"], - **connection_args + **connection_args, ) if "error" in updated_email_auth: error.append(updated_email_auth["error"]) @@ -286,7 +286,7 @@ def present(name, mediatype, **kwargs): mediatypeid, type=mediatype, exec_path=kwargs["exec_path"], - **connection_args + **connection_args, ) if "error" in updated_script: error.append(updated_script["error"]) @@ -307,7 +307,7 @@ def present(name, mediatype, **kwargs): mediatypeid, type=mediatype, gsm_modem=kwargs["gsm_modem"], - **connection_args + **connection_args, ) if "error" in updated_sms: error.append(updated_sms["error"]) @@ -320,7 +320,7 @@ def present(name, mediatype, **kwargs): type=mediatype, username=kwargs["username"], passwd=kwargs["passwd"], - **connection_args + **connection_args, ) if "error" in updated_jabber: error.append(updated_jabber["error"]) @@ -334,7 +334,7 @@ def present(name, mediatype, **kwargs): username=kwargs["username"], passwd=kwargs["passwd"], exec_path=kwargs["exec_path"], - **connection_args + **connection_args, ) if "error" in updated_eztext: error.append(updated_eztext["error"]) @@ -404,13 +404,13 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_mediatype_deleted = "Mediatype {} deleted.".format(name) - comment_mediatype_notdeleted = "Unable to delete mediatype: {}. ".format(name) - comment_mediatype_notexists = "Mediatype {} does not exist.".format(name) + comment_mediatype_deleted = f"Mediatype {name} deleted." + comment_mediatype_notdeleted = f"Unable to delete mediatype: {name}. " + comment_mediatype_notexists = f"Mediatype {name} does not exist." changes_mediatype_deleted = { name: { - "old": "Mediatype {} exists.".format(name), - "new": "Mediatype {} deleted.".format(name), + "old": f"Mediatype {name} exists.", + "new": f"Mediatype {name} deleted.", } } diff --git a/salt/states/zabbix_template.py b/salt/states/zabbix_template.py index 0e0bc6169eb..81420943371 100644 --- a/salt/states/zabbix_template.py +++ b/salt/states/zabbix_template.py @@ -487,10 +487,10 @@ def is_present(name, **kwargs): if not object_id: ret["result"] = False - ret["comment"] = 'Zabbix Template "{}" does not exist.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" does not exist.' else: ret["result"] = True - ret["comment"] = 'Zabbix Template "{}" exists.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" exists.' return ret @@ -690,7 +690,7 @@ def present(name, params, static_host_list=True, **kwargs): "selectMacros": "extend", "filter": {"host": name}, }, - **kwargs + **kwargs, ) log.info("TEMPLATE get result: %s", str(json.dumps(tmpl_get, indent=4))) @@ -797,7 +797,7 @@ def present(name, params, static_host_list=True, **kwargs): TEMPLATE_COMPONENT_DEF[component]["qselectpid"]: template_id }, filter_key=TEMPLATE_COMPONENT_DEF[component]["filter"], - **kwargs + **kwargs, ) else: defined_c_list_subs = [] @@ -807,7 +807,7 @@ def present(name, params, static_host_list=True, **kwargs): template_id, defined_c_list_subs, existing_c_list_subs, - **kwargs + **kwargs, ) log.info( @@ -846,7 +846,7 @@ def present(name, params, static_host_list=True, **kwargs): defined_p_list_subs = __salt__["zabbix.substitute_params"]( d_rule_component[proto_name], extend_params={c_def["qselectpid"]: template_id}, - **kwargs + **kwargs, ) else: defined_p_list_subs = [] @@ -857,7 +857,7 @@ def present(name, params, static_host_list=True, **kwargs): defined_p_list_subs, existing_p_list_subs, template_id=template_id, - **kwargs + **kwargs, ) log.info( @@ -884,10 +884,10 @@ def present(name, params, static_host_list=True, **kwargs): if tmpl_action: ret["result"] = True if dry_run: - ret["comment"] = 'Zabbix Template "{}" would be created.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" would be created.' ret["changes"] = { name: { - "old": 'Zabbix Template "{}" does not exist.'.format(name), + "old": f'Zabbix Template "{name}" does not exist.', "new": ( 'Zabbix Template "{}" would be created ' "according definition.".format(name) @@ -895,10 +895,10 @@ def present(name, params, static_host_list=True, **kwargs): } } else: - ret["comment"] = 'Zabbix Template "{}" created.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" created.' ret["changes"] = { name: { - "old": 'Zabbix Template "{}" did not exist.'.format(name), + "old": f'Zabbix Template "{name}" did not exist.', "new": ( 'Zabbix Template "{}" created according definition.'.format( name @@ -909,10 +909,10 @@ def present(name, params, static_host_list=True, **kwargs): else: ret["result"] = True if dry_run: - ret["comment"] = 'Zabbix Template "{}" would be updated.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" would be updated.' ret["changes"] = { name: { - "old": 'Zabbix Template "{}" differs.'.format(name), + "old": f'Zabbix Template "{name}" differs.', "new": ( 'Zabbix Template "{}" would be updated ' "according definition.".format(name) @@ -920,10 +920,10 @@ def present(name, params, static_host_list=True, **kwargs): } } else: - ret["comment"] = 'Zabbix Template "{}" updated.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" updated.' ret["changes"] = { name: { - "old": 'Zabbix Template "{}" differed.'.format(name), + "old": f'Zabbix Template "{name}" differed.', "new": ( 'Zabbix Template "{}" updated according definition.'.format( name @@ -962,15 +962,15 @@ def absent(name, **kwargs): if not object_id: ret["result"] = True - ret["comment"] = 'Zabbix Template "{}" does not exist.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" does not exist.' else: if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Template "{}" would be deleted.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" would be deleted.' ret["changes"] = { name: { - "old": 'Zabbix Template "{}" exists.'.format(name), - "new": 'Zabbix Template "{}" would be deleted.'.format(name), + "old": f'Zabbix Template "{name}" exists.', + "new": f'Zabbix Template "{name}" would be deleted.', } } else: @@ -979,11 +979,11 @@ def absent(name, **kwargs): ) if tmpl_delete: ret["result"] = True - ret["comment"] = 'Zabbix Template "{}" deleted.'.format(name) + ret["comment"] = f'Zabbix Template "{name}" deleted.' ret["changes"] = { name: { - "old": 'Zabbix Template "{}" existed.'.format(name), - "new": 'Zabbix Template "{}" deleted.'.format(name), + "old": f'Zabbix Template "{name}" existed.', + "new": f'Zabbix Template "{name}" deleted.', } } diff --git a/salt/states/zabbix_user.py b/salt/states/zabbix_user.py index e1236458801..bf7706ced08 100644 --- a/salt/states/zabbix_user.py +++ b/salt/states/zabbix_user.py @@ -191,14 +191,14 @@ def present(alias, passwd, usrgrps, medias=None, password_reset=False, **kwargs) ret = {"name": alias, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_user_created = "User {} created.".format(alias) - comment_user_updated = "User {} updated.".format(alias) - comment_user_notcreated = "Unable to create user: {}. ".format(alias) - comment_user_exists = "User {} already exists.".format(alias) + comment_user_created = f"User {alias} created." + comment_user_updated = f"User {alias} updated." + comment_user_notcreated = f"Unable to create user: {alias}. " + comment_user_exists = f"User {alias} already exists." changes_user_created = { alias: { - "old": "User {} does not exist.".format(alias), - "new": "User {} created.".format(alias), + "old": f"User {alias} does not exist.", + "new": f"User {alias} created.", } } @@ -341,7 +341,7 @@ def present(alias, passwd, usrgrps, medias=None, password_reset=False, **kwargs) usrgrp_diff = list(set(usrgrps) - set(cur_usrgrps)) if usrgrp_diff and update_usrgrps: - error.append("Unable to update group(s): {}".format(usrgrp_diff)) + error.append(f"Unable to update group(s): {usrgrp_diff}") else: if update_usrgrps: @@ -359,9 +359,7 @@ def present(alias, passwd, usrgrps, medias=None, password_reset=False, **kwargs) usrgrp_diff = list(set(usrgrps) - set(cur_usrgrps)) if usrgrp_diff: - error.append( - "Unable to update group(s): {}".format(usrgrp_diff) - ) + error.append(f"Unable to update group(s): {usrgrp_diff}") ret["changes"]["usrgrps"] = str(updated_groups) @@ -390,7 +388,7 @@ def present(alias, passwd, usrgrps, medias=None, password_reset=False, **kwargs) period=media["period"], sendto=media["sendto"], severity=media["severity"], - **connection_args + **connection_args, ) if "error" in updatemed: @@ -448,13 +446,13 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_user_deleted = "USer {} deleted.".format(name) - comment_user_notdeleted = "Unable to delete user: {}. ".format(name) - comment_user_notexists = "User {} does not exist.".format(name) + comment_user_deleted = f"USer {name} deleted." + comment_user_notdeleted = f"Unable to delete user: {name}. " + comment_user_notexists = f"User {name} does not exist." changes_user_deleted = { name: { - "old": "User {} exists.".format(name), - "new": "User {} deleted.".format(name), + "old": f"User {name} exists.", + "new": f"User {name} deleted.", } } diff --git a/salt/states/zabbix_usergroup.py b/salt/states/zabbix_usergroup.py index 0a054228866..347c0781cd7 100644 --- a/salt/states/zabbix_usergroup.py +++ b/salt/states/zabbix_usergroup.py @@ -50,14 +50,14 @@ def present(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_usergroup_created = "User group {} created.".format(name) - comment_usergroup_updated = "User group {} updated.".format(name) - comment_usergroup_notcreated = "Unable to create user group: {}. ".format(name) - comment_usergroup_exists = "User group {} already exists.".format(name) + comment_usergroup_created = f"User group {name} created." + comment_usergroup_updated = f"User group {name} updated." + comment_usergroup_notcreated = f"Unable to create user group: {name}. " + comment_usergroup_exists = f"User group {name} already exists." changes_usergroup_created = { name: { - "old": "User group {} does not exist.".format(name), - "new": "User group {} created.".format(name), + "old": f"User group {name} does not exist.", + "new": f"User group {name} created.", } } @@ -219,13 +219,13 @@ def absent(name, **kwargs): ret = {"name": name, "changes": {}, "result": False, "comment": ""} # Comment and change messages - comment_usergroup_deleted = "User group {} deleted.".format(name) - comment_usergroup_notdeleted = "Unable to delete user group: {}. ".format(name) - comment_usergroup_notexists = "User group {} does not exist.".format(name) + comment_usergroup_deleted = f"User group {name} deleted." + comment_usergroup_notdeleted = f"Unable to delete user group: {name}. " + comment_usergroup_notexists = f"User group {name} does not exist." changes_usergroup_deleted = { name: { - "old": "User group {} exists.".format(name), - "new": "User group {} deleted.".format(name), + "old": f"User group {name} exists.", + "new": f"User group {name} deleted.", } } diff --git a/salt/states/zabbix_usermacro.py b/salt/states/zabbix_usermacro.py index d1d9419ee08..e3612172de4 100644 --- a/salt/states/zabbix_usermacro.py +++ b/salt/states/zabbix_usermacro.py @@ -54,26 +54,26 @@ def present(name, value, hostid=None, **kwargs): name, hostid ) comment_usermacro_notcreated = ( - "Unable to create usermacro: {} on hostid {}. ".format(name, hostid) + f"Unable to create usermacro: {name} on hostid {hostid}. " ) comment_usermacro_exists = "Usermacro {} already exists on hostid {}.".format( name, hostid ) changes_usermacro_created = { name: { - "old": "Usermacro {} does not exist on hostid {}.".format(name, hostid), - "new": "Usermacro {} created on hostid {}.".format(name, hostid), + "old": f"Usermacro {name} does not exist on hostid {hostid}.", + "new": f"Usermacro {name} created on hostid {hostid}.", } } else: - comment_usermacro_created = "Usermacro {} created.".format(name) - comment_usermacro_updated = "Usermacro {} updated.".format(name) - comment_usermacro_notcreated = "Unable to create usermacro: {}. ".format(name) - comment_usermacro_exists = "Usermacro {} already exists.".format(name) + comment_usermacro_created = f"Usermacro {name} created." + comment_usermacro_updated = f"Usermacro {name} updated." + comment_usermacro_notcreated = f"Unable to create usermacro: {name}. " + comment_usermacro_exists = f"Usermacro {name} already exists." changes_usermacro_created = { name: { - "old": "Usermacro {} does not exist.".format(name), - "new": "Usermacro {} created.".format(name), + "old": f"Usermacro {name} does not exist.", + "new": f"Usermacro {name} created.", } } @@ -203,25 +203,25 @@ def absent(name, hostid=None, **kwargs): name, hostid ) comment_usermacro_notdeleted = ( - "Unable to delete usermacro: {} from hostid {}.".format(name, hostid) + f"Unable to delete usermacro: {name} from hostid {hostid}." ) comment_usermacro_notexists = ( - "Usermacro {} does not exist on hostid {}.".format(name, hostid) + f"Usermacro {name} does not exist on hostid {hostid}." ) changes_usermacro_deleted = { name: { - "old": "Usermacro {} exists on hostid {}.".format(name, hostid), - "new": "Usermacro {} deleted from {}.".format(name, hostid), + "old": f"Usermacro {name} exists on hostid {hostid}.", + "new": f"Usermacro {name} deleted from {hostid}.", } } else: - comment_usermacro_deleted = "Usermacro {} deleted.".format(name) - comment_usermacro_notdeleted = "Unable to delete usermacro: {}.".format(name) - comment_usermacro_notexists = "Usermacro {} does not exist.".format(name) + comment_usermacro_deleted = f"Usermacro {name} deleted." + comment_usermacro_notdeleted = f"Unable to delete usermacro: {name}." + comment_usermacro_notexists = f"Usermacro {name} does not exist." changes_usermacro_deleted = { name: { - "old": "Usermacro {} exists.".format(name), - "new": "Usermacro {} deleted.".format(name), + "old": f"Usermacro {name} exists.", + "new": f"Usermacro {name} deleted.", } } if hostid: diff --git a/salt/states/zabbix_valuemap.py b/salt/states/zabbix_valuemap.py index 2475b2b4e53..cdcf4cb8cd2 100644 --- a/salt/states/zabbix_valuemap.py +++ b/salt/states/zabbix_valuemap.py @@ -95,7 +95,7 @@ def present(name, params, **kwargs): if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" would be fixed.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" would be fixed.' ret["changes"] = { name: { "old": ( @@ -119,14 +119,14 @@ def present(name, params, **kwargs): ) if valuemap_update: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" updated.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" updated.' ret["changes"] = { name: { "old": ( 'Zabbix Value map "{}" differed ' "in following parameters: {}".format(name, diff_params) ), - "new": 'Zabbix Value map "{}" fixed.'.format(name), + "new": f'Zabbix Value map "{name}" fixed.', } } @@ -141,10 +141,10 @@ def present(name, params, **kwargs): else: if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" would be created.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" would be created.' ret["changes"] = { name: { - "old": 'Zabbix Value map "{}" does not exist.'.format(name), + "old": f'Zabbix Value map "{name}" does not exist.', "new": ( 'Zabbix Value map "{}" would be created ' "according definition.".format(name) @@ -163,10 +163,10 @@ def present(name, params, **kwargs): if valuemap_create: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" created.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" created.' ret["changes"] = { name: { - "old": 'Zabbix Value map "{}" did not exist.'.format(name), + "old": f'Zabbix Value map "{name}" did not exist.', "new": ( 'Zabbix Value map "{}" created according definition.'.format( name @@ -205,15 +205,15 @@ def absent(name, **kwargs): if not object_id: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" does not exist.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" does not exist.' else: if dry_run: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" would be deleted.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" would be deleted.' ret["changes"] = { name: { - "old": 'Zabbix Value map "{}" exists.'.format(name), - "new": 'Zabbix Value map "{}" would be deleted.'.format(name), + "old": f'Zabbix Value map "{name}" exists.', + "new": f'Zabbix Value map "{name}" would be deleted.', } } else: @@ -223,11 +223,11 @@ def absent(name, **kwargs): if valuemap_delete: ret["result"] = True - ret["comment"] = 'Zabbix Value map "{}" deleted.'.format(name) + ret["comment"] = f'Zabbix Value map "{name}" deleted.' ret["changes"] = { name: { - "old": 'Zabbix Value map "{}" existed.'.format(name), - "new": 'Zabbix Value map "{}" deleted.'.format(name), + "old": f'Zabbix Value map "{name}" existed.', + "new": f'Zabbix Value map "{name}" deleted.', } } diff --git a/salt/states/zenoss.py b/salt/states/zenoss.py index a2b11e888c7..ed06e9a249d 100644 --- a/salt/states/zenoss.py +++ b/salt/states/zenoss.py @@ -54,30 +54,30 @@ def monitored(name, device_class=None, collector="localhost", prod_state=None): if device: ret["result"] = True ret["changes"] = None - ret["comment"] = "{} is already monitored".format(name) + ret["comment"] = f"{name} is already monitored" # if prod_state is set, ensure it matches with the current state if prod_state is not None and device["productionState"] != prod_state: if __opts__["test"]: ret["comment"] = ( - "{} is already monitored but prodState will be updated".format(name) + f"{name} is already monitored but prodState will be updated" ) ret["result"] = None else: __salt__["zenoss.set_prod_state"](prod_state, name) ret["comment"] = ( - "{} is already monitored but prodState was updated".format(name) + f"{name} is already monitored but prodState was updated" ) ret["changes"] = { "old": "prodState == {}".format(device["productionState"]), - "new": "prodState == {}".format(prod_state), + "new": f"prodState == {prod_state}", } return ret # Device not yet in Zenoss if __opts__["test"]: - ret["comment"] = 'The state of "{}" will be changed.'.format(name) + ret["comment"] = f'The state of "{name}" will be changed.' ret["changes"] = {"old": "monitored == False", "new": "monitored == True"} ret["result"] = None return ret @@ -86,9 +86,9 @@ def monitored(name, device_class=None, collector="localhost", prod_state=None): if __salt__["zenoss.add_device"](name, device_class, collector, prod_state): ret["result"] = True ret["changes"] = {"old": "monitored == False", "new": "monitored == True"} - ret["comment"] = "{} has been added to Zenoss".format(name) + ret["comment"] = f"{name} has been added to Zenoss" else: ret["result"] = False ret["changes"] = None - ret["comment"] = "Unable to add {} to Zenoss".format(name) + ret["comment"] = f"Unable to add {name} to Zenoss" return ret diff --git a/salt/states/zfs.py b/salt/states/zfs.py index b28517ed5a1..0c023f5fd4e 100644 --- a/salt/states/zfs.py +++ b/salt/states/zfs.py @@ -118,7 +118,7 @@ def _absent(name, dataset_type, force=False, recursive=False): ret["comment"] = mod_res["error"] else: ## NOTE: no dataset found with name of the dataset_type - ret["comment"] = "{} {} is absent".format(dataset_type, name) + ret["comment"] = f"{dataset_type} {name} is absent" return ret @@ -145,7 +145,7 @@ def filesystem_absent(name, force=False, recursive=False): "name": name, "changes": {}, "result": False, - "comment": "invalid dataset name: {}".format(name), + "comment": f"invalid dataset name: {name}", } else: ret = _absent(name, "filesystem", force, recursive) @@ -174,7 +174,7 @@ def volume_absent(name, force=False, recursive=False): "name": name, "changes": {}, "result": False, - "comment": "invalid dataset name: {}".format(name), + "comment": f"invalid dataset name: {name}", } else: ret = _absent(name, "volume", force, recursive) @@ -198,7 +198,7 @@ def snapshot_absent(name, force=False, recursive=False): "name": name, "changes": {}, "result": False, - "comment": "invalid snapshot name: {}".format(name), + "comment": f"invalid snapshot name: {name}", } else: ret = _absent(name, "snapshot", force, recursive) @@ -222,7 +222,7 @@ def bookmark_absent(name, force=False, recursive=False): "name": name, "changes": {}, "result": False, - "comment": "invalid bookmark name: {}".format(name), + "comment": f"invalid bookmark name: {name}", } else: ret = _absent(name, "bookmark", force, recursive) @@ -250,7 +250,7 @@ def hold_absent(name, snapshot, recursive=False): ## check we have a snapshot/tag name if not __utils__["zfs.is_snapshot"](snapshot): ret["result"] = False - ret["comment"] = "invalid snapshot name: {}".format(snapshot) + ret["comment"] = f"invalid snapshot name: {snapshot}" return ret if ( @@ -259,7 +259,7 @@ def hold_absent(name, snapshot, recursive=False): or name == "error" ): ret["result"] = False - ret["comment"] = "invalid tag name: {}".format(name) + ret["comment"] = f"invalid tag name: {name}" return ret ## release hold if required @@ -319,7 +319,7 @@ def hold_present(name, snapshot, recursive=False): ## check we have a snapshot/tag name if not __utils__["zfs.is_snapshot"](snapshot): ret["result"] = False - ret["comment"] = "invalid snapshot name: {}".format(snapshot) + ret["comment"] = f"invalid snapshot name: {snapshot}" return ret if ( @@ -328,7 +328,7 @@ def hold_present(name, snapshot, recursive=False): or name == "error" ): ret["result"] = False - ret["comment"] = "invalid tag name: {}".format(name) + ret["comment"] = f"invalid tag name: {name}" return ret ## place hold if required @@ -349,9 +349,9 @@ def hold_present(name, snapshot, recursive=False): ret["result"] = mod_res["held"] if ret["result"]: ret["changes"] = OrderedDict([(snapshot, OrderedDict([(name, "held")]))]) - ret["comment"] = "hold {} added to {}".format(name, snapshot) + ret["comment"] = f"hold {name} added to {snapshot}" else: - ret["comment"] = "failed to add hold {} to {}".format(name, snapshot) + ret["comment"] = f"failed to add hold {name} to {snapshot}" if "error" in mod_res: ret["comment"] = mod_res["error"] @@ -440,19 +440,19 @@ def _dataset_present( ## check we have valid filesystem name/volume name/clone snapshot if not __utils__["zfs.is_dataset"](name): ret["result"] = False - ret["comment"] = "invalid dataset name: {}".format(name) + ret["comment"] = f"invalid dataset name: {name}" return ret if cloned_from and not __utils__["zfs.is_snapshot"](cloned_from): ret["result"] = False - ret["comment"] = "{} is not a snapshot".format(cloned_from) + ret["comment"] = f"{cloned_from} is not a snapshot" return ret ## ensure dataset is in correct state ## NOTE: update the dataset exists = __salt__["zfs.exists"](name, **{"type": dataset_type}) if exists and len(properties) == 0: - ret["comment"] = "{} {} is uptodate".format(dataset_type, name) + ret["comment"] = f"{dataset_type} {name} is uptodate" elif exists and len(properties) > 0: ## NOTE: fetch current volume properties properties_current = __salt__["zfs.get"]( @@ -500,11 +500,11 @@ def _dataset_present( ## NOTE: update comment if ret["result"] and name in ret["changes"]: - ret["comment"] = "{} {} was updated".format(dataset_type, name) + ret["comment"] = f"{dataset_type} {name} was updated" elif ret["result"]: - ret["comment"] = "{} {} is uptodate".format(dataset_type, name) + ret["comment"] = f"{dataset_type} {name} is uptodate" else: - ret["comment"] = "{} {} failed to be updated".format(dataset_type, name) + ret["comment"] = f"{dataset_type} {name} failed to be updated" ## NOTE: create or clone the dataset elif not exists: @@ -521,7 +521,7 @@ def _dataset_present( mod_res = __salt__["zfs.clone"]( cloned_from, name, - **{"create_parent": create_parent, "properties": properties} + **{"create_parent": create_parent, "properties": properties}, ) else: ## NOTE: create the dataset @@ -532,7 +532,7 @@ def _dataset_present( "properties": properties, "volume_size": volume_size, "sparse": sparse, - } + }, ) ret["result"] = mod_res[mod_res_action] @@ -658,7 +658,7 @@ def bookmark_present(name, snapshot): ## check we have valid snapshot/bookmark name if not __utils__["zfs.is_snapshot"](snapshot): ret["result"] = False - ret["comment"] = "invalid snapshot name: {}".format(name) + ret["comment"] = f"invalid snapshot name: {name}" return ret if "#" not in name and "/" not in name: @@ -670,7 +670,7 @@ def bookmark_present(name, snapshot): if not __utils__["zfs.is_bookmark"](name): ret["result"] = False - ret["comment"] = "invalid bookmark name: {}".format(name) + ret["comment"] = f"invalid bookmark name: {name}" return ret ## ensure bookmark exists @@ -684,9 +684,9 @@ def bookmark_present(name, snapshot): ret["result"] = mod_res["bookmarked"] if ret["result"]: ret["changes"][name] = snapshot - ret["comment"] = "{} bookmarked as {}".format(snapshot, name) + ret["comment"] = f"{snapshot} bookmarked as {name}" else: - ret["comment"] = "failed to bookmark {}".format(snapshot) + ret["comment"] = f"failed to bookmark {snapshot}" if "error" in mod_res: ret["comment"] = mod_res["error"] else: @@ -724,7 +724,7 @@ def snapshot_present(name, recursive=False, properties=None): ## check we have valid snapshot name if not __utils__["zfs.is_snapshot"](name): ret["result"] = False - ret["comment"] = "invalid snapshot name: {}".format(name) + ret["comment"] = f"invalid snapshot name: {name}" return ret ## ensure snapshot exits @@ -742,9 +742,9 @@ def snapshot_present(name, recursive=False, properties=None): ret["changes"][name] = "snapshotted" if properties: ret["changes"][name] = properties - ret["comment"] = "snapshot {} was created".format(name) + ret["comment"] = f"snapshot {name} was created" else: - ret["comment"] = "failed to create snapshot {}".format(name) + ret["comment"] = f"failed to create snapshot {name}" if "error" in mod_res: ret["comment"] = mod_res["error"] else: @@ -772,14 +772,14 @@ def promoted(name): ## check we if we have a valid dataset name if not __utils__["zfs.is_dataset"](name): ret["result"] = False - ret["comment"] = "invalid dataset name: {}".format(name) + ret["comment"] = f"invalid dataset name: {name}" return ret ## ensure dataset is the primary instance if not __salt__["zfs.exists"](name, **{"type": "filesystem,volume"}): ## NOTE: we don't have a dataset ret["result"] = False - ret["comment"] = "dataset {} does not exist".format(name) + ret["comment"] = f"dataset {name} does not exist" else: ## NOTE: check if we have a blank origin (-) if ( @@ -789,7 +789,7 @@ def promoted(name): == "-" ): ## NOTE: we're already promoted - ret["comment"] = "{} already promoted".format(name) + ret["comment"] = f"{name} already promoted" else: ## NOTE: promote dataset if not __opts__["test"]: @@ -800,9 +800,9 @@ def promoted(name): ret["result"] = mod_res["promoted"] if ret["result"]: ret["changes"][name] = "promoted" - ret["comment"] = "{} promoted".format(name) + ret["comment"] = f"{name} promoted" else: - ret["comment"] = "failed to promote {}".format(name) + ret["comment"] = f"failed to promote {name}" if "error" in mod_res: ret["comment"] = mod_res["error"] @@ -833,7 +833,7 @@ def _schedule_snapshot_retrieve(dataset, prefix, snapshots): snap_name = snap[snap.index("@") + 1 :] ## NOTE: we only want snapshots matching our prefix - if not snap_name.startswith("{}-".format(prefix)): + if not snap_name.startswith(f"{prefix}-"): continue ## NOTE: retrieve the holds for this snapshot @@ -886,7 +886,7 @@ def _schedule_snapshot_prepare(dataset, prefix, snapshots): ## NOTE: extract datetime from snapshot name timestamp = datetime.strptime( snapshots[hold][-1], - "{}@{}-%Y%m%d_%H%M%S".format(dataset, prefix), + f"{dataset}@{prefix}-%Y%m%d_%H%M%S", ).replace(second=0, microsecond=0) ## NOTE: compare current timestamp to timestamp from snapshot @@ -954,15 +954,15 @@ def scheduled_snapshot(name, prefix, recursive=True, schedule=None): ## NOTE: we need a valid dataset if not __utils__["zfs.is_dataset"](name): ret["result"] = False - ret["comment"] = "invalid dataset name: {}".format(name) + ret["comment"] = f"invalid dataset name: {name}" if not __salt__["zfs.exists"](name, **{"type": "filesystem,volume"}): - ret["comment"] = "dataset {} does not exist".format(name) + ret["comment"] = f"dataset {name} does not exist" ret["result"] = False ## NOTE: prefix must be 4 or longer if not prefix or len(prefix) < 4: - ret["comment"] = "prefix ({}) must be at least 4 long".format(prefix) + ret["comment"] = f"prefix ({prefix}) must be at least 4 long" ret["result"] = False ## NOTE: validate schedule @@ -1015,7 +1015,7 @@ def scheduled_snapshot(name, prefix, recursive=True, schedule=None): if not mod_res["snapshotted"]: ret["result"] = False - ret["comment"] = "error creating snapshot ({})".format(snapshot_name) + ret["comment"] = f"error creating snapshot ({snapshot_name})" else: ## NOTE: create holds (if we have a snapshot) for hold in snapshot_holds: diff --git a/salt/states/zk_concurrency.py b/salt/states/zk_concurrency.py index 0bf709911fc..d376e51c955 100644 --- a/salt/states/zk_concurrency.py +++ b/salt/states/zk_concurrency.py @@ -102,7 +102,7 @@ def lock( max_concurrency=max_concurrency, timeout=timeout, ephemeral_lease=ephemeral_lease, - **conn_kwargs + **conn_kwargs, ) if locked: ret["result"] = True @@ -151,13 +151,13 @@ def unlock( identifier=identifier, max_concurrency=max_concurrency, ephemeral_lease=ephemeral_lease, - **conn_kwargs + **conn_kwargs, ) if unlocked: ret["result"] = True else: - ret["comment"] = "Unable to find lease for path {}".format(name) + ret["comment"] = f"Unable to find lease for path {name}" return ret diff --git a/salt/states/zone.py b/salt/states/zone.py index e4a1af32a32..0c908ed34c4 100644 --- a/salt/states/zone.py +++ b/salt/states/zone.py @@ -238,7 +238,7 @@ def property_absent(name, property): elif zonecfg[property] != zonecfg_new[property]: ret["changes"][property] = zonecfg_new[property] if ret["comment"] == "": - ret["comment"] = "The property {} was cleared!".format(property) + ret["comment"] = f"The property {property} was cleared!" elif ret["comment"] == "": if ret["comment"] == "": ret["comment"] = "The property {} did not get cleared!".format( @@ -246,7 +246,7 @@ def property_absent(name, property): ) else: ret["result"] = True - ret["comment"] = "The property {} does not exist!".format(property) + ret["comment"] = f"The property {property} does not exist!" else: ## zone does not exist ret["result"] = False @@ -336,7 +336,7 @@ def resource_present( ) # note: something odd with ncpus property, we fix it here for now if key == "ncpus" and key in kwargs: - kwargs[key] = "{:.2f}".format(float(kwargs[key])) + kwargs[key] = f"{float(kwargs[key]):.2f}" if key not in resource: ret["result"] = None @@ -568,7 +568,7 @@ def booted(name, single=False): if zones[name]["state"] == "running": ## zone is running ret["result"] = True - ret["comment"] = "Zone {} already booted".format(name) + ret["comment"] = f"Zone {name} already booted" else: ## try and boot the zone if not __opts__["test"]: @@ -576,15 +576,15 @@ def booted(name, single=False): if __opts__["test"] or zoneadm_res["status"]: ret["result"] = True ret["changes"][name] = "booted" - ret["comment"] = "Zone {} booted".format(name) + ret["comment"] = f"Zone {name} booted" else: ret["result"] = False - ret["comment"] = "Failed to boot {}".format(name) + ret["comment"] = f"Failed to boot {name}" else: ## zone does not exist ret["comment"] = [] ret["comment"].append( - "The zone {} is not in the installed or booted state.".format(name) + f"The zone {name} is not in the installed or booted state." ) for zone in zones: if zones[zone]["uuid"] == name: @@ -619,7 +619,7 @@ def halted(name, graceful=True): if zones[name]["state"] != "running": ## zone is not running ret["result"] = True - ret["comment"] = "Zone {} already halted".format(name) + ret["comment"] = f"Zone {name} already halted" else: ## try and halt the zone if not __opts__["test"]: @@ -631,14 +631,14 @@ def halted(name, graceful=True): if __opts__["test"] or zoneadm_res["status"]: ret["result"] = True ret["changes"][name] = "halted" - ret["comment"] = "Zone {} halted".format(name) + ret["comment"] = f"Zone {name} halted" else: ret["result"] = False - ret["comment"] = "Failed to halt {}".format(name) + ret["comment"] = f"Failed to halt {name}" else: ## zone does not exist ret["comment"] = [] - ret["comment"].append("The zone {} is not in the installed state.".format(name)) + ret["comment"].append(f"The zone {name} is not in the installed state.") for zone in zones: if zones[zone]["uuid"] == name: ret["comment"].append( @@ -761,7 +761,7 @@ def export(name, path, replace=False): else: ## zone does not exist ret["comment"] = [] - ret["comment"].append("The zone {} does not exist.".format(name)) + ret["comment"].append(f"The zone {name} does not exist.") for zone in zones: if zones[zone]["uuid"] == name: ret["comment"].append( @@ -820,9 +820,7 @@ def import_(name, path, mode="import", nodataset=False, brand_opts=None): res_import = __salt__["zonecfg.import"](name, path) if not res_import["status"]: ret["result"] = False - ret["comment"] = ( - "Unable to import zone configuration for {}!".format(name) - ) + ret["comment"] = f"Unable to import zone configuration for {name}!" else: ret["result"] = True ret["changes"][name] = "imported" @@ -874,9 +872,7 @@ def import_(name, path, mode="import", nodataset=False, brand_opts=None): ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = False - ret["comment"] = ( - "The file {} does not exists, unable to import!".format(path) - ) + ret["comment"] = f"The file {path} does not exists, unable to import!" else: ## zone exist ret["result"] = True @@ -944,7 +940,7 @@ def present(name, brand, zonepath, properties=None, resources=None): if __opts__["test"]: ret["result"] = None ret["comment"].append( - "Cannot determine of changes would happen to the zone {}.".format(name) + f"Cannot determine of changes would happen to the zone {name}." ) ## create zone if needed @@ -959,7 +955,7 @@ def present(name, brand, zonepath, properties=None, resources=None): if res_create["status"]: ret["result"] = True ret["changes"][name] = "created" - ret["comment"].append("The zone {} was created.".format(name)) + ret["comment"].append(f"The zone {name} was created.") if not __opts__["test"]: ret["result"] = True @@ -1073,7 +1069,7 @@ def absent(name, uninstall=False): if __opts__["test"]: ret["result"] = True ret["changes"][name] = "removed" - ret["comment"] = "Zone {} was removed.".format(name) + ret["comment"] = f"Zone {name} was removed." else: ret["result"] = True if uninstall and zones[name]["state"] in ["running", "installed"]: @@ -1082,10 +1078,10 @@ def absent(name, uninstall=False): ret["result"] = res_uninstall["status"] if ret["result"]: ret["changes"][name] = "uninstalled" - ret["comment"] = "The zone {} was uninstalled.".format(name) + ret["comment"] = f"The zone {name} was uninstalled." else: ret["comment"] = [] - ret["comment"].append("Failed to uninstall zone {}!".format(name)) + ret["comment"].append(f"Failed to uninstall zone {name}!") if "message" in res_uninstall: ret["comment"].append(res_uninstall["message"]) ret["comment"] = "\n".join(ret["comment"]) @@ -1094,10 +1090,10 @@ def absent(name, uninstall=False): ret["result"] = res_detach["status"] if ret["result"]: ret["changes"][name] = "detached" - ret["comment"] = "The zone {} was detached.".format(name) + ret["comment"] = f"The zone {name} was detached." else: ret["comment"] = [] - ret["comment"].append("Failed to detach zone {}!".format(name)) + ret["comment"].append(f"Failed to detach zone {name}!") if "message" in res_detach: ret["comment"].append(res_detach["message"]) ret["comment"] = "\n".join(ret["comment"]) @@ -1106,16 +1102,16 @@ def absent(name, uninstall=False): ret["result"] = res_delete["status"] if ret["result"]: ret["changes"][name] = "deleted" - ret["comment"] = "The zone {} was delete.".format(name) + ret["comment"] = f"The zone {name} was delete." else: ret["comment"] = [] - ret["comment"].append("Failed to delete zone {}!".format(name)) + ret["comment"].append(f"Failed to delete zone {name}!") if "message" in res_delete: ret["comment"].append(res_delete["message"]) ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = True - ret["comment"] = "Zone {} does not exist.".format(name) + ret["comment"] = f"Zone {name} does not exist." return ret @@ -1142,19 +1138,19 @@ def attached(name, force=False): ret["result"] = res_attach["status"] if ret["result"]: ret["changes"][name] = "attached" - ret["comment"] = "The zone {} was attached.".format(name) + ret["comment"] = f"The zone {name} was attached." else: ret["comment"] = [] - ret["comment"].append("Failed to attach zone {}!".format(name)) + ret["comment"].append(f"Failed to attach zone {name}!") if "message" in res_attach: ret["comment"].append(res_attach["message"]) ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = True - ret["comment"] = "zone {} already attached.".format(name) + ret["comment"] = f"zone {name} already attached." else: ret["result"] = False - ret["comment"] = "zone {} is not configured!".format(name) + ret["comment"] = f"zone {name} is not configured!" return ret @@ -1179,20 +1175,20 @@ def detached(name): ret["result"] = res_detach["status"] if ret["result"]: ret["changes"][name] = "detached" - ret["comment"] = "The zone {} was detached.".format(name) + ret["comment"] = f"The zone {name} was detached." else: ret["comment"] = [] - ret["comment"].append("Failed to detach zone {}!".format(name)) + ret["comment"].append(f"Failed to detach zone {name}!") if "message" in res_detach: ret["comment"].append(res_detach["message"]) ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = True - ret["comment"] = "zone {} already detached.".format(name) + ret["comment"] = f"zone {name} already detached." else: ## note: a non existing zone is not attached, we do not consider this a failure ret["result"] = True - ret["comment"] = "zone {} is not configured!".format(name) + ret["comment"] = f"zone {name} is not configured!" return ret @@ -1221,19 +1217,19 @@ def installed(name, nodataset=False, brand_opts=None): ret["result"] = res_install["status"] if ret["result"]: ret["changes"][name] = "installed" - ret["comment"] = "The zone {} was installed.".format(name) + ret["comment"] = f"The zone {name} was installed." else: ret["comment"] = [] - ret["comment"].append("Failed to install zone {}!".format(name)) + ret["comment"].append(f"Failed to install zone {name}!") if "message" in res_install: ret["comment"].append(res_install["message"]) ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = True - ret["comment"] = "zone {} already installed.".format(name) + ret["comment"] = f"zone {name} already installed." else: ret["result"] = False - ret["comment"] = "zone {} is not configured!".format(name) + ret["comment"] = f"zone {name} is not configured!" return ret @@ -1258,19 +1254,19 @@ def uninstalled(name): ret["result"] = res_uninstall["status"] if ret["result"]: ret["changes"][name] = "uninstalled" - ret["comment"] = "The zone {} was uninstalled.".format(name) + ret["comment"] = f"The zone {name} was uninstalled." else: ret["comment"] = [] - ret["comment"].append("Failed to uninstall zone {}!".format(name)) + ret["comment"].append(f"Failed to uninstall zone {name}!") if "message" in res_uninstall: ret["comment"].append(res_uninstall["message"]) ret["comment"] = "\n".join(ret["comment"]) else: ret["result"] = True - ret["comment"] = "zone {} already uninstalled.".format(name) + ret["comment"] = f"zone {name} already uninstalled." else: ## note: a non existing zone is not installed, we do not consider this a failure ret["result"] = True - ret["comment"] = "zone {} is not configured!".format(name) + ret["comment"] = f"zone {name} is not configured!" return ret diff --git a/salt/states/zookeeper.py b/salt/states/zookeeper.py index 2f629afa76b..e6674e9911b 100644 --- a/salt/states/zookeeper.py +++ b/salt/states/zookeeper.py @@ -133,7 +133,7 @@ def present( ret = { "name": name, "result": False, - "comment": "Failed to setup znode {}".format(name), + "comment": f"Failed to setup znode {name}", "changes": {}, } connkwargs = { @@ -161,7 +161,7 @@ def present( return ret elif __opts__["test"] is True: ret["result"] = None - ret["comment"] = "Znode {} is will be updated".format(name) + ret["comment"] = f"Znode {name} is will be updated" ret["changes"]["old"] = {} ret["changes"]["new"] = {} if value != cur_value: @@ -189,12 +189,12 @@ def present( ret["changes"] = changes if value_result and acl_result: ret["result"] = True - ret["comment"] = "Znode {} successfully updated".format(name) + ret["comment"] = f"Znode {name} successfully updated" return ret if __opts__["test"] is True: ret["result"] = None - ret["comment"] = "{} is will be created".format(name) + ret["comment"] = f"{name} is will be created" ret["changes"]["old"] = {} ret["changes"]["new"] = {} ret["changes"]["new"]["acls"] = chk_acls @@ -219,7 +219,7 @@ def present( ret["changes"] = changes if value_result and acl_result: ret["result"] = True - ret["comment"] = "Znode {} successfully created".format(name) + ret["comment"] = f"Znode {name} successfully created" return ret @@ -277,7 +277,7 @@ def absent( ret = { "name": name, "result": False, - "comment": "Failed to delete znode {}".format(name), + "comment": f"Failed to delete znode {name}", "changes": {}, } connkwargs = { @@ -291,7 +291,7 @@ def absent( if __salt__["zookeeper.exists"](name, **connkwargs) is False: ret["result"] = True - ret["comment"] = "Znode {} does not exist".format(name) + ret["comment"] = f"Znode {name} does not exist" return ret changes = {} @@ -302,7 +302,7 @@ def absent( if __opts__["test"] is True: ret["result"] = None - ret["comment"] = "Znode {} will be removed".format(name) + ret["comment"] = f"Znode {name} will be removed" ret["changes"]["old"] = changes return ret @@ -310,7 +310,7 @@ def absent( if __salt__["zookeeper.exists"](name, **connkwargs) is False: ret["result"] = True - ret["comment"] = "Znode {} has been removed".format(name) + ret["comment"] = f"Znode {name} has been removed" ret["changes"]["old"] = changes return ret @@ -374,7 +374,7 @@ def acls( ret = { "name": name, "result": False, - "comment": "Failed to set acls on znode {}".format(name), + "comment": f"Failed to set acls on znode {name}", "changes": {}, } connkwargs = { @@ -396,12 +396,12 @@ def acls( cur_acls = __salt__["zookeeper.get_acls"](name, **connkwargs) if _check_acls(cur_acls, chk_acls): ret["result"] = True - ret["comment"] = "Znode {} acls already set".format(name) + ret["comment"] = f"Znode {name} acls already set" return ret if __opts__["test"] is True: ret["result"] = None - ret["comment"] = "Znode {} acls will be updated".format(name) + ret["comment"] = f"Znode {name} acls will be updated" ret["changes"]["old"] = cur_acls ret["changes"]["new"] = chk_acls return ret @@ -412,7 +412,7 @@ def acls( ret["changes"] = {"old": cur_acls, "new": new_acls} if _check_acls(new_acls, chk_acls): ret["result"] = True - ret["comment"] = "Znode {} acls updated".format(name) + ret["comment"] = f"Znode {name} acls updated" return ret - ret["comment"] = "Znode {} acls failed to update".format(name) + ret["comment"] = f"Znode {name} acls failed to update" return ret diff --git a/salt/states/zpool.py b/salt/states/zpool.py index 4c8c7b4f3af..ef7407a532a 100644 --- a/salt/states/zpool.py +++ b/salt/states/zpool.py @@ -361,7 +361,7 @@ def present( ret["result"] = mod_res["imported"] if ret["result"]: ret["changes"][name] = "imported" - ret["comment"] = "storage pool {} was imported".format(name) + ret["comment"] = f"storage pool {name} was imported" # create pool if not ret["result"] and vdevs: @@ -372,17 +372,17 @@ def present( *vdevs, force=config["force"], properties=properties, - filesystem_properties=filesystem_properties + filesystem_properties=filesystem_properties, ) ret["result"] = mod_res["created"] if ret["result"]: ret["changes"][name] = "created" - ret["comment"] = "storage pool {} was created".format(name) + ret["comment"] = f"storage pool {name} was created" elif "error" in mod_res: ret["comment"] = mod_res["error"] else: - ret["comment"] = "could not create storage pool {}".format(name) + ret["comment"] = f"could not create storage pool {name}" # give up, we cannot import the pool and we do not have a layout to create it if not ret["result"] and not vdevs: @@ -439,6 +439,6 @@ def absent(name, export=False, force=False): else: # we are looking good ret["result"] = True - ret["comment"] = "storage pool {} is absent".format(name) + ret["comment"] = f"storage pool {name} is absent" return ret diff --git a/salt/template.py b/salt/template.py index 1836259257f..7cdd8ed2055 100644 --- a/salt/template.py +++ b/salt/template.py @@ -34,7 +34,7 @@ def compile_template( sls="", input_data="", context=None, - **kwargs + **kwargs, ): """ Take the path to a template and return the high data structure @@ -209,7 +209,7 @@ for comb in ( ): fmt, tmpl = comb.split("_") - OLD_STYLE_RENDERERS[comb] = "{}|{}".format(tmpl, fmt) + OLD_STYLE_RENDERERS[comb] = f"{tmpl}|{fmt}" def check_render_pipe_str(pipestr, renderers, blacklist, whitelist): diff --git a/salt/thorium/__init__.py b/salt/thorium/__init__.py index 97b37d75b95..6dffc972a07 100644 --- a/salt/thorium/__init__.py +++ b/salt/thorium/__init__.py @@ -50,7 +50,7 @@ class ThorState(salt.state.HighState): regdata = {} if self.reg_ret is not None: try: - regdata = self.returners["{}.load_reg".format(self.reg_ret)]() + regdata = self.returners[f"{self.reg_ret}.load_reg"]() except Exception as exc: # pylint: disable=broad-except log.error(exc) @@ -68,7 +68,7 @@ class ThorState(salt.state.HighState): if not minions: return cache for minion in minions: - total = self.cache.fetch("minions/{}".format(minion), "data") + total = self.cache.fetch(f"minions/{minion}", "data") if "pillar" in total: if self.pillar_keys: @@ -176,5 +176,5 @@ class ThorState(salt.state.HighState): cache = self.gather_cache() chunks = self.get_chunks() if self.reg_ret is not None: - self.returners["{}.save_reg".format(self.reg_ret)](chunks) + self.returners[f"{self.reg_ret}.save_reg"](chunks) r_start = time.time() diff --git a/salt/thorium/calc.py b/salt/thorium/calc.py index b01b4d37c58..d5487966a54 100644 --- a/salt/thorium/calc.py +++ b/salt/thorium/calc.py @@ -48,7 +48,7 @@ def calc(name, num, oper, minimum=0, maximum=0, ref=None): """ ret = {"name": name, "changes": {}, "comment": "", "result": True} if name not in __reg__: - ret["comment"] = "{} not found in register".format(name) + ret["comment"] = f"{name} not found in register" ret["result"] = False def opadd(vals): diff --git a/salt/thorium/check.py b/salt/thorium/check.py index ee41cfb9034..48149f3c426 100644 --- a/salt/thorium/check.py +++ b/salt/thorium/check.py @@ -35,7 +35,7 @@ def gt(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] > value: ret["result"] = True @@ -65,7 +65,7 @@ def gte(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] >= value: ret["result"] = True @@ -95,7 +95,7 @@ def lt(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] < value: ret["result"] = True @@ -125,7 +125,7 @@ def lte(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] <= value: ret["result"] = True @@ -155,7 +155,7 @@ def eq(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] == value: ret["result"] = True @@ -185,7 +185,7 @@ def ne(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] != value: ret["result"] = True @@ -224,7 +224,7 @@ def contains( ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret try: count_compare = ( @@ -305,7 +305,7 @@ def len_gt(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if len(__reg__[name]["val"]) > value: ret["result"] = True @@ -335,7 +335,7 @@ def len_gte(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if len(__reg__[name]["val"]) >= value: ret["result"] = True @@ -365,7 +365,7 @@ def len_lt(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if len(__reg__[name]["val"]) < value: ret["result"] = True @@ -395,7 +395,7 @@ def len_lte(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if len(__reg__[name]["val"]) <= value: ret["result"] = True @@ -425,7 +425,7 @@ def len_eq(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if __reg__[name]["val"] == value: ret["result"] = True @@ -455,7 +455,7 @@ def len_ne(name, value): ret = {"name": name, "result": False, "comment": "", "changes": {}} if name not in __reg__: ret["result"] = False - ret["comment"] = "Value {} not in register".format(name) + ret["comment"] = f"Value {name} not in register" return ret if len(__reg__[name]["val"]) != value: ret["result"] = True diff --git a/salt/tokens/localfs.py b/salt/tokens/localfs.py index 8e739ae11be..93cfffa934f 100644 --- a/salt/tokens/localfs.py +++ b/salt/tokens/localfs.py @@ -30,7 +30,7 @@ def mk_token(opts, tdata): hash_type = getattr(hashlib, opts.get("hash_type", DEFAULT_HASH_TYPE)) tok = str(hash_type(os.urandom(512)).hexdigest()) t_path = os.path.join(opts["token_dir"], tok) - temp_t_path = "{}.tmp".format(t_path) + temp_t_path = f"{t_path}.tmp" while os.path.isfile(t_path): tok = str(hash_type(os.urandom(512)).hexdigest()) t_path = os.path.join(opts["token_dir"], tok) diff --git a/salt/tops/reclass_adapter.py b/salt/tops/reclass_adapter.py index 65fe33b0a5f..9b04bb55b58 100644 --- a/salt/tops/reclass_adapter.py +++ b/salt/tops/reclass_adapter.py @@ -120,7 +120,7 @@ def top(**kwargs): except ImportError as e: if "reclass" in str(e): raise SaltInvocationError( - "master_tops.reclass: cannot find reclass module in {}".format(sys.path) + f"master_tops.reclass: cannot find reclass module in {sys.path}" ) else: raise @@ -128,9 +128,7 @@ def top(**kwargs): except TypeError as e: if "unexpected keyword argument" in str(e): arg = str(e).split()[-1] - raise SaltInvocationError( - "master_tops.reclass: unexpected option: {}".format(arg) - ) + raise SaltInvocationError(f"master_tops.reclass: unexpected option: {arg}") else: raise @@ -143,4 +141,4 @@ def top(**kwargs): raise except ReclassException as e: - raise SaltInvocationError("master_tops.reclass: {}".format(str(e))) + raise SaltInvocationError(f"master_tops.reclass: {str(e)}") diff --git a/salt/transport/base.py b/salt/transport/base.py index 2e4f68e4cc0..00e9315db3c 100644 --- a/salt/transport/base.py +++ b/salt/transport/base.py @@ -74,7 +74,7 @@ def publish_server(opts, **kwargs): import salt.transport.local return salt.transport.local.LocalPubServerChannel(opts, **kwargs) - raise Exception("Transport type not found: {}".format(ttype)) + raise Exception(f"Transport type not found: {ttype}") def publish_client(opts, io_loop): @@ -94,7 +94,7 @@ def publish_client(opts, io_loop): import salt.transport.tcp return salt.transport.tcp.TCPPubClient(opts, io_loop) - raise Exception("Transport type not found: {}".format(ttype)) + raise Exception(f"Transport type not found: {ttype}") class TransportWarning(Warning): diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index e2278dff055..64776d204da 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -455,7 +455,7 @@ class RequestServer(salt.transport.base.DaemonizedRequestServer): signal.signal(signal.SIGTERM, self._handle_signals) def _handle_signals(self, signum, sigframe): - msg = "{} received a ".format(self.__class__.__name__) + msg = f"{self.__class__.__name__} received a " if signum == signal.SIGINT: msg += "SIGINT" elif signum == signal.SIGTERM: diff --git a/salt/utils/asynchronous.py b/salt/utils/asynchronous.py index b156c020ab3..f0048ff1910 100644 --- a/salt/utils/asynchronous.py +++ b/salt/utils/asynchronous.py @@ -81,7 +81,7 @@ class SyncWrapper: self._async_methods += self.obj._coroutines def __repr__(self): - return " self.size: self.sweep() - regex = re.compile("{}{}{}".format(self.prepend, pattern, self.append)) + regex = re.compile(f"{self.prepend}{pattern}{self.append}") self.cache[pattern] = [1, regex, pattern, time.time()] return regex @@ -298,7 +298,7 @@ class ContextCache: Create a context cache """ self.opts = opts - self.cache_path = os.path.join(opts["cachedir"], "context", "{}.p".format(name)) + self.cache_path = os.path.join(opts["cachedir"], "context", f"{name}.p") def cache_context(self, context): """ diff --git a/salt/utils/color.py b/salt/utils/color.py index 37da77472a6..8ef55ccad20 100644 --- a/salt/utils/color.py +++ b/salt/utils/color.py @@ -27,7 +27,7 @@ def get_color_theme(theme): colors = salt.utils.data.decode(salt.utils.yaml.safe_load(fp_)) ret = {} for color in colors: - ret[color] = "\033[{}m".format(colors[color]) + ret[color] = f"\033[{colors[color]}m" if not isinstance(colors, dict): log.warning("The theme file %s is not a dict", theme) return {} diff --git a/salt/utils/configcomparer.py b/salt/utils/configcomparer.py index ef67e65e5f1..1ab770a5a96 100644 --- a/salt/utils/configcomparer.py +++ b/salt/utils/configcomparer.py @@ -32,7 +32,7 @@ def compare_and_update_config(config, update_config, changes, namespace=""): for key, value in config.items(): _namespace = key if namespace: - _namespace = "{}.{}".format(namespace, _namespace) + _namespace = f"{namespace}.{_namespace}" update_config[key] = compare_and_update_config( value, update_config.get(key, None), @@ -61,9 +61,9 @@ def compare_and_update_config(config, update_config, changes, namespace=""): # iterate through config list, ensuring that each index in the # update_config list is the same for idx, item in enumerate(config): - _namespace = "[{}]".format(idx) + _namespace = f"[{idx}]" if namespace: - _namespace = "{}{}".format(namespace, _namespace) + _namespace = f"{namespace}{_namespace}" _update = None if len(update_config) > idx: _update = update_config[idx] @@ -86,9 +86,9 @@ def compare_and_update_config(config, update_config, changes, namespace=""): for idx, old_item in enumerate(update_config): if idx < len(config): continue - _namespace = "[{}]".format(idx) + _namespace = f"[{idx}]" if namespace: - _namespace = "{}{}".format(namespace, _namespace) + _namespace = f"{namespace}{_namespace}" changes[_namespace] = { "new": None, "old": old_item, diff --git a/salt/utils/crypt.py b/salt/utils/crypt.py index de892d55597..044eebe7a77 100644 --- a/salt/utils/crypt.py +++ b/salt/utils/crypt.py @@ -112,9 +112,7 @@ def decrypt( rend_func = renderers.get(rend) if rend_func is None: - raise SaltInvocationError( - "Decryption renderer '{}' is not available".format(rend) - ) + raise SaltInvocationError(f"Decryption renderer '{rend}' is not available") return rend_func(data, translate_newlines=translate_newlines) @@ -160,7 +158,7 @@ def pem_finger(path=None, key=None, sum_type="sha256"): for ind, _ in enumerate(pre): if ind % 2: # Is odd - finger += "{}:".format(pre[ind]) + finger += f"{pre[ind]}:" else: finger += pre[ind] return finger.rstrip(":") diff --git a/salt/utils/dateutils.py b/salt/utils/dateutils.py index e219753da6a..2b680672eb6 100644 --- a/salt/utils/dateutils.py +++ b/salt/utils/dateutils.py @@ -46,11 +46,9 @@ def date_cast(date): return datetime.datetime.fromtimestamp(date) except Exception: # pylint: disable=broad-except if HAS_TIMELIB: - raise ValueError("Unable to parse {}".format(date)) + raise ValueError(f"Unable to parse {date}") - raise RuntimeError( - "Unable to parse {}. Consider installing timelib".format(date) - ) + raise RuntimeError(f"Unable to parse {date}. Consider installing timelib") @jinja_filter("date_format") diff --git a/salt/utils/debug.py b/salt/utils/debug.py index e1fda0a8aec..e74bad3dda2 100644 --- a/salt/utils/debug.py +++ b/salt/utils/debug.py @@ -34,7 +34,7 @@ def _handle_sigusr1(sig, stack): output = sys.stderr _makepretty(output, stack) else: - filename = "salt-debug-{}.log".format(int(time.time())) + filename = f"salt-debug-{int(time.time())}.log" destfile = os.path.join(tempfile.gettempdir(), filename) with salt.utils.files.fopen(destfile, "w") as output: _makepretty(output, stack) @@ -50,11 +50,11 @@ def _handle_sigusr2(sig, stack): return if yappi.is_running(): yappi.stop() - filename = "callgrind.salt-{}-{}".format(int(time.time()), os.getpid()) + filename = f"callgrind.salt-{int(time.time())}-{os.getpid()}" destfile = os.path.join(tempfile.gettempdir(), filename) yappi.get_func_stats().save(destfile, type="CALLGRIND") if sys.stderr.isatty(): - sys.stderr.write("Saved profiling data to: {}\n".format(destfile)) + sys.stderr.write(f"Saved profiling data to: {destfile}\n") yappi.clear_stats() else: if sys.stderr.isatty(): @@ -135,5 +135,5 @@ def caller_name(skip=2, include_lineno=False): del parentframe fullname = ".".join(name) if include_lineno and lineno: - fullname += ":{}".format(lineno) + fullname += f":{lineno}" return fullname diff --git a/salt/utils/decorators/__init__.py b/salt/utils/decorators/__init__.py index b849ca31145..4ddf359d23c 100644 --- a/salt/utils/decorators/__init__.py +++ b/salt/utils/decorators/__init__.py @@ -116,7 +116,7 @@ class Depends: @staticmethod def run_command(dependency, mod_name, func_name): - full_name = "{}.{}".format(mod_name, func_name) + full_name = f"{mod_name}.{func_name}" log.trace("Running '%s' for '%s'", dependency, full_name) if IS_WINDOWS: args = salt.utils.args.shlex_split(dependency, posix=False) @@ -229,7 +229,7 @@ class Depends: except (AttributeError, KeyError): pass - mod_key = "{}.{}".format(mod_name, func_name) + mod_key = f"{mod_name}.{func_name}" # if we don't have this module loaded, skip it! if mod_key not in functions: @@ -264,7 +264,7 @@ def timing(function): mod_name = function.__module__[16:] else: mod_name = function.__module__ - fstr = "Function %s.%s took %.{}f seconds to execute".format(sys.float_info.dig) + fstr = f"Function %s.%s took %.{sys.float_info.dig}f seconds to execute" log.profile(fstr, mod_name, function.__name__, end_time - start_time) return ret @@ -291,9 +291,7 @@ def memoize(func): else: str_args.append(arg) - args_ = ",".join( - list(str_args) + ["{}={}".format(k, kwargs[k]) for k in sorted(kwargs)] - ) + args_ = ",".join(list(str_args) + [f"{k}={kwargs[k]}" for k in sorted(kwargs)]) if args_ not in cache: cache[args_] = func(*args, **kwargs) return cache[args_] @@ -624,9 +622,7 @@ class _WithDeprecated(_DeprecationDecorator): "Function '{}' is mentioned both in deprecated " "and superseded sections. Please remove any of that.".format(full_name) ) - old_function = self._globals.get( - self._with_name or "_{}".format(function.__name__) - ) + old_function = self._globals.get(self._with_name or f"_{function.__name__}") if self._policy == self.OPT_IN: self._function = function if use_superseded else old_function else: diff --git a/salt/utils/decorators/path.py b/salt/utils/decorators/path.py index 254593553a3..af08960b3e5 100644 --- a/salt/utils/decorators/path.py +++ b/salt/utils/decorators/path.py @@ -18,7 +18,7 @@ def which(exe): def wrapped(*args, **kwargs): if salt.utils.path.which(exe) is None: raise CommandNotFoundError( - "The '{}' binary was not found in $PATH.".format(exe) + f"The '{exe}' binary was not found in $PATH." ) return function(*args, **kwargs) @@ -38,7 +38,7 @@ def which_bin(exes): if salt.utils.path.which_bin(exes) is None: raise CommandNotFoundError( "None of provided binaries({}) were found in $PATH.".format( - ["'{}'".format(exe) for exe in exes] + [f"'{exe}'" for exe in exes] ) ) return function(*args, **kwargs) diff --git a/salt/utils/decorators/state.py b/salt/utils/decorators/state.py index 569df725f85..0d0fbf4254f 100644 --- a/salt/utils/decorators/state.py +++ b/salt/utils/decorators/state.py @@ -17,7 +17,7 @@ class OutputUnifier: self.policies = [] for pls in policies: if not hasattr(self, pls): - raise SaltException("Unknown policy: {}".format(pls)) + raise SaltException(f"Unknown policy: {pls}") else: self.policies.append(getattr(self, pls)) @@ -35,7 +35,7 @@ class OutputUnifier: "result": False, "name": "later", "changes": {}, - "comment": "An exception occurred in this state: {}".format(exc), + "comment": f"An exception occurred in this state: {exc}", } return data diff --git a/salt/utils/dockermod/translate/container.py b/salt/utils/dockermod/translate/container.py index 8dd21b7dc9f..6d8e012f9ad 100644 --- a/salt/utils/dockermod/translate/container.py +++ b/salt/utils/dockermod/translate/container.py @@ -137,7 +137,7 @@ def binds(val, **kwargs): # pylint: disable=unused-argument val = helpers.split(val) except AttributeError: raise SaltInvocationError( - "'{}' is not a dictionary or list of bind definitions".format(val) + f"'{val}' is not a dictionary or list of bind definitions" ) return val @@ -503,9 +503,7 @@ def ports(val, **kwargs): # pylint: disable=unused-argument if isinstance(val, int): val = [val] else: - raise SaltInvocationError( - "'{}' is not a valid port definition".format(val) - ) + raise SaltInvocationError(f"'{val}' is not a valid port definition") new_ports = set() for item in val: if isinstance(item, int): @@ -514,9 +512,7 @@ def ports(val, **kwargs): # pylint: disable=unused-argument try: item, _, proto = item.partition("/") except AttributeError: - raise SaltInvocationError( - "'{}' is not a valid port definition".format(item) - ) + raise SaltInvocationError(f"'{item}' is not a valid port definition") try: range_start, range_end = helpers.get_port_range(item) except ValueError as exc: @@ -625,7 +621,7 @@ def ulimits(val, **kwargs): # pylint: disable=unused-argument } except (TypeError, ValueError): raise SaltInvocationError( - "Limit '{}' contains non-numeric value(s)".format(item) + f"Limit '{item}' contains non-numeric value(s)" ) return val @@ -647,7 +643,7 @@ def user(val, **kwargs): # pylint: disable=unused-argument if not isinstance(val, (int, str)): raise SaltInvocationError("Value must be a username or uid") elif isinstance(val, int) and val < 0: - raise SaltInvocationError("'{}' is an invalid uid".format(val)) + raise SaltInvocationError(f"'{val}' is an invalid uid") return val @@ -666,7 +662,7 @@ def volumes(val, **kwargs): # pylint: disable=unused-argument val = helpers.translate_stringlist(val) for item in val: if not os.path.isabs(item): - raise SaltInvocationError("'{}' is not an absolute path".format(item)) + raise SaltInvocationError(f"'{item}' is not an absolute path") return val @@ -683,5 +679,5 @@ def working_dir(val, **kwargs): # pylint: disable=unused-argument except AttributeError: is_abs = False if not is_abs: - raise SaltInvocationError("'{}' is not an absolute path".format(val)) + raise SaltInvocationError(f"'{val}' is not an absolute path") return val diff --git a/salt/utils/dockermod/translate/helpers.py b/salt/utils/dockermod/translate/helpers.py index 2b090de0d78..948beb41e94 100644 --- a/salt/utils/dockermod/translate/helpers.py +++ b/salt/utils/dockermod/translate/helpers.py @@ -78,7 +78,7 @@ def get_port_range(port_def): "port range ({})".format(range_start, range_end) ) else: - msg = "'{}' is non-numeric or an invalid port range".format(port_def) + msg = f"'{port_def}' is non-numeric or an invalid port range" raise ValueError(msg) else: return range_start, range_end @@ -113,7 +113,7 @@ def map_vals(val, *names, **extra_opts): ( expected_num_elements if fill is NOTSET - else "up to {}".format(expected_num_elements) + else f"up to {expected_num_elements}" ), ) ) @@ -124,7 +124,7 @@ def map_vals(val, *names, **extra_opts): def validate_ip(val): try: if not salt.utils.network.is_ip(val): - raise SaltInvocationError("'{}' is not a valid IP address".format(val)) + raise SaltInvocationError(f"'{val}' is not a valid IP address") except RuntimeError: pass @@ -132,7 +132,7 @@ def validate_ip(val): def validate_subnet(val): try: if not salt.utils.network.is_subnet(val): - raise SaltInvocationError("'{}' is not a valid subnet".format(val)) + raise SaltInvocationError(f"'{val}' is not a valid subnet") except RuntimeError: pass @@ -146,7 +146,7 @@ def translate_int(val): try: val = int(val) except (TypeError, ValueError): - raise SaltInvocationError("'{}' is not an integer".format(val)) + raise SaltInvocationError(f"'{val}' is not an integer") return val @@ -159,7 +159,7 @@ def translate_dict(val): Not really translating, just raising an exception if it's not a dict """ if not isinstance(val, dict): - raise SaltInvocationError("'{}' is not a dictionary".format(val)) + raise SaltInvocationError(f"'{val}' is not a dictionary") return val @@ -257,9 +257,7 @@ def translate_key_val(val, delimiter="="): try: lvalue, rvalue = split(item, delimiter, 1) except (AttributeError, TypeError, ValueError): - raise SaltInvocationError( - "'{}' is not a key{}value pair".format(item, delimiter) - ) + raise SaltInvocationError(f"'{item}' is not a key{delimiter}value pair") new_val[lvalue] = rvalue return new_val diff --git a/salt/utils/etcd_util.py b/salt/utils/etcd_util.py index 512b4a6583d..25de49cf80f 100644 --- a/salt/utils/etcd_util.py +++ b/salt/utils/etcd_util.py @@ -143,7 +143,7 @@ class EtcdBase: ca=None, client_key=None, client_cert=None, - **kwargs + **kwargs, ): if not kwargs.get("has_etcd_opts", False): etcd_opts = _get_etcd_opts(opts, profile) @@ -201,7 +201,7 @@ class EtcdBase: wait=False, timeout=None, start_revision=None, - **kwargs + **kwargs, ): """ Read a value of a key. @@ -242,9 +242,9 @@ class EtcdBase: for k, v in data.items(): k = k.strip("/") if path: - p = "/{}/{}".format(path, k) + p = f"/{path}/{k}" else: - p = "/{}".format(k) + p = f"/{k}" if isinstance(v, dict): ret = self._flatten(v, p) flat.update(ret) @@ -441,7 +441,7 @@ class EtcdClient(EtcdBase): wait=False, timeout=None, start_revision=None, - **kwargs + **kwargs, ): recursive = kwargs.pop("recursive", None) wait_index = kwargs.pop("waitIndex", None) @@ -487,7 +487,7 @@ class EtcdClient(EtcdBase): if wait: # Wait timeouts will throw ReadTimeoutError, which isn't bad log.debug("etcd: Timed out while executing a wait") - raise EtcdUtilWatchTimeout("Watch on {} timed out".format(key)) + raise EtcdUtilWatchTimeout(f"Watch on {key} timed out") log.error("etcd: Timed out") raise etcd.EtcdConnectionFailed("Connection failed") except MaxRetryError as err: @@ -601,7 +601,7 @@ class EtcdClient(EtcdBase): if item.dir is True: if item.key == path: continue - dir_name = "{}/".format(item.key) + dir_name = f"{item.key}/" ret[dir_name] = {} else: ret[item.key] = item.value @@ -677,7 +677,7 @@ class EtcdClientV3(EtcdBase): raw_keys=False, raw_values=False, unicode_errors=None, - **kwargs + **kwargs, ): if not HAS_ETCD_V3: raise EtcdLibraryNotInstalled("Don't have etcd3-py, need to install it.") @@ -780,7 +780,7 @@ class EtcdClientV3(EtcdBase): wait=False, timeout=None, start_revision=None, - **kwargs + **kwargs, ): recursive = kwargs.pop("recursive", None) wait_index = kwargs.pop("waitIndex", None) diff --git a/salt/utils/event.py b/salt/utils/event.py index a1de7e5ab4f..983402875d6 100644 --- a/salt/utils/event.py +++ b/salt/utils/event.py @@ -306,12 +306,8 @@ class SaltEvent: id_hash = hash_type( salt.utils.stringutils.to_bytes(minion_id) ).hexdigest()[:10] - puburi = os.path.join( - sock_dir, "minion_event_{}_pub.ipc".format(id_hash) - ) - pulluri = os.path.join( - sock_dir, "minion_event_{}_pull.ipc".format(id_hash) - ) + puburi = os.path.join(sock_dir, f"minion_event_{id_hash}_pub.ipc") + pulluri = os.path.join(sock_dir, f"minion_event_{id_hash}_pull.ipc") log.debug("%s PUB socket URI: %s", self.__class__.__name__, puburi) log.debug("%s PULL socket URI: %s", self.__class__.__name__, pulluri) return puburi, pulluri @@ -467,7 +463,7 @@ class SaltEvent: def _get_match_func(self, match_type=None): if match_type is None: match_type = self.opts["event_match_type"] - return getattr(self, "_match_tag_{}".format(match_type), None) + return getattr(self, f"_match_tag_{match_type}", None) def _check_pending(self, tag, match_func=None): """Check the pending_events list for events that match the tag @@ -743,7 +739,7 @@ class SaltEvent: raise ValueError("Empty tag.") if not isinstance(data, MutableMapping): # data must be dict - raise ValueError("Dict object expected, not '{}'.".format(data)) + raise ValueError(f"Dict object expected, not '{data}'.") if not self.cpush: if timeout is not None: @@ -795,7 +791,7 @@ class SaltEvent: raise ValueError("Empty tag.") if not isinstance(data, MutableMapping): # data must be dict - raise ValueError("Dict object expected, not '{}'.".format(data)) + raise ValueError(f"Dict object expected, not '{data}'.") if not self.cpush: if timeout is not None: @@ -894,13 +890,11 @@ class SaltEvent: data["retcode"] = retcode tags = tag.split("_|-") if data.get("result") is False: - self.fire_event( - data, "{}.{}".format(tags[0], tags[-1]) - ) # old dup event + self.fire_event(data, f"{tags[0]}.{tags[-1]}") # old dup event data["jid"] = load["jid"] data["id"] = load["id"] data["success"] = False - data["return"] = "Error: {}.{}".format(tags[0], tags[-1]) + data["return"] = f"Error: {tags[0]}.{tags[-1]}" data["fun"] = fun if "user" in load: data["user"] = load["user"] @@ -1079,12 +1073,12 @@ class AsyncEventPublisher: salt.utils.stringutils.to_bytes(self.opts["id"]) ).hexdigest()[:10] epub_sock_path = os.path.join( - self.opts["sock_dir"], "minion_event_{}_pub.ipc".format(id_hash) + self.opts["sock_dir"], f"minion_event_{id_hash}_pub.ipc" ) if os.path.exists(epub_sock_path): os.unlink(epub_sock_path) epull_sock_path = os.path.join( - self.opts["sock_dir"], "minion_event_{}_pull.ipc".format(id_hash) + self.opts["sock_dir"], f"minion_event_{id_hash}_pull.ipc" ) if os.path.exists(epull_sock_path): os.unlink(epull_sock_path) @@ -1297,7 +1291,7 @@ class EventReturn(salt.utils.process.SignalHandlingProcess): # Multiple event returners for r in self.opts["event_return"]: log.debug("Calling event returner %s, one of many.", r) - event_return = "{}.event_return".format(r) + event_return = f"{r}.event_return" self._flush_event_single(event_return) else: # Only a single event returner diff --git a/salt/utils/extend.py b/salt/utils/extend.py index 5fbef75fbed..2317feb2bf8 100644 --- a/salt/utils/extend.py +++ b/salt/utils/extend.py @@ -174,19 +174,15 @@ def _prompt_choice(var_name, options): :returns: The selected user """ choice_map = OrderedDict( - ("{}".format(i), value) - for i, value in enumerate(options, 1) - if value[0] != "test" + (f"{i}", value) for i, value in enumerate(options, 1) if value[0] != "test" ) choices = choice_map.keys() default = "1" - choice_lines = [ - "{} - {} - {}".format(c[0], c[1][0], c[1][1]) for c in choice_map.items() - ] + choice_lines = [f"{c[0]} - {c[1][0]} - {c[1][1]}" for c in choice_map.items()] prompt = "\n".join( ( - "Select {}:".format(var_name), + f"Select {var_name}:", "\n".join(choice_lines), "Choose from {}".format(", ".join(choices)), ) @@ -272,7 +268,7 @@ def run( if description is None: description = _prompt_user_variable("Short description of the module", "") - template_dir = "templates/{}".format(extension_type) + template_dir = f"templates/{extension_type}" module_name = name param_dict = { diff --git a/salt/utils/extmods.py b/salt/utils/extmods.py index a7dc265476f..f1b8a826448 100644 --- a/salt/utils/extmods.py +++ b/salt/utils/extmods.py @@ -69,7 +69,7 @@ def sync( ret = [] remote = set() source = salt.utils.url.create("_" + form) - mod_dir = os.path.join(opts["extension_modules"], "{}".format(form)) + mod_dir = os.path.join(opts["extension_modules"], f"{form}") touched = False with salt.utils.files.set_umask(0o077): try: @@ -98,7 +98,7 @@ def sync( ) ) local_cache_dir = os.path.join( - opts["cachedir"], "files", sub_env, "_{}".format(form) + opts["cachedir"], "files", sub_env, f"_{form}" ) log.debug("Local cache dir: '%s'", local_cache_dir) for fn_ in cache: @@ -127,13 +127,13 @@ def sync( if src_digest != dst_digest: # The downloaded file differs, replace! shutil.copyfile(fn_, dest) - ret.append("{}.{}".format(form, relname)) + ret.append(f"{form}.{relname}") else: dest_dir = os.path.dirname(dest) if not os.path.isdir(dest_dir): os.makedirs(dest_dir) shutil.copyfile(fn_, dest) - ret.append("{}.{}".format(form, relname)) + ret.append(f"{form}.{relname}") touched = bool(ret) if opts["clean_dynamic_modules"] is True: diff --git a/salt/utils/files.py b/salt/utils/files.py index 6a70ca6f304..e5494911c28 100644 --- a/salt/utils/files.py +++ b/salt/utils/files.py @@ -130,9 +130,9 @@ def copyfile(source, dest, backup_mode="", cachedir=""): specified cache the file. """ if not os.path.isfile(source): - raise OSError("[Errno 2] No such file or directory: {}".format(source)) + raise OSError(f"[Errno 2] No such file or directory: {source}") if not os.path.isdir(os.path.dirname(dest)): - raise OSError("[Errno 2] No such file or directory: {}".format(dest)) + raise OSError(f"[Errno 2] No such file or directory: {dest}") bname = os.path.basename(dest) dname = os.path.dirname(os.path.abspath(dest)) tgt = mkstemp(prefix=bname, dir=dname) @@ -198,9 +198,7 @@ def rename(src, dst): os.remove(dst) except OSError as exc: if exc.errno != errno.ENOENT: - raise MinionError( - "Error: Unable to remove {}: {}".format(dst, exc.strerror) - ) + raise MinionError(f"Error: Unable to remove {dst}: {exc.strerror}") os.rename(src, dst) @@ -221,9 +219,9 @@ def process_read_exception(exc, path, ignore=None): return if exc.errno == errno.ENOENT: - raise CommandExecutionError("{} does not exist".format(path)) + raise CommandExecutionError(f"{path} does not exist") elif exc.errno == errno.EACCES: - raise CommandExecutionError("Permission denied reading from {}".format(path)) + raise CommandExecutionError(f"Permission denied reading from {path}") else: raise CommandExecutionError( "Error {} encountered reading from {}: {}".format( @@ -253,7 +251,7 @@ def wait_lock(path, lock_fn=None, timeout=5, sleep=0.1, time_start=None): try: if os.path.exists(lock_fn) and not os.path.isfile(lock_fn): - _raise_error("lock_fn {} exists and is not a file".format(lock_fn)) + _raise_error(f"lock_fn {lock_fn} exists and is not a file") open_flags = os.O_CREAT | os.O_EXCL | os.O_WRONLY while time.time() - time_start < timeout: @@ -293,9 +291,7 @@ def wait_lock(path, lock_fn=None, timeout=5, sleep=0.1, time_start=None): raise except Exception as exc: # pylint: disable=broad-except - _raise_error( - "Error encountered obtaining file lock {}: {}".format(lock_fn, exc) - ) + _raise_error(f"Error encountered obtaining file lock {lock_fn}: {exc}") finally: if obtained_lock: @@ -346,7 +342,7 @@ def fopen(*args, **kwargs): # and True are treated by Python 3's open() as file descriptors 0 # and 1, respectively. if args[0] in (0, 1, 2): - raise TypeError("{} is not a permitted file descriptor".format(args[0])) + raise TypeError(f"{args[0]} is not a permitted file descriptor") except IndexError: pass binary = None @@ -791,8 +787,8 @@ def backup_minion(path, bkroot): stamp = time.strftime("%a_%b_%d_%H-%M-%S_%Y") else: stamp = time.strftime("%a_%b_%d_%H:%M:%S_%Y") - stamp = "{}{}_{}".format(stamp[:-4], msecs, stamp[-4:]) - bkpath = os.path.join(bkroot, src_dir, "{}_{}".format(bname, stamp)) + stamp = f"{stamp[:-4]}{msecs}_{stamp[-4:]}" + bkpath = os.path.join(bkroot, src_dir, f"{bname}_{stamp}") if not os.path.isdir(os.path.dirname(bkpath)): os.makedirs(os.path.dirname(bkpath)) shutil.copyfile(path, bkpath) diff --git a/salt/utils/find.py b/salt/utils/find.py index f6fc3bf9250..6c1b25631b3 100644 --- a/salt/utils/find.py +++ b/salt/utils/find.py @@ -162,7 +162,7 @@ def _parse_interval(value): """ match = _INTERVAL_REGEX.match(str(value)) if match is None: - raise ValueError("invalid time interval: '{}'".format(value)) + raise ValueError(f"invalid time interval: '{value}'") result = 0 resolution = None @@ -211,7 +211,7 @@ def _parse_size(value): try: num = int(float(scalar) * multiplier) except ValueError: - raise ValueError('invalid size: "{}"'.format(value)) + raise ValueError(f'invalid size: "{value}"') if style == "-": min_size = 0 @@ -279,7 +279,7 @@ class RegexOption(Option): try: self.regex = re.compile(value) except re.error: - raise ValueError('invalid regular expression: "{}"'.format(value)) + raise ValueError(f'invalid regular expression: "{value}"') def match(self, dirname, filename, fstat): return self.regex.match(filename) @@ -296,7 +296,7 @@ class IregexOption(Option): try: self.regex = re.compile(value, re.IGNORECASE) except re.error: - raise ValueError('invalid regular expression: "{}"'.format(value)) + raise ValueError(f'invalid regular expression: "{value}"') def match(self, dirname, filename, fstat): return self.regex.match(filename) @@ -325,7 +325,7 @@ class TypeOption(Option): try: self.ftypes.add(_FILE_TYPES[ftype]) except KeyError: - raise ValueError('invalid file type "{}"'.format(ftype)) + raise ValueError(f'invalid file type "{ftype}"') def requires(self): return _REQUIRES_STAT @@ -351,7 +351,7 @@ class OwnerOption(Option): try: self.uids.add(pwd.getpwnam(value).pw_uid) except KeyError: - raise ValueError('no such user "{}"'.format(name)) + raise ValueError(f'no such user "{name}"') def requires(self): return _REQUIRES_STAT @@ -377,7 +377,7 @@ class GroupOption(Option): try: self.gids.add(grp.getgrnam(name).gr_gid) except KeyError: - raise ValueError('no such group "{}"'.format(name)) + raise ValueError(f'no such group "{name}"') def requires(self): return _REQUIRES_STAT @@ -449,7 +449,7 @@ class GrepOption(Option): try: self.regex = re.compile(value) except re.error: - raise ValueError('invalid regular expression: "{}"'.format(value)) + raise ValueError(f'invalid regular expression: "{value}"') def requires(self): return _REQUIRES_CONTENTS | _REQUIRES_STAT @@ -589,11 +589,11 @@ class ExecOption(Option): command, salt.utils.stringutils.to_str(err), ) - return "{}:\n{}\n".format(command, salt.utils.stringutils.to_str(out)) + return f"{command}:\n{salt.utils.stringutils.to_str(out)}\n" except Exception as e: # pylint: disable=broad-except log.error('Exception while executing command "%s":\n\n%s', command, e) - return "{}: Failed".format(fullpath) + return f"{fullpath}: Failed" class Finder: @@ -621,11 +621,11 @@ class Finder: # this is a passthrough object, continue continue if not value: - raise ValueError('missing value for "{}" option'.format(key)) + raise ValueError(f'missing value for "{key}" option') try: obj = globals()[key.title() + "Option"](key, value) except KeyError: - raise ValueError('invalid option "{}"'.format(key)) + raise ValueError(f'invalid option "{key}"') if hasattr(obj, "match"): requires = obj.requires() if requires & _REQUIRES_CONTENTS: @@ -721,7 +721,7 @@ def find(path, options): def _main(): if len(sys.argv) < 2: - sys.stderr.write("usage: {} path [options]\n".format(sys.argv[0])) + sys.stderr.write(f"usage: {sys.argv[0]} path [options]\n") sys.exit(salt.defaults.exitcodes.EX_USAGE) path = sys.argv[1] @@ -733,7 +733,7 @@ def _main(): try: finder = Finder(criteria) except ValueError as ex: - sys.stderr.write("error: {}\n".format(ex)) + sys.stderr.write(f"error: {ex}\n") sys.exit(salt.defaults.exitcodes.EX_GENERIC) for result in finder.find(path): diff --git a/salt/utils/fsutils.py b/salt/utils/fsutils.py index 7dda4454e9d..c1ea06f1851 100644 --- a/salt/utils/fsutils.py +++ b/salt/utils/fsutils.py @@ -119,7 +119,7 @@ def _is_device(path): """ Return True if path is a physical device. """ - out = __salt__["cmd.run_all"]("file -i {}".format(path)) + out = __salt__["cmd.run_all"](f"file -i {path}") _verify_run(out) # Always [device, mime, charset]. See (file --help) diff --git a/salt/utils/functools.py b/salt/utils/functools.py index e164811393e..224d096957c 100644 --- a/salt/utils/functools.py +++ b/salt/utils/functools.py @@ -81,7 +81,7 @@ def alias_function(fun, name, doc=None): alias_fun.__doc__ = doc else: orig_name = fun.__name__ - alias_msg = "\nThis function is an alias of ``{}``.\n".format(orig_name) + alias_msg = f"\nThis function is an alias of ``{orig_name}``.\n" alias_fun.__doc__ = alias_msg + (fun.__doc__ or "") return alias_fun diff --git a/salt/utils/gitfs.py b/salt/utils/gitfs.py index 730e6b01993..aa9190b6ee3 100644 --- a/salt/utils/gitfs.py +++ b/salt/utils/gitfs.py @@ -216,7 +216,7 @@ def failhard(role): """ Fatal configuration issue, raise an exception """ - raise FileserverConfigError("Failed to load {}".format(role)) + raise FileserverConfigError(f"Failed to load {role}") class GitProvider: @@ -249,7 +249,7 @@ class GitProvider: return str(y) self.global_saltenv = salt.utils.data.repack_dictlist( - self.opts.get("{}_saltenv".format(self.role), []), + self.opts.get(f"{self.role}_saltenv", []), strict=True, recurse=True, key_cb=str, @@ -411,7 +411,7 @@ class GitProvider: # when instantiating an instance of a GitBase subclass. Make sure # that we set this attribute so we at least have a sane default and # are able to fetch. - key = "{}_refspecs".format(self.role) + key = f"{self.role}_refspecs" try: default_refspecs = _DEFAULT_MASTER_OPTS[key] except KeyError: @@ -955,7 +955,7 @@ class GitProvider: ) ) if pid: - msg += " Process {} obtained the lock".format(pid) + msg += f" Process {pid} obtained the lock" if not pid_exists(pid): msg += ( " but this process is not running. The " @@ -1001,7 +1001,7 @@ class GitProvider: ) log.error(msg, exc_info=True) raise GitLockError(exc.errno, msg) - msg = "Set {} lock for {} remote '{}'".format(lock_type, self.role, self.id) + msg = f"Set {lock_type} lock for {self.role} remote '{self.id}'" log.debug(msg) return msg @@ -1030,7 +1030,7 @@ class GitProvider: Set and automatically clear a lock """ if not isinstance(lock_type, str): - raise GitLockError(errno.EINVAL, "Invalid lock_type '{}'".format(lock_type)) + raise GitLockError(errno.EINVAL, f"Invalid lock_type '{lock_type}'") # Make sure that we have a positive integer timeout, otherwise just set # it to zero. @@ -1158,7 +1158,7 @@ class GitProvider: for ref_type in self.ref_types: try: - func_name = "get_tree_from_{}".format(ref_type) + func_name = f"get_tree_from_{ref_type}" func = getattr(self, func_name) except AttributeError: log.error( @@ -1174,7 +1174,7 @@ class GitProvider: if self.fallback: for ref_type in self.ref_types: try: - func_name = "get_tree_from_{}".format(ref_type) + func_name = f"get_tree_from_{ref_type}" func = getattr(self, func_name) except AttributeError: log.error( @@ -1593,7 +1593,7 @@ class GitPython(GitProvider): """ try: return git.RemoteReference( - self.repo, "refs/remotes/origin/{}".format(ref) + self.repo, f"refs/remotes/origin/{ref}" ).commit.tree except ValueError: return None @@ -1603,7 +1603,7 @@ class GitPython(GitProvider): Return a git.Tree object matching a tag ref fetched into refs/tags/ """ try: - return git.TagReference(self.repo, "refs/tags/{}".format(ref)).commit.tree + return git.TagReference(self.repo, f"refs/tags/{ref}").commit.tree except ValueError: return None @@ -2191,7 +2191,7 @@ class Pygit2(GitProvider): """ try: return self.peel( - self.repo.lookup_reference("refs/remotes/origin/{}".format(ref)) + self.repo.lookup_reference(f"refs/remotes/origin/{ref}") ).tree except KeyError: return None @@ -2201,9 +2201,7 @@ class Pygit2(GitProvider): Return a pygit2.Tree object matching a tag ref fetched into refs/tags/ """ try: - return self.peel( - self.repo.lookup_reference("refs/tags/{}".format(ref)) - ).tree + return self.peel(self.repo.lookup_reference(f"refs/tags/{ref}")).tree except KeyError: return None @@ -2485,9 +2483,7 @@ class GitBase: # error out and do not proceed. override_params = copy.deepcopy(per_remote_overrides) global_auth_params = [ - "{}_{}".format(self.role, x) - for x in AUTH_PARAMS - if self.opts["{}_{}".format(self.role, x)] + f"{self.role}_{x}" for x in AUTH_PARAMS if self.opts[f"{self.role}_{x}"] ] if self.provider in AUTH_PROVIDERS: override_params += AUTH_PARAMS @@ -2510,7 +2506,7 @@ class GitBase: global_values = set(override_params) global_values.update(set(global_only)) for param in global_values: - key = "{}_{}".format(self.role, param) + key = f"{self.role}_{param}" if key not in self.opts: log.critical( "Key '%s' not present in global configuration. This is " @@ -2645,7 +2641,7 @@ class GitBase: try: shutil.rmtree(rdir) except OSError as exc: - errors.append("Unable to delete {}: {}".format(rdir, exc)) + errors.append(f"Unable to delete {rdir}: {exc}") return errors def clear_lock(self, remote=None, lock_type="update"): @@ -2823,10 +2819,10 @@ class GitBase: """ Determine which provider to use """ - if "verified_{}_provider".format(self.role) in self.opts: - self.provider = self.opts["verified_{}_provider".format(self.role)] + if f"verified_{self.role}_provider" in self.opts: + self.provider = self.opts[f"verified_{self.role}_provider"] else: - desired_provider = self.opts.get("{}_provider".format(self.role)) + desired_provider = self.opts.get(f"{self.role}_provider") if not desired_provider: if self.verify_pygit2(quiet=True): self.provider = "pygit2" @@ -2897,7 +2893,7 @@ class GitBase: _recommend() return False - self.opts["verified_{}_provider".format(self.role)] = "gitpython" + self.opts[f"verified_{self.role}_provider"] = "gitpython" log.debug("gitpython %s_provider enabled", self.role) return True @@ -2953,7 +2949,7 @@ class GitBase: _recommend() return False - self.opts["verified_{}_provider".format(self.role)] = "pygit2" + self.opts[f"verified_{self.role}_provider"] = "pygit2" log.debug("pygit2 %s_provider enabled", self.role) return True @@ -2965,11 +2961,11 @@ class GitBase: try: with salt.utils.files.fopen(remote_map, "w+") as fp_: timestamp = datetime.now().strftime("%d %b %Y %H:%M:%S.%f") - fp_.write("# {}_remote map as of {}\n".format(self.role, timestamp)) + fp_.write(f"# {self.role}_remote map as of {timestamp}\n") for repo in self.remotes: fp_.write( salt.utils.stringutils.to_str( - "{} = {}\n".format(repo.get_cache_basehash(), repo.id) + f"{repo.get_cache_basehash()} = {repo.id}\n" ) ) except OSError: @@ -3119,12 +3115,12 @@ class GitFS(GitBase): dest = salt.utils.path.join(self.cache_root, "refs", tgt_env, path) hashes_glob = salt.utils.path.join( - self.hash_cachedir, tgt_env, "{}.hash.*".format(path) + self.hash_cachedir, tgt_env, f"{path}.hash.*" ) blobshadest = salt.utils.path.join( - self.hash_cachedir, tgt_env, "{}.hash.blob_sha1".format(path) + self.hash_cachedir, tgt_env, f"{path}.hash.blob_sha1" ) - lk_fn = salt.utils.path.join(self.hash_cachedir, tgt_env, "{}.lk".format(path)) + lk_fn = salt.utils.path.join(self.hash_cachedir, tgt_env, f"{path}.lk") destdir = os.path.dirname(dest) hashdir = os.path.dirname(blobshadest) if not os.path.isdir(destdir): diff --git a/salt/utils/github.py b/salt/utils/github.py index d24244e5a0e..4ee55c39a73 100644 --- a/salt/utils/github.py +++ b/salt/utils/github.py @@ -43,7 +43,7 @@ def get_user_pubkeys(users): key_ids = user[tmp_user] user = tmp_user - url = "https://api.github.com/users/{}/keys".format(user) + url = f"https://api.github.com/users/{user}/keys" result = salt.utils.http.query( url, "GET", diff --git a/salt/utils/hashutils.py b/salt/utils/hashutils.py index 02d234af068..4969465acbe 100644 --- a/salt/utils/hashutils.py +++ b/salt/utils/hashutils.py @@ -160,7 +160,7 @@ def get_hash(path, form="sha256", chunk_size=65536): """ hash_type = hasattr(hashlib, form) and getattr(hashlib, form) or None if hash_type is None: - raise ValueError("Invalid hash type: {}".format(form)) + raise ValueError(f"Invalid hash type: {form}") with salt.utils.files.fopen(path, "rb") as ifile: hash_obj = hash_type() @@ -182,7 +182,7 @@ class DigestCollector: """ self.__digest = hasattr(hashlib, form) and getattr(hashlib, form)() or None if self.__digest is None: - raise ValueError("Invalid hash type: {}".format(form)) + raise ValueError(f"Invalid hash type: {form}") self.__buff = buff def add(self, path): diff --git a/salt/utils/immutabletypes.py b/salt/utils/immutabletypes.py index 183dc3606ef..fde42753801 100644 --- a/salt/utils/immutabletypes.py +++ b/salt/utils/immutabletypes.py @@ -30,7 +30,7 @@ class ImmutableDict(Mapping): return freeze(self.__obj[key]) def __repr__(self): - return "<{} {}>".format(self.__class__.__name__, repr(self.__obj)) + return f"<{self.__class__.__name__} {repr(self.__obj)}>" def __deepcopy__(self, memo): return copy.deepcopy(self.__obj) @@ -66,7 +66,7 @@ class ImmutableList(Sequence): return freeze(self.__obj[key]) def __repr__(self): - return "<{} {}>".format(self.__class__.__name__, repr(self.__obj)) + return f"<{self.__class__.__name__} {repr(self.__obj)}>" def __deepcopy__(self, memo): return copy.deepcopy(self.__obj) @@ -96,7 +96,7 @@ class ImmutableSet(Set): return key in self.__obj def __repr__(self): - return "<{} {}>".format(self.__class__.__name__, repr(self.__obj)) + return f"<{self.__class__.__name__} {repr(self.__obj)}>" def __deepcopy__(self, memo): return copy.deepcopy(self.__obj) diff --git a/salt/utils/jid.py b/salt/utils/jid.py index c3dbf8a078a..69d926469b9 100644 --- a/salt/utils/jid.py +++ b/salt/utils/jid.py @@ -27,11 +27,11 @@ def gen_jid(opts): jid_dt = _utc_now() if not opts.get("unique_jid", False): - return "{:%Y%m%d%H%M%S%f}".format(jid_dt) + return f"{jid_dt:%Y%m%d%H%M%S%f}" if LAST_JID_DATETIME and LAST_JID_DATETIME >= jid_dt: jid_dt = LAST_JID_DATETIME + datetime.timedelta(microseconds=1) LAST_JID_DATETIME = jid_dt - return "{:%Y%m%d%H%M%S%f}_{}".format(jid_dt, os.getpid()) + return f"{jid_dt:%Y%m%d%H%M%S%f}_{os.getpid()}" def is_jid(jid): diff --git a/salt/utils/job.py b/salt/utils/job.py index 3d4653d412d..66b0568887b 100644 --- a/salt/utils/job.py +++ b/salt/utils/job.py @@ -40,7 +40,7 @@ def store_job(opts, load, event=None, mminion=None): nocache=load.get("nocache", False) ) except KeyError: - emsg = "Returner '{}' does not support function prep_jid".format(job_cache) + emsg = f"Returner '{job_cache}' does not support function prep_jid" log.error(emsg) raise KeyError(emsg) except Exception: # pylint: disable=broad-except @@ -51,11 +51,11 @@ def store_job(opts, load, event=None, mminion=None): ) # save the load, since we don't have it - saveload_fstr = "{}.save_load".format(job_cache) + saveload_fstr = f"{job_cache}.save_load" try: mminion.returners[saveload_fstr](load["jid"], load) except KeyError: - emsg = "Returner '{}' does not support function save_load".format(job_cache) + emsg = f"Returner '{job_cache}' does not support function save_load" log.error(emsg) raise KeyError(emsg) except Exception: # pylint: disable=broad-except @@ -66,11 +66,11 @@ def store_job(opts, load, event=None, mminion=None): ) elif salt.utils.jid.is_jid(load["jid"]): # Store the jid - jidstore_fstr = "{}.prep_jid".format(job_cache) + jidstore_fstr = f"{job_cache}.prep_jid" try: mminion.returners[jidstore_fstr](False, passed_jid=load["jid"]) except KeyError: - emsg = "Returner '{}' does not support function prep_jid".format(job_cache) + emsg = f"Returner '{job_cache}' does not support function prep_jid" log.error(emsg) raise KeyError(emsg) except Exception: # pylint: disable=broad-except @@ -103,10 +103,10 @@ def store_job(opts, load, event=None, mminion=None): return # otherwise, write to the master cache - savefstr = "{}.save_load".format(job_cache) - getfstr = "{}.get_load".format(job_cache) - fstr = "{}.returner".format(job_cache) - updateetfstr = "{}.update_endtime".format(job_cache) + savefstr = f"{job_cache}.save_load" + getfstr = f"{job_cache}.get_load" + fstr = f"{job_cache}.returner" + updateetfstr = f"{job_cache}.update_endtime" if "fun" not in load and load.get("return", {}): ret_ = load.get("return", {}) if "fun" in ret_: @@ -120,7 +120,7 @@ def store_job(opts, load, event=None, mminion=None): getfstr_func = mminion.returners[getfstr] fstr_func = mminion.returners[fstr] except KeyError as error: - emsg = "Returner '{}' does not support function {}".format(job_cache, error) + emsg = f"Returner '{job_cache}' does not support function {error}" log.error(emsg) raise KeyError(emsg) @@ -160,14 +160,12 @@ def store_minions(opts, jid, minions, mminion=None, syndic_id=None): if mminion is None: mminion = salt.minion.MasterMinion(opts, states=False, rend=False) job_cache = opts["master_job_cache"] - minions_fstr = "{}.save_minions".format(job_cache) + minions_fstr = f"{job_cache}.save_minions" try: mminion.returners[minions_fstr](jid, minions, syndic_id=syndic_id) except KeyError: - raise KeyError( - "Returner '{}' does not support function save_minions".format(job_cache) - ) + raise KeyError(f"Returner '{job_cache}' does not support function save_minions") def get_retcode(ret): diff --git a/salt/utils/kickstart.py b/salt/utils/kickstart.py index 6674999a4e9..6869d2b5ba9 100644 --- a/salt/utils/kickstart.py +++ b/salt/utils/kickstart.py @@ -64,7 +64,7 @@ def parse_auth(rule): "disablewins", ) for arg in noargs: - parser.add_argument("--{}".format(arg), dest=arg, action="store_true") + parser.add_argument(f"--{arg}", dest=arg, action="store_true") parser.add_argument("--enablenis", dest="enablenis", action="store") parser.add_argument("--hesiodrhs", dest="hesiodrhs", action="store") diff --git a/salt/utils/lazy.py b/salt/utils/lazy.py index 832be90fc0d..87b356eac9a 100644 --- a/salt/utils/lazy.py +++ b/salt/utils/lazy.py @@ -77,7 +77,7 @@ class LazyDict(MutableMapping): Override this to return a more meaningfull error message if possible """ - return "'{}' is not available.".format(function_name) + return f"'{function_name}' is not available." def __setitem__(self, key, val): self._dict[key] = val diff --git a/salt/utils/mac_utils.py b/salt/utils/mac_utils.py index dbfc9f05f82..1614d2189b3 100644 --- a/salt/utils/mac_utils.py +++ b/salt/utils/mac_utils.py @@ -154,7 +154,7 @@ def execute_return_success(cmd): log.debug("Execute return success %s: %r", cmd, ret) if ret["retcode"] != 0 or "not supported" in ret["stdout"].lower(): - msg = "Command Failed: {}\n".format(cmd) + msg = f"Command Failed: {cmd}\n" msg += "Return Code: {}\n".format(ret["retcode"]) msg += "Output: {}\n".format(ret["stdout"]) msg += "Error: {}\n".format(ret["stderr"]) @@ -178,7 +178,7 @@ def execute_return_result(cmd): ret = _run_all(cmd) if ret["retcode"] != 0 or "not supported" in ret["stdout"].lower(): - msg = "Command Failed: {}\n".format(cmd) + msg = f"Command Failed: {cmd}\n" msg += "Return Code: {}\n".format(ret["retcode"]) msg += "Output: {}\n".format(ret["stdout"]) msg += "Error: {}\n".format(ret["stderr"]) @@ -313,7 +313,7 @@ def launchctl(sub_cmd, *args, **kwargs): # Raise an error or return successful result if ret["retcode"] or error: - out = "Failed to {} service:\n".format(sub_cmd) + out = f"Failed to {sub_cmd} service:\n" out += "stdout: {}\n".format(ret["stdout"]) out += "stderr: {}\n".format(ret["stderr"]) out += "retcode: {}".format(ret["retcode"]) diff --git a/salt/utils/mako.py b/salt/utils/mako.py index 4397ae8cc7d..7d467ce62c6 100644 --- a/salt/utils/mako.py +++ b/salt/utils/mako.py @@ -70,7 +70,7 @@ if HAS_MAKO: if scheme in ("salt", "file"): return uri elif scheme: - raise ValueError("Unsupported URL scheme({}) in {}".format(scheme, uri)) + raise ValueError(f"Unsupported URL scheme({scheme}) in {uri}") return self.lookup.adjust_uri(uri, filename) def get_template(self, uri, relativeto=None): diff --git a/salt/utils/master.py b/salt/utils/master.py index ce2dfe46bf0..6aa661c0607 100644 --- a/salt/utils/master.py +++ b/salt/utils/master.py @@ -109,7 +109,7 @@ def _check_cmdline(data): return False if not os.path.isdir("/proc"): return True - path = os.path.join("/proc/{}/cmdline".format(pid)) + path = os.path.join(f"/proc/{pid}/cmdline") if not os.path.isfile(path): return False try: @@ -161,7 +161,7 @@ class MasterPillarUtil: if opts is None: log.error("%s: Missing master opts init arg.", self.__class__.__name__) raise SaltException( - "{}: Missing master opts init arg.".format(self.__class__.__name__) + f"{self.__class__.__name__}: Missing master opts init arg." ) else: self.opts = opts @@ -202,7 +202,7 @@ class MasterPillarUtil: for minion_id in minion_ids: if not salt.utils.verify.valid_id(self.opts, minion_id): continue - mdata = self.cache.fetch("minions/{}".format(minion_id), "mine") + mdata = self.cache.fetch(f"minions/{minion_id}", "mine") if isinstance(mdata, dict): mine_data[minion_id] = mdata return mine_data @@ -220,7 +220,7 @@ class MasterPillarUtil: for minion_id in minion_ids: if not salt.utils.verify.valid_id(self.opts, minion_id): continue - mdata = self.cache.fetch("minions/{}".format(minion_id), "data") + mdata = self.cache.fetch(f"minions/{minion_id}", "data") if not isinstance(mdata, dict): log.warning( "cache.fetch should always return a dict. ReturnedType: %s," @@ -489,7 +489,7 @@ class MasterPillarUtil: if clear_mine: clear_what.append("mine") if clear_mine_func is not None: - clear_what.append("mine_func: '{}'".format(clear_mine_func)) + clear_what.append(f"mine_func: '{clear_mine_func}'") if not clear_what: log.debug("No cached data types specified for clearing.") return False @@ -515,7 +515,7 @@ class MasterPillarUtil: if minion_id not in c_minions: # Cache bank for this minion does not exist. Nothing to do. continue - bank = "minions/{}".format(minion_id) + bank = f"minions/{minion_id}" minion_pillar = pillars.pop(minion_id, False) minion_grains = grains.pop(minion_id, False) if ( @@ -823,7 +823,7 @@ def get_master_key(key_user, opts, skip_perm_errors=False): # The username may contain '\' if it is in Windows # 'DOMAIN\username' format. Fix this for the keyfile path. key_user = key_user.replace("\\", "_") - keyfile = os.path.join(opts["cachedir"], ".{}_key".format(key_user)) + keyfile = os.path.join(opts["cachedir"], f".{key_user}_key") # Make sure all key parent directories are accessible salt.utils.verify.check_path_traversal(opts["cachedir"], key_user, skip_perm_errors) diff --git a/salt/utils/mattermost.py b/salt/utils/mattermost.py index b8b49c32e75..17c2d6b8ffe 100644 --- a/salt/utils/mattermost.py +++ b/salt/utils/mattermost.py @@ -39,7 +39,7 @@ def query(hook=None, api_url=None, data=None): result = salt.utils.http.query(url, method, data=data, decode=True, status=True) if result.get("status", None) == http.client.OK: - ret["message"] = "Message posted {} correctly".format(data) + ret["message"] = f"Message posted {data} correctly" return ret elif result.get("status", None) == http.client.NO_CONTENT: return True diff --git a/salt/utils/memcached.py b/salt/utils/memcached.py index 11248abadd6..881f923979a 100644 --- a/salt/utils/memcached.py +++ b/salt/utils/memcached.py @@ -91,7 +91,7 @@ def get_conn(opts, profile=None, host=None, port=None): raise SaltInvocationError("port must be an integer") if HAS_LIBS: - return memcache.Client(["{}:{}".format(host, port)]) + return memcache.Client([f"{host}:{port}"]) else: raise CommandExecutionError( "(unable to import memcache, module most likely not installed)" diff --git a/salt/utils/minion.py b/salt/utils/minion.py index 9c53428c89b..39bae1a2302 100644 --- a/salt/utils/minion.py +++ b/salt/utils/minion.py @@ -131,7 +131,7 @@ def _check_cmdline(data): return False if not os.path.isdir("/proc"): return True - path = os.path.join("/proc/{}/cmdline".format(pid)) + path = os.path.join(f"/proc/{pid}/cmdline") if not os.path.isfile(path): return False try: diff --git a/salt/utils/minions.py b/salt/utils/minions.py index 3006118c239..7406b696eb5 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -107,11 +107,11 @@ def get_minion_data(minion, opts): cache = salt.cache.factory(opts) if minion is None: for id_ in cache.list("minions"): - data = cache.fetch("minions/{}".format(id_), "data") + data = cache.fetch(f"minions/{id_}", "data") if data is None: continue else: - data = cache.fetch("minions/{}".format(minion), "data") + data = cache.fetch(f"minions/{minion}", "data") if data is not None: grains = data.get("grains", None) pillar = data.get("pillar", None) @@ -323,7 +323,7 @@ class CkMinions: for id_ in cminions: if greedy and id_ not in minions: continue - mdata = self.cache.fetch("minions/{}".format(id_), "data") + mdata = self.cache.fetch(f"minions/{id_}", "data") if mdata is None: if not greedy: minions.remove(id_) @@ -408,11 +408,11 @@ class CkMinions: except Exception: # pylint: disable=broad-except log.error("Invalid IP/CIDR target: %s", tgt) return {"minions": [], "missing": []} - proto = "ipv{}".format(tgt.version) + proto = f"ipv{tgt.version}" minions = set(minions) for id_ in cminions: - mdata = self.cache.fetch("minions/{}".format(id_), "data") + mdata = self.cache.fetch(f"minions/{id_}", "data") if mdata is None: if not greedy: minions.remove(id_) @@ -649,7 +649,7 @@ class CkMinions: search = subset for id_ in search: try: - mdata = self.cache.fetch("minions/{}".format(id_), "data") + mdata = self.cache.fetch(f"minions/{id_}", "data") except SaltCacheError: # If a SaltCacheError is explicitly raised during the fetch operation, # permission was denied to open the cached data.p file. Continue on as @@ -702,7 +702,7 @@ class CkMinions: try: if expr is None: expr = "" - check_func = getattr(self, "_check_{}_minions".format(tgt_type), None) + check_func = getattr(self, f"_check_{tgt_type}_minions", None) if tgt_type in ( "grain", "grain_pcre", @@ -1048,11 +1048,7 @@ class CkMinions: for ind in auth_list: if isinstance(ind, str): if ind[0] == "@": - if ( - ind[1:] == mod_name - or ind[1:] == form - or ind == "@{}s".format(form) - ): + if ind[1:] == mod_name or ind[1:] == form or ind == f"@{form}s": return True elif isinstance(ind, dict): if len(ind) != 1: @@ -1064,7 +1060,7 @@ class CkMinions: ind[valid], fun_name, args.get("arg"), args.get("kwarg") ): return True - if valid[1:] == form or valid == "@{}s".format(form): + if valid[1:] == form or valid == f"@{form}s": if self.__fun_check( ind[valid], fun, args.get("arg"), args.get("kwarg") ): diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index 918eb942ca6..cac3455d1a6 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -58,7 +58,7 @@ def _get_config(**kwargs): "pk_file": pk_file, } - config_key = "{}.config".format(__virtualname__) + config_key = f"{__virtualname__}.config" try: config.update(__salt__["config.get"](config_key, {})) except (NameError, KeyError) as e: @@ -146,7 +146,7 @@ def keygen(sk_file=None, pk_file=None, **kwargs): } if pk_file is None: - pk_file = "{}.pub".format(sk_file) + pk_file = f"{sk_file}.pub" if sk_file and pk_file is None: if not os.path.isfile(sk_file): @@ -167,17 +167,15 @@ def keygen(sk_file=None, pk_file=None, **kwargs): else: # chmod 0600 file os.chmod(sk_file, 1536) - return "saved sk_file: {}".format(sk_file) + return f"saved sk_file: {sk_file}" else: - raise Exception("sk_file:{} already exist.".format(sk_file)) + raise Exception(f"sk_file:{sk_file} already exist.") if sk_file is None and pk_file: raise Exception("sk_file: Must be set inorder to generate a public key.") if os.path.isfile(sk_file) and os.path.isfile(pk_file): - raise Exception( - "sk_file:{} and pk_file:{} already exist.".format(sk_file, pk_file) - ) + raise Exception(f"sk_file:{sk_file} and pk_file:{pk_file} already exist.") if os.path.isfile(sk_file) and not os.path.isfile(pk_file): # generate pk using the sk @@ -187,7 +185,7 @@ def keygen(sk_file=None, pk_file=None, **kwargs): kp = nacl.public.PublicKey(sk) with salt.utils.files.fopen(pk_file, "wb") as keyf: keyf.write(base64.b64encode(kp.encode())) - return "saved pk_file: {}".format(pk_file) + return f"saved pk_file: {pk_file}" kp = nacl.public.PublicKey.generate() with salt.utils.files.fopen(sk_file, "wb") as keyf: @@ -203,7 +201,7 @@ def keygen(sk_file=None, pk_file=None, **kwargs): os.chmod(sk_file, 1536) with salt.utils.files.fopen(pk_file, "wb") as keyf: keyf.write(base64.b64encode(kp.encode())) - return "saved sk_file:{} pk_file: {}".format(sk_file, pk_file) + return f"saved sk_file:{sk_file} pk_file: {pk_file}" def enc(data, **kwargs): @@ -270,10 +268,10 @@ def enc_file(name, out=None, **kwargs): d = enc(data, **kwargs) if out: if os.path.isfile(out): - raise Exception("file:{} already exist.".format(out)) + raise Exception(f"file:{out} already exist.") with salt.utils.files.fopen(out, "wb") as f: f.write(salt.utils.stringutils.to_bytes(d)) - return "Wrote: {}".format(out) + return f"Wrote: {out}" return d @@ -342,10 +340,10 @@ def dec_file(name, out=None, **kwargs): d = dec(data, **kwargs) if out: if os.path.isfile(out): - raise Exception("file:{} already exist.".format(out)) + raise Exception(f"file:{out} already exist.") with salt.utils.files.fopen(out, "wb") as f: f.write(salt.utils.stringutils.to_bytes(d)) - return "Wrote: {}".format(out) + return f"Wrote: {out}" return d diff --git a/salt/utils/nb_popen.py b/salt/utils/nb_popen.py index 7624d609713..3f6afd4b85e 100644 --- a/salt/utils/nb_popen.py +++ b/salt/utils/nb_popen.py @@ -145,8 +145,8 @@ class NonBlockingPopen(subprocess.Popen): return self._close(which) raise - getattr(self, "{}_buff".format(which)).write(read) - getattr(self, "_{}_logger".format(which)).debug(read.rstrip()) + getattr(self, f"{which}_buff").write(read) + getattr(self, f"_{which}_logger").debug(read.rstrip()) if self.stream_stds: getattr(sys, which).write(read) @@ -195,8 +195,8 @@ class NonBlockingPopen(subprocess.Popen): if self.universal_newlines: buff = self._translate_newlines(buff) - getattr(self, "{}_buff".format(which)).write(buff) - getattr(self, "_{}_logger".format(which)).debug(buff.rstrip()) + getattr(self, f"{which}_buff").write(buff) + getattr(self, f"_{which}_logger").debug(buff.rstrip()) if self.stream_stds: getattr(sys, which).write(buff) diff --git a/salt/utils/network.py b/salt/utils/network.py index 29c6c2f1049..f964e25fa54 100644 --- a/salt/utils/network.py +++ b/salt/utils/network.py @@ -672,7 +672,7 @@ def cidr_to_ipv4_netmask(cidr_bits): netmask += "255" cidr_bits -= 8 else: - netmask += "{:d}".format(256 - (2 ** (8 - cidr_bits))) + netmask += f"{256 - (2 ** (8 - cidr_bits)):d}" cidr_bits = 0 return netmask @@ -846,11 +846,7 @@ def _interfaces_ifconfig(out): if salt.utils.platform.is_sunos(): expand_mac = [] for chunk in data["hwaddr"].split(":"): - expand_mac.append( - "0{}".format(chunk) - if len(chunk) < 2 - else "{}".format(chunk) - ) + expand_mac.append(f"0{chunk}" if len(chunk) < 2 else f"{chunk}") data["hwaddr"] = ":".join(expand_mac) if mip: if "inet" not in data: @@ -1194,7 +1190,7 @@ def get_net_start(ipaddr, netmask): """ Return the address of the network """ - net = ipaddress.ip_network("{}/{}".format(ipaddr, netmask), strict=False) + net = ipaddress.ip_network(f"{ipaddr}/{netmask}", strict=False) return str(net.network_address) @@ -1216,7 +1212,7 @@ def calc_net(ipaddr, netmask=None): (The IP can be any IP inside the subnet) """ if netmask is not None: - ipaddr = "{}/{}".format(ipaddr, netmask) + ipaddr = f"{ipaddr}/{netmask}" return str(ipaddress.ip_network(ipaddr, strict=False)) @@ -1487,7 +1483,7 @@ def _ip_networks( _net = addr.get("netmask" if proto == "inet" else "prefixlen") if _ip and _net: try: - ip_net = ipaddress.ip_network("{}/{}".format(_ip, _net), strict=False) + ip_net = ipaddress.ip_network(f"{_ip}/{_net}", strict=False) except Exception: # pylint: disable=broad-except continue if not ip_net.is_loopback or include_loopback: @@ -1596,8 +1592,8 @@ def mac2eui64(mac, prefix=None): else: try: net = ipaddress.ip_network(prefix, strict=False) - euil = int("0x{}".format(eui64), 16) - return "{}/{}".format(net[euil], net.prefixlen) + euil = int(f"0x{eui64}", 16) + return f"{net[euil]}/{net.prefixlen}" except Exception: # pylint: disable=broad-except return @@ -2013,7 +2009,7 @@ def _linux_remotes_on(port, which_end): data = subprocess.check_output( [ lsof_binary, - "-iTCP:{:d}".format(port), + f"-iTCP:{port:d}", "-n", "-P", ] @@ -2214,7 +2210,7 @@ def dns_check(addr, port, safe=False, ipv6=None): error = True if not ip_addrs: - err = "DNS lookup or connection check of '{}' failed.".format(addr) + err = f"DNS lookup or connection check of '{addr}' failed." if safe: log.error(err) raise SaltClientError() @@ -2278,9 +2274,7 @@ def parse_host_port(host_port): port = int(_s_.lstrip(":")) else: if len(_s_) > 1: - raise ValueError( - 'found ambiguous "{}" port in "{}"'.format(_s_, host_port) - ) + raise ValueError(f'found ambiguous "{_s_}" port in "{host_port}"') else: if _s_.count(":") == 1: host, _hostport_separator_, port = _s_.partition(":") @@ -2302,7 +2296,7 @@ def parse_host_port(host_port): log.debug('"%s" Not an IP address? Assuming it is a hostname.', host) if host != sanitize_host(host): log.error('bad hostname: "%s"', host) - raise ValueError('bad hostname: "{}"'.format(host)) + raise ValueError(f'bad hostname: "{host}"') return host, port @@ -2332,7 +2326,7 @@ def filter_by_networks(values, networks): elif isinstance(values, Sequence): return _filter(values, networks) else: - raise ValueError("Do not know how to filter a {}".format(type(values))) + raise ValueError(f"Do not know how to filter a {type(values)}") else: return values diff --git a/salt/utils/nxos.py b/salt/utils/nxos.py index 2572a762670..5615e9216b6 100644 --- a/salt/utils/nxos.py +++ b/salt/utils/nxos.py @@ -83,7 +83,7 @@ class NxapiClient: if self.nxargs["connect_over_uds"]: if not os.path.exists(self.NXAPI_UDS): raise NxosClientError( - "No host specified and no UDS found at {}\n".format(self.NXAPI_UDS) + f"No host specified and no UDS found at {self.NXAPI_UDS}\n" ) # Create UHTTPConnection object for NX-API communication over UDS. @@ -190,7 +190,7 @@ class NxapiClient: header_dict=req["headers"], decode=True, decode_type="json", - **self.nxargs + **self.nxargs, ) return self.parse_response(response, command_list) @@ -202,9 +202,9 @@ class NxapiClient: # Check for 500 level NX-API Server Errors if isinstance(response, Iterable) and "status" in response: if int(response["status"]) >= 500: - raise NxosError("{}".format(response)) + raise NxosError(f"{response}") else: - raise NxosError("NX-API Request Not Supported: {}".format(response)) + raise NxosError(f"NX-API Request Not Supported: {response}") if isinstance(response, Iterable): body = response["dict"] @@ -218,7 +218,7 @@ class NxapiClient: # Don't just return body['ins_api']['outputs']['output'] directly. output = body.get("ins_api") if output is None: - raise NxosClientError("Unexpected JSON output\n{}".format(body)) + raise NxosClientError(f"Unexpected JSON output\n{body}") if output.get("outputs"): output = output["outputs"] if output.get("output"): @@ -257,9 +257,9 @@ class NxapiClient: } ) elif code == "413": - raise NxosRequestNotSupported("Error 413: {}".format(msg)) + raise NxosRequestNotSupported(f"Error 413: {msg}") elif code != "200": - raise NxosError("Unknown Error: {}, Code: {}".format(msg, code)) + raise NxosError(f"Unknown Error: {msg}, Code: {code}") else: previous_commands.append(cmd) result.append(cmd_result["body"]) @@ -321,7 +321,7 @@ def ping(**kwargs): def _parser(block): - return re.compile("^{block}\n(?:^[ \n].*$\n?)+".format(block=block), re.MULTILINE) + return re.compile(f"^{block}\n(?:^[ \n].*$\n?)+", re.MULTILINE) def _parse_software(data): diff --git a/salt/utils/openstack/nova.py b/salt/utils/openstack/nova.py index 90b0b1f8269..4c737ed6c4a 100644 --- a/salt/utils/openstack/nova.py +++ b/salt/utils/openstack/nova.py @@ -204,7 +204,7 @@ def get_entry(dict_, key, value, raise_error=True): if entry[key] == value: return entry if raise_error is True: - raise SaltCloudSystemExit("Unable to find {} in {}.".format(key, dict_)) + raise SaltCloudSystemExit(f"Unable to find {key} in {dict_}.") return {} @@ -213,7 +213,7 @@ def get_entry_multi(dict_, pairs, raise_error=True): if all([entry[key] == value for key, value in pairs]): return entry if raise_error is True: - raise SaltCloudSystemExit("Unable to find {} in {}.".format(pairs, dict_)) + raise SaltCloudSystemExit(f"Unable to find {pairs} in {dict_}.") return {} @@ -281,7 +281,7 @@ class SaltNova: password=None, os_auth_plugin=None, use_keystoneauth=False, - **kwargs + **kwargs, ): """ Set up nova credentials @@ -294,7 +294,7 @@ class SaltNova: region_name=region_name, password=password, os_auth_plugin=os_auth_plugin, - **kwargs + **kwargs, ) else: self._old_init( @@ -304,7 +304,7 @@ class SaltNova: region_name=region_name, password=password, os_auth_plugin=os_auth_plugin, - **kwargs + **kwargs, ) def _new_init( @@ -317,7 +317,7 @@ class SaltNova: os_auth_plugin, auth=None, verify=True, - **kwargs + **kwargs, ): if auth is None: auth = {} @@ -386,7 +386,7 @@ class SaltNova: region_name, password, os_auth_plugin, - **kwargs + **kwargs, ): self.kwargs = kwargs.copy() if not self.extensions: @@ -674,7 +674,7 @@ class SaltNova: try: volume = self.volume_show(name) except KeyError as exc: - raise SaltCloudSystemExit("Unable to find {} volume: {}".format(name, exc)) + raise SaltCloudSystemExit(f"Unable to find {name} volume: {exc}") if volume["status"] == "deleted": return volume response = nt_ks.volumes.delete(volume["id"]) @@ -687,7 +687,7 @@ class SaltNova: try: volume = self.volume_show(name) except KeyError as exc: - raise SaltCloudSystemExit("Unable to find {} volume: {}".format(name, exc)) + raise SaltCloudSystemExit(f"Unable to find {name} volume: {exc}") if not volume["attachments"]: return True response = self.compute_conn.volumes.delete_server_volume( @@ -719,7 +719,7 @@ class SaltNova: try: volume = self.volume_show(name) except KeyError as exc: - raise SaltCloudSystemExit("Unable to find {} volume: {}".format(name, exc)) + raise SaltCloudSystemExit(f"Unable to find {name} volume: {exc}") server = self.server_by_name(server_name) response = self.compute_conn.volumes.create_server_volume( server.id, volume["id"], device=device @@ -823,7 +823,7 @@ class SaltNova: """ nt_ks = self.compute_conn nt_ks.flavors.delete(flavor_id) - return "Flavor deleted: {}".format(flavor_id) + return f"Flavor deleted: {flavor_id}" def keypair_list(self): """ @@ -859,7 +859,7 @@ class SaltNova: """ nt_ks = self.compute_conn nt_ks.keypairs.delete(name) - return "Keypair deleted: {}".format(name) + return f"Keypair deleted: {name}" def image_show(self, image_id): """ @@ -948,7 +948,7 @@ class SaltNova: if not image_id: return {"Error": "A valid image name or id was not specified"} nt_ks.images.delete_meta(image_id, pairs) - return {image_id: "Deleted: {}".format(pairs)} + return {image_id: f"Deleted: {pairs}"} def server_list(self): """ @@ -1088,8 +1088,8 @@ class SaltNova: for item in nt_ks.security_groups.list(): if item.name == name: nt_ks.security_groups.delete(item.id) - return {name: "Deleted security group: {}".format(name)} - return "Security group not found: {}".format(name) + return {name: f"Deleted security group: {name}"} + return f"Security group not found: {name}" def secgroup_list(self): """ diff --git a/salt/utils/oset.py b/salt/utils/oset.py index 85cc0931328..3725306ea0c 100644 --- a/salt/utils/oset.py +++ b/salt/utils/oset.py @@ -85,9 +85,7 @@ class OrderedSet(MutableSet): elif is_iterable(index): return OrderedSet([self.items[i] for i in index]) else: - raise TypeError( - "Don't know how to index an OrderedSet by {}".format(repr(index)) - ) + raise TypeError(f"Don't know how to index an OrderedSet by {repr(index)}") def copy(self): return OrderedSet(self) @@ -137,9 +135,7 @@ class OrderedSet(MutableSet): for item in sequence: item_index = self.add(item) except TypeError: - raise ValueError( - "Argument needs to be an iterable, got {}".format(type(sequence)) - ) + raise ValueError(f"Argument needs to be an iterable, got {type(sequence)}") return item_index def index(self, key): @@ -198,8 +194,8 @@ class OrderedSet(MutableSet): def __repr__(self): if not self: - return "{}()".format(self.__class__.__name__) - return "{}({})".format(self.__class__.__name__, repr(list(self))) + return f"{self.__class__.__name__}()" + return f"{self.__class__.__name__}({repr(list(self))})" def __eq__(self, other): if isinstance(other, OrderedSet): diff --git a/salt/utils/pagerduty.py b/salt/utils/pagerduty.py index 44c039a9f6b..62c663196e5 100644 --- a/salt/utils/pagerduty.py +++ b/salt/utils/pagerduty.py @@ -44,7 +44,7 @@ def query( """ Query the PagerDuty API """ - user_agent = "SaltStack {}".format(__version__) + user_agent = f"SaltStack {__version__}" if opts is None: opts = {} diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py index c915d5621f6..fc2eabc9a24 100644 --- a/salt/utils/parsers.py +++ b/salt/utils/parsers.py @@ -141,7 +141,7 @@ class OptionParser(optparse.OptionParser): _mixin_prio_ = sys.maxsize - 200 def __init__(self, *args, **kwargs): - kwargs.setdefault("version", "%prog {}".format(self.VERSION)) + kwargs.setdefault("version", f"%prog {self.VERSION}") kwargs.setdefault("usage", self.usage) if self.description: kwargs.setdefault("description", self.description) @@ -187,7 +187,7 @@ class OptionParser(optparse.OptionParser): # Gather and run the process_