summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author하태준/개발플랫폼팀/L4/ <taejun-ha@users.noreply.github.sec.samsung.net>2017-09-28 15:12:39 +0900
committerGitHub Enterprise <noreply-CODE@samsung.com>2017-09-28 15:12:39 +0900
commit3af165aceaab374ad93a92d7996d02ba1bc7c5cf (patch)
treed05cd5ffd37453d0b052489e7d4950843ee272a9
parentca790e213d2fa30c5fa11b80999e15c0de95e802 (diff)
parent6783926ebef589c4428948a6977b20d72b3cdbb3 (diff)
downloadtic-core-3af165aceaab374ad93a92d7996d02ba1bc7c5cf.tar.gz
tic-core-3af165aceaab374ad93a92d7996d02ba1bc7c5cf.tar.bz2
tic-core-3af165aceaab374ad93a92d7996d02ba1bc7c5cf.zip
Merge pull request #18 from cw1-shin/TPE-381
[TPE-381] fix the sanitize bottlenecks
-rw-r--r--tic/parser/repo_parser.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tic/parser/repo_parser.py b/tic/parser/repo_parser.py
index 33cb3c6..1490bf3 100644
--- a/tic/parser/repo_parser.py
+++ b/tic/parser/repo_parser.py
@@ -17,12 +17,11 @@
# - S-Core Co., Ltd
import re
-import bleach
from lxml import etree
from tic.utils.error import TICError
from tic.utils.rpmmisc import archPolicies, default_arch, compare_ver
from tic.utils.log import Logger
-from tic.utils.misc import sanitize_digit
+from tic.utils.misc import sanitize_digit, sanitize_text
from tic.config import configmgr
# meta pkg
@@ -87,8 +86,8 @@ class RepodataParser(object):
pkg_info['name'] = pkg_name
pkg_info['arch'] = pkg.findtext(tag_dic['arch'])
pkg_info['selfChecked'] = False # for web-ui tree
- pkg_info['summary'] = bleach.clean(pkg.findtext(tag_dic['summary']))
- pkg_info['description'] = bleach.clean(pkg.findtext(tag_dic['description']))
+ pkg_info['summary'] = sanitize_text(pkg.findtext(tag_dic['summary']))
+ pkg_info['description'] = sanitize_text(pkg.findtext(tag_dic['description']))
# Parsing meta-pkg using meta naming rule
meta_match = META_PATTERN.search(pkg_info['name'])
if meta_match is not None:
@@ -126,9 +125,9 @@ class RepodataParser(object):
pkg_info['profile'] = None
ver_tag = pkg.find(tag_dic['version'])
- pkg_info['version'] = {'epoch': bleach.clean(ver_tag.attrib['epoch']),
- 'ver': bleach.clean(ver_tag.attrib['ver']),
- 'rel': bleach.clean(ver_tag.attrib['rel'])}
+ pkg_info['version'] = {'epoch': sanitize_text(ver_tag.attrib['epoch']),
+ 'ver': sanitize_text(ver_tag.attrib['ver']),
+ 'rel': sanitize_text(ver_tag.attrib['rel'])}
repo_pkg[pkg_name] = pkg_info['version']
pkg_info['checksum'] = pkg.findtext(tag_dic['checksum'])
pkg_info['location'] = pkg.find(tag_dic['location']).attrib['href']