summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-08-26 23:04:56 -0700
committerJoshua Harlow <harlowja@gmail.com>2014-08-26 23:04:56 -0700
commit6a6d3a499c2327b03993bbaea2b9d0df5dc7eb64 (patch)
tree8cc07b97f8e195bf80093626b13493ca0117d521 /cloudinit
parentcc9e3af6c95b3263a49d4590d9dd176bdc570c99 (diff)
downloadvyos-cloud-init-6a6d3a499c2327b03993bbaea2b9d0df5dc7eb64.tar.gz
vyos-cloud-init-6a6d3a499c2327b03993bbaea2b9d0df5dc7eb64.zip
Just use os.path.exists directly
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/helpers/openstack.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index e5a38de0..418ab4d1 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -295,9 +295,6 @@ class ConfigDriveReader(BaseReader):
components = [base] + list(add_ons)
return os.path.join(*components)
- def _path_exists(self, path):
- return os.path.exists(path)
-
def _path_read(self, path):
return util.load_file(path)
@@ -308,7 +305,7 @@ class ConfigDriveReader(BaseReader):
continue
path = self._path_join(self.base_path, "openstack",
potential_version)
- if self._path_exists(path):
+ if os.path.exists(path):
if potential_version != version:
LOG.debug("Version '%s' not available, attempting to use"
" version '%s' instead", version,
@@ -321,7 +318,7 @@ class ConfigDriveReader(BaseReader):
def _read_ec2_metadata(self):
path = self._path_join(self.base_path,
'ec2', 'latest', 'meta-data.json')
- if not self._path_exists(path):
+ if not os.path.exists(path):
return {}
else:
try:
@@ -341,7 +338,7 @@ class ConfigDriveReader(BaseReader):
found = {}
for name in FILES_V1.keys():
path = self._path_join(self.base_path, name)
- if self._path_exists(path):
+ if os.path.exists(path):
found[name] = path
if len(found) == 0:
raise NonReadable("%s: no files found" % (self.base_path))