~ubuntu-branches/ubuntu/saucy/heat/saucy

« back to all changes in this revision

Viewing changes to heat/openstack/common/network_utils.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-09-08 21:51:19 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130908215119-r939tu4aumqgdrkx
Tags: 2013.2~b3-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/control: Add python-netaddr as build-dep.
* debian/heat-common.install: Remove heat-boto and associated man-page
* debian/heat-common.install: Remove heat-cfn and associated man-page
* debian/heat-common.install: Remove heat-watch and associated man-page
* debian/patches/fix-sqlalchemy-0.8.patch: Dropped

[ Adam Gandelman ]
* debian/patches/default-kombu.patch: Dropped.
* debian/patches/default-sqlite.patch: Refreshed.
* debian/*.install, rules: Install heat.conf.sample as common
  config file in heat-common. Drop other per-package configs, they
  are no longer used.
* debian/rules: Clean pbr .egg from build dir if it exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
Network-related utilities and helper functions.
20
20
"""
21
21
 
22
 
from heat.openstack.common import log as logging
23
 
 
24
 
 
25
 
LOG = logging.getLogger(__name__)
 
22
import urlparse
26
23
 
27
24
 
28
25
def parse_host_port(address, default_port=None):
67
64
            port = default_port
68
65
 
69
66
    return (host, None if port is None else int(port))
 
67
 
 
68
 
 
69
def urlsplit(url, scheme='', allow_fragments=True):
 
70
    """Parse a URL using urlparse.urlsplit(), splitting query and fragments.
 
71
    This function papers over Python issue9374 when needed.
 
72
 
 
73
    The parameters are the same as urlparse.urlsplit.
 
74
    """
 
75
    scheme, netloc, path, query, fragment = urlparse.urlsplit(
 
76
        url, scheme, allow_fragments)
 
77
    if allow_fragments and '#' in path:
 
78
        path, fragment = path.split('#', 1)
 
79
    if '?' in path:
 
80
        path, query = path.split('?', 1)
 
81
    return urlparse.SplitResult(scheme, netloc, path, query, fragment)