Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CastorScript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
atlas-tdaq-software
CastorScript
Commits
e3a52914
There was a problem fetching the pipeline summary.
Commit
e3a52914
authored
7 years ago
by
Fabrice Le Goff
Browse files
Options
Downloads
Patches
Plain Diff
do not crash when klist fails
parent
01a0f534
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Script/CastorScript.py
+9
-1
9 additions, 1 deletion
Script/CastorScript.py
with
9 additions
and
1 deletion
Script/CastorScript.py
+
9
−
1
View file @
e3a52914
...
@@ -353,16 +353,24 @@ def krb_tokenexpiration(logger):
...
@@ -353,16 +353,24 @@ def krb_tokenexpiration(logger):
klist
=
subprocess
.
Popen
([
'
klist
'
,],
env
=
envm
,
stdout
=
subprocess
.
PIPE
,
klist
=
subprocess
.
Popen
([
'
klist
'
,],
env
=
envm
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stderr
=
subprocess
.
STDOUT
)
ret
=
klist
.
wait
()
ret
=
klist
.
wait
()
out
=
klist
.
stdout
.
read
()
out
=
klist
.
stdout
.
read
()
logger
.
debug
(
'
klist done. Return code: %d Output: %s
'
%
(
ret
,
out
))
logger
.
debug
(
'
klist done. Return code: %d Output: %s
'
%
(
ret
,
out
))
if
ret
:
self
.
logger
.
critical
(
'
klist failed: retcode=%s, output=%s
'
,
str
(
ret
),
out
)
return
datetime
.
datetime
(
1970
,
1
,
1
)
ticket
=
None
out
=
out
.
split
(
'
\n
'
)
out
=
out
.
split
(
'
\n
'
)
for
idx
,
l
in
enumerate
(
out
):
for
idx
,
l
in
enumerate
(
out
):
if
'
Valid
'
in
l
:
if
'
Valid
'
in
l
:
ticket
=
out
[
idx
+
1
]
ticket
=
out
[
idx
+
1
]
break
break
if
ticket
is
None
:
self
.
logger
.
critical
(
'
error parsing klist output: output=%s
'
,
out
)
return
datetime
.
datetime
(
1970
,
1
,
1
)
ticket
=
ticket
.
split
()
ticket
=
ticket
.
split
()
logger
.
debug
(
'
Ticket expiration: %s
'
%
ticket
)
logger
.
debug
(
'
Ticket expiration: %s
'
%
ticket
)
return
datetime
.
datetime
.
strptime
(
'
'
.
join
(
ticket
[
2
:
4
]),
\
return
datetime
.
datetime
.
strptime
(
'
'
.
join
(
ticket
[
2
:
4
]),
\
...
...
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