except IOError:
logging.info("No old certificate available.")
+ last_exception = None
for _ in range(self._MAX_NUM_RETRIES):
try:
# Technically it should not be necessary to set the cert
client_cert_tmp=pathutils.NODED_CLIENT_CERT_FILE_TMP)
break
except errors.OpExecError as e:
- pass
+ last_exception = e
else:
- feedback_fn("Could not renew the master's client SSL certificate."
- " Cleaning up. Error: %s." % e)
+ if last_exception:
+ feedback_fn("Could not renew the master's client SSL certificate."
+ " Cleaning up. Error: %s." % last_exception)
# Cleaning up temporary certificates
utils.RemoveNodeFromCandidateCerts("%s-SERVER" % master_uuid,
cluster.candidate_certs)
feedback_fn("* Skipping offline node %s" % node_info.name)
continue
if node_uuid != master_uuid:
+ last_exception = None
for _ in range(self._MAX_NUM_RETRIES):
try:
new_digest = CreateNewClientCert(self, node_uuid)
new_digest,
cluster.candidate_certs)
break
- except errors.OpExecError as last_exception:
- pass
+ except errors.OpExecError as e:
+ last_exception = e
else:
if last_exception:
node_errors[node_uuid] = last_exception