virtManager.delete: don't allow deleting SCSI disks

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-03-06 09:28:52 +01:00 committed by Cole Robinson
parent 31e923dbdf
commit 8225cac648

View File

@ -340,9 +340,11 @@ def can_delete(conn, vol, path):
if vol:
# Managed storage
if (vol.get_parent_pool().get_type() ==
virtinst.StoragePool.TYPE_ISCSI):
pool_type = vol.get_parent_pool().get_type()
if pool_type == virtinst.StoragePool.TYPE_ISCSI:
msg = _("Cannot delete iscsi share.")
elif pool_type == virtinst.StoragePool.TYPE_SCSI:
msg = _("Cannot delete SCSI device.")
else:
if conn.is_remote():
msg = _("Cannot delete unmanaged remote storage.")