mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Suppress output of crypt context and be more specifc with whitespace vs. serial
This commit is contained in:
parent
61f817d172
commit
8ee48432f4
1 changed files with 2 additions and 2 deletions
|
@ -42,10 +42,10 @@ def get_cert_serial(cert_file):
|
|||
|
||||
salt '*' certutil.get_cert_serial <certificate name>
|
||||
'''
|
||||
cmd = "certutil.exe -verify {0}".format(cert_file)
|
||||
cmd = "certutil.exe -silent -verify {0}".format(cert_file)
|
||||
out = __salt__['cmd.run'](cmd)
|
||||
# match serial number by paragraph to work with multiple languages
|
||||
matches = re.search(r":\w*(.*)\r\n\r\n", out)
|
||||
matches = re.search(r":\s*(\w*)\r\n\r\n", out)
|
||||
if matches is not None:
|
||||
return matches.groups()[0].strip()
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue