saltstack / saltstack/salt

[BUG] softwareupdate.ignore execution module fails to ignore update that is ignorable

Open
#60,376 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug MacOS severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
Running the Mac softwareupdate.ignore execution module with does not succeed in marking an update as ignored. The Intel Mac in questions is running 10.15.7 (latest build) and the update in question is 'macOS Big Sur'. Conversely, running the normal softwareupdate --ignore 'macOS Big Sur' command does work. This is running masterless.

Setup
mac_softwareupdate.py

Steps to Reproduce the behavior
On Intel Mac running latest build of 10.15.7:

  1. Run salt-call softwareupdate.ignore name='macOS Big Sur'
  2. Note that fails to ignore update / upgrade.
  3. Run softwareupdate --ignore 'macOS Big Sur' manually.
  4. Note successful run of command (salt-call softwareupdate.list_ignored)

Expected behavior
Execution module works just like entering the command on the CLI

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
salt --versions-report
Salt Version:
          Salt: 3003
 
Dependency Versions:
          cffi: 1.12.2
      cherrypy: unknown
      dateutil: 2.8.0
     docker-py: Not Installed
         gitdb: 4.0.5
     gitpython: 3.1.12
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: 1.0.7
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.19
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
        Python: 3.7.4 (default, Apr 14 2021, 11:47:56)
  python-gnupg: 0.4.4
        PyYAML: 5.3.1
         PyZMQ: 18.0.1
         smmap: 3.0.2
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.1
 
System Versions:
          dist: darwin 19.6.0 
        locale: utf-8
       machine: x86_64
       release: 19.6.0
        system: Darwin
       version: 10.15.7 x86_64

Additional context
CLI output:

salt-call -l debug softwareupdate.ignore name='macOS Big Sur'
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/minion.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/minion.conf
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: XXXXXXX
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Override  __grains__: <module 'salt.loaded.int.log_handlers.sentry_mod' from '/opt/salt/lib/python3.7/site-packages/salt-3003-py3.7.egg/salt/log/handlers/sentry_mod.py'>
[DEBUG   ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG   ] Grains refresh requested. Refreshing grains.
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/minion.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/minion.conf
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Override  __utils__: <module 'salt.loaded.int.grains.zfs' from '/opt/salt/lib/python3.7/site-packages/salt-3003-py3.7.egg/salt/grains/zfs.py'>
[DEBUG   ] Failed to read /proc/cmdline: [Errno 2] No such file or directory: '/proc/cmdline'
[DEBUG   ] Loading static grains from /etc/salt/grains
[DEBUG   ] LazyLoaded zfs.is_supported
[DEBUG   ] Determining pillar cache
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] LazyLoaded softwareupdate.ignore
[DEBUG   ] LazyLoaded direct_call.execute
[DEBUG   ] Execute return success ['softwareupdate', '--ignore', 'macOS Big Sur']: {'pid': 62034, 'retcode': 0, 'stdout': 'Ignored updates:\n(\n)\n\nSoftware Update can only ignore updates that are eligible for installation.\nIf the label provided to ignore is not in the above list, it is not eligible\nto be ignored.\n\nIgnoring software updates is deprecated.\nThe ability to ignore individual updates will be removed in a future release of macOS.', 'stderr': ''}
[DEBUG   ] Using pkg_resources to load entry points
[DEBUG   ] LazyLoaded nested.output
local:
    False
salt-call softwareupdate.list_ignored
local:
softwareupdate --ignore 'macOS Big Sur'
Ignored updates:
(
    "macOS Big Sur"
)

Software Update can only ignore updates that are eligible for installation.
If the label provided to ignore is not in the above list, it is not eligible
to be ignored.

Ignoring software updates is deprecated.
The ability to ignore individual updates will be removed in a future release of macOS.
salt-call softwareupdate.list_ignored
local:
    - macOS Big Sur

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mac_softwareupdate.py and trace the softwareupdate.ignore execution module for the command shown in the reproduction. Compare its result with the manual softwareupdate --ignore invocation and verify the fix by checking that softwareupdate.list_ignored reports macOS Big Sur.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.