Francesco Romani has posted comments on this change. Change subject: Implementation of logind based session locking ......................................................................
Patch Set 1: (3 comments) I like the idea :) http://gerrit.ovirt.org/#/c/24628/1/ovirt-guest-agent/LockActiveSession.py File ovirt-guest-agent/LockActiveSession.py: Line 32: ) Just wondering: can this props cached or lazily created and kept? I don't know if the creation of the interface is cheap enough to make the saving worth the trouble Line 64: dbus_interface='org.freedesktop.ConsoleKit.Session') Line 65: if s.IsActive(): Line 66: session = s Line 67: break Line 68: except: Not a big fan of those Line 69: pass Line 70: return session Line 71: Line 72: Line 89: break Line 90: session = None Line 91: except: Line 92: pass Line 93: return session Would it make sense to return the valid session early in the for loop and return None here? for session_struct in sessions: ... if session.isActive(): return session return None IMHO this is a bit clearer. Line 94: Line 95: Line 96: def GetActiveSession(): Line 97: bus = dbus.SystemBus() -- To view, visit http://gerrit.ovirt.org/24628 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iafc4b88d9c508647e1d09407556359fbefbba34c Gerrit-PatchSet: 1 Gerrit-Project: ovirt-guest-agent Gerrit-Branch: master Gerrit-Owner: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
