mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 02:00:20 +00:00
Update to isort 5.10.1
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
2ff4835ff3
commit
4d49013247
1045 changed files with 1363 additions and 446 deletions
|
@ -1147,7 +1147,7 @@ repos:
|
||||||
args: [--silent, -E, fix_asserts, -E, fix_docstrings]
|
args: [--silent, -E, fix_asserts, -E, fix_docstrings]
|
||||||
|
|
||||||
- repo: https://github.com/timothycrosley/isort
|
- repo: https://github.com/timothycrosley/isort
|
||||||
rev: "1e78a9acf3110e1f9721feb591f89a451fc9876a"
|
rev: 5.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
additional_dependencies: ['toml']
|
additional_dependencies: ['toml']
|
||||||
|
|
|
@ -2,7 +2,6 @@ import itertools
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import salt
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
from docutils.parsers.rst import Directive
|
from docutils.parsers.rst import Directive
|
||||||
from docutils.statemachine import ViewList
|
from docutils.statemachine import ViewList
|
||||||
|
@ -14,6 +13,8 @@ from sphinx.locale import _
|
||||||
from sphinx.roles import XRefRole
|
from sphinx.roles import XRefRole
|
||||||
from sphinx.util.nodes import make_refnode, nested_parse_with_titles, set_source_info
|
from sphinx.util.nodes import make_refnode, nested_parse_with_titles, set_source_info
|
||||||
|
|
||||||
|
import salt
|
||||||
|
|
||||||
|
|
||||||
class Event(PyObject):
|
class Event(PyObject):
|
||||||
"""
|
"""
|
||||||
|
|
7
run.py
7
run.py
|
@ -1,18 +1,19 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# see issue: https://gitlab.com/saltstack/open/salt-pkg/-/issues/19
|
# see issue: https://gitlab.com/saltstack/open/salt-pkg/-/issues/19
|
||||||
import _pyio
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import salt.scripts
|
import _pyio
|
||||||
import salt.utils.platform
|
|
||||||
import tiamatpip.cli
|
import tiamatpip.cli
|
||||||
import tiamatpip.configure
|
import tiamatpip.configure
|
||||||
import tiamatpip.utils
|
import tiamatpip.utils
|
||||||
|
|
||||||
|
import salt.scripts
|
||||||
|
import salt.utils.platform
|
||||||
|
|
||||||
AVAIL = (
|
AVAIL = (
|
||||||
"minion",
|
"minion",
|
||||||
"master",
|
"master",
|
||||||
|
|
|
@ -6,8 +6,8 @@ Provide authentication using OpenStack Keystone
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from keystoneclient.v2_0 import client
|
|
||||||
from keystoneclient.exceptions import AuthorizationFailure, Unauthorized
|
from keystoneclient.exceptions import AuthorizationFailure, Unauthorized
|
||||||
|
from keystoneclient.v2_0 import client
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,10 @@ Provide authentication using simple LDAP binds
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from jinja2 import Environment
|
||||||
|
|
||||||
import salt.utils.data
|
import salt.utils.data
|
||||||
import salt.utils.stringutils
|
import salt.utils.stringutils
|
||||||
from jinja2 import Environment
|
|
||||||
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -16,8 +17,8 @@ log = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
import ldap
|
import ldap
|
||||||
import ldap.modlist
|
|
||||||
import ldap.filter
|
import ldap.filter
|
||||||
|
import ldap.modlist
|
||||||
|
|
||||||
HAS_LDAP = True
|
HAS_LDAP = True
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
|
@ -55,8 +55,8 @@ log = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
# Trying to import MySQLdb
|
# Trying to import MySQLdb
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
|
import MySQLdb.cursors
|
||||||
from MySQLdb.connections import OperationalError
|
from MySQLdb.connections import OperationalError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
|
@ -65,8 +65,8 @@ except ImportError:
|
||||||
|
|
||||||
pymysql.install_as_MySQLdb()
|
pymysql.install_as_MySQLdb()
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
|
import MySQLdb.cursors
|
||||||
from MySQLdb.err import OperationalError
|
from MySQLdb.err import OperationalError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
MySQLdb = None
|
MySQLdb = None
|
||||||
|
|
|
@ -14,8 +14,8 @@ import salt.utils.beacons
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
from watchdog.observers import Observer
|
|
||||||
from watchdog.events import FileSystemEventHandler
|
from watchdog.events import FileSystemEventHandler
|
||||||
|
from watchdog.observers import Observer
|
||||||
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
||||||
|
|
4
salt/cache/mysql_cache.py
vendored
4
salt/cache/mysql_cache.py
vendored
|
@ -60,8 +60,8 @@ from salt.exceptions import SaltCacheError
|
||||||
try:
|
try:
|
||||||
# Trying to import MySQLdb
|
# Trying to import MySQLdb
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
|
import MySQLdb.cursors
|
||||||
from MySQLdb.connections import OperationalError
|
from MySQLdb.connections import OperationalError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
|
@ -70,8 +70,8 @@ except ImportError:
|
||||||
|
|
||||||
pymysql.install_as_MySQLdb()
|
pymysql.install_as_MySQLdb()
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
|
import MySQLdb.cursors
|
||||||
from MySQLdb.err import OperationalError
|
from MySQLdb.err import OperationalError
|
||||||
except ImportError:
|
except ImportError:
|
||||||
MySQLdb = None
|
MySQLdb = None
|
||||||
|
|
|
@ -590,10 +590,9 @@ class LocalClient:
|
||||||
# even though it has already been imported.
|
# even though it has already been imported.
|
||||||
# when cmd_batch is called via the NetAPI
|
# when cmd_batch is called via the NetAPI
|
||||||
# the module is unavailable.
|
# the module is unavailable.
|
||||||
import salt.utils.args
|
|
||||||
|
|
||||||
# Late import - not used anywhere else in this file
|
# Late import - not used anywhere else in this file
|
||||||
import salt.cli.batch
|
import salt.cli.batch
|
||||||
|
import salt.utils.args
|
||||||
|
|
||||||
arg = salt.utils.args.condition_input(arg, kwarg)
|
arg = salt.utils.args.condition_input(arg, kwarg)
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
@ -83,9 +83,9 @@ except ImportError:
|
||||||
HAS_CLC = False
|
HAS_CLC = False
|
||||||
# Disable InsecureRequestWarning generated on python > 2.6
|
# Disable InsecureRequestWarning generated on python > 2.6
|
||||||
try:
|
try:
|
||||||
from requests.packages.urllib3 import (
|
from requests.packages.urllib3 import ( # pylint: disable=no-name-in-module
|
||||||
disable_warnings,
|
disable_warnings,
|
||||||
) # pylint: disable=no-name-in-module
|
)
|
||||||
|
|
||||||
disable_warnings()
|
disable_warnings()
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
|
|
|
@ -39,13 +39,12 @@ from salt.utils.versions import LooseVersion as _LooseVersion
|
||||||
# Import libcloud
|
# Import libcloud
|
||||||
try:
|
try:
|
||||||
import libcloud
|
import libcloud
|
||||||
from libcloud.compute.base import NodeDriver, NodeState
|
from libcloud.compute.base import NodeAuthPassword, NodeDriver, NodeState
|
||||||
from libcloud.compute.base import NodeAuthPassword
|
|
||||||
from libcloud.compute.types import Provider
|
|
||||||
from libcloud.compute.providers import get_driver
|
from libcloud.compute.providers import get_driver
|
||||||
|
from libcloud.compute.types import Provider
|
||||||
from libcloud.loadbalancer.base import Member
|
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.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 >=
|
# 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
|
# 1.4.0. However, older versions of libcloud must still be supported with
|
||||||
|
|
|
@ -66,14 +66,11 @@ from salt.utils.versions import LooseVersion as _LooseVersion
|
||||||
LIBCLOUD_IMPORT_ERROR = None
|
LIBCLOUD_IMPORT_ERROR = None
|
||||||
try:
|
try:
|
||||||
import libcloud
|
import libcloud
|
||||||
from libcloud.compute.types import Provider
|
from libcloud.common.google import ResourceInUseError, ResourceNotFoundError
|
||||||
from libcloud.compute.providers import get_driver
|
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.loadbalancer.providers import get_driver as get_driver_lb
|
||||||
from libcloud.common.google import (
|
from libcloud.loadbalancer.types import Provider as Provider_lb
|
||||||
ResourceInUseError,
|
|
||||||
ResourceNotFoundError,
|
|
||||||
)
|
|
||||||
|
|
||||||
HAS_LIBCLOUD = True
|
HAS_LIBCLOUD = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -61,13 +61,14 @@ from salt.exceptions import SaltCloudSystemExit
|
||||||
HAS_LIBS = False
|
HAS_LIBS = False
|
||||||
try:
|
try:
|
||||||
import azure
|
import azure
|
||||||
import azure.storage
|
|
||||||
import azure.servicemanagement
|
import azure.servicemanagement
|
||||||
|
import azure.storage
|
||||||
from azure.common import (
|
from azure.common import (
|
||||||
AzureConflictHttpError,
|
AzureConflictHttpError,
|
||||||
AzureMissingResourceHttpError,
|
|
||||||
AzureException,
|
AzureException,
|
||||||
|
AzureMissingResourceHttpError,
|
||||||
)
|
)
|
||||||
|
|
||||||
import salt.utils.msazure
|
import salt.utils.msazure
|
||||||
from salt.utils.msazure import object_to_dict
|
from salt.utils.msazure import object_to_dict
|
||||||
|
|
||||||
|
|
|
@ -109,13 +109,7 @@ from salt.exceptions import (
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
from oneandone.client import (
|
from oneandone.client import BlockStorage, Hdd, OneAndOneService, Server, SshKey
|
||||||
OneAndOneService,
|
|
||||||
Server,
|
|
||||||
Hdd,
|
|
||||||
BlockStorage,
|
|
||||||
SshKey,
|
|
||||||
)
|
|
||||||
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ from salt.exceptions import (
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import xmlrpc.client
|
import xmlrpc.client
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
HAS_XML_LIBS = True
|
HAS_XML_LIBS = True
|
||||||
|
|
|
@ -240,10 +240,10 @@ from salt.exceptions import (
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import shade
|
|
||||||
import shade.openstackcloud
|
|
||||||
import shade.exc
|
|
||||||
import os_client_config
|
import os_client_config
|
||||||
|
import shade
|
||||||
|
import shade.exc
|
||||||
|
import shade.openstackcloud
|
||||||
|
|
||||||
HAS_SHADE = (
|
HAS_SHADE = (
|
||||||
salt.utils.versions._LooseVersion(shade.__version__)
|
salt.utils.versions._LooseVersion(shade.__version__)
|
||||||
|
|
|
@ -114,17 +114,17 @@ try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
import profitbricks
|
import profitbricks
|
||||||
from profitbricks.client import (
|
from profitbricks.client import (
|
||||||
ProfitBricksService,
|
LAN,
|
||||||
Server,
|
|
||||||
NIC,
|
NIC,
|
||||||
Volume,
|
Datacenter,
|
||||||
FirewallRule,
|
FirewallRule,
|
||||||
IPBlock,
|
IPBlock,
|
||||||
Datacenter,
|
|
||||||
LoadBalancer,
|
LoadBalancer,
|
||||||
LAN,
|
|
||||||
PBNotFoundError,
|
|
||||||
PBError,
|
PBError,
|
||||||
|
PBNotFoundError,
|
||||||
|
ProfitBricksService,
|
||||||
|
Server,
|
||||||
|
Volume,
|
||||||
)
|
)
|
||||||
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
|
@ -642,7 +642,7 @@ def create(vm_):
|
||||||
if "use_dns" in vm_ and "ip_address" not in vm_:
|
if "use_dns" in vm_ and "ip_address" not in vm_:
|
||||||
use_dns = vm_["use_dns"]
|
use_dns = vm_["use_dns"]
|
||||||
if use_dns:
|
if use_dns:
|
||||||
from socket import gethostbyname, gaierror
|
from socket import gaierror, gethostbyname
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ip_address = gethostbyname(str(vm_["name"]))
|
ip_address = gethostbyname(str(vm_["name"]))
|
||||||
|
|
|
@ -29,8 +29,8 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
from impacket.smbconnection import SessionError as smbSessionError
|
|
||||||
from impacket.smb3 import SessionError as smb3SessionError
|
from impacket.smb3 import SessionError as smb3SessionError
|
||||||
|
from impacket.smbconnection import SessionError as smbSessionError
|
||||||
|
|
||||||
HAS_IMPACKET = True
|
HAS_IMPACKET = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -38,18 +38,17 @@ except ImportError:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
from winrm.exceptions import WinRMTransportError
|
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
from requests.exceptions import (
|
from requests.exceptions import (
|
||||||
ConnectionError,
|
ConnectionError,
|
||||||
ConnectTimeout,
|
ConnectTimeout,
|
||||||
ReadTimeout,
|
|
||||||
SSLError,
|
|
||||||
ProxyError,
|
|
||||||
RetryError,
|
|
||||||
InvalidSchema,
|
InvalidSchema,
|
||||||
|
ProxyError,
|
||||||
|
ReadTimeout,
|
||||||
|
RetryError,
|
||||||
|
SSLError,
|
||||||
)
|
)
|
||||||
|
from winrm.exceptions import WinRMTransportError
|
||||||
|
|
||||||
HAS_WINRM = True
|
HAS_WINRM = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -47,8 +47,8 @@ try:
|
||||||
from tencentcloud.common.profile.client_profile import ClientProfile
|
from tencentcloud.common.profile.client_profile import ClientProfile
|
||||||
from tencentcloud.cvm.v20170312 import cvm_client
|
from tencentcloud.cvm.v20170312 import cvm_client
|
||||||
from tencentcloud.cvm.v20170312 import models as cvm_models
|
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 models as vpc_models
|
||||||
|
from tencentcloud.vpc.v20170312 import vpc_client
|
||||||
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
||||||
|
|
|
@ -23,15 +23,16 @@ from salt.exceptions import SaltCloudSystemExit
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import vboxapi # pylint: disable=unused-import
|
import vboxapi # pylint: disable=unused-import
|
||||||
|
|
||||||
from salt.utils.virtualbox import (
|
from salt.utils.virtualbox import (
|
||||||
vb_list_machines,
|
treat_machine_dict,
|
||||||
vb_clone_vm,
|
vb_clone_vm,
|
||||||
vb_machine_exists,
|
|
||||||
vb_destroy_machine,
|
vb_destroy_machine,
|
||||||
vb_get_machine,
|
vb_get_machine,
|
||||||
vb_stop_vm,
|
vb_list_machines,
|
||||||
treat_machine_dict,
|
vb_machine_exists,
|
||||||
vb_start_vm,
|
vb_start_vm,
|
||||||
|
vb_stop_vm,
|
||||||
vb_wait_for_network_address,
|
vb_wait_for_network_address,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -139,9 +139,9 @@ except ImportError:
|
||||||
|
|
||||||
# Disable InsecureRequestWarning generated on python > 2.6
|
# Disable InsecureRequestWarning generated on python > 2.6
|
||||||
try:
|
try:
|
||||||
from requests.packages.urllib3 import (
|
from requests.packages.urllib3 import ( # pylint: disable=no-name-in-module
|
||||||
disable_warnings,
|
disable_warnings,
|
||||||
) # pylint: disable=no-name-in-module
|
)
|
||||||
|
|
||||||
disable_warnings()
|
disable_warnings()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -16,9 +16,9 @@ from salt.exceptions import SaltCloudNotFound, SaltCloudSystemExit
|
||||||
# pylint: disable=W0611
|
# pylint: disable=W0611
|
||||||
try:
|
try:
|
||||||
import libcloud
|
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.deployment import MultiStepDeployment, ScriptDeployment
|
||||||
|
from libcloud.compute.providers import get_driver
|
||||||
|
from libcloud.compute.types import NodeState, Provider
|
||||||
|
|
||||||
HAS_LIBCLOUD = True
|
HAS_LIBCLOUD = True
|
||||||
LIBCLOUD_VERSION_INFO = tuple(
|
LIBCLOUD_VERSION_INFO = tuple(
|
||||||
|
|
|
@ -43,7 +43,7 @@ from salt.exceptions import (
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from M2Crypto import RSA, EVP, BIO
|
from M2Crypto import BIO, EVP, RSA
|
||||||
|
|
||||||
HAS_M2 = True
|
HAS_M2 = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -51,11 +51,12 @@ except ImportError:
|
||||||
|
|
||||||
if not HAS_M2:
|
if not HAS_M2:
|
||||||
try:
|
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.Hash import SHA
|
||||||
from Cryptodome.PublicKey import RSA
|
from Cryptodome.PublicKey import RSA
|
||||||
from Cryptodome.Signature import PKCS1_v1_5
|
from Cryptodome.Signature import PKCS1_v1_5
|
||||||
from Cryptodome import Random
|
|
||||||
|
|
||||||
HAS_CRYPTO = True
|
HAS_CRYPTO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -63,18 +64,14 @@ if not HAS_M2:
|
||||||
|
|
||||||
if not HAS_M2 and not HAS_CRYPTO:
|
if not HAS_M2 and not HAS_CRYPTO:
|
||||||
try:
|
try:
|
||||||
from Crypto.Cipher import ( # nosec
|
# let this be imported, if possible
|
||||||
AES,
|
from Crypto import Random # nosec
|
||||||
PKCS1_OAEP,
|
from Crypto.Cipher import AES, PKCS1_OAEP # nosec
|
||||||
PKCS1_v1_5 as PKCS1_v1_5_CIPHER,
|
from Crypto.Cipher import PKCS1_v1_5 as PKCS1_v1_5_CIPHER # nosec
|
||||||
)
|
|
||||||
from Crypto.Hash import SHA # nosec
|
from Crypto.Hash import SHA # nosec
|
||||||
from Crypto.PublicKey import RSA # nosec
|
from Crypto.PublicKey import RSA # nosec
|
||||||
from Crypto.Signature import PKCS1_v1_5 # nosec
|
from Crypto.Signature import PKCS1_v1_5 # nosec
|
||||||
|
|
||||||
# let this be imported, if possible
|
|
||||||
from Crypto import Random # nosec
|
|
||||||
|
|
||||||
HAS_CRYPTO = True
|
HAS_CRYPTO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAS_CRYPTO = False
|
HAS_CRYPTO = False
|
||||||
|
|
|
@ -40,7 +40,7 @@ import logging
|
||||||
import salt.utils.event
|
import salt.utils.event
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from fluent import sender, event
|
from fluent import event, sender
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sender = None
|
sender = None
|
||||||
|
|
||||||
|
|
|
@ -92,22 +92,22 @@ import time
|
||||||
import salt.utils.event as event
|
import salt.utils.event as event
|
||||||
|
|
||||||
try:
|
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 (
|
from pyparsing import (
|
||||||
Word,
|
|
||||||
alphas,
|
|
||||||
Suppress,
|
|
||||||
Combine,
|
Combine,
|
||||||
nums,
|
LineEnd,
|
||||||
string,
|
|
||||||
Optional,
|
Optional,
|
||||||
Regex,
|
Regex,
|
||||||
LineEnd,
|
|
||||||
StringEnd,
|
StringEnd,
|
||||||
|
Suppress,
|
||||||
|
Word,
|
||||||
|
alphas,
|
||||||
delimitedList,
|
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
|
HAS_TWISTED_AND_PYPARSING = True
|
||||||
|
|
|
@ -24,6 +24,7 @@ import uuid
|
||||||
from errno import EACCES, EPERM
|
from errno import EACCES, EPERM
|
||||||
|
|
||||||
import distro
|
import distro
|
||||||
|
|
||||||
import salt.exceptions
|
import salt.exceptions
|
||||||
|
|
||||||
# Solve the Chicken and egg problem where grains need to run before any
|
# Solve the Chicken and egg problem where grains need to run before any
|
||||||
|
|
|
@ -40,7 +40,7 @@ import socket
|
||||||
from salt._logging import LOG_LEVELS
|
from salt._logging import LOG_LEVELS
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from log4mongo.handlers import MongoHandler, MongoFormatter
|
from log4mongo.handlers import MongoFormatter, MongoHandler
|
||||||
|
|
||||||
HAS_MONGO = True
|
HAS_MONGO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -54,10 +54,7 @@ log = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
import apt.cache
|
import apt.cache
|
||||||
import apt.debfile
|
import apt.debfile
|
||||||
from aptsources.sourceslist import (
|
from aptsources.sourceslist import SourceEntry, SourcesList
|
||||||
SourceEntry,
|
|
||||||
SourcesList,
|
|
||||||
)
|
|
||||||
|
|
||||||
HAS_APT = True
|
HAS_APT = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -57,8 +57,8 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import botocore
|
|
||||||
import boto3
|
import boto3
|
||||||
|
import botocore
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
||||||
|
|
|
@ -50,8 +50,8 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
try:
|
try:
|
||||||
import botocore
|
|
||||||
import boto3
|
import boto3
|
||||||
|
import botocore
|
||||||
import jmespath
|
import jmespath
|
||||||
|
|
||||||
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
||||||
|
|
|
@ -93,10 +93,10 @@ try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import boto
|
import boto
|
||||||
import boto3
|
import boto3
|
||||||
|
from botocore import __version__ as found_botocore_version
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from botocore import __version__ as found_botocore_version
|
|
||||||
|
|
||||||
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
||||||
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
||||||
|
|
|
@ -63,9 +63,9 @@ DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
||||||
try:
|
try:
|
||||||
import boto
|
import boto
|
||||||
import boto.ec2
|
import boto.ec2
|
||||||
import boto.ec2.instance
|
|
||||||
import boto.ec2.blockdevicemapping as blockdevicemapping
|
|
||||||
import boto.ec2.autoscale as autoscale
|
import boto.ec2.autoscale as autoscale
|
||||||
|
import boto.ec2.blockdevicemapping as blockdevicemapping
|
||||||
|
import boto.ec2.instance
|
||||||
|
|
||||||
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
||||||
import boto3 # pylint: disable=unused-import
|
import boto3 # pylint: disable=unused-import
|
||||||
|
|
|
@ -45,16 +45,17 @@ Connection module for Amazon CloudWatch
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import yaml # pylint: disable=blacklisted-import
|
||||||
|
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
import salt.utils.odict as odict
|
import salt.utils.odict as odict
|
||||||
import salt.utils.versions
|
import salt.utils.versions
|
||||||
import yaml # pylint: disable=blacklisted-import
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import boto
|
import boto
|
||||||
import boto.ec2.cloudwatch
|
import boto.ec2.cloudwatch
|
||||||
import boto.ec2.cloudwatch.listelement
|
|
||||||
import boto.ec2.cloudwatch.dimension
|
import boto.ec2.cloudwatch.dimension
|
||||||
|
import boto.ec2.cloudwatch.listelement
|
||||||
|
|
||||||
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
||||||
HAS_BOTO = True
|
HAS_BOTO = True
|
||||||
|
|
|
@ -55,12 +55,13 @@ try:
|
||||||
import boto.dynamodb2
|
import boto.dynamodb2
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
from boto.dynamodb2.fields import HashKey, RangeKey
|
|
||||||
from boto.dynamodb2.fields import (
|
from boto.dynamodb2.fields import (
|
||||||
AllIndex,
|
AllIndex,
|
||||||
GlobalAllIndex,
|
GlobalAllIndex,
|
||||||
GlobalIncludeIndex,
|
GlobalIncludeIndex,
|
||||||
GlobalKeysOnlyIndex,
|
GlobalKeysOnlyIndex,
|
||||||
|
HashKey,
|
||||||
|
RangeKey,
|
||||||
)
|
)
|
||||||
from boto.dynamodb2.table import Table
|
from boto.dynamodb2.table import Table
|
||||||
from boto.exception import JSONResponseError
|
from boto.exception import JSONResponseError
|
||||||
|
|
|
@ -60,8 +60,8 @@ try:
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType
|
from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType
|
||||||
from boto.ec2.networkinterface import (
|
from boto.ec2.networkinterface import (
|
||||||
NetworkInterfaceSpecification,
|
|
||||||
NetworkInterfaceCollection,
|
NetworkInterfaceCollection,
|
||||||
|
NetworkInterfaceSpecification,
|
||||||
)
|
)
|
||||||
|
|
||||||
HAS_BOTO = True
|
HAS_BOTO = True
|
||||||
|
|
|
@ -54,10 +54,12 @@ try:
|
||||||
import boto
|
import boto
|
||||||
import boto.ec2 # pylint: enable=unused-import
|
import boto.ec2 # pylint: enable=unused-import
|
||||||
from boto.ec2.elb import HealthCheck
|
from boto.ec2.elb import HealthCheck
|
||||||
from boto.ec2.elb.attributes import AccessLogAttribute
|
from boto.ec2.elb.attributes import (
|
||||||
from boto.ec2.elb.attributes import ConnectionDrainingAttribute
|
AccessLogAttribute,
|
||||||
from boto.ec2.elb.attributes import ConnectionSettingAttribute
|
ConnectionDrainingAttribute,
|
||||||
from boto.ec2.elb.attributes import CrossZoneLoadBalancingAttribute
|
ConnectionSettingAttribute,
|
||||||
|
CrossZoneLoadBalancingAttribute,
|
||||||
|
)
|
||||||
|
|
||||||
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
||||||
HAS_BOTO = True
|
HAS_BOTO = True
|
||||||
|
|
|
@ -49,7 +49,6 @@ try:
|
||||||
import botocore
|
import botocore
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
|
|
||||||
# TODO Version check using salt.utils.versions
|
# TODO Version check using salt.utils.versions
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ import salt.utils.versions
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
try:
|
try:
|
||||||
import boto
|
import boto
|
||||||
import boto.iam
|
|
||||||
import boto3
|
import boto3
|
||||||
|
import boto.iam
|
||||||
import botocore
|
import botocore
|
||||||
|
|
||||||
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
||||||
|
|
|
@ -64,10 +64,10 @@ try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import boto
|
import boto
|
||||||
import boto3
|
import boto3
|
||||||
|
from botocore import __version__ as found_botocore_version
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from botocore import __version__ as found_botocore_version
|
|
||||||
|
|
||||||
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
||||||
HAS_BOTO = True
|
HAS_BOTO = True
|
||||||
|
|
|
@ -96,10 +96,10 @@ try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import boto
|
import boto
|
||||||
import boto3
|
import boto3
|
||||||
|
from botocore import __version__ as found_botocore_version
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from botocore import __version__ as found_botocore_version
|
|
||||||
|
|
||||||
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
logging.getLogger("boto").setLevel(logging.CRITICAL)
|
||||||
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
||||||
|
|
|
@ -147,8 +147,8 @@ log = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import boto
|
import boto
|
||||||
import botocore
|
|
||||||
import boto.vpc
|
import boto.vpc
|
||||||
|
import botocore
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
from boto.exception import BotoServerError
|
from boto.exception import BotoServerError
|
||||||
|
|
|
@ -34,8 +34,8 @@ log = logging.getLogger(__file__)
|
||||||
try:
|
try:
|
||||||
import capirca
|
import capirca
|
||||||
import capirca.aclgen
|
import capirca.aclgen
|
||||||
import capirca.lib.policy
|
|
||||||
import capirca.lib.aclgenerator
|
import capirca.lib.aclgenerator
|
||||||
|
import capirca.lib.policy
|
||||||
|
|
||||||
HAS_CAPIRCA = True
|
HAS_CAPIRCA = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -96,14 +96,13 @@ __virtualname__ = "cassandra_cql"
|
||||||
HAS_DRIVER = False
|
HAS_DRIVER = False
|
||||||
try:
|
try:
|
||||||
# pylint: disable=import-error,no-name-in-module
|
# pylint: disable=import-error,no-name-in-module
|
||||||
from cassandra.cluster import Cluster
|
from cassandra.auth import PlainTextAuthProvider
|
||||||
from cassandra.cluster import NoHostAvailable
|
from cassandra.cluster import Cluster, NoHostAvailable
|
||||||
from cassandra.connection import (
|
from cassandra.connection import (
|
||||||
ConnectionException,
|
ConnectionException,
|
||||||
ConnectionShutdown,
|
ConnectionShutdown,
|
||||||
OperationTimedOut,
|
OperationTimedOut,
|
||||||
)
|
)
|
||||||
from cassandra.auth import PlainTextAuthProvider
|
|
||||||
from cassandra.query import dict_factory
|
from cassandra.query import dict_factory
|
||||||
|
|
||||||
# pylint: enable=import-error,no-name-in-module
|
# pylint: enable=import-error,no-name-in-module
|
||||||
|
|
|
@ -10,9 +10,10 @@ import os
|
||||||
import re
|
import re
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
import salt.utils.data
|
import salt.utils.data
|
||||||
import salt.utils.platform
|
import salt.utils.platform
|
||||||
from requests.structures import CaseInsensitiveDict
|
|
||||||
from salt.exceptions import (
|
from salt.exceptions import (
|
||||||
CommandExecutionError,
|
CommandExecutionError,
|
||||||
CommandNotFoundError,
|
CommandNotFoundError,
|
||||||
|
|
|
@ -15,6 +15,7 @@ https://docs.datadoghq.com/api/
|
||||||
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from salt.exceptions import SaltInvocationError
|
from salt.exceptions import SaltInvocationError
|
||||||
|
|
||||||
HAS_DATADOG = True
|
HAS_DATADOG = True
|
||||||
|
|
|
@ -32,8 +32,8 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import dns.query
|
import dns.query
|
||||||
import dns.update # pylint: disable=no-name-in-module
|
|
||||||
import dns.tsigkeyring # 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
|
dns_support = True
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
|
|
|
@ -15,6 +15,7 @@ import time
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
import jinja2.exceptions
|
import jinja2.exceptions
|
||||||
|
|
||||||
import salt.utils.dns
|
import salt.utils.dns
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.odict
|
import salt.utils.odict
|
||||||
|
|
|
@ -33,6 +33,7 @@ REPREPRO_SIGN_PROMPT_RE = re.compile(r"Passphrase: ", re.M)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import gnupg # pylint: disable=unused-import
|
import gnupg # pylint: disable=unused-import
|
||||||
|
|
||||||
import salt.modules.gpg
|
import salt.modules.gpg
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
|
|
|
@ -8,7 +8,9 @@ import os
|
||||||
HAS_GENTOOLKIT = False
|
HAS_GENTOOLKIT = False
|
||||||
|
|
||||||
try:
|
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
|
HAS_GENTOOLKIT = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -39,8 +39,8 @@ HAS_LIBS = False
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
import github
|
import github
|
||||||
import github.PaginatedList
|
|
||||||
import github.NamedUser
|
import github.NamedUser
|
||||||
|
import github.PaginatedList
|
||||||
from github.GithubException import UnknownObjectException
|
from github.GithubException import UnknownObjectException
|
||||||
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
|
@ -20,13 +20,14 @@ import os
|
||||||
import re
|
import re
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
import salt.utils.args
|
import salt.utils.args
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
import salt.utils.path
|
import salt.utils.path
|
||||||
import salt.utils.platform
|
import salt.utils.platform
|
||||||
import salt.utils.stringutils
|
import salt.utils.stringutils
|
||||||
import yaml
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
|
@ -7,8 +7,8 @@ import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from salt.utils.versions import LooseVersion as _LooseVersion
|
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
from salt.utils.versions import LooseVersion as _LooseVersion
|
||||||
|
|
||||||
HAS_REQUIRED_LIBS = True
|
HAS_REQUIRED_LIBS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -6,12 +6,12 @@ import functools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from salt.utils.versions import LooseVersion as _LooseVersion
|
import salt.modules.yumpkg
|
||||||
from salt.exceptions import CommandExecutionError
|
|
||||||
import salt.utils.data
|
import salt.utils.data
|
||||||
import salt.utils.functools
|
import salt.utils.functools
|
||||||
import salt.utils.systemd
|
import salt.utils.systemd
|
||||||
import salt.modules.yumpkg
|
from salt.exceptions import CommandExecutionError
|
||||||
|
from salt.utils.versions import LooseVersion as _LooseVersion
|
||||||
|
|
||||||
__IMPORT_ERROR = None
|
__IMPORT_ERROR = None
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
|
|
|
@ -58,14 +58,14 @@ import salt.utils.http
|
||||||
HAS_KEYSTONE = False
|
HAS_KEYSTONE = False
|
||||||
try:
|
try:
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
from keystoneclient.v2_0 import client
|
|
||||||
import keystoneclient.exceptions
|
import keystoneclient.exceptions
|
||||||
|
from keystoneclient.v2_0 import client
|
||||||
|
|
||||||
HAS_KEYSTONE = True
|
HAS_KEYSTONE = True
|
||||||
from keystoneclient.v3 import client as client3
|
|
||||||
from keystoneclient import discover
|
|
||||||
from keystoneauth1 import session
|
from keystoneauth1 import session
|
||||||
from keystoneauth1.identity import generic
|
from keystoneauth1.identity import generic
|
||||||
|
from keystoneclient import discover
|
||||||
|
from keystoneclient.v3 import client as client3
|
||||||
|
|
||||||
# pylint: enable=import-error
|
# pylint: enable=import-error
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -72,8 +72,7 @@ try:
|
||||||
from kubernetes.client import V1beta1Deployment as AppsV1beta1Deployment
|
from kubernetes.client import V1beta1Deployment as AppsV1beta1Deployment
|
||||||
from kubernetes.client import V1beta1DeploymentSpec as AppsV1beta1DeploymentSpec
|
from kubernetes.client import V1beta1DeploymentSpec as AppsV1beta1DeploymentSpec
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from kubernetes.client import AppsV1beta1Deployment
|
from kubernetes.client import AppsV1beta1Deployment, AppsV1beta1DeploymentSpec
|
||||||
from kubernetes.client import AppsV1beta1DeploymentSpec
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
|
|
|
@ -43,8 +43,8 @@ REQUIRED_LIBCLOUD_VERSION = "2.0.0"
|
||||||
try:
|
try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import libcloud
|
import libcloud
|
||||||
from libcloud.compute.providers import get_driver
|
|
||||||
from libcloud.compute.base import Node
|
from libcloud.compute.base import Node
|
||||||
|
from libcloud.compute.providers import get_driver
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
if hasattr(libcloud, "__version__") and _LooseVersion(
|
if hasattr(libcloud, "__version__") and _LooseVersion(
|
||||||
|
|
|
@ -42,8 +42,8 @@ REQUIRED_LIBCLOUD_VERSION = "1.5.0"
|
||||||
try:
|
try:
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
import libcloud
|
import libcloud
|
||||||
|
from libcloud.loadbalancer.base import Algorithm, Member
|
||||||
from libcloud.loadbalancer.providers import get_driver
|
from libcloud.loadbalancer.providers import get_driver
|
||||||
from libcloud.loadbalancer.base import Member, Algorithm
|
|
||||||
|
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
if hasattr(libcloud, "__version__") and _LooseVersion(
|
if hasattr(libcloud, "__version__") and _LooseVersion(
|
||||||
|
|
|
@ -49,10 +49,10 @@ import salt.utils.stringutils
|
||||||
try:
|
try:
|
||||||
# Trying to import MySQLdb
|
# Trying to import MySQLdb
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
from MySQLdb.constants import FIELD_TYPE, FLAG, CLIENT
|
import MySQLdb.cursors
|
||||||
from MySQLdb import OperationalError
|
from MySQLdb import OperationalError
|
||||||
|
from MySQLdb.constants import CLIENT, FIELD_TYPE, FLAG
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
# MySQLdb import failed, try to import PyMySQL
|
# MySQLdb import failed, try to import PyMySQL
|
||||||
|
@ -60,10 +60,10 @@ except ImportError:
|
||||||
|
|
||||||
pymysql.install_as_MySQLdb()
|
pymysql.install_as_MySQLdb()
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
from MySQLdb.constants import FIELD_TYPE, FLAG, CLIENT
|
import MySQLdb.cursors
|
||||||
from MySQLdb import OperationalError
|
from MySQLdb import OperationalError
|
||||||
|
from MySQLdb.constants import CLIENT, FIELD_TYPE, FLAG
|
||||||
except ImportError:
|
except ImportError:
|
||||||
MySQLdb = None
|
MySQLdb = None
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ try:
|
||||||
# pylint: disable=W0611
|
# pylint: disable=W0611
|
||||||
import capirca
|
import capirca
|
||||||
import capirca.aclgen
|
import capirca.aclgen
|
||||||
import capirca.lib.policy
|
|
||||||
import capirca.lib.aclgenerator
|
import capirca.lib.aclgenerator
|
||||||
|
import capirca.lib.policy
|
||||||
|
|
||||||
HAS_CAPIRCA = True
|
HAS_CAPIRCA = True
|
||||||
# pylint: enable=W0611
|
# pylint: enable=W0611
|
||||||
|
|
|
@ -189,8 +189,7 @@ from salt.exceptions import CommandExecutionError
|
||||||
from salt.utils.args import clean_kwargs
|
from salt.utils.args import clean_kwargs
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from netmiko import ConnectHandler
|
from netmiko import BaseConnection, ConnectHandler
|
||||||
from netmiko import BaseConnection
|
|
||||||
|
|
||||||
HAS_NETMIKO = True
|
HAS_NETMIKO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -51,18 +51,18 @@ import logging
|
||||||
import salt.utils.platform
|
import salt.utils.platform
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from nsnitro.nsnitro import NSNitro
|
|
||||||
from nsnitro.nsexceptions import NSNitroError
|
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.nsserver import NSServer
|
||||||
from nsnitro.nsresources.nsservice import NSService
|
from nsnitro.nsresources.nsservice import NSService
|
||||||
from nsnitro.nsresources.nsservicegroup import NSServiceGroup
|
from nsnitro.nsresources.nsservicegroup import NSServiceGroup
|
||||||
from nsnitro.nsresources.nsservicegroupserverbinding import (
|
from nsnitro.nsresources.nsservicegroupserverbinding import (
|
||||||
NSServiceGroupServerBinding,
|
NSServiceGroupServerBinding,
|
||||||
)
|
)
|
||||||
from nsnitro.nsresources.nslbvserver import NSLBVServer
|
|
||||||
from nsnitro.nsresources.nslbvserverservicegroupbinding import (
|
|
||||||
NSLBVServerServiceGroupBinding,
|
|
||||||
)
|
|
||||||
from nsnitro.nsresources.nssslvserversslcertkeybinding import (
|
from nsnitro.nsresources.nssslvserversslcertkeybinding import (
|
||||||
NSSSLVServerSSLCertKeyBinding,
|
NSSSLVServerSSLCertKeyBinding,
|
||||||
)
|
)
|
||||||
|
|
|
@ -23,6 +23,7 @@ Module for sending data to OpsGenie
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
import salt.exceptions
|
import salt.exceptions
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ For PagerDuty API details, see https://developer.pagerduty.com/documentation/res
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,15 @@ from datetime import datetime
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from purity_fb import PurityFb, FileSystem, FileSystemSnapshot, SnapshotSuffix
|
from purity_fb import (
|
||||||
from purity_fb import rest, NfsRule, ProtocolRule
|
FileSystem,
|
||||||
|
FileSystemSnapshot,
|
||||||
|
NfsRule,
|
||||||
|
ProtocolRule,
|
||||||
|
PurityFb,
|
||||||
|
SnapshotSuffix,
|
||||||
|
rest,
|
||||||
|
)
|
||||||
|
|
||||||
HAS_PURITY_FB = True
|
HAS_PURITY_FB = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -9,8 +9,8 @@ import salt.utils.platform
|
||||||
from salt.utils.decorators import depends
|
from salt.utils.decorators import depends
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from pywintypes import error as PyWinError
|
|
||||||
import win32ts
|
import win32ts
|
||||||
|
from pywintypes import error as PyWinError
|
||||||
|
|
||||||
_HAS_WIN32TS_DEPENDENCIES = True
|
_HAS_WIN32TS_DEPENDENCIES = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -7,6 +7,7 @@ import os
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
import jinja2.exceptions
|
import jinja2.exceptions
|
||||||
|
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
import salt.utils.stringutils
|
import salt.utils.stringutils
|
||||||
|
|
|
@ -31,8 +31,8 @@ if salt.utils.path.which("initctl"):
|
||||||
# Don't re-invent the wheel, import the helper functions from the
|
# Don't re-invent the wheel, import the helper functions from the
|
||||||
# upstart module.
|
# upstart module.
|
||||||
from salt.modules.upstart_service import (
|
from salt.modules.upstart_service import (
|
||||||
_upstart_enable,
|
|
||||||
_upstart_disable,
|
_upstart_disable,
|
||||||
|
_upstart_enable,
|
||||||
_upstart_is_enabled,
|
_upstart_is_enabled,
|
||||||
)
|
)
|
||||||
except Exception as exc: # pylint: disable=broad-except
|
except Exception as exc: # pylint: disable=broad-except
|
||||||
|
|
|
@ -31,6 +31,7 @@ HAS_LIBS = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import gnupg # pylint: disable=unused-import
|
import gnupg # pylint: disable=unused-import
|
||||||
|
|
||||||
import salt.modules.gpg
|
import salt.modules.gpg
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
|
|
|
@ -13,11 +13,12 @@ import datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
import salt.utils.event
|
import salt.utils.event
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.odict
|
import salt.utils.odict
|
||||||
import salt.utils.yaml
|
import salt.utils.yaml
|
||||||
import yaml
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import dateutil.parser as dateutil_parser
|
import dateutil.parser as dateutil_parser
|
||||||
|
|
|
@ -12,8 +12,8 @@ import logging
|
||||||
# Import salt modules
|
# Import salt modules
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import scp
|
|
||||||
import paramiko
|
import paramiko
|
||||||
|
import scp
|
||||||
|
|
||||||
HAS_SCP = True
|
HAS_SCP = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -51,10 +51,10 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
HAS_LIBS = False
|
HAS_LIBS = False
|
||||||
try:
|
try:
|
||||||
import smtplib
|
|
||||||
import email.mime.text
|
|
||||||
import email.mime.application
|
import email.mime.application
|
||||||
import email.mime.multipart
|
import email.mime.multipart
|
||||||
|
import email.mime.text
|
||||||
|
import smtplib
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -28,8 +28,8 @@ import subprocess
|
||||||
HAS_LIBS = False
|
HAS_LIBS = False
|
||||||
try:
|
try:
|
||||||
import splunklib.client
|
import splunklib.client
|
||||||
from splunklib.client import AuthenticationError
|
|
||||||
from splunklib.binding import HTTPError
|
from splunklib.binding import HTTPError
|
||||||
|
from splunklib.client import AuthenticationError
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -27,8 +27,8 @@ from salt.utils.odict import OrderedDict
|
||||||
|
|
||||||
HAS_LIBS = False
|
HAS_LIBS = False
|
||||||
try:
|
try:
|
||||||
import splunklib.client
|
|
||||||
import requests
|
import requests
|
||||||
|
import splunklib.client
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -10,6 +10,7 @@ import os
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
import jinja2.exceptions
|
import jinja2.exceptions
|
||||||
|
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.stringutils
|
import salt.utils.stringutils
|
||||||
import salt.utils.templates
|
import salt.utils.templates
|
||||||
|
|
|
@ -33,8 +33,8 @@ try:
|
||||||
from twilio.rest import TwilioException as TwilioRestException
|
from twilio.rest import TwilioException as TwilioRestException
|
||||||
else:
|
else:
|
||||||
TWILIO_5 = True
|
TWILIO_5 = True
|
||||||
from twilio.rest import TwilioRestClient
|
|
||||||
from twilio import TwilioRestException # pylint: disable=no-name-in-module
|
from twilio import TwilioRestException # pylint: disable=no-name-in-module
|
||||||
|
from twilio.rest import TwilioRestClient
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -136,6 +136,7 @@ from xml.etree import ElementTree
|
||||||
from xml.sax import saxutils
|
from xml.sax import saxutils
|
||||||
|
|
||||||
import jinja2.exceptions
|
import jinja2.exceptions
|
||||||
|
|
||||||
import salt.utils.data
|
import salt.utils.data
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
|
|
|
@ -233,15 +233,9 @@ except ImportError:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
from pyVmomi import (
|
from pyVmomi import VmomiSupport, pbm, vim, vmodl
|
||||||
vim,
|
|
||||||
vmodl,
|
|
||||||
pbm,
|
|
||||||
VmomiSupport,
|
|
||||||
)
|
|
||||||
|
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
||||||
# We check the supported vim versions to infer the pyVmomi version
|
# We check the supported vim versions to infer the pyVmomi version
|
||||||
if (
|
if (
|
||||||
"vim25/6.0" in VmomiSupport.versionMap
|
"vim25/6.0" in VmomiSupport.versionMap
|
||||||
|
@ -260,10 +254,13 @@ except ImportError:
|
||||||
# vSphere SDK Automation
|
# vSphere SDK Automation
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
try:
|
try:
|
||||||
from com.vmware.cis.tagging_client import Category, CategoryModel
|
from com.vmware.cis.tagging_client import (
|
||||||
from com.vmware.cis.tagging_client import Tag, TagModel, TagAssociation
|
Category,
|
||||||
from com.vmware.vcenter_client import Cluster
|
CategoryModel,
|
||||||
from com.vmware.vapi.std_client import DynamicID
|
Tag,
|
||||||
|
TagAssociation,
|
||||||
|
TagModel,
|
||||||
|
)
|
||||||
|
|
||||||
# Error Handling
|
# Error Handling
|
||||||
from com.vmware.vapi.std.errors_client import (
|
from com.vmware.vapi.std.errors_client import (
|
||||||
|
@ -273,6 +270,8 @@ try:
|
||||||
Unauthenticated,
|
Unauthenticated,
|
||||||
Unauthorized,
|
Unauthorized,
|
||||||
)
|
)
|
||||||
|
from com.vmware.vapi.std_client import DynamicID
|
||||||
|
from com.vmware.vcenter_client import Cluster
|
||||||
|
|
||||||
vsphere_errors = (
|
vsphere_errors = (
|
||||||
AlreadyExists,
|
AlreadyExists,
|
||||||
|
|
|
@ -20,8 +20,9 @@ from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import winreg
|
import winreg
|
||||||
import win32security
|
|
||||||
import ntsecuritycon
|
import ntsecuritycon
|
||||||
|
import win32security
|
||||||
|
|
||||||
HAS_WINDOWS_MODULES = True
|
HAS_WINDOWS_MODULES = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -8,6 +8,7 @@ import salt.utils.platform
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import wmi
|
import wmi
|
||||||
|
|
||||||
import salt.utils.winapi
|
import salt.utils.winapi
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
|
|
|
@ -99,6 +99,7 @@ try:
|
||||||
import win32con
|
import win32con
|
||||||
import win32file
|
import win32file
|
||||||
import win32security
|
import win32security
|
||||||
|
|
||||||
import salt.platform.win
|
import salt.platform.win
|
||||||
|
|
||||||
HAS_WINDOWS_MODULES = True
|
HAS_WINDOWS_MODULES = True
|
||||||
|
|
|
@ -15,9 +15,9 @@ import salt.utils.win_functions
|
||||||
import salt.utils.winapi
|
import salt.utils.winapi
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import pywintypes
|
||||||
import win32api
|
import win32api
|
||||||
import win32com.client
|
import win32com.client
|
||||||
import pywintypes
|
|
||||||
|
|
||||||
HAS_DEPENDENCIES = True
|
HAS_DEPENDENCIES = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -13,9 +13,10 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
import salt.utils.json
|
import salt.utils.json
|
||||||
import salt.utils.platform
|
import salt.utils.platform
|
||||||
import yaml
|
|
||||||
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
|
@ -27,6 +27,7 @@ from salt.exceptions import SaltInvocationError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import wmi
|
import wmi
|
||||||
|
|
||||||
import salt.utils.winapi
|
import salt.utils.winapi
|
||||||
|
|
||||||
_HAS_MODULE_DEPENDENCIES = True
|
_HAS_MODULE_DEPENDENCIES = True
|
||||||
|
|
|
@ -25,6 +25,7 @@ log = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
if salt.utils.platform.is_windows():
|
if salt.utils.platform.is_windows():
|
||||||
import wmi
|
import wmi
|
||||||
|
|
||||||
import salt.utils.winapi
|
import salt.utils.winapi
|
||||||
|
|
||||||
HAS_WMI = True
|
HAS_WMI = True
|
||||||
|
|
|
@ -24,12 +24,13 @@ import salt.utils.winapi
|
||||||
from salt.exceptions import CommandExecutionError
|
from salt.exceptions import CommandExecutionError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
from ctypes import windll
|
||||||
|
|
||||||
import pywintypes
|
import pywintypes
|
||||||
import win32api
|
import win32api
|
||||||
import win32con
|
import win32con
|
||||||
import win32net
|
import win32net
|
||||||
import wmi
|
import wmi
|
||||||
from ctypes import windll
|
|
||||||
|
|
||||||
HAS_WIN32NET_MODS = True
|
HAS_WIN32NET_MODS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -42,7 +42,6 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pywintypes
|
import pywintypes
|
||||||
import wmi
|
|
||||||
import win32api
|
import win32api
|
||||||
import win32con
|
import win32con
|
||||||
import win32net
|
import win32net
|
||||||
|
@ -50,6 +49,7 @@ try:
|
||||||
import win32profile
|
import win32profile
|
||||||
import win32security
|
import win32security
|
||||||
import win32ts
|
import win32ts
|
||||||
|
import wmi
|
||||||
|
|
||||||
HAS_WIN32NET_MODS = True
|
HAS_WIN32NET_MODS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -14,16 +14,15 @@ import logging
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
try:
|
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
|
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:
|
# TODO: use the kazoo one, waiting for pull req:
|
||||||
# https://github.com/python-zk/kazoo/pull/206
|
# https://github.com/python-zk/kazoo/pull/206
|
||||||
class _Semaphore(kazoo.recipe.lock.Semaphore):
|
class _Semaphore(kazoo.recipe.lock.Semaphore):
|
||||||
|
|
|
@ -597,6 +597,7 @@ from multiprocessing import Pipe, Process
|
||||||
from urllib.parse import parse_qsl
|
from urllib.parse import parse_qsl
|
||||||
|
|
||||||
import cherrypy # pylint: disable=import-error,3rd-party-module-not-gated
|
import cherrypy # pylint: disable=import-error,3rd-party-module-not-gated
|
||||||
|
|
||||||
import salt
|
import salt
|
||||||
import salt.auth
|
import salt.auth
|
||||||
import salt.exceptions
|
import salt.exceptions
|
||||||
|
@ -627,8 +628,8 @@ except ImportError:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Imports related to websocket
|
# Imports related to websocket
|
||||||
from .tools import websockets
|
|
||||||
from . import event_processor
|
from . import event_processor
|
||||||
|
from .tools import websockets
|
||||||
|
|
||||||
HAS_WEBSOCKETS = True
|
HAS_WEBSOCKETS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -55,8 +55,8 @@ def bootstrap_app():
|
||||||
"""
|
"""
|
||||||
Grab the opts dict of the master config by trying to import Salt
|
Grab the opts dict of the master config by trying to import Salt
|
||||||
"""
|
"""
|
||||||
from salt.netapi.rest_cherrypy import app
|
|
||||||
import salt.config
|
import salt.config
|
||||||
|
from salt.netapi.rest_cherrypy import app
|
||||||
|
|
||||||
__opts__ = salt.config.client_config(
|
__opts__ = salt.config.client_config(
|
||||||
os.environ.get("SALT_MASTER_CONFIG", "/etc/salt/master")
|
os.environ.get("SALT_MASTER_CONFIG", "/etc/salt/master")
|
||||||
|
|
|
@ -1140,8 +1140,8 @@ class Pillar:
|
||||||
# the git ext_pillar() func is run, but only for masterless.
|
# 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":
|
if self.ext and "git" in self.ext and self.opts.get("__role") != "minion":
|
||||||
# Avoid circular import
|
# Avoid circular import
|
||||||
import salt.utils.gitfs
|
|
||||||
import salt.pillar.git_pillar
|
import salt.pillar.git_pillar
|
||||||
|
import salt.utils.gitfs
|
||||||
|
|
||||||
git_pillar = salt.utils.gitfs.GitPillar(
|
git_pillar = salt.utils.gitfs.GitPillar(
|
||||||
self.opts,
|
self.opts,
|
||||||
|
|
|
@ -61,8 +61,8 @@ from salt.utils.versions import StrictVersion as _StrictVersion
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import boto.ec2
|
import boto.ec2
|
||||||
import boto.utils
|
|
||||||
import boto.exception
|
import boto.exception
|
||||||
|
import boto.utils
|
||||||
|
|
||||||
HAS_BOTO = True
|
HAS_BOTO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -380,8 +380,8 @@ import os
|
||||||
import salt.utils.yaml
|
import salt.utils.yaml
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from mako.lookup import TemplateLookup
|
|
||||||
from mako import exceptions
|
from mako import exceptions
|
||||||
|
from mako.lookup import TemplateLookup
|
||||||
|
|
||||||
HAS_MAKO = True
|
HAS_MAKO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -56,8 +56,8 @@ log = logging.getLogger(__name__)
|
||||||
try:
|
try:
|
||||||
# Trying to import MySQLdb
|
# Trying to import MySQLdb
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
|
import MySQLdb.cursors
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
# MySQLdb import failed, try to import PyMySQL
|
# MySQLdb import failed, try to import PyMySQL
|
||||||
|
@ -65,8 +65,8 @@ except ImportError:
|
||||||
|
|
||||||
pymysql.install_as_MySQLdb()
|
pymysql.install_as_MySQLdb()
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
import MySQLdb.cursors
|
|
||||||
import MySQLdb.converters
|
import MySQLdb.converters
|
||||||
|
import MySQLdb.cursors
|
||||||
except ImportError:
|
except ImportError:
|
||||||
MySQLdb = None
|
MySQLdb = None
|
||||||
|
|
||||||
|
|
|
@ -270,6 +270,7 @@ import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|
||||||
import salt.utils.files
|
import salt.utils.files
|
||||||
import salt.utils.yaml
|
import salt.utils.yaml
|
||||||
|
|
||||||
|
@ -597,9 +598,10 @@ if __name__ == "__main__":
|
||||||
__opts__["pepa_validate"] = True
|
__opts__["pepa_validate"] = True
|
||||||
|
|
||||||
if args.query_api:
|
if args.query_api:
|
||||||
import requests
|
|
||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
username = args.username
|
username = args.username
|
||||||
password = args.password
|
password = args.password
|
||||||
if username is None:
|
if username is None:
|
||||||
|
@ -660,8 +662,8 @@ if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
import pygments
|
import pygments
|
||||||
import pygments.lexers
|
|
||||||
import pygments.formatters
|
import pygments.formatters
|
||||||
|
import pygments.lexers
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
print(
|
print(
|
||||||
|
|
|
@ -125,6 +125,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
|
|
||||||
import salt.utils.data
|
import salt.utils.data
|
||||||
from salt.exceptions import SaltInvocationError
|
from salt.exceptions import SaltInvocationError
|
||||||
|
|
||||||
|
|
|
@ -378,10 +378,11 @@ import logging
|
||||||
import os
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
|
|
||||||
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
import salt.utils.data
|
import salt.utils.data
|
||||||
import salt.utils.jinja
|
import salt.utils.jinja
|
||||||
import salt.utils.yaml
|
import salt.utils.yaml
|
||||||
from jinja2 import Environment, FileSystemLoader
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
strategies = ("overwrite", "merge-first", "merge-last", "remove")
|
strategies = ("overwrite", "merge-first", "merge-last", "remove")
|
||||||
|
|
|
@ -149,8 +149,8 @@ import salt.utils.vmware
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# pylint: disable=no-name-in-module
|
# pylint: disable=no-name-in-module
|
||||||
from pyVmomi import vim
|
|
||||||
from pyVim.connect import Disconnect
|
from pyVim.connect import Disconnect
|
||||||
|
from pyVmomi import vim
|
||||||
|
|
||||||
HAS_LIBS = True
|
HAS_LIBS = True
|
||||||
# pylint: enable=no-name-in-module
|
# pylint: enable=no-name-in-module
|
||||||
|
|
|
@ -190,8 +190,10 @@ import salt.utils.args
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from netmiko import ConnectHandler
|
from netmiko import ConnectHandler
|
||||||
from netmiko.ssh_exception import NetMikoTimeoutException
|
from netmiko.ssh_exception import (
|
||||||
from netmiko.ssh_exception import NetMikoAuthenticationException
|
NetMikoAuthenticationException,
|
||||||
|
NetMikoTimeoutException,
|
||||||
|
)
|
||||||
|
|
||||||
HAS_NETMIKO = True
|
HAS_NETMIKO = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -69,8 +69,8 @@ import salt.utils.stringio
|
||||||
from salt.exceptions import SaltConfigurationError
|
from salt.exceptions import SaltConfigurationError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import botocore.exceptions
|
|
||||||
import boto3
|
import boto3
|
||||||
|
import botocore.exceptions
|
||||||
|
|
||||||
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
logging.getLogger("boto3").setLevel(logging.CRITICAL)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue