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

Added state "remount" which will remount the device #52649

Open
wants to merge 12 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@rmahique
Copy link

rmahique commented Feb 20, 2019

SUMMARY

Sometimes people want to remount the FS (ie. with NFS), i added this option to "state" parameter.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

module: mount

ADDITIONAL INFORMATION
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 20, 2019

Show resolved Hide resolved lib/ansible/modules/system/mount.py Outdated
Show resolved Hide resolved lib/ansible/modules/system/mount.py Outdated
elif state == 'remount':
res = 0

res, msg = remount(module, args)

This comment has been minimized.

@jtyr

jtyr Feb 21, 2019

Contributor

This should be executed only if module.check_mode:.

changed = True

if res:
module.fail_json(msg="Error remounting %s: %s" % (name, msg))

This comment has been minimized.

@jtyr

jtyr Feb 21, 2019

Contributor

Move this condition above the changed = True and inside the if module.check_mode:.

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 21, 2019

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:0: syntax-error inconsistent use of tabs and spaces in indentation (<unknown>, line 734)

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test ansible-doc --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: has a documentation error formatting or is missing documentation.

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
cat _themes/srtd/static/css/theme.css | sed -e 's/^[ 	]*//g; s/[ 	]*$//g; s/\([:{;,]\) /\1/g; s/ {/{/g; s/\/\*.*\*\///g; /^$/d' | sed -e :a -e '$!N; s/\n\(.\)/\1/; ta' > _themes/srtd/static/css/theme.min.css
PYTHONPATH=../../lib ../bin/dump_config.py --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ -d ../../lib/ansible/config/base.yml
mkdir -p rst/cli
PYTHONPATH=../../lib ../bin/generate_man.py --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
PYTHONPATH=../../lib ../bin/dump_keywords.py --template-dir=../templates --output-dir=rst/reference_appendices/ -d ./keyword_desc.yml
PYTHONPATH=../../lib ../bin/plugin_formatter.py -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ 
Evaluating module files...
Makefile:93: recipe for target 'modules' failed
--> Standard Error
Traceback (most recent call last):
  File "../bin/plugin_formatter.py", line 774, in <module>
    main()
  File "../bin/plugin_formatter.py", line 729, in main
    plugin_info, categories = get_plugin_info(options.module_dir, limit_to=options.limit_to, verbose=(options.verbosity > 0))
  File "../bin/plugin_formatter.py", line 294, in get_plugin_info
    doc, examples, returndocs, metadata = plugin_docs.get_docstring(module_path, fragment_loader, verbose=verbose)
  File "/root/ansible/lib/ansible/utils/plugin_docs.py", line 103, in get_docstring
    data = read_docstring(filename, verbose=verbose, ignore_errors=ignore_errors)
  File "/root/ansible/lib/ansible/parsing/plugin_docs.py", line 40, in read_docstring
    M = ast.parse(b_module_data.read())
  File "/usr/lib/python3.6/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 734
    if res:
          ^
TabError: inconsistent use of tabs and spaces in indentation
make: *** [modules] Error 1

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: SyntaxError: if res:

The test ansible-test sanity --test compile --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: SyntaxError: if res:

The test ansible-test sanity --test compile --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: SyntaxError: if res:

The test ansible-test sanity --test compile --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: SyntaxError: if res:

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: TabError: inconsistent use of tabs and spaces in indentation

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: TabError: inconsistent use of tabs and spaces in indentation

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: TabError: inconsistent use of tabs and spaces in indentation

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: TabError: inconsistent use of tabs and spaces in indentation

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/modules/system/mount.py:732:5: E101 indentation contains mixed spaces and tabs
lib/ansible/modules/system/mount.py:732:5: W191 indentation contains tabs

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:0:0: E401 Python SyntaxError while parsing module

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/system/mount.py:734:20: python-syntax-error inconsistent use of tabs and spaces in indentation (<unknown>, line 734)

click here for bot help

@ansibot ansibot removed the ci_verified label Feb 21, 2019

@jtyr

This comment has been minimized.

Copy link
Contributor

jtyr commented Feb 22, 2019

Thanks for implementing my comments, @rmahique. Please could you also add a test for this new feature?

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 22, 2019

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

test/integration/targets/mount/tasks/main.yml:306:1: empty-lines too many blank lines (1 > 0)

click here for bot help

rmahique added some commits Feb 22, 2019

fix
@rmahique

This comment has been minimized.

Copy link
Author

rmahique commented Feb 24, 2019

Added

@jtyr

jtyr approved these changes Feb 24, 2019

@jtyr

This comment has been minimized.

Copy link
Contributor

jtyr commented Feb 24, 2019

Please could you also add a changelog fragment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.