From d1d15f29c1b10c64e6cae21e994b39fdbadc2ad7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 1 Sep 2022 13:26:25 -0400 Subject: [PATCH] Add facility to fix confluent uuid problem --- confluent_server/confluent/core.py | 4 ++++ misc/checkconfluent | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 718dcc52..a2316b3d 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -1246,6 +1246,10 @@ def handle_path(path, operation, configmanager, inputdata=None, autostrip=True): elif pathcomponents[0] == 'version': return (msg.Attributes(kv={'version': confluent.__version__}),) elif pathcomponents[0] == 'uuid': + if operation == 'update': + with open('/var/lib/confluent/public/site/confluent_uuid', 'r') as uuidf: + fsuuid = uuidf.read().strip() + cfm.set_global('confluent_uuid', fsuuid) return (msg.Attributes(kv={'uuid': cfm.get_global('confluent_uuid')}),) elif pathcomponents[0] == 'usergroups': # TODO: when non-administrator accounts exist, diff --git a/misc/checkconfluent b/misc/checkconfluent index 141c8401..d7d38f01 100644 --- a/misc/checkconfluent +++ b/misc/checkconfluent @@ -1,6 +1,4 @@ #!/usr/bin/python3 -# frequent problems to check/repair -# repair would be to set the uuid global to match filesystem for least disruptive change import os import socket @@ -137,8 +135,7 @@ if __name__ == '__main__': if uuid_matches(): print('Consistent') else: - #TODO: need a resolution to suggest - emprint('Inconsistent between confluent database and /var/lib/confluent') + emprint('Inconsistent between confluent database and /var/lib/confluent (Example resolution: confetty set /uuid resync=1)') fprint('Web Server: ') conn = webserver_listening() if conn: