diff --git a/confluent_client/bin/nodehealth b/confluent_client/bin/nodehealth index f758431c..1896c18e 100755 --- a/confluent_client/bin/nodehealth +++ b/confluent_client/bin/nodehealth @@ -32,7 +32,8 @@ if path.startswith('/opt'): import confluent.client as client -sys.stdout = codecs.getwriter('utf8')(sys.stdout) +if sys.version_info[0] < 3: + sys.stdout = codecs.getwriter('utf8')(sys.stdout) argparser = optparse.OptionParser(usage="Usage: %prog ") (options, args) = argparser.parse_args() diff --git a/confluent_client/bin/nodeinventory b/confluent_client/bin/nodeinventory index 95e1c7b0..2be1fe27 100755 --- a/confluent_client/bin/nodeinventory +++ b/confluent_client/bin/nodeinventory @@ -34,7 +34,8 @@ if path.startswith('/opt'): import confluent.client as client -sys.stdout = codecs.getwriter('utf8')(sys.stdout) +if sys.version_info[0] < 3: + sys.stdout = codecs.getwriter('utf8')(sys.stdout) filters = [] @@ -145,7 +146,7 @@ try: databynode[node] = {} databynode[node][prefix] = inv else: - print '{0}: {1}: Not Present'.format(node, prefix) + print('{0}: {1}: Not Present'.format(node, prefix)) continue info = inv['information'] info.pop('board_extra', None) diff --git a/confluent_server/confluent/main.py b/confluent_server/confluent/main.py index 4b904471..67d0db2f 100644 --- a/confluent_server/confluent/main.py +++ b/confluent_server/confluent/main.py @@ -237,7 +237,7 @@ def run(): signal.signal(signal.SIGTERM, terminate) collective.startup() if dbgif: - oumask = os.umask(0077) + oumask = os.umask(0o077) try: os.remove('/var/run/confluent/dbg.sock') except OSError: