Fix the hard code about source type

Change-Id: I13428367bf4e19a236f8ad25a5052a2af3c1c69f
This commit is contained in:
Guoqiang Ding 2017-12-26 20:52:10 +08:00 committed by Lingxian Kong
parent 83611f4508
commit 40b886d5a5
1 changed files with 3 additions and 3 deletions

View File

@ -106,9 +106,9 @@ class FunctionsController(rest.RestController):
LOG.info("Downloading function %s", id)
source = func_db.code['source']
if source == 'package':
if source == constants.PACKAGE_FUNCTION:
f = self.storage_provider.retrieve(ctx.projectid, id)
elif source == 'swift':
elif source == constants.SWIFT_FUNCTION:
container = func_db.code['swift']['container']
obj = func_db.code['swift']['object']
f = swift_util.download_object(container, obj)
@ -250,7 +250,7 @@ class FunctionsController(rest.RestController):
)
source = func_db.code['source']
if source == 'package':
if source == constants.PACKAGE_FUNCTION:
self.storage_provider.delete(func_db.project_id, id)
# Delete all resources created by orchestrator asynchronously.