Skip to content

Commit

Permalink
Use xml.sax.saxutils escape instead of one from generateds
Browse files Browse the repository at this point in the history
Change-Id: I29d6d7191492e84650df3a3c95e127fc6beb1097
Partial-Bug: #1394044
  • Loading branch information
Hampapur Ajay committed Nov 20, 2014
1 parent 1a35df9 commit 0c06395
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ifmap_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,7 @@ def _generate_ifmap_db_impl(self, gen_fname, gen_type_pfx):
write(gen_file, "import cStringIO")
write(gen_file, "from lxml import etree")
write(gen_file, "")
write(gen_file, "from generatedssuper import quote_xml")
write(gen_file, "from xml.sax.saxutils import escape")
write(gen_file, "from cfgm_common.ifmap.client import client, namespaces")
write(gen_file, "from cfgm_common.ifmap.request import NewSessionRequest, RenewSessionRequest")
write(gen_file, "from cfgm_common.ifmap.request import EndSessionRequest, PublishRequest")
Expand Down Expand Up @@ -2455,7 +2455,7 @@ def _generate_ifmap_db_impl(self, gen_fname, gen_type_pfx):
write(gen_file, " if field is not None:")
if not prop.getCType():
# simple type
write(gen_file, " norm_str = quote_xml(str(obj_dict['%s']))" %(prop_field))
write(gen_file, " norm_str = escape(str(obj_dict['%s']))" %(prop_field))
write(gen_file, " meta = Metadata('%s', norm_str," %(prop_name))
write(gen_file, " {'ifmap-cardinality':'singleValue'}, ns_prefix = 'contrail')")
else: # it is complex type, use TypeGenerator's class
Expand Down Expand Up @@ -2909,8 +2909,8 @@ def _generate_ifmap_db_impl(self, gen_fname, gen_type_pfx):
write(gen_file, " parent_imid = '%s'" %(_BASE_PARENT_IMID))
write(gen_file, "")
write(gen_file, " # Normalize/escape special chars")
write(gen_file, " my_imid = quote_xml(my_imid)")
write(gen_file, " parent_imid = quote_xml(parent_imid)")
write(gen_file, " my_imid = escape(my_imid)")
write(gen_file, " parent_imid = escape(parent_imid)")
write(gen_file, "")
write(gen_file, " return (my_imid, parent_imid)")
write(gen_file, " #end %s_alloc_ifmap_id" %(method_name))
Expand Down

0 comments on commit 0c06395

Please sign in to comment.