~hazmat/pyjuju/proposed-support

« back to all changes in this revision

Viewing changes to juju/hooks/cli.py

  • Committer: kapil.thangavelu at canonical
  • Date: 2012-05-22 22:08:15 UTC
  • mfrom: (484.1.53 trunk)
  • Revision ID: kapil.thangavelu@canonical.com-20120522220815-acyt8m89i9ybe0w1
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
            # XXX: todo -- sanitize input
258
258
            filename = v[1:]
259
259
            try:
260
 
                v = open(filename, "r").read()
 
260
                with open(filename, "r") as f:
 
261
                    v = f.read()
261
262
            except IOError:
262
263
                raise JujuError(
263
264
                    "No such file or directory: %s (argument:%s)" % (