Forráskód Böngészése

solved remove static routes #30

Roberto Berto 5 éve
szülő
commit
f1607cc407
2 módosított fájl, 3 hozzáadás és 2 törlés
  1. 1 1
      vycenter/static/templates/static/list.html
  2. 2 1
      vycenter/vyos.py

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

@@ -31,7 +31,7 @@
         <td>{{ x.route }}</td>
         <td>{{ x.route }}</td>
         <td>
         <td>
             {% for y in x.nexthop %}
             {% 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 %}
             {% endfor %}
         </td>
         </td>
     </tr>
     </tr>

+ 2 - 1
vycenter/vyos.py

@@ -204,7 +204,8 @@ def set_route_static(hostname, subnet, nexthop):
     return result1  
     return result1  
 
 
 def delete_route_static(hostname, subnet, nexthop):
 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)
     result1 = api_set(hostname, cmd)
     return result1  
     return result1