mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #42484 from shengis/fix-explicit-error-msg-x509-sign-remote
Fix a potential Exception with an explicit error message
This commit is contained in:
commit
df417eae17
1 changed files with 11 additions and 2 deletions
|
@ -1373,10 +1373,19 @@ def create_certificate(
|
|||
['listen_in', 'preqrequired', '__prerequired__']:
|
||||
kwargs.pop(ignore, None)
|
||||
|
||||
cert_txt = __salt__['publish.publish'](
|
||||
certs = __salt__['publish.publish'](
|
||||
tgt=ca_server,
|
||||
fun='x509.sign_remote_certificate',
|
||||
arg=str(kwargs))[ca_server]
|
||||
arg=str(kwargs))
|
||||
|
||||
if not any(certs):
|
||||
raise salt.exceptions.SaltInvocationError(
|
||||
'ca_server did not respond'
|
||||
' salt master must permit peers to'
|
||||
' call the sign_remote_certificate function.')
|
||||
|
||||
cert_txt = certs[ca_server]
|
||||
|
||||
if path:
|
||||
return write_pem(
|
||||
text=cert_txt,
|
||||
|
|
Loading…
Add table
Reference in a new issue