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

mount.mounted with 'mount: False' reports unmounted file system as unchanged when running with test=True #47201

Closed
tkaehn opened this issue Apr 20, 2018 · 7 comments · Fixed by #62575
Labels
Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists State-Module
Milestone

Comments

@tkaehn
Copy link

tkaehn commented Apr 20, 2018

Description of Issue/Question

mount.mounted with 'mount: False' reports unmounted file system as unchanged when running with test=True. In contrast to this no changes are made when running with test=False.

Steps to Reproduce Issue

root@master:/srv/salt# cat mount.sls 
---
/mnt/proc:
  mount.mounted:
    - device: proc
    - fstype: proc
    - mount: False
    - mkmnt: True
root@master:/srv/salt# mount|grep mnt
root@master:/srv/salt# salt-call state.apply mount --state-output=changes test=True
local:
----------
          ID: /mnt/proc
    Function: mount.mounted
      Result: None
     Comment: /mnt/proc would not be mounted. Entry already exists in the fstab.
     Started: 09:25:01.512901
    Duration: 37.503 ms
     Changes:   

Summary for local
------------
Succeeded: 1 (unchanged=1)
Failed:    0
------------
Total states run:     1
Total run time:  37.503 ms
root@master:/srv/salt# salt-call state.apply mount --state-output=changes test=False
local:
  Name: /mnt/proc - Function: mount.mounted - Result: Clean Started: - 09:25:05.841866 Duration: 36.559 ms

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:  36.559 ms

Versions Report

root@master:/srv/salt# salt --versions-report
Salt Version:
           Salt: 2018.3.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.13 (default, Nov 24 2017, 17:33:09)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1
 
System Versions:
           dist: debian 9.4 
         locale: UTF-8
        machine: x86_64
        release: 4.9.0-6-amd64
         system: Linux
        version: debian 9.4 
@tkaehn tkaehn changed the title mount.mounted with mount: False reports unmounted file system as unchanged when running with test=True mount.mounted with 'mount: False' reports unmounted file system as unchanged when running with test=True Apr 20, 2018
@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 20, 2018

i'm not able to replicate this:

local:
----------
          ID: /mnt/proc
    Function: mount.mounted
      Result: None
     Comment: /mnt/proc would be created, but not mounted. /mnt/proc needs to be written to the fstab in order to be made persistent.
     Started: 15:03:16.100883
    Duration: 261.534 ms
     Changes:   

Summary for local
------------
Succeeded: 1 (unchanged=1)
Failed:    0
------------
Total states run:     1
Total run time: 261.534 ms

can you verify its not already in your /etc/fstab and just not showing in your mount command output?

@Ch3LL Ch3LL added cannot-reproduce cannot be replicated with info/context provided info-needed waiting for more info labels Apr 20, 2018
@Ch3LL Ch3LL added this to the Blocked milestone Apr 20, 2018
@tkaehn
Copy link
Author

tkaehn commented Apr 20, 2018

@Ch3LL I've just tried again and was able to reproduce the problem. The file system isn't mounted during the procedure. As you can see below the last run of state.apply (test=True) shows pending changes (which is wrong). However running with test=False none are applied which is the expected behaviour:

root@master:/srv/salt# salt-call state.apply mount --state-output=changes test=False
local:
----------
          ID: /mnt/proc
    Function: mount.mounted
      Result: True
     Comment: /mnt/proc was created, not mounted. Added new entry to the fstab.
     Started: 18:13:23.474193
    Duration: 29.675 ms
     Changes:   
              ----------
              persist:
                  new

Summary for local
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1
Total run time:  29.675 ms
root@master:/srv/salt# salt-call state.apply mount --state-output=changes test=False
local:
  Name: /mnt/proc - Function: mount.mounted - Result: Clean Started: - 18:13:28.596075 Duration: 24.125 ms

Summary for local
------------
Succeeded: 1
Failed:    0
------------
Total states run:     1
Total run time:  24.125 ms
root@master:/srv/salt# salt-call state.apply mount --state-output=changes test=True
local:
----------
          ID: /mnt/proc
    Function: mount.mounted
      Result: None
     Comment: /mnt/proc would not be mounted. Entry already exists in the fstab.
     Started: 18:13:32.716358
    Duration: 24.027 ms
     Changes:   

Summary for local
------------
Succeeded: 1 (unchanged=1)
Failed:    0
------------
Total states run:     1
Total run time:  24.027 ms

@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 23, 2018

okay did not realize you were running the state before test=True, apologies. In your first example you ran test=True so thats what i did in my use case. I'm now able to replicate the issue. Seems we can make improvements here to make sure we show that there will be no changes when run with test=True.

@Ch3LL Ch3LL added State-Module Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists and removed cannot-reproduce cannot be replicated with info/context provided info-needed waiting for more info labels Apr 23, 2018
@Ch3LL Ch3LL modified the milestones: Blocked, Approved Apr 23, 2018
@tkaehn
Copy link
Author

tkaehn commented Feb 26, 2019

Problem still exists in 2019.2.0

@stale
Copy link

stale bot commented Jan 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 9, 2020
@stale stale bot closed this as completed Jan 16, 2020
@pruiz
Copy link
Contributor

pruiz commented Feb 15, 2020

This is still an issue, please keep open.

@Ch3LL Ch3LL reopened this Feb 20, 2020
@stale
Copy link

stale bot commented Feb 20, 2020

Thank you for updating this issue. It is no longer marked as stale.

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 severity-low 4th level, cosemtic problems, work around exists State-Module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants