Enhance warning for mgmt network configuration

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 <kristine.bujold@windriver.com>
This commit is contained in:
Kristine Bujold 2018-10-04 15:43:19 -04:00
parent 0ffdae6953
commit 7d16a8a9d9
2 changed files with 16 additions and 3 deletions

View File

@ -1,2 +1,2 @@
SRC_DIR="controllerconfig"
TIS_PATCH_VER=146
TIS_PATCH_VER=147

View File

@ -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)