Skip to content

Commit 57fe38e

Browse files
committed
add check hostname during installation
1 parent 47d52ad commit 57fe38e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

python/lib/cloudutils/syscfg.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ def check(self):
7272
return True
7373

7474
if os.geteuid() != 0:
75-
raise CloudInternalException("Need to execute with root permission")
75+
raise CloudInternalException("Need to execute with root permission\n")
7676

77+
hostname = bash("hostname -f")
78+
if not hostname.isSuccess():
79+
raise CloudInternalException("Checking hostname ... [Failed]\nPlease edit /etc/hosts, add a Fully Qualified Domain Name as your hostname\n")
80+
7781
kvmEnabled = self.svo.isKVMEnabled()
7882
if not kvmEnabled:
7983
raise CloudInternalException("Checking KVM...[Failed]\nPlease enable KVM on this machine\n")
@@ -125,7 +129,7 @@ def check(self):
125129
raise CloudInternalException("Need to execute with root permission")
126130
hostname = bash("hostname -f")
127131
if not hostname.isSuccess():
128-
raise CloudInternalException("Checking hostname ... [Failed]\nNeed to have a Fully Qualified Domain Name as your hostname")
132+
raise CloudInternalException("Checking hostname ... [Failed]\nPlease edit /etc/hosts, add a Fully Qualified Domain Name as your hostname\n")
129133
return True
130134

131135
class sysConfigServerRedhat(sysConfigServer):

0 commit comments

Comments
 (0)