architecture.py 640 B

12345678910111213141516171819202122
  1. from django.core.management.base import BaseCommand, CommandParser
  2. from services.utils.architecture import export_switch, export_ip
  3. from djadhere.utils import get_active_filter
  4. class Command(BaseCommand):
  5. def add_arguments(self, parser):
  6. parser.add_argument('--switch', action='store_true')
  7. parser.add_argument('--ip', action='store_true')
  8. def handle(self, *args, **options):
  9. if options['switch']:
  10. self.export_switch()
  11. if options['ip']:
  12. self.export_ip()
  13. def export_switch(self):
  14. print(export_switch())
  15. def export_ip(self):
  16. print(export_ip())