Beispiel #1
0
 def handle(self, *args, **options):
     if len(args) == 1:
         name = args[0]
         slug = slugify(name)
         n = Network(name=name, slug=slug)
         n.save()
     else:
         self.stderr.write("Invalid usage, try --help\n")
Beispiel #2
0
    def handle(self, *args, **options):
        if len(args) == 2:
            try:
                network = args[0]
                IpRange(network)
            except:
                print("Invalid network %s" % network)
                return
            name = args[1]
 
            n = Network(name=name, network=network)
            n.save()
        else:
            self.stderr.write("Invalid usage, try --help\n")