Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/remote_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def register_v2(details):
elif success == util.CertProcessingResult.CERT_UPDATED:
logging.debug("Successfully updated registration with %s (%s:%d) - api version 2"
% (details.hostname, details.ip_info, details.auth_port))
elif success == util.CertProcessingResult.CERT_UPDATED:
elif success == util.CertProcessingResult.CERT_UP_TO_DATE:
logging.debug("Certificate already up to date, nothing to do for %s (%s:%d) - api version 2"
% (details.hostname, details.ip_info, details.auth_port))
return success
Expand Down
5 changes: 4 additions & 1 deletion src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def add_service(self, zeroconf, _type, name):
return

cert_result = util.CertProcessingResult.FAILURE
newly_discovered = False
try:
machine = self.remote_machines[ident]
# Known remote machine
Expand Down Expand Up @@ -236,6 +237,7 @@ def add_service(self, zeroconf, _type, name):
machine.api_version = api_version
except KeyError:
# New remote machine
newly_discovered = True
display_hostname = self.ensure_unique_hostname(remote_hostname)

logging.info(">>> Discovery: new remote: %s (%s:%d)"
Expand Down Expand Up @@ -263,7 +265,8 @@ def add_service(self, zeroconf, _type, name):

machine.has_zc_presence = True

if cert_result in (util.CertProcessingResult.CERT_INSERTED, util.CertProcessingResult.CERT_UPDATED):
if cert_result in (util.CertProcessingResult.CERT_INSERTED, util.CertProcessingResult.CERT_UPDATED) or \
(cert_result == util.CertProcessingResult.CERT_UP_TO_DATE and (newly_discovered or machine.status == RemoteStatus.OFFLINE)):
machine.shutdown() # This does nothing if run more than once. It's here to make sure
# the previous start thread is complete before starting a new one.
# This is needed in the corner case where the remote has gone offline,
Expand Down
Loading