2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-21 17:11:58 +00:00

Add facility to fix confluent uuid problem

This commit is contained in:
Jarrod Johnson 2022-09-01 13:26:25 -04:00
parent b98759698a
commit d1d15f29c1
2 changed files with 5 additions and 4 deletions

View File

@ -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,

View File

@ -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: