Douglas Schilling Landgraf has posted comments on this change.

Change subject: Add validator for ssh port to only accpet "22" or "1024-65535"
......................................................................


Patch Set 8: Code-Review-1

(1 comment)

-1 as I have comment.

http://gerrit.ovirt.org/#/c/29957/8/src/ovirt/node/utils/security.py
File src/ovirt/node/utils/security.py:

Line 205:         if state != "none" and int(state) in range(1024, 65536):
Line 206:             pass
Line 207:         elif state != "none" and int(state) == 22:
Line 208:             pass
Line 209:         else:
Hi there,

I would suggest different approach:

if state != "none":
    if int(state) in range(1024, 65536) or int(state) == 22:
        self.logger.debug("SSH port %s" % state)

or you can even push it as only one if.
Line 210:             raise RuntimeError("Failed to set SSH port: value is %s" 
% state)
Line 211:         return state
Line 212: 
Line 213:     def get_hostkey(self, variant="rsa"):


-- 
To view, visit http://gerrit.ovirt.org/29957
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4e5fe06ad0a1c8345e3b1265cbafdabc275bf1b5
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Fabian Deutsch <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
node-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/node-patches

Reply via email to