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

resizefs for extX and XFS filesystems #56831

Open
wants to merge 5 commits into
base: devel
from

Conversation

Projects
None yet
2 participants
@fedpr
Copy link

commented May 23, 2019

SUMMARY

While using the filesystem module I noticed that for ext{1,2,3} and XFS filesystems the parameter resizefs: true was leading to error.
for extX filesystems the error normally is:

  {
    "_ansible_no_log": false,
    "err": "resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/sdc' first.

"

while for XFS it is a requirement to have the filesystem mounted to operate changes.
So I am proposing these few lines to address the specific needs of these two filesystem families, by adding a 'mountpoint' parameter mandatory only in case of xfs, plus the fsck command and mount command in the relevant classes.
Hopefully this will enrich the module, for now I take my chance to thank everybody for the good work so far.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

filesystem.py module

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

Federico Prando
@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

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

lib/ansible/modules/system/filesystem.py:199:0: syntax-error invalid token (<unknown>, line 199)
test/sanity/pylint/ignore.txt:58:1: A102 Remove since "lib/ansible/modules/system/filesystem.py" passes "blacklisted-name" pylint test

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

lib/ansible/modules/system/filesystem.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/filesystem.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/filesystem.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/filesystem.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/python3.6 test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
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 813, in <module>
    main()
  File "../bin/plugin_formatter.py", line 768, 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 298, 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 111, 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 199
    os.mkdir(mnt, 0755)
                     ^
SyntaxError: invalid token
make: *** [modules] Error 1

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

lib/ansible/modules/system/filesystem.py:199:30: SyntaxError: os.mkdir(mnt, 0755)

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

lib/ansible/modules/system/filesystem.py:199:30: SyntaxError: os.mkdir(mnt, 0755)

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

lib/ansible/modules/system/filesystem.py:199:30: SyntaxError: os.mkdir(mnt, 0755)

click here for bot help

Federico Prando
@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/modules/system/filesystem.py:363:28: bad-whitespace Exactly one space required after comma             ['fstype', 'xfs',[ 'mountpoint' ]]                             ^
lib/ansible/modules/system/filesystem.py:363:29: bad-whitespace No space allowed after bracket             ['fstype', 'xfs',[ 'mountpoint' ]]                              ^
lib/ansible/modules/system/filesystem.py:363:44: bad-whitespace No space allowed before bracket             ['fstype', 'xfs',[ 'mountpoint' ]]                                             ^

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

lib/ansible/modules/system/filesystem.py:363:29: E231 missing whitespace after ','
lib/ansible/modules/system/filesystem.py:363:31: E201 whitespace after '['
lib/ansible/modules/system/filesystem.py:363:44: E202 whitespace before ']'

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

lib/ansible/modules/system/filesystem.py:0:0: E322 Argument 'mountpoint' is listed in the argument_spec, but not documented in the module documentation

click here for bot help

@ansibot ansibot added the ci_verified label May 23, 2019

Federico Prando

@ansibot ansibot removed the ci_verified label May 23, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

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

lib/ansible/modules/system/filesystem.py:0:0: E309 version_added for new option (mountpoint) should be '2.9'. Currently StrictVersion ('0.0')

click here for bot help

@ansibot ansibot added the ci_verified label May 23, 2019

Federico Prando
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.