Commit baad0a62 by Toshio Kuratomi

Merge pull request #10723 from mscherer/fix_errors_playbook

Fix errors reporting for playbook/*
parents 3f03f76f b20d5452
...@@ -45,11 +45,11 @@ class Become: ...@@ -45,11 +45,11 @@ class Become:
if has_become: if has_become:
msg = 'The become params ("become", "become_user") and' msg = 'The become params ("become", "become_user") and'
if has_sudo: if has_sudo:
raise errors.AnsibleParserError('%s sudo params ("sudo", "sudo_user") cannot be used together' % msg) raise AnsibleParserError('%s sudo params ("sudo", "sudo_user") cannot be used together' % msg)
elif has_su: elif has_su:
raise errors.AnsibleParserError('%s su params ("su", "su_user") cannot be used together' % msg) raise AnsibleParserError('%s su params ("su", "su_user") cannot be used together' % msg)
elif has_sudo and has_su: elif has_sudo and has_su:
raise errors.AnsibleParserError('sudo params ("sudo", "sudo_user") and su params ("su", "su_user") cannot be used together') raise AnsibleParserError('sudo params ("sudo", "sudo_user") and su params ("su", "su_user") cannot be used together')
def _preprocess_data_become(self, ds): def _preprocess_data_become(self, ds):
"""Preprocess the playbook data for become attributes """Preprocess the playbook data for become attributes
......
...@@ -27,6 +27,7 @@ from ansible.playbook.attribute import FieldAttribute ...@@ -27,6 +27,7 @@ from ansible.playbook.attribute import FieldAttribute
from ansible.playbook.base import Base from ansible.playbook.base import Base
from ansible.playbook.conditional import Conditional from ansible.playbook.conditional import Conditional
from ansible.playbook.taggable import Taggable from ansible.playbook.taggable import Taggable
from ansible.errors import AnsibleParserError
class PlaybookInclude(Base): class PlaybookInclude(Base):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment