saltstack / saltstack/salt

[BUG] states.rabbitmq_policy.present - specifying apply_to shows change on every highstate

Open
#61,925 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
Specifying apply_to parameter in states.rabbitmq_policy.present causes highstate to show change on every highstate.
Removing apply_to argument resolves the issue.

----------
          ID: rabbitmq-policy-test
    Function: rabbitmq_policy.present
        Name: test-policy
      Result: True
     Comment: Setting policy "test-policy" for pattern "TestQueue" to "{"max-length": 1000000}" with priority "0" for vhost "/" ...
     Started: 17:40:24.181276
    Duration: 1311.595 ms
     Changes:
              ----------
              new:
                  - Applyto
              old:
                  ----------
                  apply_to:
                      all
                  definition:
                      {"max-length":1000000}
                  pattern:
                      TestQueue
                  priority:
                      0

Setup

rabbitmq-policy-test:
  rabbitmq_policy.present:
    - name: test-policy
    - pattern: TestQueue
    - definition: '{"max-length": 1000000}'
    - priority: 0
    - vhost: '/'
    - apply_to: 'all'

Expected behavior
Apply the RabbitMq policy on the first highstate and then do nothing as long as the policy remains unchanged.

Versions Report
RabbitMQ server version 3.8.14-1

Salt master:

Salt Version:
          Salt: 3004.1

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.5.3
     docker-py: Not Installed
         gitdb: 2.0.0
     gitpython: 2.1.1
        Jinja2: 2.9.4
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.6.1
        pygit2: Not Installed
        Python: 3.5.3 (default, Nov  4 2021, 15:29:10)
  python-gnupg: Not Installed
        PyYAML: 3.12
         PyZMQ: 17.1.2
         smmap: 2.0.1
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.2.1

System Versions:
          dist: debian 9 stretch
        locale: UTF-8
       machine: x86_64
       release: 4.9.0-18-amd64
        system: Linux
       version: Debian GNU/Linux 9 stretch

Salt minion:

Salt Version:
          Salt: 3004.1

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.5.3
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.9.4
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.6.1
        pygit2: Not Installed
        Python: 3.5.3 (default, Nov  4 2021, 15:29:10)
  python-gnupg: Not Installed
        PyYAML: 3.12
         PyZMQ: 17.1.2
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.2.1

System Versions:
          dist: debian 9 stretch
        locale: UTF-8
       machine: x86_64
       release: 4.9.0-14-amd64
        system: Linux
       version: Debian GNU/Linux 9 stretch

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 at the states.rabbitmq_policy.present entry point and reproduce the issue with the provided YAML, RabbitMQ policy, and apply_to: all setting. Trace how the existing policy is compared on successive highstates. Done means the first highstate applies the policy, while later highstates report no changes when it remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.