fix bugs of install host discovery.py

Signed-off-by: Samuel Deng <mr.dengshuoling@gmail.com>