~openstack-charmers-archive/charms/precise/ceph-radosgw/old-1501

« back to all changes in this revision

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

  • Committer: Corey Bryant
  • Date: 2014-10-21 12:46:36 UTC
  • mfrom: (28.1.1 ceph-radosgw-next)
  • Revision ID: corey.bryant@canonical.com-20141021124636-hxyefuojootcsjbz
[gnuoy,r=coreycb] Sync charm-helpers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#  Matthew Wedgwood <matthew.wedgwood@canonical.com>
7
7
 
8
8
import os
 
9
import re
9
10
import pwd
10
11
import grp
11
12
import random
12
13
import string
13
14
import subprocess
14
15
import hashlib
15
 
import shutil
16
16
from contextlib import contextmanager
17
17
 
18
18
from collections import OrderedDict
317
317
        ip_output = (line for line in ip_output if line)
318
318
        for line in ip_output:
319
319
            if line.split()[1].startswith(int_type):
320
 
                interfaces.append(line.split()[1].replace(":", ""))
 
320
                matched = re.search('.*: (bond[0-9]+\.[0-9]+)@.*', line)
 
321
                if matched:
 
322
                    interface = matched.groups()[0]
 
323
                else:
 
324
                    interface = line.split()[1].replace(":", "")
 
325
                interfaces.append(interface)
 
326
 
321
327
    return interfaces
322
328
 
323
329