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

made certain flags part of base to make them universally settable #10744

Merged
merged 3 commits into from
Apr 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions v2/ansible/playbook/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@

class Base:

# connection/transport
_connection = FieldAttribute(isa='string')
_port = FieldAttribute(isa='int')
_remote_user = FieldAttribute(isa='string')

# vars and flags
_vars = FieldAttribute(isa='dict', default=dict())
_environment = FieldAttribute(isa='dict', default=dict())
_no_log = FieldAttribute(isa='bool', default=False)

def __init__(self):

# initialize the data loader and variable manager, which will be provided
Expand Down
3 changes: 1 addition & 2 deletions v2/ansible/playbook/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __init__(self, parent_block=None, role=None, task_include=None, use_handlers
self._task_include = task_include
self._use_handlers = use_handlers
self._dep_chain = []
self._vars = dict()

super(Block, self).__init__()

Expand All @@ -62,7 +61,7 @@ def get_vars(self):
if self._task_include:
all_vars.update(self._task_include.get_vars())

all_vars.update(self._vars)
all_vars.update(self.vars)
return all_vars

@staticmethod
Expand Down
6 changes: 0 additions & 6 deletions v2/ansible/playbook/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,11 @@ class Play(Base, Taggable, Become):
_accelerate_port = FieldAttribute(isa='int', default=5099) # should be alias of port

# Connection
_connection = FieldAttribute(isa='string', default='smart')
_gather_facts = FieldAttribute(isa='string', default='smart')
_hosts = FieldAttribute(isa='list', default=[], required=True)
_name = FieldAttribute(isa='string', default='<no name specified>')
_port = FieldAttribute(isa='int', default=22)
_remote_user = FieldAttribute(isa='string')

# Variable Attributes
_vars = FieldAttribute(isa='dict', default=dict())
_vars_files = FieldAttribute(isa='list', default=[])
_vars_prompt = FieldAttribute(isa='dict', default=dict())
_vault_password = FieldAttribute(isa='string')
Expand All @@ -80,9 +76,7 @@ class Play(Base, Taggable, Become):

# Flag/Setting Attributes
_any_errors_fatal = FieldAttribute(isa='bool', default=False)
_environment = FieldAttribute(isa='dict', default=dict())
_max_fail_percentage = FieldAttribute(isa='string', default='0')
_no_log = FieldAttribute(isa='bool', default=False)
_serial = FieldAttribute(isa='int', default=0)
_strategy = FieldAttribute(isa='string', default='linear')

Expand Down
6 changes: 0 additions & 6 deletions v2/ansible/playbook/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ class Task(Base, Conditional, Taggable, Become):
_any_errors_fatal = FieldAttribute(isa='bool')
_async = FieldAttribute(isa='int', default=0)
_changed_when = FieldAttribute(isa='string')
_connection = FieldAttribute(isa='string')
_delay = FieldAttribute(isa='int', default=5)
_delegate_to = FieldAttribute(isa='string')
_environment = FieldAttribute(isa='dict')
_failed_when = FieldAttribute(isa='string')
_first_available_file = FieldAttribute(isa='list')
_ignore_errors = FieldAttribute(isa='bool')
Expand All @@ -80,16 +78,12 @@ class Task(Base, Conditional, Taggable, Become):

_name = FieldAttribute(isa='string', default='')

_no_log = FieldAttribute(isa='bool')
_notify = FieldAttribute(isa='list')
_poll = FieldAttribute(isa='int')
_register = FieldAttribute(isa='string')
_remote_user = FieldAttribute(isa='string')
_retries = FieldAttribute(isa='int', default=1)
_run_once = FieldAttribute(isa='bool')
_transport = FieldAttribute(isa='string')
_until = FieldAttribute(isa='list') # ?
_vars = FieldAttribute(isa='dict', default=dict())

def __init__(self, block=None, role=None, task_include=None):
''' constructors a task, without the Task.load classmethod, it will be pretty blank '''
Expand Down