~james-page/charms/trusty/percona-cluster/kilo-support

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/core/host.py

  • Committer: james.page at ubuntu
  • Date: 2015-02-02 05:27:44 UTC
  • Revision ID: james.page@ubuntu.com-20150202052744-xrw5fj8el1s07c9t
Resync helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2014-2015 Canonical Limited.
 
2
#
 
3
# This file is part of charm-helpers.
 
4
#
 
5
# charm-helpers is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU Lesser General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# charm-helpers is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU Lesser General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU Lesser General Public License
 
15
# along with charm-helpers.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
1
17
"""Tools for working with the host system"""
2
18
# Copyright 2012 Canonical Ltd.
3
19
#
345
361
        ip_output = (line for line in ip_output if line)
346
362
        for line in ip_output:
347
363
            if line.split()[1].startswith(int_type):
348
 
                matched = re.search('.*: (bond[0-9]+\.[0-9]+)@.*', line)
 
364
                matched = re.search('.*: (' + int_type + r'[0-9]+\.[0-9]+)@.*', line)
349
365
                if matched:
350
366
                    interface = matched.groups()[0]
351
367
                else: