summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-21 20:28:21 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-21 20:28:21 -0700
commit23cf7e35bf9aa1cffc9d1bb2f20d362b57110723 (patch)
tree70575a70f1c3f9431ad00ee5b7b886f01ef1b7ac /cloudinit/distros
parenta588b9b966e51c9b9778b0082c8c5b6ab10f2677 (diff)
downloadvyos-cloud-init-23cf7e35bf9aa1cffc9d1bb2f20d362b57110723.tar.gz
vyos-cloud-init-23cf7e35bf9aa1cffc9d1bb2f20d362b57110723.zip
Use RuntimeError subclass instead of top level Exception
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/rhel.py4
-rw-r--r--cloudinit/distros/ubuntu.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py
index df63d559..dff76075 100644
--- a/cloudinit/distros/rhel.py
+++ b/cloudinit/distros/rhel.py
@@ -208,8 +208,8 @@ class Distro(distros.Distro):
def set_timezone(self, tz):
tz_file = os.path.join("/usr/share/zoneinfo", tz)
if not os.path.isfile(tz_file):
- raise Exception(("Invalid timezone %s,"
- " no file found at %s") % (tz, tz_file))
+ raise RuntimeError(("Invalid timezone %s,"
+ " no file found at %s") % (tz, tz_file))
# Adjust the sysconfig clock zone setting
read_fn = self._paths.join(True, "/etc/sysconfig/clock")
old_contents = self._read_conf(read_fn)
diff --git a/cloudinit/distros/ubuntu.py b/cloudinit/distros/ubuntu.py
index e8b95374..b23945d8 100644
--- a/cloudinit/distros/ubuntu.py
+++ b/cloudinit/distros/ubuntu.py
@@ -121,8 +121,8 @@ class Distro(distros.Distro):
def set_timezone(self, tz):
tz_file = os.path.join("/usr/share/zoneinfo", tz)
if not os.path.isfile(tz_file):
- raise Exception(("Invalid timezone %s,"
- " no file found at %s") % (tz, tz_file))
+ raise RuntimeError(("Invalid timezone %s,"
+ " no file found at %s") % (tz, tz_file))
tz_lines = [
"# Created by cloud-init",
str(tz),