title: How to check given IP address range contains only one CIDR?
body: <p>I trying to write a Python script to convert the range between two IP addresses to CIDR,</p>
  <pre class="lang-py prettyprint-override"><code># cidr.py
  import argparse
  import netaddr
  import sys
  
  parser = argparse.ArgumentParser()
  parser.add_argument('start_addr')
  parser.add_argument('end_addr')
  args = parser.parse_args()
  
  start_addr = netaddr.IPAddress(args.start_addr)
  end_addr = netaddr.IPAddress(args.end_addr)
  if end_addr &lt; start_addr:
    print('start address is larger than end address. check arguments.')
    sys.exit()
  ip_cidr = netaddr.iprange_to_cidrs(start_addr, end_addr)
  
  print(str(ip_cidr))
  </code></pre>
  <p>For example, execute this script using <a href="https://help.salesforce.com/articleView?siteLang=en_us&amp;id=000321501&amp;type=1&amp;mode=1" rel="nofollow noreferrer">Salesforce's IP address range</a> as arguments,
  it returns the correct CIDR expression.</p>
  <pre><code>$ python cidr.py 13.108.0.0 13.111.255.255
  [IPNetwork('13.108.0.0/14')]
  </code></pre>
  <p>But when I modify the second argument, it returns a couple of CIDRs.</p>
  <pre><code>$ python hoge.py 13.108.0.0 13.211.255.255
  [IPNetwork('13.108.0.0/14'), IPNetwork('13.112.0.0/12'), IPNetwork('13.128.0.0/10'), IPNetwork('13.192.0.0/12'), IPNetwork('13.208.0.0/14')]
  </code></pre>
  <p>I want to know the address range of 2 IP addresses <strong>only</strong> contains 1 CIDR expressions.
  How do I check it?</p>