Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hidra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steinbac
hidra
Commits
853b7795
Commit
853b7795
authored
9 years ago
by
Manuela Kuhn
Browse files
Options
Downloads
Patches
Plain Diff
Added watchdog option to config
parent
59861e28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conf/dataManager.conf
+4
-1
4 additions, 1 deletion
conf/dataManager.conf
src/shared/helperScript.py
+8
-21
8 additions, 21 deletions
src/shared/helperScript.py
with
12 additions
and
22 deletions
conf/dataManager.conf
+
4
−
1
View file @
853b7795
...
...
@@ -9,7 +9,8 @@ localTarget = /space/projects/live-viewer/data/target
#localTarget = /gpfs
# Type of event detector to use (options are: inotifyx)
eventDetectorType
=
inotifyx
#eventDetectorType = inotifyx
eventDetectorType
=
watchdog
# Event type of files to be monitored (options are: "IN_CLOSE_WRITE", "IN_MOVED_TO", ...)
monitoredEventType
=
IN_CLOSE_WRITE
#monitoredEventType = IN_MOVED_TO
...
...
@@ -17,6 +18,8 @@ monitoredEventType = IN_CLOSE_WRITE
monitoredSubdirs
= [
"commissioning"
,
"current"
,
"local"
]
# The formats to be monitored, files in an other format will be be neglected
monitoredFormats
= [
".tif"
,
".cbf"
]
# Time (in seconds) since last modification after which a file will be seen as closed
timeTillClosed
=
2
# List of hosts allowed to connect
whitelist
= [
"localhost"
,
"zitpcx19282"
,
"zitpcx22614"
,
"haspp11eval01"
,
"it-hpc-cxi03"
]
...
...
This diff is collapsed.
Click to expand it.
src/shared/helperScript.py
+
8
−
21
View file @
853b7795
...
...
@@ -88,6 +88,7 @@ class FakeSecHead(object):
else
:
return
self
.
fp
.
readline
()
# http://code.activestate.com/recipes/541096-prompt-the-user-for-confirmation/
def
confirm
(
prompt
=
None
,
resp
=
False
):
"""
prompts for yes or no response from the user. Returns True for yes and
...
...
@@ -140,7 +141,6 @@ def confirm(prompt=None, resp=False):
def
checkEventDetectorType
(
eDType
,
supportedTypes
):
#check if directory is empty
if
eDType
in
supportedTypes
:
logging
.
debug
(
"
Event detector
'"
+
eDType
+
"'
is ok.
"
)
else
:
...
...
@@ -168,14 +168,8 @@ def checkDirEmpty(dirPath):
logging
.
info
(
"
All elements of directory
"
+
str
(
dirPath
)
+
"
were removed.
"
)
def
checkSubDirExistance
(
dirPath
,
subDirs
):
"""
abort if dir does not exist
:return:
"""
dirPath
=
os
.
path
.
normpath
(
dirPath
)
dirsToCheck
=
[
dirPath
+
os
.
sep
+
directory
for
directory
in
subDirs
]
noSubdir
=
True
...
...
@@ -192,29 +186,22 @@ def checkSubDirExistance(dirPath, subDirs):
def
checkDirExistance
(
dirPath
):
"""
abort if dir does not exist
:return:
"""
# Check directory path for existance.
# Exits if it does not exist
#check directory path for existance. exits if it does not exist
if
not
os
.
path
.
exists
(
dirPath
):
logging
.
error
(
"
Dir
'
%s
'
does not exist. Abort.
"
%
str
(
dirPath
))
sys
.
exit
(
1
)
def
checkLogFileWritable
(
filepath
,
filename
):
#
error
if logfile cannot be written
#
Exits
if logfile cannot be written
try
:
fullPath
=
os
.
path
.
join
(
filepath
,
filename
)
logFile
=
open
(
fullPath
,
"
a
"
)
log
fullPath
=
os
.
path
.
join
(
filepath
,
filename
)
logFile
=
open
(
log
fullPath
,
"
a
"
)
except
:
print
"
Unable to create the logfile
"""
+ str(fullPath)
print
"""
Please specify a new target by setting the following arguments:
--logfileName
--logfilePath
"""
print
"
Unable to create the logfile
"
+
str
(
logfullPath
)
print
"
Please specify a new target by setting the following arguments:
\n
--logfileName
\n
--logfilePath
"
sys
.
exit
(
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment