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
base: devel
from

Conversation

Projects
None yet
6 participants
@vcarceler
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

angristan commented Sep 2, 2018

@bittner See #44939

@bittner

This comment has been minimized.

Copy link

bittner commented Sep 2, 2018

Then we should close this PR?

@angristan

This comment has been minimized.

Copy link
Contributor

angristan commented Sep 2, 2018

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

@webknjaz

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

angristan commented Oct 17, 2018

Thanks @vcarceler!

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

Implement snap packaging module
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

This comment has been minimized.

Copy link
Contributor

vcarceler commented Oct 18, 2018

Thanks @angristan, @webknjaz!

I'm very happy :-)

jsenecal added a commit to connectitnet/ansible that referenced this pull request Oct 19, 2018

Implement snap packaging module
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>

kbreit added a commit to kbreit/ansible that referenced this pull request Nov 15, 2018

Implement snap packaging module
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>

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

Implement snap packaging module
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment