Cleanup the source distribution.

Missing text files such as LICENSE and various READMEs are now
included in the tarball source distribution. The Makefile and shell
script for installing the openvswitch agent on xen are also now
included. The openvswitch and linuxbridge agents are included, and
executable wrapper scripts for the agents are provided. The cisco and
linuxbridge nova drivers are now setup to be run from the quantum
namespace rather than copied to nova. Finally, the setup_*.py scripts
have been removed from the project. Fixes bug 925074.

Test by running "python setup.py sdist" and examining the generated
tarball.

Change-Id: I33d336a5eb13678e6d527b575958393b337b6f3d
Signed-off-by: Bob Kukura <rkukura@redhat.com>
This commit is contained in:
Bob Kukura 2012-02-17 17:00:52 -05:00
parent 04d144ae0b
commit d6bf2b7616
15 changed files with 78 additions and 307 deletions

View File

@ -1,6 +1,13 @@
include README LICENSE TESTING
include run_tests.py run_tests.sh
include .pylintrc
include bin/*
include etc/*
include etc/init.d/*
include etc/quantum/plugins/openvswitch/*
include etc/quantum/plugins/cisco/*
include etc/quantum/plugins/linuxbridge/*
include etc/quantum/plugins/openvswitch/*.ini
include etc/quantum/plugins/cisco/*.ini
include etc/quantum/plugins/cisco/quantum.conf.ciscoext
include etc/quantum/plugins/linuxbridge/*.ini
include quantum/plugins/*/README
include quantum/plugins/openvswitch/Makefile
include quantum/plugins/openvswitch/agent/xenserver_install.sh

24
bin/quantum-linuxbridge-agent Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import sys
sys.path.insert(0, os.getcwd())
from quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent import main
main()

24
bin/quantum-openvswitch-agent Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
import sys
sys.path.insert(0, os.getcwd())
from quantum.plugins.openvswitch.agent.ovs_quantum_agent import main
main()

View File

@ -43,23 +43,8 @@ service with the Linux Bridge plugin.
--connection_type=libvirt
--libvirt_type=qemu
--libvirt_vif_type=ethernet
--libvirt_vif_driver=nova.virt.libvirt.vif_linuxbridge_quantum.QuantumLibvirtLinuxBridgeDriver
--linuxnet_interface_driver=nova.network.quantum.linux_net_linux_bridge.QuantumLibvirtLinuxBridgeDriver
The above two drivers are packaged with Quantum in the location:
quantum/plugins/linuxbridge/nova
These need to copied to the compute node in the appropriate locations.
a) Copy:
quantum/plugins/linuxbridge/nova/vif_linuxbridge_quantum.py
to:
nova/virt/libvirt/vif_linuxbridge_quantum.py
b) Copy:
quantum/plugins/linuxbridge/nova/linux_net_linux_bridge.py
to:
nova/network/quantum/linux_net_linux_bridge.py
--libvirt_vif_driver=quantum.plugins.linuxbridge.nova.vif_linuxbridge_quantum.QuantumLibvirtLinuxBridgeVIFDriver
--linuxnet_interface_driver=quantum.plugins.linuxbridge.nova.linux_net_linux_bridge.QuantumLinuxBridgeInterfaceDriver
2) If you want a DHCP server to be run for the VMs to acquire IPs,
add the following flag to your nova.conf file:

View File

