Yedidyah Bar David has posted comments on this change. Change subject: bin: add the host to a specific cluster ......................................................................
Patch Set 9: (6 comments) Nice job! A few minor notes inside. http://gerrit.ovirt.org/#/c/25456/9/src/plugins/ovirt-hosted-engine-setup/engine/add_host.py File src/plugins/ovirt-hosted-engine-setup/engine/add_host.py: Line 416: ) Line 417: self.logger.debug('Adding the host to the cluster') Line 418: cluster_l = [c.get_name() for c in engine_api.clusters.list()] Line 419: cluster_name = 'Default' if cluster_name not in cluster_l \ Line 420: else cluster_l[0] I do not understand this line. cluster_name will always be None before it, right? cluster_l will never contain None (I guess). So it will always be set to cluster_l[0]. And if for some weird reason cluster_l does include None, cluster_name will be set to 'Default', thus requiring the user to select another one below. Why not just set it to cluster_l[0]? Under what conditions do we want to set it to 'Default'? Line 421: cluster_name = self.dialog.queryString( Line 422: name='cluster_name', Line 423: note=_( Line 424: 'Enter the cluster that you want to add the host ' Line 421: cluster_name = self.dialog.queryString( Line 422: name='cluster_name', Line 423: note=_( Line 424: 'Enter the cluster that you want to add the host ' Line 425: 'to (@VALUES@) [@DEFAULT@]: ' [Text] perhaps: Enter the name of the cluster to which you want to add the host Line 426: ), Line 427: prompt=True, Line 428: default=cluster_name, Line 429: validValues=','.join(cluster_l), Line 447: ) Line 448: except ovirtsdk.infrastructure.errors.RequestError as e: Line 449: self.logger.debug( Line 450: 'Cannot add the host to the {cluster} cluster'.format( Line 451: cluster_name), [Text] perhaps: Cannot add the host to cluster '{cluster}' Line 452: exc_info=True, Line 453: ) Line 454: self.logger.error( Line 455: _( Line 453: ) Line 454: self.logger.error( Line 455: _( Line 456: 'Cannot automatically add the host ' Line 457: 'to the {cluster} cluster:\n{details}\n' [Text] same Line 458: ).format( Line 459: cluster=cluster_name, Line 460: details=e.detail Line 461: ) Line 487: cluster.update() Line 488: except ovirtsdk.infrastructure.errors.RequestError as e: Line 489: self.logger.debug( Line 490: 'Cannot set the CPU level to the {cluster} cluster', Line 491: 'cluster'.format(cluster_name), [Text] perhaps: Cannot set CPU level of cluster '{cluster}' Line 492: exc_info=True, Line 493: ) Line 494: self.logger.error( Line 495: _( Line 493: ) Line 494: self.logger.error( Line 495: _( Line 496: 'Cannot automatically set the CPU ' Line 497: 'to the {cluster} cluster:\n{details}\n' [Text] same Line 498: ).format( Line 499: cluster=cluster_name, Line 500: details=e.detail Line 501: ) -- To view, visit http://gerrit.ovirt.org/25456 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00167e70296645e5cf732b64d87efa1cf66ca783 Gerrit-PatchSet: 9 Gerrit-Project: ovirt-hosted-engine-setup Gerrit-Branch: master Gerrit-Owner: Meital Bourvine <mbour...@redhat.com> Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com> Gerrit-Reviewer: Simone Tiraboschi <simone.tirabos...@gmail.com> Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches