Skip to content

Commit

Permalink
Handle extra spaces in merge-svc-map-files
Browse files Browse the repository at this point in the history
During internal testing we are getting the following error from
merge-svc-map-files
File "/tmp/image.K2MYCphY/hooks/extra-data.d/10-merge-svc-map-files", line 54, in main
    with open(data_path, 'r') as dataFile:
IOError: [Errno 21] Is a directory: '...diskimage-builder/elements/svc-map'

Somehow IMAGE_ELEMENT contains a extra white space that manifests itself
as an element without a name. It is very hard to find where this is coming from so
instead this patch makes merge-svc-map-files more robost to this situation

Change-Id: Id1500ead8a77d691408617dcdc4e095bc5775be8
  • Loading branch information
Michael Kerrin committed Oct 20, 2014
1 parent 8ba6a26 commit 730e7bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions elements/svc-map/extra-data.d/10-merge-svc-map-files
Expand Up @@ -48,6 +48,8 @@ def main():
element_paths = os.environ.get("ELEMENTS_PATH").split(':')
service_names = dict()
for element in elements:
if not element.strip():
continue
for element_path in element_paths:
data_path = os.path.join(element_path, element, "svc-map")
if os.path.exists(data_path):
Expand Down

0 comments on commit 730e7bd

Please sign in to comment.