From 7d16a8a9d9e9bf56d1b46e11f1903f2734b0781d Mon Sep 17 00:00:00 2001 From: Kristine Bujold Date: Thu, 4 Oct 2018 15:43:19 -0400 Subject: [PATCH] Enhance warning for mgmt network configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fix enhance the warning regarding the size of the address pool when configuring the management network. A subnet of /29 will only allow 8 addresses. If a LVM/Ceph image backend is added (e.g. system storage-backend-add lvm -s cinder –confirmed, system storage-backend-add ceph -s cinder,glance –confirmed), the command will fail with “Address pool management has no available addresses”. The user will now be asked to confirm this configuration. Closes-Bug: 1796306 Change-Id: Ib33efff1e929e9754c241d6c93398be5c4d83db8 Signed-off-by: Kristine Bujold --- controllerconfig/centos/build_srpm.data | 2 +- .../controllerconfig/configassistant.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/controllerconfig/centos/build_srpm.data b/controllerconfig/centos/build_srpm.data index d732a7e202..5a4185072f 100755 --- a/controllerconfig/centos/build_srpm.data +++ b/controllerconfig/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="controllerconfig" -TIS_PATCH_VER=146 +TIS_PATCH_VER=147 diff --git a/controllerconfig/controllerconfig/controllerconfig/configassistant.py b/controllerconfig/controllerconfig/controllerconfig/configassistant.py index 7b754a4362..dae4d56293 100644 --- a/controllerconfig/controllerconfig/controllerconfig/configassistant.py +++ b/controllerconfig/controllerconfig/controllerconfig/configassistant.py @@ -1113,8 +1113,21 @@ class ConfigAssistant(): self.management_start_address = self.management_subnet[2] self.management_end_address = self.management_subnet[-2] if self.management_subnet.size < 255: - print "WARNING: Subnet allows only %d addresses." \ - % self.management_subnet.size + print "WARNING: Subnet allows only %d addresses.\n" \ + "This will not allow you to provision a Cinder LVM" \ + " or Ceph backend." % self.management_subnet.size + while True: + user_input = raw_input( + "Do you want to continue with the current " + "configuration? [Y/n]: ") + if user_input.lower() == 'q' or \ + user_input.lower() == 'n': + raise UserQuit + elif user_input.lower() == 'y' or user_input == "": + break + else: + print "Invalid choice" + continue break except ValidateFail as e: print "{}".format(e)