2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-26 19:10:30 +00:00

More python 3 compatibility fixes

Improve more commands and modules to parse and execute under python 3.
This commit is contained in:
Jarrod Johnson 2019-06-28 08:51:57 -04:00
parent 6d5f0cdb16
commit 81c0adbbe3
3 changed files with 6 additions and 4 deletions

View File

@ -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 <noderange>")
(options, args) = argparser.parse_args()

View File

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

View File

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