~ubuntu-branches/ubuntu/trusty/maas/trusty-security

« back to all changes in this revision

Viewing changes to src/metadataserver/address.py

  • Committer: Package Import Robot
  • Author(s): Greg Lutostanski
  • Date: 2014-08-29 13:27:34 UTC
  • mto: (61.1.4 trusty-proposed)
  • mto: This revision was merged to the branch mainline in revision 62.
  • Revision ID: package-import@ubuntu.com-20140829132734-d47evihju2etdwcy
Tags: upstream-1.5.4+bzr2294
ImportĀ upstreamĀ versionĀ 1.5.4+bzr2294

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
    """
64
64
    route_lines = list(ip_route_output)
65
65
    for line in route_lines:
66
 
        match = re.match('default\s+.*\sdev\s+(\w+)', line)
 
66
        match = re.match('default\s+.*\sdev\s+([^\s]+)', line)
67
67
        if match is not None:
68
68
            return match.groups()[0]
69
69
 
70
70
    # Still nothing?  Try the first recognizable interface in the list.
71
71
    for line in route_lines:
72
 
        match = re.match('\s*(?:\S+\s+)*dev\s+(\w+)', line)
 
72
        match = re.match('\s*(?:\S+\s+)*dev\s+([^\s]+)', line)
73
73
        if match is not None:
74
74
            return match.groups()[0]
75
75
    return None