Skip to content

Loading…

Change file handle for legacy #2

Merged
merged 1 commit into from

2 participants

@kristopherkane

Changed the file handler to the traditional open - try/finally to support deployments to RHEL 5 on Python 2.4

@kristopherkane

Should have said that I tested this on Python 2.4 and 2.6, RHEL 5 and 6 respectively with Zookeeper from CDH 3.

@phunt phunt merged commit 843ca60 into phunt:master
@phunt
Owner

Looks good, thanks Kristopher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 17, 2012
  1. changed with to try/finally for py 2.4

    root committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 zktop.py
View
5 zktop.py
@@ -329,8 +329,11 @@ def sigwinch_handler(*nada):
resized_sig = True
def read_zk_config(filename):
- with open(filename) as f:
+ f = open(filename, 'r')
+ try:
config = dict(tuple(line.rstrip().split('=', 1)) for line in f if line.rstrip())
+ finally:
+ f.close()
return config
def get_zk_servers(filename):
Something went wrong with that request. Please try again.