[BUG] mount.filesystems on AIX wrongly reports "options" attribute as "Invalid name for use in filesystems"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
On AIX a salt-ssh <aixminion> mount.filesystems to retrieve the stanzas of /etc/filesystems reports the following error when a stanza has an "options" attribute:
[ERROR ] An un-handled exception was caught by salt's global exception handler:
ValueError: Invalid name for use in filesystems: options
Traceback (most recent call last):
File "/tmp/salt-thin_dir/salt-call", line 27, in <module>
salt_call()
...
File "/tmp/salt-thin_dir/pyall/salt/modules/mount.py", line 1736, in filesystems
ret_dict = _filesystems(config)
File "/tmp/salt-thin_dir/pyall/salt/modules/mount.py", line 1699, in _filesystems
lines, _FileSystemsEntry.compatibility_keys
File "/tmp/salt-thin_dir/pyall/salt/modules/mount.py", line 540, in dict_from_lines
"Invalid name for use in filesystems: {}".format(key_name)
ValueError: Invalid name for use in filesystems: options
For entries in /etc/filesystems on AIX an "options" attribute is perfectly legal and is also commonly used.
See https://www.ibm.com/docs/en/aix/7.2?topic=files-filesystems-file for the allowed attributes of a stanza in /etc/filesystems.
Setup
Any AIX minion with a stanza in /etc/filesystems that has an "options" attribute. E.g.:
/mnt/foo:
dev = /dev/gaga
vfs = jfs2
options = rw,log=/dev/hd8
mount = False
Please be as specific as possible and give set-up details.
- on-prem machine
- VM (Virtualbox, KVM, etc. please specify)
- VM running on a cloud service, please be explicit and add details
- container (Kubernetes, Docker, containerd, etc. please specify)
- or a combination, please be explicit
- jails if it is FreeBSD
- classic packaging
- onedir packaging
- used bootstrap to install
Steps to Reproduce the behavior
With stanza described above in /etc/filesystems do a salt call on any AIX minion:
# /usr/bin/python /tmp/salt-thin_dir/salt-call --local --out json -c /tmp/salt-thin_dir -- mount.filesystems
[ERROR ] An un-handled exception was caught by salt's global exception handler:
ValueError: Invalid name for use in filesystems: options
...
Expected behavior
mount.filesystems should read and accept an "options" attribute in an /etc/filesystems stanza.
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.)# /usr/bin/python /tmp/salt-thin_dir/salt-call --local -c /tmp/salt-thin_dir -- test.versions
local:
Salt Version:
Salt: 3004.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.10.3
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.10.1
pygit2: Not Installed
Python: 3.7.12 (default, Dec 15 2021, 03:25:47)
python-gnupg: Not Installed
PyYAML: 5.4.1
PyZMQ: 18.1.1
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: aix 2
locale: ISO8859-1
machine: 00XXXXXXXXXX
release: 2
system: AIX
version: AIX 2
Additional context
This is not a salt-ssh problem. Any salt <aixminon> mount.filesystems, salt-ssh <aixminon> mount.filesystems or salt-call --local mount.filesystems on an AIX minion would show the error
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in salt/modules/mount.py at dict_from_lines and _filesystems, where the traceback rejects the AIX filesystems key. Reproduce the issue with the provided /etc/filesystems stanza containing options; done means mount.filesystems accepts the stanza and returns its attributes without raising ValueError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100