~salvatore-orlando/neutron/quantum-api

« back to all changes in this revision

Viewing changes to quantum/plugins/openvswitch/agent/install.sh

  • Committer: Salvatore Orlando
  • Date: 2011-06-24 13:52:17 UTC
  • mfrom: (6.1.14 quantum-trunk)
  • Revision ID: salvatore.orlando@eu.citrix.com-20110624135217-h6uz1zu3fxxpf3wt
Merge trunk
Resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
CONF_FILE=/etc/xapi.d/plugins/ovs_quantum_plugin.ini
 
4
 
 
5
if [ ! -d /etc/xapi.d/plugins ]; then
 
6
        echo "Am I on a xenserver? I can't find the plugins directory!"
 
7
        exit 1
 
8
fi
 
9
 
 
10
# Make sure we have mysql-python
 
11
rpm -qa | grep MySQL-python >/dev/null 2>&1
 
12
if [ $? -ne 0 ]; then
 
13
        echo "MySQL-python not found"
 
14
    echo "Please enable the centos repositories and install mysql-python:"
 
15
    echo "yum --enablerepo=base -y install MySQL-python"
 
16
    exit 1
 
17
fi
 
18
 
 
19
cp ovs_quantum_agent.py /etc/xapi.d/plugins
 
20
cp ovs_quantum_plugin.ini /etc/xapi.d/plugins
 
21
cp set_external_ids.sh /etc/xapi.d/plugins
 
22
 
 
23
xe network-list name-label="integration-bridge" | grep xapi >/dev/null 2>&1
 
24
if [ $? -ne 0 ]; then
 
25
        echo "No integration bridge found.  Creating."
 
26
        xe network-create name-label="integration-bridge"
 
27
fi
 
28
 
 
29
BR=$(xe network-list name-label="integration-bridge" | grep "bridge.*:" | awk '{print $4}')
 
30
CONF_BR=$(grep integration-bridge ${CONF_FILE} | cut -d= -f2)
 
31
if [ "X$BR" != "X$CONF_BR" ]; then
 
32
        echo "Integration bridge doesn't match configuration file; fixing."
 
33
        sed -i -e "s/^integration-bridge =.*$/integration-bridge = ${BR}/g" $CONF_FILE
 
34
fi
 
35
 
 
36
echo "Using integration bridge: $BR (make sure this is set in the nova configuration)"
 
37
 
 
38
echo "Make sure to edit: $CONF_FILE"