Skip to content

Commit a217ee4

Browse files
committed
fix(LinstorSR): explicit errors when database path is fetched
1 parent b55072d commit a217ee4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/LinstorSR.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,15 +766,15 @@ def scan(self, uuid):
766766
# is started without a shared and mounted /var/lib/linstor path.
767767
try:
768768
self._linstor.get_database_path()
769-
except Exception:
769+
except Exception as e:
770770
# Failed to get database path, ensure we don't have
771771
# VDIs in the XAPI database...
772772
if self.session.xenapi.SR.get_VDIs(
773773
self.session.xenapi.SR.get_by_uuid(self.uuid)
774774
):
775775
raise xs_errors.XenError(
776776
'SRUnavailable',
777-
opterr='Database is not mounted'
777+
opterr='Database is not mounted or node name is invalid ({})'.format(e)
778778
)
779779

780780
# Update the database before the restart of the GC to avoid

drivers/linstorvolumemanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2648,7 +2648,7 @@ def _request_database_path(cls, lin, activate=False):
26482648
)
26492649
except Exception as e:
26502650
raise LinstorVolumeManagerError(
2651-
'Unable to get resources during database creation: {}'
2651+
'Unable to fetch database resource: {}'
26522652
.format(e)
26532653
)
26542654

0 commit comments

Comments
 (0)