Revision 1229a55f snf-cyclades-app/synnefo/logic/management/commands/floating-ip-create.py

b/snf-cyclades-app/synnefo/logic/management/commands/floating-ip-create.py
44 44

  
45 45
    option_list = BaseCommand.option_list + (
46 46
        make_option(
47
            '--pool',
48
            dest='pool',
49
            help="The ID of the floating IP pool(network) to allocate the"
50
                 " address from"),
47
            '--network',
48
            dest='network_id',
49
            help="The ID of the network to allocate the address from"),
51 50
        make_option(
52 51
            '--address',
53 52
            dest='address',
......
64 63
        if args:
65 64
            raise CommandError("Command doesn't accept any arguments")
66 65

  
67
        network_id = options['pool']
66
        network_id = options['network_id']
68 67
        address = options['address']
69 68
        owner = options['owner']
70 69

  
......
74 73
        if network_id is not None:
75 74
            network = util.get_network(network_id, owner, for_update=True,
76 75
                                       non_deleted=True)
76
            if not network.floating_ip_pool:
77
                raise CommandError("Network '%s' is not a floating IP pool."
78
                                   % network)
77 79
        else:
78 80
            network = None
79 81

  

Also available in: Unified diff