From fabe341771403ff211937aec6a225cf07bd869f8 Mon Sep 17 00:00:00 2001 From: Tim Simpson Date: Wed, 18 Sep 2013 09:10:44 -0500 Subject: [PATCH] Now the package can be installed alongside Nova. Since this is apparently not getting into Nova it needs to be renamed so the package name won't conflict. Change-Id: Ib449e99c2a7756e46e4626a84ddb246265476bd3 --- debian/rules | 10 ++-- etc/nova/rootwrap.d/openvz.filters | 52 +++++++++---------- ovznovadriver/__init__.py | 12 +++++ ovznovadriver/localization.py | 3 ++ .../virt => ovznovadriver}/openvz/__init__.py | 2 +- {nova/virt => ovznovadriver}/openvz/driver.py | 25 ++++----- {nova/virt => ovznovadriver}/openvz/file.py | 5 +- .../openvz/file_ext}/__init__.py | 0 .../openvz/file_ext/boot.py | 4 +- .../openvz/file_ext/ext_storage.py | 5 +- .../openvz/file_ext/shutdown.py | 5 +- .../openvz/file_ext/start.py | 2 +- .../openvz/file_ext/stop.py | 2 +- .../openvz/migration.py | 7 +-- .../openvz/migration_drivers}/__init__.py | 0 .../openvz/migration_drivers/rsync.py | 7 +-- .../openvz/migration_drivers/transport.py | 3 +- .../virt => ovznovadriver}/openvz/network.py | 13 ++--- .../openvz/network_drivers}/__init__.py | 0 .../openvz/network_drivers/network_bridge.py | 3 +- .../openvz/network_drivers/tc.py | 5 +- .../templates/tc_container_start.template | 0 .../templates/tc_container_stop.template | 0 .../templates/tc_host_start.template | 0 .../templates/tc_host_stop.template | 0 {nova/virt => ovznovadriver}/openvz/utils.py | 3 +- {nova/virt => ovznovadriver}/openvz/volume.py | 7 +-- .../openvz/volume_drivers}/__init__.py | 0 .../openvz/volume_drivers/iscsi.py | 7 +-- .../tests/openvz}/__init__.py | 0 {nova => ovznovadriver}/tests/openvz/fakes.py | 2 +- .../tests/openvz/test_driver.py | 12 ++--- .../tests/openvz/test_ext_storage.py | 2 +- .../tests/openvz/test_file.py | 6 +-- .../tests/openvz/test_network.py | 8 +-- .../tests/openvz/test_utils.py | 2 +- setup.py | 33 ++++++++++++ 37 files changed, 154 insertions(+), 93 deletions(-) create mode 100644 ovznovadriver/__init__.py create mode 100644 ovznovadriver/localization.py rename {nova/virt => ovznovadriver}/openvz/__init__.py (94%) rename {nova/virt => ovznovadriver}/openvz/driver.py (99%) rename {nova/virt => ovznovadriver}/openvz/file.py (98%) rename {nova/tests/openvz => ovznovadriver/openvz/file_ext}/__init__.py (100%) rename {nova/virt => ovznovadriver}/openvz/file_ext/boot.py (92%) rename {nova/virt => ovznovadriver}/openvz/file_ext/ext_storage.py (95%) rename {nova/virt => ovznovadriver}/openvz/file_ext/shutdown.py (91%) rename {nova/virt => ovznovadriver}/openvz/file_ext/start.py (95%) rename {nova/virt => ovznovadriver}/openvz/file_ext/stop.py (95%) rename {nova/virt => ovznovadriver}/openvz/migration.py (98%) rename {nova/virt/openvz/file_ext => ovznovadriver/openvz/migration_drivers}/__init__.py (100%) rename {nova/virt => ovznovadriver}/openvz/migration_drivers/rsync.py (90%) rename {nova/virt => ovznovadriver}/openvz/migration_drivers/transport.py (95%) rename {nova/virt => ovznovadriver}/openvz/network.py (95%) rename {nova/virt/openvz/migration_drivers => ovznovadriver/openvz/network_drivers}/__init__.py (100%) rename {nova/virt => ovznovadriver}/openvz/network_drivers/network_bridge.py (94%) rename {nova/virt => ovznovadriver}/openvz/network_drivers/tc.py (98%) rename {nova/virt => ovznovadriver}/openvz/network_drivers/templates/tc_container_start.template (100%) rename {nova/virt => ovznovadriver}/openvz/network_drivers/templates/tc_container_stop.template (100%) rename {nova/virt => ovznovadriver}/openvz/network_drivers/templates/tc_host_start.template (100%) rename {nova/virt => ovznovadriver}/openvz/network_drivers/templates/tc_host_stop.template (100%) rename {nova/virt => ovznovadriver}/openvz/utils.py (99%) rename {nova/virt => ovznovadriver}/openvz/volume.py (98%) rename {nova/virt/openvz/network_drivers => ovznovadriver/openvz/volume_drivers}/__init__.py (100%) rename {nova/virt => ovznovadriver}/openvz/volume_drivers/iscsi.py (96%) rename {nova/virt/openvz/volume_drivers => ovznovadriver/tests/openvz}/__init__.py (100%) rename {nova => ovznovadriver}/tests/openvz/fakes.py (99%) rename {nova => ovznovadriver}/tests/openvz/test_driver.py (99%) rename {nova => ovznovadriver}/tests/openvz/test_ext_storage.py (98%) rename {nova => ovznovadriver}/tests/openvz/test_file.py (96%) rename {nova => ovznovadriver}/tests/openvz/test_network.py (97%) rename {nova => ovznovadriver}/tests/openvz/test_utils.py (99%) create mode 100644 setup.py diff --git a/debian/rules b/debian/rules index 61e34f0..7992b3b 100755 --- a/debian/rules +++ b/debian/rules @@ -15,11 +15,11 @@ clean: binary-arch: binary-indep -binary-indep: - dh_installdirs /usr/lib/python$(PYVERS)/dist-packages/nova/virt /usr/lib/python$(PYVERS)/dist-packages/nova/tests /etc/nova/rootwrap.d - cp -R $(CURDIR)/nova/virt/openvz $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/nova/virt - cp -R $(CURDIR)/nova/tests/openvz $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/nova/tests - install -d -m 755 $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/nova/virt +binary-indep: + dh_installdirs /usr/lib/python$(PYVERS)/dist-packages/ovznovadriver /usr/lib/python$(PYVERS)/dist-packages/nova/tests /etc/nova/rootwrap.d + cp -R $(CURDIR)/ovznovadriver/openvz $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/ovznovadriver + cp -R $(CURDIR)/ovznovadriver/tests/openvz $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/nova/tests + install -d -m 755 $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/ovznovadriver install -d -m 755 $(CURDIR)/debian/openvz-nova-driver/usr/lib/python$(PYVERS)/dist-packages/nova/tests install -D -m 0400 $(CURDIR)/etc/nova/rootwrap.d/openvz.filters $(CURDIR)/debian/openvz-nova-driver/etc/nova/rootwrap.d/ dh_testdir diff --git a/etc/nova/rootwrap.d/openvz.filters b/etc/nova/rootwrap.d/openvz.filters index 0b9766c..d6aea44 100644 --- a/etc/nova/rootwrap.d/openvz.filters +++ b/etc/nova/rootwrap.d/openvz.filters @@ -2,84 +2,84 @@ # This file should be owned by (and only-writeable by) the root user [Filters] -# nova/virt/openvz/utils.py: 'mount', '-o', 'defaults' ... +# ovznovadriver/openvz/utils.py: 'mount', '-o', 'defaults' ... mount: CommandFilter, /bin/mount, root -# nova/virt/openvz/utils.py: 'umount' +# ovznovadriver/openvz/utils.py: 'umount' umount: CommandFilter, /bin/umount, root -# nova/virt/openvz/utils.py: 'mkdir', path +# ovznovadriver/openvz/utils.py: 'mkdir', path mkdir: CommandFilter, /bin/mkdir, root -# nova/virt/openvz/utils.py: 'chown', owner_uid, path +# ovznovadriver/openvz/utils.py: 'chown', owner_uid, path chown: CommandFilter, /bin/chown, root -# nova/virt/openvz/utils.py: 'chmod' +# ovznovadriver/openvz/utils.py: 'chmod' chmod: CommandFilter, /bin/chmod, root -# nova/virt/openvz/volume_drivers/iscsi.py: 'iscsiadm', '-m', ... +# ovznovadriver/openvz/volume_drivers/iscsi.py: 'iscsiadm', '-m', ... iscsiadm: CommandFilter, iscsiadm, root -# nova/virt/openvz/volume.py: fdisk %(dev_path)s +# ovznovadriver/openvz/volume.py: fdisk %(dev_path)s fdisk: CommandFilter, /sbin/fdisk, root -# nova/virt/openvz/driver.py: 'arping', '-U', floating_ip, '-A', '-I', ... +# ovznovadriver/openvz/driver.py: 'arping', '-U', floating_ip, '-A', '-I', ... arping: CommandFilter, arping, root -# nova/virt/openvz/file.py: 'touch', target +# ovznovadriver/openvz/file.py: 'touch', target touch: CommandFilter, /usr/bin/touch, root # Rackspace Openvz starts here # nova/compute/manager.py: 'blockdev', '--getsize64', host_device blockdev: CommandFilter, /sbin/blockdev, root -# nova/virt/openvz/driver.py: '/usr/sbin/vzlist' +# ovznovadriver/openvz/driver.py: '/usr/sbin/vzlist' vzlist: CommandFilter, /usr/sbin/vzlist, root -# nova/virt/openvz/driver.py: '/usr/sbin/vzctl' +# ovznovadriver/openvz/driver.py: '/usr/sbin/vzctl' vzctl: CommandFilter, /usr/sbin/vzctl, root -# nova/virt/openvz/driver.py: '/bin/rm' +# ovznovadriver/openvz/driver.py: '/bin/rm' rm: CommandFilter, /bin/rm, root -# nova/virt/openvz/driver.py: +# ovznovadriver/openvz/driver.py: cpuinfo: ReadFileFilter, /proc/cpuinfo -# nova/virt/openvz/driver.py: +# ovznovadriver/openvz/driver.py: meminfo: ReadFileFilter, /proc/meminfo -# nova/virt/openvz/driver.py: '/usr/sbin/vzcpucheck' +# ovznovadriver/openvz/driver.py: '/usr/sbin/vzcpucheck' vzcpucheck: CommandFilter, /usr/sbin/vzcpucheck, root -# nova/virt/openvz/driver.py: '/bin/rmdir' +# ovznovadriver/openvz/driver.py: '/bin/rmdir' rmdir: CommandFilter, /bin/rmdir, root -# nova/virt/openvz/volume_drivers/iscsi.py: '/usr/bin/iscsiadm' +# ovznovadriver/openvz/volume_drivers/iscsi.py: '/usr/bin/iscsiadm' iscsiadm_usrsbin: CommandFilter, /usr/bin/iscsiadm, root -# nova/virt/openvz/utils.py: '/sbin/blkid' +# ovznovadriver/openvz/utils.py: '/sbin/blkid' blkid: CommandFilter, /sbin/blkid, root -# nova/virt/openvz/network_plugins/tc.py +# ovznovadriver/openvz/network_plugins/tc.py tc: CommandFilter, /sbin/tc, root -# nova/virt/openvz/volume.py +# ovznovadriver/openvz/volume.py ls: CommandFilter, /bin/ls, root -# nova/virt/openvz/volume.py +# ovznovadriver/openvz/volume.py sfdisk: CommandFilter, /sbin/sfdisk, root -# nova/virt/openvz/volume.py +# ovznovadriver/openvz/volume.py mknod: CommandFilter, /bin/mknod, root -# nova/virt/openvz/driver.py +# ovznovadriver/openvz/driver.py vzmigrate: CommandFilter, /usr/sbin/vzmigrate, root -# nova/virt/openvz/migrate.py +# ovznovadriver/openvz/migrate.py cp: CommandFilter, /bin/cp, root -# nova/virt/openvz/utils.py +# ovznovadriver/openvz/utils.py tar: CommandFilter, /bin/tar, root -# nova/virt/openvz/migration_drivers/rsync.py +# ovznovadriver/openvz/migration_drivers/rsync.py rsync: CommandFilter, /usr/bin/rsync, root diff --git a/ovznovadriver/__init__.py b/ovznovadriver/__init__.py new file mode 100644 index 0000000..88eeaef --- /dev/null +++ b/ovznovadriver/__init__.py @@ -0,0 +1,12 @@ +""" +OpenVZ Nova Driver +------------------ + +This is included in this oddly named directory instead of "nova/virt" since in +the later case it wouldn't be possible to have a setup.py and thus develop on +it at the same time without shadowing the real nova package. + +If you don't like that, complain to the Nova core team so they accept this +driver into the actual Nova codebase, or go write a ton of code for libvirt. +""" + diff --git a/ovznovadriver/localization.py b/ovznovadriver/localization.py new file mode 100644 index 0000000..4bd5b47 --- /dev/null +++ b/ovznovadriver/localization.py @@ -0,0 +1,3 @@ +#TODO(tim.simpson): Figure out some way to link this to Nova's localization +# function. +_ = str diff --git a/nova/virt/openvz/__init__.py b/ovznovadriver/openvz/__init__.py similarity index 94% rename from nova/virt/openvz/__init__.py rename to ovznovadriver/openvz/__init__.py index 85babe4..02ca0d1 100644 --- a/nova/virt/openvz/__init__.py +++ b/ovznovadriver/openvz/__init__.py @@ -15,6 +15,6 @@ # License for the specific language governing permissions and limitations # under the License. -from nova.virt.openvz import driver +from ovznovadriver.openvz import driver OpenVzDriver = driver.OpenVzDriver diff --git a/nova/virt/openvz/driver.py b/ovznovadriver/openvz/driver.py similarity index 99% rename from nova/virt/openvz/driver.py rename to ovznovadriver/openvz/driver.py index db120de..8628e75 100644 --- a/nova/virt/openvz/driver.py +++ b/ovznovadriver/openvz/driver.py @@ -32,15 +32,16 @@ from nova.openstack.common import log as logging from nova.openstack.common import loopingcall from nova.virt import driver from nova.virt import images -from nova.virt.openvz import file as ovzfile -from nova.virt.openvz.file_ext import boot as ovzboot -from nova.virt.openvz.file_ext import ext_storage -from nova.virt.openvz.file_ext import shutdown as ovzshutdown -from nova.virt.openvz import migration as ovz_migration -from nova.virt.openvz import network as ovznetwork -from nova.virt.openvz.network_drivers import tc as ovztc -from nova.virt.openvz import utils as ovz_utils -from nova.virt.openvz.volume_drivers import iscsi as ovziscsi +from ovznovadriver.localization import _ +from ovznovadriver.openvz import file as ovzfile +from ovznovadriver.openvz.file_ext import boot as ovzboot +from ovznovadriver.openvz.file_ext import ext_storage +from ovznovadriver.openvz.file_ext import shutdown as ovzshutdown +from ovznovadriver.openvz import migration as ovz_migration +from ovznovadriver.openvz import network as ovznetwork +from ovznovadriver.openvz.network_drivers import tc as ovztc +from ovznovadriver.openvz import utils as ovz_utils +from ovznovadriver.openvz.volume_drivers import iscsi as ovziscsi import os from oslo.config import cfg import socket @@ -69,7 +70,7 @@ openvz_conn_opts = [ default='G', help='Disk subscription increment'), cfg.StrOpt('ovz_vif_driver', - default='nova.virt.openvz.network_drivers' + default='ovznovadriver.openvz.network_drivers' '.network_bridge.OVZNetworkBridgeDriver', help='The openvz VIF driver to configures the VIFs'), cfg.StrOpt('ovz_mount_options', @@ -82,7 +83,7 @@ openvz_conn_opts = [ default='eth0', help='Device to use as the root device for tc rules'), cfg.StrOpt('ovz_tc_template_dir', - default='$pybasedir/nova/virt/openvz/network_drivers/templates', + default='$pybasedir/../openvz-nova-driver/ovznovadriver/openvz/network_drivers/templates', help='Where the tc templates are located'), cfg.StrOpt('ovz_tmp_dir', default='/var/tmp', @@ -189,7 +190,7 @@ CONF = cfg.CONF CONF.register_opts(openvz_conn_opts) CONF.import_opt('host', 'nova.config') -LOG = logging.getLogger('nova.virt.openvz.driver') +LOG = logging.getLogger('ovznovadriver.openvz.driver') class OpenVzDriver(driver.ComputeDriver): diff --git a/nova/virt/openvz/file.py b/ovznovadriver/openvz/file.py similarity index 98% rename from nova/virt/openvz/file.py rename to ovznovadriver/openvz/file.py index bf59d1e..b790726 100644 --- a/nova/virt/openvz/file.py +++ b/ovznovadriver/openvz/file.py @@ -21,14 +21,15 @@ is sketchy at best. """ from nova import exception +from ovznovadriver.localization import _ from nova.openstack.common import log as logging -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.file') +LOG = logging.getLogger('ovznovadriver.openvz.file') class OVZFile(object): diff --git a/nova/tests/openvz/__init__.py b/ovznovadriver/openvz/file_ext/__init__.py similarity index 100% rename from nova/tests/openvz/__init__.py rename to ovznovadriver/openvz/file_ext/__init__.py diff --git a/nova/virt/openvz/file_ext/boot.py b/ovznovadriver/openvz/file_ext/boot.py similarity index 92% rename from nova/virt/openvz/file_ext/boot.py rename to ovznovadriver/openvz/file_ext/boot.py index 9c176f1..d8f45ad 100644 --- a/nova/virt/openvz/file_ext/boot.py +++ b/ovznovadriver/openvz/file_ext/boot.py @@ -21,12 +21,12 @@ using the host node's context so we are implementing one here """ from nova.openstack.common import log as logging -from nova.virt.openvz import file as ovzfile +from ovznovadriver.openvz import file as ovzfile import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.file_ext.boot') +LOG = logging.getLogger('ovznovadriver.openvz.file_ext.boot') class OVZBootFile(ovzfile.OVZFile): diff --git a/nova/virt/openvz/file_ext/ext_storage.py b/ovznovadriver/openvz/file_ext/ext_storage.py similarity index 95% rename from nova/virt/openvz/file_ext/ext_storage.py rename to ovznovadriver/openvz/file_ext/ext_storage.py index 8702ea0..200ebf0 100644 --- a/nova/virt/openvz/file_ext/ext_storage.py +++ b/ovznovadriver/openvz/file_ext/ext_storage.py @@ -22,14 +22,15 @@ is sketchy at best. import json from nova.openstack.common import log as logging -from nova.virt.openvz import file as ovzfile +from ovznovadriver.localization import _ +from ovznovadriver.openvz import file as ovzfile import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.file_ext.ext_storage') +LOG = logging.getLogger('ovznovadriver.openvz.file_ext.ext_storage') class OVZExtStorage(object): diff --git a/nova/virt/openvz/file_ext/shutdown.py b/ovznovadriver/openvz/file_ext/shutdown.py similarity index 91% rename from nova/virt/openvz/file_ext/shutdown.py rename to ovznovadriver/openvz/file_ext/shutdown.py index 18f1f8e..e174f58 100644 --- a/nova/virt/openvz/file_ext/shutdown.py +++ b/ovznovadriver/openvz/file_ext/shutdown.py @@ -20,12 +20,13 @@ OpenVz doesn't have provision for a script to be run before a container is stopped but with the host node's context so we are implementing one here. """ from nova.openstack.common import log as logging -from nova.virt.openvz import file as ovzfile +from ovznovadriver.localization import _ +from ovznovadriver.openvz import file as ovzfile import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.file_ext.shutdown') +LOG = logging.getLogger('ovznovadriver.openvz.file_ext.shutdown') class OVZShutdownFile(ovzfile.OVZFile): diff --git a/nova/virt/openvz/file_ext/start.py b/ovznovadriver/openvz/file_ext/start.py similarity index 95% rename from nova/virt/openvz/file_ext/start.py rename to ovznovadriver/openvz/file_ext/start.py index a0a5e1d..15abea5 100644 --- a/nova/virt/openvz/file_ext/start.py +++ b/ovznovadriver/openvz/file_ext/start.py @@ -19,7 +19,7 @@ A driver specific to OpenVz as the support for Ovz in libvirt is sketchy at best. """ -from nova.virt.openvz import file as ovzfile +from ovznovadriver.openvz import file as ovzfile import os from oslo.config import cfg diff --git a/nova/virt/openvz/file_ext/stop.py b/ovznovadriver/openvz/file_ext/stop.py similarity index 95% rename from nova/virt/openvz/file_ext/stop.py rename to ovznovadriver/openvz/file_ext/stop.py index d34a2d0..306cbfd 100644 --- a/nova/virt/openvz/file_ext/stop.py +++ b/ovznovadriver/openvz/file_ext/stop.py @@ -19,7 +19,7 @@ A driver specific to OpenVz as the support for Ovz in libvirt is sketchy at best. """ -from nova.virt.openvz import file as ovzfile +from ovznovadriver.openvz import file as ovzfile import os from oslo.config import cfg diff --git a/nova/virt/openvz/migration.py b/ovznovadriver/openvz/migration.py similarity index 98% rename from nova/virt/openvz/migration.py rename to ovznovadriver/openvz/migration.py index cac88b7..3f67e68 100644 --- a/nova/virt/openvz/migration.py +++ b/ovznovadriver/openvz/migration.py @@ -21,12 +21,13 @@ is sketchy at best. """ from nova import exception from nova.openstack.common import log as logging -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.localization import _ +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.volume') +LOG = logging.getLogger('ovznovadriver.openvz.volume') class OVZMigration(object): @@ -356,7 +357,7 @@ class OVZMigration(object): def _setup_transport(self, src_path, dest_path, skip_list=None): if CONF.ovz_migration_transport == 'rsync': - from nova.virt.openvz.migration_drivers import rsync + from ovznovadriver.openvz.migration_drivers import rsync return rsync.OVZMigrationRsyncTransport( src_path, dest_path, self.instance['id'], self.destination_host, skip_list) diff --git a/nova/virt/openvz/file_ext/__init__.py b/ovznovadriver/openvz/migration_drivers/__init__.py similarity index 100% rename from nova/virt/openvz/file_ext/__init__.py rename to ovznovadriver/openvz/migration_drivers/__init__.py diff --git a/nova/virt/openvz/migration_drivers/rsync.py b/ovznovadriver/openvz/migration_drivers/rsync.py similarity index 90% rename from nova/virt/openvz/migration_drivers/rsync.py rename to ovznovadriver/openvz/migration_drivers/rsync.py index 013c88d..9ba361e 100644 --- a/nova/virt/openvz/migration_drivers/rsync.py +++ b/ovznovadriver/openvz/migration_drivers/rsync.py @@ -19,13 +19,14 @@ Driver for OVZ Migrations. Uses rsync as a backend. """ from nova.openstack.common import log as logging -from nova.virt.openvz.migration_drivers import transport -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.localization import _ +from ovznovadriver.openvz.migration_drivers import transport +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.migration_drivers.rsync') +LOG = logging.getLogger('ovznovadriver.openvz.migration_drivers.rsync') class OVZMigrationRsyncTransport(transport.OVZMigrationTransport): diff --git a/nova/virt/openvz/migration_drivers/transport.py b/ovznovadriver/openvz/migration_drivers/transport.py similarity index 95% rename from nova/virt/openvz/migration_drivers/transport.py rename to ovznovadriver/openvz/migration_drivers/transport.py index c0f84dc..f7d09ae 100644 --- a/nova/virt/openvz/migration_drivers/transport.py +++ b/ovznovadriver/openvz/migration_drivers/transport.py @@ -20,11 +20,12 @@ Generic transport class for OVZ Migrations. Common methods will be placed in this file for reuse. """ from nova.openstack.common import log as logging +from ovznovadriver.localization import _ import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.migration_drivers.transport') +LOG = logging.getLogger('ovznovadriver.openvz.migration_drivers.transport') class OVZMigrationTransport(object): diff --git a/nova/virt/openvz/network.py b/ovznovadriver/openvz/network.py similarity index 95% rename from nova/virt/openvz/network.py rename to ovznovadriver/openvz/network.py index 2bdc8ae..37b1b9d 100644 --- a/nova/virt/openvz/network.py +++ b/ovznovadriver/openvz/network.py @@ -23,16 +23,17 @@ is sketchy at best. from Cheetah import Template from nova import exception from nova.openstack.common import log as logging -from nova.virt.openvz import file as ovzfile -from nova.virt.openvz.file_ext import boot as ovzboot -from nova.virt.openvz.file_ext import shutdown as ovzshutdown -from nova.virt.openvz.network_drivers import tc as ovztc -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.localization import _ +from ovznovadriver.openvz import file as ovzfile +from ovznovadriver.openvz.file_ext import boot as ovzboot +from ovznovadriver.openvz.file_ext import shutdown as ovzshutdown +from ovznovadriver.openvz.network_drivers import tc as ovztc +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.network') +LOG = logging.getLogger('ovznovadriver.openvz.network') class OVZNetworkInterfaces(object): diff --git a/nova/virt/openvz/migration_drivers/__init__.py b/ovznovadriver/openvz/network_drivers/__init__.py similarity index 100% rename from nova/virt/openvz/migration_drivers/__init__.py rename to ovznovadriver/openvz/network_drivers/__init__.py diff --git a/nova/virt/openvz/network_drivers/network_bridge.py b/ovznovadriver/openvz/network_drivers/network_bridge.py similarity index 94% rename from nova/virt/openvz/network_drivers/network_bridge.py rename to ovznovadriver/openvz/network_drivers/network_bridge.py index 7876bd2..51b133b 100644 --- a/nova/virt/openvz/network_drivers/network_bridge.py +++ b/ovznovadriver/openvz/network_drivers/network_bridge.py @@ -21,9 +21,10 @@ is sketchy at best. """ from nova.network import linux_net +from ovznovadriver.localization import _ from nova.openstack.common import log as logging -LOG = logging.getLogger('nova.virt.openvz.network_drivers.network_bridge') +LOG = logging.getLogger('ovznovadriver.openvz.network_drivers.network_bridge') class OVZNetworkBridgeDriver(object): diff --git a/nova/virt/openvz/network_drivers/tc.py b/ovznovadriver/openvz/network_drivers/tc.py similarity index 98% rename from nova/virt/openvz/network_drivers/tc.py rename to ovznovadriver/openvz/network_drivers/tc.py index 3e8e9a0..2575548 100644 --- a/nova/virt/openvz/network_drivers/tc.py +++ b/ovznovadriver/openvz/network_drivers/tc.py @@ -20,13 +20,14 @@ from nova import context from nova import exception from nova.openstack.common import lockutils from nova.openstack.common import log as logging -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.localization import _ +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg import random CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.network_drivers.tc') +LOG = logging.getLogger('ovznovadriver.openvz.network_drivers.tc') global _ovz_tc_available_ids global _ovz_tc_inflight_ids diff --git a/nova/virt/openvz/network_drivers/templates/tc_container_start.template b/ovznovadriver/openvz/network_drivers/templates/tc_container_start.template similarity index 100% rename from nova/virt/openvz/network_drivers/templates/tc_container_start.template rename to ovznovadriver/openvz/network_drivers/templates/tc_container_start.template diff --git a/nova/virt/openvz/network_drivers/templates/tc_container_stop.template b/ovznovadriver/openvz/network_drivers/templates/tc_container_stop.template similarity index 100% rename from nova/virt/openvz/network_drivers/templates/tc_container_stop.template rename to ovznovadriver/openvz/network_drivers/templates/tc_container_stop.template diff --git a/nova/virt/openvz/network_drivers/templates/tc_host_start.template b/ovznovadriver/openvz/network_drivers/templates/tc_host_start.template similarity index 100% rename from nova/virt/openvz/network_drivers/templates/tc_host_start.template rename to ovznovadriver/openvz/network_drivers/templates/tc_host_start.template diff --git a/nova/virt/openvz/network_drivers/templates/tc_host_stop.template b/ovznovadriver/openvz/network_drivers/templates/tc_host_stop.template similarity index 100% rename from nova/virt/openvz/network_drivers/templates/tc_host_stop.template rename to ovznovadriver/openvz/network_drivers/templates/tc_host_stop.template diff --git a/nova/virt/openvz/utils.py b/ovznovadriver/openvz/utils.py similarity index 99% rename from nova/virt/openvz/utils.py rename to ovznovadriver/openvz/utils.py index 15fb22d..861f1cc 100644 --- a/nova/virt/openvz/utils.py +++ b/ovznovadriver/openvz/utils.py @@ -26,6 +26,7 @@ from nova import context from nova import exception from nova.openstack.common import log as logging from nova.openstack.common import processutils +from ovznovadriver.localization import _ from nova import utils import os from oslo.config import cfg @@ -35,7 +36,7 @@ import sys import uuid CONF = cfg.CONF -LOG = logging.getLogger('nova.virt.openvz.utils') +LOG = logging.getLogger('ovznovadriver.openvz.utils') conductor = api.API() diff --git a/nova/virt/openvz/volume.py b/ovznovadriver/openvz/volume.py similarity index 98% rename from nova/virt/openvz/volume.py rename to ovznovadriver/openvz/volume.py index d0b57b6..5494513 100644 --- a/nova/virt/openvz/volume.py +++ b/ovznovadriver/openvz/volume.py @@ -24,8 +24,9 @@ import glob from nova import exception from nova.openstack.common import log as logging from nova.openstack.common import processutils -from nova.virt.openvz import file as ovzfile -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.localization import _ +from ovznovadriver.openvz import file as ovzfile +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg import re @@ -38,7 +39,7 @@ CONF.register_opt( help='Number of attempts before we determine that a device ' 'has had time to settle and we are beyond a reasonable ' 'wait time')) -LOG = logging.getLogger('nova.virt.openvz.volume') +LOG = logging.getLogger('ovznovadriver.openvz.volume') class OVZVolume(object): diff --git a/nova/virt/openvz/network_drivers/__init__.py b/ovznovadriver/openvz/volume_drivers/__init__.py similarity index 100% rename from nova/virt/openvz/network_drivers/__init__.py rename to ovznovadriver/openvz/volume_drivers/__init__.py diff --git a/nova/virt/openvz/volume_drivers/iscsi.py b/ovznovadriver/openvz/volume_drivers/iscsi.py similarity index 96% rename from nova/virt/openvz/volume_drivers/iscsi.py rename to ovznovadriver/openvz/volume_drivers/iscsi.py index 2471cf0..24ae2ae 100644 --- a/nova/virt/openvz/volume_drivers/iscsi.py +++ b/ovznovadriver/openvz/volume_drivers/iscsi.py @@ -23,8 +23,9 @@ from nova import exception from nova.openstack.common import lockutils from nova.openstack.common import log as logging from nova.openstack.common import processutils -from nova.virt.openvz import utils as ovz_utils -from nova.virt.openvz import volume as ovzvolume +from ovznovadriver.localization import _ +from ovznovadriver.openvz import utils as ovz_utils +from ovznovadriver.openvz import volume as ovzvolume from oslo.config import cfg @@ -34,7 +35,7 @@ CONF.register_opt( default=1, help='Number of attempts to make an iscsi connection')) -LOG = logging.getLogger('nova.virt.openvz.volume_drivers.iscsi') +LOG = logging.getLogger('ovznovadriver.openvz.volume_drivers.iscsi') class OVZISCSIStorageDriver(ovzvolume.OVZVolume): diff --git a/nova/virt/openvz/volume_drivers/__init__.py b/ovznovadriver/tests/openvz/__init__.py similarity index 100% rename from nova/virt/openvz/volume_drivers/__init__.py rename to ovznovadriver/tests/openvz/__init__.py diff --git a/nova/tests/openvz/fakes.py b/ovznovadriver/tests/openvz/fakes.py similarity index 99% rename from nova/tests/openvz/fakes.py rename to ovznovadriver/tests/openvz/fakes.py index 323f952..711cffb 100644 --- a/nova/tests/openvz/fakes.py +++ b/ovznovadriver/tests/openvz/fakes.py @@ -19,7 +19,7 @@ from Cheetah import Template import json from nova.compute import power_state from nova import exception -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg import random diff --git a/nova/tests/openvz/test_driver.py b/ovznovadriver/tests/openvz/test_driver.py similarity index 99% rename from nova/tests/openvz/test_driver.py rename to ovznovadriver/tests/openvz/test_driver.py index f0a8671..a0d6d1b 100644 --- a/nova/tests/openvz/test_driver.py +++ b/ovznovadriver/tests/openvz/test_driver.py @@ -23,11 +23,11 @@ from nova.compute import power_state from nova import exception from nova.openstack.common import processutils from nova import test -from nova.tests.openvz import fakes -from nova.virt.openvz import driver as openvz_conn -from nova.virt.openvz.file_ext import ext_storage -from nova.virt.openvz import migration -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.tests.openvz import fakes +from ovznovadriver.openvz import driver as openvz_conn +from ovznovadriver.openvz.file_ext import ext_storage +from ovznovadriver.openvz import migration +from ovznovadriver.openvz import utils as ovz_utils import os from oslo.config import cfg @@ -42,7 +42,7 @@ class OpenVzDriverTestCase(test.TestCase): except AttributeError: CONF.register_opt( cfg.StrOpt('injected_network_template', - default='nova/virt/interfaces.template', + default='ovznovadriver/interfaces.template', help='Stub for network template ' 'for testing purposes')) CONF.use_ipv6 = False diff --git a/nova/tests/openvz/test_ext_storage.py b/ovznovadriver/tests/openvz/test_ext_storage.py similarity index 98% rename from nova/tests/openvz/test_ext_storage.py rename to ovznovadriver/tests/openvz/test_ext_storage.py index 1688064..60b6124 100644 --- a/nova/tests/openvz/test_ext_storage.py +++ b/ovznovadriver/tests/openvz/test_ext_storage.py @@ -18,7 +18,7 @@ import json from nova import test from nova.tests.openvz import fakes -from nova.virt.openvz.file_ext import ext_storage +from ovznovadriver.openvz.file_ext import ext_storage import os from oslo.config import cfg diff --git a/nova/tests/openvz/test_file.py b/ovznovadriver/tests/openvz/test_file.py similarity index 96% rename from nova/tests/openvz/test_file.py rename to ovznovadriver/tests/openvz/test_file.py index 2ce96d2..6b78bbe 100644 --- a/nova/tests/openvz/test_file.py +++ b/ovznovadriver/tests/openvz/test_file.py @@ -20,9 +20,9 @@ import mox from nova import exception from nova import test from nova.tests.openvz import fakes -from nova.virt.openvz import driver as openvz_conn -from nova.virt.openvz import file as ovzfile -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.openvz import driver as openvz_conn +from ovznovadriver.openvz import file as ovzfile +from ovznovadriver.openvz import utils as ovz_utils from oslo.config import cfg CONF = cfg.CONF diff --git a/nova/tests/openvz/test_network.py b/ovznovadriver/tests/openvz/test_network.py similarity index 97% rename from nova/tests/openvz/test_network.py rename to ovznovadriver/tests/openvz/test_network.py index e096bf7..f2164f7 100644 --- a/nova/tests/openvz/test_network.py +++ b/ovznovadriver/tests/openvz/test_network.py @@ -19,9 +19,9 @@ import mox from nova import exception from nova import test from nova.tests.openvz import fakes -from nova.virt.openvz import driver as openvz_conn -from nova.virt.openvz import network as openvz_net -from nova.virt.openvz.network_drivers import network_bridge +from ovznovadriver.openvz import driver as openvz_conn +from ovznovadriver.openvz import network as openvz_net +from ovznovadriver.openvz.network_drivers import network_bridge from oslo.config import cfg CONF = cfg.CONF @@ -36,7 +36,7 @@ class OpenVzNetworkTestCase(test.TestCase): CONF.register_opt( cfg.StrOpt( 'injected_network_template', - default='nova/virt/interfaces.template', + default='ovznovadriver/interfaces.template', help='Stub for network template for testing purposes') ) CONF.use_ipv6 = False diff --git a/nova/tests/openvz/test_utils.py b/ovznovadriver/tests/openvz/test_utils.py similarity index 99% rename from nova/tests/openvz/test_utils.py rename to ovznovadriver/tests/openvz/test_utils.py index 1737537..dad8f6b 100644 --- a/nova/tests/openvz/test_utils.py +++ b/ovznovadriver/tests/openvz/test_utils.py @@ -20,7 +20,7 @@ from nova import exception from nova.openstack.common import processutils from nova import test from nova.tests.openvz import fakes -from nova.virt.openvz import utils as ovz_utils +from ovznovadriver.openvz import utils as ovz_utils from oslo.config import cfg import uuid diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c2f1827 --- /dev/null +++ b/setup.py @@ -0,0 +1,33 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# 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 setuptools + + +setuptools.setup( + name='openvz-nova-driver', + version='0.1.0', + description='The OpenVZ Driver for Nova', + author='Rackspace', + packages=setuptools.find_packages(exclude=['debian', 'etc']), + include_package_data=True, + # i dont know where to put this package to make sure its built + classifiers=[ + 'Development Status :: 4 - Beta', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2.6', + 'Environment :: No Input/Output (Daemon)', + ] +)