Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix puppet.py for non-aio installs #62323

Merged
merged 5 commits into from
Sep 22, 2022
Merged

Conversation

llua
Copy link
Contributor

@llua llua commented Jul 12, 2022

What does this PR do?

What issues does this PR fix or reference?

Fixes: the puppet module for non-aio packages (eg: puppet on freebsd)

Previous Behavior

placeholder # salt placeholder puppet.summary
salt placeholder puppet.disable
placeholder:
    ERROR: Unable to read puppet run summary: [Errno 2] No such file or directory: '/opt/puppetlabs/puppet/cache/state/last_run_summary.yaml'
ERROR: Minions returned with non-zero exit code
placeholder:
    The minion function caused an exception: Traceback (most recent call last):
      File "/usr/local/lib/python3.8/site-packages/salt/minion.py", line 1912, in _thread_return
        return_data = minion_instance._execute_job_function(
      File "/usr/local/lib/python3.8/site-packages/salt/minion.py", line 1869, in _execute_job_function
        return_data = self.executors[fname](opts, data, func, args, kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 149, in __call__
        return self.loader.run(run_func, *args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 1201, in run
        return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 1216, in _run_as
        return _func_or_method(*args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/executors/direct_call.py", line 10, in execute
        return func(*args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 149, in __call__
        return self.loader.run(run_func, *args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 1201, in run
        return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/loader/lazy.py", line 1216, in _run_as
        return _func_or_method(*args, **kwargs)
      File "/usr/local/lib/python3.8/site-packages/salt/modules/puppet.py", line 243, in disable
        with salt.utils.files.fopen(puppet.disabled_lockfile, "w") as lockfile:
      File "/usr/local/lib/python3.8/site-packages/salt/utils/files.py", line 385, in fopen
        f_handle = open(*args, **kwargs)  # pylint: disable=resource-leakage
    FileNotFoundError: [Errno 2] No such file or directory: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
ERROR: Minions returned with non-zero exit code

New Behavior

placeholder # salt placeholder puppet.summary
salt placeholder puppet.disable
placeholder:
    ----------
    last_run:
        2022-07-12T13:29:51
    resources:
        ----------
        changed:
            0
        corrective_change:
            0
        failed:
            2
        failed_to_restart:
            0
        out_of_sync:
            1
        restarted:
            0
        scheduled:
            0
        skipped:
            1
        total:
            10
    time:
        ----------
        config_retrieval:
            0.31903874
        total:
            0.072512287
placeholder:
    True

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Sorry, something went wrong.

@llua llua requested a review from a team as a code owner July 12, 2022 17:47
@llua llua requested review from garethgreenaway and removed request for a team July 12, 2022 17:47

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Fixing lint issues.
@garethgreenaway garethgreenaway added Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases has-failing-test labels Sep 2, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@llua
Copy link
Contributor Author

llua commented Sep 22, 2022

i am reasonably sure this patch works on unix like systems, but unsure if path puppet returns on windows have a single \ or two \\ like it previously did. so it may be a breaking change in that way.

Verified

This commit was signed with the committer’s verified signature.
garethgreenaway Gareth J. Greenaway

Verified

This commit was signed with the committer’s verified signature.
garethgreenaway Gareth J. Greenaway
@garethgreenaway garethgreenaway removed the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Sep 22, 2022
@Ch3LL Ch3LL added the Sulfur v3006.0 release code name and version label Sep 22, 2022
@garethgreenaway garethgreenaway merged commit 4276809 into saltstack:master Sep 22, 2022
@llua llua deleted the puppet_conf branch July 27, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sulfur v3006.0 release code name and version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants