Commit 9fca638d authored by Antoine Millet's avatar Antoine Millet

[bug#4070] Avoid duplicate tags in order list.

parent 992883f9
......@@ -7,6 +7,7 @@ import inspect
import logging
from sjrpc.utils import RpcHandler
from sjrpc.core import RpcError
from ccserver.orderedset import OrderedSet
from ccserver.conf import CCConf
from ccserver.exceptions import (AlreadyRegistered, AuthenticationError,
RightError, ReservedTagError, BadObjectError,
......@@ -196,10 +197,10 @@ class CliHandler(OnlineCCHandler):
self._check(conn, 'list', query)
logging.debug('Executed list function with query %s', query)
objects, tags = self._server.list(query, return_toshow=True)
order = ['id']
order = OrderedSet(['id'])
if tags is not None:
order += tags
return {'objects': objects, 'order': order}
order |= OrderedSet(tags)
return {'objects': objects, 'order': list(order)}
def _vm_action(self, query, method, *args, **kwargs):
vms = self._server.list(query, show=set(('r', 'h')))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment