Skip to content

Commit

Permalink
dbus unique names have :[digit]
Browse files Browse the repository at this point in the history
We can't use ':' because it clashes with the scheme separator in
the URI. Therefore we transmit the URI without ':' and add it back
in only in the case when the name has an initial digit, because
only unique names are allowed to have an initial digit.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
  • Loading branch information
David Scott committed Feb 11, 2014
1 parent e6f738b commit e3834c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbus/vm/python/dbus-resource-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ def run(self):
for owner_uri in self.owners.keys():
try:
uri = urlparse.urlparse(owner_uri)
proxy = bus.get_object(uri.scheme, uri.path)
scheme = uri.scheme
if scheme[0] in ['0','1','2','3','4','5','6','7','8','9']:
# only unique names can begin with a digit, put the colon back on
scheme = ":" + scheme
proxy = bus.get_object(scheme, uri.path)
tasks = self.owners[owner_uri]
alive = proxy.ping(map(lambda x:x.uri, tasks), dbus_interface=TASKOWNER_INTERFACE)
for i in range(0, len(alive)):
Expand Down

0 comments on commit e3834c3

Please sign in to comment.