Skip to content

Commit

Permalink
environment: Store include paths in list to preserve mount order
Browse files Browse the repository at this point in the history
  • Loading branch information
yotam-wizery committed Aug 1, 2012
1 parent 90d858d commit 7268e7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dwight_chroot/environment.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ def _fetch_image_and_includes(self):
root_image_resource = Resource.from_string(self.config["ROOT_IMAGE"]) root_image_resource = Resource.from_string(self.config["ROOT_IMAGE"])
self._update_used_keys(used_keys, root_image_resource) self._update_used_keys(used_keys, root_image_resource)
root_image_path = root_image_resource.get_path(self) root_image_path = root_image_resource.get_path(self)
include_paths = {} include_paths = []


for include in self.config["INCLUDES"]: for include in self.config["INCLUDES"]:
_logger.debug("Fetching include %s...", include) _logger.debug("Fetching include %s...", include)
include_resource = include.to_resource() include_resource = include.to_resource()
self._update_used_keys(used_keys, include_resource) self._update_used_keys(used_keys, include_resource)
include_paths[include] = include_resource.get_path(self) include_paths.append((include, include_resource.get_path(self)))
self.cache.cleanup(self.config["MAX_CACHE_SIZE"], used_keys) self.cache.cleanup(self.config["MAX_CACHE_SIZE"], used_keys)
return root_image_path, include_paths return root_image_path, include_paths
def _update_used_keys(self, keys, resource): def _update_used_keys(self, keys, resource):
Expand Down Expand Up @@ -122,7 +122,7 @@ def _mount_root_image(self, root_image_path):
self._mount_squashfs(root_image_path, _ROOT_IMAGE_MOUNT_PATH) self._mount_squashfs(root_image_path, _ROOT_IMAGE_MOUNT_PATH)
return _ROOT_IMAGE_MOUNT_PATH return _ROOT_IMAGE_MOUNT_PATH
def _mount_includes(self, base_path, include_paths): def _mount_includes(self, base_path, include_paths):
for include, path in iteritems(include_paths): for include, path in include_paths:
self._mount_path(path, base_path, include.dest) self._mount_path(path, base_path, include.dest)
def _mount_path(self, path, base_path, mount_point): def _mount_path(self, path, base_path, mount_point):
path = os.path.abspath(path) path = os.path.abspath(path)
Expand Down

0 comments on commit 7268e7d

Please sign in to comment.