tools/qvm-ls: fix handling columns with underscore
Mangling column type was inconsistent, resulting in KeyError('VIRT_MODE').
This commit is contained in:
parent
c82d5b0a73
commit
917df5a8c5
@ -86,6 +86,17 @@ class TC_50_List(qubesadmin.tests.QubesTestCase):
|
||||
'dom0 Running TestVM black - -\n'
|
||||
'test-vm Running TestVM green template sys-net\n')
|
||||
|
||||
def test_101_list_with_underscore(self):
|
||||
app = TestApp()
|
||||
app.domains['test-vm'].virt_mode = 'pv'
|
||||
app.domains['test-vm'].label = 'green'
|
||||
app.domains['dom0'].label = 'black'
|
||||
with qubesadmin.tests.tools.StdoutBuffer() as stdout:
|
||||
qubesadmin.tools.qvm_ls.main(['-O', 'name,virt_mode,class'], app=app)
|
||||
self.assertEqual(stdout.getvalue(),
|
||||
'NAME VIRT-MODE CLASS\n'
|
||||
'dom0 - TestVM\n'
|
||||
'test-vm pv TestVM\n')
|
||||
|
||||
class TC_90_List_with_qubesd_calls(qubesadmin.tests.QubesTestCase):
|
||||
def test_100_list_with_status(self):
|
||||
|
@ -389,7 +389,8 @@ class Table(object):
|
||||
'''
|
||||
def __init__(self, app, colnames, spinner, raw_data=False):
|
||||
self.app = app
|
||||
self.columns = tuple(Column.columns[col.upper()] for col in colnames)
|
||||
self.columns = tuple(Column.columns[col.upper().replace('_', '-')]
|
||||
for col in colnames)
|
||||
self.spinner = spinner
|
||||
self.raw_data = raw_data
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user