Эх сурвалжийг харах

solved remove static routes #30

Roberto Berto 5 жил өмнө
parent
commit
f1607cc407

+ 1 - 1
vycenter/static/templates/static/list.html

@@ -31,7 +31,7 @@
         <td>{{ x.route }}</td>
         <td>
             {% for y in x.nexthop %}
-                {{ y }}  <a href=" url 'static:static-remove' route=x.route|routepack nexthop=y ">delete</a></td>
+                {{ y }}  <a href="{% url 'static:static-remove' route=x.route|routepack nexthop=y %}">delete</a></td>
             {% endfor %}
         </td>
     </tr>

+ 2 - 1
vycenter/vyos.py

@@ -204,7 +204,8 @@ def set_route_static(hostname, subnet, nexthop):
     return result1  
 
 def delete_route_static(hostname, subnet, nexthop):
-    cmd = {"op": "delete", "path": ["protocols","static","route", subnet, "next-hop", nexthop]}
+    #cmd = {"op": "delete", "path": ["protocols","static","route", subnet, "next-hop", nexthop]}
+    cmd = {"op": "delete", "path": ["protocols","static","route", subnet]}
 
     result1 = api_set(hostname, cmd)
     return result1