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/1111210
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
---
M src/plugins/ovirt-hosted-engine-setup/storage/storage.py
1 file changed, 13 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-hosted-engine-setup 
refs/changes/78/40778/1

diff --git a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py 
b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
index b2f20b8..15dd0c5 100644
--- a/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
+++ b/src/plugins/ovirt-hosted-engine-setup/storage/storage.py
@@ -134,9 +134,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 '
@@ -145,11 +143,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(
@@ -161,6 +161,9 @@
                             )
                     else:
                         valid = True
+                        self.environment[
+                            ohostedcons.StorageEnv.HOST_ID
+                        ] = int(host_id)
                 except ValueError:
                     valid = False
                     if interactive:
@@ -260,9 +263,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(
@@ -623,7 +626,7 @@
     def _storagePoolConnection(self, disconnect=False):
         spUUID = self.environment[ohostedcons.StorageEnv.SP_UUID]
         sdUUID = self.environment[ohostedcons.StorageEnv.SD_UUID]
-        ID = int(self.environment[ohostedcons.StorageEnv.HOST_ID])
+        ID = self.environment[ohostedcons.StorageEnv.HOST_ID]
         scsi_key = spUUID
         master = sdUUID
         master_ver = 1


-- 
To view, visit https://gerrit.ovirt.org/40778
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: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to