From 4d4901324709e49ad81f3903e86904f3855aec5e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 20 Jul 2022 10:42:30 +0100 Subject: [PATCH] Update to isort 5.10.1 Signed-off-by: Pedro Algarvio --- .pre-commit-config.yaml | 2 +- doc/_ext/saltdomain.py | 3 ++- run.py | 7 ++--- salt/auth/keystone.py | 2 +- salt/auth/ldap.py | 5 ++-- salt/auth/mysql.py | 4 +-- salt/beacons/watchdog.py | 2 +- salt/cache/mysql_cache.py | 4 +-- salt/client/__init__.py | 3 +-- salt/cloud/clouds/clc.py | 4 +-- salt/cloud/clouds/dimensiondata.py | 7 +++-- salt/cloud/clouds/gce.py | 9 +++---- salt/cloud/clouds/msazure.py | 5 ++-- salt/cloud/clouds/oneandone.py | 8 +----- salt/cloud/clouds/opennebula.py | 1 + salt/cloud/clouds/openstack.py | 6 ++--- salt/cloud/clouds/profitbricks.py | 12 ++++----- salt/cloud/clouds/proxmox.py | 2 +- salt/cloud/clouds/saltify.py | 13 +++++----- salt/cloud/clouds/tencentcloud.py | 2 +- salt/cloud/clouds/virtualbox.py | 9 ++++--- salt/cloud/clouds/vmware.py | 4 +-- salt/cloud/libcloudfuncs.py | 4 +-- salt/crypt.py | 19 ++++++-------- salt/engines/fluent.py | 2 +- salt/engines/junos_syslog.py | 20 +++++++------- salt/grains/core.py | 1 + salt/log_handlers/log4mongo_mod.py | 2 +- salt/modules/aptpkg.py | 5 +--- salt/modules/boto3_elasticache.py | 2 +- salt/modules/boto3_sns.py | 2 +- salt/modules/boto_apigateway.py | 2 +- salt/modules/boto_asg.py | 4 +-- salt/modules/boto_cloudwatch.py | 5 ++-- salt/modules/boto_dynamodb.py | 3 ++- salt/modules/boto_ec2.py | 2 +- salt/modules/boto_elb.py | 10 ++++--- salt/modules/boto_elbv2.py | 1 - salt/modules/boto_iam.py | 2 +- salt/modules/boto_iot.py | 2 +- salt/modules/boto_lambda.py | 2 +- salt/modules/boto_vpc.py | 2 +- salt/modules/capirca_acl.py | 2 +- salt/modules/cassandra_cql.py | 5 ++-- salt/modules/chocolatey.py | 3 ++- salt/modules/datadog_api.py | 1 + salt/modules/ddns.py | 2 +- salt/modules/debian_ip.py | 1 + salt/modules/debuild_pkgbuild.py | 1 + salt/modules/gentoolkitmod.py | 4 ++- salt/modules/github.py | 2 +- salt/modules/junos.py | 3 ++- salt/modules/kernelpkg_linux_apt.py | 2 +- salt/modules/kernelpkg_linux_yum.py | 6 ++--- salt/modules/keystone.py | 6 ++--- salt/modules/kubernetesmod.py | 3 +-- salt/modules/libcloud_compute.py | 2 +- salt/modules/libcloud_loadbalancer.py | 2 +- salt/modules/mysql.py | 8 +++--- salt/modules/napalm_netacl.py | 2 +- salt/modules/netmiko_mod.py | 3 +-- salt/modules/netscaler.py | 10 +++---- salt/modules/opsgenie.py | 1 + salt/modules/pagerduty_util.py | 1 + salt/modules/purefb.py | 11 ++++++-- salt/modules/rdp.py | 2 +- salt/modules/rh_ip.py | 1 + salt/modules/rh_service.py | 2 +- salt/modules/rpmbuild_pkgbuild.py | 1 + salt/modules/schedule.py | 3 ++- salt/modules/scp_mod.py | 2 +- salt/modules/smtp.py | 4 +-- salt/modules/splunk.py | 2 +- salt/modules/splunk_search.py | 2 +- salt/modules/suse_ip.py | 1 + salt/modules/twilio_notify.py | 2 +- salt/modules/virt.py | 1 + salt/modules/vsphere.py | 21 +++++++-------- salt/modules/win_dacl.py | 3 ++- salt/modules/win_dns_client.py | 1 + salt/modules/win_file.py | 1 + salt/modules/win_groupadd.py | 2 +- salt/modules/win_iis.py | 3 ++- salt/modules/win_smtp_server.py | 1 + salt/modules/win_status.py | 1 + salt/modules/win_system.py | 3 ++- salt/modules/win_useradd.py | 2 +- salt/modules/zk_concurrency.py | 15 +++++------ salt/netapi/rest_cherrypy/app.py | 3 ++- salt/netapi/rest_cherrypy/wsgi.py | 2 +- salt/pillar/__init__.py | 2 +- salt/pillar/ec2_pillar.py | 2 +- salt/pillar/makostack.py | 2 +- salt/pillar/mysql.py | 4 +-- salt/pillar/pepa.py | 6 +++-- salt/pillar/pillar_ldap.py | 1 + salt/pillar/stack.py | 3 ++- salt/pillar/vmware_pillar.py | 2 +- salt/proxy/netmiko_px.py | 6 +++-- salt/renderers/aws_kms.py | 2 +- salt/renderers/genshi.py | 4 +-- salt/renderers/yaml.py | 7 ++--- salt/returners/cassandra_cql_return.py | 5 ++-- salt/returners/influxdb_return.py | 1 + salt/returners/mysql.py | 4 +-- salt/returners/sms_return.py | 2 +- salt/returners/splunk.py | 1 + salt/runners/asam.py | 3 ++- salt/runners/bgp.py | 4 +-- salt/runners/ddns.py | 2 +- salt/runners/net.py | 5 ++-- salt/runners/vault.py | 1 + salt/scripts.py | 8 +++--- salt/serializers/yaml.py | 5 ++-- salt/serializers/yamlex.py | 7 ++--- salt/spm/__init__.py | 2 +- salt/states/grafana4_org.py | 3 ++- salt/states/grafana_dashboard.py | 1 + salt/states/netacl.py | 2 +- salt/states/pip_state.py | 4 +-- salt/states/pkg.py | 20 +++++++------- salt/states/restconf.py | 3 ++- salt/transport/tcp.py | 3 +-- salt/transport/zeromq.py | 5 ++-- salt/utils/azurearm.py | 2 +- salt/utils/boto3mod.py | 2 +- salt/utils/cloud.py | 12 ++++----- salt/utils/etcd_util.py | 2 +- salt/utils/extend.py | 3 ++- salt/utils/jinja.py | 9 ++++--- salt/utils/mako.py | 2 +- salt/utils/nacl.py | 2 +- salt/utils/nb_popen.py | 3 ++- salt/utils/openstack/neutron.py | 2 +- salt/utils/openstack/nova.py | 8 +++--- salt/utils/openstack/pyrax/__init__.py | 1 + salt/utils/pkg/win.py | 5 ++-- salt/utils/platform.py | 1 + salt/utils/psutil_compat.py | 4 +-- salt/utils/saltclass.py | 3 ++- salt/utils/smb.py | 26 +++++++++---------- salt/utils/templates.py | 2 ++ salt/utils/thin.py | 3 ++- salt/utils/vault.py | 1 + salt/utils/verify.py | 6 ++--- salt/utils/vmware.py | 7 ++--- salt/utils/vt.py | 7 ++--- salt/utils/win_dacl.py | 6 ++--- salt/utils/win_functions.py | 2 +- salt/utils/win_network.py | 1 + salt/utils/win_osinfo.py | 3 ++- salt/utils/win_reg.py | 2 +- salt/utils/win_runas.py | 12 +++++---- salt/utils/win_update.py | 2 +- salt/utils/yaml.py | 5 ++-- salt/utils/yamldumper.py | 6 ++--- salt/utils/yamlencoding.py | 1 + salt/utils/yamllint.py | 3 ++- salt/utils/yamlloader.py | 3 ++- salt/utils/yamlloader_old.py | 3 ++- tasks/docs.py | 1 + tasks/docstrings.py | 1 + tasks/filemap.py | 1 + tasks/loader.py | 1 + tests/conftest.py | 1 + tests/integration/cli/test_custom_module.py | 1 + tests/integration/client/test_kwarg.py | 1 + tests/integration/client/test_standard.py | 1 + tests/integration/client/test_syndic.py | 1 + tests/integration/cloud/clouds/test_ec2.py | 3 ++- .../cloud/clouds/test_openstack.py | 7 +++-- .../cloud/clouds/test_tencentcloud.py | 3 ++- .../cloud/helpers/cloud_test_base.py | 3 ++- tests/integration/cloud/test_cloud.py | 1 + tests/integration/conftest.py | 1 + tests/integration/daemons/test_masterapi.py | 1 + .../integration/externalapi/test_venafiapi.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/loader/test_ext_modules.py | 1 + tests/integration/master/test_event_return.py | 1 + tests/integration/minion/test_executor.py | 1 + tests/integration/minion/test_timeout.py | 1 + tests/integration/modules/test_chocolatey.py | 1 + tests/integration/modules/test_cmdmod.py | 1 + tests/integration/modules/test_config.py | 1 + tests/integration/modules/test_cp.py | 5 ++-- tests/integration/modules/test_decorators.py | 1 + tests/integration/modules/test_disk.py | 1 + tests/integration/modules/test_dockermod.py | 3 ++- tests/integration/modules/test_file.py | 1 + tests/integration/modules/test_gem.py | 1 + .../integration/modules/test_gentoolkitmod.py | 1 + tests/integration/modules/test_git.py | 1 + tests/integration/modules/test_groupadd.py | 3 ++- tests/integration/modules/test_hosts.py | 1 + tests/integration/modules/test_key.py | 1 + tests/integration/modules/test_linux_acl.py | 1 + .../integration/modules/test_linux_shadow.py | 3 ++- tests/integration/modules/test_localemod.py | 1 + tests/integration/modules/test_lxc.py | 1 + .../integration/modules/test_mac_assistive.py | 1 + .../integration/modules/test_mac_brew_pkg.py | 1 + tests/integration/modules/test_mac_desktop.py | 1 + tests/integration/modules/test_mac_group.py | 3 ++- .../integration/modules/test_mac_keychain.py | 1 + .../integration/modules/test_mac_portspkg.py | 1 + tests/integration/modules/test_mac_power.py | 1 + tests/integration/modules/test_mac_service.py | 1 + tests/integration/modules/test_mac_shadow.py | 1 + .../modules/test_mac_softwareupdate.py | 1 + tests/integration/modules/test_mac_sysctl.py | 1 + tests/integration/modules/test_mac_system.py | 1 + .../integration/modules/test_mac_timezone.py | 1 + tests/integration/modules/test_mac_user.py | 3 ++- tests/integration/modules/test_mac_xattr.py | 1 + tests/integration/modules/test_macdefaults.py | 1 + tests/integration/modules/test_mine.py | 1 + tests/integration/modules/test_mysql.py | 1 + tests/integration/modules/test_nilrt_ip.py | 1 + tests/integration/modules/test_pip.py | 1 + tests/integration/modules/test_publish.py | 1 + tests/integration/modules/test_pw_user.py | 1 + tests/integration/modules/test_rabbitmq.py | 1 + tests/integration/modules/test_saltcheck.py | 1 + tests/integration/modules/test_service.py | 1 + tests/integration/modules/test_ssh.py | 1 + tests/integration/modules/test_status.py | 1 + tests/integration/modules/test_swarm.py | 1 + tests/integration/modules/test_sysrc.py | 1 + tests/integration/modules/test_system.py | 1 + tests/integration/modules/test_test.py | 1 + tests/integration/modules/test_timezone.py | 1 + tests/integration/modules/test_vault.py | 1 + .../modules/test_virtualenv_mod.py | 1 + .../integration/modules/test_win_autoruns.py | 1 + .../modules/test_win_dns_client.py | 1 + .../integration/modules/test_win_firewall.py | 1 + tests/integration/modules/test_win_lgpo.py | 3 ++- tests/integration/modules/test_win_ntp.py | 1 + tests/integration/modules/test_win_pkg.py | 1 + .../modules/test_win_servermanager.py | 1 + tests/integration/modules/test_win_task.py | 1 + .../netapi/rest_tornado/test_app.py | 1 + tests/integration/output/test_output.py | 3 ++- tests/integration/pillar/test_git_pillar.py | 3 ++- tests/integration/renderers/test_jinja.py | 1 + tests/integration/renderers/test_pydsl.py | 1 + .../returners/test_librato_return.py | 1 + tests/integration/runners/test_fileserver.py | 1 + tests/integration/runners/test_jobs.py | 1 + tests/integration/runners/test_manage.py | 1 + tests/integration/runners/test_nacl.py | 3 ++- .../runners/test_runner_returns.py | 1 + tests/integration/runners/test_salt.py | 1 + tests/integration/sdb/test_env.py | 1 + tests/integration/shell/test_arguments.py | 1 + tests/integration/shell/test_enabled.py | 1 + tests/integration/shell/test_master_tops.py | 1 + tests/integration/shell/test_spm.py | 1 + tests/integration/spm/test_build.py | 1 + tests/integration/spm/test_files.py | 1 + tests/integration/spm/test_info.py | 1 + tests/integration/spm/test_install.py | 1 + tests/integration/spm/test_remove.py | 1 + tests/integration/spm/test_repo.py | 1 + tests/integration/ssh/test_deploy.py | 1 + tests/integration/ssh/test_jinja_filters.py | 1 + tests/integration/ssh/test_master.py | 1 + tests/integration/ssh/test_mine.py | 1 + tests/integration/ssh/test_pre_flight.py | 1 + tests/integration/ssh/test_raw.py | 1 + tests/integration/ssh/test_saltcheck.py | 1 + tests/integration/ssh/test_state.py | 1 + tests/integration/states/test_alternatives.py | 1 + tests/integration/states/test_archive.py | 1 + tests/integration/states/test_bower.py | 1 + tests/integration/states/test_chocolatey.py | 1 + tests/integration/states/test_cmd.py | 1 + .../integration/states/test_docker_network.py | 1 + tests/integration/states/test_file.py | 2 ++ tests/integration/states/test_git.py | 1 + tests/integration/states/test_handle_error.py | 1 + tests/integration/states/test_host.py | 1 + tests/integration/states/test_keystone.py | 1 + tests/integration/states/test_lxd.py | 1 + .../integration/states/test_lxd_container.py | 1 + tests/integration/states/test_lxd_image.py | 1 + tests/integration/states/test_lxd_profile.py | 1 + tests/integration/states/test_match.py | 1 + .../integration/states/test_mysql_database.py | 1 + tests/integration/states/test_mysql_grants.py | 1 + tests/integration/states/test_network.py | 1 + tests/integration/states/test_npm.py | 1 + .../integration/states/test_rabbitmq_user.py | 1 + .../integration/states/test_rabbitmq_vhost.py | 1 + tests/integration/states/test_reg.py | 3 ++- tests/integration/states/test_renderers.py | 1 + tests/integration/states/test_service.py | 1 + tests/integration/states/test_ssh_auth.py | 1 + .../states/test_ssh_known_hosts.py | 1 + tests/integration/states/test_x509.py | 1 + tests/integration/utils/test_win_runas.py | 9 ++++--- tests/pytests/conftest.py | 5 ++-- tests/pytests/functional/cache/helpers.py | 1 + tests/pytests/functional/cache/test_consul.py | 3 ++- tests/pytests/functional/cache/test_etcd.py | 1 + .../pytests/functional/cache/test_localfs.py | 1 + .../pytests/functional/cache/test_memcache.py | 1 + tests/pytests/functional/cache/test_mysql.py | 1 + tests/pytests/functional/cache/test_redis.py | 3 ++- tests/pytests/functional/channel/conftest.py | 1 + .../pytests/functional/channel/test_server.py | 5 ++-- tests/pytests/functional/cli/test_api.py | 1 + tests/pytests/functional/cli/test_salt.py | 1 + .../functional/cli/test_salt_master.py | 3 ++- .../functional/fileserver/hgfs/test_hgfs.py | 3 ++- .../functional/fileserver/test_roots.py | 1 + .../loader/test_loaded_base_name.py | 3 ++- .../pytests/functional/loader/test_loader.py | 1 + .../log_handlers/test_logstash_mod.py | 3 ++- .../functional/modules/cmd/test_powershell.py | 1 + .../functional/modules/file/test_readlink.py | 1 + .../functional/modules/file/test_symlink.py | 1 + .../modules/state/requisites/test_watch.py | 1 + .../functional/modules/state/test_state.py | 1 + .../pytests/functional/modules/test_aptpkg.py | 1 + .../functional/modules/test_archive.py | 1 + .../functional/modules/test_etcd_mod.py | 1 + .../functional/modules/test_mac_pkgutil.py | 1 + .../pytests/functional/modules/test_mysql.py | 3 ++- tests/pytests/functional/modules/test_opkg.py | 1 + tests/pytests/functional/modules/test_pip.py | 1 + tests/pytests/functional/modules/test_pkg.py | 3 ++- .../pytests/functional/modules/test_runit.py | 1 + .../functional/modules/test_saltutil.py | 1 + tests/pytests/functional/modules/test_user.py | 3 ++- .../functional/modules/test_win_certutil.py | 1 + .../functional/modules/test_win_dsc.py | 1 + .../functional/modules/test_win_shortcut.py | 1 + tests/pytests/functional/modules/test_yaml.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 + .../test_adv_audit_settings_module.py | 1 + .../modules/win_lgpo/test_write_regpol.py | 1 + tests/pytests/functional/netapi/conftest.py | 3 ++- .../netapi/rest_cherrypy/conftest.py | 1 + .../netapi/rest_cherrypy/test_auth.py | 1 + .../netapi/rest_cherrypy/test_auth_pam.py | 1 + .../netapi/rest_cherrypy/test_cors.py | 1 + .../test_external_auth_syntax.py | 1 + .../netapi/rest_cherrypy/test_in_formats.py | 1 + .../netapi/rest_cherrypy/test_out_formats.py | 1 + .../netapi/rest_tornado/conftest.py | 1 + .../netapi/rest_tornado/test_auth_handler.py | 1 + .../rest_tornado/test_auth_handler_pam.py | 1 + .../rest_tornado/test_base_api_handler.py | 1 + .../rest_tornado/test_event_listener.py | 1 + .../rest_tornado/test_external_auth_syntax.py | 1 + .../netapi/rest_tornado/test_run_handler.py | 1 + .../rest_tornado/test_webhooks_handler.py | 1 + .../rest_tornado/test_websockets_handler.py | 1 + .../pillar/hg_pillar/test_hg_pillar.py | 1 + .../functional/pillar/test_etcd_pillar.py | 1 + tests/pytests/functional/pillar/test_gpg.py | 3 ++- tests/pytests/functional/pillar/test_top.py | 1 + .../functional/returners/test_etcd_return.py | 1 + .../functional/runners/test_winrepo.py | 1 + tests/pytests/functional/sdb/test_etcd_db.py | 1 + .../states/file/test__check_directory_win.py | 1 + .../functional/states/file/test_comment.py | 1 + .../states/file/test_directory_win.py | 1 + .../functional/states/file/test_rename.py | 1 + .../functional/states/pkgrepo/test_debian.py | 1 + .../states/rabbitmq/test_cluster.py | 1 + .../functional/states/rabbitmq/test_plugin.py | 1 + .../functional/states/rabbitmq/test_policy.py | 1 + .../states/rabbitmq/test_upstream.py | 1 + .../functional/states/rabbitmq/test_user.py | 1 + .../functional/states/rabbitmq/test_vhost.py | 1 + .../pytests/functional/states/test_archive.py | 1 + .../states/test_docker_container.py | 3 ++- .../functional/states/test_etcd_mod.py | 1 + tests/pytests/functional/states/test_file.py | 1 + .../pytests/functional/states/test_module.py | 1 + tests/pytests/functional/states/test_mysql.py | 3 ++- tests/pytests/functional/states/test_npm.py | 1 + .../functional/states/test_pip_state.py | 1 + tests/pytests/functional/states/test_pkg.py | 1 + .../pytests/functional/states/test_pkgrepo.py | 1 + tests/pytests/functional/states/test_reg.py | 1 + tests/pytests/functional/states/test_svn.py | 1 + tests/pytests/functional/states/test_user.py | 3 ++- .../functional/states/test_virtualenv_mod.py | 1 + .../functional/states/test_win_certutil.py | 1 + .../win_lgpo/test_adv_audit_settings_state.py | 1 + .../win_lgpo/test_audit_settings_state.py | 1 + .../states/win_lgpo/test_rights_assignment.py | 1 + tests/pytests/functional/test_payload.py | 3 ++- tests/pytests/functional/test_version.py | 1 + .../pytests/functional/transport/conftest.py | 1 + .../functional/transport/ipc/test_client.py | 1 + .../transport/ipc/test_subscriber.py | 1 + .../transport/server/test_req_channel.py | 3 ++- .../transport/tcp/test_message_client.py | 1 + .../zeromq/test_pub_server_channel.py | 5 ++-- .../functools/test_namespaced_function.py | 1 + .../rthooks/test_salt_utils_vt_terminal.py | 1 + .../pyinstaller/rthooks/test_subprocess.py | 1 + .../utils/test_async_event_publisher.py | 3 ++- .../functional/utils/test_etcd_util.py | 1 + tests/pytests/functional/utils/test_jinja.py | 3 ++- .../pytests/functional/utils/test_process.py | 1 + .../utils/user/test_chugid_and_umask.py | 1 + .../functional/utils/win_dacl/test_file.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 + .../functional/utils/win_dacl/test_reg.py | 3 ++- .../utils/yamllint/test_yamllint.py | 1 + .../test_multiple_processes_logging.py | 3 ++- tests/pytests/integration/cli/test_batch.py | 1 + tests/pytests/integration/cli/test_matcher.py | 1 + tests/pytests/integration/cli/test_salt.py | 3 ++- .../pytests/integration/cli/test_salt_call.py | 1 + tests/pytests/integration/cli/test_salt_cp.py | 1 + .../integration/cli/test_salt_deltaproxy.py | 3 ++- .../pytests/integration/cli/test_salt_key.py | 3 ++- .../integration/cli/test_salt_master.py | 3 ++- .../integration/cli/test_salt_minion.py | 3 ++- .../integration/cli/test_salt_proxy.py | 3 ++- .../pytests/integration/cli/test_salt_run.py | 1 + .../integration/cli/test_salt_syndic.py | 3 ++- tests/pytests/integration/client/conftest.py | 1 + .../pytests/integration/client/test_runner.py | 1 + .../integration/master/test_clear_funcs.py | 1 + .../integration/modules/grains/conftest.py | 1 + .../modules/saltutil/test_pillar.py | 1 + .../integration/modules/state/test_state.py | 3 ++- .../modules/state/test_state_test.py | 1 + .../integration/modules/test_beacons.py | 1 + .../pytests/integration/modules/test_idem.py | 1 + .../modules/test_rpmbuild_pkgbuild.py | 1 + .../pytests/integration/modules/test_virt.py | 1 + tests/pytests/integration/netapi/conftest.py | 3 ++- .../netapi/rest_cherrypy/conftest.py | 1 + .../netapi/rest_cherrypy/test_arg_kwarg.py | 1 + .../netapi/rest_cherrypy/test_auth.py | 1 + .../netapi/rest_cherrypy/test_jobs.py | 1 + .../netapi/rest_cherrypy/test_run.py | 1 + .../netapi/rest_tornado/conftest.py | 1 + .../rest_tornado/test_events_api_handler.py | 1 + .../rest_tornado/test_jobs_api_handler.py | 1 + .../rest_tornado/test_minions_api_handler.py | 1 + .../netapi/rest_tornado/test_root_handler.py | 1 + .../rest_tornado/test_run_api_handler.py | 1 + .../pytests/integration/netapi/test_client.py | 1 + .../integration/netapi/test_ssh_client.py | 1 + tests/pytests/integration/proxy/test_shell.py | 1 + .../integration/reactor/test_reactor.py | 1 + .../integration/renderers/test_toml.py | 1 + .../runners/state/orchestrate/test_events.py | 1 + tests/pytests/integration/sdb/test_etcd_db.py | 1 + tests/pytests/integration/sdb/test_vault.py | 3 ++- tests/pytests/integration/ssh/test_grains.py | 1 + .../integration/states/test_ansiblegate.py | 5 ++-- tests/pytests/integration/states/test_cron.py | 1 + tests/pytests/integration/states/test_file.py | 3 ++- tests/pytests/integration/states/test_idem.py | 1 + tests/pytests/integration/wheel/conftest.py | 1 + .../pytests/integration/wheel/test_client.py | 1 + tests/pytests/scenarios/compat/conftest.py | 3 ++- .../scenarios/compat/test_with_versions.py | 3 ++- .../failover/multimaster/conftest.py | 3 ++- .../multimaster/test_failover_master.py | 1 + .../multimaster/beacons/test_inotify.py | 1 + .../pytests/scenarios/multimaster/conftest.py | 3 ++- .../multimaster/modules/test_test.py | 1 + tests/pytests/scenarios/setup/conftest.py | 1 + tests/pytests/scenarios/setup/test_install.py | 1 + tests/pytests/scenarios/setup/test_man.py | 1 + .../handlers/test_deferred_stream_handler.py | 1 + tests/pytests/unit/auth/test_pam.py | 1 + tests/pytests/unit/auth/test_rest.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 + .../pytests/unit/beacons/test_salt_monitor.py | 1 + tests/pytests/unit/beacons/test_sensehat.py | 1 + tests/pytests/unit/beacons/test_status.py | 1 + tests/pytests/unit/beacons/test_swapusage.py | 1 + tests/pytests/unit/beacons/test_watchdog.py | 1 + tests/pytests/unit/cache/test_mysql_cache.py | 1 + tests/pytests/unit/client/ssh/test_shell.py | 1 + tests/pytests/unit/client/ssh/test_ssh.py | 1 + tests/pytests/unit/client/test_ssh.py | 1 + .../unit/cloud/clouds/test_azurearm.py | 1 + tests/pytests/unit/cloud/clouds/test_ec2.py | 1 + tests/pytests/unit/cloud/clouds/test_gce.py | 1 + .../pytests/unit/cloud/clouds/test_hetzner.py | 1 + .../unit/cloud/clouds/test_openstack.py | 1 + tests/pytests/unit/cloud/clouds/test_xen.py | 1 + tests/pytests/unit/cloud/test_cloud.py | 1 + tests/pytests/unit/cloud/test_map.py | 1 + .../unit/config/test__validate_opts.py | 1 + tests/pytests/unit/engines/test_engines.py | 1 + .../unit/engines/test_libvirt_events.py | 1 + tests/pytests/unit/engines/test_script.py | 1 + tests/pytests/unit/engines/test_slack.py | 1 + tests/pytests/unit/engines/test_sqs_events.py | 1 + tests/pytests/unit/engines/test_stalekey.py | 1 + tests/pytests/unit/grains/test_core.py | 1 + .../pytests/unit/grains/test_metadata_gce.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/dockermod/test_module.py | 1 + .../unit/modules/dockermod/test_trans_tar.py | 1 + .../unit/modules/file/test_file_basics.py | 1 + .../modules/file/test_file_block_replace.py | 1 + .../unit/modules/file/test_file_chattr.py | 1 + .../unit/modules/file/test_file_check.py | 1 + .../modules/file/test_file_comment_line.py | 1 + .../unit/modules/file/test_file_grep.py | 1 + .../unit/modules/file/test_file_line.py | 1 + .../unit/modules/file/test_file_lsattr.py | 1 + .../unit/modules/file/test_file_module.py | 1 + .../unit/modules/file/test_file_selinux.py | 1 + tests/pytests/unit/modules/napalm/test_bgp.py | 1 + .../unit/modules/napalm/test_formula.py | 1 + tests/pytests/unit/modules/napalm/test_mod.py | 1 + .../unit/modules/napalm/test_netacl.py | 1 + .../unit/modules/napalm/test_network.py | 1 + tests/pytests/unit/modules/napalm/test_ntp.py | 1 + .../pytests/unit/modules/napalm/test_route.py | 1 + .../pytests/unit/modules/napalm/test_snmp.py | 1 + .../pytests/unit/modules/napalm/test_users.py | 1 + .../pytests/unit/modules/state/test_state.py | 1 + .../unit/modules/state/test_top_file_merge.py | 1 + tests/pytests/unit/modules/test_aix_status.py | 1 + tests/pytests/unit/modules/test_aliases.py | 1 + .../pytests/unit/modules/test_alternatives.py | 1 + .../pytests/unit/modules/test_ansiblegate.py | 1 + tests/pytests/unit/modules/test_aptpkg.py | 1 + tests/pytests/unit/modules/test_archive.py | 1 + .../pytests/unit/modules/test_azurearm_dns.py | 1 + tests/pytests/unit/modules/test_beacons.py | 1 + tests/pytests/unit/modules/test_boto_elbv2.py | 1 + tests/pytests/unit/modules/test_boto_ssm.py | 1 + tests/pytests/unit/modules/test_chocolatey.py | 1 + tests/pytests/unit/modules/test_cmdmod.py | 1 + tests/pytests/unit/modules/test_consul.py | 1 + tests/pytests/unit/modules/test_cp.py | 1 + tests/pytests/unit/modules/test_data.py | 1 + tests/pytests/unit/modules/test_defaults.py | 1 + tests/pytests/unit/modules/test_dig.py | 1 + tests/pytests/unit/modules/test_etcd_mod.py | 1 + .../unit/modules/test_freebsd_sysctl.py | 1 + tests/pytests/unit/modules/test_freezer.py | 1 + tests/pytests/unit/modules/test_git.py | 1 + tests/pytests/unit/modules/test_gpg.py | 1 + tests/pytests/unit/modules/test_grains.py | 1 + tests/pytests/unit/modules/test_ipset.py | 1 + tests/pytests/unit/modules/test_iptables.py | 1 + tests/pytests/unit/modules/test_keyboard.py | 1 + .../pytests/unit/modules/test_linux_sysctl.py | 1 + .../unit/modules/test_mac_assistive.py | 1 + .../pytests/unit/modules/test_mac_brew_pkg.py | 1 + .../pytests/unit/modules/test_mac_desktop.py | 1 + tests/pytests/unit/modules/test_mac_group.py | 1 + .../pytests/unit/modules/test_mac_keychain.py | 1 + .../pytests/unit/modules/test_mac_pkgutil.py | 1 + tests/pytests/unit/modules/test_mac_power.py | 1 + .../pytests/unit/modules/test_mac_service.py | 1 + .../unit/modules/test_mac_softwareupdate.py | 1 + tests/pytests/unit/modules/test_mac_sysctl.py | 1 + tests/pytests/unit/modules/test_mac_user.py | 1 + tests/pytests/unit/modules/test_mac_xattr.py | 1 + .../pytests/unit/modules/test_macdefaults.py | 1 + tests/pytests/unit/modules/test_macpackage.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_mod_random.py | 1 + tests/pytests/unit/modules/test_modjk.py | 1 + tests/pytests/unit/modules/test_monit.py | 1 + tests/pytests/unit/modules/test_moosefs.py | 1 + tests/pytests/unit/modules/test_mount.py | 1 + tests/pytests/unit/modules/test_munin.py | 1 + tests/pytests/unit/modules/test_mysql.py | 1 + tests/pytests/unit/modules/test_network.py | 1 + tests/pytests/unit/modules/test_nginx.py | 1 + tests/pytests/unit/modules/test_nilrt_ip.py | 1 + .../unit/modules/test_openbsd_sysctl.py | 1 + tests/pytests/unit/modules/test_openbsdpkg.py | 1 + tests/pytests/unit/modules/test_opkg.py | 1 + tests/pytests/unit/modules/test_pacmanpkg.py | 1 + tests/pytests/unit/modules/test_pcs.py | 1 + tests/pytests/unit/modules/test_pdbedit.py | 1 + tests/pytests/unit/modules/test_pf.py | 1 + tests/pytests/unit/modules/test_pillar.py | 1 + tests/pytests/unit/modules/test_pip.py | 1 + .../pytests/unit/modules/test_pkg_resource.py | 3 ++- tests/pytests/unit/modules/test_pkgin.py | 1 + tests/pytests/unit/modules/test_pkgng.py | 1 + tests/pytests/unit/modules/test_pkgutil.py | 1 + .../unit/modules/test_portage_config.py | 1 + tests/pytests/unit/modules/test_postfix.py | 1 + tests/pytests/unit/modules/test_postgres.py | 1 + tests/pytests/unit/modules/test_poudriere.py | 1 + tests/pytests/unit/modules/test_powerpath.py | 1 + tests/pytests/unit/modules/test_proxy.py | 1 + tests/pytests/unit/modules/test_publish.py | 1 + tests/pytests/unit/modules/test_puppet.py | 1 + tests/pytests/unit/modules/test_purefb.py | 1 + tests/pytests/unit/modules/test_pw_group.py | 1 + tests/pytests/unit/modules/test_pw_user.py | 1 + tests/pytests/unit/modules/test_pyenv.py | 1 + tests/pytests/unit/modules/test_qemu_img.py | 1 + tests/pytests/unit/modules/test_qemu_nbd.py | 1 + tests/pytests/unit/modules/test_rabbitmq.py | 1 + tests/pytests/unit/modules/test_rebootmgr.py | 1 + .../pytests/unit/modules/test_restartcheck.py | 1 + tests/pytests/unit/modules/test_restconf.py | 1 + tests/pytests/unit/modules/test_rpm_lowpkg.py | 1 + .../pytests/unit/modules/test_saltcloudmod.py | 1 + tests/pytests/unit/modules/test_saltutil.py | 1 + tests/pytests/unit/modules/test_schedule.py | 1 + tests/pytests/unit/modules/test_scsi.py | 1 + tests/pytests/unit/modules/test_sdb.py | 1 + tests/pytests/unit/modules/test_seed.py | 1 + tests/pytests/unit/modules/test_selinux.py | 1 + tests/pytests/unit/modules/test_sensors.py | 1 + tests/pytests/unit/modules/test_slack.py | 1 + .../unit/modules/test_slackware_service.py | 1 + tests/pytests/unit/modules/test_slsutil.py | 1 + .../unit/modules/test_solaris_shadow.py | 1 + .../unit/modules/test_solarisipspkg.py | 1 + tests/pytests/unit/modules/test_solarispkg.py | 1 + tests/pytests/unit/modules/test_status.py | 1 + tests/pytests/unit/modules/test_suse_ip.py | 1 + tests/pytests/unit/modules/test_swarm.py | 3 ++- tests/pytests/unit/modules/test_tls.py | 1 + .../unit/modules/test_transactional_update.py | 1 + tests/pytests/unit/modules/test_useradd.py | 1 + .../pytests/unit/modules/test_win_autoruns.py | 1 + .../pytests/unit/modules/test_win_certutil.py | 1 + tests/pytests/unit/modules/test_win_disk.py | 1 + tests/pytests/unit/modules/test_win_dism.py | 1 + .../unit/modules/test_win_dns_client.py | 1 + tests/pytests/unit/modules/test_win_file.py | 1 + .../pytests/unit/modules/test_win_network.py | 1 + tests/pytests/unit/modules/test_win_ntp.py | 1 + tests/pytests/unit/modules/test_win_path.py | 1 + tests/pytests/unit/modules/test_win_pkg.py | 1 + .../unit/modules/test_win_servermanager.py | 1 + .../pytests/unit/modules/test_win_timezone.py | 1 + tests/pytests/unit/modules/test_zabbix.py | 1 + tests/pytests/unit/modules/test_zfs.py | 1 + .../unit/modules/test_zfs_solaris10.py | 1 + .../unit/modules/test_zfs_solaris11.py | 1 + tests/pytests/unit/modules/test_zpool.py | 1 + tests/pytests/unit/modules/test_zypperpkg.py | 1 + tests/pytests/unit/modules/virt/conftest.py | 1 + .../pytests/unit/modules/virt/test_domain.py | 1 + tests/pytests/unit/modules/virt/test_host.py | 1 + .../pytests/unit/modules/virt/test_network.py | 1 + .../unit/netapi/cherrypy/test_events.py | 1 + .../unit/netapi/saltnado/test_base_handler.py | 1 + tests/pytests/unit/output/test_highstate.py | 1 + tests/pytests/unit/pillar/test_etcd_pillar.py | 1 + tests/pytests/unit/pillar/test_netbox.py | 1 + tests/pytests/unit/pillar/test_pillar.py | 1 + tests/pytests/unit/pillar/test_sql_base.py | 1 + tests/pytests/unit/proxy/test_netmiko_px.py | 3 ++- tests/pytests/unit/proxy/test_restconf.py | 1 + tests/pytests/unit/renderers/test_aws_kms.py | 1 + tests/pytests/unit/renderers/test_gpg.py | 1 + tests/pytests/unit/renderers/test_nacl.py | 1 + .../pytests/unit/renderers/test_stateconf.py | 1 + tests/pytests/unit/renderers/test_toml.py | 1 + tests/pytests/unit/renderers/test_yaml.py | 1 + tests/pytests/unit/renderers/test_yamlex.py | 1 + .../unit/returners/test_etcd_return.py | 1 + tests/pytests/unit/roster/test_ansible.py | 1 + tests/pytests/unit/roster/test_dir.py | 1 + tests/pytests/unit/runners/test_network.py | 1 + tests/pytests/unit/runners/test_pillar.py | 1 + tests/pytests/unit/runners/test_winrepo.py | 1 + tests/pytests/unit/sdb/test_etcd_db.py | 1 + .../unit/serializers/test_serializers.py | 3 ++- tests/pytests/unit/spm/test_pkgfiles.py | 1 + tests/pytests/unit/spm/test_spm.py | 1 + .../unit/state/test_multi_env_highstate.py | 1 + .../pytests/unit/state/test_state_compiler.py | 1 + .../unit/state/test_state_format_slots.py | 1 + .../unit/state/test_state_highstate.py | 1 + .../pytests/unit/state/test_state_options.py | 1 + .../pytests/unit/state/test_state_returns.py | 1 + .../unit/state/test_sub_state_returns.py | 1 + .../pytests/unit/states/apache/test_apache.py | 1 + tests/pytests/unit/states/apache/test_conf.py | 1 + .../pytests/unit/states/apache/test_module.py | 1 + tests/pytests/unit/states/apache/test_site.py | 1 + tests/pytests/unit/states/file/test_absent.py | 1 + .../pytests/unit/states/file/test_comment.py | 1 + tests/pytests/unit/states/file/test_copy.py | 1 + .../unit/states/file/test_directory.py | 1 + .../unit/states/file/test_filestate.py | 1 + .../unit/states/file/test_find_keep_files.py | 1 + .../pytests/unit/states/file/test_hardlink.py | 1 + .../pytests/unit/states/file/test_keyvalue.py | 1 + .../pytests/unit/states/file/test_managed.py | 1 + .../unit/states/file/test_mod_beacon.py | 1 + .../pytests/unit/states/file/test_prepend.py | 1 + .../states/file/test_private_functions.py | 1 + tests/pytests/unit/states/file/test_rename.py | 1 + .../states/file/test_retention_schedule.py | 1 + .../pytests/unit/states/file/test_selinux.py | 1 + .../pytests/unit/states/file/test_symlink.py | 1 + tests/pytests/unit/states/file/test_tidied.py | 1 + .../unit/states/mysql/test_database.py | 1 + .../pytests/unit/states/mysql/test_grants.py | 1 + tests/pytests/unit/states/mysql/test_query.py | 1 + tests/pytests/unit/states/mysql/test_user.py | 1 + .../unit/states/postgresql/test_cluster.py | 1 + .../unit/states/postgresql/test_database.py | 1 + .../unit/states/postgresql/test_extension.py | 1 + .../unit/states/postgresql/test_group.py | 1 + .../unit/states/postgresql/test_initdb.py | 1 + .../unit/states/postgresql/test_language.py | 1 + .../unit/states/postgresql/test_privileges.py | 1 + .../unit/states/postgresql/test_schema.py | 1 + .../unit/states/postgresql/test_user.py | 1 + .../unit/states/rabbitmq/test_cluster.py | 1 + .../unit/states/rabbitmq/test_plugin.py | 1 + .../unit/states/rabbitmq/test_policy.py | 1 + .../unit/states/rabbitmq/test_vhost.py | 1 + tests/pytests/unit/states/test_acme.py | 1 + tests/pytests/unit/states/test_alias.py | 1 + .../pytests/unit/states/test_alternatives.py | 1 + tests/pytests/unit/states/test_ansiblegate.py | 1 + tests/pytests/unit/states/test_aptpkg.py | 1 + tests/pytests/unit/states/test_archive.py | 1 + tests/pytests/unit/states/test_artifactory.py | 1 + tests/pytests/unit/states/test_at.py | 1 + tests/pytests/unit/states/test_augeas.py | 1 + tests/pytests/unit/states/test_aws_sqs.py | 1 + tests/pytests/unit/states/test_beacon.py | 1 + tests/pytests/unit/states/test_blockdev.py | 1 + tests/pytests/unit/states/test_boto_asg.py | 1 + .../unit/states/test_boto_cloudfront.py | 1 + .../unit/states/test_boto_cloudtrail.py | 1 + .../unit/states/test_boto_cloudwatch_alarm.py | 1 + .../unit/states/test_boto_cloudwatch_event.py | 1 + .../pytests/unit/states/test_boto_dynamodb.py | 1 + tests/pytests/unit/states/test_boto_ec2.py | 1 + .../unit/states/test_boto_elasticache.py | 1 + .../states/test_boto_elasticsearch_domain.py | 1 + tests/pytests/unit/states/test_boto_elb.py | 1 + .../pytests/unit/states/test_boto_iam_role.py | 1 + tests/pytests/unit/states/test_boto_iot.py | 1 + .../pytests/unit/states/test_boto_kinesis.py | 1 + tests/pytests/unit/states/test_boto_lambda.py | 1 + tests/pytests/unit/states/test_boto_lc.py | 1 + .../pytests/unit/states/test_boto_route53.py | 1 + .../unit/states/test_boto_s3_bucket.py | 1 + .../pytests/unit/states/test_boto_secgroup.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_btrfs.py | 1 + tests/pytests/unit/states/test_chef.py | 1 + tests/pytests/unit/states/test_cloud.py | 1 + tests/pytests/unit/states/test_cmd.py | 1 + tests/pytests/unit/states/test_composer.py | 1 + tests/pytests/unit/states/test_consul.py | 1 + tests/pytests/unit/states/test_ddns.py | 1 + tests/pytests/unit/states/test_debconfmod.py | 1 + .../pytests/unit/states/test_docker_image.py | 1 + .../pytests/unit/states/test_docker_volume.py | 1 + tests/pytests/unit/states/test_drac.py | 1 + .../pytests/unit/states/test_elasticsearch.py | 1 + tests/pytests/unit/states/test_environ.py | 1 + tests/pytests/unit/states/test_eselect.py | 1 + tests/pytests/unit/states/test_etcd_mod.py | 1 + tests/pytests/unit/states/test_event.py | 1 + tests/pytests/unit/states/test_git.py | 1 + tests/pytests/unit/states/test_grafana.py | 1 + .../unit/states/test_grafana_datasource.py | 1 + tests/pytests/unit/states/test_host.py | 1 + tests/pytests/unit/states/test_http.py | 1 + .../unit/states/test_influxdb08_database.py | 1 + .../unit/states/test_influxdb08_user.py | 1 + tests/pytests/unit/states/test_ini_manage.py | 1 + tests/pytests/unit/states/test_iptables.py | 1 + tests/pytests/unit/states/test_keyboard.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 | 1 + .../pytests/unit/states/test_libcloud_dns.py | 1 + tests/pytests/unit/states/test_locale.py | 1 + tests/pytests/unit/states/test_lvm.py | 1 + tests/pytests/unit/states/test_lvs_server.py | 1 + tests/pytests/unit/states/test_lvs_service.py | 1 + tests/pytests/unit/states/test_lxc.py | 1 + .../pytests/unit/states/test_mac_assistive.py | 1 + .../pytests/unit/states/test_mac_keychain.py | 1 + tests/pytests/unit/states/test_mac_xattr.py | 1 + tests/pytests/unit/states/test_macdefaults.py | 1 + tests/pytests/unit/states/test_macpackage.py | 1 + tests/pytests/unit/states/test_makeconf.py | 1 + tests/pytests/unit/states/test_mdadm_raid.py | 1 + tests/pytests/unit/states/test_memcached.py | 1 + tests/pytests/unit/states/test_modjk.py | 1 + .../pytests/unit/states/test_modjk_worker.py | 1 + .../unit/states/test_mongodb_database.py | 1 + .../pytests/unit/states/test_mongodb_user.py | 1 + tests/pytests/unit/states/test_nexus.py | 1 + tests/pytests/unit/states/test_nftables.py | 1 + tests/pytests/unit/states/test_npm.py | 1 + tests/pytests/unit/states/test_ntp.py | 1 + tests/pytests/unit/states/test_nxos.py | 1 + .../unit/states/test_openstack_config.py | 1 + .../unit/states/test_openvswitch_port.py | 1 + tests/pytests/unit/states/test_pagerduty.py | 1 + tests/pytests/unit/states/test_pdbedit.py | 1 + tests/pytests/unit/states/test_pecl.py | 1 + tests/pytests/unit/states/test_pkg.py | 1 + tests/pytests/unit/states/test_pkgng.py | 1 + tests/pytests/unit/states/test_pkgrepo.py | 1 + .../unit/states/test_portage_config.py | 1 + tests/pytests/unit/states/test_ports.py | 1 + tests/pytests/unit/states/test_powerpath.py | 1 + tests/pytests/unit/states/test_process.py | 1 + tests/pytests/unit/states/test_proxy.py | 1 + tests/pytests/unit/states/test_pyenv.py | 1 + .../pytests/unit/states/test_pyrax_queues.py | 1 + tests/pytests/unit/states/test_quota.py | 1 + tests/pytests/unit/states/test_rbenv.py | 1 + tests/pytests/unit/states/test_rdp.py | 1 + tests/pytests/unit/states/test_redismod.py | 1 + tests/pytests/unit/states/test_restconf.py | 1 + tests/pytests/unit/states/test_rsync.py | 1 + tests/pytests/unit/states/test_rvm.py | 1 + tests/pytests/unit/states/test_saltmod.py | 1 + tests/pytests/unit/states/test_saltutil.py | 1 + tests/pytests/unit/states/test_schedule.py | 1 + tests/pytests/unit/states/test_selinux.py | 1 + .../unit/states/test_serverdensity_device.py | 1 + tests/pytests/unit/states/test_service.py | 1 + tests/pytests/unit/states/test_slack.py | 1 + tests/pytests/unit/states/test_smartos.py | 1 + tests/pytests/unit/states/test_smtp.py | 1 + .../pytests/unit/states/test_splunk_search.py | 1 + tests/pytests/unit/states/test_ssh_auth.py | 1 + .../unit/states/test_ssh_known_hosts.py | 1 + tests/pytests/unit/states/test_status.py | 1 + tests/pytests/unit/states/test_supervisord.py | 1 + tests/pytests/unit/states/test_svn.py | 1 + tests/pytests/unit/states/test_sysctl.py | 1 + tests/pytests/unit/states/test_sysrc.py | 1 + tests/pytests/unit/states/test_test.py | 1 + tests/pytests/unit/states/test_timezone.py | 1 + tests/pytests/unit/states/test_tomcat.py | 1 + tests/pytests/unit/states/test_user.py | 1 + tests/pytests/unit/states/test_vbox_guest.py | 1 + tests/pytests/unit/states/test_webutil.py | 1 + .../pytests/unit/states/test_win_certutil.py | 1 + tests/pytests/unit/states/test_win_dism.py | 1 + .../unit/states/test_win_dns_client.py | 1 + tests/pytests/unit/states/test_win_iis.py | 1 + tests/pytests/unit/states/test_win_lgpo.py | 1 + tests/pytests/unit/states/test_win_license.py | 1 + tests/pytests/unit/states/test_win_network.py | 1 + tests/pytests/unit/states/test_win_path.py | 1 + tests/pytests/unit/states/test_win_pki.py | 1 + .../pytests/unit/states/test_win_powercfg.py | 1 + .../unit/states/test_win_servermanager.py | 1 + tests/pytests/unit/states/test_win_snmp.py | 1 + tests/pytests/unit/states/test_win_system.py | 1 + tests/pytests/unit/states/test_win_wua.py | 1 + tests/pytests/unit/states/test_win_wusa.py | 1 + tests/pytests/unit/states/test_winrepo.py | 1 + tests/pytests/unit/states/test_xml.py | 1 + tests/pytests/unit/states/test_xmpp.py | 1 + tests/pytests/unit/states/test_zfs.py | 1 + .../unit/states/test_zk_concurrency.py | 1 + tests/pytests/unit/states/test_zpool.py | 1 + tests/pytests/unit/states/virt/conftest.py | 1 + tests/pytests/unit/states/virt/test_domain.py | 1 + .../pytests/unit/states/virt/test_network.py | 1 + .../pytests/unit/states/zabbix/test_action.py | 1 + tests/pytests/unit/states/zabbix/test_host.py | 1 + .../unit/states/zabbix/test_template.py | 1 + .../unit/states/zabbix/test_valuemap.py | 1 + tests/pytests/unit/test_client.py | 1 + tests/pytests/unit/test_crypt.py | 1 + tests/pytests/unit/test_ext_importers.py | 3 ++- tests/pytests/unit/test_minion.py | 1 + tests/pytests/unit/test_syspaths.py | 1 + tests/pytests/unit/test_version.py | 1 + tests/pytests/unit/transport/test_ipc.py | 3 ++- tests/pytests/unit/transport/test_tcp.py | 3 ++- tests/pytests/unit/transport/test_zeromq.py | 1 + tests/pytests/unit/utils/event/test_event.py | 5 ++-- .../unit/utils/event/test_event_return.py | 3 ++- .../utils/jinja/test_custom_extensions.py | 3 ++- .../unit/utils/jinja/test_get_template.py | 1 + .../utils/jinja/test_jinja_default_options.py | 1 + .../utils/jinja/test_salt_cache_loader.py | 3 ++- .../pytests/unit/utils/scheduler/conftest.py | 3 ++- .../unit/utils/scheduler/test_error.py | 1 + .../pytests/unit/utils/scheduler/test_eval.py | 1 + .../unit/utils/scheduler/test_maxrunning.py | 1 + .../unit/utils/scheduler/test_schedule.py | 1 + tests/pytests/unit/utils/test_args.py | 1 + tests/pytests/unit/utils/test_cache.py | 1 + tests/pytests/unit/utils/test_cloud.py | 1 + tests/pytests/unit/utils/test_data.py | 1 + tests/pytests/unit/utils/test_etcd_util.py | 3 ++- tests/pytests/unit/utils/test_files.py | 1 + tests/pytests/unit/utils/test_http.py | 1 + tests/pytests/unit/utils/test_minions.py | 1 + tests/pytests/unit/utils/test_msgpack.py | 1 + tests/pytests/unit/utils/test_pycrypto.py | 1 + tests/pytests/unit/utils/test_reactor.py | 1 + tests/pytests/unit/utils/test_schedule.py | 1 + tests/pytests/unit/utils/test_slack.py | 1 + tests/pytests/unit/utils/test_stringutils.py | 1 + tests/pytests/unit/utils/test_thin.py | 1 + tests/pytests/unit/utils/test_vault.py | 1 + tests/pytests/unit/utils/test_verify.py | 1 + tests/pytests/unit/utils/test_versions.py | 1 + tests/pytests/unit/utils/test_vt.py | 1 + .../pytests/unit/utils/test_win_functions.py | 1 + tests/pytests/unit/utils/test_win_runas.py | 1 + tests/pytests/unit/utils/test_win_update.py | 1 + tests/pytests/unit/utils/test_xmlutil.py | 1 + tests/saltsh.py | 1 + tests/support/case.py | 3 ++- tests/support/copyartifacts.py | 1 + tests/support/gitfs.py | 7 ++--- tests/support/helpers.py | 7 ++--- tests/support/kernelpkg.py | 2 +- tests/support/mixins.py | 5 ++-- tests/support/mock.py | 3 ++- tests/support/netapi.py | 1 + tests/support/pytest/etcd.py | 3 ++- tests/support/pytest/helpers.py | 5 ++-- tests/support/pytest/loader.py | 1 + tests/support/virt.py | 1 + tests/support/xmlunit.py | 2 +- tests/unit/cli/test_daemons.py | 1 + tests/unit/client/test_ssh.py | 1 + tests/unit/cloud/__init__.py | 1 + tests/unit/cloud/clouds/test_vmware.py | 2 +- tests/unit/conftest.py | 1 + tests/unit/daemons/test_masterapi.py | 1 + tests/unit/ext/test_ipaddress.py | 1 + tests/unit/fileserver/test_gitfs.py | 1 + .../modules/test_boto_cloudwatch_event.py | 2 +- tests/unit/modules/test_boto_elb.py | 1 - tests/unit/modules/test_boto_iot.py | 2 +- tests/unit/modules/test_boto_lambda.py | 2 +- tests/unit/modules/test_boto_route53.py | 5 ++-- tests/unit/modules/test_btrfs.py | 1 + tests/unit/modules/test_debian_ip.py | 1 + tests/unit/modules/test_disk.py | 1 + tests/unit/modules/test_djangomod.py | 1 + tests/unit/modules/test_elasticsearch.py | 2 +- tests/unit/modules/test_guestfs.py | 1 + tests/unit/modules/test_junos.py | 11 ++++---- tests/unit/modules/test_k8s.py | 1 + .../unit/modules/test_kernelpkg_linux_apt.py | 10 +++---- .../unit/modules/test_kernelpkg_linux_yum.py | 12 ++++----- tests/unit/modules/test_kubeadm.py | 1 + tests/unit/modules/test_libcloud_compute.py | 6 ++--- .../modules/test_libcloud_loadbalancer.py | 2 +- tests/unit/modules/test_libcloud_storage.py | 2 +- tests/unit/modules/test_linux_shadow.py | 1 + tests/unit/modules/test_nacl.py | 3 ++- tests/unit/modules/test_pdbedit.py | 1 + tests/unit/modules/test_random_org.py | 1 + tests/unit/modules/test_reg.py | 3 ++- tests/unit/modules/test_rh_ip.py | 1 + tests/unit/modules/test_saltcheck.py | 1 + tests/unit/modules/test_systemd_service.py | 1 + tests/unit/modules/test_win_groupadd.py | 2 +- tests/unit/modules/test_win_ip.py | 1 + tests/unit/modules/test_win_lgpo.py | 1 + tests/unit/modules/test_win_service.py | 3 ++- tests/unit/modules/test_win_task.py | 1 + tests/unit/modules/test_zcbuildout.py | 1 + tests/unit/proxy/test_junos.py | 2 +- tests/unit/returners/test_local_cache.py | 1 + tests/unit/roster/test_clustershell.py | 1 + tests/unit/runners/test_queue.py | 1 + tests/unit/states/test_boto_apigateway.py | 1 + .../unit/states/test_boto_cognitoidentity.py | 1 + tests/unit/states/test_boto_vpc.py | 1 + tests/unit/states/test_kernelpkg.py | 7 +++-- tests/unit/states/test_kubernetes.py | 1 + tests/unit/states/test_loop.py | 1 + tests/unit/states/test_pip_state.py | 1 + tests/unit/states/test_saltmod.py | 1 + tests/unit/states/test_zcbuildout.py | 1 + tests/unit/test_config.py | 1 + tests/unit/test_crypt.py | 1 + tests/unit/test_engines.py | 1 + tests/unit/test_loader.py | 1 + tests/unit/test_master.py | 1 + tests/unit/test_proxy_minion.py | 3 ++- tests/unit/transport/test_ipc.py | 1 + tests/unit/transport/test_tcp.py | 3 ++- tests/unit/utils/test_context.py | 1 + tests/unit/utils/test_dns.py | 1 + tests/unit/utils/test_http.py | 3 ++- tests/unit/utils/test_nacl.py | 3 ++- tests/unit/utils/test_network.py | 1 + tests/unit/utils/test_pbm.py | 2 +- tests/unit/utils/test_process.py | 1 + tests/unit/utils/test_pydsl.py | 1 + tests/unit/utils/test_pyobjects.py | 1 + tests/unit/utils/test_templates.py | 1 + tests/unit/utils/test_thin.py | 1 + tests/unit/utils/test_timeout.py | 1 + tests/unit/utils/test_verify.py | 1 + tests/unit/utils/test_win_lgpo_auditpol.py | 1 + tests/unit/utils/test_win_lgpo_netsh.py | 1 + tests/unit/utils/test_win_pdh.py | 1 + tests/unit/utils/test_win_reg.py | 3 ++- tests/unit/utils/test_yamlloader.py | 3 ++- tests/unit/utils/test_zeromq.py | 3 +-- 1045 files changed, 1363 insertions(+), 446 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f36bf2b63f..c59b852a3c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1147,7 +1147,7 @@ repos: args: [--silent, -E, fix_asserts, -E, fix_docstrings] - repo: https://github.com/timothycrosley/isort - rev: "1e78a9acf3110e1f9721feb591f89a451fc9876a" + rev: 5.10.1 hooks: - id: isort additional_dependencies: ['toml'] diff --git a/doc/_ext/saltdomain.py b/doc/_ext/saltdomain.py index 03db0f1905d..e5e33dd4ded 100644 --- a/doc/_ext/saltdomain.py +++ b/doc/_ext/saltdomain.py @@ -2,7 +2,6 @@ import itertools import os import re -import salt from docutils import nodes from docutils.parsers.rst import Directive from docutils.statemachine import ViewList @@ -14,6 +13,8 @@ from sphinx.locale import _ from sphinx.roles import XRefRole from sphinx.util.nodes import make_refnode, nested_parse_with_titles, set_source_info +import salt + class Event(PyObject): """ diff --git a/run.py b/run.py index 1d48a5913e0..99e66d70ee9 100755 --- a/run.py +++ b/run.py @@ -1,18 +1,19 @@ #!/usr/bin/env python3 # see issue: https://gitlab.com/saltstack/open/salt-pkg/-/issues/19 -import _pyio import contextlib import multiprocessing import os import pathlib import sys -import salt.scripts -import salt.utils.platform +import _pyio import tiamatpip.cli import tiamatpip.configure import tiamatpip.utils +import salt.scripts +import salt.utils.platform + AVAIL = ( "minion", "master", diff --git a/salt/auth/keystone.py b/salt/auth/keystone.py index 29ab72ca231..5ed9f7c499f 100644 --- a/salt/auth/keystone.py +++ b/salt/auth/keystone.py @@ -6,8 +6,8 @@ Provide authentication using OpenStack Keystone try: - from keystoneclient.v2_0 import client from keystoneclient.exceptions import AuthorizationFailure, Unauthorized + from keystoneclient.v2_0 import client except ImportError: pass diff --git a/salt/auth/ldap.py b/salt/auth/ldap.py index 549701819e4..629bd93a3e0 100644 --- a/salt/auth/ldap.py +++ b/salt/auth/ldap.py @@ -6,9 +6,10 @@ Provide authentication using simple LDAP binds import itertools import logging +from jinja2 import Environment + import salt.utils.data import salt.utils.stringutils -from jinja2 import Environment from salt.exceptions import CommandExecutionError, SaltInvocationError log = logging.getLogger(__name__) @@ -16,8 +17,8 @@ log = logging.getLogger(__name__) try: # pylint: disable=no-name-in-module import ldap - import ldap.modlist import ldap.filter + import ldap.modlist HAS_LDAP = True # pylint: enable=no-name-in-module diff --git a/salt/auth/mysql.py b/salt/auth/mysql.py index b2e1a59a352..d08accb6cf4 100644 --- a/salt/auth/mysql.py +++ b/salt/auth/mysql.py @@ -55,8 +55,8 @@ log = logging.getLogger(__name__) try: # Trying to import MySQLdb import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors from MySQLdb.connections import OperationalError except ImportError: try: @@ -65,8 +65,8 @@ except ImportError: pymysql.install_as_MySQLdb() import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors from MySQLdb.err import OperationalError except ImportError: MySQLdb = None diff --git a/salt/beacons/watchdog.py b/salt/beacons/watchdog.py index 01c3f7f8207..658257354dd 100644 --- a/salt/beacons/watchdog.py +++ b/salt/beacons/watchdog.py @@ -14,8 +14,8 @@ import salt.utils.beacons try: # pylint: disable=no-name-in-module - from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler + from watchdog.observers import Observer # pylint: enable=no-name-in-module diff --git a/salt/cache/mysql_cache.py b/salt/cache/mysql_cache.py index 6b723fb72ec..8342ec77f16 100644 --- a/salt/cache/mysql_cache.py +++ b/salt/cache/mysql_cache.py @@ -60,8 +60,8 @@ from salt.exceptions import SaltCacheError try: # Trying to import MySQLdb import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors from MySQLdb.connections import OperationalError except ImportError: try: @@ -70,8 +70,8 @@ except ImportError: pymysql.install_as_MySQLdb() import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors from MySQLdb.err import OperationalError except ImportError: MySQLdb = None diff --git a/salt/client/__init__.py b/salt/client/__init__.py index 099cf33d85f..deb82bd7486 100644 --- a/salt/client/__init__.py +++ b/salt/client/__init__.py @@ -590,10 +590,9 @@ class LocalClient: # even though it has already been imported. # when cmd_batch is called via the NetAPI # the module is unavailable. - import salt.utils.args - # Late import - not used anywhere else in this file import salt.cli.batch + import salt.utils.args arg = salt.utils.args.condition_input(arg, kwarg) opts = { diff --git a/salt/cloud/clouds/clc.py b/salt/cloud/clouds/clc.py index 5ea5dfacb21..f2912531acc 100644 --- a/salt/cloud/clouds/clc.py +++ b/salt/cloud/clouds/clc.py @@ -83,9 +83,9 @@ except ImportError: HAS_CLC = False # Disable InsecureRequestWarning generated on python > 2.6 try: - from requests.packages.urllib3 import ( + from requests.packages.urllib3 import ( # pylint: disable=no-name-in-module disable_warnings, - ) # pylint: disable=no-name-in-module + ) disable_warnings() except Exception: # pylint: disable=broad-except diff --git a/salt/cloud/clouds/dimensiondata.py b/salt/cloud/clouds/dimensiondata.py index c35b24dcd44..5973a22316b 100644 --- a/salt/cloud/clouds/dimensiondata.py +++ b/salt/cloud/clouds/dimensiondata.py @@ -39,13 +39,12 @@ from salt.utils.versions import LooseVersion as _LooseVersion # Import libcloud try: import libcloud - from libcloud.compute.base import NodeDriver, NodeState - from libcloud.compute.base import NodeAuthPassword - from libcloud.compute.types import Provider + from libcloud.compute.base import NodeAuthPassword, NodeDriver, NodeState from libcloud.compute.providers import get_driver + from libcloud.compute.types import Provider from libcloud.loadbalancer.base import Member - from libcloud.loadbalancer.types import Provider as Provider_lb from libcloud.loadbalancer.providers import get_driver as get_driver_lb + from libcloud.loadbalancer.types import Provider as Provider_lb # This work-around for Issue #32743 is no longer needed for libcloud >= # 1.4.0. However, older versions of libcloud must still be supported with diff --git a/salt/cloud/clouds/gce.py b/salt/cloud/clouds/gce.py index 4e6f0f210e8..dafe6def7eb 100644 --- a/salt/cloud/clouds/gce.py +++ b/salt/cloud/clouds/gce.py @@ -66,14 +66,11 @@ from salt.utils.versions import LooseVersion as _LooseVersion LIBCLOUD_IMPORT_ERROR = None try: import libcloud - from libcloud.compute.types import Provider + from libcloud.common.google import ResourceInUseError, ResourceNotFoundError from libcloud.compute.providers import get_driver - from libcloud.loadbalancer.types import Provider as Provider_lb + from libcloud.compute.types import Provider from libcloud.loadbalancer.providers import get_driver as get_driver_lb - from libcloud.common.google import ( - ResourceInUseError, - ResourceNotFoundError, - ) + from libcloud.loadbalancer.types import Provider as Provider_lb HAS_LIBCLOUD = True except ImportError: diff --git a/salt/cloud/clouds/msazure.py b/salt/cloud/clouds/msazure.py index 2cc7f3b09dd..e18f6eaa12b 100644 --- a/salt/cloud/clouds/msazure.py +++ b/salt/cloud/clouds/msazure.py @@ -61,13 +61,14 @@ from salt.exceptions import SaltCloudSystemExit HAS_LIBS = False try: import azure - import azure.storage import azure.servicemanagement + import azure.storage from azure.common import ( AzureConflictHttpError, - AzureMissingResourceHttpError, AzureException, + AzureMissingResourceHttpError, ) + import salt.utils.msazure from salt.utils.msazure import object_to_dict diff --git a/salt/cloud/clouds/oneandone.py b/salt/cloud/clouds/oneandone.py index 7c4eb71efcc..7ddb50d3aba 100644 --- a/salt/cloud/clouds/oneandone.py +++ b/salt/cloud/clouds/oneandone.py @@ -109,13 +109,7 @@ from salt.exceptions import ( try: # pylint: disable=no-name-in-module - from oneandone.client import ( - OneAndOneService, - Server, - Hdd, - BlockStorage, - SshKey, - ) + from oneandone.client import BlockStorage, Hdd, OneAndOneService, Server, SshKey # pylint: enable=no-name-in-module diff --git a/salt/cloud/clouds/opennebula.py b/salt/cloud/clouds/opennebula.py index adf4fcc1261..02602ca1e17 100644 --- a/salt/cloud/clouds/opennebula.py +++ b/salt/cloud/clouds/opennebula.py @@ -77,6 +77,7 @@ from salt.exceptions import ( try: import xmlrpc.client + from lxml import etree HAS_XML_LIBS = True diff --git a/salt/cloud/clouds/openstack.py b/salt/cloud/clouds/openstack.py index 6a98081c46d..cdb588811ee 100644 --- a/salt/cloud/clouds/openstack.py +++ b/salt/cloud/clouds/openstack.py @@ -240,10 +240,10 @@ from salt.exceptions import ( ) try: - import shade - import shade.openstackcloud - import shade.exc import os_client_config + import shade + import shade.exc + import shade.openstackcloud HAS_SHADE = ( salt.utils.versions._LooseVersion(shade.__version__) diff --git a/salt/cloud/clouds/profitbricks.py b/salt/cloud/clouds/profitbricks.py index 2dfbcda5571..275febd9f2b 100644 --- a/salt/cloud/clouds/profitbricks.py +++ b/salt/cloud/clouds/profitbricks.py @@ -114,17 +114,17 @@ try: # pylint: disable=no-name-in-module import profitbricks from profitbricks.client import ( - ProfitBricksService, - Server, + LAN, NIC, - Volume, + Datacenter, FirewallRule, IPBlock, - Datacenter, LoadBalancer, - LAN, - PBNotFoundError, PBError, + PBNotFoundError, + ProfitBricksService, + Server, + Volume, ) # pylint: enable=no-name-in-module diff --git a/salt/cloud/clouds/proxmox.py b/salt/cloud/clouds/proxmox.py index 8f59aab6ccb..8e7745d17db 100644 --- a/salt/cloud/clouds/proxmox.py +++ b/salt/cloud/clouds/proxmox.py @@ -642,7 +642,7 @@ def create(vm_): if "use_dns" in vm_ and "ip_address" not in vm_: use_dns = vm_["use_dns"] if use_dns: - from socket import gethostbyname, gaierror + from socket import gaierror, gethostbyname try: ip_address = gethostbyname(str(vm_["name"])) diff --git a/salt/cloud/clouds/saltify.py b/salt/cloud/clouds/saltify.py index bb3ab1d48c2..47ff7f43b02 100644 --- a/salt/cloud/clouds/saltify.py +++ b/salt/cloud/clouds/saltify.py @@ -29,8 +29,8 @@ log = logging.getLogger(__name__) try: # noinspection PyUnresolvedReferences - from impacket.smbconnection import SessionError as smbSessionError from impacket.smb3 import SessionError as smb3SessionError + from impacket.smbconnection import SessionError as smbSessionError HAS_IMPACKET = True except ImportError: @@ -38,18 +38,17 @@ except ImportError: try: # noinspection PyUnresolvedReferences - from winrm.exceptions import WinRMTransportError - # noinspection PyUnresolvedReferences from requests.exceptions import ( ConnectionError, ConnectTimeout, - ReadTimeout, - SSLError, - ProxyError, - RetryError, InvalidSchema, + ProxyError, + ReadTimeout, + RetryError, + SSLError, ) + from winrm.exceptions import WinRMTransportError HAS_WINRM = True except ImportError: diff --git a/salt/cloud/clouds/tencentcloud.py b/salt/cloud/clouds/tencentcloud.py index 5611b0524ab..b2903b9380a 100644 --- a/salt/cloud/clouds/tencentcloud.py +++ b/salt/cloud/clouds/tencentcloud.py @@ -47,8 +47,8 @@ try: from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.cvm.v20170312 import cvm_client from tencentcloud.cvm.v20170312 import models as cvm_models - from tencentcloud.vpc.v20170312 import vpc_client from tencentcloud.vpc.v20170312 import models as vpc_models + from tencentcloud.vpc.v20170312 import vpc_client # pylint: enable=no-name-in-module diff --git a/salt/cloud/clouds/virtualbox.py b/salt/cloud/clouds/virtualbox.py index a5b6b87380e..58b8ecd0242 100644 --- a/salt/cloud/clouds/virtualbox.py +++ b/salt/cloud/clouds/virtualbox.py @@ -23,15 +23,16 @@ from salt.exceptions import SaltCloudSystemExit try: import vboxapi # pylint: disable=unused-import + from salt.utils.virtualbox import ( - vb_list_machines, + treat_machine_dict, vb_clone_vm, - vb_machine_exists, vb_destroy_machine, vb_get_machine, - vb_stop_vm, - treat_machine_dict, + vb_list_machines, + vb_machine_exists, vb_start_vm, + vb_stop_vm, vb_wait_for_network_address, ) diff --git a/salt/cloud/clouds/vmware.py b/salt/cloud/clouds/vmware.py index b0b3edf9c08..68fa1c821ab 100644 --- a/salt/cloud/clouds/vmware.py +++ b/salt/cloud/clouds/vmware.py @@ -139,9 +139,9 @@ except ImportError: # Disable InsecureRequestWarning generated on python > 2.6 try: - from requests.packages.urllib3 import ( + from requests.packages.urllib3 import ( # pylint: disable=no-name-in-module disable_warnings, - ) # pylint: disable=no-name-in-module + ) disable_warnings() except ImportError: diff --git a/salt/cloud/libcloudfuncs.py b/salt/cloud/libcloudfuncs.py index ed67934b1c7..cee5ea724f9 100644 --- a/salt/cloud/libcloudfuncs.py +++ b/salt/cloud/libcloudfuncs.py @@ -16,9 +16,9 @@ from salt.exceptions import SaltCloudNotFound, SaltCloudSystemExit # pylint: disable=W0611 try: import libcloud - from libcloud.compute.types import Provider, NodeState - from libcloud.compute.providers import get_driver from libcloud.compute.deployment import MultiStepDeployment, ScriptDeployment + from libcloud.compute.providers import get_driver + from libcloud.compute.types import NodeState, Provider HAS_LIBCLOUD = True LIBCLOUD_VERSION_INFO = tuple( diff --git a/salt/crypt.py b/salt/crypt.py index e974624d95d..067c84200b9 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -43,7 +43,7 @@ from salt.exceptions import ( ) try: - from M2Crypto import RSA, EVP, BIO + from M2Crypto import BIO, EVP, RSA HAS_M2 = True except ImportError: @@ -51,11 +51,12 @@ except ImportError: if not HAS_M2: try: - from Cryptodome.Cipher import AES, PKCS1_OAEP, PKCS1_v1_5 as PKCS1_v1_5_CIPHER + from Cryptodome import Random + from Cryptodome.Cipher import AES, PKCS1_OAEP + from Cryptodome.Cipher import PKCS1_v1_5 as PKCS1_v1_5_CIPHER from Cryptodome.Hash import SHA from Cryptodome.PublicKey import RSA from Cryptodome.Signature import PKCS1_v1_5 - from Cryptodome import Random HAS_CRYPTO = True except ImportError: @@ -63,18 +64,14 @@ if not HAS_M2: if not HAS_M2 and not HAS_CRYPTO: try: - from Crypto.Cipher import ( # nosec - AES, - PKCS1_OAEP, - PKCS1_v1_5 as PKCS1_v1_5_CIPHER, - ) + # let this be imported, if possible + from Crypto import Random # nosec + from Crypto.Cipher import AES, PKCS1_OAEP # nosec + from Crypto.Cipher import PKCS1_v1_5 as PKCS1_v1_5_CIPHER # nosec from Crypto.Hash import SHA # nosec from Crypto.PublicKey import RSA # nosec from Crypto.Signature import PKCS1_v1_5 # nosec - # let this be imported, if possible - from Crypto import Random # nosec - HAS_CRYPTO = True except ImportError: HAS_CRYPTO = False diff --git a/salt/engines/fluent.py b/salt/engines/fluent.py index 6848bc298f8..9b7367d7df4 100644 --- a/salt/engines/fluent.py +++ b/salt/engines/fluent.py @@ -40,7 +40,7 @@ import logging import salt.utils.event try: - from fluent import sender, event + from fluent import event, sender except ImportError: sender = None diff --git a/salt/engines/junos_syslog.py b/salt/engines/junos_syslog.py index 3b57521c561..17bd49c79b7 100644 --- a/salt/engines/junos_syslog.py +++ b/salt/engines/junos_syslog.py @@ -92,22 +92,22 @@ import time import salt.utils.event as event try: - from twisted.internet.protocol import ( # pylint: disable=no-name-in-module - DatagramProtocol, - ) - from twisted.internet import reactor, threads # pylint: disable=no-name-in-module from pyparsing import ( - Word, - alphas, - Suppress, Combine, - nums, - string, + LineEnd, Optional, Regex, - LineEnd, StringEnd, + Suppress, + Word, + alphas, delimitedList, + nums, + string, + ) + from twisted.internet import reactor, threads # pylint: disable=no-name-in-module + from twisted.internet.protocol import ( # pylint: disable=no-name-in-module + DatagramProtocol, ) HAS_TWISTED_AND_PYPARSING = True diff --git a/salt/grains/core.py b/salt/grains/core.py index debbeb257d6..9ab3a167f7e 100644 --- a/salt/grains/core.py +++ b/salt/grains/core.py @@ -24,6 +24,7 @@ import uuid from errno import EACCES, EPERM import distro + import salt.exceptions # Solve the Chicken and egg problem where grains need to run before any diff --git a/salt/log_handlers/log4mongo_mod.py b/salt/log_handlers/log4mongo_mod.py index df244a7b12d..3f99a0ca995 100644 --- a/salt/log_handlers/log4mongo_mod.py +++ b/salt/log_handlers/log4mongo_mod.py @@ -40,7 +40,7 @@ import socket from salt._logging import LOG_LEVELS try: - from log4mongo.handlers import MongoHandler, MongoFormatter + from log4mongo.handlers import MongoFormatter, MongoHandler HAS_MONGO = True except ImportError: diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index 931ceb74a84..46bf8b4d14c 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -54,10 +54,7 @@ log = logging.getLogger(__name__) try: import apt.cache import apt.debfile - from aptsources.sourceslist import ( - SourceEntry, - SourcesList, - ) + from aptsources.sourceslist import SourceEntry, SourcesList HAS_APT = True except ImportError: diff --git a/salt/modules/boto3_elasticache.py b/salt/modules/boto3_elasticache.py index a64e2450853..1e52ea25a2c 100644 --- a/salt/modules/boto3_elasticache.py +++ b/salt/modules/boto3_elasticache.py @@ -57,8 +57,8 @@ log = logging.getLogger(__name__) try: # pylint: disable=unused-import - import botocore import boto3 + import botocore # pylint: enable=unused-import logging.getLogger("boto3").setLevel(logging.CRITICAL) diff --git a/salt/modules/boto3_sns.py b/salt/modules/boto3_sns.py index 378b3e436fc..65ab6283f51 100644 --- a/salt/modules/boto3_sns.py +++ b/salt/modules/boto3_sns.py @@ -50,8 +50,8 @@ log = logging.getLogger(__name__) # pylint: disable=unused-import try: - import botocore import boto3 + import botocore import jmespath logging.getLogger("boto3").setLevel(logging.CRITICAL) diff --git a/salt/modules/boto_apigateway.py b/salt/modules/boto_apigateway.py index d2911e89acd..dad8858edb5 100644 --- a/salt/modules/boto_apigateway.py +++ b/salt/modules/boto_apigateway.py @@ -93,10 +93,10 @@ try: # pylint: disable=unused-import import boto import boto3 + from botocore import __version__ as found_botocore_version # pylint: enable=unused-import from botocore.exceptions import ClientError - from botocore import __version__ as found_botocore_version logging.getLogger("boto").setLevel(logging.CRITICAL) logging.getLogger("boto3").setLevel(logging.CRITICAL) diff --git a/salt/modules/boto_asg.py b/salt/modules/boto_asg.py index 7bdad75c7a0..c52c7946791 100644 --- a/salt/modules/boto_asg.py +++ b/salt/modules/boto_asg.py @@ -63,9 +63,9 @@ DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" try: import boto import boto.ec2 - import boto.ec2.instance - import boto.ec2.blockdevicemapping as blockdevicemapping import boto.ec2.autoscale as autoscale + import boto.ec2.blockdevicemapping as blockdevicemapping + import boto.ec2.instance logging.getLogger("boto").setLevel(logging.CRITICAL) import boto3 # pylint: disable=unused-import diff --git a/salt/modules/boto_cloudwatch.py b/salt/modules/boto_cloudwatch.py index bdd9794f3b3..f7967d23876 100644 --- a/salt/modules/boto_cloudwatch.py +++ b/salt/modules/boto_cloudwatch.py @@ -45,16 +45,17 @@ Connection module for Amazon CloudWatch import logging +import yaml # pylint: disable=blacklisted-import + import salt.utils.json import salt.utils.odict as odict import salt.utils.versions -import yaml # pylint: disable=blacklisted-import try: import boto import boto.ec2.cloudwatch - import boto.ec2.cloudwatch.listelement import boto.ec2.cloudwatch.dimension + import boto.ec2.cloudwatch.listelement logging.getLogger("boto").setLevel(logging.CRITICAL) HAS_BOTO = True diff --git a/salt/modules/boto_dynamodb.py b/salt/modules/boto_dynamodb.py index e83bf6bec9d..606eaa06876 100644 --- a/salt/modules/boto_dynamodb.py +++ b/salt/modules/boto_dynamodb.py @@ -55,12 +55,13 @@ try: import boto.dynamodb2 # pylint: enable=unused-import - from boto.dynamodb2.fields import HashKey, RangeKey from boto.dynamodb2.fields import ( AllIndex, GlobalAllIndex, GlobalIncludeIndex, GlobalKeysOnlyIndex, + HashKey, + RangeKey, ) from boto.dynamodb2.table import Table from boto.exception import JSONResponseError diff --git a/salt/modules/boto_ec2.py b/salt/modules/boto_ec2.py index 73281ab4249..be4edce11dc 100644 --- a/salt/modules/boto_ec2.py +++ b/salt/modules/boto_ec2.py @@ -60,8 +60,8 @@ try: # pylint: enable=unused-import from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType from boto.ec2.networkinterface import ( - NetworkInterfaceSpecification, NetworkInterfaceCollection, + NetworkInterfaceSpecification, ) HAS_BOTO = True diff --git a/salt/modules/boto_elb.py b/salt/modules/boto_elb.py index c912ce63bc0..310b91134bf 100644 --- a/salt/modules/boto_elb.py +++ b/salt/modules/boto_elb.py @@ -54,10 +54,12 @@ try: import boto import boto.ec2 # pylint: enable=unused-import from boto.ec2.elb import HealthCheck - from boto.ec2.elb.attributes import AccessLogAttribute - from boto.ec2.elb.attributes import ConnectionDrainingAttribute - from boto.ec2.elb.attributes import ConnectionSettingAttribute - from boto.ec2.elb.attributes import CrossZoneLoadBalancingAttribute + from boto.ec2.elb.attributes import ( + AccessLogAttribute, + ConnectionDrainingAttribute, + ConnectionSettingAttribute, + CrossZoneLoadBalancingAttribute, + ) logging.getLogger("boto").setLevel(logging.CRITICAL) HAS_BOTO = True diff --git a/salt/modules/boto_elbv2.py b/salt/modules/boto_elbv2.py index 2f20e857459..d91927caa67 100644 --- a/salt/modules/boto_elbv2.py +++ b/salt/modules/boto_elbv2.py @@ -49,7 +49,6 @@ try: import botocore # pylint: enable=unused-import - # TODO Version check using salt.utils.versions from botocore.exceptions import ClientError diff --git a/salt/modules/boto_iam.py b/salt/modules/boto_iam.py index c7ea859ecbc..521b1ff7140 100644 --- a/salt/modules/boto_iam.py +++ b/salt/modules/boto_iam.py @@ -49,8 +49,8 @@ import salt.utils.versions # pylint: disable=unused-import try: import boto - import boto.iam import boto3 + import boto.iam import botocore logging.getLogger("boto").setLevel(logging.CRITICAL) diff --git a/salt/modules/boto_iot.py b/salt/modules/boto_iot.py index 6985d416813..1243a1700f9 100644 --- a/salt/modules/boto_iot.py +++ b/salt/modules/boto_iot.py @@ -64,10 +64,10 @@ try: # pylint: disable=unused-import import boto import boto3 + from botocore import __version__ as found_botocore_version # pylint: enable=unused-import from botocore.exceptions import ClientError - from botocore import __version__ as found_botocore_version logging.getLogger("boto3").setLevel(logging.CRITICAL) HAS_BOTO = True diff --git a/salt/modules/boto_lambda.py b/salt/modules/boto_lambda.py index 313086e53ce..5dcd82a3634 100644 --- a/salt/modules/boto_lambda.py +++ b/salt/modules/boto_lambda.py @@ -96,10 +96,10 @@ try: # pylint: disable=unused-import import boto import boto3 + from botocore import __version__ as found_botocore_version # pylint: enable=unused-import from botocore.exceptions import ClientError - from botocore import __version__ as found_botocore_version logging.getLogger("boto").setLevel(logging.CRITICAL) logging.getLogger("boto3").setLevel(logging.CRITICAL) diff --git a/salt/modules/boto_vpc.py b/salt/modules/boto_vpc.py index 0f61a41dd6d..6c400e7809e 100644 --- a/salt/modules/boto_vpc.py +++ b/salt/modules/boto_vpc.py @@ -147,8 +147,8 @@ log = logging.getLogger(__name__) try: # pylint: disable=unused-import import boto - import botocore import boto.vpc + import botocore # pylint: enable=unused-import from boto.exception import BotoServerError diff --git a/salt/modules/capirca_acl.py b/salt/modules/capirca_acl.py index 6caed1faf47..82189e48ade 100644 --- a/salt/modules/capirca_acl.py +++ b/salt/modules/capirca_acl.py @@ -34,8 +34,8 @@ log = logging.getLogger(__file__) try: import capirca import capirca.aclgen - import capirca.lib.policy import capirca.lib.aclgenerator + import capirca.lib.policy HAS_CAPIRCA = True except ImportError: diff --git a/salt/modules/cassandra_cql.py b/salt/modules/cassandra_cql.py index ea6de11c3d4..d18689f39bf 100644 --- a/salt/modules/cassandra_cql.py +++ b/salt/modules/cassandra_cql.py @@ -96,14 +96,13 @@ __virtualname__ = "cassandra_cql" HAS_DRIVER = False try: # pylint: disable=import-error,no-name-in-module - from cassandra.cluster import Cluster - from cassandra.cluster import NoHostAvailable + from cassandra.auth import PlainTextAuthProvider + from cassandra.cluster import Cluster, NoHostAvailable from cassandra.connection import ( ConnectionException, ConnectionShutdown, OperationTimedOut, ) - from cassandra.auth import PlainTextAuthProvider from cassandra.query import dict_factory # pylint: enable=import-error,no-name-in-module diff --git a/salt/modules/chocolatey.py b/salt/modules/chocolatey.py index 85d612eaa8c..1e303a018bc 100644 --- a/salt/modules/chocolatey.py +++ b/salt/modules/chocolatey.py @@ -10,9 +10,10 @@ import os import re import tempfile +from requests.structures import CaseInsensitiveDict + import salt.utils.data import salt.utils.platform -from requests.structures import CaseInsensitiveDict from salt.exceptions import ( CommandExecutionError, CommandNotFoundError, diff --git a/salt/modules/datadog_api.py b/salt/modules/datadog_api.py index 3b86b870c45..27b59ba73ee 100644 --- a/salt/modules/datadog_api.py +++ b/salt/modules/datadog_api.py @@ -15,6 +15,7 @@ https://docs.datadoghq.com/api/ import requests + from salt.exceptions import SaltInvocationError HAS_DATADOG = True diff --git a/salt/modules/ddns.py b/salt/modules/ddns.py index 943940b795a..60bccff0719 100644 --- a/salt/modules/ddns.py +++ b/salt/modules/ddns.py @@ -32,8 +32,8 @@ log = logging.getLogger(__name__) try: import dns.query - import dns.update # pylint: disable=no-name-in-module import dns.tsigkeyring # pylint: disable=no-name-in-module + import dns.update # pylint: disable=no-name-in-module dns_support = True except ImportError as e: diff --git a/salt/modules/debian_ip.py b/salt/modules/debian_ip.py index c47181e38e1..4a7062c48fc 100644 --- a/salt/modules/debian_ip.py +++ b/salt/modules/debian_ip.py @@ -15,6 +15,7 @@ import time import jinja2 import jinja2.exceptions + import salt.utils.dns import salt.utils.files import salt.utils.odict diff --git a/salt/modules/debuild_pkgbuild.py b/salt/modules/debuild_pkgbuild.py index 3b84f0ab0d9..b34dd030fd5 100644 --- a/salt/modules/debuild_pkgbuild.py +++ b/salt/modules/debuild_pkgbuild.py @@ -33,6 +33,7 @@ REPREPRO_SIGN_PROMPT_RE = re.compile(r"Passphrase: ", re.M) try: import gnupg # pylint: disable=unused-import + import salt.modules.gpg HAS_LIBS = True diff --git a/salt/modules/gentoolkitmod.py b/salt/modules/gentoolkitmod.py index 9a3d27efc92..19e7b45f6fa 100644 --- a/salt/modules/gentoolkitmod.py +++ b/salt/modules/gentoolkitmod.py @@ -8,7 +8,9 @@ import os HAS_GENTOOLKIT = False try: - from gentoolkit.eclean import search, clean, cli, exclude as excludemod + from gentoolkit.eclean import clean, cli + from gentoolkit.eclean import exclude as excludemod + from gentoolkit.eclean import search HAS_GENTOOLKIT = True except ImportError: diff --git a/salt/modules/github.py b/salt/modules/github.py index 7a717964036..bc45f9cae96 100644 --- a/salt/modules/github.py +++ b/salt/modules/github.py @@ -39,8 +39,8 @@ HAS_LIBS = False try: # pylint: disable=no-name-in-module import github - import github.PaginatedList import github.NamedUser + import github.PaginatedList from github.GithubException import UnknownObjectException # pylint: enable=no-name-in-module diff --git a/salt/modules/junos.py b/salt/modules/junos.py index 7e00b46fc91..33f25080e1d 100644 --- a/salt/modules/junos.py +++ b/salt/modules/junos.py @@ -20,13 +20,14 @@ import os import re from functools import wraps +import yaml + import salt.utils.args import salt.utils.files import salt.utils.json import salt.utils.path import salt.utils.platform import salt.utils.stringutils -import yaml try: from lxml import etree diff --git a/salt/modules/kernelpkg_linux_apt.py b/salt/modules/kernelpkg_linux_apt.py index 2534565d568..36515227207 100644 --- a/salt/modules/kernelpkg_linux_apt.py +++ b/salt/modules/kernelpkg_linux_apt.py @@ -7,8 +7,8 @@ import logging import re try: - from salt.utils.versions import LooseVersion as _LooseVersion from salt.exceptions import CommandExecutionError + from salt.utils.versions import LooseVersion as _LooseVersion HAS_REQUIRED_LIBS = True except ImportError: diff --git a/salt/modules/kernelpkg_linux_yum.py b/salt/modules/kernelpkg_linux_yum.py index 920f1dfc467..42793a260e5 100644 --- a/salt/modules/kernelpkg_linux_yum.py +++ b/salt/modules/kernelpkg_linux_yum.py @@ -6,12 +6,12 @@ import functools import logging try: - from salt.utils.versions import LooseVersion as _LooseVersion - from salt.exceptions import CommandExecutionError + import salt.modules.yumpkg import salt.utils.data import salt.utils.functools import salt.utils.systemd - import salt.modules.yumpkg + from salt.exceptions import CommandExecutionError + from salt.utils.versions import LooseVersion as _LooseVersion __IMPORT_ERROR = None except ImportError as exc: diff --git a/salt/modules/keystone.py b/salt/modules/keystone.py index 9331da32336..b39a8b0ae5b 100644 --- a/salt/modules/keystone.py +++ b/salt/modules/keystone.py @@ -58,14 +58,14 @@ import salt.utils.http HAS_KEYSTONE = False try: # pylint: disable=import-error - from keystoneclient.v2_0 import client import keystoneclient.exceptions + from keystoneclient.v2_0 import client HAS_KEYSTONE = True - from keystoneclient.v3 import client as client3 - from keystoneclient import discover from keystoneauth1 import session from keystoneauth1.identity import generic + from keystoneclient import discover + from keystoneclient.v3 import client as client3 # pylint: enable=import-error except ImportError: diff --git a/salt/modules/kubernetesmod.py b/salt/modules/kubernetesmod.py index aa3a463c4e9..7f9d4ce2dae 100644 --- a/salt/modules/kubernetesmod.py +++ b/salt/modules/kubernetesmod.py @@ -72,8 +72,7 @@ try: from kubernetes.client import V1beta1Deployment as AppsV1beta1Deployment from kubernetes.client import V1beta1DeploymentSpec as AppsV1beta1DeploymentSpec except ImportError: - from kubernetes.client import AppsV1beta1Deployment - from kubernetes.client import AppsV1beta1DeploymentSpec + from kubernetes.client import AppsV1beta1Deployment, AppsV1beta1DeploymentSpec # pylint: enable=no-name-in-module HAS_LIBS = True diff --git a/salt/modules/libcloud_compute.py b/salt/modules/libcloud_compute.py index 83e3b2ed874..fe1a2aed8b5 100644 --- a/salt/modules/libcloud_compute.py +++ b/salt/modules/libcloud_compute.py @@ -43,8 +43,8 @@ REQUIRED_LIBCLOUD_VERSION = "2.0.0" try: # pylint: disable=unused-import import libcloud - from libcloud.compute.providers import get_driver from libcloud.compute.base import Node + from libcloud.compute.providers import get_driver # pylint: enable=unused-import if hasattr(libcloud, "__version__") and _LooseVersion( diff --git a/salt/modules/libcloud_loadbalancer.py b/salt/modules/libcloud_loadbalancer.py index 889a286c0f3..e524cdf8f23 100644 --- a/salt/modules/libcloud_loadbalancer.py +++ b/salt/modules/libcloud_loadbalancer.py @@ -42,8 +42,8 @@ REQUIRED_LIBCLOUD_VERSION = "1.5.0" try: # pylint: disable=unused-import import libcloud + from libcloud.loadbalancer.base import Algorithm, Member from libcloud.loadbalancer.providers import get_driver - from libcloud.loadbalancer.base import Member, Algorithm # pylint: enable=unused-import if hasattr(libcloud, "__version__") and _LooseVersion( diff --git a/salt/modules/mysql.py b/salt/modules/mysql.py index 2337e269457..27a3f039c35 100644 --- a/salt/modules/mysql.py +++ b/salt/modules/mysql.py @@ -49,10 +49,10 @@ import salt.utils.stringutils try: # Trying to import MySQLdb import MySQLdb - import MySQLdb.cursors import MySQLdb.converters - from MySQLdb.constants import FIELD_TYPE, FLAG, CLIENT + import MySQLdb.cursors from MySQLdb import OperationalError + from MySQLdb.constants import CLIENT, FIELD_TYPE, FLAG except ImportError: try: # MySQLdb import failed, try to import PyMySQL @@ -60,10 +60,10 @@ except ImportError: pymysql.install_as_MySQLdb() import MySQLdb - import MySQLdb.cursors import MySQLdb.converters - from MySQLdb.constants import FIELD_TYPE, FLAG, CLIENT + import MySQLdb.cursors from MySQLdb import OperationalError + from MySQLdb.constants import CLIENT, FIELD_TYPE, FLAG except ImportError: MySQLdb = None diff --git a/salt/modules/napalm_netacl.py b/salt/modules/napalm_netacl.py index 514eca4332b..b90eea75740 100644 --- a/salt/modules/napalm_netacl.py +++ b/salt/modules/napalm_netacl.py @@ -40,8 +40,8 @@ try: # pylint: disable=W0611 import capirca import capirca.aclgen - import capirca.lib.policy import capirca.lib.aclgenerator + import capirca.lib.policy HAS_CAPIRCA = True # pylint: enable=W0611 diff --git a/salt/modules/netmiko_mod.py b/salt/modules/netmiko_mod.py index 592837343bd..1769471f82b 100644 --- a/salt/modules/netmiko_mod.py +++ b/salt/modules/netmiko_mod.py @@ -189,8 +189,7 @@ from salt.exceptions import CommandExecutionError from salt.utils.args import clean_kwargs try: - from netmiko import ConnectHandler - from netmiko import BaseConnection + from netmiko import BaseConnection, ConnectHandler HAS_NETMIKO = True except ImportError: diff --git a/salt/modules/netscaler.py b/salt/modules/netscaler.py index b4fb16d4f48..e4d684c4088 100644 --- a/salt/modules/netscaler.py +++ b/salt/modules/netscaler.py @@ -51,18 +51,18 @@ import logging import salt.utils.platform try: - from nsnitro.nsnitro import NSNitro from nsnitro.nsexceptions import NSNitroError + from nsnitro.nsnitro import NSNitro + from nsnitro.nsresources.nslbvserver import NSLBVServer + from nsnitro.nsresources.nslbvserverservicegroupbinding import ( + NSLBVServerServiceGroupBinding, + ) from nsnitro.nsresources.nsserver import NSServer from nsnitro.nsresources.nsservice import NSService from nsnitro.nsresources.nsservicegroup import NSServiceGroup from nsnitro.nsresources.nsservicegroupserverbinding import ( NSServiceGroupServerBinding, ) - from nsnitro.nsresources.nslbvserver import NSLBVServer - from nsnitro.nsresources.nslbvserverservicegroupbinding import ( - NSLBVServerServiceGroupBinding, - ) from nsnitro.nsresources.nssslvserversslcertkeybinding import ( NSSSLVServerSSLCertKeyBinding, ) diff --git a/salt/modules/opsgenie.py b/salt/modules/opsgenie.py index 93f0f296a4b..18539b80654 100644 --- a/salt/modules/opsgenie.py +++ b/salt/modules/opsgenie.py @@ -23,6 +23,7 @@ Module for sending data to OpsGenie import logging import requests + import salt.exceptions import salt.utils.json diff --git a/salt/modules/pagerduty_util.py b/salt/modules/pagerduty_util.py index 8f782344925..bbcbcb42698 100644 --- a/salt/modules/pagerduty_util.py +++ b/salt/modules/pagerduty_util.py @@ -19,6 +19,7 @@ For PagerDuty API details, see https://developer.pagerduty.com/documentation/res """ import requests + import salt.utils.json diff --git a/salt/modules/purefb.py b/salt/modules/purefb.py index 0439c4b9615..787c77446b8 100644 --- a/salt/modules/purefb.py +++ b/salt/modules/purefb.py @@ -56,8 +56,15 @@ from datetime import datetime from salt.exceptions import CommandExecutionError try: - from purity_fb import PurityFb, FileSystem, FileSystemSnapshot, SnapshotSuffix - from purity_fb import rest, NfsRule, ProtocolRule + from purity_fb import ( + FileSystem, + FileSystemSnapshot, + NfsRule, + ProtocolRule, + PurityFb, + SnapshotSuffix, + rest, + ) HAS_PURITY_FB = True except ImportError: diff --git a/salt/modules/rdp.py b/salt/modules/rdp.py index 8d529cc0b4a..e0c4a5d21a5 100644 --- a/salt/modules/rdp.py +++ b/salt/modules/rdp.py @@ -9,8 +9,8 @@ import salt.utils.platform from salt.utils.decorators import depends try: - from pywintypes import error as PyWinError import win32ts + from pywintypes import error as PyWinError _HAS_WIN32TS_DEPENDENCIES = True except ImportError: diff --git a/salt/modules/rh_ip.py b/salt/modules/rh_ip.py index 46acecde984..4e647fdacb4 100644 --- a/salt/modules/rh_ip.py +++ b/salt/modules/rh_ip.py @@ -7,6 +7,7 @@ import os import jinja2 import jinja2.exceptions + import salt.utils.files import salt.utils.json import salt.utils.stringutils diff --git a/salt/modules/rh_service.py b/salt/modules/rh_service.py index ec0db7963dc..4a697101ef0 100644 --- a/salt/modules/rh_service.py +++ b/salt/modules/rh_service.py @@ -31,8 +31,8 @@ if salt.utils.path.which("initctl"): # Don't re-invent the wheel, import the helper functions from the # upstart module. from salt.modules.upstart_service import ( - _upstart_enable, _upstart_disable, + _upstart_enable, _upstart_is_enabled, ) except Exception as exc: # pylint: disable=broad-except diff --git a/salt/modules/rpmbuild_pkgbuild.py b/salt/modules/rpmbuild_pkgbuild.py index 41d9055c8eb..b45db65e7ff 100644 --- a/salt/modules/rpmbuild_pkgbuild.py +++ b/salt/modules/rpmbuild_pkgbuild.py @@ -31,6 +31,7 @@ HAS_LIBS = False try: import gnupg # pylint: disable=unused-import + import salt.modules.gpg HAS_LIBS = True diff --git a/salt/modules/schedule.py b/salt/modules/schedule.py index e9dfc223a2b..49d1fec2b2b 100644 --- a/salt/modules/schedule.py +++ b/salt/modules/schedule.py @@ -13,11 +13,12 @@ import datetime import logging import os +import yaml + import salt.utils.event import salt.utils.files import salt.utils.odict import salt.utils.yaml -import yaml try: import dateutil.parser as dateutil_parser diff --git a/salt/modules/scp_mod.py b/salt/modules/scp_mod.py index 8c63c01a950..4121bdbf4a7 100644 --- a/salt/modules/scp_mod.py +++ b/salt/modules/scp_mod.py @@ -12,8 +12,8 @@ import logging # Import salt modules try: - import scp import paramiko + import scp HAS_SCP = True except ImportError: diff --git a/salt/modules/smtp.py b/salt/modules/smtp.py index c66e3499e1d..8eaa6bb0a73 100644 --- a/salt/modules/smtp.py +++ b/salt/modules/smtp.py @@ -51,10 +51,10 @@ log = logging.getLogger(__name__) HAS_LIBS = False try: - import smtplib - import email.mime.text import email.mime.application import email.mime.multipart + import email.mime.text + import smtplib HAS_LIBS = True except ImportError: diff --git a/salt/modules/splunk.py b/salt/modules/splunk.py index 07ea8122eb1..848886f4435 100644 --- a/salt/modules/splunk.py +++ b/salt/modules/splunk.py @@ -28,8 +28,8 @@ import subprocess HAS_LIBS = False try: import splunklib.client - from splunklib.client import AuthenticationError from splunklib.binding import HTTPError + from splunklib.client import AuthenticationError HAS_LIBS = True except ImportError: diff --git a/salt/modules/splunk_search.py b/salt/modules/splunk_search.py index 58a64b2dc1d..560874cd23e 100644 --- a/salt/modules/splunk_search.py +++ b/salt/modules/splunk_search.py @@ -27,8 +27,8 @@ from salt.utils.odict import OrderedDict HAS_LIBS = False try: - import splunklib.client import requests + import splunklib.client HAS_LIBS = True except ImportError: diff --git a/salt/modules/suse_ip.py b/salt/modules/suse_ip.py index 5ba7410b0a1..9422c0d91b2 100644 --- a/salt/modules/suse_ip.py +++ b/salt/modules/suse_ip.py @@ -10,6 +10,7 @@ import os import jinja2 import jinja2.exceptions + import salt.utils.files import salt.utils.stringutils import salt.utils.templates diff --git a/salt/modules/twilio_notify.py b/salt/modules/twilio_notify.py index 5d28e7922fa..99437716976 100644 --- a/salt/modules/twilio_notify.py +++ b/salt/modules/twilio_notify.py @@ -33,8 +33,8 @@ try: from twilio.rest import TwilioException as TwilioRestException else: TWILIO_5 = True - from twilio.rest import TwilioRestClient from twilio import TwilioRestException # pylint: disable=no-name-in-module + from twilio.rest import TwilioRestClient HAS_LIBS = True except ImportError: pass diff --git a/salt/modules/virt.py b/salt/modules/virt.py index 6d083968427..586f0fde4a1 100644 --- a/salt/modules/virt.py +++ b/salt/modules/virt.py @@ -136,6 +136,7 @@ from xml.etree import ElementTree from xml.sax import saxutils import jinja2.exceptions + import salt.utils.data import salt.utils.files import salt.utils.json diff --git a/salt/modules/vsphere.py b/salt/modules/vsphere.py index 988780cae13..7baff359883 100644 --- a/salt/modules/vsphere.py +++ b/salt/modules/vsphere.py @@ -233,15 +233,9 @@ except ImportError: try: # pylint: disable=no-name-in-module - from pyVmomi import ( - vim, - vmodl, - pbm, - VmomiSupport, - ) + from pyVmomi import VmomiSupport, pbm, vim, vmodl # pylint: enable=no-name-in-module - # We check the supported vim versions to infer the pyVmomi version if ( "vim25/6.0" in VmomiSupport.versionMap @@ -260,10 +254,13 @@ except ImportError: # vSphere SDK Automation # pylint: disable=unused-import try: - from com.vmware.cis.tagging_client import Category, CategoryModel - from com.vmware.cis.tagging_client import Tag, TagModel, TagAssociation - from com.vmware.vcenter_client import Cluster - from com.vmware.vapi.std_client import DynamicID + from com.vmware.cis.tagging_client import ( + Category, + CategoryModel, + Tag, + TagAssociation, + TagModel, + ) # Error Handling from com.vmware.vapi.std.errors_client import ( @@ -273,6 +270,8 @@ try: Unauthenticated, Unauthorized, ) + from com.vmware.vapi.std_client import DynamicID + from com.vmware.vcenter_client import Cluster vsphere_errors = ( AlreadyExists, diff --git a/salt/modules/win_dacl.py b/salt/modules/win_dacl.py index 7bf9102ab33..a084a75684f 100644 --- a/salt/modules/win_dacl.py +++ b/salt/modules/win_dacl.py @@ -20,8 +20,9 @@ from salt.exceptions import CommandExecutionError try: import winreg - import win32security + import ntsecuritycon + import win32security HAS_WINDOWS_MODULES = True except ImportError: diff --git a/salt/modules/win_dns_client.py b/salt/modules/win_dns_client.py index 1ec0963bfee..89ba38fffb1 100644 --- a/salt/modules/win_dns_client.py +++ b/salt/modules/win_dns_client.py @@ -8,6 +8,7 @@ import salt.utils.platform try: import wmi + import salt.utils.winapi HAS_LIBS = True diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py index 0c3aa6a6acd..bbe118da942 100644 --- a/salt/modules/win_file.py +++ b/salt/modules/win_file.py @@ -99,6 +99,7 @@ try: import win32con import win32file import win32security + import salt.platform.win HAS_WINDOWS_MODULES = True diff --git a/salt/modules/win_groupadd.py b/salt/modules/win_groupadd.py index cc1eff097e9..0b10fa5c49f 100644 --- a/salt/modules/win_groupadd.py +++ b/salt/modules/win_groupadd.py @@ -15,9 +15,9 @@ import salt.utils.win_functions import salt.utils.winapi try: + import pywintypes import win32api import win32com.client - import pywintypes HAS_DEPENDENCIES = True except ImportError: diff --git a/salt/modules/win_iis.py b/salt/modules/win_iis.py index f555062681c..0c97aa84896 100644 --- a/salt/modules/win_iis.py +++ b/salt/modules/win_iis.py @@ -13,9 +13,10 @@ import logging import os import re +import yaml + import salt.utils.json import salt.utils.platform -import yaml from salt.exceptions import CommandExecutionError, SaltInvocationError log = logging.getLogger(__name__) diff --git a/salt/modules/win_smtp_server.py b/salt/modules/win_smtp_server.py index a795bbc1044..ab0e602fe79 100644 --- a/salt/modules/win_smtp_server.py +++ b/salt/modules/win_smtp_server.py @@ -27,6 +27,7 @@ from salt.exceptions import SaltInvocationError try: import wmi + import salt.utils.winapi _HAS_MODULE_DEPENDENCIES = True diff --git a/salt/modules/win_status.py b/salt/modules/win_status.py index 5fa06a39c8f..fad2323a43b 100644 --- a/salt/modules/win_status.py +++ b/salt/modules/win_status.py @@ -25,6 +25,7 @@ log = logging.getLogger(__name__) try: if salt.utils.platform.is_windows(): import wmi + import salt.utils.winapi HAS_WMI = True diff --git a/salt/modules/win_system.py b/salt/modules/win_system.py index 4632792061c..1cc9616a71d 100644 --- a/salt/modules/win_system.py +++ b/salt/modules/win_system.py @@ -24,12 +24,13 @@ import salt.utils.winapi from salt.exceptions import CommandExecutionError try: + from ctypes import windll + import pywintypes import win32api import win32con import win32net import wmi - from ctypes import windll HAS_WIN32NET_MODS = True except ImportError: diff --git a/salt/modules/win_useradd.py b/salt/modules/win_useradd.py index 0288eec7d6d..85fa3035849 100644 --- a/salt/modules/win_useradd.py +++ b/salt/modules/win_useradd.py @@ -42,7 +42,6 @@ log = logging.getLogger(__name__) try: import pywintypes - import wmi import win32api import win32con import win32net @@ -50,6 +49,7 @@ try: import win32profile import win32security import win32ts + import wmi HAS_WIN32NET_MODS = True except ImportError: diff --git a/salt/modules/zk_concurrency.py b/salt/modules/zk_concurrency.py index 7d7bef87434..4c05b5711cc 100644 --- a/salt/modules/zk_concurrency.py +++ b/salt/modules/zk_concurrency.py @@ -14,16 +14,15 @@ import logging import sys try: - import kazoo.client - - from kazoo.retry import ForceRetryError - import kazoo.recipe.lock - import kazoo.recipe.barrier - import kazoo.recipe.party - from kazoo.exceptions import CancelledError - from kazoo.exceptions import NoNodeError from socket import gethostname + import kazoo.client + import kazoo.recipe.barrier + import kazoo.recipe.lock + import kazoo.recipe.party + from kazoo.exceptions import CancelledError, NoNodeError + from kazoo.retry import ForceRetryError + # TODO: use the kazoo one, waiting for pull req: # https://github.com/python-zk/kazoo/pull/206 class _Semaphore(kazoo.recipe.lock.Semaphore): diff --git a/salt/netapi/rest_cherrypy/app.py b/salt/netapi/rest_cherrypy/app.py index e036f882ae1..7271bc7167c 100644 --- a/salt/netapi/rest_cherrypy/app.py +++ b/salt/netapi/rest_cherrypy/app.py @@ -597,6 +597,7 @@ from multiprocessing import Pipe, Process from urllib.parse import parse_qsl import cherrypy # pylint: disable=import-error,3rd-party-module-not-gated + import salt import salt.auth import salt.exceptions @@ -627,8 +628,8 @@ except ImportError: try: # Imports related to websocket - from .tools import websockets from . import event_processor + from .tools import websockets HAS_WEBSOCKETS = True except ImportError: diff --git a/salt/netapi/rest_cherrypy/wsgi.py b/salt/netapi/rest_cherrypy/wsgi.py index 00d428dad53..607dad54d82 100644 --- a/salt/netapi/rest_cherrypy/wsgi.py +++ b/salt/netapi/rest_cherrypy/wsgi.py @@ -55,8 +55,8 @@ def bootstrap_app(): """ Grab the opts dict of the master config by trying to import Salt """ - from salt.netapi.rest_cherrypy import app import salt.config + from salt.netapi.rest_cherrypy import app __opts__ = salt.config.client_config( os.environ.get("SALT_MASTER_CONFIG", "/etc/salt/master") diff --git a/salt/pillar/__init__.py b/salt/pillar/__init__.py index 7be963566ad..470b4f97af8 100644 --- a/salt/pillar/__init__.py +++ b/salt/pillar/__init__.py @@ -1140,8 +1140,8 @@ class Pillar: # the git ext_pillar() func is run, but only for masterless. if self.ext and "git" in self.ext and self.opts.get("__role") != "minion": # Avoid circular import - import salt.utils.gitfs import salt.pillar.git_pillar + import salt.utils.gitfs git_pillar = salt.utils.gitfs.GitPillar( self.opts, diff --git a/salt/pillar/ec2_pillar.py b/salt/pillar/ec2_pillar.py index 1dfe47b6105..f6fa734a6f8 100644 --- a/salt/pillar/ec2_pillar.py +++ b/salt/pillar/ec2_pillar.py @@ -61,8 +61,8 @@ from salt.utils.versions import StrictVersion as _StrictVersion try: import boto.ec2 - import boto.utils import boto.exception + import boto.utils HAS_BOTO = True except ImportError: diff --git a/salt/pillar/makostack.py b/salt/pillar/makostack.py index 933fb27b73d..b689bd5f4cd 100644 --- a/salt/pillar/makostack.py +++ b/salt/pillar/makostack.py @@ -380,8 +380,8 @@ import os import salt.utils.yaml try: - from mako.lookup import TemplateLookup from mako import exceptions + from mako.lookup import TemplateLookup HAS_MAKO = True except ImportError: diff --git a/salt/pillar/mysql.py b/salt/pillar/mysql.py index 7d910682fa1..6f854f10357 100644 --- a/salt/pillar/mysql.py +++ b/salt/pillar/mysql.py @@ -56,8 +56,8 @@ log = logging.getLogger(__name__) try: # Trying to import MySQLdb import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors except ImportError: try: # MySQLdb import failed, try to import PyMySQL @@ -65,8 +65,8 @@ except ImportError: pymysql.install_as_MySQLdb() import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors except ImportError: MySQLdb = None diff --git a/salt/pillar/pepa.py b/salt/pillar/pepa.py index 2adc381dd39..a35ebb47a09 100644 --- a/salt/pillar/pepa.py +++ b/salt/pillar/pepa.py @@ -270,6 +270,7 @@ import re import sys import jinja2 + import salt.utils.files import salt.utils.yaml @@ -597,9 +598,10 @@ if __name__ == "__main__": __opts__["pepa_validate"] = True if args.query_api: - import requests import getpass + import requests + username = args.username password = args.password if username is None: @@ -660,8 +662,8 @@ if __name__ == "__main__": try: # pylint: disable=import-error import pygments - import pygments.lexers import pygments.formatters + import pygments.lexers # pylint: disable=no-member print( diff --git a/salt/pillar/pillar_ldap.py b/salt/pillar/pillar_ldap.py index 5152bdc2086..9649194ad08 100644 --- a/salt/pillar/pillar_ldap.py +++ b/salt/pillar/pillar_ldap.py @@ -125,6 +125,7 @@ import logging import os import jinja2 + import salt.utils.data from salt.exceptions import SaltInvocationError diff --git a/salt/pillar/stack.py b/salt/pillar/stack.py index 6be8e33d695..57935021e65 100644 --- a/salt/pillar/stack.py +++ b/salt/pillar/stack.py @@ -378,10 +378,11 @@ import logging import os import posixpath +from jinja2 import Environment, FileSystemLoader + import salt.utils.data import salt.utils.jinja import salt.utils.yaml -from jinja2 import Environment, FileSystemLoader log = logging.getLogger(__name__) strategies = ("overwrite", "merge-first", "merge-last", "remove") diff --git a/salt/pillar/vmware_pillar.py b/salt/pillar/vmware_pillar.py index 8919cc17e1f..cb93efed0da 100644 --- a/salt/pillar/vmware_pillar.py +++ b/salt/pillar/vmware_pillar.py @@ -149,8 +149,8 @@ import salt.utils.vmware try: # pylint: disable=no-name-in-module - from pyVmomi import vim from pyVim.connect import Disconnect + from pyVmomi import vim HAS_LIBS = True # pylint: enable=no-name-in-module diff --git a/salt/proxy/netmiko_px.py b/salt/proxy/netmiko_px.py index 206d01789d8..b9afe596e76 100644 --- a/salt/proxy/netmiko_px.py +++ b/salt/proxy/netmiko_px.py @@ -190,8 +190,10 @@ import salt.utils.args try: from netmiko import ConnectHandler - from netmiko.ssh_exception import NetMikoTimeoutException - from netmiko.ssh_exception import NetMikoAuthenticationException + from netmiko.ssh_exception import ( + NetMikoAuthenticationException, + NetMikoTimeoutException, + ) HAS_NETMIKO = True except ImportError: diff --git a/salt/renderers/aws_kms.py b/salt/renderers/aws_kms.py index c0b43523aaa..f591627d68c 100644 --- a/salt/renderers/aws_kms.py +++ b/salt/renderers/aws_kms.py @@ -69,8 +69,8 @@ import salt.utils.stringio from salt.exceptions import SaltConfigurationError try: - import botocore.exceptions import boto3 + import botocore.exceptions logging.getLogger("boto3").setLevel(logging.CRITICAL) except ImportError: diff --git a/salt/renderers/genshi.py b/salt/renderers/genshi.py index 4f09d98928b..206cce5a3fe 100644 --- a/salt/renderers/genshi.py +++ b/salt/renderers/genshi.py @@ -4,9 +4,7 @@ Genshi Renderer for Salt try: - from genshi.template import MarkupTemplate - from genshi.template import NewTextTemplate - from genshi.template import OldTextTemplate + from genshi.template import MarkupTemplate, NewTextTemplate, OldTextTemplate HAS_LIBS = True except ImportError: diff --git a/salt/renderers/yaml.py b/salt/renderers/yaml.py index 958ab6e6bf1..2481dce21bc 100644 --- a/salt/renderers/yaml.py +++ b/salt/renderers/yaml.py @@ -8,14 +8,15 @@ For YAML usage information see :ref:`Understanding YAML `. import logging import warnings +from yaml.constructor import ConstructorError +from yaml.parser import ParserError +from yaml.scanner import ScannerError + import salt.utils.url import salt.utils.yamlloader as yamlloader_new import salt.utils.yamlloader_old as yamlloader_old from salt.exceptions import SaltRenderError from salt.utils.odict import OrderedDict -from yaml.constructor import ConstructorError -from yaml.parser import ParserError -from yaml.scanner import ScannerError log = logging.getLogger(__name__) diff --git a/salt/returners/cassandra_cql_return.py b/salt/returners/cassandra_cql_return.py index 7635abb1a9c..a6563ab90b0 100644 --- a/salt/returners/cassandra_cql_return.py +++ b/salt/returners/cassandra_cql_return.py @@ -144,10 +144,9 @@ try: # installed, both the modules/cassandra_cql execution module and this returner module # will not be loaded by Salt's loader system. # pylint: disable=unused-import,no-name-in-module - from cassandra.cluster import Cluster - from cassandra.cluster import NoHostAvailable - from cassandra.connection import ConnectionException, ConnectionShutdown from cassandra.auth import PlainTextAuthProvider + from cassandra.cluster import Cluster, NoHostAvailable + from cassandra.connection import ConnectionException, ConnectionShutdown from cassandra.query import dict_factory # pylint: enable=unused-import,no-name-in-module diff --git a/salt/returners/influxdb_return.py b/salt/returners/influxdb_return.py index c332685644e..645218242aa 100644 --- a/salt/returners/influxdb_return.py +++ b/salt/returners/influxdb_return.py @@ -53,6 +53,7 @@ To override individual configuration items, append --return_kwargs '{"key:": "va import logging import requests + import salt.returners import salt.utils.jid from salt.utils.decorators import memoize diff --git a/salt/returners/mysql.py b/salt/returners/mysql.py index 6fd4fdef2c6..848a08ad072 100644 --- a/salt/returners/mysql.py +++ b/salt/returners/mysql.py @@ -154,8 +154,8 @@ import salt.utils.json try: # Trying to import MySQLdb import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors from MySQLdb.connections import OperationalError except ImportError: try: @@ -164,8 +164,8 @@ except ImportError: pymysql.install_as_MySQLdb() import MySQLdb - import MySQLdb.cursors import MySQLdb.converters + import MySQLdb.cursors from MySQLdb.err import OperationalError except ImportError: MySQLdb = None diff --git a/salt/returners/sms_return.py b/salt/returners/sms_return.py index 883a6a7eae4..798477d7bea 100644 --- a/salt/returners/sms_return.py +++ b/salt/returners/sms_return.py @@ -44,8 +44,8 @@ try: from twilio.rest import TwilioException as TwilioRestException else: TWILIO_5 = True - from twilio.rest import TwilioRestClient from twilio import TwilioRestException # pylint: disable=no-name-in-module + from twilio.rest import TwilioRestClient HAS_TWILIO = True except ImportError: diff --git a/salt/returners/splunk.py b/salt/returners/splunk.py index 9abf5490daa..df3414bcacf 100644 --- a/salt/returners/splunk.py +++ b/salt/returners/splunk.py @@ -23,6 +23,7 @@ import socket import time import requests + import salt.utils.json _max_content_bytes = 100000 diff --git a/salt/runners/asam.py b/salt/runners/asam.py index 0d68910eba6..81e547b784b 100644 --- a/salt/runners/asam.py +++ b/salt/runners/asam.py @@ -34,9 +34,10 @@ import logging HAS_LIBS = False try: - import requests import html.parser + import requests + HAS_LIBS = True # pylint: disable=abstract-method diff --git a/salt/runners/bgp.py b/salt/runners/bgp.py index 4e23f576308..4603de029af 100644 --- a/salt/runners/bgp.py +++ b/salt/runners/bgp.py @@ -100,11 +100,9 @@ Configuration import salt.output try: - from netaddr import IPNetwork - from netaddr import IPAddress - # pylint: disable=unused-import,no-name-in-module from napalm.base import helpers as napalm_helpers + from netaddr import IPAddress, IPNetwork # pylint: enable=unused-import,no-name-in-module diff --git a/salt/runners/ddns.py b/salt/runners/ddns.py index 96fef7fad65..9e4d5c64971 100644 --- a/salt/runners/ddns.py +++ b/salt/runners/ddns.py @@ -19,8 +19,8 @@ import salt.utils.json HAS_LIBS = False try: import dns.query - import dns.update # pylint: disable=no-name-in-module import dns.tsigkeyring # pylint: disable=no-name-in-module + import dns.update # pylint: disable=no-name-in-module HAS_LIBS = True except ImportError: diff --git a/salt/runners/net.py b/salt/runners/net.py index d8dbd679f19..a7865219b62 100644 --- a/salt/runners/net.py +++ b/salt/runners/net.py @@ -72,11 +72,10 @@ import salt.output import salt.utils.network try: - from netaddr import IPNetwork # netaddr is already required by napalm - from netaddr.core import AddrFormatError - # pylint: disable=no-name-in-module from napalm.base import helpers as napalm_helpers + from netaddr import IPNetwork # netaddr is already required by napalm + from netaddr.core import AddrFormatError # pylint: enable=no-name-in-module diff --git a/salt/runners/vault.py b/salt/runners/vault.py index fe0fbc17fec..78c40472601 100644 --- a/salt/runners/vault.py +++ b/salt/runners/vault.py @@ -14,6 +14,7 @@ import string import time import requests + import salt.crypt import salt.exceptions diff --git a/salt/scripts.py b/salt/scripts.py index 7f6d80de59b..04e17472e84 100644 --- a/salt/scripts.py +++ b/salt/scripts.py @@ -100,8 +100,8 @@ def minion_process(): salt._logging.in_mainprocess.__pid__ = os.getpid() # Now the remaining required imports - import salt.utils.platform import salt.cli.daemons + import salt.utils.platform # salt_minion spawns this function in a new process @@ -169,9 +169,10 @@ def salt_minion(): salt.utils.process.notify_systemd() - import salt.cli.daemons import multiprocessing + import salt.cli.daemons + # Fix for setuptools generated scripts, so that it will # work with multiprocessing fork emulation. # (see multiprocessing.forking.get_preparation_data()) @@ -328,9 +329,10 @@ def salt_proxy(): """ Start a proxy minion. """ + import multiprocessing + import salt.cli.daemons import salt.utils.platform - import multiprocessing if "" in sys.path: sys.path.remove("") diff --git a/salt/serializers/yaml.py b/salt/serializers/yaml.py index ee84174c63b..e8a5e85e4b5 100644 --- a/salt/serializers/yaml.py +++ b/salt/serializers/yaml.py @@ -13,11 +13,12 @@ import datetime import logging import yaml -from salt.serializers import DeserializationError, SerializationError -from salt.utils.odict import OrderedDict from yaml.constructor import ConstructorError from yaml.scanner import ScannerError +from salt.serializers import DeserializationError, SerializationError +from salt.utils.odict import OrderedDict + __all__ = ["deserialize", "serialize", "available"] log = logging.getLogger(__name__) diff --git a/salt/serializers/yamlex.py b/salt/serializers/yamlex.py index 3fbf26ee0a5..d67ff7a60b2 100644 --- a/salt/serializers/yamlex.py +++ b/salt/serializers/yamlex.py @@ -107,13 +107,14 @@ import datetime import logging import yaml -from salt.serializers import DeserializationError, SerializationError -from salt.utils.aggregation import Map, Sequence, aggregate -from salt.utils.odict import OrderedDict from yaml.constructor import ConstructorError from yaml.nodes import MappingNode from yaml.scanner import ScannerError +from salt.serializers import DeserializationError, SerializationError +from salt.utils.aggregation import Map, Sequence, aggregate +from salt.utils.odict import OrderedDict + __all__ = ["deserialize", "serialize", "available"] log = logging.getLogger(__name__) diff --git a/salt/spm/__init__.py b/salt/spm/__init__.py index c4e00ac4ac5..d945baee271 100644 --- a/salt/spm/__init__.py +++ b/salt/spm/__init__.py @@ -25,8 +25,8 @@ import salt.utils.yaml from salt.template import compile_template try: - import pwd import grp + import pwd except ImportError: pass diff --git a/salt/states/grafana4_org.py b/salt/states/grafana4_org.py index 247bc88b00c..8d4aa5e1da9 100644 --- a/salt/states/grafana4_org.py +++ b/salt/states/grafana4_org.py @@ -42,8 +42,9 @@ Manage Grafana v4.0 orgs - country: "" """ -import salt.utils.dictupdate as dictupdate from requests.exceptions import HTTPError + +import salt.utils.dictupdate as dictupdate from salt.utils.dictdiffer import deep_diff diff --git a/salt/states/grafana_dashboard.py b/salt/states/grafana_dashboard.py index f11aec911c7..a23d0f084e3 100644 --- a/salt/states/grafana_dashboard.py +++ b/salt/states/grafana_dashboard.py @@ -41,6 +41,7 @@ allowing users to manage their own custom rows. import copy import requests + import salt.utils.json from salt.utils.dictdiffer import DictDiffer diff --git a/salt/states/netacl.py b/salt/states/netacl.py index ecc9fff07c5..1c3364ee057 100644 --- a/salt/states/netacl.py +++ b/salt/states/netacl.py @@ -43,8 +43,8 @@ try: # pylint: disable=W0611 import capirca import capirca.aclgen - import capirca.lib.policy import capirca.lib.aclgenerator + import capirca.lib.policy HAS_CAPIRCA = True # pylint: enable=W0611 diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py index f4115969347..9e06a63d2a3 100644 --- a/salt/states/pip_state.py +++ b/salt/states/pip_state.py @@ -103,9 +103,9 @@ if HAS_PIP is True: purge_pip.__pip_ver__ = pip.__version__ if salt.utils.versions.compare(ver1=pip.__version__, oper=">=", ver2="10.0"): - from pip._internal.exceptions import ( + from pip._internal.exceptions import ( # pylint: disable=E0611,E0401 InstallationError, - ) # pylint: disable=E0611,E0401 + ) elif salt.utils.versions.compare(ver1=pip.__version__, oper=">=", ver2="1.0"): from pip.exceptions import InstallationError # pylint: disable=E0611,E0401 else: diff --git a/salt/states/pkg.py b/salt/states/pkg.py index 5bce922356d..7e06f032165 100644 --- a/salt/states/pkg.py +++ b/salt/states/pkg.py @@ -84,15 +84,17 @@ from salt.utils.odict import OrderedDict as _OrderedDict _repack_pkgs = namespaced_function(_repack_pkgs, globals()) if salt.utils.platform.is_windows(): - from salt.modules.win_pkg import _get_package_info - from salt.modules.win_pkg import get_repo_data - from salt.modules.win_pkg import _get_repo_details - from salt.modules.win_pkg import _refresh_db_conditional - from salt.modules.win_pkg import refresh_db - from salt.modules.win_pkg import genrepo - from salt.modules.win_pkg import _repo_process_pkg_sls - from salt.modules.win_pkg import _get_latest_pkg_version - from salt.modules.win_pkg import _reverse_cmp_pkg_versions + from salt.modules.win_pkg import ( + _get_latest_pkg_version, + _get_package_info, + _get_repo_details, + _refresh_db_conditional, + _repo_process_pkg_sls, + _reverse_cmp_pkg_versions, + genrepo, + get_repo_data, + refresh_db, + ) _get_package_info = namespaced_function(_get_package_info, globals()) get_repo_data = namespaced_function(get_repo_data, globals()) diff --git a/salt/states/restconf.py b/salt/states/restconf.py index 4e5de2339e8..4ac74e27bd4 100644 --- a/salt/states/restconf.py +++ b/salt/states/restconf.py @@ -16,9 +16,10 @@ import difflib import json import logging -import salt.utils.odict import yaml +import salt.utils.odict + log = logging.getLogger(__file__) diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index e8a708f5a3d..d8a0e66781e 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -9,6 +9,7 @@ Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" import errno import logging +import multiprocessing import os import queue import socket @@ -42,8 +43,6 @@ else: USE_LOAD_BALANCER = False if USE_LOAD_BALANCER: - import multiprocessing - import salt.ext.tornado.util from salt.utils.process import SignalHandlingProcess diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index 830add6efe4..d3d38d60ebf 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -10,6 +10,9 @@ import sys import threading from random import randint +import zmq.error +import zmq.eventloop.zmqstream + import salt.ext.tornado import salt.ext.tornado.concurrent import salt.ext.tornado.gen @@ -20,8 +23,6 @@ import salt.utils.files import salt.utils.process import salt.utils.stringutils import salt.utils.zeromq -import zmq.error -import zmq.eventloop.zmqstream from salt._compat import ipaddress from salt.exceptions import SaltException, SaltReqTimeoutError from salt.utils.zeromq import LIBZMQ_VERSION_INFO, ZMQ_VERSION_INFO, zmq diff --git a/salt/utils/azurearm.py b/salt/utils/azurearm.py index f1bcb3cd383..276cbb66b36 100644 --- a/salt/utils/azurearm.py +++ b/salt/utils/azurearm.py @@ -35,8 +35,8 @@ from salt.exceptions import SaltInvocationError, SaltSystemExit try: from azure.common.credentials import ( - UserPassCredentials, ServicePrincipalCredentials, + UserPassCredentials, ) from msrestazure.azure_cloud import ( MetadataEndpointError, diff --git a/salt/utils/boto3mod.py b/salt/utils/boto3mod.py index f0c2d61c955..274f98ee367 100644 --- a/salt/utils/boto3mod.py +++ b/salt/utils/boto3mod.py @@ -40,8 +40,8 @@ try: # pylint: disable=import-error import boto import boto3 - import boto.exception import boto3.session + import boto.exception import botocore # pylint: disable=W0611 # pylint: enable=import-error diff --git a/salt/utils/cloud.py b/salt/utils/cloud.py index 56a3ab30294..63a5dfe895c 100644 --- a/salt/utils/cloud.py +++ b/salt/utils/cloud.py @@ -21,6 +21,8 @@ import time import traceback import uuid +from jinja2 import Template + import salt.client import salt.cloud import salt.config @@ -39,7 +41,6 @@ import salt.utils.stringutils import salt.utils.versions import salt.utils.vt import salt.utils.yaml -from jinja2 import Template from salt.exceptions import ( SaltCloudConfigError, SaltCloudException, @@ -60,10 +61,10 @@ except ImportError: try: from pypsexec.client import Client as PsExecClient - from pypsexec.scmr import Service as ScmrService from pypsexec.exceptions import SCMRException - from smbprotocol.tree import TreeConnect + from pypsexec.scmr import Service as ScmrService from smbprotocol.exceptions import SMBResponseException + from smbprotocol.tree import TreeConnect logging.getLogger("smbprotocol").setLevel(logging.WARNING) logging.getLogger("pypsexec").setLevel(logging.WARNING) @@ -77,11 +78,10 @@ WINRM_MIN_VER = "0.3.0" try: - import winrm - from winrm.exceptions import WinRMTransportError - # Verify WinRM 0.3.0 or greater import pkg_resources # pylint: disable=3rd-party-module-not-gated + import winrm + from winrm.exceptions import WinRMTransportError winrm_pkg = pkg_resources.get_distribution("pywinrm") if not salt.utils.versions.compare(winrm_pkg.version, ">=", WINRM_MIN_VER): diff --git a/salt/utils/etcd_util.py b/salt/utils/etcd_util.py index 8d3f55da773..512b4a6583d 100644 --- a/salt/utils/etcd_util.py +++ b/salt/utils/etcd_util.py @@ -84,7 +84,7 @@ from salt.exceptions import SaltException try: import etcd - from urllib3.exceptions import ReadTimeoutError, MaxRetryError + from urllib3.exceptions import MaxRetryError, ReadTimeoutError HAS_ETCD_V2 = True except ImportError: diff --git a/salt/utils/extend.py b/salt/utils/extend.py index 9e85ea42f86..72903af23fc 100644 --- a/salt/utils/extend.py +++ b/salt/utils/extend.py @@ -20,9 +20,10 @@ import sys import tempfile from datetime import date +from jinja2 import Template + import salt.utils.files import salt.version -from jinja2 import Template from salt.serializers.yaml import deserialize from salt.utils.odict import OrderedDict diff --git a/salt/utils/jinja.py b/salt/utils/jinja.py index dfcb9e915ad..9dab2db4d96 100644 --- a/salt/utils/jinja.py +++ b/salt/utils/jinja.py @@ -18,6 +18,11 @@ from xml.dom import minidom from xml.etree.ElementTree import Element, SubElement, tostring import jinja2 +from jinja2 import BaseLoader, TemplateNotFound, nodes +from jinja2.environment import TemplateModule +from jinja2.exceptions import TemplateRuntimeError +from jinja2.ext import Extension + import salt.fileclient import salt.utils.data import salt.utils.files @@ -25,10 +30,6 @@ import salt.utils.json import salt.utils.stringutils import salt.utils.url import salt.utils.yaml -from jinja2 import BaseLoader, TemplateNotFound, nodes -from jinja2.environment import TemplateModule -from jinja2.exceptions import TemplateRuntimeError -from jinja2.ext import Extension from salt.exceptions import TemplateError from salt.utils.decorators.jinja import jinja_filter, jinja_global, jinja_test from salt.utils.odict import OrderedDict diff --git a/salt/utils/mako.py b/salt/utils/mako.py index c45b8a3932d..69618de9837 100644 --- a/salt/utils/mako.py +++ b/salt/utils/mako.py @@ -14,8 +14,8 @@ except ImportError: if HAS_MAKO: import os - import urllib.parse + import salt.fileclient import salt.utils.url diff --git a/salt/utils/nacl.py b/salt/utils/nacl.py index a37279449ea..d86292a2c41 100644 --- a/salt/utils/nacl.py +++ b/salt/utils/nacl.py @@ -19,8 +19,8 @@ log = logging.getLogger(__name__) REQ_ERROR = None try: - import libnacl.secret import libnacl.sealed + import libnacl.secret except (ImportError, OSError) as e: REQ_ERROR = ( "libnacl import error, perhaps missing python libnacl package or should update." diff --git a/salt/utils/nb_popen.py b/salt/utils/nb_popen.py index 44a7a8c41b7..12cdc39e1b0 100644 --- a/salt/utils/nb_popen.py +++ b/salt/utils/nb_popen.py @@ -25,10 +25,11 @@ import time mswindows = sys.platform == "win32" try: + import msvcrt + import pywintypes from win32file import ReadFile, WriteFile from win32pipe import PeekNamedPipe - import msvcrt except ImportError: import fcntl diff --git a/salt/utils/openstack/neutron.py b/salt/utils/openstack/neutron.py index b92fa135e80..63e2b56beab 100644 --- a/salt/utils/openstack/neutron.py +++ b/salt/utils/openstack/neutron.py @@ -11,8 +11,8 @@ from salt import exceptions # pylint: disable=import-error HAS_NEUTRON = False try: - from neutronclient.v2_0 import client from neutronclient.shell import NeutronShell + from neutronclient.v2_0 import client HAS_NEUTRON = True except ImportError: diff --git a/salt/utils/openstack/nova.py b/salt/utils/openstack/nova.py index 1200ae40aeb..d35f7fc7eb4 100644 --- a/salt/utils/openstack/nova.py +++ b/salt/utils/openstack/nova.py @@ -16,13 +16,13 @@ HAS_NOVA = False # pylint: disable=import-error try: import novaclient - from novaclient import client - from novaclient.shell import OpenStackComputeShell - import novaclient.utils import novaclient.auth_plugin + import novaclient.base import novaclient.exceptions import novaclient.extension - import novaclient.base + import novaclient.utils + from novaclient import client + from novaclient.shell import OpenStackComputeShell HAS_NOVA = True except ImportError: diff --git a/salt/utils/openstack/pyrax/__init__.py b/salt/utils/openstack/pyrax/__init__.py index 44d8267f4e9..4ad822d5084 100644 --- a/salt/utils/openstack/pyrax/__init__.py +++ b/salt/utils/openstack/pyrax/__init__.py @@ -1,6 +1,7 @@ # pylint: disable=import-error try: import pyrax + from salt.utils.openstack.pyrax.authenticate import Authenticate from salt.utils.openstack.pyrax.queues import RackspaceQueues diff --git a/salt/utils/pkg/win.py b/salt/utils/pkg/win.py index 57c4103abd1..954dda1fb79 100644 --- a/salt/utils/pkg/win.py +++ b/salt/utils/pkg/win.py @@ -43,11 +43,11 @@ from functools import cmp_to_key __version__ = "0.1" try: + import pywintypes import win32api import win32con import win32process import win32security - import pywintypes import winerror except ImportError: @@ -1474,9 +1474,10 @@ def __main(): version_only = True if str(sys.argv[2]) == "system+user": user_pkgs = True - import salt.utils.json import timeit + import salt.utils.json + def run(): """ Main run code, when this module is run directly diff --git a/salt/utils/platform.py b/salt/utils/platform.py index b9bfe03f6b4..6b66da62920 100644 --- a/salt/utils/platform.py +++ b/salt/utils/platform.py @@ -9,6 +9,7 @@ import subprocess import sys from distro import linux_distribution + from salt.utils.decorators import memoize as real_memoize diff --git a/salt/utils/psutil_compat.py b/salt/utils/psutil_compat.py index b68c50db455..e6684e5ca46 100644 --- a/salt/utils/psutil_compat.py +++ b/salt/utils/psutil_compat.py @@ -28,11 +28,9 @@ else: # Import functions not in __all__ # pylint: disable=unused-import,3rd-party-module-not-gated - from psutil import disk_partitions - from psutil import disk_usage + 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 diff --git a/salt/utils/saltclass.py b/salt/utils/saltclass.py index cb4ad2164e0..bbd33068b06 100644 --- a/salt/utils/saltclass.py +++ b/salt/utils/saltclass.py @@ -3,9 +3,10 @@ import logging import os import re +from jinja2 import Environment, FileSystemLoader + import salt.utils.path import salt.utils.yaml -from jinja2 import Environment, FileSystemLoader log = logging.getLogger(__name__) diff --git a/salt/utils/smb.py b/salt/utils/smb.py index c6206e251fa..d3468078a48 100644 --- a/salt/utils/smb.py +++ b/salt/utils/smb.py @@ -19,24 +19,22 @@ log = logging.getLogger(__name__) try: from smbprotocol.connection import Connection - from smbprotocol.session import Session - from smbprotocol.tree import TreeConnect - from smbprotocol.open import ( - Open, - ImpersonationLevel, - FilePipePrinterAccessMask, - FileAttributes, - CreateDisposition, - CreateOptions, - ShareAccess, - DirectoryAccessMask, - FileInformationClass, - ) from smbprotocol.create_contexts import ( CreateContextName, SMB2CreateContextRequest, SMB2CreateQueryMaximalAccessRequest, ) + from smbprotocol.open import ( + CreateDisposition, + CreateOptions, + DirectoryAccessMask, + FileAttributes, + FileInformationClass, + FilePipePrinterAccessMask, + ImpersonationLevel, + Open, + ShareAccess, + ) from smbprotocol.security_descriptor import ( AccessAllowedAce, AccessMask, @@ -45,6 +43,8 @@ try: SIDPacket, SMB2CreateSDBuffer, ) + from smbprotocol.session import Session + from smbprotocol.tree import TreeConnect logging.getLogger("smbprotocol").setLevel(logging.WARNING) HAS_SMBPROTOCOL = True diff --git a/salt/utils/templates.py b/salt/utils/templates.py index d4f3f9cc273..1f613d46534 100644 --- a/salt/utils/templates.py +++ b/salt/utils/templates.py @@ -12,6 +12,7 @@ from pathlib import Path import jinja2 import jinja2.ext import jinja2.sandbox + import salt.utils.data import salt.utils.dateutils import salt.utils.files @@ -538,6 +539,7 @@ def render_mako_tmpl(tmplstr, context, tmplpath=None): """ import mako.exceptions # pylint: disable=no-name-in-module from mako.template import Template # pylint: disable=no-name-in-module + from salt.utils.mako import SaltMakoTemplateLookup saltenv = context["saltenv"] diff --git a/salt/utils/thin.py b/salt/utils/thin.py index 94ef3406000..b7d79f51ff6 100644 --- a/salt/utils/thin.py +++ b/salt/utils/thin.py @@ -18,6 +18,8 @@ import zipfile import distro import jinja2 import msgpack +import yaml + import salt import salt.exceptions import salt.ext.tornado as tornado @@ -27,7 +29,6 @@ import salt.utils.json import salt.utils.path import salt.utils.stringutils import salt.version -import yaml # This is needed until we drop support for python 3.6 has_immutables = False diff --git a/salt/utils/vault.py b/salt/utils/vault.py index f71817a8c48..7aaabd8f249 100644 --- a/salt/utils/vault.py +++ b/salt/utils/vault.py @@ -14,6 +14,7 @@ import tempfile import time import requests + import salt.crypt import salt.exceptions import salt.utils.json diff --git a/salt/utils/verify.py b/salt/utils/verify.py index 5459962b632..879128f2312 100644 --- a/salt/utils/verify.py +++ b/salt/utils/verify.py @@ -24,6 +24,7 @@ from salt.exceptions import CommandExecutionError, SaltClientError, SaltSystemEx try: import win32file + import salt.utils.win_reg except ImportError: import resource @@ -573,13 +574,12 @@ def win_verify_env(path, dirs, permissive=False, pki_dir="", skip_extra=False): Verify that the named directories are in place and that the environment can shake the salt """ - import salt.utils.win_functions - import salt.utils.win_dacl import salt.utils.path + import salt.utils.win_dacl + import salt.utils.win_functions # Make sure the file_roots is not set to something unsafe since permissions # on that directory are reset - # `salt.utils.path.safe_path` will consider anything inside `C:\Windows` to # be unsafe. In some instances the test suite uses # `C:\Windows\Temp\salt-tests-tmpdir\rootdir` as the file_roots. So, we need diff --git a/salt/utils/vmware.py b/salt/utils/vmware.py index 10e80b0824f..92a3be8e3cf 100644 --- a/salt/utils/vmware.py +++ b/salt/utils/vmware.py @@ -87,8 +87,8 @@ import salt.utils.stringutils # pylint: disable=no-name-in-module try: - from pyVim.connect import GetSi, SmartConnect, Disconnect, GetStub, SoapStubAdapter - from pyVmomi import vim, vmodl, VmomiSupport + from pyVim.connect import Disconnect, GetSi, GetStub, SmartConnect, SoapStubAdapter + from pyVmomi import VmomiSupport, vim, vmodl HAS_PYVMOMI = True except ImportError: @@ -104,9 +104,10 @@ except ImportError: HAS_VSPHERE_SDK = False # pylint: enable=no-name-in-module try: - import gssapi import base64 + import gssapi + HAS_GSSAPI = True except ImportError: HAS_GSSAPI = False diff --git a/salt/utils/vt.py b/salt/utils/vt.py index f19504dc2a0..d1a64252b2a 100644 --- a/salt/utils/vt.py +++ b/salt/utils/vt.py @@ -38,17 +38,18 @@ mswindows = sys.platform == "win32" try: # pylint: disable=F0401,W0611 - from win32file import ReadFile, WriteFile - from win32pipe import PeekNamedPipe import msvcrt + import win32api import win32con import win32process + from win32file import ReadFile, WriteFile + from win32pipe import PeekNamedPipe # pylint: enable=F0401,W0611 except ImportError: - import pty import fcntl + import pty import struct import termios diff --git a/salt/utils/win_dacl.py b/salt/utils/win_dacl.py index 5dc2eec4bb0..ec16f7a22c6 100644 --- a/salt/utils/win_dacl.py +++ b/salt/utils/win_dacl.py @@ -146,10 +146,10 @@ from salt.exceptions import CommandExecutionError, SaltInvocationError HAS_WIN32 = False try: - import win32security - import win32con - import win32api import pywintypes + import win32api + import win32con + import win32security HAS_WIN32 = True except ImportError: diff --git a/salt/utils/win_functions.py b/salt/utils/win_functions.py index 685ba9e8544..97e3e0878a2 100644 --- a/salt/utils/win_functions.py +++ b/salt/utils/win_functions.py @@ -15,7 +15,7 @@ try: import win32api import win32net import win32security - from win32con import HWND_BROADCAST, WM_SETTINGCHANGE, SMTO_ABORTIFHUNG + from win32con import HWND_BROADCAST, SMTO_ABORTIFHUNG, WM_SETTINGCHANGE HAS_WIN32 = True except ImportError: diff --git a/salt/utils/win_network.py b/salt/utils/win_network.py index 8a417d0edbc..ecbdf3f047d 100644 --- a/salt/utils/win_network.py +++ b/salt/utils/win_network.py @@ -33,6 +33,7 @@ if IS_WINDOWS: USE_WMI = StrictVersion(platform.version()) < StrictVersion("6.2") if USE_WMI: import wmi + import salt.utils.winapi else: import clr diff --git a/salt/utils/win_osinfo.py b/salt/utils/win_osinfo.py index 71fdc5f85ee..56f1e12d50f 100644 --- a/salt/utils/win_osinfo.py +++ b/salt/utils/win_osinfo.py @@ -7,7 +7,8 @@ import ctypes HAS_WIN32 = True try: - from ctypes.wintypes import BYTE, WORD, DWORD, WCHAR + from ctypes.wintypes import BYTE, DWORD, WCHAR, WORD + import win32net import win32netcon except (ImportError, ValueError): diff --git a/salt/utils/win_reg.py b/salt/utils/win_reg.py index f93da309e86..de1f2f9e24e 100644 --- a/salt/utils/win_reg.py +++ b/salt/utils/win_reg.py @@ -35,9 +35,9 @@ import salt.utils.stringutils from salt.exceptions import CommandExecutionError try: - import win32gui import win32api import win32con + import win32gui HAS_WINDOWS_MODULES = True except ImportError: diff --git a/salt/utils/win_runas.py b/salt/utils/win_runas.py index 617c38c7a0e..0b695aaad26 100644 --- a/salt/utils/win_runas.py +++ b/salt/utils/win_runas.py @@ -18,16 +18,18 @@ except ImportError: HAS_PSUTIL = False try: + import msvcrt + + import pywintypes import win32api import win32con - import win32process - import win32security - import win32pipe import win32event + import win32pipe + import win32process import win32profile - import msvcrt + import win32security + import salt.platform.win - import pywintypes HAS_WIN32 = True except ImportError: diff --git a/salt/utils/win_update.py b/salt/utils/win_update.py index c54ffd3915a..778acd141fa 100644 --- a/salt/utils/win_update.py +++ b/salt/utils/win_update.py @@ -10,8 +10,8 @@ import salt.utils.winapi from salt.exceptions import CommandExecutionError try: - import win32com.client import pywintypes + import win32com.client HAS_PYWIN32 = True except ImportError: diff --git a/salt/utils/yaml.py b/salt/utils/yaml.py index 260bb121af8..f590d493261 100644 --- a/salt/utils/yaml.py +++ b/salt/utils/yaml.py @@ -3,8 +3,9 @@ Convenience module that provides our custom loader and dumper in a single module """ # pylint: disable=wildcard-import,unused-wildcard-import,unused-import -from salt.utils.yamldumper import * -from salt.utils.yamlloader import * from yaml import YAMLError, parser, scanner +from salt.utils.yamldumper import * +from salt.utils.yamlloader import * + # pylint: enable=wildcard-import,unused-wildcard-import,unused-import diff --git a/salt/utils/yamldumper.py b/salt/utils/yamldumper.py index 4a2ddfe44af..e5e937cac7d 100644 --- a/salt/utils/yamldumper.py +++ b/salt/utils/yamldumper.py @@ -9,16 +9,16 @@ import collections -import salt.utils.context import yaml # pylint: disable=blacklisted-import + +import salt.utils.context from salt.utils.odict import OrderedDict try: from yaml import CDumper as Dumper from yaml import CSafeDumper as SafeDumper except ImportError: - from yaml import Dumper - from yaml import SafeDumper + from yaml import Dumper, SafeDumper __all__ = [ diff --git a/salt/utils/yamlencoding.py b/salt/utils/yamlencoding.py index cfe84a6ab16..7e26b9afcb5 100644 --- a/salt/utils/yamlencoding.py +++ b/salt/utils/yamlencoding.py @@ -7,6 +7,7 @@ import io import sys import yaml # pylint: disable=blacklisted-import + from salt.utils.decorators.jinja import jinja_filter diff --git a/salt/utils/yamllint.py b/salt/utils/yamllint.py index 6db47fa6300..82464b44658 100644 --- a/salt/utils/yamllint.py +++ b/salt/utils/yamllint.py @@ -1,10 +1,11 @@ import logging -import salt.utils.stringutils import yamllint from yamllint import linter from yamllint.config import YamlLintConfig +import salt.utils.stringutils + log = logging.getLogger(__name__) diff --git a/salt/utils/yamlloader.py b/salt/utils/yamlloader.py index 9b5544d31ab..25b4b3bb936 100644 --- a/salt/utils/yamlloader.py +++ b/salt/utils/yamlloader.py @@ -3,11 +3,12 @@ Custom YAML loading in Salt """ -import salt.utils.stringutils import yaml # pylint: disable=blacklisted-import from yaml.constructor import ConstructorError from yaml.nodes import MappingNode, SequenceNode +import salt.utils.stringutils + # prefer C bindings over python when available BaseLoader = getattr(yaml, "CSafeLoader", yaml.SafeLoader) diff --git a/salt/utils/yamlloader_old.py b/salt/utils/yamlloader_old.py index 68f2cfd3d54..d24717a79b2 100644 --- a/salt/utils/yamlloader_old.py +++ b/salt/utils/yamlloader_old.py @@ -5,11 +5,12 @@ Custom YAML loading in Salt import re -import salt.utils.stringutils import yaml # pylint: disable=blacklisted-import from yaml.constructor import ConstructorError from yaml.nodes import MappingNode, SequenceNode +import salt.utils.stringutils + try: yaml.Loader = yaml.CLoader yaml.Dumper = yaml.CDumper diff --git a/tasks/docs.py b/tasks/docs.py index 457069d23f7..323d14a0a1f 100644 --- a/tasks/docs.py +++ b/tasks/docs.py @@ -12,6 +12,7 @@ import pathlib import re from invoke import task # pylint: disable=3rd-party-module-not-gated + from tasks import utils CODE_DIR = pathlib.Path(__file__).resolve().parent.parent diff --git a/tasks/docstrings.py b/tasks/docstrings.py index f50e3250e67..b8078c6dfe2 100644 --- a/tasks/docstrings.py +++ b/tasks/docstrings.py @@ -10,6 +10,7 @@ import pathlib import re from invoke import task # pylint: disable=3rd-party-module-not-gated + from salt.loader import SALT_INTERNAL_LOADERS_PATHS from salt.version import SaltStackVersion from tasks import utils diff --git a/tasks/filemap.py b/tasks/filemap.py index 79f76ba4314..a1eb62c6b82 100644 --- a/tasks/filemap.py +++ b/tasks/filemap.py @@ -9,6 +9,7 @@ import re import yaml from invoke import task # pylint: disable=3rd-party-module-not-gated + from tasks import utils CODE_DIR = pathlib.Path(__file__).resolve().parent.parent diff --git a/tasks/loader.py b/tasks/loader.py index 58b4cf61731..d65e5e28591 100644 --- a/tasks/loader.py +++ b/tasks/loader.py @@ -9,6 +9,7 @@ import ast import pathlib from invoke import task # pylint: disable=3rd-party-module-not-gated + from salt.loader import SALT_INTERNAL_LOADERS_PATHS from tasks import utils diff --git a/tests/conftest.py b/tests/conftest.py index 24ecf57e04f..6b9cc80254b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -26,6 +26,7 @@ import _pytest.logging import _pytest.skipping import psutil import pytest + import salt._logging import salt._logging.mixins import salt.config diff --git a/tests/integration/cli/test_custom_module.py b/tests/integration/cli/test_custom_module.py index 787ac118598..c9dc95b9883 100644 --- a/tests/integration/cli/test_custom_module.py +++ b/tests/integration/cli/test_custom_module.py @@ -30,6 +30,7 @@ """ import pytest + from tests.support.case import SSHCase diff --git a/tests/integration/client/test_kwarg.py b/tests/integration/client/test_kwarg.py index e482d127a74..2a3db24946c 100644 --- a/tests/integration/client/test_kwarg.py +++ b/tests/integration/client/test_kwarg.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/client/test_standard.py b/tests/integration/client/test_standard.py index 3efb3cc5244..2a4e0285608 100644 --- a/tests/integration/client/test_standard.py +++ b/tests/integration/client/test_standard.py @@ -1,6 +1,7 @@ import os import pytest + import salt.utils.files import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/client/test_syndic.py b/tests/integration/client/test_syndic.py index d5709b79cc0..9fa64015644 100644 --- a/tests/integration/client/test_syndic.py +++ b/tests/integration/client/test_syndic.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import SyndicCase from tests.support.unit import skipIf diff --git a/tests/integration/cloud/clouds/test_ec2.py b/tests/integration/cloud/clouds/test_ec2.py index 6cbc65a673f..4e71b8e4fd6 100644 --- a/tests/integration/cloud/clouds/test_ec2.py +++ b/tests/integration/cloud/clouds/test_ec2.py @@ -5,10 +5,11 @@ import os +import yaml + import salt.utils.cloud import salt.utils.files import salt.utils.yaml -import yaml from tests.integration.cloud.helpers.cloud_test_base import CloudTest from tests.support import win_installer from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/cloud/clouds/test_openstack.py b/tests/integration/cloud/clouds/test_openstack.py index 117f4d01242..1f7f1b8ee65 100644 --- a/tests/integration/cloud/clouds/test_openstack.py +++ b/tests/integration/cloud/clouds/test_openstack.py @@ -5,6 +5,7 @@ Tests for the Openstack Cloud Provider import logging import pytest + from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, CloudTest from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin @@ -14,8 +15,10 @@ log = logging.getLogger(__name__) try: import keystoneclient # pylint: disable=import-error,unused-import - from libcloud.common.openstack_identity import OpenStackIdentity_3_0_Connection - from libcloud.common.openstack_identity import OpenStackIdentityTokenScope + from libcloud.common.openstack_identity import ( + OpenStackIdentity_3_0_Connection, + OpenStackIdentityTokenScope, + ) HAS_KEYSTONE = True except ImportError: diff --git a/tests/integration/cloud/clouds/test_tencentcloud.py b/tests/integration/cloud/clouds/test_tencentcloud.py index 37a94001bed..ce995c44ff1 100644 --- a/tests/integration/cloud/clouds/test_tencentcloud.py +++ b/tests/integration/cloud/clouds/test_tencentcloud.py @@ -5,8 +5,9 @@ import os import pytest -from salt.config import cloud_providers_config from saltfactories.utils import random_string + +from salt.config import cloud_providers_config from tests.support.case import ShellCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/cloud/helpers/cloud_test_base.py b/tests/integration/cloud/helpers/cloud_test_base.py index be7d8c16c03..48e44a6f0fa 100644 --- a/tests/integration/cloud/helpers/cloud_test_base.py +++ b/tests/integration/cloud/helpers/cloud_test_base.py @@ -9,10 +9,11 @@ import shutil from time import sleep import pytest +from saltfactories.utils import random_string + import salt.utils.files from salt.config import cloud_config, cloud_providers_config from salt.utils.yaml import safe_load -from saltfactories.utils import random_string from tests.support.case import ShellCase from tests.support.paths import FILES from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/cloud/test_cloud.py b/tests/integration/cloud/test_cloud.py index eec86630cf2..29bd820da7b 100644 --- a/tests/integration/cloud/test_cloud.py +++ b/tests/integration/cloud/test_cloud.py @@ -2,6 +2,7 @@ Integration tests for functions located in the salt.cloud.__init__.py file. """ import pytest + import salt.cloud from tests.integration.cloud.helpers.cloud_test_base import CloudTest from tests.support.helpers import PRE_PYTEST_SKIP diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index e8cac97bc65..1e1baf6134a 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -8,6 +8,7 @@ import logging import pathlib import pytest + from tests.support.runtests import RUNTIME_VARS log = logging.getLogger(__name__) diff --git a/tests/integration/daemons/test_masterapi.py b/tests/integration/daemons/test_masterapi.py index be511d191bb..f41ae99ec89 100644 --- a/tests/integration/daemons/test_masterapi.py +++ b/tests/integration/daemons/test_masterapi.py @@ -3,6 +3,7 @@ import shutil import stat import pytest + import salt.utils.files import salt.utils.stringutils from tests.support.case import ShellCase diff --git a/tests/integration/externalapi/test_venafiapi.py b/tests/integration/externalapi/test_venafiapi.py index 6bbbac60f2f..ad08605430f 100644 --- a/tests/integration/externalapi/test_venafiapi.py +++ b/tests/integration/externalapi/test_venafiapi.py @@ -12,6 +12,7 @@ from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from cryptography.x509.oid import NameOID + from tests.support.case import ShellCase diff --git a/tests/integration/grains/test_core.py b/tests/integration/grains/test_core.py index 5f1cf11e243..46a27c4d9ee 100644 --- a/tests/integration/grains/test_core.py +++ b/tests/integration/grains/test_core.py @@ -4,6 +4,7 @@ Test the core grains import pytest + import salt.loader import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/grains/test_custom.py b/tests/integration/grains/test_custom.py index da9d4e2aea4..17a09a4797e 100644 --- a/tests/integration/grains/test_custom.py +++ b/tests/integration/grains/test_custom.py @@ -4,6 +4,7 @@ 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 bb20a83c126..78af1a920fe 100644 --- a/tests/integration/loader/test_ext_grains.py +++ b/tests/integration/loader/test_ext_grains.py @@ -10,6 +10,7 @@ import os import time import pytest + import salt.config import salt.loader from tests.support.case import ModuleCase diff --git a/tests/integration/loader/test_ext_modules.py b/tests/integration/loader/test_ext_modules.py index d964f0cb36d..bc57f6b5d7e 100644 --- a/tests/integration/loader/test_ext_modules.py +++ b/tests/integration/loader/test_ext_modules.py @@ -13,6 +13,7 @@ import os import time import pytest + from tests.support.case import ModuleCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/master/test_event_return.py b/tests/integration/master/test_event_return.py index 9449401d863..82ed3a202ba 100644 --- a/tests/integration/master/test_event_return.py +++ b/tests/integration/master/test_event_return.py @@ -16,6 +16,7 @@ import time from pytestshellutils.utils import ports from pytestshellutils.utils.processes import terminate_process + from salt.utils.nb_popen import NonBlockingPopen from tests.support.cli_scripts import ScriptPathMixin from tests.support.mixins import AdaptedConfigurationTestCaseMixin diff --git a/tests/integration/minion/test_executor.py b/tests/integration/minion/test_executor.py index 9348ac5d8ac..894c7580f57 100644 --- a/tests/integration/minion/test_executor.py +++ b/tests/integration/minion/test_executor.py @@ -1,6 +1,7 @@ import logging import pytest + from tests.support.case import ModuleCase, ShellCase log = logging.getLogger(__name__) diff --git a/tests/integration/minion/test_timeout.py b/tests/integration/minion/test_timeout.py index 06fbb1c2983..8ceb66c4a5d 100644 --- a/tests/integration/minion/test_timeout.py +++ b/tests/integration/minion/test_timeout.py @@ -7,6 +7,7 @@ import os import sys import pytest + import salt.utils.platform from tests.support.case import ShellCase diff --git a/tests/integration/modules/test_chocolatey.py b/tests/integration/modules/test_chocolatey.py index 5243ab648c4..97672ed3332 100644 --- a/tests/integration/modules/test_chocolatey.py +++ b/tests/integration/modules/test_chocolatey.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.path import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_cmdmod.py b/tests/integration/modules/test_cmdmod.py index 283ee55658c..5a8b20f393a 100644 --- a/tests/integration/modules/test_cmdmod.py +++ b/tests/integration/modules/test_cmdmod.py @@ -5,6 +5,7 @@ import tempfile from contextlib import contextmanager import pytest + import salt.utils.path import salt.utils.platform import salt.utils.user diff --git a/tests/integration/modules/test_config.py b/tests/integration/modules/test_config.py index c4f9fb80496..865e2753c73 100644 --- a/tests/integration/modules/test_config.py +++ b/tests/integration/modules/test_config.py @@ -3,6 +3,7 @@ Validate the config system """ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_cp.py b/tests/integration/modules/test_cp.py index 9bb44de6b5d..c0ddcad3fed 100644 --- a/tests/integration/modules/test_cp.py +++ b/tests/integration/modules/test_cp.py @@ -10,12 +10,13 @@ import uuid import psutil # pylint: disable=3rd-party-module-not-gated import pytest +from pytestshellutils.utils import ports +from saltfactories.utils.tempfiles import temp_file + import salt.utils.files import salt.utils.path import salt.utils.platform import salt.utils.stringutils -from pytestshellutils.utils import ports -from saltfactories.utils.tempfiles import temp_file from tests.support.case import ModuleCase from tests.support.helpers import with_tempfile from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/modules/test_decorators.py b/tests/integration/modules/test_decorators.py index cdfdcd35493..a3f83cd87c9 100644 --- a/tests/integration/modules/test_decorators.py +++ b/tests/integration/modules/test_decorators.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_disk.py b/tests/integration/modules/test_disk.py index 0b2c8f937f2..43d6eaa9b4e 100644 --- a/tests/integration/modules/test_disk.py +++ b/tests/integration/modules/test_disk.py @@ -2,6 +2,7 @@ import os import shutil import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_dockermod.py b/tests/integration/modules/test_dockermod.py index 10815f53d4a..bf3c0644d2e 100644 --- a/tests/integration/modules/test_dockermod.py +++ b/tests/integration/modules/test_dockermod.py @@ -7,8 +7,9 @@ import string import sys import pytest -import salt.utils.path from saltfactories.utils.tempfiles import temp_file + +import salt.utils.path from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/modules/test_file.py b/tests/integration/modules/test_file.py index ff6cab465c6..5174137cb30 100644 --- a/tests/integration/modules/test_file.py +++ b/tests/integration/modules/test_file.py @@ -4,6 +4,7 @@ import shutil import sys import pytest + import salt.utils.files import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_gem.py b/tests/integration/modules/test_gem.py index d7c5de3a60c..3aae137a15b 100644 --- a/tests/integration/modules/test_gem.py +++ b/tests/integration/modules/test_gem.py @@ -3,6 +3,7 @@ Integration tests for Ruby Gem module """ import pytest + import salt.utils.path from salt.ext.tornado.httpclient import HTTPClient from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_gentoolkitmod.py b/tests/integration/modules/test_gentoolkitmod.py index a32615cf0ed..82e09c5ad13 100644 --- a/tests/integration/modules/test_gentoolkitmod.py +++ b/tests/integration/modules/test_gentoolkitmod.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_git.py b/tests/integration/modules/test_git.py index e4addc1643d..b3438a0c027 100644 --- a/tests/integration/modules/test_git.py +++ b/tests/integration/modules/test_git.py @@ -17,6 +17,7 @@ import tempfile from contextlib import closing import pytest + import salt.utils.data import salt.utils.files import salt.utils.platform diff --git a/tests/integration/modules/test_groupadd.py b/tests/integration/modules/test_groupadd.py index 595c8b56bf3..8cf368e1555 100644 --- a/tests/integration/modules/test_groupadd.py +++ b/tests/integration/modules/test_groupadd.py @@ -1,8 +1,9 @@ import pytest +from saltfactories.utils import random_string + import salt.utils.files import salt.utils.platform import salt.utils.stringutils -from saltfactories.utils import random_string from tests.support.case import ModuleCase from tests.support.helpers import runs_on from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_hosts.py b/tests/integration/modules/test_hosts.py index 0ce1338dd48..d13ed5b1452 100644 --- a/tests/integration/modules/test_hosts.py +++ b/tests/integration/modules/test_hosts.py @@ -7,6 +7,7 @@ import os import shutil import pytest + import salt.utils.files import salt.utils.stringutils from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_key.py b/tests/integration/modules/test_key.py index 44b2293cca1..6f1ba6dfc74 100644 --- a/tests/integration/modules/test_key.py +++ b/tests/integration/modules/test_key.py @@ -1,6 +1,7 @@ import re import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_linux_acl.py b/tests/integration/modules/test_linux_acl.py index 6406e82e1c5..c5b45802061 100644 --- a/tests/integration/modules/test_linux_acl.py +++ b/tests/integration/modules/test_linux_acl.py @@ -2,6 +2,7 @@ import os import shutil import pytest + import salt.utils.files import salt.utils.user from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_linux_shadow.py b/tests/integration/modules/test_linux_shadow.py index ff151abe296..73a18a8dc81 100644 --- a/tests/integration/modules/test_linux_shadow.py +++ b/tests/integration/modules/test_linux_shadow.py @@ -5,10 +5,11 @@ integration tests for shadow linux import os import pytest +from saltfactories.utils import random_string + import salt.modules.linux_shadow import salt.utils.files import salt.utils.platform -from saltfactories.utils import random_string from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_localemod.py b/tests/integration/modules/test_localemod.py index 3791fdbf3f8..4e49f611172 100644 --- a/tests/integration/modules/test_localemod.py +++ b/tests/integration/modules/test_localemod.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_lxc.py b/tests/integration/modules/test_lxc.py index 549c0a541c3..fc1dea3d2c7 100644 --- a/tests/integration/modules/test_lxc.py +++ b/tests/integration/modules/test_lxc.py @@ -3,6 +3,7 @@ Test the lxc module """ import pytest + from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_mac_assistive.py b/tests/integration/modules/test_mac_assistive.py index b4ed8e07c6f..2be832ffd43 100644 --- a/tests/integration/modules/test_mac_assistive.py +++ b/tests/integration/modules/test_mac_assistive.py @@ -3,6 +3,7 @@ """ import pytest + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_brew_pkg.py b/tests/integration/modules/test_mac_brew_pkg.py index 82c11593dc0..5c33bf6cfb9 100644 --- a/tests/integration/modules/test_mac_brew_pkg.py +++ b/tests/integration/modules/test_mac_brew_pkg.py @@ -3,6 +3,7 @@ """ import pytest + from salt.exceptions import CommandExecutionError from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_desktop.py b/tests/integration/modules/test_mac_desktop.py index 064b532facd..9353a8b12bb 100644 --- a/tests/integration/modules/test_mac_desktop.py +++ b/tests/integration/modules/test_mac_desktop.py @@ -3,6 +3,7 @@ Integration tests for the mac_desktop execution module. """ import pytest + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_group.py b/tests/integration/modules/test_mac_group.py index 45224df2c4a..e4ee3ba7dc6 100644 --- a/tests/integration/modules/test_mac_group.py +++ b/tests/integration/modules/test_mac_group.py @@ -3,8 +3,9 @@ """ import pytest -from salt.exceptions import CommandExecutionError from saltfactories.utils import random_string + +from salt.exceptions import CommandExecutionError from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_keychain.py b/tests/integration/modules/test_mac_keychain.py index ac6f91e9557..755d0085afb 100644 --- a/tests/integration/modules/test_mac_keychain.py +++ b/tests/integration/modules/test_mac_keychain.py @@ -5,6 +5,7 @@ Validate the mac-keychain module import os import pytest + from salt.exceptions import CommandExecutionError from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_portspkg.py b/tests/integration/modules/test_mac_portspkg.py index bb485f9fc60..366c6b6ecd3 100644 --- a/tests/integration/modules/test_mac_portspkg.py +++ b/tests/integration/modules/test_mac_portspkg.py @@ -3,6 +3,7 @@ integration tests for mac_ports """ import pytest + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_power.py b/tests/integration/modules/test_mac_power.py index a50044263db..cf63d0ae97d 100644 --- a/tests/integration/modules/test_mac_power.py +++ b/tests/integration/modules/test_mac_power.py @@ -3,6 +3,7 @@ integration tests for mac_power """ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_mac_service.py b/tests/integration/modules/test_mac_service.py index c1601be8614..d35f7891dda 100644 --- a/tests/integration/modules/test_mac_service.py +++ b/tests/integration/modules/test_mac_service.py @@ -5,6 +5,7 @@ integration tests for mac_service import plistlib import pytest + import salt.utils.files from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_shadow.py b/tests/integration/modules/test_mac_shadow.py index 9997e41f006..355f9083f05 100644 --- a/tests/integration/modules/test_mac_shadow.py +++ b/tests/integration/modules/test_mac_shadow.py @@ -6,6 +6,7 @@ import datetime import pytest from saltfactories.utils import random_string + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_softwareupdate.py b/tests/integration/modules/test_mac_softwareupdate.py index cb719d489b7..4fa7bdfc5e7 100644 --- a/tests/integration/modules/test_mac_softwareupdate.py +++ b/tests/integration/modules/test_mac_softwareupdate.py @@ -3,6 +3,7 @@ integration tests for mac_softwareupdate """ import pytest + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_sysctl.py b/tests/integration/modules/test_mac_sysctl.py index 05c87fd7e87..53158047f50 100644 --- a/tests/integration/modules/test_mac_sysctl.py +++ b/tests/integration/modules/test_mac_sysctl.py @@ -6,6 +6,7 @@ import os import random import pytest + import salt.utils.files from salt.exceptions import CommandExecutionError from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_mac_system.py b/tests/integration/modules/test_mac_system.py index a6c1e54a27b..ad81da3c54b 100644 --- a/tests/integration/modules/test_mac_system.py +++ b/tests/integration/modules/test_mac_system.py @@ -6,6 +6,7 @@ import logging import pytest from saltfactories.utils import random_string + from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_mac_timezone.py b/tests/integration/modules/test_mac_timezone.py index f9f5ec6b411..a52750a97a4 100644 --- a/tests/integration/modules/test_mac_timezone.py +++ b/tests/integration/modules/test_mac_timezone.py @@ -12,6 +12,7 @@ Time sync do the following: import datetime import pytest + from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_mac_user.py b/tests/integration/modules/test_mac_user.py index ca6c5d7043d..da322514d67 100644 --- a/tests/integration/modules/test_mac_user.py +++ b/tests/integration/modules/test_mac_user.py @@ -5,9 +5,10 @@ import os import pytest +from saltfactories.utils import random_string + import salt.utils.files from salt.exceptions import CommandExecutionError -from saltfactories.utils import random_string from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mac_xattr.py b/tests/integration/modules/test_mac_xattr.py index 3027de6e01d..1c0899069b0 100644 --- a/tests/integration/modules/test_mac_xattr.py +++ b/tests/integration/modules/test_mac_xattr.py @@ -5,6 +5,7 @@ integration tests for mac_xattr import os import pytest + from tests.support.case import ModuleCase from tests.support.helpers import runs_on from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/modules/test_macdefaults.py b/tests/integration/modules/test_macdefaults.py index e7cd4df67c9..efc8000423f 100644 --- a/tests/integration/modules/test_macdefaults.py +++ b/tests/integration/modules/test_macdefaults.py @@ -2,6 +2,7 @@ Validate the mac-defaults module """ import pytest + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_mine.py b/tests/integration/modules/test_mine.py index 63801fc3137..c5e4bef5cc4 100644 --- a/tests/integration/modules/test_mine.py +++ b/tests/integration/modules/test_mine.py @@ -6,6 +6,7 @@ import pprint import time import pytest + import salt.utils.platform from tests.support.case import ModuleCase, ShellCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/modules/test_mysql.py b/tests/integration/modules/test_mysql.py index 181cf192d9d..320733e86cc 100644 --- a/tests/integration/modules/test_mysql.py +++ b/tests/integration/modules/test_mysql.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.utils.path from salt.modules import mysql as mysqlmod from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_nilrt_ip.py b/tests/integration/modules/test_nilrt_ip.py index 9d0d04b385c..f29cd31edec 100644 --- a/tests/integration/modules/test_nilrt_ip.py +++ b/tests/integration/modules/test_nilrt_ip.py @@ -8,6 +8,7 @@ import shutil import time import pytest + import salt.modules.nilrt_ip as ip import salt.utils.files import salt.utils.platform diff --git a/tests/integration/modules/test_pip.py b/tests/integration/modules/test_pip.py index e277d2c9cd4..9ca14c56a7a 100644 --- a/tests/integration/modules/test_pip.py +++ b/tests/integration/modules/test_pip.py @@ -12,6 +12,7 @@ import sys import tempfile import pytest + import salt.utils.files import salt.utils.path import salt.utils.platform diff --git a/tests/integration/modules/test_publish.py b/tests/integration/modules/test_publish.py index 04b34647414..fb1306e14a5 100644 --- a/tests/integration/modules/test_publish.py +++ b/tests/integration/modules/test_publish.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/modules/test_pw_user.py b/tests/integration/modules/test_pw_user.py index 4460c492400..5b993c8d328 100644 --- a/tests/integration/modules/test_pw_user.py +++ b/tests/integration/modules/test_pw_user.py @@ -5,6 +5,7 @@ tests.integration.modules.pw_user import pytest from saltfactories.utils import random_string + from tests.support.case import ModuleCase from tests.support.helpers import runs_on diff --git a/tests/integration/modules/test_rabbitmq.py b/tests/integration/modules/test_rabbitmq.py index f3c999caf3c..131549eec0d 100644 --- a/tests/integration/modules/test_rabbitmq.py +++ b/tests/integration/modules/test_rabbitmq.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_saltcheck.py b/tests/integration/modules/test_saltcheck.py index 926a2ede492..394d80bb8ab 100644 --- a/tests/integration/modules/test_saltcheck.py +++ b/tests/integration/modules/test_saltcheck.py @@ -3,6 +3,7 @@ Test the saltcheck module """ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_service.py b/tests/integration/modules/test_service.py index 8e4732544a0..7c070c6e2af 100644 --- a/tests/integration/modules/test_service.py +++ b/tests/integration/modules/test_service.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.path import salt.utils.platform import salt.utils.systemd diff --git a/tests/integration/modules/test_ssh.py b/tests/integration/modules/test_ssh.py index ee3b4a132c5..14135226976 100644 --- a/tests/integration/modules/test_ssh.py +++ b/tests/integration/modules/test_ssh.py @@ -6,6 +6,7 @@ import os import shutil import pytest + import salt.utils.files import salt.utils.platform from salt.ext.tornado.httpclient import HTTPClient diff --git a/tests/integration/modules/test_status.py b/tests/integration/modules/test_status.py index 6c9401b4f01..b11f1d9e767 100644 --- a/tests/integration/modules/test_status.py +++ b/tests/integration/modules/test_status.py @@ -1,6 +1,7 @@ import random import pytest + import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_swarm.py b/tests/integration/modules/test_swarm.py index d9665b0acaf..207f80731c0 100644 --- a/tests/integration/modules/test_swarm.py +++ b/tests/integration/modules/test_swarm.py @@ -3,6 +3,7 @@ Integration tests for the docker swarm modules """ import pytest + import salt.utils.path from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/modules/test_sysrc.py b/tests/integration/modules/test_sysrc.py index 6361ce39919..5be8ed243cd 100644 --- a/tests/integration/modules/test_sysrc.py +++ b/tests/integration/modules/test_sysrc.py @@ -1,6 +1,7 @@ import sys import pytest + from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_system.py b/tests/integration/modules/test_system.py index 2b6cbb8cffb..7eabb4670cd 100644 --- a/tests/integration/modules/test_system.py +++ b/tests/integration/modules/test_system.py @@ -7,6 +7,7 @@ import textwrap import time import pytest + import salt.states.file import salt.utils.files import salt.utils.path diff --git a/tests/integration/modules/test_test.py b/tests/integration/modules/test_test.py index 2c2501b2d9b..f9849e3a48c 100644 --- a/tests/integration/modules/test_test.py +++ b/tests/integration/modules/test_test.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.config import salt.version from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_timezone.py b/tests/integration/modules/test_timezone.py index 6e96a8585d5..3fd5f8163bb 100644 --- a/tests/integration/modules/test_timezone.py +++ b/tests/integration/modules/test_timezone.py @@ -6,6 +6,7 @@ Linux and Solaris are supported import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_vault.py b/tests/integration/modules/test_vault.py index 34125a81ca3..424a399ef98 100644 --- a/tests/integration/modules/test_vault.py +++ b/tests/integration/modules/test_vault.py @@ -6,6 +6,7 @@ import logging import time import pytest + import salt.utils.path from tests.support.case import ModuleCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/modules/test_virtualenv_mod.py b/tests/integration/modules/test_virtualenv_mod.py index 5f988904ad0..3142f659ce7 100644 --- a/tests/integration/modules/test_virtualenv_mod.py +++ b/tests/integration/modules/test_virtualenv_mod.py @@ -2,6 +2,7 @@ import os import tempfile import pytest + import salt.utils.path from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_win_autoruns.py b/tests/integration/modules/test_win_autoruns.py index c14ffbcf14a..e949b4b1f3b 100644 --- a/tests/integration/modules/test_win_autoruns.py +++ b/tests/integration/modules/test_win_autoruns.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_win_dns_client.py b/tests/integration/modules/test_win_dns_client.py index 06d1495ff80..ca3ca6132f6 100644 --- a/tests/integration/modules/test_win_dns_client.py +++ b/tests/integration/modules/test_win_dns_client.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_win_firewall.py b/tests/integration/modules/test_win_firewall.py index 0f2ce436f8e..3955a350611 100644 --- a/tests/integration/modules/test_win_firewall.py +++ b/tests/integration/modules/test_win_firewall.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_win_lgpo.py b/tests/integration/modules/test_win_lgpo.py index a04e557e761..9359976f45c 100644 --- a/tests/integration/modules/test_win_lgpo.py +++ b/tests/integration/modules/test_win_lgpo.py @@ -3,10 +3,11 @@ import os import re import pytest +from saltfactories.utils import random_string + import salt.utils.files import salt.utils.platform import salt.utils.win_reg as reg -from saltfactories.utils import random_string from tests.support.case import ModuleCase from tests.support.runtests import RUNTIME_VARS from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_win_ntp.py b/tests/integration/modules/test_win_ntp.py index 259320f506e..1e4053edb8e 100644 --- a/tests/integration/modules/test_win_ntp.py +++ b/tests/integration/modules/test_win_ntp.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_win_pkg.py b/tests/integration/modules/test_win_pkg.py index 4e0ca756851..7901ce7d302 100644 --- a/tests/integration/modules/test_win_pkg.py +++ b/tests/integration/modules/test_win_pkg.py @@ -2,6 +2,7 @@ import os import textwrap import pytest + import salt.utils.files import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/modules/test_win_servermanager.py b/tests/integration/modules/test_win_servermanager.py index 34272a4f0b0..1a79e83c515 100644 --- a/tests/integration/modules/test_win_servermanager.py +++ b/tests/integration/modules/test_win_servermanager.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.unit import skipIf diff --git a/tests/integration/modules/test_win_task.py b/tests/integration/modules/test_win_task.py index c3a95f5e4de..fe52bc77c54 100644 --- a/tests/integration/modules/test_win_task.py +++ b/tests/integration/modules/test_win_task.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.win_task as task import salt.utils.platform from salt.exceptions import CommandExecutionError diff --git a/tests/integration/netapi/rest_tornado/test_app.py b/tests/integration/netapi/rest_tornado/test_app.py index c03977959fe..a6b168a6863 100644 --- a/tests/integration/netapi/rest_tornado/test_app.py +++ b/tests/integration/netapi/rest_tornado/test_app.py @@ -3,6 +3,7 @@ import threading import time import pytest + import salt.auth import salt.ext.tornado.escape import salt.ext.tornado.web diff --git a/tests/integration/output/test_output.py b/tests/integration/output/test_output.py index aa34ebf635c..615d2c41b82 100644 --- a/tests/integration/output/test_output.py +++ b/tests/integration/output/test_output.py @@ -6,10 +6,11 @@ import os import traceback import pytest +from saltfactories.utils.tempfiles import temp_file + import salt.config import salt.utils.yaml from salt.output import display_output -from saltfactories.utils.tempfiles import temp_file from tests.support.case import ShellCase from tests.support.mixins import RUNTIME_VARS diff --git a/tests/integration/pillar/test_git_pillar.py b/tests/integration/pillar/test_git_pillar.py index af828d9ddf9..7deff13c5fa 100644 --- a/tests/integration/pillar/test_git_pillar.py +++ b/tests/integration/pillar/test_git_pillar.py @@ -68,9 +68,10 @@ import string import sys import pytest +from distro import linux_distribution + import salt.utils.path import salt.utils.platform -from distro import linux_distribution from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES as VIRTUALENV_NAMES from salt.utils.gitfs import ( GITPYTHON_MINVER, diff --git a/tests/integration/renderers/test_jinja.py b/tests/integration/renderers/test_jinja.py index 3d23d209841..f0fcd28ff9d 100644 --- a/tests/integration/renderers/test_jinja.py +++ b/tests/integration/renderers/test_jinja.py @@ -1,6 +1,7 @@ import os import pytest + import salt.utils.files from tests.support.case import ModuleCase, ShellCase from tests.support.helpers import with_tempdir diff --git a/tests/integration/renderers/test_pydsl.py b/tests/integration/renderers/test_pydsl.py index 48a5de91964..6b85c81186f 100644 --- a/tests/integration/renderers/test_pydsl.py +++ b/tests/integration/renderers/test_pydsl.py @@ -3,6 +3,7 @@ import shutil import textwrap import pytest + import salt.utils.files import salt.utils.platform import salt.utils.stringutils diff --git a/tests/integration/returners/test_librato_return.py b/tests/integration/returners/test_librato_return.py index ecabc00dc82..4f1ad2141a2 100644 --- a/tests/integration/returners/test_librato_return.py +++ b/tests/integration/returners/test_librato_return.py @@ -5,6 +5,7 @@ Tests for the librato returner import logging import pytest + from salt.returners import librato_return from tests.support.case import ShellCase diff --git a/tests/integration/runners/test_fileserver.py b/tests/integration/runners/test_fileserver.py index d8dfbdbe6a5..ae8ab766aae 100644 --- a/tests/integration/runners/test_fileserver.py +++ b/tests/integration/runners/test_fileserver.py @@ -6,6 +6,7 @@ import contextlib import pathlib import pytest + from tests.support.case import ShellCase from tests.support.helpers import PRE_PYTEST_SKIP_REASON from tests.support.mock import MagicMock, create_autospec, patch diff --git a/tests/integration/runners/test_jobs.py b/tests/integration/runners/test_jobs.py index d551473549c..82a367c45d0 100644 --- a/tests/integration/runners/test_jobs.py +++ b/tests/integration/runners/test_jobs.py @@ -3,6 +3,7 @@ Tests for the salt-run command """ import pytest + from tests.support.case import ShellCase diff --git a/tests/integration/runners/test_manage.py b/tests/integration/runners/test_manage.py index 51f224a64d4..993032c94e7 100644 --- a/tests/integration/runners/test_manage.py +++ b/tests/integration/runners/test_manage.py @@ -3,6 +3,7 @@ Tests for the salt-run command """ import pytest + from tests.support.case import ShellCase diff --git a/tests/integration/runners/test_nacl.py b/tests/integration/runners/test_nacl.py index 2a8e8486130..45213dfd564 100644 --- a/tests/integration/runners/test_nacl.py +++ b/tests/integration/runners/test_nacl.py @@ -6,12 +6,13 @@ import logging import sys import pytest + from tests.support.case import ShellCase from tests.support.unit import skipIf try: - import libnacl.secret # pylint: disable=unused-import import libnacl.sealed # pylint: disable=unused-import + import libnacl.secret # pylint: disable=unused-import HAS_LIBNACL = True except (ImportError, OSError, AttributeError): diff --git a/tests/integration/runners/test_runner_returns.py b/tests/integration/runners/test_runner_returns.py index a52f62fefb1..849c7aa1e4d 100644 --- a/tests/integration/runners/test_runner_returns.py +++ b/tests/integration/runners/test_runner_returns.py @@ -8,6 +8,7 @@ import socket import tempfile import pytest + import salt.payload import salt.utils.args import salt.utils.files diff --git a/tests/integration/runners/test_salt.py b/tests/integration/runners/test_salt.py index 634da4f51e5..8b5f10689dd 100644 --- a/tests/integration/runners/test_salt.py +++ b/tests/integration/runners/test_salt.py @@ -5,6 +5,7 @@ Tests for the salt runner """ import pytest + from tests.support.case import ShellCase diff --git a/tests/integration/sdb/test_env.py b/tests/integration/sdb/test_env.py index 6f264e3fc48..911d49dbb52 100644 --- a/tests/integration/sdb/test_env.py +++ b/tests/integration/sdb/test_env.py @@ -6,6 +6,7 @@ import os import textwrap import pytest + import salt.utils.files from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/shell/test_arguments.py b/tests/integration/shell/test_arguments.py index 0ae2ced93c4..e3c59c26445 100644 --- a/tests/integration/shell/test_arguments.py +++ b/tests/integration/shell/test_arguments.py @@ -3,6 +3,7 @@ """ import pytest + import salt.utils.args from tests.support.case import ModuleCase diff --git a/tests/integration/shell/test_enabled.py b/tests/integration/shell/test_enabled.py index 153fc201d94..dd6ab57605b 100644 --- a/tests/integration/shell/test_enabled.py +++ b/tests/integration/shell/test_enabled.py @@ -2,6 +2,7 @@ import os import textwrap import pytest + import salt.utils.files import salt.utils.platform 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 365abc7b71d..27625a4ff60 100644 --- a/tests/integration/shell/test_master_tops.py +++ b/tests/integration/shell/test_master_tops.py @@ -5,6 +5,7 @@ import pytest + from tests.support.case import ShellCase diff --git a/tests/integration/shell/test_spm.py b/tests/integration/shell/test_spm.py index d0b7cfe8029..991e335e29c 100644 --- a/tests/integration/shell/test_spm.py +++ b/tests/integration/shell/test_spm.py @@ -1,6 +1,7 @@ import os import pytest + from tests.support.case import ShellCase, SPMCase diff --git a/tests/integration/spm/test_build.py b/tests/integration/spm/test_build.py index d8ab1783ccd..0354dcd1919 100644 --- a/tests/integration/spm/test_build.py +++ b/tests/integration/spm/test_build.py @@ -6,6 +6,7 @@ import os import shutil import pytest + import salt.utils.files import salt.utils.path from tests.support.case import ModuleCase, SPMCase diff --git a/tests/integration/spm/test_files.py b/tests/integration/spm/test_files.py index 6981704d6e4..390f64f21cb 100644 --- a/tests/integration/spm/test_files.py +++ b/tests/integration/spm/test_files.py @@ -6,6 +6,7 @@ import os import shutil import pytest + from tests.support.case import SPMCase diff --git a/tests/integration/spm/test_info.py b/tests/integration/spm/test_info.py index f7e022fd769..20157d5102b 100644 --- a/tests/integration/spm/test_info.py +++ b/tests/integration/spm/test_info.py @@ -5,6 +5,7 @@ Tests for the spm info utility import shutil import pytest + from tests.support.case import SPMCase diff --git a/tests/integration/spm/test_install.py b/tests/integration/spm/test_install.py index 716f4c157a9..8a66e1a910e 100644 --- a/tests/integration/spm/test_install.py +++ b/tests/integration/spm/test_install.py @@ -6,6 +6,7 @@ import os import shutil import pytest + import salt.utils.files import salt.utils.path import salt.utils.yaml diff --git a/tests/integration/spm/test_remove.py b/tests/integration/spm/test_remove.py index 7d08f684fe4..c4cb8f0b26f 100644 --- a/tests/integration/spm/test_remove.py +++ b/tests/integration/spm/test_remove.py @@ -6,6 +6,7 @@ import os import shutil import pytest + from tests.support.case import SPMCase diff --git a/tests/integration/spm/test_repo.py b/tests/integration/spm/test_repo.py index c15e820a26e..89f68884972 100644 --- a/tests/integration/spm/test_repo.py +++ b/tests/integration/spm/test_repo.py @@ -6,6 +6,7 @@ import os import shutil import pytest + from tests.support.case import SPMCase diff --git a/tests/integration/ssh/test_deploy.py b/tests/integration/ssh/test_deploy.py index 5f63acc368d..01a1f4bde2c 100644 --- a/tests/integration/ssh/test_deploy.py +++ b/tests/integration/ssh/test_deploy.py @@ -6,6 +6,7 @@ import os import shutil import pytest + from tests.support.case import SSHCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/ssh/test_jinja_filters.py b/tests/integration/ssh/test_jinja_filters.py index 01f37bf6186..d7e6d5ce634 100644 --- a/tests/integration/ssh/test_jinja_filters.py +++ b/tests/integration/ssh/test_jinja_filters.py @@ -1,6 +1,7 @@ import platform import pytest + from tests.support.case import SSHCase diff --git a/tests/integration/ssh/test_master.py b/tests/integration/ssh/test_master.py index 11cd2ccc0ee..4e784de6a8f 100644 --- a/tests/integration/ssh/test_master.py +++ b/tests/integration/ssh/test_master.py @@ -4,6 +4,7 @@ Simple Smoke Tests for Connected SSH minions import pytest from saltfactories.utils.tempfiles import temp_file + from tests.support.case import SSHCase from tests.support.helpers import requires_system_grains from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/ssh/test_mine.py b/tests/integration/ssh/test_mine.py index 4709eac1883..a312e92c50e 100644 --- a/tests/integration/ssh/test_mine.py +++ b/tests/integration/ssh/test_mine.py @@ -2,6 +2,7 @@ import os import shutil import pytest + import salt.utils.platform from tests.support.case import SSHCase from tests.support.unit import skipIf diff --git a/tests/integration/ssh/test_pre_flight.py b/tests/integration/ssh/test_pre_flight.py index 9c39219e9d8..1598b3d51b5 100644 --- a/tests/integration/ssh/test_pre_flight.py +++ b/tests/integration/ssh/test_pre_flight.py @@ -5,6 +5,7 @@ Test for ssh_pre_flight roster option import os import pytest + import salt.utils.files from tests.support.case import SSHCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/ssh/test_raw.py b/tests/integration/ssh/test_raw.py index 097704f769a..b365c12efe4 100644 --- a/tests/integration/ssh/test_raw.py +++ b/tests/integration/ssh/test_raw.py @@ -1,4 +1,5 @@ import pytest + from tests.support.case import SSHCase diff --git a/tests/integration/ssh/test_saltcheck.py b/tests/integration/ssh/test_saltcheck.py index 12a558e188b..0c245abc082 100644 --- a/tests/integration/ssh/test_saltcheck.py +++ b/tests/integration/ssh/test_saltcheck.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from tests.support.case import SSHCase from tests.support.unit import skipIf diff --git a/tests/integration/ssh/test_state.py b/tests/integration/ssh/test_state.py index d034b6a81e8..4f4d2bf8a51 100644 --- a/tests/integration/ssh/test_state.py +++ b/tests/integration/ssh/test_state.py @@ -7,6 +7,7 @@ import time import pytest from saltfactories.utils.tempfiles import temp_file + from tests.support.case import SSHCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/states/test_alternatives.py b/tests/integration/states/test_alternatives.py index 24261ae1d0a..433e2a4e01d 100644 --- a/tests/integration/states/test_alternatives.py +++ b/tests/integration/states/test_alternatives.py @@ -5,6 +5,7 @@ Integration tests for the alternatives state module import os import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/states/test_archive.py b/tests/integration/states/test_archive.py index 03999c37d4f..7d2dba52210 100644 --- a/tests/integration/states/test_archive.py +++ b/tests/integration/states/test_archive.py @@ -7,6 +7,7 @@ import logging import os import pytest + import salt.utils.files import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_bower.py b/tests/integration/states/test_bower.py index 2afa3554747..4f22db227f5 100644 --- a/tests/integration/states/test_bower.py +++ b/tests/integration/states/test_bower.py @@ -3,6 +3,7 @@ """ import pytest + import salt.utils.json import salt.utils.path from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_chocolatey.py b/tests/integration/states/test_chocolatey.py index cb09589b914..78113b5b727 100644 --- a/tests/integration/states/test_chocolatey.py +++ b/tests/integration/states/test_chocolatey.py @@ -5,6 +5,7 @@ Tests for the Chocolatey State import logging import pytest + import salt.utils.platform from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_cmd.py b/tests/integration/states/test_cmd.py index dd5b670b5d9..1e68ed354ff 100644 --- a/tests/integration/states/test_cmd.py +++ b/tests/integration/states/test_cmd.py @@ -9,6 +9,7 @@ import textwrap import time import pytest + import salt.utils.files import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_docker_network.py b/tests/integration/states/test_docker_network.py index ce8da074d40..1f035ecaf09 100644 --- a/tests/integration/states/test_docker_network.py +++ b/tests/integration/states/test_docker_network.py @@ -10,6 +10,7 @@ import subprocess import tempfile import pytest + import salt.utils.files import salt.utils.network import salt.utils.path diff --git a/tests/integration/states/test_file.py b/tests/integration/states/test_file.py index 93a5830bdbb..c5c9bdf21a5 100644 --- a/tests/integration/states/test_file.py +++ b/tests/integration/states/test_file.py @@ -14,6 +14,7 @@ import tempfile import textwrap import pytest + import salt.serializers.configparser import salt.serializers.plist import salt.utils.atomicfile @@ -2707,6 +2708,7 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin): self.assertEqual(ret["some-utf8-file-create2"]["changes"], {"diff": diff}) if salt.utils.platform.is_windows(): import subprocess + import win32api proc = subprocess.run( diff --git a/tests/integration/states/test_git.py b/tests/integration/states/test_git.py index ecf24b522ed..5c00a6253e7 100644 --- a/tests/integration/states/test_git.py +++ b/tests/integration/states/test_git.py @@ -13,6 +13,7 @@ import tempfile import urllib.parse import pytest + import salt.utils.files import salt.utils.path from salt.utils.versions import LooseVersion as _LooseVersion diff --git a/tests/integration/states/test_handle_error.py b/tests/integration/states/test_handle_error.py index 8fdd1468d34..431cbe2e7ee 100644 --- a/tests/integration/states/test_handle_error.py +++ b/tests/integration/states/test_handle_error.py @@ -3,6 +3,7 @@ tests for host state """ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_host.py b/tests/integration/states/test_host.py index 4c131b37545..f80ed37416f 100644 --- a/tests/integration/states/test_host.py +++ b/tests/integration/states/test_host.py @@ -7,6 +7,7 @@ import os import shutil import pytest + import salt.utils.files import salt.utils.stringutils from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_keystone.py b/tests/integration/states/test_keystone.py index 670abce455a..a4f3ba8a3b9 100644 --- a/tests/integration/states/test_keystone.py +++ b/tests/integration/states/test_keystone.py @@ -5,6 +5,7 @@ Tests for the Keystone states import logging import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.unit import skipIf diff --git a/tests/integration/states/test_lxd.py b/tests/integration/states/test_lxd.py index fd1987a5fac..7aee81f96cd 100644 --- a/tests/integration/states/test_lxd.py +++ b/tests/integration/states/test_lxd.py @@ -3,6 +3,7 @@ Integration tests for the lxd states """ import pytest + import salt.modules.lxd from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_lxd_container.py b/tests/integration/states/test_lxd_container.py index 3fc75805088..4ee92d33fef 100644 --- a/tests/integration/states/test_lxd_container.py +++ b/tests/integration/states/test_lxd_container.py @@ -3,6 +3,7 @@ Integration tests for the lxd states """ import pytest + import salt.modules.lxd from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_lxd_image.py b/tests/integration/states/test_lxd_image.py index ac2ea1bf3e7..374aac57762 100644 --- a/tests/integration/states/test_lxd_image.py +++ b/tests/integration/states/test_lxd_image.py @@ -2,6 +2,7 @@ Integration tests for the lxd states """ import pytest + import salt.modules.lxd from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_lxd_profile.py b/tests/integration/states/test_lxd_profile.py index f149c98997c..cfcc24d968d 100644 --- a/tests/integration/states/test_lxd_profile.py +++ b/tests/integration/states/test_lxd_profile.py @@ -2,6 +2,7 @@ Integration tests for the lxd states """ import pytest + import salt.modules.lxd from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_match.py b/tests/integration/states/test_match.py index adab6e22704..eb064cd16bf 100644 --- a/tests/integration/states/test_match.py +++ b/tests/integration/states/test_match.py @@ -4,6 +4,7 @@ tests.integration.states.match """ import pytest + from tests.support.case import ModuleCase from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/states/test_mysql_database.py b/tests/integration/states/test_mysql_database.py index 6bf144f782a..0cdd8dea4b8 100644 --- a/tests/integration/states/test_mysql_database.py +++ b/tests/integration/states/test_mysql_database.py @@ -3,6 +3,7 @@ Tests for the MySQL states """ import pytest + import salt.utils.path from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_mysql_grants.py b/tests/integration/states/test_mysql_grants.py index 655daefa127..114e31237ab 100644 --- a/tests/integration/states/test_mysql_grants.py +++ b/tests/integration/states/test_mysql_grants.py @@ -5,6 +5,7 @@ Tests for the MySQL states import logging import pytest + import salt.utils.path from salt.modules import mysql as mysqlmod from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_network.py b/tests/integration/states/test_network.py index 4e8bbe53794..623cde77b93 100644 --- a/tests/integration/states/test_network.py +++ b/tests/integration/states/test_network.py @@ -6,6 +6,7 @@ """ import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_npm.py b/tests/integration/states/test_npm.py index 740630a0efe..11e2003a20a 100644 --- a/tests/integration/states/test_npm.py +++ b/tests/integration/states/test_npm.py @@ -7,6 +7,7 @@ import os import pytest + import salt.utils.path import salt.utils.platform from salt.utils.versions import LooseVersion diff --git a/tests/integration/states/test_rabbitmq_user.py b/tests/integration/states/test_rabbitmq_user.py index 84d6dc13995..d841064562d 100644 --- a/tests/integration/states/test_rabbitmq_user.py +++ b/tests/integration/states/test_rabbitmq_user.py @@ -3,6 +3,7 @@ Tests for the rabbitmq state """ import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_rabbitmq_vhost.py b/tests/integration/states/test_rabbitmq_vhost.py index ffb618c421a..6ead7d011b3 100644 --- a/tests/integration/states/test_rabbitmq_vhost.py +++ b/tests/integration/states/test_rabbitmq_vhost.py @@ -3,6 +3,7 @@ Tests for the rabbitmq state """ import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin diff --git a/tests/integration/states/test_reg.py b/tests/integration/states/test_reg.py index 5054dc32c5d..838d2c05aa2 100644 --- a/tests/integration/states/test_reg.py +++ b/tests/integration/states/test_reg.py @@ -5,9 +5,10 @@ Tests for the Reg State import logging import pytest +from saltfactories.utils import random_string + import salt.utils.platform import salt.utils.win_reg as reg -from saltfactories.utils import random_string from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.unit import skipIf diff --git a/tests/integration/states/test_renderers.py b/tests/integration/states/test_renderers.py index c50577ec5f4..e21d81021b8 100644 --- a/tests/integration/states/test_renderers.py +++ b/tests/integration/states/test_renderers.py @@ -3,6 +3,7 @@ Integration tests for renderer functions """ import pytest + from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_service.py b/tests/integration/states/test_service.py index f1faa7678c1..8607c92b278 100644 --- a/tests/integration/states/test_service.py +++ b/tests/integration/states/test_service.py @@ -5,6 +5,7 @@ Tests for the service state import re import pytest + import salt.utils.path import salt.utils.platform from tests.support.case import ModuleCase diff --git a/tests/integration/states/test_ssh_auth.py b/tests/integration/states/test_ssh_auth.py index f2fced3936f..660c3f62d6a 100644 --- a/tests/integration/states/test_ssh_auth.py +++ b/tests/integration/states/test_ssh_auth.py @@ -5,6 +5,7 @@ Test the ssh_auth states import os import pytest + import salt.utils.files from tests.support.case import ModuleCase from tests.support.helpers import with_system_user diff --git a/tests/integration/states/test_ssh_known_hosts.py b/tests/integration/states/test_ssh_known_hosts.py index cb4b40d3a06..979a2172846 100644 --- a/tests/integration/states/test_ssh_known_hosts.py +++ b/tests/integration/states/test_ssh_known_hosts.py @@ -6,6 +6,7 @@ import os import shutil import pytest + from tests.support.case import ModuleCase from tests.support.mixins import SaltReturnAssertsMixin from tests.support.runtests import RUNTIME_VARS diff --git a/tests/integration/states/test_x509.py b/tests/integration/states/test_x509.py index 8accd0ebda5..040e3ffbf2c 100644 --- a/tests/integration/states/test_x509.py +++ b/tests/integration/states/test_x509.py @@ -6,6 +6,7 @@ import pprint import textwrap import pytest + import salt.utils.files from tests.support.case import ModuleCase from tests.support.helpers import with_tempfile diff --git a/tests/integration/utils/test_win_runas.py b/tests/integration/utils/test_win_runas.py index 2cec9e99df4..f0acaad5b2e 100644 --- a/tests/integration/utils/test_win_runas.py +++ b/tests/integration/utils/test_win_runas.py @@ -9,9 +9,10 @@ import threading import time import traceback +import yaml + import salt.utils.files import salt.utils.win_runas -import yaml from tests.support.case import ModuleCase from tests.support.helpers import with_system_user from tests.support.mock import Mock @@ -19,11 +20,11 @@ from tests.support.runtests import RUNTIME_VARS from tests.support.unit import skipIf try: - import win32service - import win32serviceutil - import win32event import servicemanager import win32api + import win32event + import win32service + import win32serviceutil CODE_DIR = win32api.GetLongPathName(RUNTIME_VARS.CODE_DIR) HAS_WIN32 = True diff --git a/tests/pytests/conftest.py b/tests/pytests/conftest.py index 4305ed98d2e..4549d36b8d5 100644 --- a/tests/pytests/conftest.py +++ b/tests/pytests/conftest.py @@ -14,12 +14,13 @@ import tempfile import attr import pytest +from pytestshellutils.utils import ports +from saltfactories.utils import random_string + import salt.ext.tornado.ioloop import salt.utils.files import salt.utils.platform -from pytestshellutils.utils import ports from salt.serializers import yaml -from saltfactories.utils import random_string from tests.support.helpers import get_virtualenv_binary_path from tests.support.pytest.helpers import TestAccount from tests.support.runtests import RUNTIME_VARS diff --git a/tests/pytests/functional/cache/helpers.py b/tests/pytests/functional/cache/helpers.py index 44a35741560..cd90f0fefc7 100644 --- a/tests/pytests/functional/cache/helpers.py +++ b/tests/pytests/functional/cache/helpers.py @@ -1,6 +1,7 @@ import time import pytest + import salt.cache from salt.exceptions import SaltCacheError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/functional/cache/test_consul.py b/tests/pytests/functional/cache/test_consul.py index 6680a75a683..1156b7aab24 100644 --- a/tests/pytests/functional/cache/test_consul.py +++ b/tests/pytests/functional/cache/test_consul.py @@ -3,9 +3,10 @@ import socket import time import pytest +from saltfactories.utils import random_string + import salt.cache import salt.loader -from saltfactories.utils import random_string from tests.pytests.functional.cache.helpers import run_common_cache_tests docker = pytest.importorskip("docker") diff --git a/tests/pytests/functional/cache/test_etcd.py b/tests/pytests/functional/cache/test_etcd.py index d13f34d15df..01ec44b4f4f 100644 --- a/tests/pytests/functional/cache/test_etcd.py +++ b/tests/pytests/functional/cache/test_etcd.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.cache import salt.loader from tests.pytests.functional.cache.helpers import run_common_cache_tests diff --git a/tests/pytests/functional/cache/test_localfs.py b/tests/pytests/functional/cache/test_localfs.py index 4b03e6677ad..face6e69820 100644 --- a/tests/pytests/functional/cache/test_localfs.py +++ b/tests/pytests/functional/cache/test_localfs.py @@ -2,6 +2,7 @@ import logging import shutil import pytest + import salt.cache import salt.loader from tests.pytests.functional.cache.helpers import run_common_cache_tests diff --git a/tests/pytests/functional/cache/test_memcache.py b/tests/pytests/functional/cache/test_memcache.py index 4f35ce47900..30bc5fec26b 100644 --- a/tests/pytests/functional/cache/test_memcache.py +++ b/tests/pytests/functional/cache/test_memcache.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.cache from tests.pytests.functional.cache.helpers import run_common_cache_tests diff --git a/tests/pytests/functional/cache/test_mysql.py b/tests/pytests/functional/cache/test_mysql.py index abffca2888a..c283872c08c 100644 --- a/tests/pytests/functional/cache/test_mysql.py +++ b/tests/pytests/functional/cache/test_mysql.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.cache import salt.loader from tests.pytests.functional.cache.helpers import run_common_cache_tests diff --git a/tests/pytests/functional/cache/test_redis.py b/tests/pytests/functional/cache/test_redis.py index 9b3d5aa27e9..2cc2b006122 100644 --- a/tests/pytests/functional/cache/test_redis.py +++ b/tests/pytests/functional/cache/test_redis.py @@ -1,8 +1,9 @@ import logging import pytest -import salt.cache from saltfactories.utils import random_string + +import salt.cache from tests.pytests.functional.cache.helpers import run_common_cache_tests pytest.importorskip("redis") diff --git a/tests/pytests/functional/channel/conftest.py b/tests/pytests/functional/channel/conftest.py index 399f18d7f9f..62e53c27fb4 100644 --- a/tests/pytests/functional/channel/conftest.py +++ b/tests/pytests/functional/channel/conftest.py @@ -2,6 +2,7 @@ import ctypes import multiprocessing import pytest + import salt.crypt import salt.master import salt.utils.stringutils diff --git a/tests/pytests/functional/channel/test_server.py b/tests/pytests/functional/channel/test_server.py index ec55d034480..d92a55bf68f 100644 --- a/tests/pytests/functional/channel/test_server.py +++ b/tests/pytests/functional/channel/test_server.py @@ -7,6 +7,9 @@ import shutil import time import pytest +from pytestshellutils.utils import ports +from saltfactories.utils import random_string + import salt.channel.client import salt.channel.server import salt.config @@ -16,8 +19,6 @@ import salt.master import salt.utils.platform import salt.utils.process import salt.utils.stringutils -from pytestshellutils.utils import ports -from saltfactories.utils import random_string log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/cli/test_api.py b/tests/pytests/functional/cli/test_api.py index 0cefb94c7c2..fd62650fd48 100644 --- a/tests/pytests/functional/cli/test_api.py +++ b/tests/pytests/functional/cli/test_api.py @@ -2,6 +2,7 @@ import os import sys import pytest + from salt._logging import get_log_record_factory, set_log_record_factory from salt.cli.api import SaltAPI diff --git a/tests/pytests/functional/cli/test_salt.py b/tests/pytests/functional/cli/test_salt.py index cee1977e212..79ab3a8c39f 100644 --- a/tests/pytests/functional/cli/test_salt.py +++ b/tests/pytests/functional/cli/test_salt.py @@ -3,6 +3,7 @@ tests.pytests.functional.cli.test_salt ~~~~~~~~~~~~~~~~~~~~~~~~~ """ import pytest + import salt.version diff --git a/tests/pytests/functional/cli/test_salt_master.py b/tests/pytests/functional/cli/test_salt_master.py index 77bb146bfbd..4b21ecf231a 100644 --- a/tests/pytests/functional/cli/test_salt_master.py +++ b/tests/pytests/functional/cli/test_salt_master.py @@ -1,10 +1,11 @@ import logging import pytest -import salt.defaults.exitcodes from pytestshellutils.exceptions import FactoryNotStarted from saltfactories.utils import random_string +import salt.defaults.exitcodes + pytestmark = [ pytest.mark.slow_test, pytest.mark.windows_whitelisted, diff --git a/tests/pytests/functional/fileserver/hgfs/test_hgfs.py b/tests/pytests/functional/fileserver/hgfs/test_hgfs.py index 898011fa1e2..45d5997e2ee 100644 --- a/tests/pytests/functional/fileserver/hgfs/test_hgfs.py +++ b/tests/pytests/functional/fileserver/hgfs/test_hgfs.py @@ -4,9 +4,10 @@ from pathlib import Path import psutil # pylint: disable=3rd-party-module-not-gated import pytest +from pytestshellutils.utils.processes import terminate_process + import salt.config import salt.fileserver.hgfs as hgfs -from pytestshellutils.utils.processes import terminate_process from tests.support.mock import patch try: diff --git a/tests/pytests/functional/fileserver/test_roots.py b/tests/pytests/functional/fileserver/test_roots.py index ef84be26446..37e410e302c 100644 --- a/tests/pytests/functional/fileserver/test_roots.py +++ b/tests/pytests/functional/fileserver/test_roots.py @@ -1,4 +1,5 @@ import pytest + import salt.config import salt.fileserver.roots as roots from salt.utils.odict import OrderedDict diff --git a/tests/pytests/functional/loader/test_loaded_base_name.py b/tests/pytests/functional/loader/test_loaded_base_name.py index 7fd22ef51f7..56c2892c8d6 100644 --- a/tests/pytests/functional/loader/test_loaded_base_name.py +++ b/tests/pytests/functional/loader/test_loaded_base_name.py @@ -1,10 +1,11 @@ import warnings import pytest +from saltfactories.utils import random_string + import salt.config import salt.loader from salt.loader.lazy import LazyLoader -from saltfactories.utils import random_string @pytest.fixture(scope="module") diff --git a/tests/pytests/functional/loader/test_loader.py b/tests/pytests/functional/loader/test_loader.py index 6dfd97b0e64..4341088f65a 100644 --- a/tests/pytests/functional/loader/test_loader.py +++ b/tests/pytests/functional/loader/test_loader.py @@ -2,6 +2,7 @@ import json import sys import pytest + import salt.utils.versions from tests.support.helpers import SaltVirtualEnv from tests.support.pytest.helpers import FakeSaltExtension diff --git a/tests/pytests/functional/log_handlers/test_logstash_mod.py b/tests/pytests/functional/log_handlers/test_logstash_mod.py index 9fa9c39203c..dfc45a75824 100644 --- a/tests/pytests/functional/log_handlers/test_logstash_mod.py +++ b/tests/pytests/functional/log_handlers/test_logstash_mod.py @@ -4,9 +4,10 @@ import socket import time import pytest -import salt.utils.stringutils import zmq from pytestshellutils.utils import ports + +import salt.utils.stringutils from salt.log_handlers.logstash_mod import DatagramLogstashHandler, ZMQLogstashHander log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/modules/cmd/test_powershell.py b/tests/pytests/functional/modules/cmd/test_powershell.py index 4dcfed1082b..62b17665640 100644 --- a/tests/pytests/functional/modules/cmd/test_powershell.py +++ b/tests/pytests/functional/modules/cmd/test_powershell.py @@ -1,6 +1,7 @@ import base64 import pytest + import salt.modules.cmdmod as cmdmod import salt.utils.path import salt.utils.stringutils diff --git a/tests/pytests/functional/modules/file/test_readlink.py b/tests/pytests/functional/modules/file/test_readlink.py index b2577214a95..ce5ad36bd9e 100644 --- a/tests/pytests/functional/modules/file/test_readlink.py +++ b/tests/pytests/functional/modules/file/test_readlink.py @@ -3,6 +3,7 @@ Tests for file.readlink function """ import pytest + from salt.exceptions import SaltInvocationError pytestmark = [ diff --git a/tests/pytests/functional/modules/file/test_symlink.py b/tests/pytests/functional/modules/file/test_symlink.py index b9a0fd5bc39..68920fd9d7d 100644 --- a/tests/pytests/functional/modules/file/test_symlink.py +++ b/tests/pytests/functional/modules/file/test_symlink.py @@ -5,6 +5,7 @@ Tests for file.symlink function import os import pytest + import salt.utils.path from salt.exceptions import CommandExecutionError, SaltInvocationError diff --git a/tests/pytests/functional/modules/state/requisites/test_watch.py b/tests/pytests/functional/modules/state/requisites/test_watch.py index 0c76db7cc94..9eff2c10b6d 100644 --- a/tests/pytests/functional/modules/state/requisites/test_watch.py +++ b/tests/pytests/functional/modules/state/requisites/test_watch.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform from . import normalize_ret diff --git a/tests/pytests/functional/modules/state/test_state.py b/tests/pytests/functional/modules/state/test_state.py index 8f8706ae45a..eb10ae2a4be 100644 --- a/tests/pytests/functional/modules/state/test_state.py +++ b/tests/pytests/functional/modules/state/test_state.py @@ -5,6 +5,7 @@ import threading import time import pytest + import salt.loader import salt.utils.atomicfile import salt.utils.files diff --git a/tests/pytests/functional/modules/test_aptpkg.py b/tests/pytests/functional/modules/test_aptpkg.py index 3eed526ff29..8b1e897bc70 100644 --- a/tests/pytests/functional/modules/test_aptpkg.py +++ b/tests/pytests/functional/modules/test_aptpkg.py @@ -3,6 +3,7 @@ import pathlib import shutil import pytest + import salt.exceptions import salt.modules.aptpkg as aptpkg import salt.modules.cmdmod as cmd diff --git a/tests/pytests/functional/modules/test_archive.py b/tests/pytests/functional/modules/test_archive.py index dfdc42e7e7a..c276100c09b 100644 --- a/tests/pytests/functional/modules/test_archive.py +++ b/tests/pytests/functional/modules/test_archive.py @@ -9,6 +9,7 @@ import textwrap import attr import pytest + import salt.utils.files import salt.utils.path import salt.utils.platform diff --git a/tests/pytests/functional/modules/test_etcd_mod.py b/tests/pytests/functional/modules/test_etcd_mod.py index 56fe66b3a09..56ae6b06ca1 100644 --- a/tests/pytests/functional/modules/test_etcd_mod.py +++ b/tests/pytests/functional/modules/test_etcd_mod.py @@ -3,6 +3,7 @@ import threading import time import pytest + import salt.modules.etcd_mod as etcd_mod from salt.utils.etcd_util import get_conn from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import diff --git a/tests/pytests/functional/modules/test_mac_pkgutil.py b/tests/pytests/functional/modules/test_mac_pkgutil.py index 98c31b31672..3622d70c4ad 100644 --- a/tests/pytests/functional/modules/test_mac_pkgutil.py +++ b/tests/pytests/functional/modules/test_mac_pkgutil.py @@ -4,6 +4,7 @@ integration tests for mac_pkgutil import shutil import pytest + from salt.exceptions import SaltInvocationError pytestmark = [ diff --git a/tests/pytests/functional/modules/test_mysql.py b/tests/pytests/functional/modules/test_mysql.py index fa90e9b9490..6bd1903fe69 100644 --- a/tests/pytests/functional/modules/test_mysql.py +++ b/tests/pytests/functional/modules/test_mysql.py @@ -5,8 +5,9 @@ import logging import time import pytest -import salt.modules.mysql as mysqlmod from pytestshellutils.utils import format_callback_to_string + +import salt.modules.mysql as mysqlmod from tests.support.pytest.mysql import * # pylint: disable=wildcard-import,unused-wildcard-import log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/modules/test_opkg.py b/tests/pytests/functional/modules/test_opkg.py index f11c8254db3..091db51ef03 100644 --- a/tests/pytests/functional/modules/test_opkg.py +++ b/tests/pytests/functional/modules/test_opkg.py @@ -1,6 +1,7 @@ import os import pytest + import salt.modules.cmdmod as cmd import salt.modules.opkg as opkg from tests.support.mock import patch diff --git a/tests/pytests/functional/modules/test_pip.py b/tests/pytests/functional/modules/test_pip.py index 51f40c49a74..0e8587bf86e 100644 --- a/tests/pytests/functional/modules/test_pip.py +++ b/tests/pytests/functional/modules/test_pip.py @@ -1,6 +1,7 @@ import sys import pytest + from tests.support.helpers import VirtualEnv diff --git a/tests/pytests/functional/modules/test_pkg.py b/tests/pytests/functional/modules/test_pkg.py index dd76401ba58..b998151086c 100644 --- a/tests/pytests/functional/modules/test_pkg.py +++ b/tests/pytests/functional/modules/test_pkg.py @@ -6,10 +6,11 @@ import tempfile import time import pytest +from saltfactories.utils.functional import Loaders + import salt.utils.path import salt.utils.pkg import salt.utils.platform -from saltfactories.utils.functional import Loaders log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/modules/test_runit.py b/tests/pytests/functional/modules/test_runit.py index 016e30a5d79..3897827c426 100644 --- a/tests/pytests/functional/modules/test_runit.py +++ b/tests/pytests/functional/modules/test_runit.py @@ -1,6 +1,7 @@ import pathlib import pytest + import salt.modules.runit as runit from tests.support.mock import patch diff --git a/tests/pytests/functional/modules/test_saltutil.py b/tests/pytests/functional/modules/test_saltutil.py index cf65593836a..ca61f70143a 100644 --- a/tests/pytests/functional/modules/test_saltutil.py +++ b/tests/pytests/functional/modules/test_saltutil.py @@ -1,4 +1,5 @@ import pytest + import salt.config import salt.loader import salt.modules.saltutil diff --git a/tests/pytests/functional/modules/test_user.py b/tests/pytests/functional/modules/test_user.py index 5a936b5c167..b6f935aee83 100644 --- a/tests/pytests/functional/modules/test_user.py +++ b/tests/pytests/functional/modules/test_user.py @@ -1,10 +1,11 @@ import pathlib import pytest +from saltfactories.utils import random_string + import salt.modules.useradd as useradd import salt.utils.platform from salt.exceptions import CommandExecutionError -from saltfactories.utils import random_string from tests.support.unit import skipIf pytestmark = [ diff --git a/tests/pytests/functional/modules/test_win_certutil.py b/tests/pytests/functional/modules/test_win_certutil.py index 99430720332..ca2e2a219cb 100644 --- a/tests/pytests/functional/modules/test_win_certutil.py +++ b/tests/pytests/functional/modules/test_win_certutil.py @@ -3,6 +3,7 @@ Tests for win_certutil execution module """ import pytest + import salt.exceptions import salt.utils.files diff --git a/tests/pytests/functional/modules/test_win_dsc.py b/tests/pytests/functional/modules/test_win_dsc.py index aff88e5f4d1..502fbe038d1 100644 --- a/tests/pytests/functional/modules/test_win_dsc.py +++ b/tests/pytests/functional/modules/test_win_dsc.py @@ -4,6 +4,7 @@ import subprocess import psutil import pytest + import salt.exceptions pytestmark = [ diff --git a/tests/pytests/functional/modules/test_win_shortcut.py b/tests/pytests/functional/modules/test_win_shortcut.py index 205809811a9..1afa0217bc7 100644 --- a/tests/pytests/functional/modules/test_win_shortcut.py +++ b/tests/pytests/functional/modules/test_win_shortcut.py @@ -6,6 +6,7 @@ import shutil import subprocess import pytest + from salt.exceptions import CommandExecutionError try: diff --git a/tests/pytests/functional/modules/test_yaml.py b/tests/pytests/functional/modules/test_yaml.py index 10ecd5dd472..2a8fbc113ff 100644 --- a/tests/pytests/functional/modules/test_yaml.py +++ b/tests/pytests/functional/modules/test_yaml.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest + import salt.loader import salt.modules.config import salt.modules.cp 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 7046590da7e..53e656eab18 100644 --- a/tests/pytests/functional/modules/win_file/test_check_perms.py +++ b/tests/pytests/functional/modules/win_file/test_check_perms.py @@ -2,6 +2,7 @@ Tests for win_file execution module """ import pytest + import salt.modules.win_file as win_file import salt.utils.win_dacl as win_dacl from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/functional/modules/win_file/test_remove.py b/tests/pytests/functional/modules/win_file/test_remove.py index c28434bca8f..6cc26686f5a 100644 --- a/tests/pytests/functional/modules/win_file/test_remove.py +++ b/tests/pytests/functional/modules/win_file/test_remove.py @@ -2,6 +2,7 @@ Tests for win_file execution module """ import pytest + import salt.modules.win_file as win_file import salt.utils.path diff --git a/tests/pytests/functional/modules/win_file/test_stat.py b/tests/pytests/functional/modules/win_file/test_stat.py index 57b58205214..0ff78e85fb7 100644 --- a/tests/pytests/functional/modules/win_file/test_stat.py +++ b/tests/pytests/functional/modules/win_file/test_stat.py @@ -2,6 +2,7 @@ Tests for win_file execution module """ import pytest + import salt.modules.win_file as win_file import salt.utils.files import salt.utils.path diff --git a/tests/pytests/functional/modules/win_lgpo/test_adv_audit_settings_module.py b/tests/pytests/functional/modules/win_lgpo/test_adv_audit_settings_module.py index e9538b9cc3e..8a767bb0aa3 100644 --- a/tests/pytests/functional/modules/win_lgpo/test_adv_audit_settings_module.py +++ b/tests/pytests/functional/modules/win_lgpo/test_adv_audit_settings_module.py @@ -1,4 +1,5 @@ import pytest + import salt.loader import salt.modules.win_lgpo as win_lgpo diff --git a/tests/pytests/functional/modules/win_lgpo/test_write_regpol.py b/tests/pytests/functional/modules/win_lgpo/test_write_regpol.py index f8dd5b4277e..64eba6c99f2 100644 --- a/tests/pytests/functional/modules/win_lgpo/test_write_regpol.py +++ b/tests/pytests/functional/modules/win_lgpo/test_write_regpol.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.win_file import salt.modules.win_lgpo as win_lgpo import salt.utils.files diff --git a/tests/pytests/functional/netapi/conftest.py b/tests/pytests/functional/netapi/conftest.py index 084c0172724..6fd4d6b5747 100644 --- a/tests/pytests/functional/netapi/conftest.py +++ b/tests/pytests/functional/netapi/conftest.py @@ -1,9 +1,10 @@ import pathlib import pytest +from pytestshellutils.utils.ports import get_unused_localhost_port + import salt.config import tests.support.netapi as netapi -from pytestshellutils.utils.ports import get_unused_localhost_port @pytest.fixture diff --git a/tests/pytests/functional/netapi/rest_cherrypy/conftest.py b/tests/pytests/functional/netapi/rest_cherrypy/conftest.py index 8be88daff03..01b6ee42074 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/conftest.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/conftest.py @@ -1,4 +1,5 @@ import pytest + import salt.ext.tornado.wsgi import salt.netapi.rest_cherrypy.app import tests.support.netapi as netapi diff --git a/tests/pytests/functional/netapi/rest_cherrypy/test_auth.py b/tests/pytests/functional/netapi/rest_cherrypy/test_auth.py index cab94086f95..ab58d70b5ed 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/test_auth.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/test_auth.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/functional/netapi/rest_cherrypy/test_auth_pam.py b/tests/pytests/functional/netapi/rest_cherrypy/test_auth_pam.py index 9b2e16d8a1d..f275b1510e3 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/test_auth_pam.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/test_auth_pam.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + from salt.ext.tornado.httpclient import HTTPError pytestmark = [ diff --git a/tests/pytests/functional/netapi/rest_cherrypy/test_cors.py b/tests/pytests/functional/netapi/rest_cherrypy/test_cors.py index 56c48185c00..67e1370172d 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/test_cors.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/test_cors.py @@ -1,4 +1,5 @@ import pytest + from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/functional/netapi/rest_cherrypy/test_external_auth_syntax.py b/tests/pytests/functional/netapi/rest_cherrypy/test_external_auth_syntax.py index 1972d53b948..30c5086a845 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/test_external_auth_syntax.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/test_external_auth_syntax.py @@ -2,6 +2,7 @@ import urllib.parse import attr import pytest + import salt.utils.json import salt.utils.yaml import tests.support.netapi as netapi diff --git a/tests/pytests/functional/netapi/rest_cherrypy/test_in_formats.py b/tests/pytests/functional/netapi/rest_cherrypy/test_in_formats.py index d01db4f320c..f3b32e3b6ff 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/test_in_formats.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/test_in_formats.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json import salt.utils.yaml from tests.support.mock import patch diff --git a/tests/pytests/functional/netapi/rest_cherrypy/test_out_formats.py b/tests/pytests/functional/netapi/rest_cherrypy/test_out_formats.py index 2dd58ebf002..444bced9be1 100644 --- a/tests/pytests/functional/netapi/rest_cherrypy/test_out_formats.py +++ b/tests/pytests/functional/netapi/rest_cherrypy/test_out_formats.py @@ -1,4 +1,5 @@ import pytest + from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/functional/netapi/rest_tornado/conftest.py b/tests/pytests/functional/netapi/rest_tornado/conftest.py index d15fefe0e49..c8525eb87c2 100644 --- a/tests/pytests/functional/netapi/rest_tornado/conftest.py +++ b/tests/pytests/functional/netapi/rest_tornado/conftest.py @@ -1,4 +1,5 @@ import pytest + import tests.support.netapi as netapi diff --git a/tests/pytests/functional/netapi/rest_tornado/test_auth_handler.py b/tests/pytests/functional/netapi/rest_tornado/test_auth_handler.py index 2edadd1599e..59046b84955 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_auth_handler.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_auth_handler.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json import salt.utils.yaml from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/functional/netapi/rest_tornado/test_auth_handler_pam.py b/tests/pytests/functional/netapi/rest_tornado/test_auth_handler_pam.py index 823fd1551bb..ffd9871339b 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_auth_handler_pam.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_auth_handler_pam.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json import salt.utils.yaml from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/functional/netapi/rest_tornado/test_base_api_handler.py b/tests/pytests/functional/netapi/rest_tornado/test_base_api_handler.py index 500e97d80f6..78ece2b3d59 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_base_api_handler.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_base_api_handler.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json import salt.utils.yaml from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py b/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py index fcaf0aaba87..0b1f7b62cdb 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_event_listener.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.event from salt.netapi.rest_tornado import saltnado from tests.support.events import eventpublisher_process diff --git a/tests/pytests/functional/netapi/rest_tornado/test_external_auth_syntax.py b/tests/pytests/functional/netapi/rest_tornado/test_external_auth_syntax.py index 0f96cc83e68..4bdd3279ed1 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_external_auth_syntax.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_external_auth_syntax.py @@ -2,6 +2,7 @@ import urllib.parse import attr import pytest + import salt.utils.json import salt.utils.yaml import tests.support.netapi as netapi diff --git a/tests/pytests/functional/netapi/rest_tornado/test_run_handler.py b/tests/pytests/functional/netapi/rest_tornado/test_run_handler.py index 00f17ef3f4f..69187c6b0bd 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_run_handler.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_run_handler.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.json from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/functional/netapi/rest_tornado/test_webhooks_handler.py b/tests/pytests/functional/netapi/rest_tornado/test_webhooks_handler.py index 2db7ae547ab..3b199b6e209 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_webhooks_handler.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_webhooks_handler.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json from salt.netapi.rest_tornado import saltnado from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/functional/netapi/rest_tornado/test_websockets_handler.py b/tests/pytests/functional/netapi/rest_tornado/test_websockets_handler.py index 33cc5eed965..130f68026ad 100644 --- a/tests/pytests/functional/netapi/rest_tornado/test_websockets_handler.py +++ b/tests/pytests/functional/netapi/rest_tornado/test_websockets_handler.py @@ -2,6 +2,7 @@ import hashlib import urllib.parse import pytest + import salt.netapi.rest_tornado as rest_tornado import salt.utils.json import salt.utils.yaml diff --git a/tests/pytests/functional/pillar/hg_pillar/test_hg_pillar.py b/tests/pytests/functional/pillar/hg_pillar/test_hg_pillar.py index 774b438d8e3..da26f982fdd 100644 --- a/tests/pytests/functional/pillar/hg_pillar/test_hg_pillar.py +++ b/tests/pytests/functional/pillar/hg_pillar/test_hg_pillar.py @@ -3,6 +3,7 @@ import tempfile from pathlib import Path import pytest + import salt.config import salt.pillar.hg_pillar as hg_pillar diff --git a/tests/pytests/functional/pillar/test_etcd_pillar.py b/tests/pytests/functional/pillar/test_etcd_pillar.py index d49e53be75e..ac4c931452e 100644 --- a/tests/pytests/functional/pillar/test_etcd_pillar.py +++ b/tests/pytests/functional/pillar/test_etcd_pillar.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.pillar.etcd_pillar as etcd_pillar from salt.utils.etcd_util import get_conn from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import diff --git a/tests/pytests/functional/pillar/test_gpg.py b/tests/pytests/functional/pillar/test_gpg.py index 47788788d21..2c7166795bb 100644 --- a/tests/pytests/functional/pillar/test_gpg.py +++ b/tests/pytests/functional/pillar/test_gpg.py @@ -6,9 +6,10 @@ import subprocess import textwrap import pytest +from pytestshellutils.utils.processes import ProcessResult + import salt.pillar import salt.utils.stringutils -from pytestshellutils.utils.processes import ProcessResult pytestmark = [ pytest.mark.skip_if_binaries_missing("gpg"), diff --git a/tests/pytests/functional/pillar/test_top.py b/tests/pytests/functional/pillar/test_top.py index 08fd4d1ec0d..65f82431433 100644 --- a/tests/pytests/functional/pillar/test_top.py +++ b/tests/pytests/functional/pillar/test_top.py @@ -1,4 +1,5 @@ import pytest + import salt.pillar pytestmark = [ diff --git a/tests/pytests/functional/returners/test_etcd_return.py b/tests/pytests/functional/returners/test_etcd_return.py index be2f838ac91..1bd4b03ff3c 100644 --- a/tests/pytests/functional/returners/test_etcd_return.py +++ b/tests/pytests/functional/returners/test_etcd_return.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.returners.etcd_return as etcd_return import salt.utils.json from salt.utils.etcd_util import get_conn diff --git a/tests/pytests/functional/runners/test_winrepo.py b/tests/pytests/functional/runners/test_winrepo.py index 2166c9d6ee6..892155a9752 100644 --- a/tests/pytests/functional/runners/test_winrepo.py +++ b/tests/pytests/functional/runners/test_winrepo.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.gitfs from salt.runners import winrepo from tests.support.mock import patch diff --git a/tests/pytests/functional/sdb/test_etcd_db.py b/tests/pytests/functional/sdb/test_etcd_db.py index b0f1e8af608..68a043c1dae 100644 --- a/tests/pytests/functional/sdb/test_etcd_db.py +++ b/tests/pytests/functional/sdb/test_etcd_db.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.sdb.etcd_db as etcd_db from salt.utils.etcd_util import get_conn from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import diff --git a/tests/pytests/functional/states/file/test__check_directory_win.py b/tests/pytests/functional/states/file/test__check_directory_win.py index 3c86e9b69ed..1ce94d06425 100644 --- a/tests/pytests/functional/states/file/test__check_directory_win.py +++ b/tests/pytests/functional/states/file/test__check_directory_win.py @@ -1,4 +1,5 @@ import pytest + import salt.states.file as file import salt.utils.win_dacl as win_dacl diff --git a/tests/pytests/functional/states/file/test_comment.py b/tests/pytests/functional/states/file/test_comment.py index de061b9acec..c62479ce5c7 100644 --- a/tests/pytests/functional/states/file/test_comment.py +++ b/tests/pytests/functional/states/file/test_comment.py @@ -4,6 +4,7 @@ Tests for file.comment state function import re import pytest + import salt.utils.files from tests.support.helpers import dedent diff --git a/tests/pytests/functional/states/file/test_directory_win.py b/tests/pytests/functional/states/file/test_directory_win.py index de8a92bb2fa..0b622be6ff0 100644 --- a/tests/pytests/functional/states/file/test_directory_win.py +++ b/tests/pytests/functional/states/file/test_directory_win.py @@ -1,6 +1,7 @@ import os import pytest + import salt.modules.win_file as win_file import salt.states.file as file import salt.utils.win_dacl as win_dacl diff --git a/tests/pytests/functional/states/file/test_rename.py b/tests/pytests/functional/states/file/test_rename.py index f73567edde1..ffffb76ec8a 100644 --- a/tests/pytests/functional/states/file/test_rename.py +++ b/tests/pytests/functional/states/file/test_rename.py @@ -4,6 +4,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 + import salt.utils.path pytestmark = [ diff --git a/tests/pytests/functional/states/pkgrepo/test_debian.py b/tests/pytests/functional/states/pkgrepo/test_debian.py index 9456a29edb7..12ab69ab6b2 100644 --- a/tests/pytests/functional/states/pkgrepo/test_debian.py +++ b/tests/pytests/functional/states/pkgrepo/test_debian.py @@ -8,6 +8,7 @@ import sys import _pytest._version import attr import pytest + import salt.utils.files from tests.conftest import CODE_DIR diff --git a/tests/pytests/functional/states/rabbitmq/test_cluster.py b/tests/pytests/functional/states/rabbitmq/test_cluster.py index 6313a1e839e..d05ad9a72d7 100644 --- a/tests/pytests/functional/states/rabbitmq/test_cluster.py +++ b/tests/pytests/functional/states/rabbitmq/test_cluster.py @@ -5,6 +5,7 @@ Integration tests for the rabbitmq_cluster states import logging import pytest + import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_cluster as rabbitmq_cluster diff --git a/tests/pytests/functional/states/rabbitmq/test_plugin.py b/tests/pytests/functional/states/rabbitmq/test_plugin.py index 06e8d76d8c5..320d24f02ef 100644 --- a/tests/pytests/functional/states/rabbitmq/test_plugin.py +++ b/tests/pytests/functional/states/rabbitmq/test_plugin.py @@ -5,6 +5,7 @@ Integration tests for the rabbitmq_plugin states import logging import pytest + import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_plugin as rabbitmq_plugin from tests.support.mock import patch diff --git a/tests/pytests/functional/states/rabbitmq/test_policy.py b/tests/pytests/functional/states/rabbitmq/test_policy.py index 4ccded9cd9e..d596e55b679 100644 --- a/tests/pytests/functional/states/rabbitmq/test_policy.py +++ b/tests/pytests/functional/states/rabbitmq/test_policy.py @@ -5,6 +5,7 @@ Integration tests for the rabbitmq_policy states import logging import pytest + import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_policy as rabbitmq_policy from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/functional/states/rabbitmq/test_upstream.py b/tests/pytests/functional/states/rabbitmq/test_upstream.py index ba2ec73ef5f..c8b4b0f627f 100644 --- a/tests/pytests/functional/states/rabbitmq/test_upstream.py +++ b/tests/pytests/functional/states/rabbitmq/test_upstream.py @@ -5,6 +5,7 @@ Integration tests for the rabbitmq_user states import logging import pytest + import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_upstream as rabbitmq_upstream diff --git a/tests/pytests/functional/states/rabbitmq/test_user.py b/tests/pytests/functional/states/rabbitmq/test_user.py index 2478c9c559b..5b283536a85 100644 --- a/tests/pytests/functional/states/rabbitmq/test_user.py +++ b/tests/pytests/functional/states/rabbitmq/test_user.py @@ -5,6 +5,7 @@ Integration tests for the rabbitmq_user states import logging import pytest + import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_user as rabbitmq_user diff --git a/tests/pytests/functional/states/rabbitmq/test_vhost.py b/tests/pytests/functional/states/rabbitmq/test_vhost.py index c466fa5a8ee..ae9d369aaa8 100644 --- a/tests/pytests/functional/states/rabbitmq/test_vhost.py +++ b/tests/pytests/functional/states/rabbitmq/test_vhost.py @@ -5,6 +5,7 @@ Integration tests for the rabbitmq_user states import logging import pytest + import salt.modules.rabbitmq as rabbitmq import salt.states.rabbitmq_vhost as rabbitmq_vhost diff --git a/tests/pytests/functional/states/test_archive.py b/tests/pytests/functional/states/test_archive.py index 813f2e7b6d0..b3bb6c0fc9a 100644 --- a/tests/pytests/functional/states/test_archive.py +++ b/tests/pytests/functional/states/test_archive.py @@ -10,6 +10,7 @@ import sys from contextlib import closing import pytest + import salt.utils.files diff --git a/tests/pytests/functional/states/test_docker_container.py b/tests/pytests/functional/states/test_docker_container.py index 5f5eb327158..2267399891e 100644 --- a/tests/pytests/functional/states/test_docker_container.py +++ b/tests/pytests/functional/states/test_docker_container.py @@ -10,13 +10,14 @@ import subprocess import attr import pytest +from saltfactories.utils import random_string + import salt.utils.files import salt.utils.network import salt.utils.path from salt._compat import ipaddress from salt.exceptions import CommandExecutionError from salt.modules.config import DEFAULTS as _config_defaults -from saltfactories.utils import random_string from tests.support.runtests import RUNTIME_VARS log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/states/test_etcd_mod.py b/tests/pytests/functional/states/test_etcd_mod.py index d28a5226067..73c19d4303c 100644 --- a/tests/pytests/functional/states/test_etcd_mod.py +++ b/tests/pytests/functional/states/test_etcd_mod.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.modules.etcd_mod as etcd_mod import salt.states.etcd_mod as etcd_state from salt.utils.etcd_util import get_conn diff --git a/tests/pytests/functional/states/test_file.py b/tests/pytests/functional/states/test_file.py index 8b8fc479a69..a3ad275e141 100644 --- a/tests/pytests/functional/states/test_file.py +++ b/tests/pytests/functional/states/test_file.py @@ -10,6 +10,7 @@ import sys from contextlib import closing import pytest + import salt.utils.files diff --git a/tests/pytests/functional/states/test_module.py b/tests/pytests/functional/states/test_module.py index b93950c8b5f..d4caca2bc3a 100644 --- a/tests/pytests/functional/states/test_module.py +++ b/tests/pytests/functional/states/test_module.py @@ -1,6 +1,7 @@ import logging import pytest + from tests.support.helpers import dedent log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/states/test_mysql.py b/tests/pytests/functional/states/test_mysql.py index 900b53fc55b..ba717a99d15 100644 --- a/tests/pytests/functional/states/test_mysql.py +++ b/tests/pytests/functional/states/test_mysql.py @@ -5,9 +5,10 @@ import logging import time import pytest -import salt.modules.mysql as mysqlmod from pytestshellutils.utils import format_callback_to_string from saltfactories.utils.functional import StateResult + +import salt.modules.mysql as mysqlmod from tests.support.pytest.mysql import * # pylint: disable=wildcard-import,unused-wildcard-import log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/states/test_npm.py b/tests/pytests/functional/states/test_npm.py index 59165ad41b8..bd6a042169d 100644 --- a/tests/pytests/functional/states/test_npm.py +++ b/tests/pytests/functional/states/test_npm.py @@ -1,4 +1,5 @@ import pytest + from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/functional/states/test_pip_state.py b/tests/pytests/functional/states/test_pip_state.py index 751ac5a63da..3fc6ac7a1df 100644 --- a/tests/pytests/functional/states/test_pip_state.py +++ b/tests/pytests/functional/states/test_pip_state.py @@ -6,6 +6,7 @@ import shutil import sys import pytest + import salt.utils.files import salt.utils.path import salt.utils.platform diff --git a/tests/pytests/functional/states/test_pkg.py b/tests/pytests/functional/states/test_pkg.py index 6a49ec1f095..aa9a9307046 100644 --- a/tests/pytests/functional/states/test_pkg.py +++ b/tests/pytests/functional/states/test_pkg.py @@ -7,6 +7,7 @@ import os import time import pytest + import salt.utils.files import salt.utils.path import salt.utils.pkg.rpm diff --git a/tests/pytests/functional/states/test_pkgrepo.py b/tests/pytests/functional/states/test_pkgrepo.py index 82a6f093983..cee5870d8b2 100644 --- a/tests/pytests/functional/states/test_pkgrepo.py +++ b/tests/pytests/functional/states/test_pkgrepo.py @@ -1,6 +1,7 @@ import platform import pytest + import salt.utils.files diff --git a/tests/pytests/functional/states/test_reg.py b/tests/pytests/functional/states/test_reg.py index 70cbca69d84..10a4d155aa6 100644 --- a/tests/pytests/functional/states/test_reg.py +++ b/tests/pytests/functional/states/test_reg.py @@ -1,4 +1,5 @@ import pytest + from tests.support.mock import patch try: diff --git a/tests/pytests/functional/states/test_svn.py b/tests/pytests/functional/states/test_svn.py index eac7e2bdc20..5ad09ad37e2 100644 --- a/tests/pytests/functional/states/test_svn.py +++ b/tests/pytests/functional/states/test_svn.py @@ -4,6 +4,7 @@ Tests for the SVN state import logging import pytest + import salt.utils.platform from tests.support.helpers import SKIP_INITIAL_PHOTONOS_FAILURES diff --git a/tests/pytests/functional/states/test_user.py b/tests/pytests/functional/states/test_user.py index e0d01773b54..df7001221f0 100644 --- a/tests/pytests/functional/states/test_user.py +++ b/tests/pytests/functional/states/test_user.py @@ -10,9 +10,10 @@ import shutil import sys import pytest +from saltfactories.utils import random_string + import salt.utils.files import salt.utils.platform -from saltfactories.utils import random_string try: import grp diff --git a/tests/pytests/functional/states/test_virtualenv_mod.py b/tests/pytests/functional/states/test_virtualenv_mod.py index 18b35db66b9..21ac5baaa3a 100644 --- a/tests/pytests/functional/states/test_virtualenv_mod.py +++ b/tests/pytests/functional/states/test_virtualenv_mod.py @@ -1,6 +1,7 @@ import logging import pytest + from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES from tests.support.helpers import SKIP_INITIAL_PHOTONOS_FAILURES diff --git a/tests/pytests/functional/states/test_win_certutil.py b/tests/pytests/functional/states/test_win_certutil.py index 1c3e71189d4..92d238b3f4a 100644 --- a/tests/pytests/functional/states/test_win_certutil.py +++ b/tests/pytests/functional/states/test_win_certutil.py @@ -2,6 +2,7 @@ Tests for win_certutil state module """ import pytest + import salt.utils.files pytestmark = [ diff --git a/tests/pytests/functional/states/win_lgpo/test_adv_audit_settings_state.py b/tests/pytests/functional/states/win_lgpo/test_adv_audit_settings_state.py index d5bd3bbbff0..c4c677ee3ce 100644 --- a/tests/pytests/functional/states/win_lgpo/test_adv_audit_settings_state.py +++ b/tests/pytests/functional/states/win_lgpo/test_adv_audit_settings_state.py @@ -1,4 +1,5 @@ import pytest + import salt.loader import salt.modules.win_lgpo as win_lgpo_module import salt.states.win_lgpo as win_lgpo_state diff --git a/tests/pytests/functional/states/win_lgpo/test_audit_settings_state.py b/tests/pytests/functional/states/win_lgpo/test_audit_settings_state.py index 3b57ca0f882..725081545a5 100644 --- a/tests/pytests/functional/states/win_lgpo/test_audit_settings_state.py +++ b/tests/pytests/functional/states/win_lgpo/test_audit_settings_state.py @@ -1,6 +1,7 @@ import os import pytest + import salt.loader import salt.modules.win_lgpo as win_lgpo_module import salt.states.win_lgpo as win_lgpo_state diff --git a/tests/pytests/functional/states/win_lgpo/test_rights_assignment.py b/tests/pytests/functional/states/win_lgpo/test_rights_assignment.py index 9437ac84a7d..3d16a8bcb70 100644 --- a/tests/pytests/functional/states/win_lgpo/test_rights_assignment.py +++ b/tests/pytests/functional/states/win_lgpo/test_rights_assignment.py @@ -1,4 +1,5 @@ import pytest + import salt.loader import salt.modules.win_lgpo as win_lgpo_module import salt.states.win_lgpo as win_lgpo_state diff --git a/tests/pytests/functional/test_payload.py b/tests/pytests/functional/test_payload.py index ec5f66bdf67..9b5e7973304 100644 --- a/tests/pytests/functional/test_payload.py +++ b/tests/pytests/functional/test_payload.py @@ -4,9 +4,10 @@ import threading import time import pytest +import zmq + import salt.exceptions import salt.payload -import zmq log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/test_version.py b/tests/pytests/functional/test_version.py index 178e9b39aa6..dfa8850557e 100644 --- a/tests/pytests/functional/test_version.py +++ b/tests/pytests/functional/test_version.py @@ -2,6 +2,7 @@ import json import logging import pytest + from tests.support.helpers import SaltVirtualEnv from tests.support.pytest.helpers import FakeSaltExtension diff --git a/tests/pytests/functional/transport/conftest.py b/tests/pytests/functional/transport/conftest.py index 399f18d7f9f..62e53c27fb4 100644 --- a/tests/pytests/functional/transport/conftest.py +++ b/tests/pytests/functional/transport/conftest.py @@ -2,6 +2,7 @@ import ctypes import multiprocessing import pytest + import salt.crypt import salt.master import salt.utils.stringutils diff --git a/tests/pytests/functional/transport/ipc/test_client.py b/tests/pytests/functional/transport/ipc/test_client.py index 59068ce6bc9..69d7e84a897 100644 --- a/tests/pytests/functional/transport/ipc/test_client.py +++ b/tests/pytests/functional/transport/ipc/test_client.py @@ -3,6 +3,7 @@ import sys import attr import pytest + import salt.transport.ipc import salt.utils.platform from salt.ext.tornado import locks diff --git a/tests/pytests/functional/transport/ipc/test_subscriber.py b/tests/pytests/functional/transport/ipc/test_subscriber.py index f6a278fedcf..6a442127223 100644 --- a/tests/pytests/functional/transport/ipc/test_subscriber.py +++ b/tests/pytests/functional/transport/ipc/test_subscriber.py @@ -3,6 +3,7 @@ import sys import attr import pytest + import salt.channel.server import salt.ext.tornado.gen import salt.transport.ipc diff --git a/tests/pytests/functional/transport/server/test_req_channel.py b/tests/pytests/functional/transport/server/test_req_channel.py index 685b02b9dc0..7c2cfdc3cd1 100644 --- a/tests/pytests/functional/transport/server/test_req_channel.py +++ b/tests/pytests/functional/transport/server/test_req_channel.py @@ -3,6 +3,8 @@ import logging import multiprocessing import pytest +from pytestshellutils.utils.processes import terminate_process + import salt.channel.client import salt.channel.server import salt.config @@ -15,7 +17,6 @@ import salt.transport.server import salt.utils.platform import salt.utils.process import salt.utils.stringutils -from pytestshellutils.utils.processes import terminate_process log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/transport/tcp/test_message_client.py b/tests/pytests/functional/transport/tcp/test_message_client.py index 0dfdcc128d6..292f389000d 100644 --- a/tests/pytests/functional/transport/tcp/test_message_client.py +++ b/tests/pytests/functional/transport/tcp/test_message_client.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.ext.tornado.gen import salt.ext.tornado.iostream import salt.ext.tornado.tcpserver diff --git a/tests/pytests/functional/transport/zeromq/test_pub_server_channel.py b/tests/pytests/functional/transport/zeromq/test_pub_server_channel.py index d72f87755f5..57164b6afd4 100644 --- a/tests/pytests/functional/transport/zeromq/test_pub_server_channel.py +++ b/tests/pytests/functional/transport/zeromq/test_pub_server_channel.py @@ -6,6 +6,9 @@ import time from concurrent.futures.thread import ThreadPoolExecutor import pytest +import zmq +from pytestshellutils.utils.processes import terminate_process + import salt.channel.client import salt.channel.server import salt.config @@ -22,8 +25,6 @@ import salt.utils.msgpack import salt.utils.platform import salt.utils.process import salt.utils.stringutils -import zmq -from pytestshellutils.utils.processes import terminate_process from tests.support.mock import MagicMock, patch log = logging.getLogger(__name__) diff --git a/tests/pytests/functional/utils/functools/test_namespaced_function.py b/tests/pytests/functional/utils/functools/test_namespaced_function.py index 1366916ed99..a97a32706a0 100644 --- a/tests/pytests/functional/utils/functools/test_namespaced_function.py +++ b/tests/pytests/functional/utils/functools/test_namespaced_function.py @@ -3,6 +3,7 @@ import sys import warnings import pytest + from salt.utils.functools import namespaced_function from tests.conftest import CODE_DIR diff --git a/tests/pytests/functional/utils/pyinstaller/rthooks/test_salt_utils_vt_terminal.py b/tests/pytests/functional/utils/pyinstaller/rthooks/test_salt_utils_vt_terminal.py index 03e1ec3374d..791b149494d 100644 --- a/tests/pytests/functional/utils/pyinstaller/rthooks/test_salt_utils_vt_terminal.py +++ b/tests/pytests/functional/utils/pyinstaller/rthooks/test_salt_utils_vt_terminal.py @@ -3,6 +3,7 @@ import os import sys import pytest + import salt.utils.pyinstaller.rthooks._overrides as overrides from tests.support import mock from tests.support.helpers import PatchedEnviron diff --git a/tests/pytests/functional/utils/pyinstaller/rthooks/test_subprocess.py b/tests/pytests/functional/utils/pyinstaller/rthooks/test_subprocess.py index 5c7b33b14fb..c709de65b65 100644 --- a/tests/pytests/functional/utils/pyinstaller/rthooks/test_subprocess.py +++ b/tests/pytests/functional/utils/pyinstaller/rthooks/test_subprocess.py @@ -4,6 +4,7 @@ import subprocess import sys import pytest + import salt.utils.pyinstaller.rthooks._overrides as overrides from tests.support import mock from tests.support.helpers import PatchedEnviron diff --git a/tests/pytests/functional/utils/test_async_event_publisher.py b/tests/pytests/functional/utils/test_async_event_publisher.py index eac901536f6..aa773b452ab 100644 --- a/tests/pytests/functional/utils/test_async_event_publisher.py +++ b/tests/pytests/functional/utils/test_async_event_publisher.py @@ -1,9 +1,10 @@ import pytest +import zmq + import salt.config import salt.ext.tornado.ioloop import salt.utils.event import salt.utils.stringutils -import zmq NO_LONG_IPC = False if getattr(zmq, "IPC_PATH_MAX_LEN", 103) <= 103: diff --git a/tests/pytests/functional/utils/test_etcd_util.py b/tests/pytests/functional/utils/test_etcd_util.py index 893828d8a31..2bd7e9809c8 100644 --- a/tests/pytests/functional/utils/test_etcd_util.py +++ b/tests/pytests/functional/utils/test_etcd_util.py @@ -4,6 +4,7 @@ import threading import time import pytest + from salt.utils.etcd_util import EtcdClient, EtcdClientV3, get_conn from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import diff --git a/tests/pytests/functional/utils/test_jinja.py b/tests/pytests/functional/utils/test_jinja.py index e79f6e8ae37..98070c9909b 100644 --- a/tests/pytests/functional/utils/test_jinja.py +++ b/tests/pytests/functional/utils/test_jinja.py @@ -1,6 +1,7 @@ import pytest -import salt.utils.jinja from jinja2.exceptions import TemplateNotFound + +import salt.utils.jinja from salt.utils.odict import OrderedDict diff --git a/tests/pytests/functional/utils/test_process.py b/tests/pytests/functional/utils/test_process.py index 16cb5ee69a4..6c420b95f48 100644 --- a/tests/pytests/functional/utils/test_process.py +++ b/tests/pytests/functional/utils/test_process.py @@ -5,6 +5,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/user/test_chugid_and_umask.py b/tests/pytests/functional/utils/user/test_chugid_and_umask.py index 2fcb79e125c..660a37d651f 100644 --- a/tests/pytests/functional/utils/user/test_chugid_and_umask.py +++ b/tests/pytests/functional/utils/user/test_chugid_and_umask.py @@ -5,6 +5,7 @@ import subprocess import tempfile import pytest + import salt.utils.user pytestmark = [ diff --git a/tests/pytests/functional/utils/win_dacl/test_file.py b/tests/pytests/functional/utils/win_dacl/test_file.py index 6aeb82fd985..bb6bd123869 100644 --- a/tests/pytests/functional/utils/win_dacl/test_file.py +++ b/tests/pytests/functional/utils/win_dacl/test_file.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.win_dacl as win_dacl from tests.support.mock import patch 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 e39724e5f10..8ea5d7614e4 100644 --- a/tests/pytests/functional/utils/win_dacl/test_get_name.py +++ b/tests/pytests/functional/utils/win_dacl/test_get_name.py @@ -5,6 +5,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 import salt.utils.win_dacl 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 0174f80f0ed..e2e09f6dea6 100644 --- a/tests/pytests/functional/utils/win_dacl/test_get_sid.py +++ b/tests/pytests/functional/utils/win_dacl/test_get_sid.py @@ -5,6 +5,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 # Third-party libs 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 54258886bea..adde42501ae 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 @@ -5,6 +5,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 # Third-party libs diff --git a/tests/pytests/functional/utils/win_dacl/test_reg.py b/tests/pytests/functional/utils/win_dacl/test_reg.py index b2d56713f1a..af6de169e6c 100644 --- a/tests/pytests/functional/utils/win_dacl/test_reg.py +++ b/tests/pytests/functional/utils/win_dacl/test_reg.py @@ -1,7 +1,8 @@ import pytest +from saltfactories.utils import random_string + import salt.utils.win_dacl as win_dacl import salt.utils.win_reg as win_reg -from saltfactories.utils import random_string from tests.support.mock import patch pytestmark = [ diff --git a/tests/pytests/functional/utils/yamllint/test_yamllint.py b/tests/pytests/functional/utils/yamllint/test_yamllint.py index 7d410916a97..c0debe9328a 100644 --- a/tests/pytests/functional/utils/yamllint/test_yamllint.py +++ b/tests/pytests/functional/utils/yamllint/test_yamllint.py @@ -1,6 +1,7 @@ from pathlib import Path import pytest + import salt.utils.versions as versions try: diff --git a/tests/pytests/integration/_logging/test_multiple_processes_logging.py b/tests/pytests/integration/_logging/test_multiple_processes_logging.py index ea7cb4c9109..5df6f1323a0 100644 --- a/tests/pytests/integration/_logging/test_multiple_processes_logging.py +++ b/tests/pytests/integration/_logging/test_multiple_processes_logging.py @@ -3,10 +3,11 @@ import time from types import SimpleNamespace import pytest -import salt.utils.platform from _pytest.pytester import LineMatcher from saltfactories.utils import random_string +import salt.utils.platform + @pytest.fixture(scope="module") def logging_master(salt_factories): diff --git a/tests/pytests/integration/cli/test_batch.py b/tests/pytests/integration/cli/test_batch.py index 7eba1de2fdf..230aa6d5cbb 100644 --- a/tests/pytests/integration/cli/test_batch.py +++ b/tests/pytests/integration/cli/test_batch.py @@ -3,6 +3,7 @@ """ import pytest + import salt.utils.platform pytestmark = [ diff --git a/tests/pytests/integration/cli/test_matcher.py b/tests/pytests/integration/cli/test_matcher.py index 08c500f24c8..2e3f3ad996d 100644 --- a/tests/pytests/integration/cli/test_matcher.py +++ b/tests/pytests/integration/cli/test_matcher.py @@ -1,6 +1,7 @@ import pathlib import pytest + import salt.defaults.exitcodes pytestmark = [ diff --git a/tests/pytests/integration/cli/test_salt.py b/tests/pytests/integration/cli/test_salt.py index 8459b611bf4..1668c145293 100644 --- a/tests/pytests/integration/cli/test_salt.py +++ b/tests/pytests/integration/cli/test_salt.py @@ -11,9 +11,10 @@ import tempfile import time import pytest +from pytestshellutils.utils.processes import ProcessResult, terminate_process + import salt.defaults.exitcodes import salt.utils.path -from pytestshellutils.utils.processes import ProcessResult, terminate_process log = logging.getLogger(__name__) diff --git a/tests/pytests/integration/cli/test_salt_call.py b/tests/pytests/integration/cli/test_salt_call.py index f0f1631187c..a1fba598541 100644 --- a/tests/pytests/integration/cli/test_salt_call.py +++ b/tests/pytests/integration/cli/test_salt_call.py @@ -6,6 +6,7 @@ import re import sys import pytest + import salt.defaults.exitcodes import salt.utils.files import salt.utils.json diff --git a/tests/pytests/integration/cli/test_salt_cp.py b/tests/pytests/integration/cli/test_salt_cp.py index 2c315d7de78..ebc6afc9233 100644 --- a/tests/pytests/integration/cli/test_salt_cp.py +++ b/tests/pytests/integration/cli/test_salt_cp.py @@ -9,6 +9,7 @@ import os import pathlib import pytest + import salt.utils.files from tests.support.runtests import RUNTIME_VARS diff --git a/tests/pytests/integration/cli/test_salt_deltaproxy.py b/tests/pytests/integration/cli/test_salt_deltaproxy.py index e12ffb48dbc..61823fb6bcd 100644 --- a/tests/pytests/integration/cli/test_salt_deltaproxy.py +++ b/tests/pytests/integration/cli/test_salt_deltaproxy.py @@ -6,9 +6,10 @@ import logging import os import pytest -import salt.defaults.exitcodes from pytestshellutils.exceptions import FactoryNotStarted from saltfactories.utils import random_string + +import salt.defaults.exitcodes from tests.support.helpers import PRE_PYTEST_SKIP_REASON log = logging.getLogger(__name__) diff --git a/tests/pytests/integration/cli/test_salt_key.py b/tests/pytests/integration/cli/test_salt_key.py index 5c01ee7b0e6..c4bd5cce16b 100644 --- a/tests/pytests/integration/cli/test_salt_key.py +++ b/tests/pytests/integration/cli/test_salt_key.py @@ -4,11 +4,12 @@ import re import textwrap import pytest +from saltfactories.utils import random_string + import salt.utils.files import salt.utils.platform import salt.utils.pycrypto import salt.utils.yaml -from saltfactories.utils import random_string pytestmark = [ pytest.mark.slow_test, diff --git a/tests/pytests/integration/cli/test_salt_master.py b/tests/pytests/integration/cli/test_salt_master.py index ec3c9d0b496..6db26d0fdae 100644 --- a/tests/pytests/integration/cli/test_salt_master.py +++ b/tests/pytests/integration/cli/test_salt_master.py @@ -2,8 +2,9 @@ import logging import time import pytest -import salt.defaults.exitcodes from saltfactories.utils import random_string + +import salt.defaults.exitcodes from tests.support.helpers import PRE_PYTEST_SKIP_REASON pytestmark = [ diff --git a/tests/pytests/integration/cli/test_salt_minion.py b/tests/pytests/integration/cli/test_salt_minion.py index 80ea44d607d..675ba31014c 100644 --- a/tests/pytests/integration/cli/test_salt_minion.py +++ b/tests/pytests/integration/cli/test_salt_minion.py @@ -2,9 +2,10 @@ import logging import os import pytest -import salt.defaults.exitcodes from pytestshellutils.exceptions import FactoryNotStarted from saltfactories.utils import random_string + +import salt.defaults.exitcodes from tests.support.helpers import PRE_PYTEST_SKIP_REASON pytestmark = [ diff --git a/tests/pytests/integration/cli/test_salt_proxy.py b/tests/pytests/integration/cli/test_salt_proxy.py index 6ac886db46b..568b706d7ef 100644 --- a/tests/pytests/integration/cli/test_salt_proxy.py +++ b/tests/pytests/integration/cli/test_salt_proxy.py @@ -5,9 +5,10 @@ import logging import pytest -import salt.defaults.exitcodes from pytestshellutils.exceptions import FactoryNotStarted from saltfactories.utils import random_string + +import salt.defaults.exitcodes from tests.support.helpers import PRE_PYTEST_SKIP_REASON log = logging.getLogger(__name__) diff --git a/tests/pytests/integration/cli/test_salt_run.py b/tests/pytests/integration/cli/test_salt_run.py index a20fdbd9a1e..7581927a3a6 100644 --- a/tests/pytests/integration/cli/test_salt_run.py +++ b/tests/pytests/integration/cli/test_salt_run.py @@ -1,6 +1,7 @@ import re import pytest + import salt.defaults.exitcodes import salt.utils.files import salt.utils.platform diff --git a/tests/pytests/integration/cli/test_salt_syndic.py b/tests/pytests/integration/cli/test_salt_syndic.py index cd5fab30083..e6cd12a9a7d 100644 --- a/tests/pytests/integration/cli/test_salt_syndic.py +++ b/tests/pytests/integration/cli/test_salt_syndic.py @@ -3,9 +3,10 @@ import os import time import pytest -import salt.defaults.exitcodes from pytestshellutils.exceptions import FactoryNotStarted from saltfactories.utils import random_string + +import salt.defaults.exitcodes from tests.support.helpers import PRE_PYTEST_SKIP, PRE_PYTEST_SKIP_REASON pytestmark = [ diff --git a/tests/pytests/integration/client/conftest.py b/tests/pytests/integration/client/conftest.py index a9718018a2f..b6f42b734a4 100644 --- a/tests/pytests/integration/client/conftest.py +++ b/tests/pytests/integration/client/conftest.py @@ -1,4 +1,5 @@ import pytest + import salt.config import salt.wheel diff --git a/tests/pytests/integration/client/test_runner.py b/tests/pytests/integration/client/test_runner.py index 946bdc01889..3303277da81 100644 --- a/tests/pytests/integration/client/test_runner.py +++ b/tests/pytests/integration/client/test_runner.py @@ -1,4 +1,5 @@ import pytest + import salt.auth import salt.runner diff --git a/tests/pytests/integration/master/test_clear_funcs.py b/tests/pytests/integration/master/test_clear_funcs.py index ef484dac34d..e235864d088 100644 --- a/tests/pytests/integration/master/test_clear_funcs.py +++ b/tests/pytests/integration/master/test_clear_funcs.py @@ -5,6 +5,7 @@ import time import attr import pytest + import salt.channel.client import salt.config import salt.master diff --git a/tests/pytests/integration/modules/grains/conftest.py b/tests/pytests/integration/modules/grains/conftest.py index 0afb20da9b4..bcca957218d 100644 --- a/tests/pytests/integration/modules/grains/conftest.py +++ b/tests/pytests/integration/modules/grains/conftest.py @@ -1,5 +1,6 @@ import attr import pytest + import salt.defaults.events diff --git a/tests/pytests/integration/modules/saltutil/test_pillar.py b/tests/pytests/integration/modules/saltutil/test_pillar.py index 9200f1965f7..7eb51605604 100644 --- a/tests/pytests/integration/modules/saltutil/test_pillar.py +++ b/tests/pytests/integration/modules/saltutil/test_pillar.py @@ -7,6 +7,7 @@ import logging import time import pytest + import salt.defaults.events log = logging.getLogger(__name__) diff --git a/tests/pytests/integration/modules/state/test_state.py b/tests/pytests/integration/modules/state/test_state.py index 8494e124ca8..ad32efa68b8 100644 --- a/tests/pytests/integration/modules/state/test_state.py +++ b/tests/pytests/integration/modules/state/test_state.py @@ -3,9 +3,10 @@ import os import zipfile import pytest +from saltfactories.utils.functional import MultiStateResult + import salt.utils.files import salt.utils.stringutils -from saltfactories.utils.functional import MultiStateResult from tests.support.runtests import RUNTIME_VARS diff --git a/tests/pytests/integration/modules/state/test_state_test.py b/tests/pytests/integration/modules/state/test_state_test.py index b611139053d..40049e9a6b6 100644 --- a/tests/pytests/integration/modules/state/test_state_test.py +++ b/tests/pytests/integration/modules/state/test_state_test.py @@ -1,6 +1,7 @@ import pathlib import pytest + from tests.support.runtests import RUNTIME_VARS pytestmark = [ diff --git a/tests/pytests/integration/modules/test_beacons.py b/tests/pytests/integration/modules/test_beacons.py index 01b6f201e62..fb43f66468f 100644 --- a/tests/pytests/integration/modules/test_beacons.py +++ b/tests/pytests/integration/modules/test_beacons.py @@ -6,6 +6,7 @@ import shutil import attr import pytest + from tests.support.helpers import PRE_PYTEST_SKIP_OR_NOT pytestmark = [ diff --git a/tests/pytests/integration/modules/test_idem.py b/tests/pytests/integration/modules/test_idem.py index 9ef9854b43a..90e319cab0d 100644 --- a/tests/pytests/integration/modules/test_idem.py +++ b/tests/pytests/integration/modules/test_idem.py @@ -4,6 +4,7 @@ Integration tests for the idem execution module from contextlib import contextmanager import pytest + import salt.utils.idem as idem import salt.utils.path diff --git a/tests/pytests/integration/modules/test_rpmbuild_pkgbuild.py b/tests/pytests/integration/modules/test_rpmbuild_pkgbuild.py index b2efbbb74a3..e4bc54b56e5 100644 --- a/tests/pytests/integration/modules/test_rpmbuild_pkgbuild.py +++ b/tests/pytests/integration/modules/test_rpmbuild_pkgbuild.py @@ -10,6 +10,7 @@ import subprocess import textwrap import pytest + from tests.support.runtests import RUNTIME_VARS GPG_TEST_PRIV_KEY = """-----BEGIN PGP PRIVATE KEY BLOCK----- diff --git a/tests/pytests/integration/modules/test_virt.py b/tests/pytests/integration/modules/test_virt.py index 82d99f7c28e..39d836b13a3 100644 --- a/tests/pytests/integration/modules/test_virt.py +++ b/tests/pytests/integration/modules/test_virt.py @@ -6,6 +6,7 @@ from numbers import Number from xml.etree import ElementTree import pytest + from tests.support.virt import SaltVirtMinionContainerFactory docker = pytest.importorskip("docker") diff --git a/tests/pytests/integration/netapi/conftest.py b/tests/pytests/integration/netapi/conftest.py index 78566a74b26..3ac028b9c1c 100644 --- a/tests/pytests/integration/netapi/conftest.py +++ b/tests/pytests/integration/netapi/conftest.py @@ -1,7 +1,8 @@ import pytest +from pytestshellutils.utils.ports import get_unused_localhost_port + import salt.config import tests.support.netapi as netapi -from pytestshellutils.utils.ports import get_unused_localhost_port @pytest.fixture diff --git a/tests/pytests/integration/netapi/rest_cherrypy/conftest.py b/tests/pytests/integration/netapi/rest_cherrypy/conftest.py index 603d35d315a..2394de2c148 100644 --- a/tests/pytests/integration/netapi/rest_cherrypy/conftest.py +++ b/tests/pytests/integration/netapi/rest_cherrypy/conftest.py @@ -1,4 +1,5 @@ import pytest + import salt.ext.tornado.wsgi import salt.netapi.rest_cherrypy.app import tests.support.netapi as netapi diff --git a/tests/pytests/integration/netapi/rest_cherrypy/test_arg_kwarg.py b/tests/pytests/integration/netapi/rest_cherrypy/test_arg_kwarg.py index 1b8b2e0bd9f..8296f6907ca 100644 --- a/tests/pytests/integration/netapi/rest_cherrypy/test_arg_kwarg.py +++ b/tests/pytests/integration/netapi/rest_cherrypy/test_arg_kwarg.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json diff --git a/tests/pytests/integration/netapi/rest_cherrypy/test_auth.py b/tests/pytests/integration/netapi/rest_cherrypy/test_auth.py index cab94086f95..ab58d70b5ed 100644 --- a/tests/pytests/integration/netapi/rest_cherrypy/test_auth.py +++ b/tests/pytests/integration/netapi/rest_cherrypy/test_auth.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + import salt.utils.json from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/integration/netapi/rest_cherrypy/test_jobs.py b/tests/pytests/integration/netapi/rest_cherrypy/test_jobs.py index 7ec804d0794..62981814522 100644 --- a/tests/pytests/integration/netapi/rest_cherrypy/test_jobs.py +++ b/tests/pytests/integration/netapi/rest_cherrypy/test_jobs.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.json diff --git a/tests/pytests/integration/netapi/rest_cherrypy/test_run.py b/tests/pytests/integration/netapi/rest_cherrypy/test_run.py index 6fd4ad21ce0..5e23b55a474 100644 --- a/tests/pytests/integration/netapi/rest_cherrypy/test_run.py +++ b/tests/pytests/integration/netapi/rest_cherrypy/test_run.py @@ -1,6 +1,7 @@ import urllib.parse import pytest + from salt.ext.tornado.httpclient import HTTPError diff --git a/tests/pytests/integration/netapi/rest_tornado/conftest.py b/tests/pytests/integration/netapi/rest_tornado/conftest.py index b532afa92ef..2a190542b5a 100644 --- a/tests/pytests/integration/netapi/rest_tornado/conftest.py +++ b/tests/pytests/integration/netapi/rest_tornado/conftest.py @@ -1,4 +1,5 @@ import pytest + import tests.support.netapi as netapi from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/integration/netapi/rest_tornado/test_events_api_handler.py b/tests/pytests/integration/netapi/rest_tornado/test_events_api_handler.py index a5d87886af9..188e4603492 100644 --- a/tests/pytests/integration/netapi/rest_tornado/test_events_api_handler.py +++ b/tests/pytests/integration/netapi/rest_tornado/test_events_api_handler.py @@ -1,6 +1,7 @@ from functools import partial import pytest + import salt.ext.tornado.gen from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/integration/netapi/rest_tornado/test_jobs_api_handler.py b/tests/pytests/integration/netapi/rest_tornado/test_jobs_api_handler.py index fc71abb634a..80cc53453f2 100644 --- a/tests/pytests/integration/netapi/rest_tornado/test_jobs_api_handler.py +++ b/tests/pytests/integration/netapi/rest_tornado/test_jobs_api_handler.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.json from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/integration/netapi/rest_tornado/test_minions_api_handler.py b/tests/pytests/integration/netapi/rest_tornado/test_minions_api_handler.py index a2e4b97118a..b2c8c4d08a2 100644 --- a/tests/pytests/integration/netapi/rest_tornado/test_minions_api_handler.py +++ b/tests/pytests/integration/netapi/rest_tornado/test_minions_api_handler.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.json from salt.ext.tornado.httpclient import HTTPError from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/integration/netapi/rest_tornado/test_root_handler.py b/tests/pytests/integration/netapi/rest_tornado/test_root_handler.py index 3f8aeef6e2e..9dd4cbd6aab 100644 --- a/tests/pytests/integration/netapi/rest_tornado/test_root_handler.py +++ b/tests/pytests/integration/netapi/rest_tornado/test_root_handler.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.json from salt.ext.tornado.httpclient import HTTPError from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/integration/netapi/rest_tornado/test_run_api_handler.py b/tests/pytests/integration/netapi/rest_tornado/test_run_api_handler.py index 5889cc46ee3..140bc176c92 100644 --- a/tests/pytests/integration/netapi/rest_tornado/test_run_api_handler.py +++ b/tests/pytests/integration/netapi/rest_tornado/test_run_api_handler.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.json from salt.netapi.rest_tornado import saltnado diff --git a/tests/pytests/integration/netapi/test_client.py b/tests/pytests/integration/netapi/test_client.py index 2b29b3427af..8d76f1bb67f 100644 --- a/tests/pytests/integration/netapi/test_client.py +++ b/tests/pytests/integration/netapi/test_client.py @@ -1,4 +1,5 @@ import pytest + import salt.netapi from salt.exceptions import EauthAuthenticationError diff --git a/tests/pytests/integration/netapi/test_ssh_client.py b/tests/pytests/integration/netapi/test_ssh_client.py index 9f7360c7fd9..19568f34e65 100644 --- a/tests/pytests/integration/netapi/test_ssh_client.py +++ b/tests/pytests/integration/netapi/test_ssh_client.py @@ -1,4 +1,5 @@ import pytest + import salt.netapi from salt.exceptions import EauthAuthenticationError from tests.support.helpers import SaveRequestsPostHandler, Webserver diff --git a/tests/pytests/integration/proxy/test_shell.py b/tests/pytests/integration/proxy/test_shell.py index efe00c92868..44a0e137f75 100644 --- a/tests/pytests/integration/proxy/test_shell.py +++ b/tests/pytests/integration/proxy/test_shell.py @@ -5,6 +5,7 @@ import logging import random import pytest + import salt.proxy.dummy import salt.utils.path import salt.utils.platform diff --git a/tests/pytests/integration/reactor/test_reactor.py b/tests/pytests/integration/reactor/test_reactor.py index 8b9a5f12253..875d71623e3 100644 --- a/tests/pytests/integration/reactor/test_reactor.py +++ b/tests/pytests/integration/reactor/test_reactor.py @@ -11,6 +11,7 @@ import time import types import pytest + import salt.utils.event import salt.utils.reactor from salt.serializers import yaml diff --git a/tests/pytests/integration/renderers/test_toml.py b/tests/pytests/integration/renderers/test_toml.py index c1299400ac0..dbe836314f3 100644 --- a/tests/pytests/integration/renderers/test_toml.py +++ b/tests/pytests/integration/renderers/test_toml.py @@ -1,4 +1,5 @@ import pytest + import salt.serializers.toml diff --git a/tests/pytests/integration/runners/state/orchestrate/test_events.py b/tests/pytests/integration/runners/state/orchestrate/test_events.py index 90e571b0ead..4a4b7eb6f64 100644 --- a/tests/pytests/integration/runners/state/orchestrate/test_events.py +++ b/tests/pytests/integration/runners/state/orchestrate/test_events.py @@ -7,6 +7,7 @@ import json import time import pytest + import salt.utils.jid import salt.utils.platform diff --git a/tests/pytests/integration/sdb/test_etcd_db.py b/tests/pytests/integration/sdb/test_etcd_db.py index 4cfdf94af11..d981b222da7 100644 --- a/tests/pytests/integration/sdb/test_etcd_db.py +++ b/tests/pytests/integration/sdb/test_etcd_db.py @@ -5,6 +5,7 @@ Integration tests for the etcd modules import logging import pytest + from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import etcd = pytest.importorskip("etcd") diff --git a/tests/pytests/integration/sdb/test_vault.py b/tests/pytests/integration/sdb/test_vault.py index 515139ced33..c70c251c2a9 100644 --- a/tests/pytests/integration/sdb/test_vault.py +++ b/tests/pytests/integration/sdb/test_vault.py @@ -7,8 +7,9 @@ import subprocess import time import pytest -import salt.utils.path from pytestshellutils.utils.processes import ProcessResult + +import salt.utils.path from tests.support.helpers import PatchedEnviron from tests.support.runtests import RUNTIME_VARS diff --git a/tests/pytests/integration/ssh/test_grains.py b/tests/pytests/integration/ssh/test_grains.py index 49e06e4d82a..a2f8a8114a5 100644 --- a/tests/pytests/integration/ssh/test_grains.py +++ b/tests/pytests/integration/ssh/test_grains.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform pytestmark = [ diff --git a/tests/pytests/integration/states/test_ansiblegate.py b/tests/pytests/integration/states/test_ansiblegate.py index dc85d22fa07..c66ba9075b4 100644 --- a/tests/pytests/integration/states/test_ansiblegate.py +++ b/tests/pytests/integration/states/test_ansiblegate.py @@ -7,11 +7,12 @@ import shutil import textwrap import pytest -import salt.utils.files -import salt.utils.path import yaml from pytestshellutils.exceptions import FactoryTimeout from saltfactories.utils.functional import StateResult + +import salt.utils.files +import salt.utils.path from tests.support.runtests import RUNTIME_VARS pytestmark = [ diff --git a/tests/pytests/integration/states/test_cron.py b/tests/pytests/integration/states/test_cron.py index 574166bbbb2..00b25cb9f8c 100644 --- a/tests/pytests/integration/states/test_cron.py +++ b/tests/pytests/integration/states/test_cron.py @@ -6,6 +6,7 @@ import logging import subprocess import pytest + import salt.utils.platform log = logging.getLogger(__name__) diff --git a/tests/pytests/integration/states/test_file.py b/tests/pytests/integration/states/test_file.py index d1b033b72d4..faf50a30974 100644 --- a/tests/pytests/integration/states/test_file.py +++ b/tests/pytests/integration/states/test_file.py @@ -8,9 +8,10 @@ import re import textwrap import pytest +from pytestshellutils.utils import ports + import salt.utils.files import salt.utils.path -from pytestshellutils.utils import ports from salt.utils.versions import LooseVersion as _LooseVersion from tests.support.helpers import SKIP_INITIAL_PHOTONOS_FAILURES diff --git a/tests/pytests/integration/states/test_idem.py b/tests/pytests/integration/states/test_idem.py index d31091c5d2a..feab60d4951 100644 --- a/tests/pytests/integration/states/test_idem.py +++ b/tests/pytests/integration/states/test_idem.py @@ -5,6 +5,7 @@ import tempfile from contextlib import contextmanager import pytest + import salt.state import salt.utils.idem as idem import salt.utils.path diff --git a/tests/pytests/integration/wheel/conftest.py b/tests/pytests/integration/wheel/conftest.py index 4434dcdcd17..3244fa05bfb 100644 --- a/tests/pytests/integration/wheel/conftest.py +++ b/tests/pytests/integration/wheel/conftest.py @@ -1,4 +1,5 @@ import pytest + import salt.config import salt.wheel diff --git a/tests/pytests/integration/wheel/test_client.py b/tests/pytests/integration/wheel/test_client.py index e2b145dd778..40363ead10a 100644 --- a/tests/pytests/integration/wheel/test_client.py +++ b/tests/pytests/integration/wheel/test_client.py @@ -1,4 +1,5 @@ import pytest + import salt.auth pytestmark = [ diff --git a/tests/pytests/scenarios/compat/conftest.py b/tests/pytests/scenarios/compat/conftest.py index 45c49a35251..29d58354abc 100644 --- a/tests/pytests/scenarios/compat/conftest.py +++ b/tests/pytests/scenarios/compat/conftest.py @@ -9,9 +9,10 @@ import os import shutil import pytest -import salt.utils.path from saltfactories.daemons.container import Container from saltfactories.utils import random_string + +import salt.utils.path from tests.support.runtests import RUNTIME_VARS from tests.support.sminion import create_sminion diff --git a/tests/pytests/scenarios/compat/test_with_versions.py b/tests/pytests/scenarios/compat/test_with_versions.py index 1a5c25205f8..429d1e25a18 100644 --- a/tests/pytests/scenarios/compat/test_with_versions.py +++ b/tests/pytests/scenarios/compat/test_with_versions.py @@ -8,9 +8,10 @@ import logging import pathlib import pytest -import salt.utils.platform from saltfactories.daemons.container import SaltMinion from saltfactories.utils import random_string + +import salt.utils.platform from tests.support.runtests import RUNTIME_VARS docker = pytest.importorskip("docker") diff --git a/tests/pytests/scenarios/failover/multimaster/conftest.py b/tests/pytests/scenarios/failover/multimaster/conftest.py index 531fc062be5..c1a74034cda 100644 --- a/tests/pytests/scenarios/failover/multimaster/conftest.py +++ b/tests/pytests/scenarios/failover/multimaster/conftest.py @@ -5,9 +5,10 @@ import subprocess import time import pytest -import salt.utils.platform from pytestshellutils.exceptions import FactoryNotStarted, FactoryTimeout +import salt.utils.platform + log = logging.getLogger(__name__) diff --git a/tests/pytests/scenarios/failover/multimaster/test_failover_master.py b/tests/pytests/scenarios/failover/multimaster/test_failover_master.py index cc22d13bda2..349bf9eb2e2 100644 --- a/tests/pytests/scenarios/failover/multimaster/test_failover_master.py +++ b/tests/pytests/scenarios/failover/multimaster/test_failover_master.py @@ -4,6 +4,7 @@ import shutil import time import pytest + import salt.utils.platform pytestmark = [ diff --git a/tests/pytests/scenarios/multimaster/beacons/test_inotify.py b/tests/pytests/scenarios/multimaster/beacons/test_inotify.py index 3fc8fb21ccf..c16384d7b6f 100644 --- a/tests/pytests/scenarios/multimaster/beacons/test_inotify.py +++ b/tests/pytests/scenarios/multimaster/beacons/test_inotify.py @@ -3,6 +3,7 @@ import shutil import time import pytest + import salt.config import salt.version diff --git a/tests/pytests/scenarios/multimaster/conftest.py b/tests/pytests/scenarios/multimaster/conftest.py index 07d8b888f15..b18d65ca96b 100644 --- a/tests/pytests/scenarios/multimaster/conftest.py +++ b/tests/pytests/scenarios/multimaster/conftest.py @@ -5,9 +5,10 @@ import subprocess import time import pytest -import salt.utils.platform from pytestshellutils.exceptions import FactoryTimeout +import salt.utils.platform + log = logging.getLogger(__name__) diff --git a/tests/pytests/scenarios/multimaster/modules/test_test.py b/tests/pytests/scenarios/multimaster/modules/test_test.py index 23110fb8d24..b11cad1f71d 100644 --- a/tests/pytests/scenarios/multimaster/modules/test_test.py +++ b/tests/pytests/scenarios/multimaster/modules/test_test.py @@ -1,4 +1,5 @@ import pytest + import salt.config import salt.version diff --git a/tests/pytests/scenarios/setup/conftest.py b/tests/pytests/scenarios/setup/conftest.py index 744b9059bdf..89002d8eee9 100644 --- a/tests/pytests/scenarios/setup/conftest.py +++ b/tests/pytests/scenarios/setup/conftest.py @@ -3,6 +3,7 @@ import pathlib import shutil import pytest + from tests.support.helpers import VirtualEnv from tests.support.runtests import RUNTIME_VARS diff --git a/tests/pytests/scenarios/setup/test_install.py b/tests/pytests/scenarios/setup/test_install.py index d8ce96cb34e..0eeebdebaae 100644 --- a/tests/pytests/scenarios/setup/test_install.py +++ b/tests/pytests/scenarios/setup/test_install.py @@ -8,6 +8,7 @@ import re import sys import pytest + import salt.utils.path import salt.utils.platform import salt.version diff --git a/tests/pytests/scenarios/setup/test_man.py b/tests/pytests/scenarios/setup/test_man.py index de08dd53711..b5a5b0b8874 100644 --- a/tests/pytests/scenarios/setup/test_man.py +++ b/tests/pytests/scenarios/setup/test_man.py @@ -6,6 +6,7 @@ import os import pprint import pytest + import salt.utils.platform from salt.modules.virtualenv_mod import KNOWN_BINARY_NAMES diff --git a/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py b/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py index 230da8abc8b..76b0e88eca5 100644 --- a/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py +++ b/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py @@ -7,6 +7,7 @@ import time import pytest from pytestshellutils.utils.processes import terminate_process + from salt._logging.handlers import DeferredStreamHandler from salt.utils.nb_popen import NonBlockingPopen from tests.support.helpers import CaptureOutput, dedent diff --git a/tests/pytests/unit/auth/test_pam.py b/tests/pytests/unit/auth/test_pam.py index 04457c79cb6..16999368b32 100644 --- a/tests/pytests/unit/auth/test_pam.py +++ b/tests/pytests/unit/auth/test_pam.py @@ -1,4 +1,5 @@ import pytest + import salt.auth.pam from tests.support.mock import patch diff --git a/tests/pytests/unit/auth/test_rest.py b/tests/pytests/unit/auth/test_rest.py index 87f2465f715..a71ab1867f5 100644 --- a/tests/pytests/unit/auth/test_rest.py +++ b/tests/pytests/unit/auth/test_rest.py @@ -1,4 +1,5 @@ import pytest + import salt.auth.rest as rest from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/beacons/test_adb.py b/tests/pytests/unit/beacons/test_adb.py index fee3f837d2d..0d9ee99ee6a 100644 --- a/tests/pytests/unit/beacons/test_adb.py +++ b/tests/pytests/unit/beacons/test_adb.py @@ -5,6 +5,7 @@ ADB beacon test cases """ import pytest + import salt.beacons.adb as adb from tests.support.mock import Mock, patch diff --git a/tests/pytests/unit/beacons/test_avahi_announce.py b/tests/pytests/unit/beacons/test_avahi_announce.py index e6a12ef1aaa..2eb95a35a2f 100644 --- a/tests/pytests/unit/beacons/test_avahi_announce.py +++ b/tests/pytests/unit/beacons/test_avahi_announce.py @@ -5,6 +5,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 9f3bdbf3200..c5551edebfd 100644 --- a/tests/pytests/unit/beacons/test_bonjour_announce.py +++ b/tests/pytests/unit/beacons/test_bonjour_announce.py @@ -5,6 +5,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 7da49717ded..e37863cd733 100644 --- a/tests/pytests/unit/beacons/test_diskusage.py +++ b/tests/pytests/unit/beacons/test_diskusage.py @@ -7,6 +7,7 @@ from collections import namedtuple import pytest + import salt.beacons.diskusage as diskusage from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/beacons/test_glxinfo.py b/tests/pytests/unit/beacons/test_glxinfo.py index c6e37b79839..b556c2cafa9 100644 --- a/tests/pytests/unit/beacons/test_glxinfo.py +++ b/tests/pytests/unit/beacons/test_glxinfo.py @@ -5,6 +5,7 @@ glxinfo beacon test cases """ import pytest + import salt.beacons.glxinfo as glxinfo from tests.support.mock import Mock, patch diff --git a/tests/pytests/unit/beacons/test_haproxy.py b/tests/pytests/unit/beacons/test_haproxy.py index 859e708ad8f..33197cb1414 100644 --- a/tests/pytests/unit/beacons/test_haproxy.py +++ b/tests/pytests/unit/beacons/test_haproxy.py @@ -5,6 +5,7 @@ HAProxy beacon test cases """ import pytest + import salt.beacons.haproxy as haproxy from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/beacons/test_load.py b/tests/pytests/unit/beacons/test_load.py index 4b1386140a0..a0a28428e4b 100644 --- a/tests/pytests/unit/beacons/test_load.py +++ b/tests/pytests/unit/beacons/test_load.py @@ -5,6 +5,7 @@ Load beacon test cases """ import pytest + import salt.beacons.load as load from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/beacons/test_log_beacon.py b/tests/pytests/unit/beacons/test_log_beacon.py index c21c596d40a..f0dc61865cb 100644 --- a/tests/pytests/unit/beacons/test_log_beacon.py +++ b/tests/pytests/unit/beacons/test_log_beacon.py @@ -5,6 +5,7 @@ log beacon test cases """ import pytest + import salt.beacons.log_beacon as log_beacon from tests.support.mock import mock_open, patch diff --git a/tests/pytests/unit/beacons/test_memusage.py b/tests/pytests/unit/beacons/test_memusage.py index 829fc1c7084..bab3d5321e2 100644 --- a/tests/pytests/unit/beacons/test_memusage.py +++ b/tests/pytests/unit/beacons/test_memusage.py @@ -7,6 +7,7 @@ from collections import namedtuple import pytest + import salt.beacons.memusage as memusage from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/beacons/test_network_info.py b/tests/pytests/unit/beacons/test_network_info.py index b96887e8777..2f356f41ac0 100644 --- a/tests/pytests/unit/beacons/test_network_info.py +++ b/tests/pytests/unit/beacons/test_network_info.py @@ -7,6 +7,7 @@ from collections import namedtuple import pytest + import salt.beacons.network_info as network_info from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/beacons/test_ps.py b/tests/pytests/unit/beacons/test_ps.py index 950d3d403e2..2d1df7ff15d 100644 --- a/tests/pytests/unit/beacons/test_ps.py +++ b/tests/pytests/unit/beacons/test_ps.py @@ -5,6 +5,7 @@ ps usage beacon test cases """ import pytest + import salt.beacons.ps as ps from tests.support.mock import patch diff --git a/tests/pytests/unit/beacons/test_salt_monitor.py b/tests/pytests/unit/beacons/test_salt_monitor.py index be4843caf31..1edf8be539d 100644 --- a/tests/pytests/unit/beacons/test_salt_monitor.py +++ b/tests/pytests/unit/beacons/test_salt_monitor.py @@ -1,6 +1,7 @@ # pylint: disable=E8231 # Salt libs import pytest + import salt.beacons.salt_monitor as salt_monitor TEST_CONFIG = [ diff --git a/tests/pytests/unit/beacons/test_sensehat.py b/tests/pytests/unit/beacons/test_sensehat.py index 388278570bc..3f77e8904cb 100644 --- a/tests/pytests/unit/beacons/test_sensehat.py +++ b/tests/pytests/unit/beacons/test_sensehat.py @@ -1,4 +1,5 @@ import pytest + import salt.beacons.sensehat as sensehat from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/beacons/test_status.py b/tests/pytests/unit/beacons/test_status.py index 6c010ddd803..cceba468552 100644 --- a/tests/pytests/unit/beacons/test_status.py +++ b/tests/pytests/unit/beacons/test_status.py @@ -6,6 +6,7 @@ """ import pytest + import salt.modules.status as status_module from salt.beacons import status diff --git a/tests/pytests/unit/beacons/test_swapusage.py b/tests/pytests/unit/beacons/test_swapusage.py index 8ddf996182e..5ffed290bf8 100644 --- a/tests/pytests/unit/beacons/test_swapusage.py +++ b/tests/pytests/unit/beacons/test_swapusage.py @@ -7,6 +7,7 @@ from collections import namedtuple import pytest + import salt.beacons.swapusage as swapusage from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/beacons/test_watchdog.py b/tests/pytests/unit/beacons/test_watchdog.py index 323696c3ff5..1b63bef4e62 100644 --- a/tests/pytests/unit/beacons/test_watchdog.py +++ b/tests/pytests/unit/beacons/test_watchdog.py @@ -2,6 +2,7 @@ import os import time import pytest + import salt.utils.files import salt.utils.platform from salt.beacons import watchdog diff --git a/tests/pytests/unit/cache/test_mysql_cache.py b/tests/pytests/unit/cache/test_mysql_cache.py index 9532436c886..dc8c9218efa 100644 --- a/tests/pytests/unit/cache/test_mysql_cache.py +++ b/tests/pytests/unit/cache/test_mysql_cache.py @@ -6,6 +6,7 @@ unit tests for the mysql_cache cache import logging import pytest + import salt.cache.mysql_cache as mysql_cache import salt.payload import salt.utils.files diff --git a/tests/pytests/unit/client/ssh/test_shell.py b/tests/pytests/unit/client/ssh/test_shell.py index 858e8d82a6d..1b17ce34ede 100644 --- a/tests/pytests/unit/client/ssh/test_shell.py +++ b/tests/pytests/unit/client/ssh/test_shell.py @@ -2,6 +2,7 @@ import subprocess import types import pytest + import salt.client.ssh.shell as shell diff --git a/tests/pytests/unit/client/ssh/test_ssh.py b/tests/pytests/unit/client/ssh/test_ssh.py index b9388f10ea2..50ecdcc601e 100644 --- a/tests/pytests/unit/client/ssh/test_ssh.py +++ b/tests/pytests/unit/client/ssh/test_ssh.py @@ -1,6 +1,7 @@ import os import pytest + import salt.client.ssh.client import salt.utils.msgpack from salt.client import ssh diff --git a/tests/pytests/unit/client/test_ssh.py b/tests/pytests/unit/client/test_ssh.py index c84eba406f4..d2ddb34b7ef 100644 --- a/tests/pytests/unit/client/test_ssh.py +++ b/tests/pytests/unit/client/test_ssh.py @@ -1,4 +1,5 @@ import pytest + import salt.client.ssh from tests.support.helpers import dedent diff --git a/tests/pytests/unit/cloud/clouds/test_azurearm.py b/tests/pytests/unit/cloud/clouds/test_azurearm.py index 757e0926bb5..d84aeeffd65 100644 --- a/tests/pytests/unit/cloud/clouds/test_azurearm.py +++ b/tests/pytests/unit/cloud/clouds/test_azurearm.py @@ -1,6 +1,7 @@ import types import pytest + from salt.cloud.clouds import azurearm as azure from tests.support.mock import MagicMock, create_autospec, patch diff --git a/tests/pytests/unit/cloud/clouds/test_ec2.py b/tests/pytests/unit/cloud/clouds/test_ec2.py index 2dde09eabf7..78df49c5d97 100644 --- a/tests/pytests/unit/cloud/clouds/test_ec2.py +++ b/tests/pytests/unit/cloud/clouds/test_ec2.py @@ -1,4 +1,5 @@ import pytest + from salt.cloud.clouds import ec2 pytestmark = [ diff --git a/tests/pytests/unit/cloud/clouds/test_gce.py b/tests/pytests/unit/cloud/clouds/test_gce.py index 7dce906abfc..9253f3746b6 100644 --- a/tests/pytests/unit/cloud/clouds/test_gce.py +++ b/tests/pytests/unit/cloud/clouds/test_gce.py @@ -8,6 +8,7 @@ import collections import pytest + from salt.cloud.clouds import gce from salt.exceptions import SaltCloudSystemExit from salt.utils.versions import LooseVersion diff --git a/tests/pytests/unit/cloud/clouds/test_hetzner.py b/tests/pytests/unit/cloud/clouds/test_hetzner.py index b73b98e07f1..cfe5bb4e85e 100644 --- a/tests/pytests/unit/cloud/clouds/test_hetzner.py +++ b/tests/pytests/unit/cloud/clouds/test_hetzner.py @@ -3,6 +3,7 @@ """ import pytest + from salt.cloud.clouds import hetzner from salt.exceptions import SaltCloudException, SaltCloudSystemExit from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/cloud/clouds/test_openstack.py b/tests/pytests/unit/cloud/clouds/test_openstack.py index 80eeed805cf..788b942dad5 100644 --- a/tests/pytests/unit/cloud/clouds/test_openstack.py +++ b/tests/pytests/unit/cloud/clouds/test_openstack.py @@ -1,4 +1,5 @@ import pytest + import salt.cloud.clouds.openstack as openstack from tests.support.mock import call, patch diff --git a/tests/pytests/unit/cloud/clouds/test_xen.py b/tests/pytests/unit/cloud/clouds/test_xen.py index d8ee7af9b91..a82d492756f 100644 --- a/tests/pytests/unit/cloud/clouds/test_xen.py +++ b/tests/pytests/unit/cloud/clouds/test_xen.py @@ -8,6 +8,7 @@ import logging import pytest + from salt.cloud.clouds import xen from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/cloud/test_cloud.py b/tests/pytests/unit/cloud/test_cloud.py index 14ced78e0da..34300225c37 100644 --- a/tests/pytests/unit/cloud/test_cloud.py +++ b/tests/pytests/unit/cloud/test_cloud.py @@ -1,6 +1,7 @@ import copy import pytest + import salt.config from salt.cloud import Cloud from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/cloud/test_map.py b/tests/pytests/unit/cloud/test_map.py index 559f67472d4..7a6d3f5fdca 100644 --- a/tests/pytests/unit/cloud/test_map.py +++ b/tests/pytests/unit/cloud/test_map.py @@ -8,6 +8,7 @@ import logging import os import pytest + import salt.cloud import salt.config from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/config/test__validate_opts.py b/tests/pytests/unit/config/test__validate_opts.py index df8c48bd1ff..3359a55bd85 100644 --- a/tests/pytests/unit/config/test__validate_opts.py +++ b/tests/pytests/unit/config/test__validate_opts.py @@ -2,6 +2,7 @@ Test config option type enforcement """ import pytest + import salt.config diff --git a/tests/pytests/unit/engines/test_engines.py b/tests/pytests/unit/engines/test_engines.py index c66d91ec46e..aaf8280a74d 100644 --- a/tests/pytests/unit/engines/test_engines.py +++ b/tests/pytests/unit/engines/test_engines.py @@ -1,4 +1,5 @@ import pytest + import salt.engines from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/engines/test_libvirt_events.py b/tests/pytests/unit/engines/test_libvirt_events.py index 736e9740a4e..382ec311732 100644 --- a/tests/pytests/unit/engines/test_libvirt_events.py +++ b/tests/pytests/unit/engines/test_libvirt_events.py @@ -2,6 +2,7 @@ unit tests for the libvirt_events engine """ import pytest + import salt.engines.libvirt_events as libvirt_events from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/engines/test_script.py b/tests/pytests/unit/engines/test_script.py index a9e6a1e2ea9..286fc0ff601 100644 --- a/tests/pytests/unit/engines/test_script.py +++ b/tests/pytests/unit/engines/test_script.py @@ -3,6 +3,7 @@ unit tests for the script engine """ import pytest + import salt.config import salt.engines.script as script from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/engines/test_slack.py b/tests/pytests/unit/engines/test_slack.py index db1a93b42fa..c4946b51a15 100644 --- a/tests/pytests/unit/engines/test_slack.py +++ b/tests/pytests/unit/engines/test_slack.py @@ -2,6 +2,7 @@ unit tests for the slack engine """ import pytest + import salt.config import salt.engines.slack as slack from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/engines/test_sqs_events.py b/tests/pytests/unit/engines/test_sqs_events.py index d46a2dd968d..894d1d6f652 100644 --- a/tests/pytests/unit/engines/test_sqs_events.py +++ b/tests/pytests/unit/engines/test_sqs_events.py @@ -2,6 +2,7 @@ unit tests for the sqs_events engine """ import pytest + import salt.engines.sqs_events as sqs_events from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/engines/test_stalekey.py b/tests/pytests/unit/engines/test_stalekey.py index eeabd1be74f..b468bd503b8 100644 --- a/tests/pytests/unit/engines/test_stalekey.py +++ b/tests/pytests/unit/engines/test_stalekey.py @@ -5,6 +5,7 @@ unit tests for the stalekey engine import logging import pytest + import salt.engines.stalekey as stalekey from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 5c43dbdb09a..1196bdd4e79 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -15,6 +15,7 @@ import textwrap from collections import namedtuple import pytest + import salt.grains.core as core import salt.loader import salt.modules.cmdmod diff --git a/tests/pytests/unit/grains/test_metadata_gce.py b/tests/pytests/unit/grains/test_metadata_gce.py index be88b89d30c..68e134fac7d 100644 --- a/tests/pytests/unit/grains/test_metadata_gce.py +++ b/tests/pytests/unit/grains/test_metadata_gce.py @@ -9,6 +9,7 @@ import logging import pytest + import salt.grains.metadata_gce as metadata import salt.utils.http as http from tests.support.mock import create_autospec, patch diff --git a/tests/pytests/unit/loader/test_lazy.py b/tests/pytests/unit/loader/test_lazy.py index 828d73ff2d3..df5039a7193 100644 --- a/tests/pytests/unit/loader/test_lazy.py +++ b/tests/pytests/unit/loader/test_lazy.py @@ -4,6 +4,7 @@ Tests for salt.loader.lazy import sys import pytest + import salt.loader import salt.loader.context import salt.loader.lazy diff --git a/tests/pytests/unit/loader/test_loader.py b/tests/pytests/unit/loader/test_loader.py index 8f0c2711c6b..d313e481793 100644 --- a/tests/pytests/unit/loader/test_loader.py +++ b/tests/pytests/unit/loader/test_loader.py @@ -9,6 +9,7 @@ import shutil import textwrap import pytest + import salt.loader import salt.loader.lazy diff --git a/tests/pytests/unit/log_handlers/test_sentry_mod.py b/tests/pytests/unit/log_handlers/test_sentry_mod.py index bd26d2cd0b7..4c2d174b710 100644 --- a/tests/pytests/unit/log_handlers/test_sentry_mod.py +++ b/tests/pytests/unit/log_handlers/test_sentry_mod.py @@ -2,6 +2,7 @@ Tests for salt.log_handlers.sentry_mod """ import pytest + import salt.log_handlers.sentry_mod from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/dockermod/test_module.py b/tests/pytests/unit/modules/dockermod/test_module.py index 47fe5d55e6f..d80006dad38 100644 --- a/tests/pytests/unit/modules/dockermod/test_module.py +++ b/tests/pytests/unit/modules/dockermod/test_module.py @@ -5,6 +5,7 @@ Unit tests for the docker module import logging import pytest + import salt.config import salt.loader import salt.modules.dockermod as docker_mod diff --git a/tests/pytests/unit/modules/dockermod/test_trans_tar.py b/tests/pytests/unit/modules/dockermod/test_trans_tar.py index 00cfc763baf..6167c3fdeb0 100644 --- a/tests/pytests/unit/modules/dockermod/test_trans_tar.py +++ b/tests/pytests/unit/modules/dockermod/test_trans_tar.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.modules.dockermod as docker_mod from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/file/test_file_basics.py b/tests/pytests/unit/modules/file/test_file_basics.py index 3acf3f1aa7d..cee60da2fab 100644 --- a/tests/pytests/unit/modules/file/test_file_basics.py +++ b/tests/pytests/unit/modules/file/test_file_basics.py @@ -3,6 +3,7 @@ import os import shutil import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/file/test_file_block_replace.py b/tests/pytests/unit/modules/file/test_file_block_replace.py index 057e26767b0..577e6004a42 100644 --- a/tests/pytests/unit/modules/file/test_file_block_replace.py +++ b/tests/pytests/unit/modules/file/test_file_block_replace.py @@ -4,6 +4,7 @@ import shutil import textwrap import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/file/test_file_chattr.py b/tests/pytests/unit/modules/file/test_file_chattr.py index d59d1b72be3..31b3e42a982 100644 --- a/tests/pytests/unit/modules/file/test_file_chattr.py +++ b/tests/pytests/unit/modules/file/test_file_chattr.py @@ -2,6 +2,7 @@ import logging import textwrap import pytest + import salt.modules.cmdmod as cmdmod import salt.modules.file as filemod from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/modules/file/test_file_check.py b/tests/pytests/unit/modules/file/test_file_check.py index bd0379ddaed..5ab3d0f1acd 100644 --- a/tests/pytests/unit/modules/file/test_file_check.py +++ b/tests/pytests/unit/modules/file/test_file_check.py @@ -3,6 +3,7 @@ import logging import os import pytest + import salt.modules.file as filemod import salt.utils.files import salt.utils.platform diff --git a/tests/pytests/unit/modules/file/test_file_comment_line.py b/tests/pytests/unit/modules/file/test_file_comment_line.py index 2c2c55d84b8..52f8d378bf8 100644 --- a/tests/pytests/unit/modules/file/test_file_comment_line.py +++ b/tests/pytests/unit/modules/file/test_file_comment_line.py @@ -4,6 +4,7 @@ import shutil import textwrap import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/file/test_file_grep.py b/tests/pytests/unit/modules/file/test_file_grep.py index d40c8839b53..b3f57e0505f 100644 --- a/tests/pytests/unit/modules/file/test_file_grep.py +++ b/tests/pytests/unit/modules/file/test_file_grep.py @@ -4,6 +4,7 @@ import shutil import textwrap import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/file/test_file_line.py b/tests/pytests/unit/modules/file/test_file_line.py index 7d2450975e4..914a006bc56 100644 --- a/tests/pytests/unit/modules/file/test_file_line.py +++ b/tests/pytests/unit/modules/file/test_file_line.py @@ -7,6 +7,7 @@ import os import shutil import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/file/test_file_lsattr.py b/tests/pytests/unit/modules/file/test_file_lsattr.py index 94a35fff51a..4ad9fcd13bd 100644 --- a/tests/pytests/unit/modules/file/test_file_lsattr.py +++ b/tests/pytests/unit/modules/file/test_file_lsattr.py @@ -2,6 +2,7 @@ import logging import textwrap import pytest + import salt.modules.cmdmod as cmdmod import salt.modules.file as filemod from salt.exceptions import SaltInvocationError diff --git a/tests/pytests/unit/modules/file/test_file_module.py b/tests/pytests/unit/modules/file/test_file_module.py index 868b6293c35..299375570d6 100644 --- a/tests/pytests/unit/modules/file/test_file_module.py +++ b/tests/pytests/unit/modules/file/test_file_module.py @@ -4,6 +4,7 @@ import shutil import textwrap import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/file/test_file_selinux.py b/tests/pytests/unit/modules/file/test_file_selinux.py index 3ef315ee51f..843353f8ac2 100644 --- a/tests/pytests/unit/modules/file/test_file_selinux.py +++ b/tests/pytests/unit/modules/file/test_file_selinux.py @@ -3,6 +3,7 @@ import os import shutil import pytest + import salt.config import salt.loader import salt.modules.cmdmod as cmdmod diff --git a/tests/pytests/unit/modules/napalm/test_bgp.py b/tests/pytests/unit/modules/napalm/test_bgp.py index 13ef6dcd07f..e9dcb21ecf5 100644 --- a/tests/pytests/unit/modules/napalm/test_bgp.py +++ b/tests/pytests/unit/modules/napalm/test_bgp.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.napalm_bgp as napalm_bgp import tests.support.napalm as napalm_test_support from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_formula.py b/tests/pytests/unit/modules/napalm/test_formula.py index 90d266522a1..07a61783f4a 100644 --- a/tests/pytests/unit/modules/napalm/test_formula.py +++ b/tests/pytests/unit/modules/napalm/test_formula.py @@ -5,6 +5,7 @@ Test the napalm_formula execution module. import textwrap import pytest + import salt.modules.napalm_formula as napalm_formula from salt.utils.immutabletypes import freeze from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_mod.py b/tests/pytests/unit/modules/napalm/test_mod.py index 95a2a5ac53d..306a9840a46 100644 --- a/tests/pytests/unit/modules/napalm/test_mod.py +++ b/tests/pytests/unit/modules/napalm/test_mod.py @@ -4,6 +4,7 @@ import logging import pytest + import salt.modules.napalm_mod as napalm_mod import tests.support.napalm as napalm_test_support from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_netacl.py b/tests/pytests/unit/modules/napalm/test_netacl.py index 948986cf864..95ec3642fac 100644 --- a/tests/pytests/unit/modules/napalm/test_netacl.py +++ b/tests/pytests/unit/modules/napalm/test_netacl.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.napalm_netacl as napalm_acl import tests.support.napalm as napalm_test_support from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_network.py b/tests/pytests/unit/modules/napalm/test_network.py index 0de18763fdf..4dfaf8af447 100644 --- a/tests/pytests/unit/modules/napalm/test_network.py +++ b/tests/pytests/unit/modules/napalm/test_network.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.napalm_network as napalm_network import tests.support.napalm as napalm_test_support from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_ntp.py b/tests/pytests/unit/modules/napalm/test_ntp.py index 8ebf21e3968..1f146603e04 100644 --- a/tests/pytests/unit/modules/napalm/test_ntp.py +++ b/tests/pytests/unit/modules/napalm/test_ntp.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.napalm_ntp as napalm_ntp import tests.support.napalm as napalm_test_support from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_route.py b/tests/pytests/unit/modules/napalm/test_route.py index 0bb8b1393ed..06ccf0ec618 100644 --- a/tests/pytests/unit/modules/napalm/test_route.py +++ b/tests/pytests/unit/modules/napalm/test_route.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.napalm_route as napalm_route import tests.support.napalm as napalm_test_support from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/napalm/test_snmp.py b/tests/pytests/unit/modules/napalm/test_snmp.py index b5518633146..67d25850f3a 100644 --- a/tests/pytests/unit/modules/napalm/test_snmp.py +++ b/tests/pytests/unit/modules/napalm/test_snmp.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.napalm_network as napalm_network import salt.modules.napalm_snmp as napalm_snmp import tests.support.napalm as napalm_test_support diff --git a/tests/pytests/unit/modules/napalm/test_users.py b/tests/pytests/unit/modules/napalm/test_users.py index 913af79c61a..b76010e76f1 100644 --- a/tests/pytests/unit/modules/napalm/test_users.py +++ b/tests/pytests/unit/modules/napalm/test_users.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.napalm_network as napalm_network import salt.modules.napalm_users as napalm_users import tests.support.napalm as napalm_test_support diff --git a/tests/pytests/unit/modules/state/test_state.py b/tests/pytests/unit/modules/state/test_state.py index 02fd2dd3079..3198296410e 100644 --- a/tests/pytests/unit/modules/state/test_state.py +++ b/tests/pytests/unit/modules/state/test_state.py @@ -7,6 +7,7 @@ import logging import os import pytest + import salt.config import salt.loader import salt.modules.config as config diff --git a/tests/pytests/unit/modules/state/test_top_file_merge.py b/tests/pytests/unit/modules/state/test_top_file_merge.py index a34df864314..f2d753f53eb 100644 --- a/tests/pytests/unit/modules/state/test_top_file_merge.py +++ b/tests/pytests/unit/modules/state/test_top_file_merge.py @@ -2,6 +2,7 @@ import sys import textwrap import pytest + import salt.modules.state as state import salt.state import salt.utils.files diff --git a/tests/pytests/unit/modules/test_aix_status.py b/tests/pytests/unit/modules/test_aix_status.py index 9eca1a4852b..9c6f3610a6b 100644 --- a/tests/pytests/unit/modules/test_aix_status.py +++ b/tests/pytests/unit/modules/test_aix_status.py @@ -2,6 +2,7 @@ import logging import sys import pytest + import salt.modules.status as status from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_aliases.py b/tests/pytests/unit/modules/test_aliases.py index 076cbfa2632..dc519b5aeda 100644 --- a/tests/pytests/unit/modules/test_aliases.py +++ b/tests/pytests/unit/modules/test_aliases.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.aliases as aliases from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_alternatives.py b/tests/pytests/unit/modules/test_alternatives.py index 6b76c746fec..4cf71875f05 100644 --- a/tests/pytests/unit/modules/test_alternatives.py +++ b/tests/pytests/unit/modules/test_alternatives.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.alternatives as alternatives from tests.support.helpers import TstSuiteLoggingHandler from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/modules/test_ansiblegate.py b/tests/pytests/unit/modules/test_ansiblegate.py index c42e97024a2..33456195149 100644 --- a/tests/pytests/unit/modules/test_ansiblegate.py +++ b/tests/pytests/unit/modules/test_ansiblegate.py @@ -3,6 +3,7 @@ import os import pytest + import salt.config import salt.loader import salt.modules.ansiblegate as ansiblegate diff --git a/tests/pytests/unit/modules/test_aptpkg.py b/tests/pytests/unit/modules/test_aptpkg.py index a7f118af54b..f72f4d53b1d 100644 --- a/tests/pytests/unit/modules/test_aptpkg.py +++ b/tests/pytests/unit/modules/test_aptpkg.py @@ -14,6 +14,7 @@ import pathlib import textwrap import pytest + import salt.modules.aptpkg as aptpkg import salt.modules.pkg_resource as pkg_resource import salt.utils.path diff --git a/tests/pytests/unit/modules/test_archive.py b/tests/pytests/unit/modules/test_archive.py index f4c3f04a1ab..ae58b4ef88f 100644 --- a/tests/pytests/unit/modules/test_archive.py +++ b/tests/pytests/unit/modules/test_archive.py @@ -1,6 +1,7 @@ import os.path import pytest + import salt.modules.archive as archive from salt.exceptions import CommandNotFoundError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_azurearm_dns.py b/tests/pytests/unit/modules/test_azurearm_dns.py index e2b621a6971..3c09e23143f 100644 --- a/tests/pytests/unit/modules/test_azurearm_dns.py +++ b/tests/pytests/unit/modules/test_azurearm_dns.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.config import salt.loader import salt.modules.azurearm_dns as azurearm_dns diff --git a/tests/pytests/unit/modules/test_beacons.py b/tests/pytests/unit/modules/test_beacons.py index 67f303d9844..69f9e57113b 100644 --- a/tests/pytests/unit/modules/test_beacons.py +++ b/tests/pytests/unit/modules/test_beacons.py @@ -6,6 +6,7 @@ import logging import os import pytest + import salt.config import salt.modules.beacons as beacons from salt.utils.event import SaltEvent diff --git a/tests/pytests/unit/modules/test_boto_elbv2.py b/tests/pytests/unit/modules/test_boto_elbv2.py index 5cf47986335..84206f5c0ef 100644 --- a/tests/pytests/unit/modules/test_boto_elbv2.py +++ b/tests/pytests/unit/modules/test_boto_elbv2.py @@ -1,4 +1,5 @@ import pytest + from salt.modules import boto_elbv2 from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_boto_ssm.py b/tests/pytests/unit/modules/test_boto_ssm.py index 6a28f0a1983..5677ca102c0 100644 --- a/tests/pytests/unit/modules/test_boto_ssm.py +++ b/tests/pytests/unit/modules/test_boto_ssm.py @@ -1,4 +1,5 @@ import pytest + from salt.modules import boto_ssm from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_chocolatey.py b/tests/pytests/unit/modules/test_chocolatey.py index bdeb096e118..07d2f2e56bd 100644 --- a/tests/pytests/unit/modules/test_chocolatey.py +++ b/tests/pytests/unit/modules/test_chocolatey.py @@ -6,6 +6,7 @@ Test for the chocolatey module import os import pytest + import salt.modules.chocolatey as chocolatey import salt.utils import salt.utils.platform diff --git a/tests/pytests/unit/modules/test_cmdmod.py b/tests/pytests/unit/modules/test_cmdmod.py index a6508e54622..fa7e032bb23 100644 --- a/tests/pytests/unit/modules/test_cmdmod.py +++ b/tests/pytests/unit/modules/test_cmdmod.py @@ -13,6 +13,7 @@ import sys import tempfile import pytest + import salt.modules.cmdmod as cmdmod import salt.utils.files import salt.utils.platform diff --git a/tests/pytests/unit/modules/test_consul.py b/tests/pytests/unit/modules/test_consul.py index 700997ac441..52f1c8ece2e 100644 --- a/tests/pytests/unit/modules/test_consul.py +++ b/tests/pytests/unit/modules/test_consul.py @@ -6,6 +6,7 @@ Test case for the consul execution module import logging import pytest + import salt.modules.consul as consul import salt.utils.http import salt.utils.json diff --git a/tests/pytests/unit/modules/test_cp.py b/tests/pytests/unit/modules/test_cp.py index a9c5ccf3707..6caa9ef5938 100644 --- a/tests/pytests/unit/modules/test_cp.py +++ b/tests/pytests/unit/modules/test_cp.py @@ -4,6 +4,7 @@ import pytest + import salt.channel.client import salt.modules.cp as cp import salt.utils.files diff --git a/tests/pytests/unit/modules/test_data.py b/tests/pytests/unit/modules/test_data.py index bd0f0d00a68..02a91c36a14 100644 --- a/tests/pytests/unit/modules/test_data.py +++ b/tests/pytests/unit/modules/test_data.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.modules.data as data from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/modules/test_defaults.py b/tests/pytests/unit/modules/test_defaults.py index c808cc4d624..73a0833064b 100644 --- a/tests/pytests/unit/modules/test_defaults.py +++ b/tests/pytests/unit/modules/test_defaults.py @@ -7,6 +7,7 @@ Test cases for salt.modules.defaults import inspect import pytest + import salt.modules.defaults as defaults from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_dig.py b/tests/pytests/unit/modules/test_dig.py index 16b2cb957d2..29cdb816d2a 100644 --- a/tests/pytests/unit/modules/test_dig.py +++ b/tests/pytests/unit/modules/test_dig.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.cmdmod as cmdmod import salt.modules.dig as dig from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_etcd_mod.py b/tests/pytests/unit/modules/test_etcd_mod.py index 4c02aec0743..1c43772524d 100644 --- a/tests/pytests/unit/modules/test_etcd_mod.py +++ b/tests/pytests/unit/modules/test_etcd_mod.py @@ -11,6 +11,7 @@ import pytest + import salt.modules.etcd_mod as etcd_mod import salt.utils.etcd_util as etcd_util from tests.support.mock import MagicMock, create_autospec, patch diff --git a/tests/pytests/unit/modules/test_freebsd_sysctl.py b/tests/pytests/unit/modules/test_freebsd_sysctl.py index 727f58d7600..8f14e829ef1 100644 --- a/tests/pytests/unit/modules/test_freebsd_sysctl.py +++ b/tests/pytests/unit/modules/test_freebsd_sysctl.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.freebsd_sysctl as freebsd_sysctl import salt.modules.systemd_service as systemd from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/modules/test_freezer.py b/tests/pytests/unit/modules/test_freezer.py index 8878bfd38a5..4476e9baec5 100644 --- a/tests/pytests/unit/modules/test_freezer.py +++ b/tests/pytests/unit/modules/test_freezer.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.freezer as freezer from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/modules/test_git.py b/tests/pytests/unit/modules/test_git.py index 5ec2fda18b7..058e850f734 100644 --- a/tests/pytests/unit/modules/test_git.py +++ b/tests/pytests/unit/modules/test_git.py @@ -9,6 +9,7 @@ import os import subprocess import pytest + import salt.modules.git as git_mod # Don't potentially shadow GitPython from salt.utils.versions import LooseVersion from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/modules/test_gpg.py b/tests/pytests/unit/modules/test_gpg.py index 94d144e4662..d99644ddcda 100644 --- a/tests/pytests/unit/modules/test_gpg.py +++ b/tests/pytests/unit/modules/test_gpg.py @@ -12,6 +12,7 @@ import types import psutil import pytest + import salt.modules.gpg as gpg from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_grains.py b/tests/pytests/unit/modules/test_grains.py index f9c9084b2b8..24a78ee4a2d 100644 --- a/tests/pytests/unit/modules/test_grains.py +++ b/tests/pytests/unit/modules/test_grains.py @@ -2,6 +2,7 @@ import copy import os import pytest + import salt.modules.grains as grainsmod import salt.utils.dictupdate as dictupdate from salt.exceptions import SaltException diff --git a/tests/pytests/unit/modules/test_ipset.py b/tests/pytests/unit/modules/test_ipset.py index 7f6a624d2f8..e0f486300f3 100644 --- a/tests/pytests/unit/modules/test_ipset.py +++ b/tests/pytests/unit/modules/test_ipset.py @@ -2,6 +2,7 @@ :codeauthor: Rupesh Tare """ import pytest + import salt.modules.ipset as ipset from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_iptables.py b/tests/pytests/unit/modules/test_iptables.py index 5c8c7d0b103..a7b52311abc 100644 --- a/tests/pytests/unit/modules/test_iptables.py +++ b/tests/pytests/unit/modules/test_iptables.py @@ -6,6 +6,7 @@ import textwrap import uuid import pytest + import salt.modules.iptables as iptables from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/modules/test_keyboard.py b/tests/pytests/unit/modules/test_keyboard.py index 2256b0749b2..d88f52bd6d6 100644 --- a/tests/pytests/unit/modules/test_keyboard.py +++ b/tests/pytests/unit/modules/test_keyboard.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.keyboard as keyboard from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_linux_sysctl.py b/tests/pytests/unit/modules/test_linux_sysctl.py index 75bb048d4f8..ab80eb9de9a 100644 --- a/tests/pytests/unit/modules/test_linux_sysctl.py +++ b/tests/pytests/unit/modules/test_linux_sysctl.py @@ -5,6 +5,7 @@ Tests for salt.modules.linux_sysctl module """ import pytest + import salt.modules.linux_sysctl as linux_sysctl import salt.modules.systemd_service as systemd from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/modules/test_mac_assistive.py b/tests/pytests/unit/modules/test_mac_assistive.py index 6eb624c8ba0..40841f516f2 100644 --- a/tests/pytests/unit/modules/test_mac_assistive.py +++ b/tests/pytests/unit/modules/test_mac_assistive.py @@ -1,6 +1,7 @@ import sqlite3 import pytest + import salt.modules.mac_assistive as assistive from salt.exceptions import CommandExecutionError from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_mac_brew_pkg.py b/tests/pytests/unit/modules/test_mac_brew_pkg.py index f6ffa6ed853..fbf6ba40dec 100644 --- a/tests/pytests/unit/modules/test_mac_brew_pkg.py +++ b/tests/pytests/unit/modules/test_mac_brew_pkg.py @@ -4,6 +4,7 @@ import textwrap import pytest + import salt.modules.mac_brew_pkg as mac_brew import salt.utils.pkg from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/modules/test_mac_desktop.py b/tests/pytests/unit/modules/test_mac_desktop.py index 334c8631419..32fb215bec8 100644 --- a/tests/pytests/unit/modules/test_mac_desktop.py +++ b/tests/pytests/unit/modules/test_mac_desktop.py @@ -3,6 +3,7 @@ Unit Tests for the mac_desktop execution module. """ import pytest + import salt.modules.mac_desktop as mac_desktop from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mac_group.py b/tests/pytests/unit/modules/test_mac_group.py index 5ce4b1429d4..2f0eefdd145 100644 --- a/tests/pytests/unit/modules/test_mac_group.py +++ b/tests/pytests/unit/modules/test_mac_group.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.mac_group as mac_group from salt.exceptions import CommandExecutionError, SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mac_keychain.py b/tests/pytests/unit/modules/test_mac_keychain.py index ac78c209f13..eb411e69b57 100644 --- a/tests/pytests/unit/modules/test_mac_keychain.py +++ b/tests/pytests/unit/modules/test_mac_keychain.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.mac_keychain as keychain from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mac_pkgutil.py b/tests/pytests/unit/modules/test_mac_pkgutil.py index bab8c0e7c95..adc27134036 100644 --- a/tests/pytests/unit/modules/test_mac_pkgutil.py +++ b/tests/pytests/unit/modules/test_mac_pkgutil.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.mac_pkgutil as mac_pkgutil from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_mac_power.py b/tests/pytests/unit/modules/test_mac_power.py index 081daaf976d..f89c19fe268 100644 --- a/tests/pytests/unit/modules/test_mac_power.py +++ b/tests/pytests/unit/modules/test_mac_power.py @@ -3,6 +3,7 @@ mac_power tests """ import pytest + import salt.modules.mac_power as mac_power from salt.exceptions import SaltInvocationError diff --git a/tests/pytests/unit/modules/test_mac_service.py b/tests/pytests/unit/modules/test_mac_service.py index a2a4387f463..c657ea893c5 100644 --- a/tests/pytests/unit/modules/test_mac_service.py +++ b/tests/pytests/unit/modules/test_mac_service.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.mac_service as mac_service from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mac_softwareupdate.py b/tests/pytests/unit/modules/test_mac_softwareupdate.py index 12c216347a3..2ee4decdbbd 100644 --- a/tests/pytests/unit/modules/test_mac_softwareupdate.py +++ b/tests/pytests/unit/modules/test_mac_softwareupdate.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.mac_softwareupdate as mac_softwareupdate from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mac_sysctl.py b/tests/pytests/unit/modules/test_mac_sysctl.py index 02b5a1da09a..9c8fb79f6b4 100644 --- a/tests/pytests/unit/modules/test_mac_sysctl.py +++ b/tests/pytests/unit/modules/test_mac_sysctl.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.mac_sysctl as mac_sysctl from salt.exceptions import CommandExecutionError from tests.support.mock import DEFAULT, MagicMock, mock_open, patch diff --git a/tests/pytests/unit/modules/test_mac_user.py b/tests/pytests/unit/modules/test_mac_user.py index 37e14eb42ae..7565545cc65 100644 --- a/tests/pytests/unit/modules/test_mac_user.py +++ b/tests/pytests/unit/modules/test_mac_user.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.mac_user as mac_user from salt.exceptions import CommandExecutionError, SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mac_xattr.py b/tests/pytests/unit/modules/test_mac_xattr.py index ef6ff576fdd..c5816877e72 100644 --- a/tests/pytests/unit/modules/test_mac_xattr.py +++ b/tests/pytests/unit/modules/test_mac_xattr.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.mac_xattr as xattr import salt.utils.mac_utils from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/modules/test_macdefaults.py b/tests/pytests/unit/modules/test_macdefaults.py index a5bcb1c7eec..dc0fa649505 100644 --- a/tests/pytests/unit/modules/test_macdefaults.py +++ b/tests/pytests/unit/modules/test_macdefaults.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.macdefaults as macdefaults from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_macpackage.py b/tests/pytests/unit/modules/test_macpackage.py index 883393c7c82..9eeb62d25ac 100644 --- a/tests/pytests/unit/modules/test_macpackage.py +++ b/tests/pytests/unit/modules/test_macpackage.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.macpackage as macpackage from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/modules/test_mandrill.py b/tests/pytests/unit/modules/test_mandrill.py index 8edca58ae8e..c1930d470e3 100644 --- a/tests/pytests/unit/modules/test_mandrill.py +++ b/tests/pytests/unit/modules/test_mandrill.py @@ -4,6 +4,7 @@ Tests for the Mandrill execution module. import pytest + import salt.modules.mandrill as mandrill from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_match.py b/tests/pytests/unit/modules/test_match.py index 391cc37d356..c5f0fc180dd 100644 --- a/tests/pytests/unit/modules/test_match.py +++ b/tests/pytests/unit/modules/test_match.py @@ -4,6 +4,7 @@ import pytest + import salt.loader import salt.matchers.compound_match as compound_match import salt.matchers.glob_match as glob_match diff --git a/tests/pytests/unit/modules/test_mdadm_raid.py b/tests/pytests/unit/modules/test_mdadm_raid.py index f9a04193015..40716d029ad 100644 --- a/tests/pytests/unit/modules/test_mdadm_raid.py +++ b/tests/pytests/unit/modules/test_mdadm_raid.py @@ -9,6 +9,7 @@ import re import sys import pytest + import salt.modules.mdadm_raid as mdadm from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mine.py b/tests/pytests/unit/modules/test_mine.py index 0e2bb0c43f6..9fdfecbd0c1 100644 --- a/tests/pytests/unit/modules/test_mine.py +++ b/tests/pytests/unit/modules/test_mine.py @@ -5,6 +5,7 @@ import pytest + import salt.modules.mine as mine import salt.utils.mine from salt.utils.odict import OrderedDict diff --git a/tests/pytests/unit/modules/test_mod_random.py b/tests/pytests/unit/modules/test_mod_random.py index cd3965c7c0b..a92c1a4c420 100644 --- a/tests/pytests/unit/modules/test_mod_random.py +++ b/tests/pytests/unit/modules/test_mod_random.py @@ -5,6 +5,7 @@ import re import pytest + import salt.modules.mod_random as mod_random import salt.utils.pycrypto from salt.exceptions import SaltInvocationError diff --git a/tests/pytests/unit/modules/test_modjk.py b/tests/pytests/unit/modules/test_modjk.py index 1328659fad9..948694979bc 100644 --- a/tests/pytests/unit/modules/test_modjk.py +++ b/tests/pytests/unit/modules/test_modjk.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.modjk as modjk from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_monit.py b/tests/pytests/unit/modules/test_monit.py index f9f2f107079..092782bc1dd 100644 --- a/tests/pytests/unit/modules/test_monit.py +++ b/tests/pytests/unit/modules/test_monit.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.monit as monit from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_moosefs.py b/tests/pytests/unit/modules/test_moosefs.py index ff6accacc3c..8c25918907c 100644 --- a/tests/pytests/unit/modules/test_moosefs.py +++ b/tests/pytests/unit/modules/test_moosefs.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.moosefs as moosefs from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mount.py b/tests/pytests/unit/modules/test_mount.py index 01112ccac88..4e233ec63c6 100644 --- a/tests/pytests/unit/modules/test_mount.py +++ b/tests/pytests/unit/modules/test_mount.py @@ -9,6 +9,7 @@ import sys import textwrap import pytest + import salt.modules.mount as mount import salt.utils.files import salt.utils.path diff --git a/tests/pytests/unit/modules/test_munin.py b/tests/pytests/unit/modules/test_munin.py index e5043dc390c..8850193853d 100644 --- a/tests/pytests/unit/modules/test_munin.py +++ b/tests/pytests/unit/modules/test_munin.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.munin as munin from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_mysql.py b/tests/pytests/unit/modules/test_mysql.py index 7a3c1a26327..4dc8c06c0e0 100644 --- a/tests/pytests/unit/modules/test_mysql.py +++ b/tests/pytests/unit/modules/test_mysql.py @@ -10,6 +10,7 @@ import logging import pytest + import salt.modules.mysql as mysql from tests.support.mock import MagicMock, call, mock_open, patch diff --git a/tests/pytests/unit/modules/test_network.py b/tests/pytests/unit/modules/test_network.py index 15fd5545a0b..81035434b61 100644 --- a/tests/pytests/unit/modules/test_network.py +++ b/tests/pytests/unit/modules/test_network.py @@ -1,6 +1,7 @@ import threading import pytest + import salt.modules.network as networkmod from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_nginx.py b/tests/pytests/unit/modules/test_nginx.py index f0ff95f0bc8..dee5c7f4ed0 100644 --- a/tests/pytests/unit/modules/test_nginx.py +++ b/tests/pytests/unit/modules/test_nginx.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.nginx as nginx from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_nilrt_ip.py b/tests/pytests/unit/modules/test_nilrt_ip.py index 3e4bd414e9f..379b23cd2ba 100644 --- a/tests/pytests/unit/modules/test_nilrt_ip.py +++ b/tests/pytests/unit/modules/test_nilrt_ip.py @@ -1,6 +1,7 @@ import io import pytest + import salt.modules.nilrt_ip as nilrt_ip from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_openbsd_sysctl.py b/tests/pytests/unit/modules/test_openbsd_sysctl.py index c9bc05b6902..9184bdfb4a2 100644 --- a/tests/pytests/unit/modules/test_openbsd_sysctl.py +++ b/tests/pytests/unit/modules/test_openbsd_sysctl.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.openbsd_sysctl as openbsd_sysctl from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_openbsdpkg.py b/tests/pytests/unit/modules/test_openbsdpkg.py index 62c8fa5d73b..33261be9464 100644 --- a/tests/pytests/unit/modules/test_openbsdpkg.py +++ b/tests/pytests/unit/modules/test_openbsdpkg.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.openbsdpkg as openbsdpkg from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/modules/test_opkg.py b/tests/pytests/unit/modules/test_opkg.py index 7fd12015e58..96081c32adc 100644 --- a/tests/pytests/unit/modules/test_opkg.py +++ b/tests/pytests/unit/modules/test_opkg.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.opkg as opkg from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_pacmanpkg.py b/tests/pytests/unit/modules/test_pacmanpkg.py index f5878e10733..09a6f6aef16 100644 --- a/tests/pytests/unit/modules/test_pacmanpkg.py +++ b/tests/pytests/unit/modules/test_pacmanpkg.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.pacmanpkg as pacman from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pcs.py b/tests/pytests/unit/modules/test_pcs.py index 9c667f6e2d4..4bc0d7d6f49 100644 --- a/tests/pytests/unit/modules/test_pcs.py +++ b/tests/pytests/unit/modules/test_pcs.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.pcs as pcs from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pdbedit.py b/tests/pytests/unit/modules/test_pdbedit.py index 6719b390952..a132a4b5128 100644 --- a/tests/pytests/unit/modules/test_pdbedit.py +++ b/tests/pytests/unit/modules/test_pdbedit.py @@ -1,6 +1,7 @@ from textwrap import dedent import pytest + import salt.modules.pdbedit as pdbedit from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pf.py b/tests/pytests/unit/modules/test_pf.py index b50a3610b7b..2a7cbf6983d 100644 --- a/tests/pytests/unit/modules/test_pf.py +++ b/tests/pytests/unit/modules/test_pf.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.pf as pf from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pillar.py b/tests/pytests/unit/modules/test_pillar.py index 722eb75fa32..2f62d497e3b 100644 --- a/tests/pytests/unit/modules/test_pillar.py +++ b/tests/pytests/unit/modules/test_pillar.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.pillar as pillarmod from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pip.py b/tests/pytests/unit/modules/test_pip.py index 405ec6c82e8..b1a7cbfa6d0 100644 --- a/tests/pytests/unit/modules/test_pip.py +++ b/tests/pytests/unit/modules/test_pip.py @@ -2,6 +2,7 @@ import os import sys import pytest + import salt.modules.pip as pip import salt.utils.files import salt.utils.platform diff --git a/tests/pytests/unit/modules/test_pkg_resource.py b/tests/pytests/unit/modules/test_pkg_resource.py index 8ca28e27840..7ea04d2262a 100644 --- a/tests/pytests/unit/modules/test_pkg_resource.py +++ b/tests/pytests/unit/modules/test_pkg_resource.py @@ -3,10 +3,11 @@ """ import pytest +import yaml + import salt.modules.pkg_resource as pkg_resource import salt.utils.data import salt.utils.yaml -import yaml from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pkgin.py b/tests/pytests/unit/modules/test_pkgin.py index 81d71fcb5af..db5845907a8 100644 --- a/tests/pytests/unit/modules/test_pkgin.py +++ b/tests/pytests/unit/modules/test_pkgin.py @@ -1,6 +1,7 @@ import os import pytest + import salt.modules.pkgin as pkgin from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pkgng.py b/tests/pytests/unit/modules/test_pkgng.py index 880072f59a7..1e3eb59b9eb 100644 --- a/tests/pytests/unit/modules/test_pkgng.py +++ b/tests/pytests/unit/modules/test_pkgng.py @@ -1,6 +1,7 @@ import textwrap import pytest + import salt.modules.pkgng as pkgng from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pkgutil.py b/tests/pytests/unit/modules/test_pkgutil.py index de43679a8c4..627c807d917 100644 --- a/tests/pytests/unit/modules/test_pkgutil.py +++ b/tests/pytests/unit/modules/test_pkgutil.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.pkgutil as pkgutil import salt.utils.pkg from salt.exceptions import CommandExecutionError, MinionError diff --git a/tests/pytests/unit/modules/test_portage_config.py b/tests/pytests/unit/modules/test_portage_config.py index 5cc6b90596d..34b388a8a43 100644 --- a/tests/pytests/unit/modules/test_portage_config.py +++ b/tests/pytests/unit/modules/test_portage_config.py @@ -5,6 +5,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import pytest + import salt.modules.portage_config as portage_config import salt.utils.files from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_postfix.py b/tests/pytests/unit/modules/test_postfix.py index f25308cb188..e834b654473 100644 --- a/tests/pytests/unit/modules/test_postfix.py +++ b/tests/pytests/unit/modules/test_postfix.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.postfix as postfix from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_postgres.py b/tests/pytests/unit/modules/test_postgres.py index 30d8219837a..ec25e4d5918 100644 --- a/tests/pytests/unit/modules/test_postgres.py +++ b/tests/pytests/unit/modules/test_postgres.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.postgres as postgres from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_poudriere.py b/tests/pytests/unit/modules/test_poudriere.py index 77a3bcbb184..4f069f47715 100644 --- a/tests/pytests/unit/modules/test_poudriere.py +++ b/tests/pytests/unit/modules/test_poudriere.py @@ -5,6 +5,7 @@ import os import pytest + import salt.modules.poudriere as poudriere from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/modules/test_powerpath.py b/tests/pytests/unit/modules/test_powerpath.py index fde9dbedb3b..dd5263dc0a9 100644 --- a/tests/pytests/unit/modules/test_powerpath.py +++ b/tests/pytests/unit/modules/test_powerpath.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.powerpath as powerpath from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_proxy.py b/tests/pytests/unit/modules/test_proxy.py index 1462aae8dc4..9ca822e2e68 100644 --- a/tests/pytests/unit/modules/test_proxy.py +++ b/tests/pytests/unit/modules/test_proxy.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.proxy as proxy from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/modules/test_publish.py b/tests/pytests/unit/modules/test_publish.py index a5df8bda73a..38731761a91 100644 --- a/tests/pytests/unit/modules/test_publish.py +++ b/tests/pytests/unit/modules/test_publish.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.publish as publish from salt.exceptions import SaltReqTimeoutError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_puppet.py b/tests/pytests/unit/modules/test_puppet.py index d4e9f04e0ac..4afd9859b3d 100644 --- a/tests/pytests/unit/modules/test_puppet.py +++ b/tests/pytests/unit/modules/test_puppet.py @@ -6,6 +6,7 @@ import errno import os import pytest + import salt.modules.puppet as puppet import salt.utils.args import salt.utils.files diff --git a/tests/pytests/unit/modules/test_purefb.py b/tests/pytests/unit/modules/test_purefb.py index c8799d69ca5..f47e19c2df8 100644 --- a/tests/pytests/unit/modules/test_purefb.py +++ b/tests/pytests/unit/modules/test_purefb.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.purefb as purefb from tests.support.mock import patch diff --git a/tests/pytests/unit/modules/test_pw_group.py b/tests/pytests/unit/modules/test_pw_group.py index a53824aa4c3..e469b174c6f 100644 --- a/tests/pytests/unit/modules/test_pw_group.py +++ b/tests/pytests/unit/modules/test_pw_group.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.pw_group as pw_group from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pw_user.py b/tests/pytests/unit/modules/test_pw_user.py index 02d9fddf70d..c527bcbd2df 100644 --- a/tests/pytests/unit/modules/test_pw_user.py +++ b/tests/pytests/unit/modules/test_pw_user.py @@ -6,6 +6,7 @@ import logging import pytest + import salt.modules.pw_user as pw_user from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_pyenv.py b/tests/pytests/unit/modules/test_pyenv.py index 88885cb8110..221fb52426e 100644 --- a/tests/pytests/unit/modules/test_pyenv.py +++ b/tests/pytests/unit/modules/test_pyenv.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.pyenv as pyenv from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_qemu_img.py b/tests/pytests/unit/modules/test_qemu_img.py index d7bc7b12a55..b616f6f172b 100644 --- a/tests/pytests/unit/modules/test_qemu_img.py +++ b/tests/pytests/unit/modules/test_qemu_img.py @@ -6,6 +6,7 @@ import os import pytest + import salt.modules.qemu_img as qemu_img from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_qemu_nbd.py b/tests/pytests/unit/modules/test_qemu_nbd.py index 188db066932..06fbd8d4741 100644 --- a/tests/pytests/unit/modules/test_qemu_nbd.py +++ b/tests/pytests/unit/modules/test_qemu_nbd.py @@ -7,6 +7,7 @@ import os.path import tempfile import pytest + import salt.modules.qemu_nbd as qemu_nbd from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_rabbitmq.py b/tests/pytests/unit/modules/test_rabbitmq.py index bc6e6de41a1..b9004962b4f 100644 --- a/tests/pytests/unit/modules/test_rabbitmq.py +++ b/tests/pytests/unit/modules/test_rabbitmq.py @@ -6,6 +6,7 @@ import logging import pytest + import salt.modules.rabbitmq as rabbitmq from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_rebootmgr.py b/tests/pytests/unit/modules/test_rebootmgr.py index a2ceb65cd95..8bbe2f7c67b 100644 --- a/tests/pytests/unit/modules/test_rebootmgr.py +++ b/tests/pytests/unit/modules/test_rebootmgr.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.rebootmgr as rebootmgr from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_restartcheck.py b/tests/pytests/unit/modules/test_restartcheck.py index 8c540634216..71ddfba9e8b 100644 --- a/tests/pytests/unit/modules/test_restartcheck.py +++ b/tests/pytests/unit/modules/test_restartcheck.py @@ -1,6 +1,7 @@ import io import pytest + import salt.modules.cmdmod as cmdmod import salt.modules.restartcheck as restartcheck import salt.modules.system as system diff --git a/tests/pytests/unit/modules/test_restconf.py b/tests/pytests/unit/modules/test_restconf.py index 3ebbd9da949..6c4bea1deac 100644 --- a/tests/pytests/unit/modules/test_restconf.py +++ b/tests/pytests/unit/modules/test_restconf.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.restconf as restconf from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_rpm_lowpkg.py b/tests/pytests/unit/modules/test_rpm_lowpkg.py index f19afa854e2..cb7cb9e9bd2 100644 --- a/tests/pytests/unit/modules/test_rpm_lowpkg.py +++ b/tests/pytests/unit/modules/test_rpm_lowpkg.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.cmdmod import salt.modules.rpm_lowpkg as rpm import salt.utils.path diff --git a/tests/pytests/unit/modules/test_saltcloudmod.py b/tests/pytests/unit/modules/test_saltcloudmod.py index 112e345587f..54f56552329 100644 --- a/tests/pytests/unit/modules/test_saltcloudmod.py +++ b/tests/pytests/unit/modules/test_saltcloudmod.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.saltcloudmod as saltcloudmod import salt.utils.json from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_saltutil.py b/tests/pytests/unit/modules/test_saltutil.py index 3fda5f3a0a5..889543c9454 100644 --- a/tests/pytests/unit/modules/test_saltutil.py +++ b/tests/pytests/unit/modules/test_saltutil.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.saltutil as saltutil from salt.client import LocalClient from tests.support.mock import create_autospec diff --git a/tests/pytests/unit/modules/test_schedule.py b/tests/pytests/unit/modules/test_schedule.py index da520a8c08b..2a8e849ffaf 100644 --- a/tests/pytests/unit/modules/test_schedule.py +++ b/tests/pytests/unit/modules/test_schedule.py @@ -6,6 +6,7 @@ import datetime import logging import pytest + import salt.modules.schedule as schedule import salt.utils.odict from salt.utils.event import SaltEvent diff --git a/tests/pytests/unit/modules/test_scsi.py b/tests/pytests/unit/modules/test_scsi.py index c085b06af45..6179ec25aab 100644 --- a/tests/pytests/unit/modules/test_scsi.py +++ b/tests/pytests/unit/modules/test_scsi.py @@ -6,6 +6,7 @@ import copy import os import pytest + import salt.modules.scsi as scsi import salt.utils.path from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_sdb.py b/tests/pytests/unit/modules/test_sdb.py index c1248174f34..01d1e1a6273 100644 --- a/tests/pytests/unit/modules/test_sdb.py +++ b/tests/pytests/unit/modules/test_sdb.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.modules.sdb as sdb from salt.exceptions import SaltInvocationError diff --git a/tests/pytests/unit/modules/test_seed.py b/tests/pytests/unit/modules/test_seed.py index d0c6f9b3c1f..ee51cdc3a5c 100644 --- a/tests/pytests/unit/modules/test_seed.py +++ b/tests/pytests/unit/modules/test_seed.py @@ -7,6 +7,7 @@ import shutil import uuid import pytest + import salt.modules.seed as seed import salt.utils.files import salt.utils.odict diff --git a/tests/pytests/unit/modules/test_selinux.py b/tests/pytests/unit/modules/test_selinux.py index 2c6942b47b1..e1f66dcfb3f 100644 --- a/tests/pytests/unit/modules/test_selinux.py +++ b/tests/pytests/unit/modules/test_selinux.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.selinux as selinux from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_sensors.py b/tests/pytests/unit/modules/test_sensors.py index 3553ad5d25e..d07cfe398d7 100644 --- a/tests/pytests/unit/modules/test_sensors.py +++ b/tests/pytests/unit/modules/test_sensors.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.sensors as sensors from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_slack.py b/tests/pytests/unit/modules/test_slack.py index cfc4609968a..94196061477 100644 --- a/tests/pytests/unit/modules/test_slack.py +++ b/tests/pytests/unit/modules/test_slack.py @@ -5,6 +5,7 @@ Tests for salt.modules.slack module import urllib.parse import pytest + import salt.modules.slack_notify as slack_notify from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_slackware_service.py b/tests/pytests/unit/modules/test_slackware_service.py index 2fe38c52325..c2cd52e1a5d 100644 --- a/tests/pytests/unit/modules/test_slackware_service.py +++ b/tests/pytests/unit/modules/test_slackware_service.py @@ -4,6 +4,7 @@ import os import pytest + import salt.modules.slackware_service as slackware_service from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_slsutil.py b/tests/pytests/unit/modules/test_slsutil.py index 5b1e1de2b94..49651d55c27 100644 --- a/tests/pytests/unit/modules/test_slsutil.py +++ b/tests/pytests/unit/modules/test_slsutil.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.exceptions import salt.modules.slsutil as slsutil from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/modules/test_solaris_shadow.py b/tests/pytests/unit/modules/test_solaris_shadow.py index 0044b3988e0..4cc99c6e983 100644 --- a/tests/pytests/unit/modules/test_solaris_shadow.py +++ b/tests/pytests/unit/modules/test_solaris_shadow.py @@ -2,6 +2,7 @@ import io from textwrap import dedent import pytest + import salt.modules.solaris_shadow as solaris_shadow from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_solarisipspkg.py b/tests/pytests/unit/modules/test_solarisipspkg.py index dfdc16c3d6d..2c048437279 100644 --- a/tests/pytests/unit/modules/test_solarisipspkg.py +++ b/tests/pytests/unit/modules/test_solarisipspkg.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.modules.solarisipspkg as solarisipspkg from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/modules/test_solarispkg.py b/tests/pytests/unit/modules/test_solarispkg.py index abe961b49a2..923117252f8 100644 --- a/tests/pytests/unit/modules/test_solarispkg.py +++ b/tests/pytests/unit/modules/test_solarispkg.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.modules.solarispkg as solarispkg from tests.support.mock import ANY, MagicMock, call, patch diff --git a/tests/pytests/unit/modules/test_status.py b/tests/pytests/unit/modules/test_status.py index 63fc2dbe643..74f11f0ab13 100644 --- a/tests/pytests/unit/modules/test_status.py +++ b/tests/pytests/unit/modules/test_status.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.status as status from salt.exceptions import CommandExecutionError from tests.support.mock import Mock, patch diff --git a/tests/pytests/unit/modules/test_suse_ip.py b/tests/pytests/unit/modules/test_suse_ip.py index a21595c5613..b6812a0043f 100644 --- a/tests/pytests/unit/modules/test_suse_ip.py +++ b/tests/pytests/unit/modules/test_suse_ip.py @@ -3,6 +3,7 @@ import os import jinja2.exceptions import pytest + import salt.modules.suse_ip as suse_ip from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_swarm.py b/tests/pytests/unit/modules/test_swarm.py index 28235464188..6a2c940e6b7 100644 --- a/tests/pytests/unit/modules/test_swarm.py +++ b/tests/pytests/unit/modules/test_swarm.py @@ -1,6 +1,7 @@ import pytest -import salt.modules.swarm as swarm from requests.models import Response + +import salt.modules.swarm as swarm from tests.support.mock import DEFAULT, MagicMock, patch HAS_DOCKER = False diff --git a/tests/pytests/unit/modules/test_tls.py b/tests/pytests/unit/modules/test_tls.py index cd4b7aba050..3a9d5f9c2bf 100644 --- a/tests/pytests/unit/modules/test_tls.py +++ b/tests/pytests/unit/modules/test_tls.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.modules.tls as tls from tests.support.helpers import SKIP_INITIAL_PHOTONOS_FAILURES from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_transactional_update.py b/tests/pytests/unit/modules/test_transactional_update.py index 72f0608718d..5d9294c49bd 100644 --- a/tests/pytests/unit/modules/test_transactional_update.py +++ b/tests/pytests/unit/modules/test_transactional_update.py @@ -1,4 +1,5 @@ import pytest + import salt.loader.context import salt.modules.state as statemod import salt.modules.transactional_update as tu diff --git a/tests/pytests/unit/modules/test_useradd.py b/tests/pytests/unit/modules/test_useradd.py index b60b84a71d8..209c6ebed0e 100644 --- a/tests/pytests/unit/modules/test_useradd.py +++ b/tests/pytests/unit/modules/test_useradd.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.useradd as useradd from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_win_autoruns.py b/tests/pytests/unit/modules/test_win_autoruns.py index e363740244d..dd8060eedd8 100644 --- a/tests/pytests/unit/modules/test_win_autoruns.py +++ b/tests/pytests/unit/modules/test_win_autoruns.py @@ -4,6 +4,7 @@ import pytest + import salt.modules.win_autoruns as win_autoruns from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_win_certutil.py b/tests/pytests/unit/modules/test_win_certutil.py index fca50fe999b..6c3bb69955a 100644 --- a/tests/pytests/unit/modules/test_win_certutil.py +++ b/tests/pytests/unit/modules/test_win_certutil.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.win_certutil as certutil from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_win_disk.py b/tests/pytests/unit/modules/test_win_disk.py index 408aba4e408..dedeb2ab0e0 100644 --- a/tests/pytests/unit/modules/test_win_disk.py +++ b/tests/pytests/unit/modules/test_win_disk.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.win_disk as win_disk diff --git a/tests/pytests/unit/modules/test_win_dism.py b/tests/pytests/unit/modules/test_win_dism.py index de7612ac83a..c841e191aa0 100644 --- a/tests/pytests/unit/modules/test_win_dism.py +++ b/tests/pytests/unit/modules/test_win_dism.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.win_dism as dism from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_win_dns_client.py b/tests/pytests/unit/modules/test_win_dns_client.py index 2cfac17850f..d48b7fa8276 100644 --- a/tests/pytests/unit/modules/test_win_dns_client.py +++ b/tests/pytests/unit/modules/test_win_dns_client.py @@ -6,6 +6,7 @@ import types import pytest + import salt.modules.win_dns_client as win_dns_client import salt.utils.stringutils from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/modules/test_win_file.py b/tests/pytests/unit/modules/test_win_file.py index 096a974df27..efcdb31a550 100644 --- a/tests/pytests/unit/modules/test_win_file.py +++ b/tests/pytests/unit/modules/test_win_file.py @@ -1,6 +1,7 @@ import re import pytest + import salt.modules.win_file as win_file from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/modules/test_win_network.py b/tests/pytests/unit/modules/test_win_network.py index 601f3cb3ed9..524bc198e2f 100644 --- a/tests/pytests/unit/modules/test_win_network.py +++ b/tests/pytests/unit/modules/test_win_network.py @@ -5,6 +5,7 @@ import socket import pytest + import salt.modules.win_network as win_network import salt.utils.network from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/modules/test_win_ntp.py b/tests/pytests/unit/modules/test_win_ntp.py index 63851177a2c..1e3d15af6a6 100644 --- a/tests/pytests/unit/modules/test_win_ntp.py +++ b/tests/pytests/unit/modules/test_win_ntp.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.win_ntp as win_ntp from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_win_path.py b/tests/pytests/unit/modules/test_win_path.py index de08172fe07..7dad024a878 100644 --- a/tests/pytests/unit/modules/test_win_path.py +++ b/tests/pytests/unit/modules/test_win_path.py @@ -6,6 +6,7 @@ import os import pytest + import salt.modules.win_path as win_path import salt.utils.stringutils import salt.utils.win_reg as reg_util diff --git a/tests/pytests/unit/modules/test_win_pkg.py b/tests/pytests/unit/modules/test_win_pkg.py index 8611b614c41..c14cadb5994 100644 --- a/tests/pytests/unit/modules/test_win_pkg.py +++ b/tests/pytests/unit/modules/test_win_pkg.py @@ -2,6 +2,7 @@ Tests for the win_pkg module """ import pytest + import salt.modules.config as config import salt.modules.pkg_resource as pkg_resource import salt.modules.win_pkg as win_pkg diff --git a/tests/pytests/unit/modules/test_win_servermanager.py b/tests/pytests/unit/modules/test_win_servermanager.py index a7fb7d62a93..ef00470c0d6 100644 --- a/tests/pytests/unit/modules/test_win_servermanager.py +++ b/tests/pytests/unit/modules/test_win_servermanager.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.win_servermanager as win_servermanager from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_win_timezone.py b/tests/pytests/unit/modules/test_win_timezone.py index 0e5d82762f7..26a867dff85 100644 --- a/tests/pytests/unit/modules/test_win_timezone.py +++ b/tests/pytests/unit/modules/test_win_timezone.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.modules.win_timezone as win_timezone from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/test_zabbix.py b/tests/pytests/unit/modules/test_zabbix.py index 6fdc6c4b443..5c2f8fc7ee5 100644 --- a/tests/pytests/unit/modules/test_zabbix.py +++ b/tests/pytests/unit/modules/test_zabbix.py @@ -4,6 +4,7 @@ """ import pytest + import salt.modules.config as config import salt.modules.zabbix as zabbix from salt.exceptions import SaltException diff --git a/tests/pytests/unit/modules/test_zfs.py b/tests/pytests/unit/modules/test_zfs.py index a1895a565cf..6c77e04ec6f 100644 --- a/tests/pytests/unit/modules/test_zfs.py +++ b/tests/pytests/unit/modules/test_zfs.py @@ -9,6 +9,7 @@ Tests for salt.modules.zfs """ import pytest + import salt.loader import salt.modules.zfs as zfs import salt.utils.zfs diff --git a/tests/pytests/unit/modules/test_zfs_solaris10.py b/tests/pytests/unit/modules/test_zfs_solaris10.py index 60d7cdce912..8bb12cf4279 100644 --- a/tests/pytests/unit/modules/test_zfs_solaris10.py +++ b/tests/pytests/unit/modules/test_zfs_solaris10.py @@ -3,6 +3,7 @@ Tests for salt.modules.zfs on Solaris """ import pytest + import salt.config import salt.loader import salt.modules.zfs as zfs diff --git a/tests/pytests/unit/modules/test_zfs_solaris11.py b/tests/pytests/unit/modules/test_zfs_solaris11.py index d2d54bf4e0c..0da337a0a3e 100644 --- a/tests/pytests/unit/modules/test_zfs_solaris11.py +++ b/tests/pytests/unit/modules/test_zfs_solaris11.py @@ -3,6 +3,7 @@ Tests for salt.modules.zfs on Solaris """ import pytest + import salt.config import salt.loader import salt.modules.zfs as zfs diff --git a/tests/pytests/unit/modules/test_zpool.py b/tests/pytests/unit/modules/test_zpool.py index 19328246acf..75685882fb0 100644 --- a/tests/pytests/unit/modules/test_zpool.py +++ b/tests/pytests/unit/modules/test_zpool.py @@ -9,6 +9,7 @@ Tests for salt.modules.zpool """ import pytest + import salt.loader import salt.modules.zpool as zpool import salt.utils.decorators diff --git a/tests/pytests/unit/modules/test_zypperpkg.py b/tests/pytests/unit/modules/test_zypperpkg.py index 70bd837c5f9..e75b2fa6e62 100644 --- a/tests/pytests/unit/modules/test_zypperpkg.py +++ b/tests/pytests/unit/modules/test_zypperpkg.py @@ -6,6 +6,7 @@ import os import pytest + import salt.modules.pkg_resource as pkg_resource import salt.modules.zypperpkg as zypper from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/virt/conftest.py b/tests/pytests/unit/modules/virt/conftest.py index 0e7e5a1c70e..03225530056 100644 --- a/tests/pytests/unit/modules/virt/conftest.py +++ b/tests/pytests/unit/modules/virt/conftest.py @@ -1,6 +1,7 @@ import xml.etree.ElementTree as ET import pytest + import salt.modules.config as config import salt.modules.virt as virt from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/modules/virt/test_domain.py b/tests/pytests/unit/modules/virt/test_domain.py index b151afd8286..6446fd5cc7d 100644 --- a/tests/pytests/unit/modules/virt/test_domain.py +++ b/tests/pytests/unit/modules/virt/test_domain.py @@ -2,6 +2,7 @@ import os.path import xml.etree.ElementTree as ET import pytest + import salt.modules.virt as virt import salt.syspaths import salt.utils.xmlutil as xmlutil diff --git a/tests/pytests/unit/modules/virt/test_host.py b/tests/pytests/unit/modules/virt/test_host.py index c5cadb8aa03..16bde3ffd7f 100644 --- a/tests/pytests/unit/modules/virt/test_host.py +++ b/tests/pytests/unit/modules/virt/test_host.py @@ -1,6 +1,7 @@ import os.path import pytest + import salt.modules.virt as virt from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/modules/virt/test_network.py b/tests/pytests/unit/modules/virt/test_network.py index ccb579aad7d..b033484db60 100644 --- a/tests/pytests/unit/modules/virt/test_network.py +++ b/tests/pytests/unit/modules/virt/test_network.py @@ -1,6 +1,7 @@ import xml.etree.ElementTree as ET import pytest + import salt.modules.virt as virt import salt.utils.xmlutil as xmlutil diff --git a/tests/pytests/unit/netapi/cherrypy/test_events.py b/tests/pytests/unit/netapi/cherrypy/test_events.py index 51cbdc2ee51..6302bb3b387 100644 --- a/tests/pytests/unit/netapi/cherrypy/test_events.py +++ b/tests/pytests/unit/netapi/cherrypy/test_events.py @@ -1,6 +1,7 @@ import time import pytest + import salt.netapi.rest_cherrypy.app as cherrypy_app from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/netapi/saltnado/test_base_handler.py b/tests/pytests/unit/netapi/saltnado/test_base_handler.py index 392d93ea655..5f64b22fe04 100644 --- a/tests/pytests/unit/netapi/saltnado/test_base_handler.py +++ b/tests/pytests/unit/netapi/saltnado/test_base_handler.py @@ -1,6 +1,7 @@ import time import pytest + import salt.netapi.rest_tornado.saltnado as saltnado_app from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/output/test_highstate.py b/tests/pytests/unit/output/test_highstate.py index 64ce0ff2fee..347923db352 100644 --- a/tests/pytests/unit/output/test_highstate.py +++ b/tests/pytests/unit/output/test_highstate.py @@ -3,6 +3,7 @@ import logging import sys import pytest + import salt.config import salt.output.highstate as highstate from tests.support.mock import patch diff --git a/tests/pytests/unit/pillar/test_etcd_pillar.py b/tests/pytests/unit/pillar/test_etcd_pillar.py index a2b07901193..ec08616e17c 100644 --- a/tests/pytests/unit/pillar/test_etcd_pillar.py +++ b/tests/pytests/unit/pillar/test_etcd_pillar.py @@ -5,6 +5,7 @@ """ import pytest + import salt.pillar.etcd_pillar as etcd_pillar import salt.utils.etcd_util as etcd_util from tests.support.mock import MagicMock, create_autospec, patch diff --git a/tests/pytests/unit/pillar/test_netbox.py b/tests/pytests/unit/pillar/test_netbox.py index 51703337f95..48463b26b2e 100644 --- a/tests/pytests/unit/pillar/test_netbox.py +++ b/tests/pytests/unit/pillar/test_netbox.py @@ -3,6 +3,7 @@ """ import pytest + import salt.pillar.netbox as netbox from tests.support.mock import patch diff --git a/tests/pytests/unit/pillar/test_pillar.py b/tests/pytests/unit/pillar/test_pillar.py index d375a37d476..a04dc7622d9 100644 --- a/tests/pytests/unit/pillar/test_pillar.py +++ b/tests/pytests/unit/pillar/test_pillar.py @@ -1,4 +1,5 @@ import pytest + import salt.loader import salt.pillar from salt.utils.odict import OrderedDict diff --git a/tests/pytests/unit/pillar/test_sql_base.py b/tests/pytests/unit/pillar/test_sql_base.py index 0d44c2d608d..8126d0868c0 100644 --- a/tests/pytests/unit/pillar/test_sql_base.py +++ b/tests/pytests/unit/pillar/test_sql_base.py @@ -1,4 +1,5 @@ import pytest + import salt.pillar.sql_base as sql_base from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/proxy/test_netmiko_px.py b/tests/pytests/unit/proxy/test_netmiko_px.py index 730234a60ef..29b0cbbfb34 100644 --- a/tests/pytests/unit/proxy/test_netmiko_px.py +++ b/tests/pytests/unit/proxy/test_netmiko_px.py @@ -6,8 +6,9 @@ import copy import logging import pytest -import salt.proxy.netmiko_px as netmiko_proxy from saltfactories.utils import random_string + +import salt.proxy.netmiko_px as netmiko_proxy from tests.support.mock import MagicMock, patch log = logging.getLogger(__name__) diff --git a/tests/pytests/unit/proxy/test_restconf.py b/tests/pytests/unit/proxy/test_restconf.py index f778a773af2..08e403c42b0 100644 --- a/tests/pytests/unit/proxy/test_restconf.py +++ b/tests/pytests/unit/proxy/test_restconf.py @@ -1,6 +1,7 @@ import sys import pytest + import salt.proxy.restconf as restconf from tests.support.mock import patch diff --git a/tests/pytests/unit/renderers/test_aws_kms.py b/tests/pytests/unit/renderers/test_aws_kms.py index 67ec5c07bd8..9770531633f 100644 --- a/tests/pytests/unit/renderers/test_aws_kms.py +++ b/tests/pytests/unit/renderers/test_aws_kms.py @@ -2,6 +2,7 @@ Unit tests for AWS KMS Decryption Renderer. """ import pytest + import salt.exceptions import salt.renderers.aws_kms as aws_kms from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/renderers/test_gpg.py b/tests/pytests/unit/renderers/test_gpg.py index aa7c43c0179..101bfdb2116 100644 --- a/tests/pytests/unit/renderers/test_gpg.py +++ b/tests/pytests/unit/renderers/test_gpg.py @@ -3,6 +3,7 @@ from subprocess import PIPE from textwrap import dedent import pytest + import salt.config import salt.renderers.gpg as gpg from salt.exceptions import SaltRenderError diff --git a/tests/pytests/unit/renderers/test_nacl.py b/tests/pytests/unit/renderers/test_nacl.py index 7e563be07de..c522c27e350 100644 --- a/tests/pytests/unit/renderers/test_nacl.py +++ b/tests/pytests/unit/renderers/test_nacl.py @@ -1,4 +1,5 @@ import pytest + import salt.renderers.nacl as nacl from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/renderers/test_stateconf.py b/tests/pytests/unit/renderers/test_stateconf.py index c207af35bc6..34899e3bb5c 100644 --- a/tests/pytests/unit/renderers/test_stateconf.py +++ b/tests/pytests/unit/renderers/test_stateconf.py @@ -4,6 +4,7 @@ import os.path import attr import pytest + import salt.config import salt.loader from salt.exceptions import SaltRenderError diff --git a/tests/pytests/unit/renderers/test_toml.py b/tests/pytests/unit/renderers/test_toml.py index aff23d7c6a1..50303e36e9b 100644 --- a/tests/pytests/unit/renderers/test_toml.py +++ b/tests/pytests/unit/renderers/test_toml.py @@ -1,4 +1,5 @@ import pytest + import salt.renderers.tomlmod import salt.serializers.toml diff --git a/tests/pytests/unit/renderers/test_yaml.py b/tests/pytests/unit/renderers/test_yaml.py index 93378224192..93fb8414203 100644 --- a/tests/pytests/unit/renderers/test_yaml.py +++ b/tests/pytests/unit/renderers/test_yaml.py @@ -2,6 +2,7 @@ import collections import textwrap import pytest + import salt.renderers.yaml as yaml from tests.support.mock import patch diff --git a/tests/pytests/unit/renderers/test_yamlex.py b/tests/pytests/unit/renderers/test_yamlex.py index 2fc4f5859e7..9c4e16df8dd 100644 --- a/tests/pytests/unit/renderers/test_yamlex.py +++ b/tests/pytests/unit/renderers/test_yamlex.py @@ -1,4 +1,5 @@ import pytest + import salt.serializers.yamlex as yamlex import salt.state from salt.config import minion_config diff --git a/tests/pytests/unit/returners/test_etcd_return.py b/tests/pytests/unit/returners/test_etcd_return.py index 3b2b3056ad0..6d4920519b3 100644 --- a/tests/pytests/unit/returners/test_etcd_return.py +++ b/tests/pytests/unit/returners/test_etcd_return.py @@ -7,6 +7,7 @@ import copy import pytest + import salt.returners.etcd_return as etcd_return import salt.utils.etcd_util as etcd_util import salt.utils.jid diff --git a/tests/pytests/unit/roster/test_ansible.py b/tests/pytests/unit/roster/test_ansible.py index 2c85b705ba0..7b96e6e642c 100644 --- a/tests/pytests/unit/roster/test_ansible.py +++ b/tests/pytests/unit/roster/test_ansible.py @@ -1,6 +1,7 @@ import shutil import pytest + import salt.loader import salt.roster.ansible as ansible from tests.support.mock import patch diff --git a/tests/pytests/unit/roster/test_dir.py b/tests/pytests/unit/roster/test_dir.py index 8a56b5eca05..72279119357 100644 --- a/tests/pytests/unit/roster/test_dir.py +++ b/tests/pytests/unit/roster/test_dir.py @@ -6,6 +6,7 @@ Test the directory roster. import logging import pytest + import salt.config import salt.loader import salt.roster.dir as dir_ diff --git a/tests/pytests/unit/runners/test_network.py b/tests/pytests/unit/runners/test_network.py index ce07fa33606..6d16d54eb94 100644 --- a/tests/pytests/unit/runners/test_network.py +++ b/tests/pytests/unit/runners/test_network.py @@ -4,6 +4,7 @@ Unit tests for Network runner import logging import pytest + import salt.runners.network as network from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/runners/test_pillar.py b/tests/pytests/unit/runners/test_pillar.py index 3a91ee208f1..02efc67ae9c 100644 --- a/tests/pytests/unit/runners/test_pillar.py +++ b/tests/pytests/unit/runners/test_pillar.py @@ -7,6 +7,7 @@ import os import shutil import pytest + import salt.runners.pillar as pillar_runner import salt.utils.files import salt.utils.gitfs diff --git a/tests/pytests/unit/runners/test_winrepo.py b/tests/pytests/unit/runners/test_winrepo.py index 5f4e2d3a66a..aecdaaf10a4 100644 --- a/tests/pytests/unit/runners/test_winrepo.py +++ b/tests/pytests/unit/runners/test_winrepo.py @@ -6,6 +6,7 @@ Test the winrepo runner import textwrap import pytest + import salt.runners.winrepo as winrepo import salt.utils.files import salt.utils.stringutils diff --git a/tests/pytests/unit/sdb/test_etcd_db.py b/tests/pytests/unit/sdb/test_etcd_db.py index eff5b99ffc7..3e572048d13 100644 --- a/tests/pytests/unit/sdb/test_etcd_db.py +++ b/tests/pytests/unit/sdb/test_etcd_db.py @@ -5,6 +5,7 @@ Test case for the etcd SDB module import logging import pytest + import salt.sdb.etcd_db as etcd_db import salt.utils.etcd_util as etcd_util from tests.support.mock import MagicMock, create_autospec, patch diff --git a/tests/pytests/unit/serializers/test_serializers.py b/tests/pytests/unit/serializers/test_serializers.py index 4d7c6cb2338..acb5ddb7f86 100644 --- a/tests/pytests/unit/serializers/test_serializers.py +++ b/tests/pytests/unit/serializers/test_serializers.py @@ -2,6 +2,8 @@ from textwrap import dedent import jinja2 import pytest +import yaml as _yaml + import salt.serializers.configparser as configparser import salt.serializers.json as json import salt.serializers.msgpack as msgpack @@ -10,7 +12,6 @@ import salt.serializers.python as python import salt.serializers.toml as toml import salt.serializers.yaml as yaml import salt.serializers.yamlex as yamlex -import yaml as _yaml from salt.serializers import SerializationError from salt.serializers.yaml import EncryptedString from salt.utils.odict import OrderedDict diff --git a/tests/pytests/unit/spm/test_pkgfiles.py b/tests/pytests/unit/spm/test_pkgfiles.py index 796feadc767..f6722fca0ff 100644 --- a/tests/pytests/unit/spm/test_pkgfiles.py +++ b/tests/pytests/unit/spm/test_pkgfiles.py @@ -1,6 +1,7 @@ import pathlib import pytest + import salt.spm.pkgfiles.local as spm import salt.syspaths from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/spm/test_spm.py b/tests/pytests/unit/spm/test_spm.py index 0ffb096cd4a..32528bc7cfb 100644 --- a/tests/pytests/unit/spm/test_spm.py +++ b/tests/pytests/unit/spm/test_spm.py @@ -2,6 +2,7 @@ import os import shutil import pytest + import salt.config import salt.spm import salt.utils.files diff --git a/tests/pytests/unit/state/test_multi_env_highstate.py b/tests/pytests/unit/state/test_multi_env_highstate.py index 2e7e4b089b9..d1ae83fabc2 100644 --- a/tests/pytests/unit/state/test_multi_env_highstate.py +++ b/tests/pytests/unit/state/test_multi_env_highstate.py @@ -6,6 +6,7 @@ import logging import os import pytest # pylint: disable=unused-import + import salt.exceptions import salt.state import salt.utils.files diff --git a/tests/pytests/unit/state/test_state_compiler.py b/tests/pytests/unit/state/test_state_compiler.py index 73f63366cc5..d720ea0ceba 100644 --- a/tests/pytests/unit/state/test_state_compiler.py +++ b/tests/pytests/unit/state/test_state_compiler.py @@ -5,6 +5,7 @@ import logging import pytest # pylint: disable=unused-import + import salt.exceptions import salt.state import salt.utils.files diff --git a/tests/pytests/unit/state/test_state_format_slots.py b/tests/pytests/unit/state/test_state_format_slots.py index 629b7d73b1b..0044da97f4f 100644 --- a/tests/pytests/unit/state/test_state_format_slots.py +++ b/tests/pytests/unit/state/test_state_format_slots.py @@ -5,6 +5,7 @@ import logging import pytest # pylint: disable=unused-import + import salt.exceptions import salt.state import salt.utils.files diff --git a/tests/pytests/unit/state/test_state_highstate.py b/tests/pytests/unit/state/test_state_highstate.py index 059f83fd9f2..12c4fb3d971 100644 --- a/tests/pytests/unit/state/test_state_highstate.py +++ b/tests/pytests/unit/state/test_state_highstate.py @@ -5,6 +5,7 @@ import logging import pytest # pylint: disable=unused-import + import salt.state log = logging.getLogger(__name__) diff --git a/tests/pytests/unit/state/test_state_options.py b/tests/pytests/unit/state/test_state_options.py index a302ac78c4f..810f73fa514 100644 --- a/tests/pytests/unit/state/test_state_options.py +++ b/tests/pytests/unit/state/test_state_options.py @@ -1,6 +1,7 @@ import itertools import pytest + import salt.config import salt.state diff --git a/tests/pytests/unit/state/test_state_returns.py b/tests/pytests/unit/state/test_state_returns.py index 685d5c23b5b..1a3253fbb8e 100644 --- a/tests/pytests/unit/state/test_state_returns.py +++ b/tests/pytests/unit/state/test_state_returns.py @@ -5,6 +5,7 @@ import logging import pytest # pylint: disable=unused-import + from salt.utils.decorators import state as statedecorators log = logging.getLogger(__name__) diff --git a/tests/pytests/unit/state/test_sub_state_returns.py b/tests/pytests/unit/state/test_sub_state_returns.py index b96bc07e7cb..d979f08a3eb 100644 --- a/tests/pytests/unit/state/test_sub_state_returns.py +++ b/tests/pytests/unit/state/test_sub_state_returns.py @@ -5,6 +5,7 @@ import logging import pytest # pylint: disable=unused-import + from salt.utils.decorators import state as statedecorators log = logging.getLogger(__name__) diff --git a/tests/pytests/unit/states/apache/test_apache.py b/tests/pytests/unit/states/apache/test_apache.py index 1a386dececc..eef4a6df14c 100644 --- a/tests/pytests/unit/states/apache/test_apache.py +++ b/tests/pytests/unit/states/apache/test_apache.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.apache as apache import salt.utils.files from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/states/apache/test_conf.py b/tests/pytests/unit/states/apache/test_conf.py index aa418c0148f..6d5fd04eb19 100644 --- a/tests/pytests/unit/states/apache/test_conf.py +++ b/tests/pytests/unit/states/apache/test_conf.py @@ -1,4 +1,5 @@ import pytest + import salt.states.apache_conf as apache_conf from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/apache/test_module.py b/tests/pytests/unit/states/apache/test_module.py index b2d7f8f7093..6edf200a4bc 100644 --- a/tests/pytests/unit/states/apache/test_module.py +++ b/tests/pytests/unit/states/apache/test_module.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.apache_module as apache_module from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/apache/test_site.py b/tests/pytests/unit/states/apache/test_site.py index 4dcd67424f4..881148de493 100644 --- a/tests/pytests/unit/states/apache/test_site.py +++ b/tests/pytests/unit/states/apache/test_site.py @@ -1,4 +1,5 @@ import pytest + import salt.states.apache_site as apache_site from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/file/test_absent.py b/tests/pytests/unit/states/file/test_absent.py index d7a6a2431a5..62fc16eb6e0 100644 --- a/tests/pytests/unit/states/file/test_absent.py +++ b/tests/pytests/unit/states/file/test_absent.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_comment.py b/tests/pytests/unit/states/file/test_comment.py index dceca84fc27..0eefd36d041 100644 --- a/tests/pytests/unit/states/file/test_comment.py +++ b/tests/pytests/unit/states/file/test_comment.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_copy.py b/tests/pytests/unit/states/file/test_copy.py index ce7161f02dc..579c7cf0c80 100644 --- a/tests/pytests/unit/states/file/test_copy.py +++ b/tests/pytests/unit/states/file/test_copy.py @@ -3,6 +3,7 @@ import os import shutil import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_directory.py b/tests/pytests/unit/states/file/test_directory.py index 1287609c6a8..042ecc9e61f 100644 --- a/tests/pytests/unit/states/file/test_directory.py +++ b/tests/pytests/unit/states/file/test_directory.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_filestate.py b/tests/pytests/unit/states/file/test_filestate.py index 2f9f369fb2c..ecbca012f59 100644 --- a/tests/pytests/unit/states/file/test_filestate.py +++ b/tests/pytests/unit/states/file/test_filestate.py @@ -5,6 +5,7 @@ import pprint import msgpack import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_find_keep_files.py b/tests/pytests/unit/states/file/test_find_keep_files.py index 03a591ad494..6854bd3e61e 100644 --- a/tests/pytests/unit/states/file/test_find_keep_files.py +++ b/tests/pytests/unit/states/file/test_find_keep_files.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.states.file as filestate log = logging.getLogger(__name__) diff --git a/tests/pytests/unit/states/file/test_hardlink.py b/tests/pytests/unit/states/file/test_hardlink.py index 6e0d29b0ddc..901cae3a4b0 100644 --- a/tests/pytests/unit/states/file/test_hardlink.py +++ b/tests/pytests/unit/states/file/test_hardlink.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_keyvalue.py b/tests/pytests/unit/states/file/test_keyvalue.py index 37dd9217cbc..396e29aea6d 100644 --- a/tests/pytests/unit/states/file/test_keyvalue.py +++ b/tests/pytests/unit/states/file/test_keyvalue.py @@ -2,6 +2,7 @@ import collections import logging import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_managed.py b/tests/pytests/unit/states/file/test_managed.py index 9d9fb177178..128c808e97f 100644 --- a/tests/pytests/unit/states/file/test_managed.py +++ b/tests/pytests/unit/states/file/test_managed.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_mod_beacon.py b/tests/pytests/unit/states/file/test_mod_beacon.py index 651ccea9137..512e55094b5 100644 --- a/tests/pytests/unit/states/file/test_mod_beacon.py +++ b/tests/pytests/unit/states/file/test_mod_beacon.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.beacons as beaconmod import salt.states.beacon as beaconstate import salt.states.file as filestate diff --git a/tests/pytests/unit/states/file/test_prepend.py b/tests/pytests/unit/states/file/test_prepend.py index ca4f519f834..e0b4edb8d99 100644 --- a/tests/pytests/unit/states/file/test_prepend.py +++ b/tests/pytests/unit/states/file/test_prepend.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_private_functions.py b/tests/pytests/unit/states/file/test_private_functions.py index f691f4f9260..b3fc7cbbe65 100644 --- a/tests/pytests/unit/states/file/test_private_functions.py +++ b/tests/pytests/unit/states/file/test_private_functions.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.modules.file as filemod import salt.states.file as filestate import salt.utils.files diff --git a/tests/pytests/unit/states/file/test_rename.py b/tests/pytests/unit/states/file/test_rename.py index b1d5caaf6a2..bccb59b8c03 100644 --- a/tests/pytests/unit/states/file/test_rename.py +++ b/tests/pytests/unit/states/file/test_rename.py @@ -3,6 +3,7 @@ import os import shutil import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_retention_schedule.py b/tests/pytests/unit/states/file/test_retention_schedule.py index 4d673fec269..f948338727d 100644 --- a/tests/pytests/unit/states/file/test_retention_schedule.py +++ b/tests/pytests/unit/states/file/test_retention_schedule.py @@ -3,6 +3,7 @@ import os from datetime import datetime import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_selinux.py b/tests/pytests/unit/states/file/test_selinux.py index 53ea53be6ba..707f69f4d7f 100644 --- a/tests/pytests/unit/states/file/test_selinux.py +++ b/tests/pytests/unit/states/file/test_selinux.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.states.file as filestate from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/file/test_symlink.py b/tests/pytests/unit/states/file/test_symlink.py index 81112b0fafd..384772937c4 100644 --- a/tests/pytests/unit/states/file/test_symlink.py +++ b/tests/pytests/unit/states/file/test_symlink.py @@ -2,6 +2,7 @@ import logging import os import pytest + import salt.serializers.json as jsonserializer import salt.serializers.msgpack as msgpackserializer import salt.serializers.plist as plistserializer diff --git a/tests/pytests/unit/states/file/test_tidied.py b/tests/pytests/unit/states/file/test_tidied.py index 6050745a3be..251b02f4f56 100644 --- a/tests/pytests/unit/states/file/test_tidied.py +++ b/tests/pytests/unit/states/file/test_tidied.py @@ -3,6 +3,7 @@ import os from datetime import datetime import pytest + import salt.states.file as filestate import salt.utils.files import salt.utils.json diff --git a/tests/pytests/unit/states/mysql/test_database.py b/tests/pytests/unit/states/mysql/test_database.py index de5f5704c31..4176d85fb88 100644 --- a/tests/pytests/unit/states/mysql/test_database.py +++ b/tests/pytests/unit/states/mysql/test_database.py @@ -2,6 +2,7 @@ This test checks mysql_database salt state """ import pytest + import salt.states.mysql_database as mysql_database from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/mysql/test_grants.py b/tests/pytests/unit/states/mysql/test_grants.py index c797af2011a..aa616bba484 100644 --- a/tests/pytests/unit/states/mysql/test_grants.py +++ b/tests/pytests/unit/states/mysql/test_grants.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.mysql_grants as mysql_grants from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/mysql/test_query.py b/tests/pytests/unit/states/mysql/test_query.py index 06a6dbf1774..1859afa3b2d 100644 --- a/tests/pytests/unit/states/mysql/test_query.py +++ b/tests/pytests/unit/states/mysql/test_query.py @@ -6,6 +6,7 @@ import logging import os import pytest + import salt.modules.mysql as mysql_mod import salt.states.mysql_query as mysql_query from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/mysql/test_user.py b/tests/pytests/unit/states/mysql/test_user.py index f15787d38bd..fe3e46c80fa 100644 --- a/tests/pytests/unit/states/mysql/test_user.py +++ b/tests/pytests/unit/states/mysql/test_user.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.mysql_user as mysql_user import salt.utils.data from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/postgresql/test_cluster.py b/tests/pytests/unit/states/postgresql/test_cluster.py index 8ece505ffcc..52e9f087131 100644 --- a/tests/pytests/unit/states/postgresql/test_cluster.py +++ b/tests/pytests/unit/states/postgresql/test_cluster.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.postgres_cluster as postgres_cluster from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/postgresql/test_database.py b/tests/pytests/unit/states/postgresql/test_database.py index 8e275c307fb..1e50574cad2 100644 --- a/tests/pytests/unit/states/postgresql/test_database.py +++ b/tests/pytests/unit/states/postgresql/test_database.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.postgres_database as postgres_database from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/postgresql/test_extension.py b/tests/pytests/unit/states/postgresql/test_extension.py index 959e9375da4..c5f0cbf7854 100644 --- a/tests/pytests/unit/states/postgresql/test_extension.py +++ b/tests/pytests/unit/states/postgresql/test_extension.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.postgres as postgresmod import salt.states.postgres_extension as postgres_extension from tests.support.mock import Mock, patch diff --git a/tests/pytests/unit/states/postgresql/test_group.py b/tests/pytests/unit/states/postgresql/test_group.py index e04ea3d88ca..2eb77bf4c0f 100644 --- a/tests/pytests/unit/states/postgresql/test_group.py +++ b/tests/pytests/unit/states/postgresql/test_group.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.postgres as postgres import salt.states.postgres_group as postgres_group from tests.support.mock import create_autospec, patch diff --git a/tests/pytests/unit/states/postgresql/test_initdb.py b/tests/pytests/unit/states/postgresql/test_initdb.py index ed6316e9cff..aee445743f3 100644 --- a/tests/pytests/unit/states/postgresql/test_initdb.py +++ b/tests/pytests/unit/states/postgresql/test_initdb.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.postgres_initdb as postgres_initdb from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/postgresql/test_language.py b/tests/pytests/unit/states/postgresql/test_language.py index 5c10f52dd83..f8a1fa0dbd3 100644 --- a/tests/pytests/unit/states/postgresql/test_language.py +++ b/tests/pytests/unit/states/postgresql/test_language.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.postgres_language as postgres_language from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/postgresql/test_privileges.py b/tests/pytests/unit/states/postgresql/test_privileges.py index df1c98f56b8..c11a2f5af2e 100644 --- a/tests/pytests/unit/states/postgresql/test_privileges.py +++ b/tests/pytests/unit/states/postgresql/test_privileges.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.postgres_privileges as postgres_privileges from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/postgresql/test_schema.py b/tests/pytests/unit/states/postgresql/test_schema.py index 0d1ab31fd5d..516fddae02d 100644 --- a/tests/pytests/unit/states/postgresql/test_schema.py +++ b/tests/pytests/unit/states/postgresql/test_schema.py @@ -1,4 +1,5 @@ import pytest + import salt.states.postgres_schema as postgres_schema from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/states/postgresql/test_user.py b/tests/pytests/unit/states/postgresql/test_user.py index f182145b400..46d76535144 100644 --- a/tests/pytests/unit/states/postgresql/test_user.py +++ b/tests/pytests/unit/states/postgresql/test_user.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.postgres as postgres import salt.states.postgres_user as postgres_user from tests.support.mock import create_autospec, patch diff --git a/tests/pytests/unit/states/rabbitmq/test_cluster.py b/tests/pytests/unit/states/rabbitmq/test_cluster.py index 5a35d07a157..851e6deb9e4 100644 --- a/tests/pytests/unit/states/rabbitmq/test_cluster.py +++ b/tests/pytests/unit/states/rabbitmq/test_cluster.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rabbitmq_cluster as rabbitmq_cluster from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/rabbitmq/test_plugin.py b/tests/pytests/unit/states/rabbitmq/test_plugin.py index dcab329790c..58be1cb89bf 100644 --- a/tests/pytests/unit/states/rabbitmq/test_plugin.py +++ b/tests/pytests/unit/states/rabbitmq/test_plugin.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rabbitmq_plugin as rabbitmq_plugin from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/rabbitmq/test_policy.py b/tests/pytests/unit/states/rabbitmq/test_policy.py index 3243214e02f..bf7f438e26e 100644 --- a/tests/pytests/unit/states/rabbitmq/test_policy.py +++ b/tests/pytests/unit/states/rabbitmq/test_policy.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rabbitmq_policy as rabbitmq_policy from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/rabbitmq/test_vhost.py b/tests/pytests/unit/states/rabbitmq/test_vhost.py index ed71142af65..d6fc3e624f5 100644 --- a/tests/pytests/unit/states/rabbitmq/test_vhost.py +++ b/tests/pytests/unit/states/rabbitmq/test_vhost.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rabbitmq_vhost as rabbitmq_vhost from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_acme.py b/tests/pytests/unit/states/test_acme.py index 6918627c9a3..88f59e519ea 100644 --- a/tests/pytests/unit/states/test_acme.py +++ b/tests/pytests/unit/states/test_acme.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.acme as acme from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_alias.py b/tests/pytests/unit/states/test_alias.py index a275ab3ac19..db2afb9e0c4 100644 --- a/tests/pytests/unit/states/test_alias.py +++ b/tests/pytests/unit/states/test_alias.py @@ -3,6 +3,7 @@ unit tests for the alias state """ import pytest + import salt.states.alias as alias from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_alternatives.py b/tests/pytests/unit/states/test_alternatives.py index de0bc509b9d..9dbdd8b04f5 100644 --- a/tests/pytests/unit/states/test_alternatives.py +++ b/tests/pytests/unit/states/test_alternatives.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.alternatives as alternatives from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ansiblegate.py b/tests/pytests/unit/states/test_ansiblegate.py index 02157d34204..fb837651518 100644 --- a/tests/pytests/unit/states/test_ansiblegate.py +++ b/tests/pytests/unit/states/test_ansiblegate.py @@ -2,6 +2,7 @@ import json import pathlib import pytest + import salt.states.ansiblegate as ansiblegate from tests.support.mock import MagicMock, patch from tests.support.runtests import RUNTIME_VARS diff --git a/tests/pytests/unit/states/test_aptpkg.py b/tests/pytests/unit/states/test_aptpkg.py index d728bd4f06f..fb36e377800 100644 --- a/tests/pytests/unit/states/test_aptpkg.py +++ b/tests/pytests/unit/states/test_aptpkg.py @@ -4,6 +4,7 @@ import pytest + import salt.states.aptpkg as aptpkg from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_archive.py b/tests/pytests/unit/states/test_archive.py index ed27511f2c2..178f00b83a1 100644 --- a/tests/pytests/unit/states/test_archive.py +++ b/tests/pytests/unit/states/test_archive.py @@ -6,6 +6,7 @@ import os import pytest + import salt.states.archive as archive import salt.utils.platform from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_artifactory.py b/tests/pytests/unit/states/test_artifactory.py index 97715c8ae1b..6b5e8003fee 100644 --- a/tests/pytests/unit/states/test_artifactory.py +++ b/tests/pytests/unit/states/test_artifactory.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.artifactory as artifactory from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_at.py b/tests/pytests/unit/states/test_at.py index 063670d5adb..21f91bd5345 100644 --- a/tests/pytests/unit/states/test_at.py +++ b/tests/pytests/unit/states/test_at.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.at as at from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_augeas.py b/tests/pytests/unit/states/test_augeas.py index e325c839186..e8ba31cb129 100644 --- a/tests/pytests/unit/states/test_augeas.py +++ b/tests/pytests/unit/states/test_augeas.py @@ -6,6 +6,7 @@ import os import pytest + import salt.states.augeas as augeas from tests.support.mock import MagicMock, mock_open, patch diff --git a/tests/pytests/unit/states/test_aws_sqs.py b/tests/pytests/unit/states/test_aws_sqs.py index f5fb4c29a6d..dd132c88420 100644 --- a/tests/pytests/unit/states/test_aws_sqs.py +++ b/tests/pytests/unit/states/test_aws_sqs.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.aws_sqs as aws_sqs from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_beacon.py b/tests/pytests/unit/states/test_beacon.py index 90854dca62a..a393190ec07 100644 --- a/tests/pytests/unit/states/test_beacon.py +++ b/tests/pytests/unit/states/test_beacon.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.beacon as beacon from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_blockdev.py b/tests/pytests/unit/states/test_blockdev.py index faf162833ba..a1eacf2e53b 100644 --- a/tests/pytests/unit/states/test_blockdev.py +++ b/tests/pytests/unit/states/test_blockdev.py @@ -5,6 +5,7 @@ import os import pytest + import salt.states.blockdev as blockdev import salt.utils.path from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/states/test_boto_asg.py b/tests/pytests/unit/states/test_boto_asg.py index 646cc468d56..46749f78eaa 100644 --- a/tests/pytests/unit/states/test_boto_asg.py +++ b/tests/pytests/unit/states/test_boto_asg.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.boto_asg as boto_asg from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_cloudfront.py b/tests/pytests/unit/states/test_boto_cloudfront.py index 9dea0de0372..1c392a2cd07 100644 --- a/tests/pytests/unit/states/test_boto_cloudfront.py +++ b/tests/pytests/unit/states/test_boto_cloudfront.py @@ -5,6 +5,7 @@ import copy import textwrap import pytest + import salt.config import salt.loader import salt.states.boto_cloudfront as boto_cloudfront diff --git a/tests/pytests/unit/states/test_boto_cloudtrail.py b/tests/pytests/unit/states/test_boto_cloudtrail.py index 14f9a410076..f4ee8e4d1f3 100644 --- a/tests/pytests/unit/states/test_boto_cloudtrail.py +++ b/tests/pytests/unit/states/test_boto_cloudtrail.py @@ -3,6 +3,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_cloudtrail as boto_cloudtrail diff --git a/tests/pytests/unit/states/test_boto_cloudwatch_alarm.py b/tests/pytests/unit/states/test_boto_cloudwatch_alarm.py index c7164b7d476..16c655a1cdf 100644 --- a/tests/pytests/unit/states/test_boto_cloudwatch_alarm.py +++ b/tests/pytests/unit/states/test_boto_cloudwatch_alarm.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.boto_cloudwatch_alarm as boto_cloudwatch_alarm from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_cloudwatch_event.py b/tests/pytests/unit/states/test_boto_cloudwatch_event.py index 6b0ed4ef5ef..b7008db0937 100644 --- a/tests/pytests/unit/states/test_boto_cloudwatch_event.py +++ b/tests/pytests/unit/states/test_boto_cloudwatch_event.py @@ -3,6 +3,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_cloudwatch_event as boto_cloudwatch_event diff --git a/tests/pytests/unit/states/test_boto_dynamodb.py b/tests/pytests/unit/states/test_boto_dynamodb.py index b8a59a2e6ad..2375077b805 100644 --- a/tests/pytests/unit/states/test_boto_dynamodb.py +++ b/tests/pytests/unit/states/test_boto_dynamodb.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.boto_dynamodb as boto_dynamodb from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_ec2.py b/tests/pytests/unit/states/test_boto_ec2.py index 9fec9a6984e..6a41900c8d7 100644 --- a/tests/pytests/unit/states/test_boto_ec2.py +++ b/tests/pytests/unit/states/test_boto_ec2.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.boto_ec2 as boto_ec2 from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_elasticache.py b/tests/pytests/unit/states/test_boto_elasticache.py index 44844187ab6..6dbe211d771 100644 --- a/tests/pytests/unit/states/test_boto_elasticache.py +++ b/tests/pytests/unit/states/test_boto_elasticache.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.boto_elasticache as boto_elasticache from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_elasticsearch_domain.py b/tests/pytests/unit/states/test_boto_elasticsearch_domain.py index 423d53b0a64..8a97d129390 100644 --- a/tests/pytests/unit/states/test_boto_elasticsearch_domain.py +++ b/tests/pytests/unit/states/test_boto_elasticsearch_domain.py @@ -3,6 +3,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_elasticsearch_domain as boto_elasticsearch_domain diff --git a/tests/pytests/unit/states/test_boto_elb.py b/tests/pytests/unit/states/test_boto_elb.py index 049ba849395..08699d796fe 100644 --- a/tests/pytests/unit/states/test_boto_elb.py +++ b/tests/pytests/unit/states/test_boto_elb.py @@ -5,6 +5,7 @@ import copy import pytest + import salt.states.boto_elb as boto_elb from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_iam_role.py b/tests/pytests/unit/states/test_boto_iam_role.py index 8147f90d3de..0a577e56978 100644 --- a/tests/pytests/unit/states/test_boto_iam_role.py +++ b/tests/pytests/unit/states/test_boto_iam_role.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.boto_iam_role as boto_iam_role from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_iot.py b/tests/pytests/unit/states/test_boto_iot.py index 7d4fca76533..a485a3e4bad 100644 --- a/tests/pytests/unit/states/test_boto_iot.py +++ b/tests/pytests/unit/states/test_boto_iot.py @@ -3,6 +3,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_iot as boto_iot diff --git a/tests/pytests/unit/states/test_boto_kinesis.py b/tests/pytests/unit/states/test_boto_kinesis.py index 0b23971aa8b..2c3c9491ad8 100644 --- a/tests/pytests/unit/states/test_boto_kinesis.py +++ b/tests/pytests/unit/states/test_boto_kinesis.py @@ -1,4 +1,5 @@ import pytest + import salt.states.boto_kinesis as boto_kinesis from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_lambda.py b/tests/pytests/unit/states/test_boto_lambda.py index 47c0ff0de49..44900665e8f 100644 --- a/tests/pytests/unit/states/test_boto_lambda.py +++ b/tests/pytests/unit/states/test_boto_lambda.py @@ -3,6 +3,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_lambda as boto_lambda diff --git a/tests/pytests/unit/states/test_boto_lc.py b/tests/pytests/unit/states/test_boto_lc.py index c8f1c86785c..ab44a58f586 100644 --- a/tests/pytests/unit/states/test_boto_lc.py +++ b/tests/pytests/unit/states/test_boto_lc.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.boto_lc as boto_lc from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_route53.py b/tests/pytests/unit/states/test_boto_route53.py index 37ddc80793e..e374d486b9e 100644 --- a/tests/pytests/unit/states/test_boto_route53.py +++ b/tests/pytests/unit/states/test_boto_route53.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.boto_route53 as boto_route53 from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_s3_bucket.py b/tests/pytests/unit/states/test_boto_s3_bucket.py index b779bb4d3f5..c3fec11703c 100644 --- a/tests/pytests/unit/states/test_boto_s3_bucket.py +++ b/tests/pytests/unit/states/test_boto_s3_bucket.py @@ -4,6 +4,7 @@ import string from copy import deepcopy import pytest + import salt.loader import salt.states.boto_s3_bucket as boto_s3_bucket from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_secgroup.py b/tests/pytests/unit/states/test_boto_secgroup.py index a2dbe487d31..5a17975339f 100644 --- a/tests/pytests/unit/states/test_boto_secgroup.py +++ b/tests/pytests/unit/states/test_boto_secgroup.py @@ -1,4 +1,5 @@ import pytest + import salt.states.boto_secgroup as boto_secgroup from salt.utils.odict import OrderedDict diff --git a/tests/pytests/unit/states/test_boto_sns.py b/tests/pytests/unit/states/test_boto_sns.py index 24e6bfbb2df..d6fbdcee059 100644 --- a/tests/pytests/unit/states/test_boto_sns.py +++ b/tests/pytests/unit/states/test_boto_sns.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.boto_sns as boto_sns from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_boto_sqs.py b/tests/pytests/unit/states/test_boto_sqs.py index e54b7efc5f1..1fba31e86a0 100644 --- a/tests/pytests/unit/states/test_boto_sqs.py +++ b/tests/pytests/unit/states/test_boto_sqs.py @@ -4,6 +4,7 @@ import textwrap import pytest + import salt.config import salt.loader import salt.states.boto_sqs as boto_sqs diff --git a/tests/pytests/unit/states/test_bower.py b/tests/pytests/unit/states/test_bower.py index ed8cb9cfa17..f375f6ab58c 100644 --- a/tests/pytests/unit/states/test_bower.py +++ b/tests/pytests/unit/states/test_bower.py @@ -2,6 +2,7 @@ :codeauthor: Alexander Pyatkin """ import pytest + import salt.states.bower as bower from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_btrfs.py b/tests/pytests/unit/states/test_btrfs.py index 75fff65190d..5951fd9eb13 100644 --- a/tests/pytests/unit/states/test_btrfs.py +++ b/tests/pytests/unit/states/test_btrfs.py @@ -4,6 +4,7 @@ """ import pytest + import salt.states.btrfs as btrfs import salt.utils.platform from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/states/test_chef.py b/tests/pytests/unit/states/test_chef.py index 24f872adc75..d9defa0ff78 100644 --- a/tests/pytests/unit/states/test_chef.py +++ b/tests/pytests/unit/states/test_chef.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.chef import salt.states.chef as chef from tests.support.mock import MagicMock, create_autospec, patch diff --git a/tests/pytests/unit/states/test_cloud.py b/tests/pytests/unit/states/test_cloud.py index 117135fab26..ef257ee1f60 100644 --- a/tests/pytests/unit/states/test_cloud.py +++ b/tests/pytests/unit/states/test_cloud.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.cloud as cloud import salt.utils.cloud from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_cmd.py b/tests/pytests/unit/states/test_cmd.py index 25e614f0d2f..682ee621e7d 100644 --- a/tests/pytests/unit/states/test_cmd.py +++ b/tests/pytests/unit/states/test_cmd.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.cmd as cmd from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_composer.py b/tests/pytests/unit/states/test_composer.py index e75c5d1049a..a55f8eb3a9d 100644 --- a/tests/pytests/unit/states/test_composer.py +++ b/tests/pytests/unit/states/test_composer.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.composer as composer from salt.exceptions import SaltException from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_consul.py b/tests/pytests/unit/states/test_consul.py index 69e8cb65df5..02367458356 100644 --- a/tests/pytests/unit/states/test_consul.py +++ b/tests/pytests/unit/states/test_consul.py @@ -6,6 +6,7 @@ Test case for the consul state module import logging import pytest + import salt.states.consul as consul from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ddns.py b/tests/pytests/unit/states/test_ddns.py index 3d3595e04cd..e14ec13f0b2 100644 --- a/tests/pytests/unit/states/test_ddns.py +++ b/tests/pytests/unit/states/test_ddns.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.ddns as ddns from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_debconfmod.py b/tests/pytests/unit/states/test_debconfmod.py index cc98a0d39ef..eae21c97535 100644 --- a/tests/pytests/unit/states/test_debconfmod.py +++ b/tests/pytests/unit/states/test_debconfmod.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.debconfmod as debconfmod from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_docker_image.py b/tests/pytests/unit/states/test_docker_image.py index 7a1eb4eef7f..7a50eebf14c 100644 --- a/tests/pytests/unit/states/test_docker_image.py +++ b/tests/pytests/unit/states/test_docker_image.py @@ -3,6 +3,7 @@ Unit tests for the docker state """ import pytest + import salt.modules.dockermod as docker_mod import salt.states.docker_image as docker_state from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_docker_volume.py b/tests/pytests/unit/states/test_docker_volume.py index 4dbe49bc0bd..fe382f806a3 100644 --- a/tests/pytests/unit/states/test_docker_volume.py +++ b/tests/pytests/unit/states/test_docker_volume.py @@ -3,6 +3,7 @@ Unit tests for the docker state """ import pytest + import salt.modules.dockermod as docker_mod import salt.states.docker_volume as docker_state from tests.support.mock import Mock, patch diff --git a/tests/pytests/unit/states/test_drac.py b/tests/pytests/unit/states/test_drac.py index c94ba207459..71f95396e25 100644 --- a/tests/pytests/unit/states/test_drac.py +++ b/tests/pytests/unit/states/test_drac.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.drac as drac from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_elasticsearch.py b/tests/pytests/unit/states/test_elasticsearch.py index c0e97ad769d..b3d55e1df41 100644 --- a/tests/pytests/unit/states/test_elasticsearch.py +++ b/tests/pytests/unit/states/test_elasticsearch.py @@ -2,6 +2,7 @@ :codeauthor: Lukas Raska """ import pytest + import salt.utils.dictdiffer as dictdiffer from salt.exceptions import CommandExecutionError from salt.states import elasticsearch diff --git a/tests/pytests/unit/states/test_environ.py b/tests/pytests/unit/states/test_environ.py index 88c43d75dc0..7347f7dbe17 100644 --- a/tests/pytests/unit/states/test_environ.py +++ b/tests/pytests/unit/states/test_environ.py @@ -1,6 +1,7 @@ import os import pytest + import salt.modules.environ as envmodule import salt.modules.reg import salt.states.environ as envstate diff --git a/tests/pytests/unit/states/test_eselect.py b/tests/pytests/unit/states/test_eselect.py index db038d26f1a..02eed1a319d 100644 --- a/tests/pytests/unit/states/test_eselect.py +++ b/tests/pytests/unit/states/test_eselect.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.eselect as eselect from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_etcd_mod.py b/tests/pytests/unit/states/test_etcd_mod.py index 8af70f13155..e8fde7c48f1 100644 --- a/tests/pytests/unit/states/test_etcd_mod.py +++ b/tests/pytests/unit/states/test_etcd_mod.py @@ -11,6 +11,7 @@ import pytest + import salt.states.etcd_mod as etcd_state from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_event.py b/tests/pytests/unit/states/test_event.py index bfbf93b0310..9e50e16e739 100644 --- a/tests/pytests/unit/states/test_event.py +++ b/tests/pytests/unit/states/test_event.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.event as event from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_git.py b/tests/pytests/unit/states/test_git.py index 4713f153328..7410239bac1 100644 --- a/tests/pytests/unit/states/test_git.py +++ b/tests/pytests/unit/states/test_git.py @@ -8,6 +8,7 @@ import logging import pytest + import salt.states.git as git_state # Don't potentially shadow GitPython from tests.support.mock import DEFAULT, MagicMock, Mock, patch diff --git a/tests/pytests/unit/states/test_grafana.py b/tests/pytests/unit/states/test_grafana.py index 452c53dce65..3a6b73f947e 100644 --- a/tests/pytests/unit/states/test_grafana.py +++ b/tests/pytests/unit/states/test_grafana.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.grafana as grafana import salt.utils.json from salt.exceptions import SaltInvocationError diff --git a/tests/pytests/unit/states/test_grafana_datasource.py b/tests/pytests/unit/states/test_grafana_datasource.py index a9ee0bbc671..6db65657cd9 100644 --- a/tests/pytests/unit/states/test_grafana_datasource.py +++ b/tests/pytests/unit/states/test_grafana_datasource.py @@ -1,4 +1,5 @@ import pytest + import salt.states.grafana_datasource as grafana_datasource from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/states/test_host.py b/tests/pytests/unit/states/test_host.py index c374d8f966c..3a3ab022a02 100644 --- a/tests/pytests/unit/states/test_host.py +++ b/tests/pytests/unit/states/test_host.py @@ -5,6 +5,7 @@ import logging import pytest + import salt.states.host as host from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/states/test_http.py b/tests/pytests/unit/states/test_http.py index 00403ce934d..a672845e5c3 100644 --- a/tests/pytests/unit/states/test_http.py +++ b/tests/pytests/unit/states/test_http.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.http as http from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_influxdb08_database.py b/tests/pytests/unit/states/test_influxdb08_database.py index 08a790bbe3a..d5685de2131 100644 --- a/tests/pytests/unit/states/test_influxdb08_database.py +++ b/tests/pytests/unit/states/test_influxdb08_database.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.influxdb08_database as influxdb08_database from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_influxdb08_user.py b/tests/pytests/unit/states/test_influxdb08_user.py index bda515d1558..d5f4f29131b 100644 --- a/tests/pytests/unit/states/test_influxdb08_user.py +++ b/tests/pytests/unit/states/test_influxdb08_user.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.influxdb08_user as influxdb08_user from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ini_manage.py b/tests/pytests/unit/states/test_ini_manage.py index 1467a8499eb..009e006f240 100644 --- a/tests/pytests/unit/states/test_ini_manage.py +++ b/tests/pytests/unit/states/test_ini_manage.py @@ -2,6 +2,7 @@ import copy import os import pytest + import salt.modules.ini_manage as mod_ini_manage import salt.states.ini_manage as ini_manage from salt.utils.odict import OrderedDict diff --git a/tests/pytests/unit/states/test_iptables.py b/tests/pytests/unit/states/test_iptables.py index 0e379dff4bc..ed4cf998a25 100644 --- a/tests/pytests/unit/states/test_iptables.py +++ b/tests/pytests/unit/states/test_iptables.py @@ -4,6 +4,7 @@ import pytest + import salt.states.iptables as iptables from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_keyboard.py b/tests/pytests/unit/states/test_keyboard.py index dbe3846ea3f..5c00bc21e07 100644 --- a/tests/pytests/unit/states/test_keyboard.py +++ b/tests/pytests/unit/states/test_keyboard.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.keyboard as keyboard from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_kmod.py b/tests/pytests/unit/states/test_kmod.py index 115d6d11972..a4ec3dbc17c 100644 --- a/tests/pytests/unit/states/test_kmod.py +++ b/tests/pytests/unit/states/test_kmod.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.kmod as kmod from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_layman.py b/tests/pytests/unit/states/test_layman.py index 547eae23012..ad3dec64b74 100644 --- a/tests/pytests/unit/states/test_layman.py +++ b/tests/pytests/unit/states/test_layman.py @@ -2,6 +2,7 @@ :codeauthor: Jayesh Kariya """ import pytest + import salt.states.layman as layman from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ldap.py b/tests/pytests/unit/states/test_ldap.py index eb383b7b7f8..bf57549fd9c 100644 --- a/tests/pytests/unit/states/test_ldap.py +++ b/tests/pytests/unit/states/test_ldap.py @@ -12,6 +12,7 @@ import logging import attr import pytest + import salt.states.ldap from salt.utils.oset import OrderedSet from salt.utils.stringutils import to_bytes diff --git a/tests/pytests/unit/states/test_libcloud_dns.py b/tests/pytests/unit/states/test_libcloud_dns.py index adf145fa97e..230ecb940d1 100644 --- a/tests/pytests/unit/states/test_libcloud_dns.py +++ b/tests/pytests/unit/states/test_libcloud_dns.py @@ -4,6 +4,7 @@ import pytest + import salt.states.libcloud_dns as libcloud_dns from salt.modules.libcloud_dns import _simple_record, _simple_zone diff --git a/tests/pytests/unit/states/test_locale.py b/tests/pytests/unit/states/test_locale.py index fb4fec76a6a..cf391f6f127 100644 --- a/tests/pytests/unit/states/test_locale.py +++ b/tests/pytests/unit/states/test_locale.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.locale as locale from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_lvm.py b/tests/pytests/unit/states/test_lvm.py index 72e77509a6f..10975dcdbd7 100644 --- a/tests/pytests/unit/states/test_lvm.py +++ b/tests/pytests/unit/states/test_lvm.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.lvm as lvm from salt.exceptions import ArgumentValueError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_lvs_server.py b/tests/pytests/unit/states/test_lvs_server.py index 84a24dc65c7..ee4e2f77783 100644 --- a/tests/pytests/unit/states/test_lvs_server.py +++ b/tests/pytests/unit/states/test_lvs_server.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.lvs_server as lvs_server from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_lvs_service.py b/tests/pytests/unit/states/test_lvs_service.py index 2110c3ff01f..188c7cd6468 100644 --- a/tests/pytests/unit/states/test_lvs_service.py +++ b/tests/pytests/unit/states/test_lvs_service.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.lvs_service as lvs_service from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_lxc.py b/tests/pytests/unit/states/test_lxc.py index 93759fa4bc8..3ee57f1b3e7 100644 --- a/tests/pytests/unit/states/test_lxc.py +++ b/tests/pytests/unit/states/test_lxc.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.lxc as lxc import salt.utils.versions from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_mac_assistive.py b/tests/pytests/unit/states/test_mac_assistive.py index 8e81c194678..e83d422f591 100644 --- a/tests/pytests/unit/states/test_mac_assistive.py +++ b/tests/pytests/unit/states/test_mac_assistive.py @@ -1,4 +1,5 @@ import pytest + import salt.states.mac_assistive as assistive from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_mac_keychain.py b/tests/pytests/unit/states/test_mac_keychain.py index 4d742e3a75f..aded6002d3c 100644 --- a/tests/pytests/unit/states/test_mac_keychain.py +++ b/tests/pytests/unit/states/test_mac_keychain.py @@ -1,4 +1,5 @@ import pytest + import salt.states.mac_keychain as keychain from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/states/test_mac_xattr.py b/tests/pytests/unit/states/test_mac_xattr.py index 4a082a03bd6..a338467955e 100644 --- a/tests/pytests/unit/states/test_mac_xattr.py +++ b/tests/pytests/unit/states/test_mac_xattr.py @@ -1,4 +1,5 @@ import pytest + import salt.states.mac_xattr as xattr from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_macdefaults.py b/tests/pytests/unit/states/test_macdefaults.py index fbc32879cea..a9d40288858 100644 --- a/tests/pytests/unit/states/test_macdefaults.py +++ b/tests/pytests/unit/states/test_macdefaults.py @@ -1,4 +1,5 @@ import pytest + import salt.states.macdefaults as macdefaults from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_macpackage.py b/tests/pytests/unit/states/test_macpackage.py index 9c9de9a2818..6a13cbd7bcd 100644 --- a/tests/pytests/unit/states/test_macpackage.py +++ b/tests/pytests/unit/states/test_macpackage.py @@ -1,4 +1,5 @@ import pytest + import salt.states.macpackage as macpackage from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_makeconf.py b/tests/pytests/unit/states/test_makeconf.py index 2fc7b90f5ba..7f7b3a4fb86 100644 --- a/tests/pytests/unit/states/test_makeconf.py +++ b/tests/pytests/unit/states/test_makeconf.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.makeconf as makeconf from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_mdadm_raid.py b/tests/pytests/unit/states/test_mdadm_raid.py index 2fe92eeafcd..01112fa3848 100644 --- a/tests/pytests/unit/states/test_mdadm_raid.py +++ b/tests/pytests/unit/states/test_mdadm_raid.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.mdadm_raid as mdadm from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_memcached.py b/tests/pytests/unit/states/test_memcached.py index 1f25783679d..e3ee9635d9c 100644 --- a/tests/pytests/unit/states/test_memcached.py +++ b/tests/pytests/unit/states/test_memcached.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.memcached as memcached from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_modjk.py b/tests/pytests/unit/states/test_modjk.py index 0ab2a26da8a..e3da9270219 100644 --- a/tests/pytests/unit/states/test_modjk.py +++ b/tests/pytests/unit/states/test_modjk.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.modjk as modjk diff --git a/tests/pytests/unit/states/test_modjk_worker.py b/tests/pytests/unit/states/test_modjk_worker.py index 73dad7c8802..f2fa3bf11ba 100644 --- a/tests/pytests/unit/states/test_modjk_worker.py +++ b/tests/pytests/unit/states/test_modjk_worker.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.modjk_worker as modjk_worker from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_mongodb_database.py b/tests/pytests/unit/states/test_mongodb_database.py index b0b46cb4d76..e82bb159d53 100644 --- a/tests/pytests/unit/states/test_mongodb_database.py +++ b/tests/pytests/unit/states/test_mongodb_database.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.mongodb_database as mongodb_database from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_mongodb_user.py b/tests/pytests/unit/states/test_mongodb_user.py index 1b17ccb0924..cc1524c85c5 100644 --- a/tests/pytests/unit/states/test_mongodb_user.py +++ b/tests/pytests/unit/states/test_mongodb_user.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.mongodb_user as mongodb_user from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_nexus.py b/tests/pytests/unit/states/test_nexus.py index 81429b648db..83bc35da7d6 100644 --- a/tests/pytests/unit/states/test_nexus.py +++ b/tests/pytests/unit/states/test_nexus.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.nexus as nexus from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_nftables.py b/tests/pytests/unit/states/test_nftables.py index 9f5d1fbc09e..c3617f583f8 100644 --- a/tests/pytests/unit/states/test_nftables.py +++ b/tests/pytests/unit/states/test_nftables.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.nftables as nftables from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_npm.py b/tests/pytests/unit/states/test_npm.py index 838fba19c28..093f7065f4f 100644 --- a/tests/pytests/unit/states/test_npm.py +++ b/tests/pytests/unit/states/test_npm.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.npm as npmmod import salt.states.npm as npm from salt.exceptions import CommandExecutionError diff --git a/tests/pytests/unit/states/test_ntp.py b/tests/pytests/unit/states/test_ntp.py index 492595af619..e41c937a412 100644 --- a/tests/pytests/unit/states/test_ntp.py +++ b/tests/pytests/unit/states/test_ntp.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.ntp as ntp from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_nxos.py b/tests/pytests/unit/states/test_nxos.py index 96a2eb0849f..41185623ee3 100644 --- a/tests/pytests/unit/states/test_nxos.py +++ b/tests/pytests/unit/states/test_nxos.py @@ -17,6 +17,7 @@ # limitations under the License. import pytest + import salt.states.nxos as nxos_state from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_openstack_config.py b/tests/pytests/unit/states/test_openstack_config.py index cc2c428e7ac..6ae65fbe6ec 100644 --- a/tests/pytests/unit/states/test_openstack_config.py +++ b/tests/pytests/unit/states/test_openstack_config.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.openstack_config as openstack_config from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_openvswitch_port.py b/tests/pytests/unit/states/test_openvswitch_port.py index d2baedc8fda..677b439fe13 100644 --- a/tests/pytests/unit/states/test_openvswitch_port.py +++ b/tests/pytests/unit/states/test_openvswitch_port.py @@ -1,4 +1,5 @@ import pytest + import salt.states.openvswitch_port as openvswitch_port from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_pagerduty.py b/tests/pytests/unit/states/test_pagerduty.py index 98fb921d3d4..799d266b9a1 100644 --- a/tests/pytests/unit/states/test_pagerduty.py +++ b/tests/pytests/unit/states/test_pagerduty.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.pagerduty as pagerduty from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_pdbedit.py b/tests/pytests/unit/states/test_pdbedit.py index c04feb318fa..900553ca4cf 100644 --- a/tests/pytests/unit/states/test_pdbedit.py +++ b/tests/pytests/unit/states/test_pdbedit.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.pdbedit as pdbedit_mod import salt.states.pdbedit as pdbedit from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_pecl.py b/tests/pytests/unit/states/test_pecl.py index 17f5d113d81..132a8f8de7d 100644 --- a/tests/pytests/unit/states/test_pecl.py +++ b/tests/pytests/unit/states/test_pecl.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.pecl as pecl from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_pkg.py b/tests/pytests/unit/states/test_pkg.py index 954c9cc175e..4991f4a6d5e 100644 --- a/tests/pytests/unit/states/test_pkg.py +++ b/tests/pytests/unit/states/test_pkg.py @@ -1,6 +1,7 @@ import logging import pytest + import salt.modules.beacons as beaconmod import salt.states.beacon as beaconstate import salt.states.pkg as pkg diff --git a/tests/pytests/unit/states/test_pkgng.py b/tests/pytests/unit/states/test_pkgng.py index 48e96ba866d..8683a8a5d86 100644 --- a/tests/pytests/unit/states/test_pkgng.py +++ b/tests/pytests/unit/states/test_pkgng.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.pkgng as pkgng from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_pkgrepo.py b/tests/pytests/unit/states/test_pkgrepo.py index daa913bcc2e..c124d234b70 100644 --- a/tests/pytests/unit/states/test_pkgrepo.py +++ b/tests/pytests/unit/states/test_pkgrepo.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.pkgrepo as pkgrepo from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_portage_config.py b/tests/pytests/unit/states/test_portage_config.py index e3846915465..4c99e729d35 100644 --- a/tests/pytests/unit/states/test_portage_config.py +++ b/tests/pytests/unit/states/test_portage_config.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.portage_config as portage_config from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ports.py b/tests/pytests/unit/states/test_ports.py index 6476f1efa7d..3c1bded928a 100644 --- a/tests/pytests/unit/states/test_ports.py +++ b/tests/pytests/unit/states/test_ports.py @@ -4,6 +4,7 @@ import os import pytest + import salt.states.ports as ports from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_powerpath.py b/tests/pytests/unit/states/test_powerpath.py index 36ccf9e5943..1f808581a45 100644 --- a/tests/pytests/unit/states/test_powerpath.py +++ b/tests/pytests/unit/states/test_powerpath.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.powerpath as powerpath from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_process.py b/tests/pytests/unit/states/test_process.py index 10daf074a44..d9e6c3a3dae 100644 --- a/tests/pytests/unit/states/test_process.py +++ b/tests/pytests/unit/states/test_process.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.process as process from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_proxy.py b/tests/pytests/unit/states/test_proxy.py index 8d91fcedd76..3661330af93 100644 --- a/tests/pytests/unit/states/test_proxy.py +++ b/tests/pytests/unit/states/test_proxy.py @@ -1,4 +1,5 @@ import pytest + import salt.states.proxy as proxy from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/states/test_pyenv.py b/tests/pytests/unit/states/test_pyenv.py index f25957150c1..850506814ee 100644 --- a/tests/pytests/unit/states/test_pyenv.py +++ b/tests/pytests/unit/states/test_pyenv.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.pyenv as pyenv from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_pyrax_queues.py b/tests/pytests/unit/states/test_pyrax_queues.py index 05f7921b900..d5315163111 100644 --- a/tests/pytests/unit/states/test_pyrax_queues.py +++ b/tests/pytests/unit/states/test_pyrax_queues.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.pyrax_queues as pyrax_queues from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_quota.py b/tests/pytests/unit/states/test_quota.py index 9c254638686..50203681dd3 100644 --- a/tests/pytests/unit/states/test_quota.py +++ b/tests/pytests/unit/states/test_quota.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.quota as quota from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_rbenv.py b/tests/pytests/unit/states/test_rbenv.py index 2c73d3e16bd..b9cf9917d49 100644 --- a/tests/pytests/unit/states/test_rbenv.py +++ b/tests/pytests/unit/states/test_rbenv.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rbenv as rbenv from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_rdp.py b/tests/pytests/unit/states/test_rdp.py index bca60da64a1..691236d9bfd 100644 --- a/tests/pytests/unit/states/test_rdp.py +++ b/tests/pytests/unit/states/test_rdp.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rdp as rdp from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_redismod.py b/tests/pytests/unit/states/test_redismod.py index 19f1c9b61e9..eaecc5adab5 100644 --- a/tests/pytests/unit/states/test_redismod.py +++ b/tests/pytests/unit/states/test_redismod.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.redismod as redismod from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_restconf.py b/tests/pytests/unit/states/test_restconf.py index 0b8c9c81fb7..2f55a51ff68 100644 --- a/tests/pytests/unit/states/test_restconf.py +++ b/tests/pytests/unit/states/test_restconf.py @@ -1,4 +1,5 @@ import pytest + import salt.states.restconf as restconf from salt.utils.odict import OrderedDict from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_rsync.py b/tests/pytests/unit/states/test_rsync.py index 84c8b7ecfa6..243705e0b1d 100644 --- a/tests/pytests/unit/states/test_rsync.py +++ b/tests/pytests/unit/states/test_rsync.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.rsync as rsync from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_rvm.py b/tests/pytests/unit/states/test_rvm.py index 3cb1543bc8c..34dcc79e14f 100644 --- a/tests/pytests/unit/states/test_rvm.py +++ b/tests/pytests/unit/states/test_rvm.py @@ -1,4 +1,5 @@ import pytest + import salt.states.rvm as rvm from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_saltmod.py b/tests/pytests/unit/states/test_saltmod.py index 4870a1fa161..073ea5fa589 100644 --- a/tests/pytests/unit/states/test_saltmod.py +++ b/tests/pytests/unit/states/test_saltmod.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.saltutil as saltutil import salt.states.saltmod as saltmod from tests.support.mock import create_autospec, patch diff --git a/tests/pytests/unit/states/test_saltutil.py b/tests/pytests/unit/states/test_saltutil.py index 08417a4e3ff..c0d251889f6 100644 --- a/tests/pytests/unit/states/test_saltutil.py +++ b/tests/pytests/unit/states/test_saltutil.py @@ -5,6 +5,7 @@ import inspect import pytest + import salt.modules.saltutil as saltutil_module import salt.states.saltutil as saltutil_state from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_schedule.py b/tests/pytests/unit/states/test_schedule.py index c7dede94d41..f58a51a22a7 100644 --- a/tests/pytests/unit/states/test_schedule.py +++ b/tests/pytests/unit/states/test_schedule.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.schedule as schedule from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_selinux.py b/tests/pytests/unit/states/test_selinux.py index bbd12de7696..8b30aa2e282 100644 --- a/tests/pytests/unit/states/test_selinux.py +++ b/tests/pytests/unit/states/test_selinux.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.selinux as selinux from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_serverdensity_device.py b/tests/pytests/unit/states/test_serverdensity_device.py index d8deff4cfd4..e675fc8fc10 100644 --- a/tests/pytests/unit/states/test_serverdensity_device.py +++ b/tests/pytests/unit/states/test_serverdensity_device.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.serverdensity_device as serverdensity_device from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_service.py b/tests/pytests/unit/states/test_service.py index 3e835ed1a0f..75707d509ad 100644 --- a/tests/pytests/unit/states/test_service.py +++ b/tests/pytests/unit/states/test_service.py @@ -5,6 +5,7 @@ import logging import pytest + import salt.modules.beacons as beaconmod import salt.states.beacon as beaconstate import salt.states.service as service diff --git a/tests/pytests/unit/states/test_slack.py b/tests/pytests/unit/states/test_slack.py index 13d842d54d1..5f4dfaca645 100644 --- a/tests/pytests/unit/states/test_slack.py +++ b/tests/pytests/unit/states/test_slack.py @@ -4,6 +4,7 @@ """ import pytest + import salt.states.slack as slack from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_smartos.py b/tests/pytests/unit/states/test_smartos.py index 69d4dc75ee9..b42c7e528bc 100644 --- a/tests/pytests/unit/states/test_smartos.py +++ b/tests/pytests/unit/states/test_smartos.py @@ -1,4 +1,5 @@ import pytest + import salt.states.smartos as smartos from salt.utils.odict import OrderedDict from tests.support.mock import patch diff --git a/tests/pytests/unit/states/test_smtp.py b/tests/pytests/unit/states/test_smtp.py index 11bb8e6a1ba..8fa702f091b 100644 --- a/tests/pytests/unit/states/test_smtp.py +++ b/tests/pytests/unit/states/test_smtp.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.smtp as smtp from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_splunk_search.py b/tests/pytests/unit/states/test_splunk_search.py index a5b4b645093..0f51ffe7ad9 100644 --- a/tests/pytests/unit/states/test_splunk_search.py +++ b/tests/pytests/unit/states/test_splunk_search.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.splunk_search as splunk_search from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ssh_auth.py b/tests/pytests/unit/states/test_ssh_auth.py index f77ac384e5f..8f487da07cd 100644 --- a/tests/pytests/unit/states/test_ssh_auth.py +++ b/tests/pytests/unit/states/test_ssh_auth.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.ssh_auth as ssh_auth from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_ssh_known_hosts.py b/tests/pytests/unit/states/test_ssh_known_hosts.py index d2b5db301af..67c69d270e6 100644 --- a/tests/pytests/unit/states/test_ssh_known_hosts.py +++ b/tests/pytests/unit/states/test_ssh_known_hosts.py @@ -5,6 +5,7 @@ import os import pytest + import salt.states.ssh_known_hosts as ssh_known_hosts from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_status.py b/tests/pytests/unit/states/test_status.py index d162708ee0e..85926e044b8 100644 --- a/tests/pytests/unit/states/test_status.py +++ b/tests/pytests/unit/states/test_status.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.status as status from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_supervisord.py b/tests/pytests/unit/states/test_supervisord.py index edaad858152..4e5609f034c 100644 --- a/tests/pytests/unit/states/test_supervisord.py +++ b/tests/pytests/unit/states/test_supervisord.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.supervisord as supervisord from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_svn.py b/tests/pytests/unit/states/test_svn.py index 51b9f3c4418..aa9e582f03e 100644 --- a/tests/pytests/unit/states/test_svn.py +++ b/tests/pytests/unit/states/test_svn.py @@ -5,6 +5,7 @@ import os import pytest + import salt.states.svn as svn from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_sysctl.py b/tests/pytests/unit/states/test_sysctl.py index 2a619324c47..ec81ea9d7ab 100644 --- a/tests/pytests/unit/states/test_sysctl.py +++ b/tests/pytests/unit/states/test_sysctl.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.sysctl as sysctl from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_sysrc.py b/tests/pytests/unit/states/test_sysrc.py index a45e3838b89..9126c072248 100644 --- a/tests/pytests/unit/states/test_sysrc.py +++ b/tests/pytests/unit/states/test_sysrc.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.sysrc as sysrc from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_test.py b/tests/pytests/unit/states/test_test.py index 43b2433c265..ef8c3b85f76 100644 --- a/tests/pytests/unit/states/test_test.py +++ b/tests/pytests/unit/states/test_test.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.test as test from salt.exceptions import SaltInvocationError from salt.utils.odict import OrderedDict diff --git a/tests/pytests/unit/states/test_timezone.py b/tests/pytests/unit/states/test_timezone.py index ff2194833fa..c5b933483ad 100644 --- a/tests/pytests/unit/states/test_timezone.py +++ b/tests/pytests/unit/states/test_timezone.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.timezone as timezone from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_tomcat.py b/tests/pytests/unit/states/test_tomcat.py index b193a1800db..e4b611ff5ed 100644 --- a/tests/pytests/unit/states/test_tomcat.py +++ b/tests/pytests/unit/states/test_tomcat.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.tomcat as tomcat from salt.modules import tomcat as tomcatmod from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_user.py b/tests/pytests/unit/states/test_user.py index 5aeb81ec345..d17f36dd501 100644 --- a/tests/pytests/unit/states/test_user.py +++ b/tests/pytests/unit/states/test_user.py @@ -5,6 +5,7 @@ import logging import pytest + import salt.states.user as user from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/states/test_vbox_guest.py b/tests/pytests/unit/states/test_vbox_guest.py index 97aaf9b9727..d4eeee61be0 100644 --- a/tests/pytests/unit/states/test_vbox_guest.py +++ b/tests/pytests/unit/states/test_vbox_guest.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.vbox_guest as vbox_guest from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_webutil.py b/tests/pytests/unit/states/test_webutil.py index 8ae48659263..d8a10f2d7a0 100644 --- a/tests/pytests/unit/states/test_webutil.py +++ b/tests/pytests/unit/states/test_webutil.py @@ -4,6 +4,7 @@ import pytest + import salt.states.webutil as htpasswd from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_certutil.py b/tests/pytests/unit/states/test_win_certutil.py index 56126876255..5e8a0a987df 100644 --- a/tests/pytests/unit/states/test_win_certutil.py +++ b/tests/pytests/unit/states/test_win_certutil.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_certutil as certutil from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_dism.py b/tests/pytests/unit/states/test_win_dism.py index b13b4f0ccc5..182fd0df08e 100644 --- a/tests/pytests/unit/states/test_win_dism.py +++ b/tests/pytests/unit/states/test_win_dism.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_dism as dism from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_dns_client.py b/tests/pytests/unit/states/test_win_dns_client.py index 9e5efb5b15a..b92e2a06af8 100644 --- a/tests/pytests/unit/states/test_win_dns_client.py +++ b/tests/pytests/unit/states/test_win_dns_client.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.win_dns_client as win_dns_client from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_iis.py b/tests/pytests/unit/states/test_win_iis.py index 3bc9df45f1b..21bde0f1e1b 100644 --- a/tests/pytests/unit/states/test_win_iis.py +++ b/tests/pytests/unit/states/test_win_iis.py @@ -5,6 +5,7 @@ """ import pytest + import salt.states.win_iis as win_iis from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_lgpo.py b/tests/pytests/unit/states/test_win_lgpo.py index 91f428cf832..3da70862930 100644 --- a/tests/pytests/unit/states/test_win_lgpo.py +++ b/tests/pytests/unit/states/test_win_lgpo.py @@ -4,6 +4,7 @@ import copy import pytest + import salt.config import salt.loader import salt.states.win_lgpo as win_lgpo diff --git a/tests/pytests/unit/states/test_win_license.py b/tests/pytests/unit/states/test_win_license.py index c36ebc2310a..284c720c708 100644 --- a/tests/pytests/unit/states/test_win_license.py +++ b/tests/pytests/unit/states/test_win_license.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_license as win_license from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_network.py b/tests/pytests/unit/states/test_win_network.py index e6b6b25cb2f..c35c9b91f8a 100644 --- a/tests/pytests/unit/states/test_win_network.py +++ b/tests/pytests/unit/states/test_win_network.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.win_network as win_network from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_path.py b/tests/pytests/unit/states/test_win_path.py index 9fda49ab42f..4f685f6fb78 100644 --- a/tests/pytests/unit/states/test_win_path.py +++ b/tests/pytests/unit/states/test_win_path.py @@ -5,6 +5,7 @@ Tests for win_path states import copy import pytest + import salt.states.win_path as win_path from tests.support.mock import MagicMock, Mock, patch diff --git a/tests/pytests/unit/states/test_win_pki.py b/tests/pytests/unit/states/test_win_pki.py index df61379a318..573e344b8bf 100644 --- a/tests/pytests/unit/states/test_win_pki.py +++ b/tests/pytests/unit/states/test_win_pki.py @@ -6,6 +6,7 @@ """ import pytest + import salt.states.win_pki as win_pki from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_powercfg.py b/tests/pytests/unit/states/test_win_powercfg.py index 567037f7f5b..5ad8fd7d4fc 100644 --- a/tests/pytests/unit/states/test_win_powercfg.py +++ b/tests/pytests/unit/states/test_win_powercfg.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_powercfg as powercfg from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_servermanager.py b/tests/pytests/unit/states/test_win_servermanager.py index 78540cb7552..252b053baac 100644 --- a/tests/pytests/unit/states/test_win_servermanager.py +++ b/tests/pytests/unit/states/test_win_servermanager.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_servermanager as win_servermanager from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_snmp.py b/tests/pytests/unit/states/test_win_snmp.py index 778917804ba..962f44aed3b 100644 --- a/tests/pytests/unit/states/test_win_snmp.py +++ b/tests/pytests/unit/states/test_win_snmp.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_snmp as win_snmp from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_system.py b/tests/pytests/unit/states/test_win_system.py index 388099657de..e94b8e5c901 100644 --- a/tests/pytests/unit/states/test_win_system.py +++ b/tests/pytests/unit/states/test_win_system.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.win_system as win_system from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_win_wua.py b/tests/pytests/unit/states/test_win_wua.py index e236b8acfa8..51e1d9ef987 100644 --- a/tests/pytests/unit/states/test_win_wua.py +++ b/tests/pytests/unit/states/test_win_wua.py @@ -4,6 +4,7 @@ Test the win_wua state module from collections import namedtuple import pytest + import salt.states.win_wua as win_wua import salt.utils.platform import salt.utils.win_update as win_update diff --git a/tests/pytests/unit/states/test_win_wusa.py b/tests/pytests/unit/states/test_win_wusa.py index 5dc7d7efdd9..9b3b29d66b9 100644 --- a/tests/pytests/unit/states/test_win_wusa.py +++ b/tests/pytests/unit/states/test_win_wusa.py @@ -1,4 +1,5 @@ import pytest + import salt.states.win_wusa as wusa from salt.exceptions import SaltInvocationError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_winrepo.py b/tests/pytests/unit/states/test_winrepo.py index f1f569ad596..49d62839be4 100644 --- a/tests/pytests/unit/states/test_winrepo.py +++ b/tests/pytests/unit/states/test_winrepo.py @@ -5,6 +5,7 @@ import os import pytest + import salt.config import salt.states.winrepo as winrepo import salt.utils.path diff --git a/tests/pytests/unit/states/test_xml.py b/tests/pytests/unit/states/test_xml.py index ffe0e4e3179..81cada32504 100644 --- a/tests/pytests/unit/states/test_xml.py +++ b/tests/pytests/unit/states/test_xml.py @@ -3,6 +3,7 @@ Test cases for xml state """ import pytest + import salt.states.xml as xml from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_xmpp.py b/tests/pytests/unit/states/test_xmpp.py index eec737c0e2b..bec7224cdf1 100644 --- a/tests/pytests/unit/states/test_xmpp.py +++ b/tests/pytests/unit/states/test_xmpp.py @@ -4,6 +4,7 @@ import pytest + import salt.states.xmpp as xmpp from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_zfs.py b/tests/pytests/unit/states/test_zfs.py index 2abcb39ddac..f57b4121db2 100644 --- a/tests/pytests/unit/states/test_zfs.py +++ b/tests/pytests/unit/states/test_zfs.py @@ -9,6 +9,7 @@ Tests for salt.states.zfs """ import pytest + import salt.config import salt.loader import salt.states.zfs as zfs diff --git a/tests/pytests/unit/states/test_zk_concurrency.py b/tests/pytests/unit/states/test_zk_concurrency.py index 6a57b34ab55..9c319f50350 100644 --- a/tests/pytests/unit/states/test_zk_concurrency.py +++ b/tests/pytests/unit/states/test_zk_concurrency.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.zk_concurrency as zk_concurrency from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/test_zpool.py b/tests/pytests/unit/states/test_zpool.py index 05af36edae2..3b109761fa4 100644 --- a/tests/pytests/unit/states/test_zpool.py +++ b/tests/pytests/unit/states/test_zpool.py @@ -9,6 +9,7 @@ Tests for salt.states.zpool """ import pytest + import salt.config import salt.loader import salt.states.zpool as zpool diff --git a/tests/pytests/unit/states/virt/conftest.py b/tests/pytests/unit/states/virt/conftest.py index 662d34777a9..af42240dfbb 100644 --- a/tests/pytests/unit/states/virt/conftest.py +++ b/tests/pytests/unit/states/virt/conftest.py @@ -1,4 +1,5 @@ import pytest + from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/states/virt/test_domain.py b/tests/pytests/unit/states/virt/test_domain.py index 2c1411462e4..b3197b6fe86 100644 --- a/tests/pytests/unit/states/virt/test_domain.py +++ b/tests/pytests/unit/states/virt/test_domain.py @@ -1,4 +1,5 @@ import pytest + import salt.states.virt as virt from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/virt/test_network.py b/tests/pytests/unit/states/virt/test_network.py index 9c150691ab1..81bb4c88f67 100644 --- a/tests/pytests/unit/states/virt/test_network.py +++ b/tests/pytests/unit/states/virt/test_network.py @@ -1,4 +1,5 @@ import pytest + import salt.states.virt as virt from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/zabbix/test_action.py b/tests/pytests/unit/states/zabbix/test_action.py index 3a29458feda..57da6be2684 100644 --- a/tests/pytests/unit/states/zabbix/test_action.py +++ b/tests/pytests/unit/states/zabbix/test_action.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.zabbix_action as zabbix_action from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/zabbix/test_host.py b/tests/pytests/unit/states/zabbix/test_host.py index 9ed173e7e2f..8e6bad58a92 100644 --- a/tests/pytests/unit/states/zabbix/test_host.py +++ b/tests/pytests/unit/states/zabbix/test_host.py @@ -6,6 +6,7 @@ import ast from collections import OrderedDict import pytest + import salt.states.zabbix_host as zabbix_host from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/zabbix/test_template.py b/tests/pytests/unit/states/zabbix/test_template.py index 93f20357ed4..203a80a50ae 100644 --- a/tests/pytests/unit/states/zabbix/test_template.py +++ b/tests/pytests/unit/states/zabbix/test_template.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.zabbix_template as zabbix_template from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/states/zabbix/test_valuemap.py b/tests/pytests/unit/states/zabbix/test_valuemap.py index f33b4fe4c7b..bc589d7bc92 100644 --- a/tests/pytests/unit/states/zabbix/test_valuemap.py +++ b/tests/pytests/unit/states/zabbix/test_valuemap.py @@ -3,6 +3,7 @@ """ import pytest + import salt.states.zabbix_valuemap as zabbix_valuemap from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/test_client.py b/tests/pytests/unit/test_client.py index bc9107573cb..06e4415d399 100644 --- a/tests/pytests/unit/test_client.py +++ b/tests/pytests/unit/test_client.py @@ -6,6 +6,7 @@ import copy import logging import pytest + import salt.utils.platform from salt import client from salt.exceptions import ( diff --git a/tests/pytests/unit/test_crypt.py b/tests/pytests/unit/test_crypt.py index 6b296a407d6..e3c98ab6366 100644 --- a/tests/pytests/unit/test_crypt.py +++ b/tests/pytests/unit/test_crypt.py @@ -8,6 +8,7 @@ Unit tests for salt's crypt module import uuid import pytest + import salt.crypt import salt.master import salt.utils.files diff --git a/tests/pytests/unit/test_ext_importers.py b/tests/pytests/unit/test_ext_importers.py index bedf0fe8c02..cbd737ef0bc 100644 --- a/tests/pytests/unit/test_ext_importers.py +++ b/tests/pytests/unit/test_ext_importers.py @@ -4,9 +4,10 @@ import subprocess import sys import pytest -import salt import six # pylint: disable=blacklisted-external-import,3rd-party-module-not-gated +import salt + log = logging.getLogger(__name__) diff --git a/tests/pytests/unit/test_minion.py b/tests/pytests/unit/test_minion.py index a4ddc22c773..ea2303a3e65 100644 --- a/tests/pytests/unit/test_minion.py +++ b/tests/pytests/unit/test_minion.py @@ -3,6 +3,7 @@ import logging import os import pytest + import salt.ext.tornado import salt.ext.tornado.gen import salt.ext.tornado.testing diff --git a/tests/pytests/unit/test_syspaths.py b/tests/pytests/unit/test_syspaths.py index 144a63ead6e..0ecb4789a61 100644 --- a/tests/pytests/unit/test_syspaths.py +++ b/tests/pytests/unit/test_syspaths.py @@ -5,6 +5,7 @@ tests.pytests.unit.test_syspaths Unit tests for salt's syspaths module """ import pytest + import salt.syspaths from tests.support.mock import patch diff --git a/tests/pytests/unit/test_version.py b/tests/pytests/unit/test_version.py index f2506c76b8d..f68f9a5a468 100644 --- a/tests/pytests/unit/test_version.py +++ b/tests/pytests/unit/test_version.py @@ -7,6 +7,7 @@ Test salt's regex git describe version parsing import re import pytest + import salt.version from salt.version import ( SaltStackVersion, diff --git a/tests/pytests/unit/transport/test_ipc.py b/tests/pytests/unit/transport/test_ipc.py index 445054e8e91..8f41f9d723a 100644 --- a/tests/pytests/unit/transport/test_ipc.py +++ b/tests/pytests/unit/transport/test_ipc.py @@ -1,9 +1,10 @@ import pytest +from pytestshellutils.utils import ports + import salt.ext.tornado.iostream import salt.transport.ipc import salt.utils.asynchronous import salt.utils.platform -from pytestshellutils.utils import ports def test_ipc_connect_in_async_methods(): diff --git a/tests/pytests/unit/transport/test_tcp.py b/tests/pytests/unit/transport/test_tcp.py index 9688b562ffb..4ee0798fa28 100644 --- a/tests/pytests/unit/transport/test_tcp.py +++ b/tests/pytests/unit/transport/test_tcp.py @@ -3,11 +3,12 @@ import socket import attr import pytest +from pytestshellutils.utils import ports + import salt.channel.server import salt.exceptions import salt.ext.tornado import salt.transport.tcp -from pytestshellutils.utils import ports from tests.support.mock import MagicMock, PropertyMock, patch diff --git a/tests/pytests/unit/transport/test_zeromq.py b/tests/pytests/unit/transport/test_zeromq.py index de2cc98e09e..dc96e47fa07 100644 --- a/tests/pytests/unit/transport/test_zeromq.py +++ b/tests/pytests/unit/transport/test_zeromq.py @@ -12,6 +12,7 @@ import time import uuid import pytest + import salt.channel.client import salt.channel.server import salt.config diff --git a/tests/pytests/unit/utils/event/test_event.py b/tests/pytests/unit/utils/event/test_event.py index b83d53feeea..64c86683556 100644 --- a/tests/pytests/unit/utils/event/test_event.py +++ b/tests/pytests/unit/utils/event/test_event.py @@ -2,12 +2,13 @@ import hashlib import time import pytest +import zmq +import zmq.eventloop.ioloop + import salt.config import salt.ext.tornado.ioloop import salt.utils.event import salt.utils.stringutils -import zmq -import zmq.eventloop.ioloop from tests.support.events import eventpublisher_process, eventsender_process NO_LONG_IPC = False diff --git a/tests/pytests/unit/utils/event/test_event_return.py b/tests/pytests/unit/utils/event/test_event_return.py index 84f60d3bf39..33136c2aa1c 100644 --- a/tests/pytests/unit/utils/event/test_event_return.py +++ b/tests/pytests/unit/utils/event/test_event_return.py @@ -1,9 +1,10 @@ import pytest +from pytestshellutils.utils.processes import terminate_process + import salt.config import salt.ext.tornado.ioloop import salt.utils.event import salt.utils.stringutils -from pytestshellutils.utils.processes import terminate_process @pytest.mark.slow_test diff --git a/tests/pytests/unit/utils/jinja/test_custom_extensions.py b/tests/pytests/unit/utils/jinja/test_custom_extensions.py index 91a69c77130..ff166e1a8db 100644 --- a/tests/pytests/unit/utils/jinja/test_custom_extensions.py +++ b/tests/pytests/unit/utils/jinja/test_custom_extensions.py @@ -9,6 +9,8 @@ import pprint import re import pytest +from jinja2 import DictLoader, Environment, exceptions + import salt.config import salt.loader @@ -18,7 +20,6 @@ import salt.utils.files import salt.utils.json import salt.utils.stringutils import salt.utils.yaml -from jinja2 import DictLoader, Environment, exceptions from salt.exceptions import SaltRenderError from salt.utils.decorators.jinja import JinjaFilter from salt.utils.jinja import SerializerExtension, ensure_sequence_filter diff --git a/tests/pytests/unit/utils/jinja/test_get_template.py b/tests/pytests/unit/utils/jinja/test_get_template.py index cd5d3a7ec3c..868ca03aea7 100644 --- a/tests/pytests/unit/utils/jinja/test_get_template.py +++ b/tests/pytests/unit/utils/jinja/test_get_template.py @@ -8,6 +8,7 @@ import logging import os import pytest + import salt.config import salt.loader diff --git a/tests/pytests/unit/utils/jinja/test_jinja_default_options.py b/tests/pytests/unit/utils/jinja/test_jinja_default_options.py index a0abbfdf7ff..bd8f4311e7b 100644 --- a/tests/pytests/unit/utils/jinja/test_jinja_default_options.py +++ b/tests/pytests/unit/utils/jinja/test_jinja_default_options.py @@ -5,6 +5,7 @@ Tests for salt.utils.jinja import os import pytest + import salt.config import salt.loader diff --git a/tests/pytests/unit/utils/jinja/test_salt_cache_loader.py b/tests/pytests/unit/utils/jinja/test_salt_cache_loader.py index 505cc25f638..2206c7d2f43 100644 --- a/tests/pytests/unit/utils/jinja/test_salt_cache_loader.py +++ b/tests/pytests/unit/utils/jinja/test_salt_cache_loader.py @@ -6,6 +6,8 @@ import copy import os import pytest +from jinja2 import Environment, exceptions + import salt.config import salt.loader @@ -15,7 +17,6 @@ import salt.utils.files import salt.utils.json import salt.utils.stringutils import salt.utils.yaml -from jinja2 import Environment, exceptions from salt.utils.jinja import SaltCacheLoader from tests.support.mock import Mock, patch diff --git a/tests/pytests/unit/utils/scheduler/conftest.py b/tests/pytests/unit/utils/scheduler/conftest.py index 61d30d2e9d7..e74b67091bf 100644 --- a/tests/pytests/unit/utils/scheduler/conftest.py +++ b/tests/pytests/unit/utils/scheduler/conftest.py @@ -8,9 +8,10 @@ import copy import logging import pytest +from pytestshellutils.utils.processes import terminate_process + import salt.utils.platform import salt.utils.schedule -from pytestshellutils.utils.processes import terminate_process from salt.modules.test import ping from salt.utils.process import SubprocessList from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/scheduler/test_error.py b/tests/pytests/unit/utils/scheduler/test_error.py index ff266f7fc5b..2d73876c375 100644 --- a/tests/pytests/unit/utils/scheduler/test_error.py +++ b/tests/pytests/unit/utils/scheduler/test_error.py @@ -1,6 +1,7 @@ import logging import pytest + from tests.support.mock import MagicMock, patch try: diff --git a/tests/pytests/unit/utils/scheduler/test_eval.py b/tests/pytests/unit/utils/scheduler/test_eval.py index f99e230ba7e..0721b9ecab2 100644 --- a/tests/pytests/unit/utils/scheduler/test_eval.py +++ b/tests/pytests/unit/utils/scheduler/test_eval.py @@ -4,6 +4,7 @@ import random import time import pytest + import salt.utils.platform import salt.utils.schedule from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/scheduler/test_maxrunning.py b/tests/pytests/unit/utils/scheduler/test_maxrunning.py index c9755dd93e2..f94204126c7 100644 --- a/tests/pytests/unit/utils/scheduler/test_maxrunning.py +++ b/tests/pytests/unit/utils/scheduler/test_maxrunning.py @@ -1,6 +1,7 @@ import logging import pytest + from tests.support.mock import MagicMock, patch try: diff --git a/tests/pytests/unit/utils/scheduler/test_schedule.py b/tests/pytests/unit/utils/scheduler/test_schedule.py index e88859e6841..466b11725f6 100644 --- a/tests/pytests/unit/utils/scheduler/test_schedule.py +++ b/tests/pytests/unit/utils/scheduler/test_schedule.py @@ -7,6 +7,7 @@ import datetime import logging import pytest + import salt.config import salt.utils.schedule from salt.utils.schedule import Schedule diff --git a/tests/pytests/unit/utils/test_args.py b/tests/pytests/unit/utils/test_args.py index 28a4ba2052c..68d2fdbfc48 100644 --- a/tests/pytests/unit/utils/test_args.py +++ b/tests/pytests/unit/utils/test_args.py @@ -2,6 +2,7 @@ import logging from collections import namedtuple import pytest + import salt.utils.args from salt.exceptions import SaltInvocationError from tests.support.mock import DEFAULT, patch diff --git a/tests/pytests/unit/utils/test_cache.py b/tests/pytests/unit/utils/test_cache.py index abbd4965577..7910aa37a95 100644 --- a/tests/pytests/unit/utils/test_cache.py +++ b/tests/pytests/unit/utils/test_cache.py @@ -8,6 +8,7 @@ import time import pytest + import salt.config import salt.loader import salt.payload diff --git a/tests/pytests/unit/utils/test_cloud.py b/tests/pytests/unit/utils/test_cloud.py index 8210a16cda4..12b76786d31 100644 --- a/tests/pytests/unit/utils/test_cloud.py +++ b/tests/pytests/unit/utils/test_cloud.py @@ -11,6 +11,7 @@ import os import tempfile import pytest + import salt.utils.cloud as cloud from salt.utils.cloud import __ssh_gateway_arguments as ssh_gateway_arguments from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/test_data.py b/tests/pytests/unit/utils/test_data.py index 97fe8b9de0b..877bb5a7785 100644 --- a/tests/pytests/unit/utils/test_data.py +++ b/tests/pytests/unit/utils/test_data.py @@ -1,6 +1,7 @@ import sys import pytest + import salt.utils.data diff --git a/tests/pytests/unit/utils/test_etcd_util.py b/tests/pytests/unit/utils/test_etcd_util.py index c77c1286666..908eed21353 100644 --- a/tests/pytests/unit/utils/test_etcd_util.py +++ b/tests/pytests/unit/utils/test_etcd_util.py @@ -5,12 +5,13 @@ """ import pytest + import salt.utils.etcd_util as etcd_util from tests.support.mock import MagicMock, patch if etcd_util.HAS_ETCD_V2: import etcd - from urllib3.exceptions import ReadTimeoutError, MaxRetryError + from urllib3.exceptions import MaxRetryError, ReadTimeoutError def _version_id(value): diff --git a/tests/pytests/unit/utils/test_files.py b/tests/pytests/unit/utils/test_files.py index fd88167b160..465120fca22 100644 --- a/tests/pytests/unit/utils/test_files.py +++ b/tests/pytests/unit/utils/test_files.py @@ -7,6 +7,7 @@ import copy import os import pytest + import salt.utils.files from tests.support.mock import patch diff --git a/tests/pytests/unit/utils/test_http.py b/tests/pytests/unit/utils/test_http.py index 246416d92fc..52bf3d2ca28 100644 --- a/tests/pytests/unit/utils/test_http.py +++ b/tests/pytests/unit/utils/test_http.py @@ -1,5 +1,6 @@ import pytest import requests + import salt.utils.http from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/test_minions.py b/tests/pytests/unit/utils/test_minions.py index cd0bb36bd3d..c8ce4574457 100644 --- a/tests/pytests/unit/utils/test_minions.py +++ b/tests/pytests/unit/utils/test_minions.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.minions import salt.utils.network from tests.support.mock import patch diff --git a/tests/pytests/unit/utils/test_msgpack.py b/tests/pytests/unit/utils/test_msgpack.py index 9ef753c0969..a09b6e5b8b1 100644 --- a/tests/pytests/unit/utils/test_msgpack.py +++ b/tests/pytests/unit/utils/test_msgpack.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.msgpack from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/test_pycrypto.py b/tests/pytests/unit/utils/test_pycrypto.py index ffec2f33c60..693ad10e240 100644 --- a/tests/pytests/unit/utils/test_pycrypto.py +++ b/tests/pytests/unit/utils/test_pycrypto.py @@ -4,6 +4,7 @@ import re import string import pytest + import salt.utils.platform import salt.utils.pycrypto from salt.exceptions import SaltInvocationError diff --git a/tests/pytests/unit/utils/test_reactor.py b/tests/pytests/unit/utils/test_reactor.py index d2ce0035b61..e527f7c81f9 100644 --- a/tests/pytests/unit/utils/test_reactor.py +++ b/tests/pytests/unit/utils/test_reactor.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.data import salt.utils.reactor as reactor from tests.support.mock import MagicMock, call, patch diff --git a/tests/pytests/unit/utils/test_schedule.py b/tests/pytests/unit/utils/test_schedule.py index 4260df6d8b6..85a55c3cb3e 100644 --- a/tests/pytests/unit/utils/test_schedule.py +++ b/tests/pytests/unit/utils/test_schedule.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.schedule from tests.support.mock import MagicMock diff --git a/tests/pytests/unit/utils/test_slack.py b/tests/pytests/unit/utils/test_slack.py index 24ed7187e6a..d05d00d2c8b 100644 --- a/tests/pytests/unit/utils/test_slack.py +++ b/tests/pytests/unit/utils/test_slack.py @@ -5,6 +5,7 @@ Test case for the slack utils module import logging import pytest + import salt.utils.slack as slack from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/test_stringutils.py b/tests/pytests/unit/utils/test_stringutils.py index abc80f8832a..26d17b785b3 100644 --- a/tests/pytests/unit/utils/test_stringutils.py +++ b/tests/pytests/unit/utils/test_stringutils.py @@ -8,6 +8,7 @@ import sys import textwrap import pytest + import salt.utils.stringutils from tests.support.mock import patch from tests.support.unit import LOREM_IPSUM diff --git a/tests/pytests/unit/utils/test_thin.py b/tests/pytests/unit/utils/test_thin.py index 72bb4efa31e..adab8ecf68d 100644 --- a/tests/pytests/unit/utils/test_thin.py +++ b/tests/pytests/unit/utils/test_thin.py @@ -1,4 +1,5 @@ import pytest + import salt.exceptions import salt.utils.stringutils import salt.utils.thin diff --git a/tests/pytests/unit/utils/test_vault.py b/tests/pytests/unit/utils/test_vault.py index 076a3bc03a6..55eea0811b1 100644 --- a/tests/pytests/unit/utils/test_vault.py +++ b/tests/pytests/unit/utils/test_vault.py @@ -7,6 +7,7 @@ import threading from copy import copy import pytest + import salt.utils.files import salt.utils.vault as vault from tests.support.mock import ANY, MagicMock, Mock, patch diff --git a/tests/pytests/unit/utils/test_verify.py b/tests/pytests/unit/utils/test_verify.py index 031d9794c41..efac7338193 100644 --- a/tests/pytests/unit/utils/test_verify.py +++ b/tests/pytests/unit/utils/test_verify.py @@ -1,6 +1,7 @@ import os import pytest + import salt.utils.verify from tests.support.mock import patch diff --git a/tests/pytests/unit/utils/test_versions.py b/tests/pytests/unit/utils/test_versions.py index 73218765ab8..714b4ce4c52 100644 --- a/tests/pytests/unit/utils/test_versions.py +++ b/tests/pytests/unit/utils/test_versions.py @@ -3,6 +3,7 @@ import sys import warnings import pytest + import salt.modules.cmdmod import salt.utils.versions import salt.version diff --git a/tests/pytests/unit/utils/test_vt.py b/tests/pytests/unit/utils/test_vt.py index 34ad3365be4..9a78627e201 100644 --- a/tests/pytests/unit/utils/test_vt.py +++ b/tests/pytests/unit/utils/test_vt.py @@ -2,6 +2,7 @@ import os import signal import pytest + import salt.utils.vt as vt diff --git a/tests/pytests/unit/utils/test_win_functions.py b/tests/pytests/unit/utils/test_win_functions.py index 75a52982237..10a5bf88513 100644 --- a/tests/pytests/unit/utils/test_win_functions.py +++ b/tests/pytests/unit/utils/test_win_functions.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.win_functions as win_functions from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/test_win_runas.py b/tests/pytests/unit/utils/test_win_runas.py index dec04ff85e3..b698c44973a 100644 --- a/tests/pytests/unit/utils/test_win_runas.py +++ b/tests/pytests/unit/utils/test_win_runas.py @@ -1,4 +1,5 @@ import pytest + from salt.utils import win_runas diff --git a/tests/pytests/unit/utils/test_win_update.py b/tests/pytests/unit/utils/test_win_update.py index 58977995256..a221ee31952 100644 --- a/tests/pytests/unit/utils/test_win_update.py +++ b/tests/pytests/unit/utils/test_win_update.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.win_update as win_update from tests.support.mock import MagicMock, patch diff --git a/tests/pytests/unit/utils/test_xmlutil.py b/tests/pytests/unit/utils/test_xmlutil.py index 60029b6a67c..482f787e66f 100644 --- a/tests/pytests/unit/utils/test_xmlutil.py +++ b/tests/pytests/unit/utils/test_xmlutil.py @@ -1,6 +1,7 @@ import xml.etree.ElementTree as ET import pytest + import salt.utils.xmlutil as xml diff --git a/tests/saltsh.py b/tests/saltsh.py index f490de6b93c..64ace99cc3b 100644 --- a/tests/saltsh.py +++ b/tests/saltsh.py @@ -31,6 +31,7 @@ import sys from code import InteractiveConsole import jinja2 + import salt.client import salt.config import salt.loader diff --git a/tests/support/case.py b/tests/support/case.py index c919272e3aa..55b537f6ffd 100644 --- a/tests/support/case.py +++ b/tests/support/case.py @@ -24,8 +24,9 @@ import time from datetime import datetime, timedelta import pytest -import salt.utils.files from pytestshellutils.utils.processes import terminate_process + +import salt.utils.files from tests.support.cli_scripts import ScriptPathMixin from tests.support.helpers import RedirectStdStreams from tests.support.mixins import ( # pylint: disable=unused-import diff --git a/tests/support/copyartifacts.py b/tests/support/copyartifacts.py index 790d4f0d7fb..a3054d80931 100644 --- a/tests/support/copyartifacts.py +++ b/tests/support/copyartifacts.py @@ -7,6 +7,7 @@ import os import subprocess import paramiko + import salt.utils.yaml diff --git a/tests/support/gitfs.py b/tests/support/gitfs.py index 9eb61becf8c..4775182a65b 100644 --- a/tests/support/gitfs.py +++ b/tests/support/gitfs.py @@ -11,16 +11,17 @@ import textwrap import attr import pytest +from pytestshellutils.utils import ports +from saltfactories.bases import Daemon +from saltfactories.daemons.sshd import Sshd as _Sshd + import salt.utils.files import salt.utils.path import salt.utils.platform import salt.utils.yaml -from pytestshellutils.utils import ports from salt.fileserver import gitfs from salt.pillar import git_pillar from salt.utils.immutabletypes import freeze -from saltfactories.bases import Daemon -from saltfactories.daemons.sshd import Sshd as _Sshd from tests.support.case import ModuleCase from tests.support.helpers import patched_environ, requires_system_grains from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/support/helpers.py b/tests/support/helpers.py index 08483aaf9d8..099de5a4600 100644 --- a/tests/support/helpers.py +++ b/tests/support/helpers.py @@ -34,6 +34,10 @@ from contextlib import contextmanager import attr import pytest +from pytestshellutils.exceptions import ProcessFailed +from pytestshellutils.utils import ports +from pytestshellutils.utils.processes import ProcessResult + import salt.ext.tornado.ioloop import salt.ext.tornado.web import salt.utils.files @@ -41,9 +45,6 @@ import salt.utils.platform import salt.utils.pycrypto import salt.utils.stringutils import salt.utils.versions -from pytestshellutils.exceptions import ProcessFailed -from pytestshellutils.utils import ports -from pytestshellutils.utils.processes import ProcessResult from tests.support.mock import patch from tests.support.runtests import RUNTIME_VARS from tests.support.sminion import create_sminion diff --git a/tests/support/kernelpkg.py b/tests/support/kernelpkg.py index a99fb59ce60..eada8d931d1 100644 --- a/tests/support/kernelpkg.py +++ b/tests/support/kernelpkg.py @@ -9,8 +9,8 @@ # Salt testing libs try: - from tests.support.mock import MagicMock, patch from salt.exceptions import CommandExecutionError + from tests.support.mock import MagicMock, patch except ImportError: pass diff --git a/tests/support/mixins.py b/tests/support/mixins.py index 88d3d7b777b..53f7e75108b 100644 --- a/tests/support/mixins.py +++ b/tests/support/mixins.py @@ -21,6 +21,8 @@ import tempfile import time import xml.etree.ElementTree as etree +from saltfactories.utils import random_string + import salt.config import salt.exceptions import salt.utils.event @@ -33,7 +35,6 @@ import salt.utils.yaml import salt.version from salt.utils.immutabletypes import freeze from salt.utils.verify import verify_env -from saltfactories.utils import random_string from tests.support.paths import CODE_DIR from tests.support.pytest.loader import LoaderModuleMock from tests.support.runtests import RUNTIME_VARS @@ -299,7 +300,7 @@ class ShellCaseCommonTestsMixin(CheckShellBinaryNameAndVersionMixin): def test_salt_with_git_version(self): if getattr(self, "_call_binary_", None) is None: self.skipTest("'_call_binary_' not defined.") - from salt.version import __version_info__, SaltStackVersion + from salt.version import SaltStackVersion, __version_info__ git = salt.utils.path.which("git") if not git: diff --git a/tests/support/mock.py b/tests/support/mock.py index de46848a7fe..5d71f30c292 100644 --- a/tests/support/mock.py +++ b/tests/support/mock.py @@ -21,7 +21,6 @@ import sys # By these days, we should blowup if mock is not available import mock # pylint: disable=blacklisted-external-import -import salt.utils.stringutils # pylint: disable=no-name-in-module,no-member from mock import ( @@ -40,6 +39,8 @@ from mock import ( sentinel, ) +import salt.utils.stringutils + # pylint: disable=no-name-in-module,no-member diff --git a/tests/support/netapi.py b/tests/support/netapi.py index eb61b92758c..91fbad5f1a4 100644 --- a/tests/support/netapi.py +++ b/tests/support/netapi.py @@ -2,6 +2,7 @@ import logging import socket import attr + import salt.auth import salt.ext.tornado.escape import salt.ext.tornado.web diff --git a/tests/support/pytest/etcd.py b/tests/support/pytest/etcd.py index fa7e5ecf0b9..6606e9436b8 100644 --- a/tests/support/pytest/etcd.py +++ b/tests/support/pytest/etcd.py @@ -4,9 +4,10 @@ import time import pytest import requests import requests.exceptions -from salt.utils.etcd_util import HAS_ETCD_V2, HAS_ETCD_V3 from saltfactories.utils import random_string +from salt.utils.etcd_util import HAS_ETCD_V2, HAS_ETCD_V3 + class EtcdVersion(enum.Enum): v2 = "etcd-v2" diff --git a/tests/support/pytest/helpers.py b/tests/support/pytest/helpers.py index 51ea68ffdae..0d29877297d 100644 --- a/tests/support/pytest/helpers.py +++ b/tests/support/pytest/helpers.py @@ -19,10 +19,11 @@ from contextlib import contextmanager import _pytest._version import attr import pytest -import salt.utils.platform -import salt.utils.pycrypto from saltfactories.utils import random_string from saltfactories.utils.tempfiles import temp_file + +import salt.utils.platform +import salt.utils.pycrypto from tests.support.pytest.loader import LoaderModuleMock from tests.support.runtests import RUNTIME_VARS from tests.support.sminion import create_sminion diff --git a/tests/support/pytest/loader.py b/tests/support/pytest/loader.py index 9af714a1e1f..2ac99459c2a 100644 --- a/tests/support/pytest/loader.py +++ b/tests/support/pytest/loader.py @@ -10,6 +10,7 @@ import types from collections import deque import attr + from tests.support.mock import patch log = logging.getLogger(__name__) diff --git a/tests/support/virt.py b/tests/support/virt.py index 83b4280c093..1cb7f738f5b 100644 --- a/tests/support/virt.py +++ b/tests/support/virt.py @@ -4,6 +4,7 @@ import uuid import attr from pytestshellutils.utils import ports from saltfactories.daemons.container import SaltMinion + from tests.support.runtests import RUNTIME_VARS diff --git a/tests/support/xmlunit.py b/tests/support/xmlunit.py index d3c7a1a7c56..b9e91bf1fd2 100644 --- a/tests/support/xmlunit.py +++ b/tests/support/xmlunit.py @@ -19,8 +19,8 @@ log = logging.getLogger(__name__) try: - import xmlrunner.runner import xmlrunner.result + import xmlrunner.runner HAS_XMLRUNNER = True diff --git a/tests/unit/cli/test_daemons.py b/tests/unit/cli/test_daemons.py index fba0c78c4fa..50e8a220841 100644 --- a/tests/unit/cli/test_daemons.py +++ b/tests/unit/cli/test_daemons.py @@ -6,6 +6,7 @@ import logging import multiprocessing import pytest + import salt.cli.daemons as daemons from tests.support.mixins import SaltClientTestCaseMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/client/test_ssh.py b/tests/unit/client/test_ssh.py index 00313ed55f1..25dae442399 100644 --- a/tests/unit/client/test_ssh.py +++ b/tests/unit/client/test_ssh.py @@ -8,6 +8,7 @@ import shutil import tempfile import pytest + import salt.client.ssh.client import salt.config import salt.roster diff --git a/tests/unit/cloud/__init__.py b/tests/unit/cloud/__init__.py index e792212f574..e96033e8910 100644 --- a/tests/unit/cloud/__init__.py +++ b/tests/unit/cloud/__init__.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~~ """ import pytest + import salt.cloud from tests.support.unit import TestCase diff --git a/tests/unit/cloud/clouds/test_vmware.py b/tests/unit/cloud/clouds/test_vmware.py index 5a1a163e348..baf517d796a 100644 --- a/tests/unit/cloud/clouds/test_vmware.py +++ b/tests/unit/cloud/clouds/test_vmware.py @@ -18,7 +18,7 @@ from tests.support.unit import TestCase, skipIf HAS_LIBS = True # pylint: disable=import-error,no-name-in-module,unused-import try: - from pyVim.connect import SmartConnect, Disconnect + from pyVim.connect import Disconnect, SmartConnect from pyVmomi import vim, vmodl except ImportError: HAS_LIBS = False diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 3df3bd2c7cc..945cd324b8d 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -1,6 +1,7 @@ import pathlib import pytest + from tests.support.runtests import RUNTIME_VARS diff --git a/tests/unit/daemons/test_masterapi.py b/tests/unit/daemons/test_masterapi.py index 2c973710913..47b7ff9bfee 100644 --- a/tests/unit/daemons/test_masterapi.py +++ b/tests/unit/daemons/test_masterapi.py @@ -3,6 +3,7 @@ import stat from functools import wraps import pytest + import salt.config import salt.daemons.masterapi as masterapi import salt.utils.platform diff --git a/tests/unit/ext/test_ipaddress.py b/tests/unit/ext/test_ipaddress.py index 407ea5a91f2..420ec473823 100644 --- a/tests/unit/ext/test_ipaddress.py +++ b/tests/unit/ext/test_ipaddress.py @@ -24,6 +24,7 @@ import sys import weakref import pytest + from salt._compat import ipaddress from tests.support.unit import TestCase, skipIf diff --git a/tests/unit/fileserver/test_gitfs.py b/tests/unit/fileserver/test_gitfs.py index 70e663ee35c..f42270f1a84 100644 --- a/tests/unit/fileserver/test_gitfs.py +++ b/tests/unit/fileserver/test_gitfs.py @@ -11,6 +11,7 @@ import tempfile import textwrap import pytest + import salt.ext.tornado.ioloop import salt.fileserver.gitfs as gitfs import salt.utils.files diff --git a/tests/unit/modules/test_boto_cloudwatch_event.py b/tests/unit/modules/test_boto_cloudwatch_event.py index 98bc3b98fd3..36384359463 100644 --- a/tests/unit/modules/test_boto_cloudwatch_event.py +++ b/tests/unit/modules/test_boto_cloudwatch_event.py @@ -13,8 +13,8 @@ from tests.support.unit import TestCase, skipIf try: import boto import boto3 - from botocore.exceptions import ClientError from botocore import __version__ as found_botocore_version + from botocore.exceptions import ClientError HAS_BOTO = True except ImportError: diff --git a/tests/unit/modules/test_boto_elb.py b/tests/unit/modules/test_boto_elb.py index 169f0021c3d..6f0614d9108 100644 --- a/tests/unit/modules/test_boto_elb.py +++ b/tests/unit/modules/test_boto_elb.py @@ -27,7 +27,6 @@ except ImportError: try: import pkg_resources - from moto import mock_ec2_deprecated # pylint: disable=no-name-in-module from moto import mock_elb_deprecated # pylint: disable=no-name-in-module diff --git a/tests/unit/modules/test_boto_iot.py b/tests/unit/modules/test_boto_iot.py index f98fff3ed06..7bec8ea0d1e 100644 --- a/tests/unit/modules/test_boto_iot.py +++ b/tests/unit/modules/test_boto_iot.py @@ -14,8 +14,8 @@ from tests.support.unit import TestCase, skipIf try: import boto import boto3 - from botocore.exceptions import ClientError from botocore import __version__ as found_botocore_version + from botocore.exceptions import ClientError HAS_BOTO = True except ImportError: diff --git a/tests/unit/modules/test_boto_lambda.py b/tests/unit/modules/test_boto_lambda.py index 8effe7e63db..9442583a740 100644 --- a/tests/unit/modules/test_boto_lambda.py +++ b/tests/unit/modules/test_boto_lambda.py @@ -17,8 +17,8 @@ from tests.support.unit import TestCase, skipIf # pylint: disable=import-error,no-name-in-module try: import boto3 - from botocore.exceptions import ClientError from botocore import __version__ as found_botocore_version + from botocore.exceptions import ClientError HAS_BOTO = True except ImportError: diff --git a/tests/unit/modules/test_boto_route53.py b/tests/unit/modules/test_boto_route53.py index 7f3ca9b48e4..6cd74924ae6 100644 --- a/tests/unit/modules/test_boto_route53.py +++ b/tests/unit/modules/test_boto_route53.py @@ -15,9 +15,10 @@ from tests.support.unit import TestCase, skipIf # pylint: disable=import-error try: - import salt.modules.boto_route53 as boto_route53 - from boto.route53.exception import DNSServerError import boto + from boto.route53.exception import DNSServerError + + import salt.modules.boto_route53 as boto_route53 boto.ENDPOINTS_PATH = os.path.join( RUNTIME_VARS.TESTS_DIR, "unit/files/endpoints.json" diff --git a/tests/unit/modules/test_btrfs.py b/tests/unit/modules/test_btrfs.py index e32c274194b..40522d77ca8 100644 --- a/tests/unit/modules/test_btrfs.py +++ b/tests/unit/modules/test_btrfs.py @@ -5,6 +5,7 @@ import os import pytest + import salt.modules.btrfs as btrfs import salt.utils.files import salt.utils.fsutils diff --git a/tests/unit/modules/test_debian_ip.py b/tests/unit/modules/test_debian_ip.py index 52a8fed587b..921457340c5 100644 --- a/tests/unit/modules/test_debian_ip.py +++ b/tests/unit/modules/test_debian_ip.py @@ -6,6 +6,7 @@ import tempfile import jinja2.exceptions import pytest + import salt.modules.debian_ip as debian_ip import salt.utils.files import salt.utils.platform diff --git a/tests/unit/modules/test_disk.py b/tests/unit/modules/test_disk.py index 9de9226b77c..d145c5de565 100644 --- a/tests/unit/modules/test_disk.py +++ b/tests/unit/modules/test_disk.py @@ -4,6 +4,7 @@ import sys import pytest + import salt.modules.disk as disk import salt.utils.path import salt.utils.platform diff --git a/tests/unit/modules/test_djangomod.py b/tests/unit/modules/test_djangomod.py index 903fc9f9dca..7a83e0a8f39 100644 --- a/tests/unit/modules/test_djangomod.py +++ b/tests/unit/modules/test_djangomod.py @@ -4,6 +4,7 @@ import sys import pytest + import salt.modules.djangomod as djangomod from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/modules/test_elasticsearch.py b/tests/unit/modules/test_elasticsearch.py index e6056eba13f..d90fd018474 100644 --- a/tests/unit/modules/test_elasticsearch.py +++ b/tests/unit/modules/test_elasticsearch.py @@ -10,7 +10,7 @@ from tests.support.unit import TestCase, skipIf # Import elasticsearch exceptions NO_ELASTIC = False try: - from elasticsearch import TransportError, NotFoundError + from elasticsearch import NotFoundError, TransportError except Exception: # pylint: disable=broad-except NO_ELASTIC = True diff --git a/tests/unit/modules/test_guestfs.py b/tests/unit/modules/test_guestfs.py index d0c07f80d97..9f4d950e2df 100644 --- a/tests/unit/modules/test_guestfs.py +++ b/tests/unit/modules/test_guestfs.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.guestfs as guestfs from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, call, patch diff --git a/tests/unit/modules/test_junos.py b/tests/unit/modules/test_junos.py index be18f845dfc..aec58075e6e 100644 --- a/tests/unit/modules/test_junos.py +++ b/tests/unit/modules/test_junos.py @@ -3,8 +3,9 @@ """ import os -import salt.modules.junos as junos import yaml + +import salt.modules.junos as junos from tests.support.mixins import LoaderModuleMockMixin, XMLEqualityMixin from tests.support.mock import ANY, MagicMock, PropertyMock, call, mock_open, patch from tests.support.unit import TestCase, skipIf @@ -15,12 +16,12 @@ except ImportError: import xml.etree.ElementTree as etree try: + import jnpr.junos.op as tables_dir + import jxmlease # pylint: disable=unused-import + from jnpr.junos.device import Device + from jnpr.junos.exception import ConnectClosedError, LockError, UnlockError from jnpr.junos.utils.config import Config from jnpr.junos.utils.sw import SW - from jnpr.junos.device import Device - import jxmlease # pylint: disable=unused-import - import jnpr.junos.op as tables_dir - from jnpr.junos.exception import ConnectClosedError, LockError, UnlockError HAS_JUNOS = True except ImportError: diff --git a/tests/unit/modules/test_k8s.py b/tests/unit/modules/test_k8s.py index 1d82d6870bd..db11296bde5 100644 --- a/tests/unit/modules/test_k8s.py +++ b/tests/unit/modules/test_k8s.py @@ -8,6 +8,7 @@ import time from subprocess import PIPE, Popen import pytest + import salt.modules.k8s as k8s import salt.utils.files import salt.utils.json diff --git a/tests/unit/modules/test_kernelpkg_linux_apt.py b/tests/unit/modules/test_kernelpkg_linux_apt.py index eba7f0a73a9..811839c3225 100644 --- a/tests/unit/modules/test_kernelpkg_linux_apt.py +++ b/tests/unit/modules/test_kernelpkg_linux_apt.py @@ -11,14 +11,14 @@ import re try: # Import Salt Testing Libs - from tests.support.mixins import LoaderModuleMockMixin - from tests.support.unit import TestCase, skipIf - from tests.support.mock import MagicMock, patch + import salt.modules.kernelpkg_linux_apt as kernelpkg + from salt.exceptions import CommandExecutionError # Import Salt Libs from tests.support.kernelpkg import KernelPkgTestCase - import salt.modules.kernelpkg_linux_apt as kernelpkg - from salt.exceptions import CommandExecutionError + from tests.support.mixins import LoaderModuleMockMixin + from tests.support.mock import MagicMock, patch + from tests.support.unit import TestCase, skipIf HAS_MODULES = True except ImportError: diff --git a/tests/unit/modules/test_kernelpkg_linux_yum.py b/tests/unit/modules/test_kernelpkg_linux_yum.py index becc95a8eb7..88c9aac3481 100644 --- a/tests/unit/modules/test_kernelpkg_linux_yum.py +++ b/tests/unit/modules/test_kernelpkg_linux_yum.py @@ -9,16 +9,16 @@ try: # Import Salt Testing Libs - from tests.support.mixins import LoaderModuleMockMixin - from tests.support.unit import TestCase, skipIf - from tests.support.mock import MagicMock, patch - - # Import Salt Libs - from tests.support.kernelpkg import KernelPkgTestCase import salt.modules.kernelpkg_linux_yum as kernelpkg import salt.modules.yumpkg as pkg from salt.exceptions import CommandExecutionError + # Import Salt Libs + from tests.support.kernelpkg import KernelPkgTestCase + from tests.support.mixins import LoaderModuleMockMixin + from tests.support.mock import MagicMock, patch + from tests.support.unit import TestCase, skipIf + HAS_MODULES = True except ImportError: HAS_MODULES = False diff --git a/tests/unit/modules/test_kubeadm.py b/tests/unit/modules/test_kubeadm.py index f508e3181d6..bb2cddd01b7 100644 --- a/tests/unit/modules/test_kubeadm.py +++ b/tests/unit/modules/test_kubeadm.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.kubeadm as kubeadm from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_libcloud_compute.py b/tests/unit/modules/test_libcloud_compute.py index 57c2bd4c8c1..815ff89c984 100644 --- a/tests/unit/modules/test_libcloud_compute.py +++ b/tests/unit/modules/test_libcloud_compute.py @@ -16,15 +16,15 @@ try: import libcloud from libcloud.compute.base import ( BaseDriver, + KeyPair, Node, + NodeImage, + NodeLocation, NodeSize, NodeState, - NodeLocation, StorageVolume, StorageVolumeState, VolumeSnapshot, - NodeImage, - KeyPair, ) if hasattr(libcloud, "__version__") and _LooseVersion( diff --git a/tests/unit/modules/test_libcloud_loadbalancer.py b/tests/unit/modules/test_libcloud_loadbalancer.py index c04ee07a282..63acc2335ff 100644 --- a/tests/unit/modules/test_libcloud_loadbalancer.py +++ b/tests/unit/modules/test_libcloud_loadbalancer.py @@ -9,7 +9,7 @@ from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase, skipIf try: - from libcloud.loadbalancer.base import BaseDriver, LoadBalancer, Algorithm, Member + from libcloud.loadbalancer.base import Algorithm, BaseDriver, LoadBalancer, Member HAS_LIBCLOUD = True except ImportError: diff --git a/tests/unit/modules/test_libcloud_storage.py b/tests/unit/modules/test_libcloud_storage.py index 44058c00c48..491e55ef7ac 100644 --- a/tests/unit/modules/test_libcloud_storage.py +++ b/tests/unit/modules/test_libcloud_storage.py @@ -9,7 +9,7 @@ from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase, skipIf try: - from libcloud.storage.base import Container, BaseDriver, Object + from libcloud.storage.base import BaseDriver, Container, Object HAS_LIBCLOUD = True except ImportError: diff --git a/tests/unit/modules/test_linux_shadow.py b/tests/unit/modules/test_linux_shadow.py index d2d4df55f83..844b4c56e80 100644 --- a/tests/unit/modules/test_linux_shadow.py +++ b/tests/unit/modules/test_linux_shadow.py @@ -5,6 +5,7 @@ import textwrap import pytest + import salt.utils.platform import salt.utils.stringutils from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_nacl.py b/tests/unit/modules/test_nacl.py index 0bf6fd69123..7491afaa65f 100644 --- a/tests/unit/modules/test_nacl.py +++ b/tests/unit/modules/test_nacl.py @@ -9,8 +9,9 @@ from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipIf try: - import libnacl.secret # pylint: disable=unused-import import libnacl.sealed # pylint: disable=unused-import + import libnacl.secret # pylint: disable=unused-import + import salt.modules.nacl as nacl HAS_LIBNACL = True diff --git a/tests/unit/modules/test_pdbedit.py b/tests/unit/modules/test_pdbedit.py index 4e4e1fc292c..8da420e8900 100644 --- a/tests/unit/modules/test_pdbedit.py +++ b/tests/unit/modules/test_pdbedit.py @@ -1,6 +1,7 @@ import hashlib import pytest + import salt.modules.pdbedit as pdbedit from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/modules/test_random_org.py b/tests/unit/modules/test_random_org.py index 5da210aed73..574f716b3c5 100644 --- a/tests/unit/modules/test_random_org.py +++ b/tests/unit/modules/test_random_org.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.random_org as random_org from salt.ext.tornado.httpclient import HTTPClient from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_reg.py b/tests/unit/modules/test_reg.py index 3914d898d2e..f819ff829df 100644 --- a/tests/unit/modules/test_reg.py +++ b/tests/unit/modules/test_reg.py @@ -1,9 +1,10 @@ import pytest +from saltfactories.utils import random_string + import salt.modules.reg as reg import salt.utils.stringutils import salt.utils.win_reg from salt.exceptions import CommandExecutionError -from saltfactories.utils import random_string from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase, skipIf diff --git a/tests/unit/modules/test_rh_ip.py b/tests/unit/modules/test_rh_ip.py index 459802d7811..d061978ae35 100644 --- a/tests/unit/modules/test_rh_ip.py +++ b/tests/unit/modules/test_rh_ip.py @@ -6,6 +6,7 @@ import copy import os import jinja2.exceptions + import salt.modules.rh_ip as rh_ip import salt.modules.systemd_service as service_mod from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_saltcheck.py b/tests/unit/modules/test_saltcheck.py index b2f808481e5..3d35fe2de5b 100644 --- a/tests/unit/modules/test_saltcheck.py +++ b/tests/unit/modules/test_saltcheck.py @@ -3,6 +3,7 @@ import os.path import pytest + import salt.config import salt.modules.saltcheck as saltcheck import salt.syspaths as syspaths diff --git a/tests/unit/modules/test_systemd_service.py b/tests/unit/modules/test_systemd_service.py index 5e921e8f0d2..e6c8a73a105 100644 --- a/tests/unit/modules/test_systemd_service.py +++ b/tests/unit/modules/test_systemd_service.py @@ -6,6 +6,7 @@ import os import pytest + import salt.modules.systemd_service as systemd import salt.utils.systemd from salt.exceptions import CommandExecutionError diff --git a/tests/unit/modules/test_win_groupadd.py b/tests/unit/modules/test_win_groupadd.py index 0325ac2aea4..b4786456365 100644 --- a/tests/unit/modules/test_win_groupadd.py +++ b/tests/unit/modules/test_win_groupadd.py @@ -12,9 +12,9 @@ from tests.support.unit import TestCase, skipIf # pylint: disable=unused-import try: - import win32com import pythoncom import pywintypes + import win32com PYWINTYPES_ERROR = pywintypes.com_error( -1234, "Exception occurred.", (0, None, "C", None, 0, -2147352567), None diff --git a/tests/unit/modules/test_win_ip.py b/tests/unit/modules/test_win_ip.py index 7d5e639abc5..a29fc6e0238 100644 --- a/tests/unit/modules/test_win_ip.py +++ b/tests/unit/modules/test_win_ip.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.win_ip as win_ip from salt.exceptions import CommandExecutionError, SaltInvocationError from tests.support.mixins import LoaderModuleMockMixin diff --git a/tests/unit/modules/test_win_lgpo.py b/tests/unit/modules/test_win_lgpo.py index 1d7a6e2976e..b1b5c494326 100644 --- a/tests/unit/modules/test_win_lgpo.py +++ b/tests/unit/modules/test_win_lgpo.py @@ -6,6 +6,7 @@ import glob import os import pytest + import salt.config import salt.loader import salt.modules.win_lgpo as win_lgpo diff --git a/tests/unit/modules/test_win_service.py b/tests/unit/modules/test_win_service.py index 557fb485b0f..1b32f944ef6 100644 --- a/tests/unit/modules/test_win_service.py +++ b/tests/unit/modules/test_win_service.py @@ -3,6 +3,7 @@ """ import pytest + import salt.modules.win_service as win_service import salt.utils.path from tests.support.mixins import LoaderModuleMockMixin @@ -11,8 +12,8 @@ from tests.support.unit import TestCase, skipIf try: WINAPI = True - import win32serviceutil import pywintypes + import win32serviceutil except ImportError: WINAPI = False diff --git a/tests/unit/modules/test_win_task.py b/tests/unit/modules/test_win_task.py index 8b973c04e5b..0a2a7ce856e 100644 --- a/tests/unit/modules/test_win_task.py +++ b/tests/unit/modules/test_win_task.py @@ -1,4 +1,5 @@ import pytest + import salt.modules.win_task as win_task import salt.utils.platform from tests.support.unit import TestCase, skipIf diff --git a/tests/unit/modules/test_zcbuildout.py b/tests/unit/modules/test_zcbuildout.py index 9fab2a61789..07c4552ecef 100644 --- a/tests/unit/modules/test_zcbuildout.py +++ b/tests/unit/modules/test_zcbuildout.py @@ -7,6 +7,7 @@ import urllib.error import urllib.request import pytest + import salt.modules.cmdmod as cmd import salt.modules.virtualenv_mod import salt.modules.zcbuildout as buildout diff --git a/tests/unit/proxy/test_junos.py b/tests/unit/proxy/test_junos.py index 1a6ec1d4463..ba555664a00 100644 --- a/tests/unit/proxy/test_junos.py +++ b/tests/unit/proxy/test_junos.py @@ -6,9 +6,9 @@ from tests.support.mock import ANY, patch from tests.support.unit import TestCase, skipIf try: + import jxmlease # pylint: disable=unused-import from jnpr.junos.device import Device # pylint: disable=unused-import from jnpr.junos.exception import ConnectError - import jxmlease # pylint: disable=unused-import HAS_JUNOS = True except ImportError: diff --git a/tests/unit/returners/test_local_cache.py b/tests/unit/returners/test_local_cache.py index b01a1b3e49e..68af4f5c5fb 100644 --- a/tests/unit/returners/test_local_cache.py +++ b/tests/unit/returners/test_local_cache.py @@ -12,6 +12,7 @@ import tempfile import time import pytest + import salt.returners.local_cache as local_cache import salt.utils.files import salt.utils.jid diff --git a/tests/unit/roster/test_clustershell.py b/tests/unit/roster/test_clustershell.py index 8aaa60276f2..9ba3257f2a5 100644 --- a/tests/unit/roster/test_clustershell.py +++ b/tests/unit/roster/test_clustershell.py @@ -42,6 +42,7 @@ class ClusterShellTestCase(TestCase): # Reimports are necessary to re-init the namespace. # pylint: disable=unused-import import socket + from ClusterShell.NodeSet import NodeSet # pylint: enable=unused-import diff --git a/tests/unit/runners/test_queue.py b/tests/unit/runners/test_queue.py index 4635395e19a..57a18d5167e 100644 --- a/tests/unit/runners/test_queue.py +++ b/tests/unit/runners/test_queue.py @@ -5,6 +5,7 @@ unit tests for the cache runner import os import pytest + import salt.runners.queue as queue_mod from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/states/test_boto_apigateway.py b/tests/unit/states/test_boto_apigateway.py index 37a97130228..913f3a41337 100644 --- a/tests/unit/states/test_boto_apigateway.py +++ b/tests/unit/states/test_boto_apigateway.py @@ -5,6 +5,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_apigateway as boto_apigateway diff --git a/tests/unit/states/test_boto_cognitoidentity.py b/tests/unit/states/test_boto_cognitoidentity.py index 6be1f9df985..6317e46a2ab 100644 --- a/tests/unit/states/test_boto_cognitoidentity.py +++ b/tests/unit/states/test_boto_cognitoidentity.py @@ -3,6 +3,7 @@ import random import string import pytest + import salt.config import salt.loader import salt.states.boto_cognitoidentity as boto_cognitoidentity diff --git a/tests/unit/states/test_boto_vpc.py b/tests/unit/states/test_boto_vpc.py index 99493d27e43..b8a313ede79 100644 --- a/tests/unit/states/test_boto_vpc.py +++ b/tests/unit/states/test_boto_vpc.py @@ -4,6 +4,7 @@ import string import sys import pytest + import salt.config import salt.states.boto_vpc as boto_vpc import salt.utils.botomod as botomod diff --git a/tests/unit/states/test_kernelpkg.py b/tests/unit/states/test_kernelpkg.py index 953ff664839..2cdd034cc4d 100644 --- a/tests/unit/states/test_kernelpkg.py +++ b/tests/unit/states/test_kernelpkg.py @@ -9,12 +9,11 @@ try: # Import Salt Testing Libs - from tests.support.mixins import LoaderModuleMockMixin - from tests.support.unit import skipIf, TestCase - from tests.support.mock import MagicMock, patch - # Import Salt Libs import salt.states.kernelpkg as kernelpkg + from tests.support.mixins import LoaderModuleMockMixin + from tests.support.mock import MagicMock, patch + from tests.support.unit import TestCase, skipIf HAS_MODULES = True except ImportError: diff --git a/tests/unit/states/test_kubernetes.py b/tests/unit/states/test_kubernetes.py index dc4d80a15df..b90b9b37ebf 100644 --- a/tests/unit/states/test_kubernetes.py +++ b/tests/unit/states/test_kubernetes.py @@ -6,6 +6,7 @@ import base64 from contextlib import contextmanager import pytest + import salt.modules.kubernetesmod as kubernetesmod import salt.states.kubernetes as kubernetes import salt.utils.stringutils diff --git a/tests/unit/states/test_loop.py b/tests/unit/states/test_loop.py index c17c36e419b..49a26e529db 100644 --- a/tests/unit/states/test_loop.py +++ b/tests/unit/states/test_loop.py @@ -3,6 +3,7 @@ Tests for loop state(s) """ import pytest + import salt.states.loop from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch diff --git a/tests/unit/states/test_pip_state.py b/tests/unit/states/test_pip_state.py index 93b8b3bd717..7effcfc015f 100644 --- a/tests/unit/states/test_pip_state.py +++ b/tests/unit/states/test_pip_state.py @@ -9,6 +9,7 @@ import subprocess import sys import pytest + import salt.states.pip_state as pip_state import salt.utils.path import salt.version diff --git a/tests/unit/states/test_saltmod.py b/tests/unit/states/test_saltmod.py index 14d2df16683..29fefe81b0b 100644 --- a/tests/unit/states/test_saltmod.py +++ b/tests/unit/states/test_saltmod.py @@ -6,6 +6,7 @@ import os import tempfile import pytest + import salt.config import salt.loader import salt.states.saltmod as saltmod diff --git a/tests/unit/states/test_zcbuildout.py b/tests/unit/states/test_zcbuildout.py index 93a6dfaaea2..3a6f969544d 100644 --- a/tests/unit/states/test_zcbuildout.py +++ b/tests/unit/states/test_zcbuildout.py @@ -1,6 +1,7 @@ import os import pytest + import salt.modules.cmdmod as cmd import salt.modules.virtualenv_mod import salt.modules.zcbuildout as modbuildout diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index d13cb733ded..1b2ba64b82d 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -6,6 +6,7 @@ import os import textwrap import pytest + import salt.config import salt.minion import salt.syspaths diff --git a/tests/unit/test_crypt.py b/tests/unit/test_crypt.py index 7b7036a6e37..2b0586f30e7 100644 --- a/tests/unit/test_crypt.py +++ b/tests/unit/test_crypt.py @@ -3,6 +3,7 @@ import shutil import tempfile import pytest + import salt.utils.files import salt.utils.stringutils from salt import crypt diff --git a/tests/unit/test_engines.py b/tests/unit/test_engines.py index 337cc9ddd47..bcfeaf5e77e 100644 --- a/tests/unit/test_engines.py +++ b/tests/unit/test_engines.py @@ -5,6 +5,7 @@ unit tests for the Salt engines import logging import pytest + import salt.config import salt.engines as engines import salt.utils.process diff --git a/tests/unit/test_loader.py b/tests/unit/test_loader.py index 66ba3d4e05b..cf339033200 100644 --- a/tests/unit/test_loader.py +++ b/tests/unit/test_loader.py @@ -18,6 +18,7 @@ import tempfile import textwrap import pytest + import salt.config import salt.loader import salt.loader.context diff --git a/tests/unit/test_master.py b/tests/unit/test_master.py index fe4c667e8b7..26c0bdb19ae 100644 --- a/tests/unit/test_master.py +++ b/tests/unit/test_master.py @@ -1,6 +1,7 @@ import time import pytest + import salt.config import salt.master from tests.support.mixins import AdaptedConfigurationTestCaseMixin diff --git a/tests/unit/test_proxy_minion.py b/tests/unit/test_proxy_minion.py index 75058c240bb..bc3e867619f 100644 --- a/tests/unit/test_proxy_minion.py +++ b/tests/unit/test_proxy_minion.py @@ -10,13 +10,14 @@ import tempfile import textwrap import pytest +from saltfactories.utils import random_string + import salt.config import salt.ext.tornado import salt.ext.tornado.testing import salt.metaproxy.proxy import salt.minion import salt.syspaths -from saltfactories.utils import random_string from tests.support.mock import MagicMock, patch from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase diff --git a/tests/unit/transport/test_ipc.py b/tests/unit/transport/test_ipc.py index 4a0a7c29e27..21ffb6aeecc 100644 --- a/tests/unit/transport/test_ipc.py +++ b/tests/unit/transport/test_ipc.py @@ -9,6 +9,7 @@ import os import threading import pytest + import salt.config import salt.exceptions import salt.ext.tornado.gen diff --git a/tests/unit/transport/test_tcp.py b/tests/unit/transport/test_tcp.py index 6258f3310bd..45eb4c07cf3 100644 --- a/tests/unit/transport/test_tcp.py +++ b/tests/unit/transport/test_tcp.py @@ -6,6 +6,8 @@ import logging import threading import pytest +from pytestshellutils.utils import ports + import salt.channel.client import salt.channel.server import salt.config @@ -15,7 +17,6 @@ import salt.ext.tornado.gen import salt.ext.tornado.ioloop import salt.utils.platform import salt.utils.process -from pytestshellutils.utils import ports from salt.ext.tornado.testing import AsyncTestCase from tests.support.mixins import AdaptedConfigurationTestCaseMixin from tests.support.unit import skipIf diff --git a/tests/unit/utils/test_context.py b/tests/unit/utils/test_context.py index 2b8ff989767..abea69fbf62 100644 --- a/tests/unit/utils/test_context.py +++ b/tests/unit/utils/test_context.py @@ -7,6 +7,7 @@ import threading import time import pytest + import salt.ext.tornado.gen import salt.ext.tornado.stack_context import salt.utils.json diff --git a/tests/unit/utils/test_dns.py b/tests/unit/utils/test_dns.py index b395949d055..32015a5276f 100644 --- a/tests/unit/utils/test_dns.py +++ b/tests/unit/utils/test_dns.py @@ -3,6 +3,7 @@ import socket import textwrap import pytest + import salt.modules.cmdmod import salt.utils.dns from salt._compat import ipaddress diff --git a/tests/unit/utils/test_http.py b/tests/unit/utils/test_http.py index ff7cc468d41..8c2a56810b0 100644 --- a/tests/unit/utils/test_http.py +++ b/tests/unit/utils/test_http.py @@ -6,8 +6,9 @@ import socket from contextlib import closing import pytest -import salt.utils.http as http from saltfactories.utils.tempfiles import temp_file + +import salt.utils.http as http from tests.support.helpers import MirrorPostHandler, Webserver from tests.support.mock import MagicMock, patch from tests.support.runtests import RUNTIME_VARS diff --git a/tests/unit/utils/test_nacl.py b/tests/unit/utils/test_nacl.py index 4fcb0195219..ed953a42997 100644 --- a/tests/unit/utils/test_nacl.py +++ b/tests/unit/utils/test_nacl.py @@ -8,8 +8,9 @@ from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipIf try: - import libnacl.secret # pylint: disable=unused-import import libnacl.sealed # pylint: disable=unused-import + import libnacl.secret # pylint: disable=unused-import + import salt.utils.nacl as nacl HAS_LIBNACL = True diff --git a/tests/unit/utils/test_network.py b/tests/unit/utils/test_network.py index e2dce6a71dc..7e0ada71e18 100644 --- a/tests/unit/utils/test_network.py +++ b/tests/unit/utils/test_network.py @@ -4,6 +4,7 @@ import textwrap import time import pytest + import salt.exceptions import salt.utils.network as network from salt._compat import ipaddress diff --git a/tests/unit/utils/test_pbm.py b/tests/unit/utils/test_pbm.py index 814e98fec78..65fabf41c4d 100644 --- a/tests/unit/utils/test_pbm.py +++ b/tests/unit/utils/test_pbm.py @@ -22,7 +22,7 @@ from tests.support.mock import MagicMock, PropertyMock, patch from tests.support.unit import TestCase, skipIf try: - from pyVmomi import vim, vmodl, pbm # pylint: disable=no-name-in-module + from pyVmomi import pbm, vim, vmodl # pylint: disable=no-name-in-module HAS_PYVMOMI = True except ImportError: diff --git a/tests/unit/utils/test_process.py b/tests/unit/utils/test_process.py index bccd1aec60b..accefe2bf60 100644 --- a/tests/unit/utils/test_process.py +++ b/tests/unit/utils/test_process.py @@ -10,6 +10,7 @@ import threading import time import pytest + import salt._logging import salt.utils.platform import salt.utils.process diff --git a/tests/unit/utils/test_pydsl.py b/tests/unit/utils/test_pydsl.py index 6aee21a1914..33d131bca8b 100644 --- a/tests/unit/utils/test_pydsl.py +++ b/tests/unit/utils/test_pydsl.py @@ -7,6 +7,7 @@ import tempfile import textwrap import pytest + import salt.config import salt.loader import salt.utils.files diff --git a/tests/unit/utils/test_pyobjects.py b/tests/unit/utils/test_pyobjects.py index edd8b383516..6a7bd406237 100644 --- a/tests/unit/utils/test_pyobjects.py +++ b/tests/unit/utils/test_pyobjects.py @@ -7,6 +7,7 @@ import uuid import jinja2 import pytest + import salt.config import salt.state import salt.utils.files diff --git a/tests/unit/utils/test_templates.py b/tests/unit/utils/test_templates.py index 87194a79c5f..850e7280d1c 100644 --- a/tests/unit/utils/test_templates.py +++ b/tests/unit/utils/test_templates.py @@ -10,6 +10,7 @@ from collections import OrderedDict from pathlib import PurePath, PurePosixPath import pytest + import salt.utils.files import salt.utils.templates from tests.support.helpers import with_tempdir diff --git a/tests/unit/utils/test_thin.py b/tests/unit/utils/test_thin.py index cc128598cac..cb3cf7e521e 100644 --- a/tests/unit/utils/test_thin.py +++ b/tests/unit/utils/test_thin.py @@ -12,6 +12,7 @@ import tempfile import jinja2 import pytest + import salt.exceptions import salt.utils.hashutils import salt.utils.json diff --git a/tests/unit/utils/test_timeout.py b/tests/unit/utils/test_timeout.py index 87315b76eee..bc116dc937b 100644 --- a/tests/unit/utils/test_timeout.py +++ b/tests/unit/utils/test_timeout.py @@ -2,6 +2,7 @@ import logging import time import pytest + from salt.utils.timeout import wait_for from tests.support.unit import TestCase diff --git a/tests/unit/utils/test_verify.py b/tests/unit/utils/test_verify.py index 64a34e94501..3ad1257d9de 100644 --- a/tests/unit/utils/test_verify.py +++ b/tests/unit/utils/test_verify.py @@ -12,6 +12,7 @@ import sys import tempfile import pytest + import salt.utils.files import salt.utils.platform from salt.utils.verify import ( diff --git a/tests/unit/utils/test_win_lgpo_auditpol.py b/tests/unit/utils/test_win_lgpo_auditpol.py index e1d7e8f7c6b..866a5b5712d 100644 --- a/tests/unit/utils/test_win_lgpo_auditpol.py +++ b/tests/unit/utils/test_win_lgpo_auditpol.py @@ -1,6 +1,7 @@ import random import pytest + import salt.modules.cmdmod import salt.utils.platform import salt.utils.win_lgpo_auditpol as win_lgpo_auditpol diff --git a/tests/unit/utils/test_win_lgpo_netsh.py b/tests/unit/utils/test_win_lgpo_netsh.py index 38ecb0b978d..ff512e199e7 100644 --- a/tests/unit/utils/test_win_lgpo_netsh.py +++ b/tests/unit/utils/test_win_lgpo_netsh.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform import salt.utils.win_lgpo_netsh as win_lgpo_netsh from salt.exceptions import CommandExecutionError diff --git a/tests/unit/utils/test_win_pdh.py b/tests/unit/utils/test_win_pdh.py index d7613356996..04214a72684 100644 --- a/tests/unit/utils/test_win_pdh.py +++ b/tests/unit/utils/test_win_pdh.py @@ -1,4 +1,5 @@ import pytest + import salt.utils.platform import salt.utils.win_pdh as win_pdh from tests.support.mock import patch diff --git a/tests/unit/utils/test_win_reg.py b/tests/unit/utils/test_win_reg.py index a7f58ec7f96..62be7cf711d 100644 --- a/tests/unit/utils/test_win_reg.py +++ b/tests/unit/utils/test_win_reg.py @@ -1,8 +1,9 @@ import pytest +from saltfactories.utils import random_string + import salt.utils.stringutils import salt.utils.win_reg as win_reg from salt.exceptions import CommandExecutionError -from saltfactories.utils import random_string from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase, skipIf diff --git a/tests/unit/utils/test_yamlloader.py b/tests/unit/utils/test_yamlloader.py index a5de963817a..04370a97083 100644 --- a/tests/unit/utils/test_yamlloader.py +++ b/tests/unit/utils/test_yamlloader.py @@ -4,11 +4,12 @@ import textwrap +from yaml.constructor import ConstructorError + import salt.utils.files from salt.utils.yamlloader import SaltYamlSafeLoader, yaml from tests.support.mock import mock_open, patch from tests.support.unit import TestCase -from yaml.constructor import ConstructorError class YamlLoaderTestCase(TestCase): diff --git a/tests/unit/utils/test_zeromq.py b/tests/unit/utils/test_zeromq.py index cbd8268fbff..df21ee31dc4 100644 --- a/tests/unit/utils/test_zeromq.py +++ b/tests/unit/utils/test_zeromq.py @@ -1,10 +1,9 @@ """ Test salt.utils.zeromq """ - +import zmq import salt.utils.zeromq -import zmq from salt.exceptions import SaltSystemExit from tests.support.mock import patch from tests.support.unit import TestCase, skipIf