Ticket #65 (closed defect: fixed)

Opened 14 months ago

Last modified 12 days ago

xcap_pres_rules ERROR loading Eyebeam's pres-rules

Reported by: ibc Owned by: support@ag-projects.com
Priority: major Milestone: Future
Component: XCAP stack Version: trunk
Keywords: Cc:

Description

Eyebeam publishes the following 'pres-rules document in OpenXCAP:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns="urn:ietf:params:xml:ns:common-policy" xmlns:pr="urn:ietf:params:xml:ns:pres-rules" xmlns:cp="www.counterpath.com/privacy-lists">
	<rule id="pres_whitelist">
		<conditions>
			<identity>
				<one id="sip:alice@mydomain.net" />
				<one id="sip:eyebeam@mydomain.net" />
				<one id="sip:ibc@aliax.net" />
				<many domain="mydomain.net">
				</many>
			</identity>
		</conditions>
		<actions>
			<pr:sub-handling>allow</pr:sub-handling>
		</actions>
		<transformations>
			<pr:provide-services>
				<pr:all-services />
			</pr:provide-services>
			<pr:provide-persons>
				<pr:all-persons />
			</pr:provide-persons>
			<pr:provide-devices>
				<pr:all-devices />
			</pr:provide-devices>
			<pr:provide-all-attributes />
		</transformations>
	</rule>
	<rule id="im_whitelist">
		<conditions>
			<sphere value="im_whitelist" />
		<identity>
			<one id="sip:alice@mydomain.net" />
			<one id="sip:eyebeam@mydomain.net" />
			<one id="sip:ibc@aliax.net" />
			<many domain="mydomain.net">
			</many>
		</identity>
		</conditions>
		<actions>
			<cp:im-handling>allow</cp:im-handling>
		</actions>
		<transformations />
	</rule>
	<rule id="phone_whitelist">
		<conditions>
			<sphere value="phone_whitelist" />
			<identity>
				<one id="sip:ibc@aliax.net" />
				<many domain="mydomain.net">
				<except id="sip:eyebeam@mydomain.net" />
				</many>
			</identity>
		</conditions>
		<actions>
			<cp:phone-handling>allow</cp:phone-handling>
		</actions>
		<transformations />
	</rule>
	<rule id="phone_blacklist">
		<conditions>
			<sphere value="phone_blacklist" />
			<identity>
				<one id="sip:eyebeam@mydomain.net" />
			</identity>
		</conditions>
		<actions>
			<cp:phone-handling>block</cp:phone-handling>
		</actions>
		<transformations />
	</rule>
</ruleset>

When trying to load it with xcap_pres_rules this error occurs:

Retrieving current presence rules from http://mydomain.net:443/xcap-root
ne 282, in read_queue
    get_prules()
  File "/usr/bin/xcap_pres_rules", line 69, in get_prules
    prules = PresRules.parse(doc)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 459, in parse
    return cls.from_element(xml, *args, **kwargs)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 346, in from_element
    obj._parse_element(element, *args, **kwargs)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 421, in _parse_element
    list.append(self, Rule.from_element(child, *args, **kwargs))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 337, in from_element
    value = type.from_element(child, *args, **kwargs)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 346, in from_element
    obj._parse_element(element, *args, **kwargs)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 295, in _parse_element
    list.append(self, child_cls.from_element(child, *args, **kwargs))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 346, in from_element
    obj._parse_element(element, *args, **kwargs)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 198, in _parse_element
    list.append(self, child_cls.from_element(child, *args, **kwargs))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 346, in from_element
    obj._parse_element(element, *args, **kwargs)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 152, in _parse_element
    list.append(self, IdentityExcept.from_element(child, *args, **kwargs))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 326, in from_element
    setattr(obj, name, attribute.parse(xmlvalue))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 111, in <lambda>
    id = XMLAttribute('id', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'domain', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 112, in <lambda>
    domain = XMLAttribute('domain', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'id', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 111, in <lambda>
    id = XMLAttribute('id', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'domain', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 112, in <lambda>
    domain = XMLAttribute('domain', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'id', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)

[REPEAT]

  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 111, in <lambda>
    id = XMLAttribute('id', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'domain', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 112, in <lambda>
    domain = XMLAttribute('domain', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'id', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 133, in __set__
    self.onset(obj, self)
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/policy.py", line 111, in <lambda>
    id = XMLAttribute('id', type=str, required=False, test_equal=True, onset=(lambda self, attr: setattr(self, 'domain', None)))
  File "/usr/lib/pymodules/python2.5/sipsimple/applications/__init__.py", line 131, in __set__
    self.values[id(obj)] = value
RuntimeError: maximum recursion depth exceeded in cmp

Change History

Changed 12 days ago by adigeo

  • status changed from new to closed
  • version changed from 0.9.0 to trunk
  • resolution set to fixed

Fixed in the upcoming release.

Note: See TracTickets for help on using tickets.