Revision c52f91ad snf-cyclades-app/synnefo/api/management/commands/subnet-create.py

b/snf-cyclades-app/synnefo/api/management/commands/subnet-create.py
36 36
from django.core.management.base import BaseCommand, CommandError
37 37
from synnefo.management import common
38 38
from snf_django.management.utils import parse_bool
39
from synnefo.management import pprint
39 40

  
40 41
from synnefo.logic import subnets
41 42

  
......
107 108
        dns = options["dns"]
108 109
        host_routes = options["host_routes"]
109 110

  
110
        subnets.create_subnet(name=name,
111
                              network_id=network_id,
112
                              cidr=cidr,
113
                              allocation_pools=allocation_pools,
114
                              gateway=gateway,
115
                              ipversion=ipversion,
116
                              dhcp=dhcp,
117
                              slaac=dhcp,
118
                              dns_nameservers=dns,
119
                              host_routes=host_routes,
120
                              user_id=user_id)
111
        sub = subnets.create_subnet(name=name,
112
                                    network_id=network_id,
113
                                    cidr=cidr,
114
                                    allocation_pools=allocation_pools,
115
                                    gateway=gateway,
116
                                    ipversion=ipversion,
117
                                    dhcp=dhcp,
118
                                    slaac=dhcp,
119
                                    dns_nameservers=dns,
120
                                    host_routes=host_routes,
121
                                    user_id=user_id)
122

  
123
        pprint.pprint_subnet_in_db(sub, stdout=self.stdout)
124
        self.stdout.write("\n\n")
125
        pprint.pprint_ippool(sub, stdout=self.stdout)

Also available in: Unified diff