Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
cam
Commits
1c063489
Commit
1c063489
authored
Feb 06, 2012
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print expiration dates in the "list" command
parent
f054c992
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
cam/main.py
cam/main.py
+11
-1
No files found.
cam/main.py
View file @
1c063489
...
...
@@ -87,8 +87,18 @@ def main():
print
c
.
public_key_file
print
c
.
private_key_file
elif
cmd
==
'list'
:
now
=
time
.
time
()
for
cert
in
sorted
(
certs
,
key
=
lambda
x
:
x
.
name
):
print
cert
.
name
,
cert
.
cn
,
cert
.
get_expiration_date
()
expiry
=
cert
.
get_expiration_date
()
state
=
'OK'
expiry_str
=
''
if
not
expiry
:
state
=
'MISSING'
else
:
if
expiry
<
now
:
state
=
'EXPIRED'
expiry_str
=
time
.
strftime
(
'%Y/%m/%d'
,
time
.
gmtime
(
expiry
))
print
cert
.
name
,
cert
.
cn
,
state
,
expiry_str
elif
cmd
==
'fp'
or
cmd
==
'fingerprint'
:
if
len
(
args
)
>
0
:
certs
=
[
find_cert
(
certs
,
x
)
for
x
in
args
]
...
...
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