@Name: is_server_ssh_ready @Input: timeout: tcp connection timeout flag, others information need to be added @Output:object for SshClient Name of the function is little misnomer and is not verifying anything as such mentioned
(ipaddress, port, username, password, retries=20, retryinterv=30, timeout=10.0, keyPairFileLocation=None)
| 165 | obj.delete(api_client) |
| 166 | |
| 167 | def is_server_ssh_ready(ipaddress, port, username, password, retries=20, retryinterv=30, timeout=10.0, keyPairFileLocation=None): |
| 168 | ''' |
| 169 | @Name: is_server_ssh_ready |
| 170 | @Input: timeout: tcp connection timeout flag, |
| 171 | others information need to be added |
| 172 | @Output:object for SshClient |
| 173 | Name of the function is little misnomer and is not |
| 174 | verifying anything as such mentioned |
| 175 | ''' |
| 176 | |
| 177 | try: |
| 178 | ssh = SshClient( |
| 179 | host=ipaddress, |
| 180 | port=port, |
| 181 | user=username, |
| 182 | passwd=password, |
| 183 | keyPairFiles=keyPairFileLocation, |
| 184 | retries=retries, |
| 185 | delay=retryinterv, |
| 186 | timeout=timeout) |
| 187 | except Exception as e: |
| 188 | raise Exception("SSH connection has Failed. Waited %ss. Error is %s" % (retries * retryinterv, str(e))) |
| 189 | else: |
| 190 | return ssh |
| 191 | |
| 192 | |
| 193 | def format_volume_to_ext3(ssh_client, device="/dev/sda"): |