Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Justin
slapos.toolbox
Commits
3f24877e
Commit
3f24877e
authored
Jan 09, 2020
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: Support python 3.7+
os.errno does not exists since python 3.7
parent
c3eeed9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
slapos/monitor/monitor.py
slapos/monitor/monitor.py
+7
-3
No files found.
slapos/monitor/monitor.py
View file @
3f24877e
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
from
__future__
import
print_function
from
__future__
import
print_function
import
sys
import
sys
try
:
import
errno
except
ImportError
:
from
os
import
errno
import
os
import
os
import
stat
import
stat
import
json
import
json
...
@@ -53,7 +57,7 @@ def mkdirAll(path):
...
@@ -53,7 +57,7 @@ def mkdirAll(path):
try
:
try
:
os
.
makedirs
(
path
)
os
.
makedirs
(
path
)
except
OSError
as
e
:
except
OSError
as
e
:
if
e
.
errno
==
os
.
errno
.
EEXIST
and
os
.
path
.
isdir
(
path
):
if
e
.
errno
==
errno
.
EEXIST
and
os
.
path
.
isdir
(
path
):
pass
pass
else
:
raise
else
:
raise
...
@@ -67,7 +71,7 @@ def createSymlink(source, destination):
...
@@ -67,7 +71,7 @@ def createSymlink(source, destination):
try
:
try
:
os
.
symlink
(
source
,
destination
)
os
.
symlink
(
source
,
destination
)
except
OSError
as
e
:
except
OSError
as
e
:
if
e
.
errno
!=
os
.
errno
.
EEXIST
:
if
e
.
errno
!=
errno
.
EEXIST
:
raise
raise
class
Monitoring
(
object
):
class
Monitoring
(
object
):
...
@@ -201,7 +205,7 @@ class Monitoring(object):
...
@@ -201,7 +205,7 @@ class Monitoring(object):
mkdirAll
(
dirname
)
# could also raise OSError
mkdirAll
(
dirname
)
# could also raise OSError
os
.
symlink
(
path
,
os
.
path
.
join
(
dirname
,
os
.
path
.
basename
(
path
)))
os
.
symlink
(
path
,
os
.
path
.
join
(
dirname
,
os
.
path
.
basename
(
path
)))
except
OSError
as
e
:
except
OSError
as
e
:
if
e
.
errno
!=
os
.
errno
.
EEXIST
:
if
e
.
errno
!=
errno
.
EEXIST
:
raise
raise
def
getMonitorTitleFromUrl
(
self
,
monitor_url
):
def
getMonitorTitleFromUrl
(
self
,
monitor_url
):
...
...
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