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
ac18d289
Commit
ac18d289
authored
Mar 27, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6732 from ciupicri/micro-optimizations
Micro-optimizations
parents
cda90e3f
96ff1444
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
7 deletions
+7
-7
lib/ansible/inventory/__init__.py
+1
-1
lib/ansible/module_utils/known_hosts.py
+1
-1
lib/ansible/utils/__init__.py
+2
-2
library/cloud/gc_storage
+1
-1
library/cloud/s3
+1
-1
library/system/service
+1
-1
No files found.
lib/ansible/inventory/__init__.py
View file @
ac18d289
...
...
@@ -108,7 +108,7 @@ class Inventory(object):
inv_file
=
open
(
host_list
)
first_line
=
inv_file
.
readlines
()[
0
]
inv_file
.
close
()
if
first_line
.
find
(
'#!'
)
==
0
:
if
first_line
.
startswith
(
'#!'
)
:
shebang_present
=
True
except
:
pass
...
...
lib/ansible/module_utils/known_hosts.py
View file @
ac18d289
...
...
@@ -98,7 +98,7 @@ def not_in_host_file(self, host):
host_fh
.
close
()
for
line
in
data
.
split
(
"
\n
"
):
if
line
is
None
or
line
.
find
(
" "
)
==
-
1
:
if
line
is
None
or
" "
not
in
line
:
continue
tokens
=
line
.
split
()
if
tokens
[
0
]
.
find
(
HASHED_KEY_MAGIC
)
==
0
:
...
...
lib/ansible/utils/__init__.py
View file @
ac18d289
...
...
@@ -314,7 +314,7 @@ def parse_json(raw_data):
raise
for
t
in
tokens
:
if
t
.
find
(
"="
)
==
-
1
:
if
"="
not
in
t
:
raise
errors
.
AnsibleError
(
"failed to parse:
%
s"
%
orig_data
)
(
key
,
value
)
=
t
.
split
(
"="
,
1
)
if
key
==
'changed'
or
'failed'
:
...
...
@@ -1035,7 +1035,7 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
# not sure why the "/" is in above code :)
try
:
new_terms
=
template
.
template
(
basedir
,
"{{
%
s }}"
%
terms
,
inject
)
if
isinstance
(
new_terms
,
basestring
)
and
new_terms
.
find
(
"{{"
)
!=
-
1
:
if
isinstance
(
new_terms
,
basestring
)
and
"{{"
in
new_terms
:
pass
else
:
terms
=
new_terms
...
...
library/cloud/gc_storage
View file @
ac18d289
...
...
@@ -154,7 +154,7 @@ def keysum(module, gs, bucket, obj):
key_check
=
bucket
.
get_key
(
obj
)
if
key_check
:
md5_remote
=
key_check
.
etag
[
1
:
-
1
]
etag_multipart
=
md5_remote
.
find
(
'-'
)
!=-
1
#
Check for multipart, etag is not md5
etag_multipart
=
'-'
in
md5_remote
#
Check for multipart, etag is not md5
if
etag_multipart
is
True
:
module
.
fail_json
(
msg
=
"Files uploaded with multipart of gs are not supported with checksum, unable to compute checksum."
)
return
md5_remote
...
...
library/cloud/s3
View file @
ac18d289
...
...
@@ -147,7 +147,7 @@ def keysum(module, s3, bucket, obj):
key_check
=
bucket
.
get_key
(
obj
)
if
key_check
:
md5_remote
=
key_check
.
etag
[
1
:
-
1
]
etag_multipart
=
md5_remote
.
find
(
'-'
)
!=-
1
#
Check for multipart, etag is not md5
etag_multipart
=
'-'
in
md5_remote
#
Check for multipart, etag is not md5
if
etag_multipart
is
True
:
module
.
fail_json
(
msg
=
"Files uploaded with multipart of s3 are not supported with checksum, unable to compute checksum."
)
return
md5_remote
...
...
library/system/service
View file @
ac18d289
...
...
@@ -1008,7 +1008,7 @@ class SunOSService(Service):
# enabled true
# enabled false
for
line
in
stdout
.
split
(
"
\n
"
):
if
line
.
find
(
"enabled"
)
==
0
:
if
line
.
startswith
(
"enabled"
)
:
if
"true"
in
line
:
enabled
=
True
if
"temporary"
in
line
:
...
...
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