Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
slapos
Commits
0353d07a
Commit
0353d07a
authored
Apr 21, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor-bootstrap: backward compatibility with older python
parent
b171c34f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
stack/monitor/buildout.cfg
stack/monitor/buildout.cfg
+1
-1
stack/monitor/scripts/monitor.py
stack/monitor/scripts/monitor.py
+8
-3
No files found.
stack/monitor/buildout.cfg
View file @
0353d07a
...
@@ -130,7 +130,7 @@ depends =
...
@@ -130,7 +130,7 @@ depends =
[monitor2-bin]
[monitor2-bin]
<= monitor-template-script
<= monitor-template-script
filename = monitor.py
filename = monitor.py
md5sum =
222365a469f8ab08a0367d81c0b03982
md5sum =
31beec15d3c3cd7979d04ecb834c439a
[run-promise-py]
[run-promise-py]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
...
...
stack/monitor/scripts/monitor.py
View file @
0353d07a
...
@@ -222,13 +222,18 @@ class Monitoring(object):
...
@@ -222,13 +222,18 @@ class Monitoring(object):
def
getMonitorTitleFromUrl
(
self
,
monitor_url
):
def
getMonitorTitleFromUrl
(
self
,
monitor_url
):
# This file should be generated
# This file should be generated
if
not
monitor_url
.
startswith
(
'https://'
)
and
not
monitor_url
.
startswith
(
'http://'
):
if
not
monitor_url
.
startswith
(
'https://'
)
and
not
monitor_url
.
startswith
(
'http://'
):
return
'Unknow Instance'
return
'Unknow
n
Instance'
if
not
monitor_url
.
endswith
(
'/'
):
if
not
monitor_url
.
endswith
(
'/'
):
monitor_url
=
monitor_url
+
'/'
monitor_url
=
monitor_url
+
'/'
context
=
ssl
.
_create_unverified_context
()
url
=
monitor_url
+
'/.jio_documents/monitor.global.json'
# XXX Hard Coded path
url
=
monitor_url
+
'/.jio_documents/monitor.global.json'
# XXX Hard Coded path
try
:
try
:
response
=
urllib2
.
urlopen
(
url
,
context
=
context
)
# XXX - working here with public url
if
hasattr
(
ssl
,
'_create_unverified_context'
):
context
=
ssl
.
_create_unverified_context
()
response
=
urllib2
.
urlopen
(
url
,
context
=
context
)
else
:
response
=
urllib2
.
urlopen
(
url
)
except
urllib2
.
HTTPError
:
except
urllib2
.
HTTPError
:
return
'Unknow Instance'
return
'Unknow Instance'
else
:
else
:
...
...
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