Browse Source

Merge "Fix restore index page"

tags/0.2.0
Jenkins 2 years ago
parent
commit
dc4900a896
1 changed files with 9 additions and 5 deletions
  1. 9
    5
      karbor_dashboard/restores/views.py

+ 9
- 5
karbor_dashboard/restores/views.py View File

@@ -55,13 +55,17 @@ class IndexView(horizon_tables.DataTableView):
55 55
                     reversed_order=reversed_order)
56 56
 
57 57
             for restore in restores:
58
-                checkpoint = karborclient.checkpoint_get(
59
-                    self.request,
60
-                    restore.provider_id,
61
-                    restore.checkpoint_id)
58
+                try:
59
+                    checkpoint = karborclient.checkpoint_get(
60
+                        self.request,
61
+                        restore.provider_id,
62
+                        restore.checkpoint_id)
63
+                    plan_name = checkpoint.protection_plan["name"]
64
+                except Exception:
65
+                    plan_name = "Not Found"
62 66
                 provider = karborclient.provider_get(self.request,
63 67
                                                      restore.provider_id)
64
-                setattr(restore, "name", checkpoint.protection_plan["name"])
68
+                setattr(restore, "name", plan_name)
65 69
                 setattr(restore, "provider_name", provider.name)
66 70
 
67 71
         except Exception:

Loading…
Cancel
Save