Permalink
Browse files

FEATURE: Reject common hostnames ('frontend' and 'backend')

This fixes JIRA: STACKI-350
  • Loading branch information...
khanfluence committed Jun 1, 2018
1 parent 94624d5 commit fbdb1ea33abb77ff8bd917ac1a66ec29e4b0d45a
Showing with 11 additions and 0 deletions.
  1. +11 −0 tools/fab/frontend-install.py
@@ -299,6 +299,11 @@ def usage():
attrs['HOSTNAME'] = fqdn.pop(0)
attrs['DOMAIN'] = '.'.join(fqdn)
# Reject frontend and backend as hostnames
if attrs['HOSTNAME'].lower() in ['frontend', 'backend']:
print('Cannot have an appliance name as a hostname')
sys.exit(1)
# Figure out which interface to use
interfaces = []
for line in subprocess.check_output("ip -o -4 address", shell=True).splitlines():
@@ -489,6 +494,12 @@ def usage():
split = line.split(":",1)
attributes[split[0]]=split[1]
# Reject frontend and backend as hostnames
hostname = attributes['Kickstart_PrivateHostname'].lower()
if hostname in ['frontend', 'backend']:
print('Cannot have an appliance name as a hostname')
sys.exit(1)
if not use_existing:
# fix hostfile
with open("/etc/hosts", "a") as f:

0 comments on commit fbdb1ea

Please sign in to comment.