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 a basic module for snap packages (packaging/os/snap.py) #40852

Closed
wants to merge 1 commit into from

Conversation

@vcarceler
Copy link
Contributor

@vcarceler vcarceler commented May 29, 2018

SUMMARY

Added a basic module for managing snap packages.

Snap is a new package format, for more info visit: https://snapcraft.io/

This module is able to install, uninstall snaps with or without --classic confinement.

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

snap
packaging/os/snap.py

ANSIBLE VERSION

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

@ansibot ansibot commented May 29, 2018

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

lib/ansible/modules/packaging/os/snap.py:153:15: undefined-variable Undefined variable 'parse_diff'

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

lib/ansible/modules/packaging/os/snap.py:0:0: missing: __metaclass__ = type
lib/ansible/modules/packaging/os/snap.py:0:0: missing: from __future__ import (absolute_import, division, print_function)

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

lib/ansible/modules/packaging/os/snap.py:79:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/packaging/os/snap.py:87:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/packaging/os/snap.py:94:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/packaging/os/snap.py:105:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/packaging/os/snap.py:112:1: E302 expected 2 blank lines, found 1
lib/ansible/modules/packaging/os/snap.py:159:9: E265 block comment should start with '# '
lib/ansible/modules/packaging/os/snap.py:160:9: E265 block comment should start with '# '
lib/ansible/modules/packaging/os/snap.py:198:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [explain] failed with 5 errors:

lib/ansible/modules/packaging/os/snap.py:0:0: E307 version_added should be 2.7. Currently 2.4
lib/ansible/modules/packaging/os/snap.py:0:0: E319 RETURN.message.returned: required key not provided @ data['returned']. Got None
lib/ansible/modules/packaging/os/snap.py:0:0: E319 RETURN.message.type: required key not provided @ data['type']. Got None
lib/ansible/modules/packaging/os/snap.py:0:0: E319 RETURN.original_message.returned: required key not provided @ data['returned']. Got None
lib/ansible/modules/packaging/os/snap.py:0:0: E326 Value for "choices" from the argument_spec ([]) for "classic" does not match the documentation ([False, True])

click here for bot help

def install_snap(module, name):
classic = ''
if module.params['classic']:
classic = '--classic'

This comment has been minimized.

@bittner

bittner Sep 2, 2018

I would write this all on a single line as:

classic = '--classic' if module.params['classic'] else ''
if module._diff:
diff = parse_diff(out)
else:
diff = {}

This comment has been minimized.

@bittner

bittner Sep 2, 2018

I would write this all on a single line as:

diff = parse_diff(out) if module._diff else {}
@bittner
Copy link

@bittner bittner commented Sep 2, 2018

@vcarceler Could you address the complaints of the @ansibot from above, please? Then this PR could move forward (into a discussion).

@angristan
Copy link
Contributor

@angristan angristan commented Sep 2, 2018

@bittner See #44939

@bittner
Copy link

@bittner bittner commented Sep 2, 2018

Then we should close this PR?

@angristan
Copy link
Contributor

@angristan angristan commented Sep 2, 2018

I think we should! I'm motivated to finish the module

@webknjaz
Copy link
Member

@webknjaz webknjaz commented Oct 17, 2018

Implemented by @angristan via #44939 on top of this PR. Thanks to @vcarceler for the original work!

@webknjaz webknjaz closed this Oct 17, 2018
@angristan
Copy link
Contributor

@angristan angristan commented Oct 17, 2018

Thanks @vcarceler!

pull bot pushed a commit to yaplej/ansible that referenced this pull request Oct 17, 2018
PR ansible#44939

Fixes ansible#39155
Closes ansible#40852

Co-authored-by: Victor Carceler <vcarceler@iespuigcastellar.xeill.net>
Co-authored-by: Stanislas Lange <angristan@pm.me>
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
@vcarceler
Copy link
Contributor Author

@vcarceler vcarceler commented Oct 18, 2018

Thanks @angristan, @webknjaz!

I'm very happy :-)

Tomorrow9 added a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
PR ansible#44939

Fixes ansible#39155
Closes ansible#40852

Co-authored-by: Victor Carceler <vcarceler@iespuigcastellar.xeill.net>
Co-authored-by: Stanislas Lange <angristan@pm.me>
Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants