Mercurial > libervia-backend
comparison src/plugins/plugin_adhoc_dbus.py @ 1933:16e65f15f31f
plugin adhoc_dbus, jp (cmd/adhoc): fixes adHocDBusAddAuto when no bus is found
fix bug 134
author | souliane <souliane@mailoo.org> |
---|---|
date | Sun, 17 Apr 2016 13:37:40 +0200 |
parents | d17772b0fe22 |
children | 2daf7b4c6756 |
comparison
equal
deleted
inserted
replaced
1932:44342730df66 | 1933:16e65f15f31f |
---|---|
128 def adHocDBusAddAuto(self, prog_name, allowed_jids=None, allowed_groups=None, allowed_magics=None, forbidden_jids=None, forbidden_groups=None, flags=None, profile_key=C.PROF_KEY_NONE): | 128 def adHocDBusAddAuto(self, prog_name, allowed_jids=None, allowed_groups=None, allowed_magics=None, forbidden_jids=None, forbidden_groups=None, flags=None, profile_key=C.PROF_KEY_NONE): |
129 bus_names = yield self._DBusListNames() | 129 bus_names = yield self._DBusListNames() |
130 bus_names = [bus_name for bus_name in bus_names if '.' + prog_name in bus_name] | 130 bus_names = [bus_name for bus_name in bus_names if '.' + prog_name in bus_name] |
131 if not bus_names: | 131 if not bus_names: |
132 log.info("Can't find any bus for [%s]" % prog_name) | 132 log.info("Can't find any bus for [%s]" % prog_name) |
133 return | 133 defer.returnValue(("", [])) |
134 bus_names.sort() | 134 bus_names.sort() |
135 for bus_name in bus_names: | 135 for bus_name in bus_names: |
136 if bus_name.endswith(prog_name): | 136 if bus_name.endswith(prog_name): |
137 break | 137 break |
138 log.info("bus name found: [%s]" % bus_name) | 138 log.info("bus name found: [%s]" % bus_name) |