Revision 971645d6 flowspec/models.py
b/flowspec/models.py | ||
---|---|---|
62 | 62 |
db_table = u'then_action' |
63 | 63 |
|
64 | 64 |
class Route(models.Model): |
65 |
name = models.CharField(max_length=128)
|
|
65 |
name = models.SlugField(max_length=128)
|
|
66 | 66 |
applier = models.ForeignKey(User, blank=True, null=True) |
67 | 67 |
source = models.CharField(max_length=32, blank=True, null=True, help_text=u"Network address. Use address/CIDR notation", verbose_name="Source Address") |
68 | 68 |
sourceport = models.ManyToManyField(MatchPort, blank=True, null=True, related_name="matchSourcePort", verbose_name="Source Port") |
69 |
destination = models.CharField(max_length=32, blank=True, null=True, help_text=u"Network address. Use address/CIDR notation", verbose_name="Destination Address")
|
|
69 |
destination = models.CharField(max_length=32, help_text=u"Network address. Use address/CIDR notation", verbose_name="Destination Address") |
|
70 | 70 |
destinationport = models.ManyToManyField(MatchPort, blank=True, null=True, related_name="matchDestinationPort", verbose_name="Destination Port") |
71 | 71 |
port = models.ManyToManyField(MatchPort, blank=True, null=True, related_name="matchPort", verbose_name="Port" ) |
72 | 72 |
dscp = models.ManyToManyField(MatchDscp, blank=True, null=True, verbose_name="DSCP") |
... | ... | |
135 | 135 |
try: |
136 | 136 |
routes = device.routing_options[0].routes |
137 | 137 |
except Exception as e: |
138 |
self.is_online = False |
|
139 |
self.save() |
|
138 | 140 |
logger.error("No routing options on device. Exception: %s" %e) |
139 | 141 |
return False |
140 | 142 |
for route in routes: |
Also available in: Unified diff