mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix a potential Exception with an explicit error message
if sign_remote_certificate is not authorized on master, execution fail with explicite error.
This commit is contained in:
parent
c91a5e539e
commit
0b548c72e1
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