On Sept. 2, 2013, 11:58 a.m., Radek Novacek wrote:
src/service-dbus/test/testService.py, line 114 http://reviewboard-openlmi.rhcloud.com/r/805/diff/1/?file=4443#file4443line114
sysd_state = ret == 0
Robin Hack wrote: It's more harder to read without parentheses.
Radek Novacek wrote: I'm ok with parentheses but not with the ternary operator.
Fixed with: sysd_state = (ret == 0)
On Sept. 2, 2013, 11:58 a.m., Radek Novacek wrote:
src/service-dbus/test/testService.py, lines 100-102 http://reviewboard-openlmi.rhcloud.com/r/805/diff/1/?file=4443#file4443line100
This is way too complicated only to get list of services (and also hard to read). I would go with simple loop like this: sysd_services = [] for line in subprocess.check_output(["/usr/bin/systemctl", "list-unit-files", "-t", "service", "--no-pager", "--no-legend"]).split("\n"): service_name = line.split(" ", 1)[0] if service_name and "@.service" not in service_name: sysd_services.append(service_name)
It's not that hard to read when you know basics of functional programming. Maybe grep in subprocess.check_output can be replaced by better solution.
I don't like something like: for line in some_very_long_function_name_with(lot, of, parameters, howg):
- Robin
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/805/#review1060 -----------------------------------------------------------
On Sept. 2, 2013, 11:16 a.m., Robin Hack wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/805/
(Updated Sept. 2, 2013, 11:16 a.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
Service tests: Upstream test for service profider from QA.
Diffs
src/service-dbus/test/failing.service PRE-CREATION src/service-dbus/test/testService.py PRE-CREATION
Diff: http://reviewboard-openlmi.rhcloud.com/r/805/diff/
Testing
Thanks,
Robin Hack