Compare commits

..

1 commit

Author SHA1 Message Date
Vladimir Botka
48654cea81
Merge 385a562148 into b96fad5e5b 2025-08-06 06:49:04 +02:00
3 changed files with 7 additions and 6 deletions

View file

@ -1,3 +0,0 @@
bugfixes:
- "firewalld_info - stop returning warnings as return values; this has been deprecated by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670)."
- "mount - stop returning warnings as return values; this has been deprecated by ansible-core (https://github.com/ansible-collections/ansible.posix/pull/670)."

View file

@ -319,6 +319,7 @@ def main():
active_zones=module.params['active_zones'], active_zones=module.params['active_zones'],
collected_zones=list(), collected_zones=list(),
undefined_zones=list(), undefined_zones=list(),
warnings=list(),
) )
# Exit with failure message if requirements modules are not installed. # Exit with failure message if requirements modules are not installed.

View file

@ -279,7 +279,7 @@ def _set_mount_save_old(module, args):
old_lines = [] old_lines = []
exists = False exists = False
changed = False changed = False
escaped_args = dict([(k, _escape_fstab(v)) for k, v in iteritems(args)]) escaped_args = dict([(k, _escape_fstab(v)) for k, v in iteritems(args) if k != 'warnings'])
new_line = '%(src)s %(name)s %(fstype)s %(opts)s %(dump)s %(passno)s\n' new_line = '%(src)s %(name)s %(fstype)s %(opts)s %(dump)s %(passno)s\n'
if platform.system() == 'SunOS': if platform.system() == 'SunOS':
@ -804,6 +804,7 @@ def main():
passno='-', passno='-',
fstab=module.params['fstab'], fstab=module.params['fstab'],
boot='yes' if module.params['boot'] else 'no', boot='yes' if module.params['boot'] else 'no',
warnings=[]
) )
if args['fstab'] is None: if args['fstab'] is None:
args['fstab'] = '/etc/vfstab' args['fstab'] = '/etc/vfstab'
@ -815,6 +816,7 @@ def main():
passno='0', passno='0',
fstab=module.params['fstab'], fstab=module.params['fstab'],
boot='yes', boot='yes',
warnings=[]
) )
if args['fstab'] is None: if args['fstab'] is None:
args['fstab'] = '/etc/fstab' args['fstab'] = '/etc/fstab'
@ -832,7 +834,8 @@ def main():
linux_mounts = get_linux_mounts(module) linux_mounts = get_linux_mounts(module)
if linux_mounts is None: if linux_mounts is None:
module.warn('Cannot open file /proc/self/mountinfo. Bind mounts might be misinterpreted.') args['warnings'].append('Cannot open file /proc/self/mountinfo.'
' Bind mounts might be misinterpreted.')
# Override defaults with user specified params # Override defaults with user specified params
for key in ('src', 'fstype', 'passno', 'opts', 'dump', 'fstab'): for key in ('src', 'fstype', 'passno', 'opts', 'dump', 'fstab'):
@ -844,7 +847,7 @@ def main():
# specified in 'opts', mount module will ignore 'boot'. # specified in 'opts', mount module will ignore 'boot'.
opts = args['opts'].split(',') opts = args['opts'].split(',')
if module.params['boot'] and 'noauto' in opts: if module.params['boot'] and 'noauto' in opts:
module.warn("Ignore the 'boot' due to 'opts' contains 'noauto'.") args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
elif not module.params['boot']: elif not module.params['boot']:
args['boot'] = 'no' args['boot'] = 'no'
opts.append('noauto') opts.append('noauto')