Rename timestamp fields according to server change
This is a follow up to the server side changes. Change-Id: I41819cfba550c6832fc536cb88d26e01351d0dec
This commit is contained in:
parent
e4df9991ef
commit
ec375cf551
senlinclient
@ -109,7 +109,7 @@ class ShellTest(testtools.TestCase):
|
||||
client = mock.Mock()
|
||||
profiles = mock.Mock()
|
||||
client.conn.cluster.profiles.return_value = profiles
|
||||
fields = ['id', 'name', 'type', 'created_time']
|
||||
fields = ['id', 'name', 'type', 'created_at']
|
||||
args = {
|
||||
'limit': 20,
|
||||
'marker': 'mark_id',
|
||||
@ -337,7 +337,7 @@ class ShellTest(testtools.TestCase):
|
||||
'global_project': False,
|
||||
'full_id': False,
|
||||
}
|
||||
fields = ['id', 'name', 'type', 'cluster_id', 'action', 'created_time']
|
||||
fields = ['id', 'name', 'type', 'cluster_id', 'action', 'created_at']
|
||||
args = self._make_args(params)
|
||||
queries = copy.deepcopy(params)
|
||||
del queries['filters']
|
||||
@ -455,7 +455,7 @@ class ShellTest(testtools.TestCase):
|
||||
@mock.patch.object(utils, 'print_list')
|
||||
def test_do_policy_list(self, mock_print):
|
||||
client = mock.Mock()
|
||||
fields = ['id', 'name', 'type', 'level', 'cooldown', 'created_time']
|
||||
fields = ['id', 'name', 'type', 'level', 'cooldown', 'created_at']
|
||||
args = {
|
||||
'limit': 20,
|
||||
'marker': 'fake_id',
|
||||
@ -534,8 +534,7 @@ class ShellTest(testtools.TestCase):
|
||||
args = {'id': 'policy_id'}
|
||||
args = self._make_args(args)
|
||||
sh.do_policy_show(client, args)
|
||||
mock_show.assert_called_once_with(client,
|
||||
policy_id='policy_id')
|
||||
mock_show.assert_called_once_with(client, policy_id='policy_id')
|
||||
|
||||
@mock.patch.object(sh, '_show_policy')
|
||||
def test_do_policy_update(self, mock_show):
|
||||
@ -584,8 +583,7 @@ class ShellTest(testtools.TestCase):
|
||||
@mock.patch.object(utils, 'print_list')
|
||||
def test_do_cluster_list(self, mock_print):
|
||||
client = mock.Mock()
|
||||
fields = ['id', 'name', 'status', 'created_time', 'updated_time',
|
||||
'parent']
|
||||
fields = ['id', 'name', 'status', 'created_at', 'updated_at', 'parent']
|
||||
args = {
|
||||
'limit': 20,
|
||||
'marker': 'fake_id',
|
||||
@ -728,8 +726,7 @@ class ShellTest(testtools.TestCase):
|
||||
nodes = mock.Mock()
|
||||
client.nodes.return_value = nodes
|
||||
formatters = {}
|
||||
fields = ['id', 'name', 'index', 'status', 'physical_id',
|
||||
'created_time']
|
||||
fields = ['id', 'name', 'index', 'status', 'physical_id', 'created_at']
|
||||
sh.do_cluster_node_list(client, args)
|
||||
client.nodes.assert_called_once_with(**queries)
|
||||
mock_print.assert_called_once_with(nodes, fields,
|
||||
@ -1096,7 +1093,7 @@ class ShellTest(testtools.TestCase):
|
||||
def test_do_node_list(self, mock_print):
|
||||
client = mock.Mock()
|
||||
fields = ['id', 'name', 'status', 'cluster_id', 'physical_id',
|
||||
'profile_name', 'created_time', 'updated_time']
|
||||
'profile_name', 'created_at', 'updated_at']
|
||||
args = {
|
||||
'cluster': 'cluster1',
|
||||
'sort_keys': 'name',
|
||||
|
@ -53,8 +53,8 @@ class Cluster(resource.Resource):
|
||||
project = resource.prop('project')
|
||||
domain = resource.prop('domain')
|
||||
parent = resource.prop('parent')
|
||||
created_time = resource.prop('created_time')
|
||||
updated_time = resource.prop('updated_time')
|
||||
created_at = resource.prop('created_at')
|
||||
updated_at = resource.prop('updated_at')
|
||||
min_size = resource.prop('min_size', type=int)
|
||||
max_size = resource.prop('max_size', type=int)
|
||||
desired_capacity = resource.prop('desired_capacity', type=int)
|
||||
@ -187,8 +187,8 @@ class Cluster(resource.Resource):
|
||||
'project': self.project,
|
||||
'domain': self.domain,
|
||||
'parent': self.parent,
|
||||
'created_time': self.created_time,
|
||||
'updated_time': self.updated_time,
|
||||
'created_at': self.created_at,
|
||||
'updated_at': self.updated_at,
|
||||
'min_size': self.min_size,
|
||||
'max_size': self.max_size,
|
||||
'desired_capacity': self.desired_capacity,
|
||||
@ -264,9 +264,9 @@ class Node(resource.Resource):
|
||||
profile_name = resource.prop('profile_name')
|
||||
index = resource.prop('index', type=int)
|
||||
role = resource.prop('role')
|
||||
init_time = resource.prop('init_time')
|
||||
created_time = resource.prop('created_time')
|
||||
updated_time = resource.prop('updated_time')
|
||||
init_at = resource.prop('init_at')
|
||||
created_at = resource.prop('created_at')
|
||||
updated_at = resource.prop('updated_at')
|
||||
status = resource.prop('status')
|
||||
status_reason = resource.prop('status_reason')
|
||||
metadata = resource.prop('metadata', type=dict)
|
||||
@ -303,9 +303,9 @@ class Node(resource.Resource):
|
||||
'project': self.project,
|
||||
'index': self.index,
|
||||
'role': self.role,
|
||||
'init_time': self.init_time,
|
||||
'created_time': self.created_time,
|
||||
'updated_time': self.updated_time,
|
||||
'init_at': self.init_at,
|
||||
'created_at': self.created_at,
|
||||
'updated_at': self.updated_at,
|
||||
'status': self.status,
|
||||
'status_reason': self.status_reason,
|
||||
'metadata': self.metadata,
|
||||
@ -385,7 +385,7 @@ class Receiver(resource.Resource):
|
||||
type = resource.prop('type')
|
||||
cluster_id = resource.prop('cluster_id')
|
||||
action = resource.prop('action')
|
||||
created_time = resource.prop('created_time')
|
||||
created_at = resource.prop('created_at')
|
||||
actor = resource.prop('actor', type=dict)
|
||||
params = resource.prop('params', type=dict)
|
||||
channel = resource.prop('channel', type=dict)
|
||||
|
@ -80,7 +80,7 @@ def do_profile_type_show(sc, args):
|
||||
help=_('Print full IDs in list.'))
|
||||
def do_profile_list(sc, args=None):
|
||||
"""List profiles that meet the criteria."""
|
||||
fields = ['id', 'name', 'type', 'created_time']
|
||||
fields = ['id', 'name', 'type', 'created_at']
|
||||
queries = {
|
||||
'limit': args.limit,
|
||||
'marker': args.marker,
|
||||
@ -246,7 +246,7 @@ def do_policy_type_show(sc, args):
|
||||
help=_('Print full IDs in list.'))
|
||||
def do_policy_list(sc, args=None):
|
||||
"""List policies that meet the criteria."""
|
||||
fields = ['id', 'name', 'type', 'level', 'cooldown', 'created_time']
|
||||
fields = ['id', 'name', 'type', 'level', 'cooldown', 'created_at']
|
||||
queries = {
|
||||
'limit': args.limit,
|
||||
'marker': args.marker,
|
||||
@ -375,8 +375,8 @@ def do_policy_delete(sc, args):
|
||||
help=_('Print full IDs in list.'))
|
||||
def do_cluster_list(sc, args=None):
|
||||
"""List the user's clusters."""
|
||||
fields = ['id', 'name', 'status', 'created_time', 'updated_time']
|
||||
sort_keys = ['name', 'status', 'created_time', 'updated_time']
|
||||
fields = ['id', 'name', 'status', 'created_at', 'updated_at']
|
||||
sort_keys = ['name', 'status', 'created_at', 'updated_at']
|
||||
queries = {
|
||||
'limit': args.limit,
|
||||
'marker': args.marker,
|
||||
@ -394,7 +394,7 @@ def do_cluster_list(sc, args=None):
|
||||
# we only validate the sort keys
|
||||
# - if all keys are valid, we won't enforce sorting in the resulting list
|
||||
# - if any keys are invalid, we abort the command execution;
|
||||
# - if no sort key is specified, we use created_time column for sorting
|
||||
# - if no sort key is specified, we use created_at column for sorting
|
||||
if args.sort_keys:
|
||||
for key in args.sort_keys.split(';'):
|
||||
if len(key) > 0 and key not in sort_keys:
|
||||
@ -559,7 +559,7 @@ def do_cluster_node_list(sc, args):
|
||||
else:
|
||||
formatters = {}
|
||||
|
||||
fields = ['id', 'name', 'index', 'status', 'physical_id', 'created_time']
|
||||
fields = ['id', 'name', 'index', 'status', 'physical_id', 'created_at']
|
||||
utils.print_list(nodes, fields, formatters=formatters, sortby_index=5)
|
||||
|
||||
|
||||
@ -879,8 +879,8 @@ def do_node_list(sc, args):
|
||||
"""Show list of nodes."""
|
||||
|
||||
fields = ['id', 'name', 'status', 'cluster_id', 'physical_id',
|
||||
'profile_name', 'created_time', 'updated_time']
|
||||
sort_keys = ['index', 'name', 'created_time', 'updated_time', 'status']
|
||||
'profile_name', 'created_at', 'updated_at']
|
||||
sort_keys = ['index', 'name', 'created_at', 'updated_at', 'status']
|
||||
|
||||
queries = {
|
||||
'cluster_id': args.cluster,
|
||||
@ -1067,8 +1067,8 @@ def do_node_leave(sc, args):
|
||||
help=_('Print full IDs in list.'))
|
||||
def do_receiver_list(sc, args=None):
|
||||
"""List receivers that meet the criteria."""
|
||||
fields = ['id', 'name', 'type', 'cluster_id', 'action', 'created_time']
|
||||
sort_keys = ['name', 'type', 'cluster_id', 'created_time']
|
||||
fields = ['id', 'name', 'type', 'cluster_id', 'action', 'created_at']
|
||||
sort_keys = ['name', 'type', 'cluster_id', 'created_at']
|
||||
queries = {
|
||||
'limit': args.limit,
|
||||
'marker': args.marker,
|
||||
@ -1259,7 +1259,7 @@ def do_action_list(sc, args):
|
||||
|
||||
fields = ['id', 'name', 'action', 'status', 'target', 'depends_on',
|
||||
'depended_by']
|
||||
sort_keys = ['name', 'target', 'action', 'created_time', 'status']
|
||||
sort_keys = ['name', 'target', 'action', 'created_at', 'status']
|
||||
|
||||
queries = {
|
||||
'sort_keys': args.sort_keys,
|
||||
|
Loading…
x
Reference in New Issue
Block a user