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
56813c03
Commit
56813c03
authored
Jun 25, 2013
by
Curtis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup appearances of config_directory, remove slash, remove hardcoded /etc/bprobe
parent
445c8884
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
library/monitoring/boundary_meter
+3
-3
No files found.
library/monitoring/boundary_meter
View file @
56813c03
...
@@ -149,7 +149,7 @@ def create_meter(module, name, apiid, apikey):
...
@@ -149,7 +149,7 @@ def create_meter(module, name, apiid, apikey):
for
cert_type
in
types
:
for
cert_type
in
types
:
try
:
try
:
# If we can't open the file it's not there, so we should download it
# If we can't open the file it's not there, so we should download it
cert_file
=
open
(
'
/etc/bprobe/{cert_type}.pem'
.
format
(
cert_type
=
cert_type
))
cert_file
=
open
(
'
{config_directory}/{cert_type}.pem'
.
format
(
config_directory
=
config_directory
,
cert_type
=
cert_type
))
except
IOError
:
except
IOError
:
# Now download the file...
# Now download the file...
rc
=
download_request
(
module
,
name
,
apiid
,
apikey
,
cert_type
)
rc
=
download_request
(
module
,
name
,
apiid
,
apikey
,
cert_type
)
...
@@ -201,7 +201,7 @@ def delete_meter(module, name, apiid, apikey):
...
@@ -201,7 +201,7 @@ def delete_meter(module, name, apiid, apikey):
types
=
[
'cert'
,
'key'
]
types
=
[
'cert'
,
'key'
]
for
cert_type
in
types
:
for
cert_type
in
types
:
try
:
try
:
cert_file
=
'
/
{config_directory}/{cert_type}.pem'
.
format
(
config_directory
=
config_directory
,
cert_type
=
cert_type
)
cert_file
=
'{config_directory}/{cert_type}.pem'
.
format
(
config_directory
=
config_directory
,
cert_type
=
cert_type
)
os
.
remove
(
cert_file
)
os
.
remove
(
cert_file
)
except
OSError
,
e
:
## if failed, report it back to the user ##
except
OSError
,
e
:
## if failed, report it back to the user ##
module
.
fail_json
(
"Failed to remove "
+
cert_type
+
".pem file"
)
module
.
fail_json
(
"Failed to remove "
+
cert_type
+
".pem file"
)
...
@@ -223,7 +223,7 @@ def download_request(module, name, apiid, apikey, cert_type):
...
@@ -223,7 +223,7 @@ def download_request(module, name, apiid, apikey, cert_type):
if
result
:
if
result
:
try
:
try
:
cert_file_path
=
'
/
{config_directory}/{cert_type}.pem'
.
format
(
config_directory
=
config_directory
,
cert_type
=
cert_type
)
cert_file_path
=
'{config_directory}/{cert_type}.pem'
.
format
(
config_directory
=
config_directory
,
cert_type
=
cert_type
)
body
=
result
.
read
()
body
=
result
.
read
()
cert_file
=
open
(
cert_file_path
,
'w'
)
cert_file
=
open
(
cert_file_path
,
'w'
)
cert_file
.
write
(
body
)
cert_file
.
write
(
body
)
...
...
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