diff --git a/hyperv/__init__.py b/hyperv/__init__.py index e69de29b..42067924 100644 --- a/hyperv/__init__.py +++ b/hyperv/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2016 Cloudbase Solutions Srl +# +# 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__('pkg_resources').declare_namespace(__name__) diff --git a/hyperv/nova/hostops.py b/hyperv/nova/hostops.py index c5f9ca6a..9353a80c 100644 --- a/hyperv/nova/hostops.py +++ b/hyperv/nova/hostops.py @@ -50,7 +50,6 @@ hyper_host_opts = [ CONF = cfg.CONF CONF.register_opts(hyper_host_opts, 'hyperv') -CONF.import_opt('my_ip', 'nova.netconf') CONF.import_opt('enable_remotefx', 'hyperv.nova.vmops', 'hyperv') LOG = logging.getLogger(__name__) diff --git a/hyperv/nova/volumeops.py b/hyperv/nova/volumeops.py index 214c0538..c9c10393 100644 --- a/hyperv/nova/volumeops.py +++ b/hyperv/nova/volumeops.py @@ -60,8 +60,6 @@ hyper_volumeops_opts = [ CONF = nova.conf.CONF CONF.register_opts(hyper_volumeops_opts, 'hyperv') -CONF.import_opt('host', 'nova.netconf') -CONF.import_opt('my_ip', 'nova.netconf') class VolumeOps(object): diff --git a/nova/__init__.py b/nova/__init__.py new file mode 100644 index 00000000..42067924 --- /dev/null +++ b/nova/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2016 Cloudbase Solutions Srl +# +# 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__('pkg_resources').declare_namespace(__name__) diff --git a/nova/virt/__init__.py b/nova/virt/__init__.py new file mode 100644 index 00000000..42067924 --- /dev/null +++ b/nova/virt/__init__.py @@ -0,0 +1,15 @@ +# Copyright (c) 2016 Cloudbase Solutions Srl +# +# 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__('pkg_resources').declare_namespace(__name__) diff --git a/nova/virt/compute_hyperv/__init__.py b/nova/virt/compute_hyperv/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nova/virt/compute_hyperv/cluster/__init__.py b/nova/virt/compute_hyperv/cluster/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nova/virt/compute_hyperv/cluster/driver.py b/nova/virt/compute_hyperv/cluster/driver.py new file mode 100644 index 00000000..b8169a97 --- /dev/null +++ b/nova/virt/compute_hyperv/cluster/driver.py @@ -0,0 +1,22 @@ +# Copyright (c) 2016 Cloudbase Solutions Srl +# +# 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. + +"""A Hyper-V Cluster Nova Compute driver.""" + +from hyperv.nova.cluster import driver + +# NOTE: nova changed the way it imports drivers. All drivers must belong +# in the nova.virt namespace. + +HyperVClusterDriver = driver.HyperVClusterDriver diff --git a/nova/virt/compute_hyperv/driver.py b/nova/virt/compute_hyperv/driver.py new file mode 100644 index 00000000..0026459f --- /dev/null +++ b/nova/virt/compute_hyperv/driver.py @@ -0,0 +1,24 @@ +# Copyright (c) 2016 Cloudbase Solutions Srl +# +# 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. + +""" +A Hyper-V Nova Compute driver. +""" + +from hyperv.nova import driver + +# NOTE: nova changed the way it imports drivers. All drivers must belong +# in the nova.virt namespace. + +HyperVDriver = driver.HyperVDriver diff --git a/setup.cfg b/setup.cfg index 66c80902..9734e38d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,6 +25,7 @@ keywords = openstack nova hyper-v compute [files] packages = hyperv + nova.virt.compute_hyperv [build_sphinx] source-dir = doc/source diff --git a/tools/tox_install.sh b/tools/tox_install.sh deleted file mode 100755 index c0a6ca81..00000000 --- a/tools/tox_install.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -# compute-hyperv repo depends on nova, which doesn't exist on pypi. - -# This wrapper for tox's package installer will use the existing package -# if it exists, else use zuul-cloner if that program exists, else grab it -# from nova master via a hard-coded URL. That last case should only -# happen with devs running unit tests locally. - -# From the tox.ini config page: -# install_command=ARGV -# default: -# pip install {opts} {packages} - -ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner -nova_installed=$(echo "import nova" | python 2>/dev/null ; echo $?) - -set -e - -if [ $nova_installed -eq 0 ]; then - echo "ALREADY INSTALLED" > /tmp/tox_install.txt - echo "Nova already installed; using existing package" -elif [ -x "$ZUUL_CLONER" ]; then - export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH} - echo "ZUUL CLONER" > /tmp/tox_install.txt - cwd=$(/bin/pwd) - cd /tmp - $ZUUL_CLONER --cache-dir \ - /opt/git \ - git://git.openstack.org \ - openstack/nova - cd openstack/nova - pip install -e . - cd "$cwd" -else - echo "PIP HARDCODE" > /tmp/tox_install.txt - pip install -U -egit+https://git.openstack.org/openstack/nova#egg=nova -fi - -pip install -U $* -exit $? \ No newline at end of file diff --git a/tox.ini b/tox.ini index 324b025f..1a1bb37a 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ usedevelop = True # tox is silly... these need to be separated by a newline.... whitelist_externals = bash find -install_command = {toxinidir}/tools/tox_install.sh {opts} {packages} +install_command = pip install -U {opts} {packages} # Note the hash seed is set to 0 until hyperv can be tested with a # random hash seed successfully. setenv = VIRTUAL_ENV={envdir} @@ -17,6 +17,7 @@ setenv = VIRTUAL_ENV={envdir} LANGUAGE=en_US deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt + -egit+https://github.com/openstack/nova#egg=nova commands = find . -type f -name "*.pyc" -delete python setup.py testr --slowest --testr-args='{posargs}'