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

fix for nfs mounts in _active_mounts_openbsd() #29883

Merged
merged 2 commits into from Dec 21, 2015

Conversation

Projects
None yet
2 participants
@serge-p
Contributor

serge-p commented Dec 21, 2015

attempting to run following state

/backup:
mount.mounted:
- device: joule:/backup
- fstype: nfs
- mkmnt: True
- opts: rw,nodev,nosuid

getting unexpected behavior:

        ID: /backup
    Function: mount.mounted
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/local/lib/python2.7/site-packages/salt/state.py", line 1591, in call
                  **cdata['kwargs'])
                File "/usr/local/lib/python2.7/site-packages/salt/states/mount.py", line 120, in mounted
                  active = __salt__['mount.active'](extended=True)
                File "/usr/local/lib/python2.7/site-packages/salt/modules/mount.py", line 184, in active
                  _active_mounts_openbsd(ret)
                File "/usr/local/lib/python2.7/site-packages/salt/modules/mount.py", line 148, in _active_mounts_openbsd
                  'opts': parens[1].split(", "),
              IndexError: list index out of range
     Started: 21:51:47.764708
    Duration: 38.882 ms

issue clarification:

function _active_mounts_openbsd()
expecting all mount points to have DUID
but NFS mounts do not have DUIDs generated, so line need to be parsed separately

proposal:

  1. check length of parens array
  2. and have a different parsing for lines with no DUIDs in them

testing same state after change:

  Name: /etc/fstab - Function: file.blockreplace - Result: Clean
  Name: /d01 - Function: mount.mounted - Result: Clean
  Name: /stage - Function: mount.mounted - Result: Clean
  Name: /backup - Function: mount.mounted - Result: Changed

Thanks,
Sergey.

fix for nfs mounts in _active_mounts_openbsd()
attempting to run following state
---

/backup:
  mount.mounted:
    - device: joule:/backup
    - fstype: nfs
    - mkmnt: True
    - opts: rw,nodev,nosuid

getting unexpected behavior: 
----------
 
``` 
        ID: /backup
    Function: mount.mounted
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/local/lib/python2.7/site-packages/salt/state.py", line 1591, in call
                  **cdata['kwargs'])
                File "/usr/local/lib/python2.7/site-packages/salt/states/mount.py", line 120, in mounted
                  active = __salt__['mount.active'](extended=True)
                File "/usr/local/lib/python2.7/site-packages/salt/modules/mount.py", line 184, in active
                  _active_mounts_openbsd(ret)
                File "/usr/local/lib/python2.7/site-packages/salt/modules/mount.py", line 148, in _active_mounts_openbsd
                  'opts': parens[1].split(", "),
              IndexError: list index out of range
     Started: 21:51:47.764708
    Duration: 38.882 ms
```

issue clarification: 
---
function _active_mounts_openbsd() 
expecting all mount points to have DUID   
but NFS mounts do not have DUIDs generated, so line need to be parsed separately  

proposal: 
---
1. check length of parens array 
2. and have a different parsing for lines with no DUIDs  in them

testing same state after change: 
---

```
  Name: /etc/fstab - Function: file.blockreplace - Result: Clean
  Name: /d01 - Function: mount.mounted - Result: Clean
  Name: /stage - Function: mount.mounted - Result: Clean
  Name: /backup - Function: mount.mounted - Result: Changed
```

---
Thanks, 
Sergey.
@cachedout

This comment has been minimized.

Show comment
Hide comment
@cachedout

cachedout Dec 21, 2015

Contributor

Hi Sergey,

Same white-space issue here as the other one. When you've updated the PR, please let me know and I'll get it in. Thanks!

Contributor

cachedout commented Dec 21, 2015

Hi Sergey,

Same white-space issue here as the other one. When you've updated the PR, please let me know and I'll get it in. Thanks!

Update mount.py
added a line

cachedout added a commit that referenced this pull request Dec 21, 2015

Merge pull request #29883 from serge-p/patch-6
fix for nfs mounts in _active_mounts_openbsd()

@cachedout cachedout merged commit 5e44639 into saltstack:2015.8 Dec 21, 2015

4 of 5 checks passed

default Merged build finished.
Details
jenkins/salt-pr-clone Salt PR - Clone Repository #12235 — SUCCESS
Details
jenkins/salt-pr-linode-ubuntu14.04-n Salt PR - Linode Ubuntu 14.04 #3299 — SUCCESS
Details
jenkins/salt-pr-lint-n Salt PR - Code Lint #11937 — SUCCESS
Details
jenkins/salt-pr-rs-cent7-n Salt PR - RS CentOS 7 #10814 — SUCCESS
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment