]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
tools/checkcerts.py: pretty up the output a bit for reading ease 743/head
authorDan Mick <dmick@redhat.com>
Wed, 21 Jun 2023 04:08:41 +0000 (21:08 -0700)
committerDan Mick <dmick@redhat.com>
Wed, 21 Jun 2023 04:21:05 +0000 (21:21 -0700)
Signed-off-by: Dan Mick <dmick@redhat.com>
tools/checkcerts.py

index d4d5da7c52e7f4894bbff715a66dbebb3ae5731f..e0d3efcddbd9d5f14e72abad035b8c25484c9c9b 100755 (executable)
@@ -98,11 +98,12 @@ def main():
         now = datetime.datetime.utcnow()
         left = expire - now
 
+        leftstr = f'{domain:30s} cert: {str(left).rsplit(".",1)[0]} left until it expires'
         if not args.quiet:
-            print(f'{domain}\'s cert has {left} left', file=sys.stderr)
+            print(leftstr, file=sys.stderr)
         if left < warn and args.email:
             subject = f'{domain}\'s SSL Cert is expiring soon.'
-            body = f'{domain}\'s SSL cert has {left} left until it expires'
+            body = leftstr
             email = args.email
             if email == []:
                 email = DEFAULT_EMAIL