~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/virt/hyperv/baseops.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman, Yolanda Robla, James Page
  • Date: 2013-01-11 13:06:56 UTC
  • mfrom: (1.1.67)
  • Revision ID: package-import@ubuntu.com-20130111130656-7n7fkevy03stm3mv
Tags: 2013.1~g2-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/patches/ubuntu-show-tests.patch: Dropped no longer needed.
* debian/nova-xcp-plugins.install: Fix xcp-plugins empty packages
* debian/control: Drop python-nose in favor or testrepository
* debian/control: Add python-coverage as a build dep.
* debian/rules, debian/control: Run pep8 tests.
* debian/*.init: Remove they are not needed and take up space
* debian/control, debian/nova-cells.{install, logrotate, upstart}: Add
  cells support.
* debian/patches/fix-ubuntu-tests.patch: temporarily disable failing tests.
* debian/control, debian/nova-baremetal.{install, logrotate, upstart}: Add
  nova baremetal support.
* debian/control: Remove python-support.

[ Adam Gandelman ]
* debian/*.manpages: Install Sphinx-generated manpages instead of
  our own.
* debian/nova-compute-*.conf: Specify the newly required compute_driver
  flag in addition to libvirt_type.
* debian/control:  Specify required python-webob and python-stevedore
  versions.

[ Yolanda Robla ]
* debian/*.upstart: Use start-stop-daemon instead of su for chuid
  (LP: #1086833).
* debian/rules: Remove override of dh_installinit for discriminating
  between Debian and Ubuntu.
* debian/nova-common.docs: Installing changelogs from rules
* debian/rules: Replacing perms in /etc/nova/logging.conf for 0644
* debian/control: adduser dependency on nova-compute.
* debian/control: added section oldlibs and priority extra on
  nova-ajax-console-proxy.
* debian/nova-xvpvncproxy.postrm: removing because of duplicates.

[ James Page ]
* d/control: Add ~ to python-sqlalchemy-ext versioned dependencies to
  make backporting easier.
* d/control: Updated nova-volume description and depdendencies to
  mark it as a transitional package, moved to oldlibs/extra.
* d/p/fix-libvirt-tests.patch: Dropped; accepted upstream.
* d/control: Added python-stevedore to BD's.
* d/*.postrm: Dropped postrm's that just run update-rc.d; this is not
  required when deploying upstart configurations only.
* d/nova-scheduler.manpages: Add man page for nova-rpc-zmq-receiver.
* d/rules: Install upstream changelog with a policy compliant name.
* d/control: Mark nova-compute-xcp as virtual package.
* d/control: nova-api-os-volume; Depend on cinder-api and mark as
  transitional package.
* d/nova-api-os-volume.lintian-overrides: Dropped - no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright 2012 Cloudbase Solutions Srl
 
4
# All Rights Reserved.
 
5
#
 
6
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
#    not use this file except in compliance with the License. You may obtain
 
8
#    a copy of the License at
 
9
#
 
10
#         http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
#    Unless required by applicable law or agreed to in writing, software
 
13
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
#    License for the specific language governing permissions and limitations
 
16
#    under the License.
 
17
 
 
18
"""
 
19
Management base class for Hyper-V operations.
 
20
"""
 
21
import sys
 
22
 
 
23
from nova.openstack.common import log as logging
 
24
 
 
25
# Check needed for unit testing on Unix
 
26
if sys.platform == 'win32':
 
27
    import wmi
 
28
 
 
29
LOG = logging.getLogger(__name__)
 
30
 
 
31
 
 
32
class BaseOps(object):
 
33
    def __init__(self):
 
34
        self.__conn = None
 
35
        self.__conn_v2 = None
 
36
        self.__conn_cimv2 = None
 
37
        self.__conn_wmi = None
 
38
        self.__conn_storage = None
 
39
 
 
40
    @property
 
41
    def _conn(self):
 
42
        if self.__conn is None:
 
43
            self.__conn = wmi.WMI(moniker='//./root/virtualization')
 
44
        return self.__conn
 
45
 
 
46
    @property
 
47
    def _conn_v2(self):
 
48
        if self.__conn_v2 is None:
 
49
            self.__conn_v2 = wmi.WMI(moniker='//./root/virtualization/v2')
 
50
        return self.__conn_v2
 
51
 
 
52
    @property
 
53
    def _conn_cimv2(self):
 
54
        if self.__conn_cimv2 is None:
 
55
            self.__conn_cimv2 = wmi.WMI(moniker='//./root/cimv2')
 
56
        return self.__conn_cimv2
 
57
 
 
58
    @property
 
59
    def _conn_wmi(self):
 
60
        if self.__conn_wmi is None:
 
61
            self.__conn_wmi = wmi.WMI(moniker='//./root/wmi')
 
62
        return self.__conn_wmi
 
63
 
 
64
    @property
 
65
    def _conn_storage(self):
 
66
        if self.__conn_storage is None:
 
67
            storage_namespace = '//./Root/Microsoft/Windows/Storage'
 
68
            self.__conn_storage = wmi.WMI(moniker=storage_namespace)
 
69
        return self.__conn_storage