Francesco Romani has posted comments on this change.
Change subject: periodic: add executor-compatible naming ......................................................................
Patch Set 6:
(2 comments)
https://gerrit.ovirt.org/#/c/48193/6/vdsm/virt/periodic.py File vdsm/virt/periodic.py:
Line 262: return '<VmDispatcher operation=%s at 0x%x>' % ( Line 263: self._create, id(self) Line 264: ) Line 265: Line 266: __repr__ = __str__
Just thought about retaining __repr__ here (as `str' falls back to it), but
You are right, as the doc -why I should have refreshed earlier- reminds us: https://docs.python.org/2/reference/datamodel.html#object.__repr__
However, here I abused __repr__ in the old code, because this representation definitely leans toward "informal", and not even attempts to be a valid python expression. So it always was more akin to __str__ than __repr__ in the intentions.
For this reason I'll keep the rename and drop the alias, and maybe readd back __repr__ in a later patch, with better context and rationale. Line 267: Line 268: Line 269: class _RunnableOnVm(object): Line 270:
Line 292: Line 293: def __str__(self): Line 294: return '<%s vm=%s at 0x%x>' % ( Line 295: self.NAME, self._vm.id, id(self) Line 296: )
Why not simply using self.__class__.__name__ here and introducing NAME?
no good reason. Changing - thanks! Line 297: Line 298: Line 299: class UpdateVolumes(_RunnableOnVm): Line 300: