Merge "modify patch 414777 of importutils use error"

This commit is contained in:
Jenkins 2017-01-23 02:48:49 +00:00 committed by Gerrit Code Review
commit 3240484de4
2 changed files with 4 additions and 4 deletions

View File

@ -442,7 +442,7 @@ class Controller(controller.BaseController):
ext_func = "%s.api.hosts" % ext_name
extension = importutils.import_module(
'daisy.api.v1.ext.%s' % ext_func)
if 'template_to_host' in dir(extersion):
if 'template_to_host' in dir(extension):
extension.template_to_host(orig_host_meta)
params = {'filters': {'cluster_name': host_template['cluster_name']}}
templates = registry.host_template_lists_metadata(

View File

@ -717,9 +717,9 @@ class Controller(controller.BaseController):
if filename in names:
ext_name = root.split(path)[1].strip('/')
ext_func = "%s.api.hosts" % ext_name
extension = importutils.import_module('daisy.api.v1.ext',
ext_func)
if 'complement_host_extra_info' in dir(extersion):
extension = importutils.import_module(
'daisy.api.v1.ext.%s' % ext_func)
if 'complement_host_extra_info' in dir(extension):
extension.complement_host_extra_info(host_meta)
os_handle = get_os_handle()