File: compat.py

package info (click to toggle)
pytest-salt 2019.6.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 488 kB
  • sloc: python: 6,309; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 557 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
'''
pytestsalt.utils.compat
~~~~~~~~~~~~~~~~~~~~~~~

Imports compatability layer
'''

try:
    # Salt > 2017.1.1
    # pylint: disable=invalid-name
    import salt.utils.files
    fopen = salt.utils.files.fopen
except AttributeError:
    # Salt <= 2017.1.1
    # pylint: disable=invalid-name
    fopen = salt.utils.fopen

try:
    # Salt >= 2018.3.0
    # pylint: disable=invalid-name
    from salt.utils.path import which
except ImportError:
    # Salt < 2018.3.0
    # pylint: disable=invalid-name
    from salt.utils import which