I want to add retry logic and. refactor the code in the python socket connect code I have the below Python code which checks whether the ssh host is up or not: