summaryrefslogtreecommitdiff
path: root/cloudinit/helpers.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-05-26 11:22:52 -0400
committerScott Moser <smoser@ubuntu.com>2016-05-26 11:22:52 -0400
commitb4a298b10c26ee79ee6f21a164cf32ab767ca14f (patch)
treed15f2614650f8be4224ad77c11f3d449467179c8 /cloudinit/helpers.py
parent399eb29662ee67f7744d3a482f63e8af377e75db (diff)
downloadvyos-cloud-init-b4a298b10c26ee79ee6f21a164cf32ab767ca14f.tar.gz
vyos-cloud-init-b4a298b10c26ee79ee6f21a164cf32ab767ca14f.zip
cloudinit/helpers.py: _get_path raise KeyError if input is bad.
previously, if you did: paths.get_ipath("bogus") it would silenetly hand you back just the directory. now it will fail, which seems much more sane.
Diffstat (limited to 'cloudinit/helpers.py')
-rw-r--r--cloudinit/helpers.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/cloudinit/helpers.py b/cloudinit/helpers.py
index abfb0cbb..d4acbe7e 100644
--- a/cloudinit/helpers.py
+++ b/cloudinit/helpers.py
@@ -392,10 +392,9 @@ class Paths(object):
return ipath
def _get_path(self, base, name=None):
- add_on = self.lookups.get(name)
- if not add_on:
+ if name is None:
return base
- return os.path.join(base, add_on)
+ return os.path.join(base, self.lookups[name])
def get_runpath(self, name=None):
return self._get_path(self.run_dir, name)