updated get message from ahenk for packages

This commit is contained in:
Tuncay ÇOLAK 2021-01-05 18:40:01 +03:00
parent 69807d8f42
commit e9a5402e55

View file

@ -22,6 +22,7 @@ class Packages(AbstractPlugin):
cn = '{0}\r\n'.format(self.Ahenk.dn().split(',')[0])
items = (self.data)['packageInfoList']
packages = []
for item in items:
try:
if self.has_attr_json(item, 'tag') and self.has_attr_json(item, 'source'):
@ -61,6 +62,9 @@ class Packages(AbstractPlugin):
## INSTALL/REMOVE PACKAGE
p_item = {'packageName': '{0}'.format(item['packageName']),
'tag': '{0}'.format(item['tag'])}
packages.append(p_item)
if item['tag'] == 'Yükle' or item['tag'] == 'Install':
self.logger.debug(
"Installing new package... {0}".format(item['packageName']))
@ -108,10 +112,9 @@ class Packages(AbstractPlugin):
return
self.delete_source_file()
self.logger.debug('Task handled successfully')
self.context.create_response(code=self.message_code.TASK_PROCESSED.value,
message='{0} ahenginde, {1} paketi({2}) {3} işlemi başarı ile gerçekleştirildi.'.format(cn,item['packageName'], item['version'], item['tag']))
message='{0} paket kur/kaldır işlemleri başarı ile gerçekleştirildi.'.format(packages))
except Exception as e:
self.logger.error('Unpredictable error exists. Error Message: {0}'.format(str(e)))
self.delete_source_file()