host: Print iscsi volume key as well in volume list
Suggested here: http://www.redhat.com/archives/virt-tools-list/2013-December/msg00014.html
This commit is contained in:
parent
70f1f8df1e
commit
2a25c8d37d
|
@ -1316,7 +1316,7 @@ def populate_storage_volumes(list_widget, pool, sensitive_cb):
|
|||
|
||||
try:
|
||||
path = vol.get_target_path()
|
||||
name = vol.get_name()
|
||||
name = vol.get_pretty_name(pool.get_type())
|
||||
cap = vol.get_pretty_capacity()
|
||||
fmt = vol.get_format() or ""
|
||||
except:
|
||||
|
|
|
@ -62,6 +62,8 @@ class vmmStorageVolume(vmmLibvirtObject):
|
|||
# XML accessors #
|
||||
#################
|
||||
|
||||
def get_key(self):
|
||||
return self.get_xmlobj().key or ""
|
||||
def get_target_path(self):
|
||||
return self.get_xmlobj().target_path or ""
|
||||
def get_format(self):
|
||||
|
@ -76,6 +78,16 @@ class vmmStorageVolume(vmmLibvirtObject):
|
|||
def get_pretty_allocation(self):
|
||||
return util.pretty_bytes(self.get_allocation())
|
||||
|
||||
def get_pretty_name(self, pooltype):
|
||||
name = self.get_name()
|
||||
if pooltype != "iscsi":
|
||||
return name
|
||||
|
||||
key = self.get_key()
|
||||
if not key:
|
||||
return name
|
||||
return "%s (%s)" % (name, key)
|
||||
|
||||
|
||||
class vmmStoragePool(vmmLibvirtObject):
|
||||
__gsignals__ = {
|
||||
|
|
Loading…
Reference in New Issue