root / cron_fetch_networks.py @ master
History | View | Annotate | Download (443 Bytes)
1 | 049a5a10 | Leonidas Poulopoulos | from django.core.management import setup_environ |
---|---|---|---|
2 | 049a5a10 | Leonidas Poulopoulos | import settings |
3 | 049a5a10 | Leonidas Poulopoulos | setup_environ(settings) |
4 | 049a5a10 | Leonidas Poulopoulos | from django.core.mail import send_mail |
5 | 049a5a10 | Leonidas Poulopoulos | from flowspy.peers.models import * |
6 | 049a5a10 | Leonidas Poulopoulos | |
7 | 049a5a10 | Leonidas Poulopoulos | |
8 | 049a5a10 | Leonidas Poulopoulos | def populate_networks(): |
9 | 049a5a10 | Leonidas Poulopoulos | peers = Peer.objects.all() |
10 | 049a5a10 | Leonidas Poulopoulos | for peer in peers: |
11 | 049a5a10 | Leonidas Poulopoulos | peer.fill_networks() |
12 | 049a5a10 | Leonidas Poulopoulos | # if peer_networks > 0:
|
13 | 049a5a10 | Leonidas Poulopoulos | # send_mail('Peer networks added , 'noreply@grnet.gr', ['leopoul@noc.grnet.gr'])
|
14 | 049a5a10 | Leonidas Poulopoulos | |
15 | 049a5a10 | Leonidas Poulopoulos | |
16 | 049a5a10 | Leonidas Poulopoulos | if __name__ == "__main__": |
17 | 049a5a10 | Leonidas Poulopoulos | populate_networks() |