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
5a70ca03
Commit
5a70ca03
authored
9 years ago
by
Manuela Kuhn
Browse files
Options
Downloads
Patches
Plain Diff
Ability to handle hostnames in whitelist regarding .desy.de
parent
a7764013
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
src/ZeroMQTunnel/FileMover.py
+12
-2
12 additions, 2 deletions
src/ZeroMQTunnel/FileMover.py
src/sender.py
+18
-19
18 additions, 19 deletions
src/sender.py
with
30 additions
and
21 deletions
src/ZeroMQTunnel/FileMover.py
+
12
−
2
View file @
5a70ca03
...
...
@@ -60,7 +60,14 @@ class FileMover():
self
.
ondaIps
=
ondaIps
self
.
ondaPorts
=
ondaPorts
self
.
receiverWhiteList
=
receiverWhiteList
#remove .desy.de from hostnames
self
.
receiverWhiteList
=
[]
for
host
in
receiverWhiteList
:
if
host
.
endswith
(
"
.desy.de
"
):
self
.
receiverWhiteList
.
append
(
host
[:
-
8
])
else
:
self
.
receiverWhiteList
.
append
(
host
)
self
.
parallelDataStreams
=
parallelDataStreams
self
.
chunkSize
=
chunkSize
...
...
@@ -182,8 +189,11 @@ class FileMover():
self
.
receiverComSocket
.
send
(
"
NO_VALID_SIGNAL
"
,
zmq
.
NOBLOCK
)
continue
if
signalHostname
.
endswith
(
"
.desy.de
"
):
signalHostnameModified
=
signalHostname
[:
-
8
]
self
.
log
.
debug
(
"
Check if signal sending host is in WhiteList...
"
)
if
signalHostname
in
self
.
receiverWhiteList
:
if
signalHostname
in
self
.
receiverWhiteList
or
signalHostnameModified
in
self
.
receiverWhiteList
:
self
.
log
.
info
(
"
Check if signal sending host is in WhiteList...Host
"
+
str
(
signalHostname
)
+
"
is allowed to connect.
"
)
else
:
self
.
log
.
info
(
"
Check if signal sending host is in WhiteList...Host
"
+
str
(
signalHostname
)
+
"
is not allowed to connect.
"
)
...
...
This diff is collapsed.
Click to expand it.
src/sender.py
+
18
−
19
View file @
5a70ca03
...
...
@@ -121,25 +121,24 @@ class Sender():
logging
.
info
(
"
Keyboard interruption detected. Shutting down
"
)
# except Exception, e:
# print "unknown exception detected."
logging
.
debug
(
"
shutting down zeromq...
"
)
try
:
fileMover
.
stop
()
logging
.
debug
(
"
shutting down zeromq...done.
"
)
except
:
logging
.
error
(
sys
.
exc_info
())
logging
.
error
(
"
shutting down zeromq...failed.
"
)
# give the other processes time to close the sockets
time
.
sleep
(
0.1
)
try
:
logging
.
debug
(
"
closing zmqContext...
"
)
self
.
zmqContext
.
destroy
()
logging
.
debug
(
"
closing zmqContext...done.
"
)
except
:
logging
.
debug
(
"
closing zmqContext...failed.
"
)
logging
.
error
(
sys
.
exc_info
())
finally
:
logging
.
debug
(
"
shutting down zeromq...
"
)
try
:
fileMover
.
stop
()
logging
.
debug
(
"
shutting down zeromq...done.
"
)
except
:
logging
.
error
(
sys
.
exc_info
())
logging
.
error
(
"
shutting down zeromq...failed.
"
)
# give the other processes time to close the sockets
time
.
sleep
(
0.1
)
try
:
logging
.
debug
(
"
closing zmqContext...
"
)
self
.
zmqContext
.
destroy
()
logging
.
debug
(
"
closing zmqContext...done.
"
)
except
:
logging
.
debug
(
"
closing zmqContext...failed.
"
)
logging
.
error
(
sys
.
exc_info
())
...
...
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