Make trunk commands handle timestamps for trunk resources

Partial-implements: blueprint vlan-aware-vms
Change-Id: I853ae5d01401cf9df429b2e3f4565c2aef8a34dd
This commit is contained in:
Armando Migliaccio 2016-08-29 23:09:47 -07:00 committed by Ihar Hrachyshka
parent 89d4a9a2ea
commit 496969e05d
2 changed files with 11 additions and 1 deletions

View File

@ -159,10 +159,14 @@ class ListNetworkTrunk(command.Lister):
headers += (
'Status',
'State',
'Created At',
'Updated At',
)
columns += (
'status',
'admin_state_up',
'created_at',
'updated_at'
)
return (headers,
(utils.get_dict_properties(

View File

@ -295,7 +295,9 @@ class TestShowNetworkTrunk(test_fakes.TestNeutronClientOSCV2):
class TestListNetworkTrunk(test_fakes.TestNeutronClientOSCV2):
# Create trunks to be listed.
_trunks = fakes.FakeTrunk.create_trunks(count=3)
_trunks = fakes.FakeTrunk.create_trunks(
{'created_at': '2001-01-01 00:00:00',
'updated_at': '2001-01-01 00:00:00'}, count=3)
columns = (
'ID',
@ -306,6 +308,8 @@ class TestListNetworkTrunk(test_fakes.TestNeutronClientOSCV2):
columns_long = columns + (
'Status',
'State',
'Created At',
'Updated At'
)
data = []
for t in _trunks:
@ -324,6 +328,8 @@ class TestListNetworkTrunk(test_fakes.TestNeutronClientOSCV2):
t['description'],
t['status'],
trunk._format_admin_state(t['admin_state_up']),
'2001-01-01 00:00:00',
'2001-01-01 00:00:00',
))
def setUp(self):