Change in vdsm[master]: virt: Fix @staticmethod usage in guest agent

nsoffer at redhat.com nsoffer at redhat.com
Thu Dec 17 19:07:49 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: virt: Fix @staticmethod usage in guest agent
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/50656/1/vdsm/virt/guestagent.py
File vdsm/virt/guestagent.py:

Line 203
Line 204
Line 205
Line 206
Line 207
Why use static method here?

If the rule is use static methods when the code is not using "self", the rule is completely wrong. The correct rule is - never use static method, they are useless.


Line 484:                 raise
Line 485: 
Line 486:         return result
Line 487: 
Line 488:     @staticmethod
Please avoid static methods, they only make testing harder, and do not add any value.

When you are using static method, you should use a module level function.
Line 489:     def _parseLine(line):
Line 490:         # Deal with any bad UTF8 encoding from the (untrusted) guest,
Line 491:         # by replacing them with the Unicode replacement character
Line 492:         uniline = line.decode('utf8', 'replace')


-- 
To view, visit https://gerrit.ovirt.org/50656
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icaadf151eaf86f13d2574d4f4c14ce64f9a819a7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list