mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Move _pkg.txt into salt directory
This commit is contained in:
parent
86a8ddc6a5
commit
a6ff8d0c23
6 changed files with 9 additions and 5 deletions
|
@ -46,5 +46,5 @@ def test_grains_package_onedir(salt_cli, salt_minion):
|
|||
Test that the package grain returns onedir
|
||||
"""
|
||||
ret = salt_cli.run("grains.get", "package", minion_tgt=salt_minion.id)
|
||||
assert "onedir" == ret.data
|
||||
assert ret.data == "onedir"
|
||||
assert ret.data, ret
|
||||
|
|
|
@ -18,7 +18,7 @@ def pkg_type():
|
|||
"""
|
||||
Utility to find out how Salt was installed.
|
||||
"""
|
||||
pkg_file = pathlib.Path(__file__).parent.parent.parent / "_pkg.txt"
|
||||
pkg_file = pathlib.Path(__file__).parent.parent / "_pkg.txt"
|
||||
if pkg_file.is_file():
|
||||
with salt.utils.files.fopen(pkg_file) as _fp:
|
||||
content = _fp.read()
|
||||
|
|
|
@ -4,7 +4,7 @@ import pytest
|
|||
|
||||
|
||||
@pytest.fixture(scope="package", autouse=True)
|
||||
def onedir_env():
|
||||
def _onedir_env():
|
||||
"""
|
||||
Functional tests cannot currently test the
|
||||
onedir artifact. This will need to be removed
|
||||
|
@ -18,6 +18,8 @@ def onedir_env():
|
|||
yield
|
||||
finally:
|
||||
os.environ["ONEDIR_TESTRUN"] = "1"
|
||||
else:
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
|
|
|
@ -6,7 +6,7 @@ import salt.config
|
|||
|
||||
|
||||
@pytest.fixture(scope="package", autouse=True)
|
||||
def onedir_env():
|
||||
def _onedir_env():
|
||||
"""
|
||||
Unit tests cannot currently test the
|
||||
onedir artifact. This will need to be removed
|
||||
|
@ -18,6 +18,8 @@ def onedir_env():
|
|||
yield
|
||||
finally:
|
||||
os.environ["ONEDIR_TESTRUN"] = "1"
|
||||
else:
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
@ -749,7 +749,7 @@ def salt_onedir(
|
|||
shutil.copyfile(src, dst)
|
||||
|
||||
# Add package type file for package grain
|
||||
with open(pathlib.Path(site_packages) / "_pkg.txt", "w") as fp:
|
||||
with open(pathlib.Path(site_packages) / "salt" / "_pkg.txt", "w") as fp:
|
||||
fp.write("onedir")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue