From be11324740ad4624c45a6e909643ab84aecdbf16 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 26 Jan 2011 09:03:46 -0500 Subject: change 'except' syntax to python 3 style. Everywhere that there occurred: except Exception, e: changed to except Exception as e: --- cloudinit/CloudConfig/cc_update_hostname.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cloudinit/CloudConfig/cc_update_hostname.py') diff --git a/cloudinit/CloudConfig/cc_update_hostname.py b/cloudinit/CloudConfig/cc_update_hostname.py index 3663c0ab..a49f8649 100644 --- a/cloudinit/CloudConfig/cc_update_hostname.py +++ b/cloudinit/CloudConfig/cc_update_hostname.py @@ -31,7 +31,7 @@ def handle(name,cfg,cloud,log,args): hostname = util.get_cfg_option_str(cfg,"hostname",cloud.get_hostname()) prev ="%s/%s" % (cloud.get_cpath('datadir'),"previous-hostname") update_hostname(hostname, prev, log) - except Exception, e: + except Exception as e: log.warn("failed to set hostname\n") raise @@ -50,7 +50,7 @@ def read_hostname(filename, default=None): line = line.rstrip() if line: return line - except IOError, e: + except IOError as e: if e.errno != errno.ENOENT: raise return default @@ -62,7 +62,7 @@ def update_hostname(hostname, prev_file, log): try: hostname_prev = read_hostname(prev_file) - except Exception, e: + except Exception as e: log.warn("Failed to open %s: %s" % (prev_file, e)) try: -- cgit v1.2.3