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

FIX #35474 - resolve apt error messages #56179

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open

Conversation

@KunyiLiu
Copy link

@KunyiLiu KunyiLiu commented May 7, 2019

SUMMARY

FIX #35474

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/packaging/os/apt.py

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

@ansibot ansibot commented May 7, 2019

Copy link
Member

@bcoca bcoca left a comment

This just exchanges the issue to create the exact same problem when people use package

@samdoran
Copy link
Member

@samdoran samdoran commented May 9, 2019

@bcoca True, but I believe that we decided to make the code match the documentation when we went over this in triage. The idea being that the docs list name as the primary field which most people will probably use. That the error using package is confusing since most people may not realize it's an alias. Furthermore, most package modules use name for the package name. There are a couple that use package and pkg but most use name.

become: True
failed_when: False
register: apt_result
- name: Check that name and upgrade arguments produce a conflict error
Copy link
Member

@samdoran samdoran May 9, 2019

Add a line between tasks to make them a bit more readable.

- name: Check that name and upgrade arguments produce a conflict error
assert:
that:
- >-
Copy link
Member

@samdoran samdoran May 9, 2019

There's no need to use line folding here. You can just list the test cases:

Suggested change
- >-
- "parameters are mutually exclusive: deb|name|upgrade" in apt_result.msg

@@ -34,5 +34,7 @@
name: "{{ repodir }}"
state: absent

- include: 'apt-error-message.yml'
Copy link
Member

@samdoran samdoran May 9, 2019

Rather than use include, use import_tasks. I know that is how the other tasks files are imported but they should be updated as well.

@bcoca
Copy link
Member

@bcoca bcoca commented May 9, 2019

@samdoran, still a better fix is to check if alias is set and use that in the error message (a reverse of current handle_aliases).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants