Simone Tiraboschi has uploaded a new change for review. Change subject: packaging: setup: always storing HOST_ID as an int ......................................................................
packaging: setup: always storing HOST_ID as an int always storing HOST_ID as an int Change-Id: Ie3585bda2704c8ef50899874b7e76648c27792aa Bug-Url: https://bugzilla.redhat.com/1216172 Signed-off-by: Simone Tiraboschi <stira...@redhat.com> --- M src/plugins/ovirt-hosted-engine-setup/storage/storage.py 1 file changed, 12 insertions(+), 9 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup refs/changes/46/40846/1 diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py index 72b8c43..b704fb7 100644 --- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py +++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py @@ -133,9 +133,7 @@ valid = False while not valid: if interactive: - self.environment[ - ohostedcons.StorageEnv.HOST_ID - ] = self.dialog.queryString( + host_id = self.dialog.queryString( name='OVEHOSTED_HOST_ID', note=_( 'Please specify the Host ID ' @@ -144,11 +142,13 @@ prompt=True, default=ohostedcons.Const.FIRST_HOST_ID + 1, ) + else: + host_id = self.environment[ + ohostedcons.StorageEnv.HOST_ID + ] try: # ensure it's an int and not the FIRST_HOST_ID. - if int( - self.environment[ohostedcons.StorageEnv.HOST_ID] - ) == ohostedcons.Const.FIRST_HOST_ID: + if int(host_id) == ohostedcons.Const.FIRST_HOST_ID: valid = False if interactive: self.logger.error( @@ -160,6 +160,9 @@ ) else: valid = True + self.environment[ + ohostedcons.StorageEnv.HOST_ID + ] = int(host_id) except ValueError: valid = False if interactive: @@ -258,9 +261,9 @@ ] + ".metadata", ) if ( - int( - self.environment[ohostedcons.StorageEnv.HOST_ID] - ) in all_host_stats.keys() and + self.environment[ + ohostedcons.StorageEnv.HOST_ID + ] in all_host_stats.keys() and not self._re_deploying_host() ): raise RuntimeError( -- To view, visit https://gerrit.ovirt.org/40846 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3585bda2704c8ef50899874b7e76648c27792aa Gerrit-PatchSet: 1 Gerrit-Project: ovirt-hosted-engine-setup Gerrit-Branch: ovirt-hosted-engine-setup-1.2 Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches