Skip to content

Commit

Permalink
InstallRhel: Fix setting hostname properly
Browse files Browse the repository at this point in the history
Currently hostname is set with ip address during rhel OS installation.
This patch fixes it by setting the hostname with dns name properly.
For this user need to suppy host name in --host-name

Fixes: #261

Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
  • Loading branch information
pridhiviraj committed Jun 24, 2018
1 parent 1c811b8 commit cb5fadd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions OpTestConfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def get_parser():
help="Prompt for Host SSH session")

hostinstgroup = parser.add_argument_group('Host OS Install', 'Options for installing an OS on the Host')
hostinstgroup.add_argument("--host-name", help="Host name", default="localhost")
hostinstgroup.add_argument("--host-gateway", help="Host Gateway", default="")
hostinstgroup.add_argument("--host-submask", help="Host Subnet Mask", default="255.255.255.0")
hostinstgroup.add_argument("--host-mac",
Expand Down
4 changes: 3 additions & 1 deletion testcases/InstallRhel.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def setUp(self):
self.fail("Provide host user details refer, --host-{user,password}")
if not self.conf.args.host_scratch_disk:
self.fail("Provide proper host disk to install refer, --host-scratch-disk")
if not self.conf.args.host_name:
self.fail("Provide hostname to be set during installation")

def runTest(self):
self.system.goto_state(OpSystemState.PETITBOOT_SHELL)
Expand Down Expand Up @@ -84,7 +86,7 @@ def runTest(self):
self.host.ip,
self.conf.args.host_gateway,
self.conf.args.host_submask,
self.host.hostname(),
self.conf.args.host_name,
self.conf.args.host_dns,
ks_url)
self.c = self.system.sys_get_ipmi_console()
Expand Down

0 comments on commit cb5fadd

Please sign in to comment.