Skip to content

[BUG] ini_manage always updates file even if there are no changes #65191

@jcpearson

Description

@jcpearson

Description
When using ini.options_present in a state, the ini file always gets updated even if there have been no changes

Setup
Using something like:

/tmp/test.ini:
  ini.options_present:
    - sections:
        A:
          a: 1
        B:
          b: 2
        C:
          c: 3
        D:
          d: 4

Steps to Reproduce the behavior
Every time the state is applied, the timestamp of /tmp/test.ini is always updated - even if the state hasn't changed

Expected behavior
/tmp/test.ini to remain untouched if no changes have been made to the state

Versions Report

Salt Version:
          Salt: 3006.3
 
Python Version:
        Python: 3.10.13 (main, Sep  6 2023, 02:11:27) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.13.10
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: centos 7.9.2009 Core
        locale: utf-8
       machine: x86_64
       release: 3.10.0-1160.81.1.el7.x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    State-Modulebugbroken, incorrect, or confusing behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions