- call(self._render_config('route_add', dict(
- dev = device.name,
- net_addr = route.net_addr,
- prefix = route.prefix,
- gateway = route.gateway,
- )
+ try:
+ call(self._render_config('route_add', dict(
+ dev = device.name,
+ net_addr = route.net_addr,
+ prefix = route.prefix,
+ gateway = route.gateway,
+ )
+ ), shell=True)
+ except ExecutionError, e:
+ print e
+ if self.hops:
+ try:
+ call('ip route del default', shell=True)
+ except ExecutionError, e:
+ print e
+ try:
+ call(self._render_config('hop', dict(
+ hops = self.hops,
+ )