

def prepare(self):
    if self.network:
        dhcp_start = str((self.network.network + 2))
        dhcp_end = str(((self.network.network + self.network.size) - 2))
        dhcp_range = ','.join([dhcp_start, dhcp_end])
        values = {
            'USE_LXC_BRIDGE': 'true',
            'LXC_BRIDGE': self.config.get('lxc_bridge', 'lxcbr0'),
            'LXC_ADDR': (self.network.network + 1),
            'LXC_NETMASK': self.network.netmask,
            'LXC_NETWORK': self.network,
            'LXC_DHCP_RANGE': dhcp_range,
            'LXC_DHCP_MAX': (self.network.size - 3),
        }
        config = moves.StringIO()
        for (name, value) in six.iteritems(values):
            config.write(('%(name)s="%(value)s"\n' % {
                'name': name,
                'value': value,
            }))
        config.seek(0)
        self.server.ssh.run('cat > /tmp/.lxc_default', stdin=config)
    self.server.ssh.run('/bin/sh', stdin=_get_script('lxc-install.sh'))
    self.create_local_tunnels()
    self.create_remote_tunnels()

dataset/ETHPy150Open openstack/rally/rally/deployment/serverprovider/providers/lxc.py LxcHost.prepare/original