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

[BUG] AttributeError: 'Process' object has no attribute '_args_for_getstate' #57742

Closed
shish opened this issue Jun 21, 2020 · 31 comments · Fixed by #57028
Closed

[BUG] AttributeError: 'Process' object has no attribute '_args_for_getstate' #57742

shish opened this issue Jun 21, 2020 · 31 comments · Fixed by #57028
Assignees
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt has-failing-test MacOS pertains to the OS of fruit Regression The issue is a bug that breaks functionality known to work in previous releases. severity-critical top severity, seen by most users, serious issues

Comments

@shish
Copy link
Contributor

shish commented Jun 21, 2020

Description
salt-ssh crashes with an exception before doing seemingly anything

Setup
Just upgraded to salt 3001, 3000 was working fine

Steps to Reproduce the behavior
salt-ssh $host state.highstate test=True

AttributeError: 'Process' object has no attribute '_args_for_getstate'
Traceback (most recent call last):
  File "/usr/local/bin/salt-ssh", line 33, in <module>
    sys.exit(load_entry_point('salt==3001', 'console_scripts', 'salt-ssh')())
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/scripts.py", line 499, in salt_ssh
    client.run()
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/cli/ssh.py", line 26, in run
    ssh.run()
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/client/ssh/__init__.py", line 787, in run
    for ret in self.handle_ssh():
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/client/ssh/__init__.py", line 604, in handle_ssh
    routine.start()
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
    return Popen(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/utils/process.py", line 755, in __getstate__
    args = self._args_for_getstate
AttributeError: 'Process' object has no attribute '_args_for_getstate'

Expected behavior
Salt executes on the host

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
           Salt: 3001

Dependency Versions:
           cffi: 1.12.2
       cherrypy: unknown
       dateutil: 2.8.0
      docker-py: Not Installed
          gitdb: 2.0.6
      gitpython: 2.1.15
         Jinja2: 2.10.1
        libgit2: 1.0.1
       M2Crypto: 0.35.2
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: Not Installed
   pycryptodome: 3.9.7
         pygit2: 1.2.1
         Python: 3.8.3 (default, May 27 2020, 20:54:22)
   python-gnupg: 0.4.4
         PyYAML: 5.1.2
          PyZMQ: 19.0.0
          smmap: 3.0.4
        timelib: 0.2.4
        Tornado: 4.5.3
            ZMQ: 4.3.2

System Versions:
           dist: darwin 19.5.0
         locale: utf-8
        machine: x86_64
        release: 19.5.0
         system: Darwin
        version: 10.15.5 x86_64
@shish shish added the Bug broken, incorrect, or confusing behavior label Jun 21, 2020
@krionbsd krionbsd added this to the Follow up milestone Jun 22, 2020
@krionbsd
Copy link
Contributor

@saltstack/team-core someone with MacOS Kung-Fu skills might take a look into this one

@cdalvaro
Copy link
Contributor

cdalvaro commented Jun 23, 2020

Same for 'SignalHandlingProcess':

[salt.minion      :505 ][ERROR   ][308] Exception 'SignalHandlingProcess' object has no attribute '_args_for_getstate' occurred in scheduled job
[tornado.application:353 ][ERROR   ][308] Future <salt.ext.tornado.concurrent.Future object at 0x108ebf5b0> exception was never retrieved: Traceback (most recent call last):
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/ext/tornado/gen.py", line 309, in wrapper
    yielded = next(result)
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/minion.py", line 1719, in _handle_decoded_payload
    process.start()
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/utils/process.py", line 867, in start
    super(SignalHandlingProcess, self).start()
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
    return Popen(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/utils/process.py", line 755, in __getstate__
    args = self._args_for_getstate
AttributeError: 'SignalHandlingProcess' object has no attribute '_args_for_getstate'

Update: _args_for_getstate is only defined for Windows platforms:

salt/salt/utils/process.py

Lines 705 to 714 in 8a23ec9

class Process(multiprocessing.Process, NewStyleClassMixIn):
def __init__(self, *args, **kwargs):
log_queue = kwargs.pop("log_queue", None)
log_queue_level = kwargs.pop("log_queue_level", None)
super(Process, self).__init__(*args, **kwargs)
if salt.utils.platform.is_windows():
# On Windows, subclasses should call super if they define
# __setstate__ and/or __getstate__
self._args_for_getstate = copy.copy(args)
self._kwargs_for_getstate = copy.copy(kwargs)

So method __getstate__, should not been called from different architectures:

salt/salt/utils/process.py

Lines 745 to 766 in 8a23ec9

# __setstate__ and __getstate__ are only used on Windows.
def __setstate__(self, state):
args = state["args"]
kwargs = state["kwargs"]
# This will invoke __init__ of the most derived class.
self.__init__(*args, **kwargs)
self._after_fork_methods = self._after_fork_methods
self._finalize_methods = self._finalize_methods
def __getstate__(self):
args = self._args_for_getstate
kwargs = self._kwargs_for_getstate
if "log_queue" not in kwargs:
kwargs["log_queue"] = self.log_queue
if "log_queue_level" not in kwargs:
kwargs["log_queue_level"] = self.log_queue_level
return {
"args": args,
"kwargs": kwargs,
"_after_fork_methods": self._after_fork_methods,
"_finalize_methods": self._finalize_methods,
}

Update 2: This part of the code has been untouched for more than 5 years, so the issue could be related with having changed from Python 3.7 to 3.8 on macOS with salt 3001 update Homebrew/homebrew-core#56461

@nlgordon
Copy link

I ran into this just running a test.ping against a mac minion. Getting my dev environment setup and going to take a swing at digging into this as time allows.

@cdalvaro
Copy link
Contributor

cdalvaro commented Jun 23, 2020

This is a temporary solution until the bug is fixed.

Edit the Homebrew salt formula (brew edit salt) to apply the following patch:

diff --git a/Formula/salt.rb b/Formula/salt.rb
index d4a87977f..196e27648 100644
--- a/Formula/salt.rb
+++ b/Formula/salt.rb
@@ -17,7 +17,7 @@ class Salt < Formula
   depends_on "libgit2"
   depends_on "libyaml"
   depends_on "[email protected]"
-  depends_on "[email protected]"
+  depends_on "python"
   depends_on "zeromq"

   on_linux do
@@ -61,7 +61,7 @@ class Salt < Formula
     # https://github.com/Homebrew/homebrew-core/pull/52835#issuecomment-617502578
     File.write(buildpath/"pkg/osx/req_pyobjc.txt", "")

-    venv = virtualenv_create(libexec, Formula["[email protected]"].bin/"python3.8")
+    venv = virtualenv_create(libexec, "python3")
     venv.pip_install resources

     system libexec/"bin/pip", "install", "-v", "--ignore-installed", buildpath

then:

brew uninstall salt
sudo rm -rf /usr/local/Cellar/salt/3001
brew install --build-from-source salt

May be we could create a PR at homebrew-core to apply this patch to the formula until the next Salt released is ready with the bug fixed.

@DmitryKuzmenko DmitryKuzmenko added Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt MacOS pertains to the OS of fruit severity-critical top severity, seen by most users, serious issues labels Jun 25, 2020
@sagetherage
Copy link
Contributor

@weswhet

@sagetherage sagetherage added the v3001.1 vulnerable version label Jun 25, 2020
@sagetherage sagetherage modified the milestones: Follow up, Approved Jun 25, 2020
@sagetherage sagetherage added the Regression The issue is a bug that breaks functionality known to work in previous releases. label Jun 25, 2020
@cdalvaro
Copy link
Contributor

cdalvaro commented Jun 25, 2020

I have tried adding this changes to salt/utils/process.py:

diff --git a/salt/utils/process.py b/salt/utils/process.py
index 2ac797b5f3..34e22b84cc 100644
--- a/salt/utils/process.py
+++ b/salt/utils/process.py
@@ -744,6 +744,9 @@ class Process(multiprocessing.Process, NewStyleClassMixIn):

     # __setstate__ and __getstate__ are only used on Windows.
     def __setstate__(self, state):
+        if not salt.utils.platform.is_windows():
+            self.__dict__.update(state)
+            return
         args = state["args"]
         kwargs = state["kwargs"]
         # This will invoke __init__ of the most derived class.
@@ -752,6 +755,8 @@ class Process(multiprocessing.Process, NewStyleClassMixIn):
         self._finalize_methods = self._finalize_methods

     def __getstate__(self):
+        if not salt.utils.platform.is_windows():
+            return self.__dict__
         args = self._args_for_getstate
         kwargs = self._kwargs_for_getstate
         if "log_queue" not in kwargs:

but then, the following error is reported:

[tornado.application:353 ][ERROR   ][1761] Future <salt.ext.tornado.concurrent.Future object at 0x1116c9550> exception was never retrieved: Traceback (most recent call last):
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/ext/tornado/gen.py", line 309, in wrapper
    yielded = next(result)
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/minion.py", line 1719, in _handle_decoded_payload
    process.start()
  File "/usr/local/Cellar/salt/3001/libexec/lib/python3.8/site-packages/salt/utils/process.py", line 872, in start
    super(SignalHandlingProcess, self).start()
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
    return Popen(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'Minion.setup_beacons.<locals>.handle_beacons'
[salt.minion      :505 ][ERROR   ][1761] Exception cannot pickle '_thread._local' object occurred in scheduled job

It looks this is the origin of the issue: https://docs.python.org/3/library/multiprocessing.html

Changed in version 3.8: On macOS, the spawn start method is now the default. The fork start method should be considered unsafe as it can lead to crashes of the subprocess. See bpo-33725.

Update

Similar issue solved here: horovod/horovod#1904

@weswhet
Copy link
Contributor

weswhet commented Jun 25, 2020

Gonna need to put up the @s0undt3ch bat signal on this one. He’s already working on it here #57028

@weswhet
Copy link
Contributor

weswhet commented Jun 25, 2020

Turning multiprocessing off in the minion config may patch this as well. If homebrew is going to be py3.8

@s0undt3ch
Copy link
Collaborator

This is a known issue being worked on in #57028 for magnesium

@sagetherage
Copy link
Contributor

I will look at the PR and see if I can help in the test suite at all and look at if we can bring this into the point release.

@sagetherage sagetherage added Magnesium Mg release after Na prior to Al and removed v3001.1 vulnerable version labels Jul 8, 2020
@h0jeZvgoxFepBQ2C
Copy link

This is really a blocker somehow, using @cdalvaro 's solution worked fine on one laptop.. but not on the other.. Dunno why :(

@cdalvaro
Copy link
Contributor

cdalvaro commented Jul 14, 2020

It is not working anymore because python formula has been upgraded from 3.7 to 3.8 ...

brew info python
[email protected]: stable 3.8.3 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/[email protected]/3.8.3_2 (4,229 files, 64.6MB)
  Poured from bottle on 2020-07-14 at 14:43:45
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]
==> Dependencies
Build: pkg-config ✔
Required: gdbm ✔, [email protected] ✔, readline ✔, sqlite ✔, xz ✔
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/[email protected]/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.8/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 463,840 (30 days), 1,253,709 (90 days), 1,905,378 (365 days)
install-on-request: 48,437 (30 days), 71,239 (90 days), 96,550 (365 days)
build-error: 0 (30 days)

We need to fix the code for making it to work with python 3.8

Applying the following patch to your salt formula (brew edit salt) and install it building from source will allow you to run salt-minion again.

diff --git a/Formula/salt.rb b/Formula/salt.rb
index d4a87977f..196e27648 100644
--- a/Formula/salt.rb
+++ b/Formula/salt.rb
@@ -17,7 +17,7 @@ class Salt < Formula
   depends_on "libgit2"
   depends_on "libyaml"
   depends_on "[email protected]"
-  depends_on "[email protected]"
+  depends_on "[email protected]"
   depends_on "zeromq"

   on_linux do
@@ -61,7 +61,7 @@ class Salt < Formula
     # https://github.com/Homebrew/homebrew-core/pull/52835#issuecomment-617502578
     File.write(buildpath/"pkg/osx/req_pyobjc.txt", "")

-    venv = virtualenv_create(libexec, Formula["[email protected]"].bin/"python3.8")
+    venv = virtualenv_create(libexec, Formula["[email protected]"].bin/"python3.7")
     venv.pip_install resources

     system libexec/"bin/pip", "install", "-v", "--ignore-installed", buildpath
brew install --build-from-source salt

Undo your formula changes after installing it to allow future updates for the salt formula.

@h0jeZvgoxFepBQ2C
Copy link

Do you have a workaround again maybe?

@sagetherage
Copy link
Contributor

Looks like the PR was re-labeled as Silicon so I am matching it here. I see a change was requested so I will see if I can find out more details.

@prandelicious
Copy link

I'm getting the same error on Big Sur. Homebrew installs python 3.9.5 and the salt version is 3003.1

@nergdron
Copy link

nergdron commented Jul 13, 2021

yeah, just discovered this trying to help some coworkers with salt on their Macs. this is a big blocker for us, is there any update on getting it fixed?

@s0undt3ch
Copy link
Collaborator

I don't have much time available at the moment.
If you can, and want, to help, checkout the code from #57028
And try running the testsuite. It will fail, which means there are still places in Salt's code where we need fixes to support macOS python where spawning is now the default multiprocessing method.

@s0undt3ch
Copy link
Collaborator

I'll try to at least rebase the PR against the latest master in the next couple of days...

@sagetherage sagetherage modified the milestones: Silicon, Phosphorus Aug 19, 2021
@sagetherage sagetherage removed the Silicon v3004.0 Release code name label Aug 19, 2021
s0undt3ch added a commit to s0undt3ch/salt that referenced this issue May 5, 2022
garethgreenaway pushed a commit that referenced this issue May 20, 2022
Fixes #57742

Signed-off-by: Pedro Algarvio <[email protected]>
garethgreenaway pushed a commit to garethgreenaway/salt that referenced this issue May 23, 2022
Ch3LL pushed a commit that referenced this issue May 26, 2022
* Making the retry state system feature available when parallel is set to True.

* swapping out using time.sleep Salt function for Python time.sleep.

* Skipping parallel tests on Windows.

* Fixing items, values, and keys functions in the data module.  Moving integration to functional tests.  Converting unit test over to pytest.

* adding changleog.

* fixes #62044 add ignore_missing to file.comment state

* fixes #61662 fix file.comment reports changes in test mode

* add 61662.fixed changelog

* add final test mode run after comment is successful

* fix uncomment_regex

* fix uncomment_regex

* Try not to trigger the GLIBC race condition.

See https://sourceware.org/bugzilla/show_bug.cgi?id=19329

Fixes #62071

Signed-off-by: Pedro Algarvio <[email protected]>

* Add missing CLI example to ``network.fqdns``

Signed-off-by: Pedro Algarvio <[email protected]>

* Sleep between submitting new jobs to thread pool

Signed-off-by: Pedro Algarvio <[email protected]>

* Sleep before trying to resolve instead

Signed-off-by: Pedro Algarvio <[email protected]>

* Shorter sleeps

* fixes #61944 fixed backslash literal bytestring

* When states are running in parallel, ensure that the total run time produced by the highstate outputter takes that into account.

* removing unrelated change

* Adding changelog.

* Skip parallel test on Windows.

* skip pdbedit unit tests on ubuntu 2204 because md4 is not supported as a hash type

* refresh db at the beginning for destructive aptpkg functional tests

* fix failing test_pkgrepo_managed_absent and actually capture and keep signed-by information in salt/modules/aptpkg.py custom implementation of apt repository management

* Update tests/unit/modules/test_pdbedit.py

Co-authored-by: Pedro Algarvio <[email protected]>

* Disable hack to force allowing forking on macOS

* Use the newer nox platforms file which installs Py3.9

Signed-off-by: Pedro Algarvio <[email protected]>

* Support macOS defaulting to spawn as the default multiprocessing method

* Remove unused attribute

* Switch to ``salt.utils.platform.spawning_platform()``

Signed-off-by: Pedro Algarvio <[email protected]>

* Reconstruct client instances on spawning platforms

* Also skip this test for now on macOS

Signed-off-by: Pedro Algarvio <[email protected]>

* Reconstruct the ``State`` class on spawned processes.

Signed-off-by: Pedro Algarvio <[email protected]>

* Force a reference to ``salt.ext.tornado.iostream.StreamClosedError`` to avoid ``NameError`` issues

Signed-off-by: Pedro Algarvio <[email protected]>

* Skip, for now, problematic tests on spawning platforms

Signed-off-by: Pedro Algarvio <[email protected]>

* DeltaProxy minions do not work on spawning platforms

Signed-off-by: Pedro Algarvio <[email protected]>

* Avoid a ``NameError`` when failing to initialize the process list

Signed-off-by: Pedro Algarvio <[email protected]>

* Use Python 3.9 on macOS

Signed-off-by: Pedro Algarvio <[email protected]>

* Drop requirements on Darwin for Py<3.9

Signed-off-by: Pedro Algarvio <[email protected]>

* Same test run timeout as windows

Signed-off-by: Pedro Algarvio <[email protected]>

* Don't shell out! Access the database directly and properly escape values.

Signed-off-by: Pedro Algarvio <[email protected]>

* Fixes for the new macOS Catalina and BigSur CICD images

Signed-off-by: Pedro Algarvio <[email protected]>

* Migrate ``integration.modules.test_mac_pkgutil`` to PyTest and functional tests.

Fixes #60819

Signed-off-by: Pedro Algarvio <[email protected]>

* Add changelog for #57742

Fixes #57742

Signed-off-by: Pedro Algarvio <[email protected]>

* Add changelog entry.

Fixes #55847

Signed-off-by: Pedro Algarvio <[email protected]>

* initial Proxy Module

* inital pass of restconf states

* adding codeauthor

* adding restconf module

* doc update

* doc update

* doc update

* add requirements chefk to states module

* doc update

* doc update

* doc update

* add changelog entry

* Update salt/proxy/restconf.py

Co-authored-by: Wayne Werner <[email protected]>

* Update salt/proxy/restconf.py

Co-authored-by: Wayne Werner <[email protected]>

* remove noqa statements

* docs update & opts defaults

* docs update

* error checks + https transport method

* docs update

* docs update

* doing a fix for commit check

* adding test and updating modules

* removing old code

* DRY

* docs update

* output updates

* prepping for deepdiff switch

* states testing

* more tests

* changed changelog from fixed to added

* force pre-commit checks

* new style of diff output that is readable

* updating tests and output

* updating output style to make YAML diff more readable

* add test for restconf module

* adjusting based on pr review

* adjusting based on pr review

* adjusting true/false verify based on pr review

* change uri to path and clean args list

Co-authored-by: Wayne Werner <[email protected]>

* adjusting uri to path based on pr review

* adjusting capabilities path based on pr review

* Update salt/modules/restconf.py

Co-authored-by: Wayne Werner <[email protected]>

* adjusting val based on pr review

* caps to confirm to RFC 8040

* WIP: refactor based on feedback

* WIP: changed results to be any kind of falsey val

* linting - pre-commit

* updating docs

* Update salt/states/restconf.py

Co-authored-by: Wayne Werner <[email protected]>

* updating style

* fixes for lint and nox pass

* fixing

* blacken

* Update restconf.py

* add cli examples

* change logging type

* add pytest skip for ordereddict issue with legacy python

* add sys library for pytest mark skipif check

* pre-commit fixes

* Update salt/proxy/restconf.py

Co-authored-by: Pedro Algarvio <[email protected]>

* Update salt/states/restconf.py

Co-authored-by: Pedro Algarvio <[email protected]>

* Update tests/pytests/unit/modules/test_restconf.py

Co-authored-by: Pedro Algarvio <[email protected]>

* Update tests/pytests/unit/states/test_restconf.py

Co-authored-by: Pedro Algarvio <[email protected]>

* Update tests/pytests/unit/proxy/test_restconf.py

Co-authored-by: Pedro Algarvio <[email protected]>

* pre-commit fix

* update logging

* Update restconf.py

* some rest apis dont follow the standard correctly (cisco) and need another header

* fixes #61946 sync_after_install immutabledict error

* add configurable sync sleep for create

* add testing around the particular sync command called

* Adds the ability to get file version information on Windows

- Adds file.version that will get just the version
- Adds file.version_details to get additional information
- Adds tests
- Adds changelog

@amalaguti originally submitted a PR for this: #59770, but he has
since deleted his branch. Recognizing his contribution here.

* Update states.chef for version 16.x and 17.x Chef Infra Client output

* Support previous Chef version plus version 16.x and 17.x output.

* Remove legacy chef unit test

* Add unit tests for chef state

These tests cover the entire state, but are only concerned with the
ret["result"] of the outputs. It would be a good idea to test other
outputs as well - these tests could be modified to include assertions
about the other parts of ret. (Obviously they would need to be slightly
renamed. Maybe to `..._return_expected_ret`

* Update salt-bootstrap to 2022.03.15 release

* Update state.py

Fixing lint.

* Running pre-commit manually.

* swap out salt.utils.platform.is_windows for salt.utils.platform.spawning_platform.  Bump up duration for test_retry_option_success_parallel to 30 seconds to account for test running on Mac OS.

Co-authored-by: Megan Wilhite <[email protected]>
Co-authored-by: nicholasmhughes <[email protected]>
Co-authored-by: Pedro Algarvio <[email protected]>
Co-authored-by: emmadionne1 <[email protected]>
Co-authored-by: MKLeb <[email protected]>
Co-authored-by: Caleb Beard <[email protected]>
Co-authored-by: Pedro Algarvio <[email protected]>
Co-authored-by: Jamie Murphy <[email protected]>
Co-authored-by: Jamie (Bear) Murphy <[email protected]>
Co-authored-by: Jamie Murphy <[email protected]>
Co-authored-by: Wayne Werner <[email protected]>
Co-authored-by: Cassandra Durnford <[email protected]>
Co-authored-by: Jamie Murphy <[email protected]>
Co-authored-by: Jamie (Bear) Murphy <[email protected]>
Co-authored-by: Twangboy <[email protected]>
Co-authored-by: Eric Ham <[email protected]>
Co-authored-by: Wayne Werner <[email protected]>
Co-authored-by: krionbsd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt has-failing-test MacOS pertains to the OS of fruit Regression The issue is a bug that breaks functionality known to work in previous releases. severity-critical top severity, seen by most users, serious issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.