]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix linting errors
authorPere Diaz Bou <pdiazbou@redhat.com>
Tue, 5 Jul 2022 08:10:23 +0000 (10:10 +0200)
committerPere Diaz Bou <pdiazbou@redhat.com>
Tue, 12 Jul 2022 17:09:02 +0000 (19:09 +0200)
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
src/pybind/mgr/dashboard/openapi.yaml
src/pybind/mgr/dashboard/services/rbd.py

index 9f2738bbd489e12851d787ede27a3809b418bf71..49f4632f0ebc2ebe4d777b5f73e6ce5b58e99742 100644 (file)
@@ -167,7 +167,7 @@ describe('IscsiTargetFormComponent', () => {
     httpTesting.expectOne('ui-api/iscsi/settings').flush(SETTINGS);
     httpTesting.expectOne('ui-api/iscsi/portals').flush(PORTALS);
     httpTesting.expectOne('ui-api/iscsi/version').flush(VERSION);
-    httpTesting.expectOne('api/block/image?offset=0&limit=-1').flush(RBD_LIST);
+    httpTesting.expectOne('api/block/image?offset=0&limit=-1&search=&sort=%3Ename').flush(RBD_LIST);
     httpTesting.expectOne('api/iscsi/target').flush(LIST_TARGET);
     httpTesting.verify();
   });
index 734118632ae9ac5bd1d38d2a52f054f37cebcf41..f43bd0a1ff17bebfc07f4cfb494cda84e26f0a2e 100644 (file)
@@ -658,7 +658,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
       context.search = this.userConfig.search;
       if (this.userConfig.sorts?.length) {
         const sort = this.userConfig.sorts[0];
-        context.sort = `${sort.dir == 'desc' ? '<' : '>'}${sort.prop}`;
+        context.sort = `${sort.dir === 'desc' ? '<' : '>'}${sort.prop}`;
       }
       this.fetchData.emit(context);
       this.updating = true;
index 8d07d74f09cf216ed3ae17510aa96469139c019e..83bd98c2ed1621507457fcd3d9c57dabf16d899c 100644 (file)
@@ -171,6 +171,11 @@ paths:
         name: search
         schema:
           type: string
+      - default: ''
+        in: query
+        name: sort
+        schema:
+          type: string
       responses:
         '200':
           content:
index 21ecd34f15769258dda5f46fcc3e646c2ae43ef3..4071943a3041fe9c80a81ee6bc505d3f4dc59da2 100644 (file)
@@ -430,7 +430,8 @@ class RbdService(object):
         return joint_refs
 
     @classmethod
-    def rbd_pool_list(cls, pool_names: List[str], namespace=None, offset=0, limit=0, search='', sort=''):
+    def rbd_pool_list(cls, pool_names: List[str], namespace=None, offset=0, limit=0,
+                      search='', sort=''):
         offset = int(offset)
         limit = int(limit)
         # let's use -1 to denotate we want ALL images for now. Iscsi currently gathers
@@ -451,6 +452,8 @@ class RbdService(object):
 
         result = []
         end = offset + limit
+        if len(sort) < 2:
+            sort = '>name'
         descending = sort[0] == '<'
         sort_by = sort[1:]
         if sort_by == 'pool_name':