'Mount EBS volumes, if specified in ~/.starcluster/config to /home'

def _setup_ebs_volumes(self):

    master = self._master
    devices = master.get_device_map()
    for vol in self._volumes:
        vol = self._volumes[vol]
        vol_id = vol.get('volume_id')
        mount_path = vol.get('mount_path')
        device = vol.get('device')
        volume_partition = vol.get('partition')
        if (not (vol_id and device and mount_path)):
            log.error(('missing    required    settings    for    vol    %s' % vol))
            continue
        if ((device not in devices) and device.startswith('/dev/sd')):
            device = device.replace('/dev/sd', '/dev/xvd')
            if (device not in devices):
                log.warn(('Cannot    find    device    %s    for    volume    %s' % (device, vol_id)))
                log.warn(('Not    mounting    %s    on    %s' % (vol_id, mount_path)))
                log.warn('This    usually    means    there    was    a    problem    attaching    the    EBS    volume    to    the    master    node')
                continue
        partitions = master.get_partition_map(device=device)
        if (not volume_partition):
            if (len(partitions) == 0):
                volume_partition = device
            elif (len(partitions) == 1):
                volume_partition = partitions.popitem()[0]
            else:
                log.error("volume    has    more    than    one    partition,    please    specify    which    partition    to    use    (e.g.    partition=0,    partition=1,    etc.)    in    the    volume's    config")
                continue
        elif (volume_partition not in partitions):
            log.warn(('Cannot    find    partition    %s    on    volume    %s' % (volume_partition, vol_id)))
            log.warn(('Not    mounting    %s    on    %s' % (vol_id, mount_path)))
            log.warn('This    either    means    that    the    volume    has    not    been    partitioned    or    that    the    partition    specified    does    not    exist    on    the    volume')
            continue
        log.info(('Mounting    EBS    volume    %s    on    %s...' % (vol_id, mount_path)))
        mount_map = master.get_mount_map()
        if (volume_partition in mount_map):
            (path, fstype, options) = mount_map.get(volume_partition)
            if (path != mount_path):
                log.error(('Volume    %s    is    mounted    on    %s,    not    on    %s' % (vol_id, path, mount_path)))
            else:
                log.info(('Volume    %s    already    mounted    on    %s...skipping' % (vol_id, mount_path)))
            continue
        master.mount_device(volume_partition, mount_path)
