Douglas Schilling Landgraf has posted comments on this change.

Change subject: vdsm-tool: Add register verb
......................................................................


Patch Set 6:

(7 comments)

https://gerrit.ovirt.org/#/c/40966/6/lib/vdsm/tool/register.py
File lib/vdsm/tool/register.py:

Line 136: 
Line 137:         try:
Line 138:             res = requests.get(__GET_VERSION, verify=False)
Line 139:         except requests.RequestException:
Line 140:             self.logger.error(requests.RequestException, 
exc_info=True)
> you should still use
Now I understood the self.exception :)
Line 141:             raise requests.RequestException
Line 142: 
Line 143:         if res.status_code != 200:
Line 144:             self.reg_protocol = "legacy"


Line 230:         except requests.RequestException:
Line 231:             self.logger.error("Cannot connect to engine. {f} matches "
Line 232:                               "the FQDN of 
Engine?".format(f=self.engine_fqdn),
Line 233:                               exc_info=True)
Line 234:             raise requests.RequestException
> again, I don't think that you should have ANY exception handling here. but 
Done
Line 235: 
Line 236:         return res.content
Line 237: 
Line 238:     def _silent_restorecon(self, path):


Line 412:         formatter_class=argparse.RawTextHelpFormatter,
Line 413:         description='Tool to register node to Engine',
Line 414:         epilog='Example of use:\n%(prog)s '
Line 415:                     '--engine-fqdn engine.mydomain'
Line 416:     )
> each exposed function should have 
Done
Line 417: 
Line 418:     # Needed by vdsm-tool. Otherwise it complains about register
Line 419:     # option doesn't exist
Line 420:     parser.add_argument(


Line 417: 
Line 418:     # Needed by vdsm-tool. Otherwise it complains about register
Line 419:     # option doesn't exist
Line 420:     parser.add_argument(
Line 421:         'register',
> I missed that you don't pass to ArgumentParser the *args so you get all of 
Great, thanks Yaniv.
Line 422:     )
Line 423: 
Line 424:     parser.add_argument(
Line 425:         '--node-fqdn',


Line 488:                    ssh_user=args.ssh_user,
Line 489:                    ssh_port=args.ssh_port,
Line 490:                    fingerprint=args.fingerprint,
Line 491:                    check_fqdn=args.check_fqdn)
Line 492: 
> here I'd add a "try"
Done
Line 493:     reg.host_uuid()
Line 494:     reg.download_ca()
Line 495:     reg.download_ssh()
Line 496:     reg.execute_registration()


Line 492: 
Line 493:     reg.host_uuid()
Line 494:     reg.download_ca()
Line 495:     reg.download_ssh()
Line 496:     reg.execute_registration()
> and here, an
Done
Line 497: 
Line 498: if __name__ == '__main__':
Line 499:     main()
Line 500: 


Line 495:     reg.download_ssh()
Line 496:     reg.execute_registration()
Line 497: 
Line 498: if __name__ == '__main__':
Line 499:     main()
> place
Done
Line 500: 
Line 501: """
Line 502: Registration schema:
Line 503: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ica800027beec1e5a20165bb5e1e78baf9283c1da
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to