- if ToscaTemplate.FILES in tmpl:
- for f in tmpl[ToscaTemplate.FILES]:
- self.log.debug(_("Copy supporting file {0}").format(f))
-
- # Search in source packages
- if len(self.pkgs):
- for pkg in self.pkgs:
- # TODO(pjoseph): Need to add support for other file types
- fname = f[ToscaResource.NAME]
- dest_path = os.path.join(subdir, f[ToscaResource.DEST])
- ftype = f[ToscaResource.TYPE]
-
- if ftype == 'image':
- image_file_map = rift.package.image.get_package_image_files(pkg)
-
- if fname in image_file_map:
- self.log.debug(_("Extracting image {0} to {1}").
- format(fname, dest_path))
- pkg.extract_file(image_file_map[fname],
- dest_path)
- break
-
- elif ftype == 'script':
- script_file_map = \
- rift.package.script.PackageScriptExtractor.package_script_files(pkg)
- if fname in script_file_map:
- self.log.debug(_("Extracting script {0} to {1}").
- format(fname, dest_path))
- pkg.extract_file(script_file_map[fname],
- dest_path)
- break
-
- elif ftype == 'cloud_init':
- script_file_map = \
- rift.package.cloud_init.PackageCloudInitExtractor.package_script_files(pkg)
- if fname in script_file_map:
- self.log.debug(_("Extracting script {0} to {1}").
- format(fname, dest_path))
- pkg.extract_file(script_file_map[fname],
- dest_path)
- break
-
- else:
- self.log.warn(_("Unknown file type {0}: {1}").
- format(ftype, f))
-
- #TODO(pjoseph): Search in other locations
+ for key in tmpl_out:
+ tmpl = tmpl_out[key]
+ if ToscaTemplate.FILES in tmpl:
+ for f in tmpl[ToscaTemplate.FILES]:
+ self.log.debug(_("Copy supporting file {0}").format(f))
+
+ # Search in source packages
+ if len(self.pkgs):
+ for pkg in self.pkgs:
+ # TODO(pjoseph): Need to add support for other file types
+ fname = f[ToscaResource.NAME]
+ dest_path = os.path.join(subdir, f[ToscaResource.DEST])
+ ftype = f[ToscaResource.TYPE]
+
+ if ftype == 'image':
+ image_file_map = rift.package.image.get_package_image_files(pkg)
+
+ if fname in image_file_map:
+ self.log.debug(_("Extracting image {0} to {1}").
+ format(fname, dest_path))
+ pkg.extract_file(image_file_map[fname],
+ dest_path)
+ break
+
+ elif ftype == 'script':
+ script_file_map = \
+ rift.package.script.PackageScriptExtractor.package_script_files(pkg)
+ if fname in script_file_map:
+ self.log.debug(_("Extracting script {0} to {1}").
+ format(fname, dest_path))
+ pkg.extract_file(script_file_map[fname],
+ dest_path)
+ break
+
+ elif ftype == 'cloud_init':
+ script_file_map = \
+ rift.package.cloud_init.PackageCloudInitExtractor.package_script_files(pkg)
+ if fname in script_file_map:
+ self.log.debug(_("Extracting script {0} to {1}").
+ format(fname, dest_path))
+ pkg.extract_file(script_file_map[fname],
+ dest_path)
+ break
+
+ else:
+ self.log.warn(_("Unknown file type {0}: {1}").
+ format(ftype, f))
+
+ #TODO(pjoseph): Search in other locations