~midokura/nova/network-refactoring

« back to all changes in this revision

Viewing changes to nova/api/ec2/cloud.py

  • Committer: Ryu Ishimoto
  • Date: 2011-06-30 03:39:04 UTC
  • mfrom: (1118.1.112 nova)
  • Revision ID: ryu@midokura.jp-20110630033904-7l6m3wzdyx95tq01
Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
"""
24
24
 
25
25
import base64
26
 
import IPy
 
26
import netaddr
27
27
import os
28
28
import urllib
29
29
import tempfile
452
452
        elif cidr_ip:
453
453
            # If this fails, it throws an exception. This is what we want.
454
454
            cidr_ip = urllib.unquote(cidr_ip).decode()
455
 
            IPy.IP(cidr_ip)
 
455
            netaddr.IPNetwork(cidr_ip)
456
456
            values['cidr'] = cidr_ip
457
457
        else:
458
458
            values['cidr'] = '0.0.0.0/0'