@ -411,7 +411,8 @@ class LinuxBridgeQuantumAgent:
old_port_bindings = bindings[PORT_BINDINGS]
time.sleep(self.polling_interval)
if __name__ == "__main__":
def main():
usagestr = "%prog [OPTIONS] <config file>"
parser = OptionParser(usage=usagestr)
parser.add_option("-v", "--verbose", dest="verbose",
@ -439,6 +440,7 @@ if __name__ == "__main__":
physical_interface = config.get("LINUX_BRIDGE", "physical_interface")
polling_interval = config.get("AGENT", "polling_interval")
'Establish database connection and load models'
global DB_CONNECTION
DB_CONNECTION = config.get("DATABASE", "connection")
if DB_CONNECTION == 'sqlite':
LOG.info("Connecting to sqlite DB")
@ -468,3 +470,6 @@ if __name__ == "__main__":
conn.close()
sys.exit(0)
if __name__ == "__main__":
main()

View File

@ -46,7 +46,7 @@ def _device_exists(device):
# plugs interfaces using Linux Bridge when using QuantumManager
class QuantumLibvirtLinuxBridgeDriver(LinuxNetInterfaceDriver):
class QuantumLinuxBridgeInterfaceDriver(LinuxNetInterfaceDriver):
def plug(self, network, mac_address, gateway=True):
LOG.debug(_("inside plug()"))

View File

@ -31,12 +31,12 @@ from nova import utils
from nova.virt.vif import VIFDriver
from nova import exception
LOG = logging.getLogger('nova.virt.libvirt.vif_linuxbridge_quantum')
LOG = logging.getLogger(__name__)
FLAGS = flags.FLAGS
class QuantumLibvirtLinuxBridgeDriver(VIFDriver):
class QuantumLibvirtLinuxBridgeVIFDriver(VIFDriver):
"""VIF driver for Linux Bridge."""
def get_dev_name(_self, iface_id):

View File

@ -262,7 +262,8 @@ class OVSQuantumAgent:
db.commit()
time.sleep(2)
if __name__ == "__main__":
def main():
usagestr = "%prog [OPTIONS] <config file>"
parser = OptionParser(usage=usagestr)
parser.add_option("-v", "--verbose", dest="verbose",
@ -298,3 +299,6 @@ if __name__ == "__main__":
plugin.daemon_loop(db)
sys.exit(0)
if __name__ == "__main__":
main()

View File

@ -106,6 +106,10 @@ setup(
eager_resources=EagerResources,
entry_points={
'console_scripts': [
'quantum-linuxbridge-agent = \
quantum.plugins.linuxbridge.agent.linuxbridge_quantum_agent:main',
'quantum-openvswitch-agent = \
quantum.plugins.openvswitch.agent.ovs_quantum_agent:main',
'quantum-server = quantum.server:main',
]
},

View File

@ -1,74 +0,0 @@
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import sys
from quantum import version
Name = 'quantum-cisco-plugin'
ProjecUrl = ""
Version = version.version_string()
License = 'Apache License 2.0'
Author = 'Cisco Systems'
AuthorEmail = ''
Maintainer = ''
Summary = 'Cisco plugin for Quantum'
ShortDescription = Summary
Description = Summary
requires = [
'quantum-common',
'quantum-server',
]
EagerResources = [
'quantum',
]
ProjectScripts = [
]
PackageData = {
}
# If we're installing server-wide, use an aboslute path for config
# if not, use a relative path
config_path = '/etc/quantum/plugins/cisco'
relative_locations = ['--user', '--virtualenv', '--venv']
if [x for x in relative_locations if x in sys.argv]:
config_path = 'etc/quantum/plugins/cisco'
DataFiles = [
(config_path,
['etc/quantum/plugins/cisco/credentials.ini',
'etc/quantum/plugins/cisco/l2network_plugin.ini',
'etc/quantum/plugins/cisco/nexus.ini',
'etc/quantum/plugins/cisco/ucs.ini',
'etc/quantum/plugins/cisco/cisco_plugins.ini',
'etc/quantum/plugins/cisco/db_conn.ini'])
]
setup(
name=Name,
version=Version,
author=Author,
author_email=AuthorEmail,
description=ShortDescription,
long_description=Description,
license=License,
scripts=ProjectScripts,
install_requires=requires,
include_package_data=True,
packages=["quantum.plugins.cisco"],
package_data=PackageData,
data_files=DataFiles,
eager_resources=EagerResources,
entry_points={
'console_scripts': [
'cisco-quantum = quantum.plugins.cisco.client.cli:main'
]
},
)

View File

@ -1,65 +0,0 @@
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from quantum import version
import sys
Name = 'quantum-openvswitch-plugin'
ProjecUrl = ""
Version = version.version_string()
License = 'Apache License 2.0'
Author = 'Open vSwitch Team'
AuthorEmail = 'discuss@openvswitch.org'
Maintainer = ''
Summary = 'OpenVSwitch plugin for Quantum'
ShortDescription = Summary
Description = Summary
requires = [
'quantum-common',
'quantum-server',
]
EagerResources = [
'quantum',
]
ProjectScripts = [
]
PackageData = {
}
# If we're installing server-wide, use an aboslute path for config
# if not, use a relative path
config_path = '/etc/quantum/plugins/openvswitch'
relative_locations = ['--user', '--virtualenv', '--venv']
if [x for x in relative_locations if x in sys.argv]:
config_path = 'etc/quantum/plugins/openvswitch'
DataFiles = [
(config_path,
['etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini'])
]
setup(
name=Name,
version=Version,
author=Author,
author_email=AuthorEmail,
description=ShortDescription,
long_description=Description,
license=License,
scripts=ProjectScripts,
install_requires=requires,
include_package_data=True,
packages=["quantum.plugins.openvswitch"],
package_data=PackageData,
data_files=DataFiles,
eager_resources=EagerResources,
)

View File

@ -1,51 +0,0 @@
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
from quantum import version
import sys
Name = 'quantum-sample-plugin'
Summary = 'Sample plugin for Quantum'
Url = "https://launchpad.net/quantum"
Version = version.version_string()
License = 'Apache License 2.0'
Author = 'Netstack'
AuthorEmail = 'netstack@lists.launchpad.net'
Maintainer = ''
ShortDescription = Summary
Description = Summary
requires = [
'quantum-common',
'quantum-server',
]
EagerResources = [
'quantum',
]
ProjectScripts = [
]
PackageData = {
}
setup(
name=Name,
version=Version,
author=Author,
author_email=AuthorEmail,
description=ShortDescription,
long_description=Description,
license=License,
scripts=ProjectScripts,
install_requires=requires,
include_package_data=True,
packages=["quantum.plugins.sample"],
package_data=PackageData,
eager_resources=EagerResources,
)

View File

@ -1,92 +0,0 @@
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
import os
import sys
from quantum import version
Name = 'quantum-server'
Url = "https://launchpad.net/quantum"
Version = version.version_string()
License = 'Apache License 2.0'
Author = 'Netstatck'
AuthorEmail = 'netstack@lists.launchpad.net'
Maintainer = ''
Summary = 'Server functionalities for Quantum'
ShortDescription = Summary
Description = Summary
requires = [
'quantum-common'
]
EagerResources = [
'quantum',
]
ProjectScripts = [
]
PackageData = {
}
# If we're installing server-wide, use an aboslute path for config
# if not, use a relative path
config_path = '/etc/quantum'
init_path = '/etc/init.d'
relative_locations = ['--user', '--virtualenv', '--venv']
if [x for x in relative_locations if x in sys.argv]:
config_path = 'etc/quantum/'
init_path = 'etc/init.d'
import os
from distutils.command.build_py import build_py as _build_py
class build_py(_build_py):
def find_data_files(self, package, src_dir):
files = []
for p in _build_py.find_data_files(self, package, src_dir):
if os.path.isdir(p):
files.extend(os.path.join(par, f)
for par, dirs, files in os.walk(p)
for f in files)
else:
files.append(p)
return files
print "config_path: %s" % config_path
DataFiles = [
(config_path,
['etc/quantum.conf', 'etc/quantum.conf.test', 'etc/plugins.ini']),
(init_path, ['etc/init.d/quantum-server'])
]
setup(
name=Name,
version=Version,
url=Url,
author=Author,
author_email=AuthorEmail,
description=ShortDescription,
long_description=Description,
license=License,
scripts=ProjectScripts,
install_requires=requires,
include_package_data=True,
packages=["quantum.server"],
package_data=PackageData,
data_files=DataFiles,
package_dir={'quantum': 'quantum'},
eager_resources=EagerResources,
entry_points={
'console_scripts': [
'quantum-server = quantum.server:main'
]
},
)