From 09cb6963f07e4b0a4eebcbdb1199e5683a332b64 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 29 Jan 2019 16:02:54 -0500 Subject: [PATCH 1/3] Add attempt to present status data tcons made this attempt, also implement this on a best effort basis. --- confluent_client/bin/nodeconsole | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodeconsole b/confluent_client/bin/nodeconsole index 257b0b68..31e45ad0 100755 --- a/confluent_client/bin/nodeconsole +++ b/confluent_client/bin/nodeconsole @@ -40,6 +40,7 @@ if len(args) != 1: argparser.print_help() sys.exit(1) if options.tile: + null = open('/dev/null', 'w') nodes = [] sess = client.Command() for res in sess.read('/noderange/{0}/nodes/'.format(args[0])): @@ -60,13 +61,15 @@ if options.tile: confettypath, node)]) else: subprocess.call(['tmux', 'select-pane', '-t', str(pane)]) + subprocess.call(['tmux', 'set-option', 'pane-border-status', 'top'], stderr=null) pane += 1 subprocess.call( ['tmux', 'split', '-h', '{0} -m 5 start /nodes/{1}/console/session'.format( confettypath, node)]) - subprocess.call(['tmux', 'select-layout', 'tiled']) + subprocess.call(['tmux', 'select-layout', 'tiled'], stdout=null) subprocess.call(['tmux', 'select-pane', '-t', '0']) + subprocess.call(['tmux', 'set-option', 'pane-border-status', 'top'], stderr=null) os.execlp('tmux', 'tmux', 'attach', '-t', 'nodeconsole_{0}'.format( os.getpid())) else: From 8a5f1c6dc59b5cd34d78e362437f6e6eaa4163ce Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 30 Jan 2019 09:50:31 -0500 Subject: [PATCH 2/3] Parse string arguments to nodes attributes as noderange Since everywhere else accepts noderange, it is a reasonable expectation for the nodes attribute on nodegroups to also take a noderange. Correct this inconsistency. --- .../confluent/config/configmanager.py | 17 ++++++++++------- .../confluent/discovery/protocols/slp.py | 2 ++ .../plugins/configuration/attributes.py | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 4fcc0b71..9719e173 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -1,7 +1,7 @@ 7# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 IBM Corporation -# Copyright 2015-2018 Lenovo +# Copyright 2015-2019 Lenovo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1515,17 +1515,20 @@ class ConfigManager(object): currnodes = list(self.get_nodegroup_attributes( group, ['nodes']).get('nodes', [])) if attribmap[group][attr].get('prepend', False): - newnodes = attribmap[group][attr][ - 'prepend'].split(',') - attribmap[group][attr] = newnodes + currnodes + newnodes = noderange.NodeRange(attribmap[group][attr][ + 'prepend'], config=self).nodes + attribmap[group][attr] = list( + newnodes) + currnodes elif attribmap[group][attr].get('remove', False): - delnodes = attribmap[group][attr][ - 'remove'].split(',') + delnodes = noderange.NodeRange( + attribmap[group][attr]['remove'], + config=self).nodes attribmap[group][attr] = [ x for x in currnodes if x not in delnodes] if not isinstance(attribmap[group][attr], list): if type(attribmap[group][attr]) is unicode or type(attribmap[group][attr]) is str: - attribmap[group][attr]=attribmap[group][attr].split(",") + attribmap[group][attr] = noderange.NodeRange( + attribmap[group][attr], config=self).nodes else: raise ValueError("nodes attribute on group must be list") for node in attribmap[group]['nodes']: diff --git a/confluent_server/confluent/discovery/protocols/slp.py b/confluent_server/confluent/discovery/protocols/slp.py index 77e642e1..ae44d955 100644 --- a/confluent_server/confluent/discovery/protocols/slp.py +++ b/confluent_server/confluent/discovery/protocols/slp.py @@ -199,6 +199,8 @@ def _find_srvtype(net, net4, srvtype, addresses, xid): net4.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) v6addrs = [] v6hash = _v6mcasthash(srvtype) + print(repr(srvtype)) + print(repr(v6hash)) # do 'interface local' and 'link local' # it shouldn't make sense, but some configurations work with interface # local that do not work with link local diff --git a/confluent_server/confluent/plugins/configuration/attributes.py b/confluent_server/confluent/plugins/configuration/attributes.py index 373397c8..e16dad19 100644 --- a/confluent_server/confluent/plugins/configuration/attributes.py +++ b/confluent_server/confluent/plugins/configuration/attributes.py @@ -1,5 +1,5 @@ # Copyright 2014 IBM Corporation -# Copyright 2017 Lenovo +# Copyright 2017-2019 Lenovo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 085981f74c8ced45ae4fed92281803d82932cb40 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 30 Jan 2019 13:45:38 -0500 Subject: [PATCH 3/3] Remove spurious debug output Some spurious debug output was injected by mistake. --- confluent_server/confluent/discovery/protocols/slp.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/confluent_server/confluent/discovery/protocols/slp.py b/confluent_server/confluent/discovery/protocols/slp.py index ae44d955..77e642e1 100644 --- a/confluent_server/confluent/discovery/protocols/slp.py +++ b/confluent_server/confluent/discovery/protocols/slp.py @@ -199,8 +199,6 @@ def _find_srvtype(net, net4, srvtype, addresses, xid): net4.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) v6addrs = [] v6hash = _v6mcasthash(srvtype) - print(repr(srvtype)) - print(repr(v6hash)) # do 'interface local' and 'link local' # it shouldn't make sense, but some configurations work with interface # local that do not work with link local