Skip to content

Commit 22eced3

Browse files
authored
Merge pull request #765 from globocom/add_except_to_ssh_error_disk_resize
adding SSHException validation on disk resize task
2 parents d191c03 + 6772621 commit 22eced3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dbaas/maintenance/tasks_disk_resize.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from dbaas_zabbix.metrics import ZabbixMetrics
1313
from logical.errors import BusyDatabaseError
1414
from logical.models import Database
15+
from paramiko.ssh_exception import SSHException
1516
from physical.errors import DiskOfferingMaxAutoResize
1617
from physical.models import Environment, DiskOffering
1718
from physical.ssh import ScriptFailedException
@@ -266,6 +267,16 @@ def host_mount_data_percentage(host, task):
266267
message="Could not load mount size: {}".format(str(err)), level=4
267268
)
268269
return None, None, None
270+
except SSHException as err:
271+
task.add_detail(
272+
message="Could not connect to Host SSH: {}".format(str(err)), level=4
273+
)
274+
return None, None, None
275+
except Exception as err:
276+
task.add_detail(
277+
message="Error when mounting /data from host: {}".format(str(err)), level=4
278+
)
279+
return None, None, None
269280

270281
values = output["stdout"][0].strip().split()
271282

0 commit comments

Comments
 (0)