Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
ff87ac08
Commit
ff87ac08
authored
Oct 03, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
An attempt at modularization prior to moving things towards BaseObject and considering Attributes.
parent
cae88ca1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
40 deletions
+2
-40
lib/ansible/modules/core
+1
-1
v2/ansible/playbook/base.py
+1
-39
v2/ansible/playbook/task.py
+0
-0
No files found.
core
@
9b35a391
Subproject commit
db5668b84c3a19498b843d0bfe34574aef40c193
Subproject commit
9b35a391213fe87834af5ebc907109de2bc0005f
v2/ansible/playbook/base.py
View file @
ff87ac08
...
@@ -21,43 +21,5 @@ from playbook.tag import Tag
...
@@ -21,43 +21,5 @@ from playbook.tag import Tag
class
Base
(
object
):
class
Base
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_tags
=
Tag
()
pass
def
_ensure_int
(
self
,
attr
,
default
=
0
):
value
=
getattr
(
self
,
attr
)
if
value
is
None
:
setattr
(
self
,
attr
,
default
)
elif
not
isinstance
(
value
,
int
):
try
:
setattr
(
self
,
attr
,
int
(
value
))
except
ValueError
:
raise
AnsibleError
(
"failed to set attr
%
s to an integer, got '
%
s' which is a
%
s"
%
(
attr
,
value
,
type
(
value
)))
def
_ensure_bool
(
self
,
attr
,
default
=
False
):
value
=
getattr
(
self
,
attr
)
if
value
is
None
:
setattr
(
self
,
attr
,
default
)
elif
not
isinstance
(
value
,
bool
):
setattr
(
self
,
attr
,
utils
.
boolean
(
value
))
def
_ensure_basestring
(
self
,
attr
,
default
=
""
):
value
=
getattr
(
self
,
attr
)
if
value
is
None
:
setattr
(
self
,
attr
,
default
)
elif
not
isinstance
(
value
,
basestring
):
setattr
(
self
,
attr
,
"
%
s"
%
value
)
def
_ensure_list_of_strings
(
self
,
attr
,
default
=
[]):
value
=
getattr
(
self
,
attr
)
if
value
is
None
:
setattr
(
self
,
attr
,
default
)
elif
not
isinstance
(
value
,
list
):
setattr
(
self
,
attr
,
[
str
(
value
)
])
else
:
changed
=
False
for
idx
,
val
in
enumerate
(
value
):
if
not
isinstance
(
val
,
basestring
):
value
[
idx
]
=
str
(
val
)
changed
=
True
if
changed
:
setattr
(
self
,
attr
,
value
)
v2/ansible/playbook/task.py
View file @
ff87ac08
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment