Loading ccserver/ccserver.py +6 −2 Original line number Diff line number Diff line Loading @@ -238,7 +238,7 @@ class CCServer(object): return right['target'] == 'allow' return False def list(self, query, show=set(), pure=False): def list(self, query, show=set(), pure=False, return_toshow=False): ''' List objects on the server. Loading @@ -250,6 +250,7 @@ class CCServer(object): parser = TqlParser(query) ast, to_show, to_get, to_check = parser.parse() orig_to_show = copy(to_show) to_show += show # Calculate the tags to get/check/show: Loading Loading @@ -295,4 +296,7 @@ class CCServer(object): for obj in objects: objects_dicts.append(obj.to_dict(to_display, deny=deny)) if return_toshow: return objects_dicts, orig_to_show else: return objects_dicts ccserver/handlers.py +5 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,11 @@ class CliHandler(OnlineCCHandler): self._check(conn, 'list', query) logging.debug('Executed list function with query %s', query) objects = self._server.list(query) return {'objects': objects, 'order': ['id']} objects, tags = self._server.list(query, return_toshow=True) order = ['id'] if tags is not None: order += tags return {'objects': objects, 'order': order} def _vm_action(self, query, method, *args, **kwargs): vms = self._server.list(query, show=set(('r', 'h'))) Loading Loading
ccserver/ccserver.py +6 −2 Original line number Diff line number Diff line Loading @@ -238,7 +238,7 @@ class CCServer(object): return right['target'] == 'allow' return False def list(self, query, show=set(), pure=False): def list(self, query, show=set(), pure=False, return_toshow=False): ''' List objects on the server. Loading @@ -250,6 +250,7 @@ class CCServer(object): parser = TqlParser(query) ast, to_show, to_get, to_check = parser.parse() orig_to_show = copy(to_show) to_show += show # Calculate the tags to get/check/show: Loading Loading @@ -295,4 +296,7 @@ class CCServer(object): for obj in objects: objects_dicts.append(obj.to_dict(to_display, deny=deny)) if return_toshow: return objects_dicts, orig_to_show else: return objects_dicts
ccserver/handlers.py +5 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,11 @@ class CliHandler(OnlineCCHandler): self._check(conn, 'list', query) logging.debug('Executed list function with query %s', query) objects = self._server.list(query) return {'objects': objects, 'order': ['id']} objects, tags = self._server.list(query, return_toshow=True) order = ['id'] if tags is not None: order += tags return {'objects': objects, 'order': order} def _vm_action(self, query, method, *args, **kwargs): vms = self._server.list(query, show=set(('r', 'h'))) Loading