diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-05-26 11:22:52 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-05-26 11:22:52 -0400 |
commit | b4a298b10c26ee79ee6f21a164cf32ab767ca14f (patch) | |
tree | d15f2614650f8be4224ad77c11f3d449467179c8 /cloudinit/helpers.py | |
parent | 399eb29662ee67f7744d3a482f63e8af377e75db (diff) | |
download | vyos-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.py | 5 |
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) |