[node-patches] Change in ovirt-node[master]: Add validator for ssh port to only accpet "22" or "1024-65535"

dougsland at redhat.com dougsland at redhat.com
Thu Jul 17 02:26:22 UTC 2014


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 <hadong0720 at gmail.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes



More information about the node-patches mailing list