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
d8a81c48
Commit
d8a81c48
authored
Mar 12, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove validate_certs parameter from fetch_url calls
parent
a9017af2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
11 deletions
+10
-11
library/monitoring/airbrake_deployment
+1
-1
library/net_infrastructure/netscaler
+1
-1
library/network/get_url
+3
-4
library/packaging/apt_key
+1
-1
library/packaging/rpm_key
+1
-1
library/source_control/github_hooks
+3
-3
No files found.
library/monitoring/airbrake_deployment
View file @
d8a81c48
...
@@ -115,7 +115,7 @@ def main():
...
@@ -115,7 +115,7 @@ def main():
# Send the data to airbrake
# Send the data to airbrake
data
=
urllib
.
urlencode
(
params
)
data
=
urllib
.
urlencode
(
params
)
response
,
info
=
fetch_url
(
module
,
url
,
data
=
data
,
validate_certs
=
module
.
params
[
'validate_certs'
]
)
response
,
info
=
fetch_url
(
module
,
url
,
data
=
data
)
if
info
[
'status'
]
==
200
:
if
info
[
'status'
]
==
200
:
module
.
exit_json
(
changed
=
True
)
module
.
exit_json
(
changed
=
True
)
else
:
else
:
...
...
library/net_infrastructure/netscaler
View file @
d8a81c48
...
@@ -122,7 +122,7 @@ class netscaler(object):
...
@@ -122,7 +122,7 @@ class netscaler(object):
'Content-Type'
:
'application/x-www-form-urlencoded'
,
'Content-Type'
:
'application/x-www-form-urlencoded'
,
}
}
response
,
info
=
fetch_url
(
self
.
module
,
request_url
,
data
=
data_json
,
validate_certs
=
self
.
module
.
params
[
'validate_certs'
]
)
response
,
info
=
fetch_url
(
self
.
module
,
request_url
,
data
=
data_json
)
return
json
.
load
(
response
.
read
())
return
json
.
load
(
response
.
read
())
...
...
library/network/get_url
View file @
d8a81c48
...
@@ -124,14 +124,14 @@ def url_filename(url):
...
@@ -124,14 +124,14 @@ def url_filename(url):
return
'index.html'
return
'index.html'
return
fn
return
fn
def
url_get
(
module
,
url
,
dest
,
use_proxy
,
last_mod_time
,
force
,
validate_certs
):
def
url_get
(
module
,
url
,
dest
,
use_proxy
,
last_mod_time
,
force
):
"""
"""
Download data from the url and store in a temporary file.
Download data from the url and store in a temporary file.
Return (tempfile, info about the request)
Return (tempfile, info about the request)
"""
"""
rsp
,
info
=
fetch_url
(
module
,
url
,
use_proxy
=
use_proxy
,
force
=
force
,
last_mod_time
=
last_mod_time
,
validate_certs
=
validate_certs
)
rsp
,
info
=
fetch_url
(
module
,
url
,
use_proxy
=
use_proxy
,
force
=
force
,
last_mod_time
=
last_mod_time
)
if
info
[
'status'
]
==
304
:
if
info
[
'status'
]
==
304
:
module
.
exit_json
(
url
=
url
,
dest
=
dest
,
changed
=
False
,
msg
=
info
.
get
(
'msg'
,
''
))
module
.
exit_json
(
url
=
url
,
dest
=
dest
,
changed
=
False
,
msg
=
info
.
get
(
'msg'
,
''
))
...
@@ -192,7 +192,6 @@ def main():
...
@@ -192,7 +192,6 @@ def main():
force
=
module
.
params
[
'force'
]
force
=
module
.
params
[
'force'
]
sha256sum
=
module
.
params
[
'sha256sum'
]
sha256sum
=
module
.
params
[
'sha256sum'
]
use_proxy
=
module
.
params
[
'use_proxy'
]
use_proxy
=
module
.
params
[
'use_proxy'
]
validate_certs
=
module
.
params
[
'validate_certs'
]
dest_is_dir
=
os
.
path
.
isdir
(
dest
)
dest_is_dir
=
os
.
path
.
isdir
(
dest
)
last_mod_time
=
None
last_mod_time
=
None
...
@@ -207,7 +206,7 @@ def main():
...
@@ -207,7 +206,7 @@ def main():
last_mod_time
=
datetime
.
datetime
.
utcfromtimestamp
(
mtime
)
last_mod_time
=
datetime
.
datetime
.
utcfromtimestamp
(
mtime
)
# download to tmpsrc
# download to tmpsrc
tmpsrc
,
info
=
url_get
(
module
,
url
,
dest
,
use_proxy
,
last_mod_time
,
force
,
validate_certs
)
tmpsrc
,
info
=
url_get
(
module
,
url
,
dest
,
use_proxy
,
last_mod_time
,
force
)
# Now the request has completed, we can finally generate the final
# Now the request has completed, we can finally generate the final
# destination file name from the info dict.
# destination file name from the info dict.
...
...
library/packaging/apt_key
View file @
d8a81c48
...
@@ -140,7 +140,7 @@ def download_key(module, url):
...
@@ -140,7 +140,7 @@ def download_key(module, url):
if
url
is
None
:
if
url
is
None
:
module
.
fail_json
(
msg
=
"needed a URL but was not specified"
)
module
.
fail_json
(
msg
=
"needed a URL but was not specified"
)
try
:
try
:
rsp
,
info
=
fetch_url
(
module
,
url
,
validate_certs
=
module
.
params
[
'validate_certs'
]
)
rsp
,
info
=
fetch_url
(
module
,
url
)
return
rsp
.
read
()
return
rsp
.
read
()
except
Exception
:
except
Exception
:
module
.
fail_json
(
msg
=
"error getting key id from url"
,
traceback
=
format_exc
())
module
.
fail_json
(
msg
=
"error getting key id from url"
,
traceback
=
format_exc
())
...
...
library/packaging/rpm_key
View file @
d8a81c48
...
@@ -123,7 +123,7 @@ class RpmKey:
...
@@ -123,7 +123,7 @@ class RpmKey:
def
fetch_key
(
self
,
url
,
maxbytes
=
MAXBYTES
):
def
fetch_key
(
self
,
url
,
maxbytes
=
MAXBYTES
):
"""Downloads a key from url, returns a valid path to a gpg key"""
"""Downloads a key from url, returns a valid path to a gpg key"""
try
:
try
:
rsp
,
info
=
fetch_url
(
self
.
module
,
url
,
validate_certs
=
self
.
module
.
params
[
'validate_certs'
]
)
rsp
,
info
=
fetch_url
(
self
.
module
,
url
)
key
=
rsp
.
read
(
maxbytes
)
key
=
rsp
.
read
(
maxbytes
)
if
not
is_pubkey
(
key
):
if
not
is_pubkey
(
key
):
self
.
module
.
fail_json
(
msg
=
"Not a public key:
%
s"
%
url
)
self
.
module
.
fail_json
(
msg
=
"Not a public key:
%
s"
%
url
)
...
...
library/source_control/github_hooks
View file @
d8a81c48
...
@@ -75,7 +75,7 @@ def list(module, hookurl, oauthkey, repo, user):
...
@@ -75,7 +75,7 @@ def list(module, hookurl, oauthkey, repo, user):
headers
=
{
headers
=
{
'Authorization'
:
'Basic
%
s'
%
auth
,
'Authorization'
:
'Basic
%
s'
%
auth
,
}
}
response
,
info
=
fetch_url
(
module
,
url
,
headers
=
headers
,
validate_certs
=
module
.
params
[
'validate_certs'
]
)
response
,
info
=
fetch_url
(
module
,
url
,
headers
=
headers
)
if
info
[
'status'
]
!=
200
:
if
info
[
'status'
]
!=
200
:
return
False
,
''
return
False
,
''
else
:
else
:
...
@@ -120,7 +120,7 @@ def create(module, hookurl, oauthkey, repo, user):
...
@@ -120,7 +120,7 @@ def create(module, hookurl, oauthkey, repo, user):
headers
=
{
headers
=
{
'Authorization'
:
'Basic
%
s'
%
auth
,
'Authorization'
:
'Basic
%
s'
%
auth
,
}
}
response
,
info
=
fetch_url
(
module
,
url
,
data
=
data
,
headers
=
headers
,
validate_certs
=
module
.
params
[
'validate_certs'
]
)
response
,
info
=
fetch_url
(
module
,
url
,
data
=
data
,
headers
=
headers
)
if
info
[
'status'
]
!=
200
:
if
info
[
'status'
]
!=
200
:
return
0
,
'[]'
return
0
,
'[]'
else
:
else
:
...
@@ -132,7 +132,7 @@ def delete(module, hookurl, oauthkey, repo, user, hookid):
...
@@ -132,7 +132,7 @@ def delete(module, hookurl, oauthkey, repo, user, hookid):
headers
=
{
headers
=
{
'Authorization'
:
'Basic
%
s'
%
auth
,
'Authorization'
:
'Basic
%
s'
%
auth
,
}
}
response
,
info
=
fetch_url
(
module
,
url
,
data
=
data
,
headers
=
headers
,
method
=
'DELETE'
,
validate_certs
=
module
.
params
[
'validate_certs'
]
)
response
,
info
=
fetch_url
(
module
,
url
,
data
=
data
,
headers
=
headers
,
method
=
'DELETE'
)
return
response
.
read
()
return
response
.
read
()
def
main
():
def
main
():
...
...
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