2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-10 15:55:27 +00:00

Revert "Provide fallback for unexpected reply in collective show"

This reverts commit 2f566fb81ddfdd14b3b623ee6d1ff48d67e636b4.
This commit is contained in:
Jarrod Johnson 2018-10-10 09:44:06 -04:00
parent 2f566fb81d
commit cf9d2a43e8
2 changed files with 11 additions and 12 deletions

View File

@ -68,7 +68,7 @@ def join_collective(server, invitation):
res = tlvdata.recv(s)
res = res.get('collective',
{'status': 'Unknown response: ' + repr(res)})
print(res.get('status', res.get('error', repr(res))))
print(res.get('status', res['error']))
def show_collective():

View File

@ -63,7 +63,6 @@ import eventlet
import eventlet.event as event
import eventlet.green.select as select
import eventlet.green.threading as gthread
import eventlet.greenpool as gpool
import fnmatch
import json
import operator
@ -948,7 +947,7 @@ class ConfigManager(object):
os.getenv('SystemDrive'), '\\ProgramData', 'confluent', 'cfg')
else:
_cfgdir = "/etc/confluent/cfg"
_cfgwriter = gpool.GreenPool(1)
_cfgwriter = None
_writepending = False
_syncrunning = False
_syncstate = threading.RLock()
@ -2046,9 +2045,11 @@ class ConfigManager(object):
@classmethod
def wait_for_sync(cls, fullsync=False):
cls._cfgwriter.waitall()
if cls._cfgwriter is not None:
cls._cfgwriter.join()
cls._bg_sync_to_file(fullsync)
cls._cfgwriter.waitall()
if cls._cfgwriter is not None:
cls._cfgwriter.join()
@classmethod
def shutdown(cls):
@ -2064,13 +2065,11 @@ class ConfigManager(object):
cls._writepending = True
return
cls._syncrunning = True
cls._cfgwriter.spawn_n(cls._g_sync_to_file, fullsync)
@classmethod
def _g_sync_to_file(cls, fullsync):
cls._sync_to_file(fullsync)
# if the thread is exiting, join it to let it close, just in case
if cls._cfgwriter is not None:
cls._cfgwriter.join()
cls._cfgwriter = threading.Thread(target=cls._sync_to_file, args=(fullsync,))
cls._cfgwriter.start()
@classmethod
def _sync_to_file(cls, fullsync=False):