summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2012-03-07 15:58:07 -0600
committerJosh Kearney <josh@jk0.org>2012-03-07 17:00:45 -0600
commit010f8b14041090fe8a1ea57956b8d66dc382ecfe (patch)
tree7d0e8ae054c5f7a8df710cd12f2fe680d4f2239d
parent4242b6883ec0181e9dcfca6721824d637bb83f5d (diff)
downloadnova-010f8b14041090fe8a1ea57956b8d66dc382ecfe.tar.gz
nova-010f8b14041090fe8a1ea57956b8d66dc382ecfe.tar.xz
nova-010f8b14041090fe8a1ea57956b8d66dc382ecfe.zip
Further cleanup of XenAPI.
Change-Id: If29e326f67ca8a81f26fe0b1b0b8989ccfc05aaf
-rw-r--r--nova/tests/test_xenapi.py2
-rw-r--r--nova/virt/xenapi/fake.py2
-rw-r--r--nova/virt/xenapi/pool.py4
-rw-r--r--nova/virt/xenapi/vm_utils.py1
-rw-r--r--nova/virt/xenapi/vmops.py4
-rw-r--r--nova/virt/xenapi_conn.py1
6 files changed, 3 insertions, 11 deletions
diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py
index 89f5693da..bc58330bb 100644
--- a/nova/tests/test_xenapi.py
+++ b/nova/tests/test_xenapi.py
@@ -1790,7 +1790,7 @@ class XenAPIAggregateTestCase(test.TestCase):
def test_join_slave(self):
"""Ensure join_slave gets called when the request gets to master."""
- def fake_join_slave(id, compute_uuid, url, user, password):
+ def fake_join_slave(id, compute_uuid, host, url, user, password):
fake_join_slave.called = True
self.stubs.Set(self.conn._pool, "_join_slave", fake_join_slave)
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index e074e1c9b..0b2f1fef2 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -401,8 +401,6 @@ class SessionBase(object):
def SR_introduce(self, _1, sr_uuid, label, desc, type, content_type,
shared, sm_config):
- host_ref = _db_content['host'].keys()[0]
-
ref = None
rec = None
for ref, rec in _db_content['SR'].iteritems():
diff --git a/nova/virt/xenapi/pool.py b/nova/virt/xenapi/pool.py
index 7448ae357..6635d4c19 100644
--- a/nova/virt/xenapi/pool.py
+++ b/nova/virt/xenapi/pool.py
@@ -76,7 +76,7 @@ class ResourcePool(object):
# this is the master -> do a pool-join
# To this aim, nova compute on the slave has to go down.
# NOTE: it is assumed that ONLY nova compute is running now
- self._join_slave(aggregate.id,
+ self._join_slave(aggregate.id, host,
kwargs.get('compute_uuid'),
kwargs.get('url'), kwargs.get('user'),
kwargs.get('passwd'))
@@ -127,7 +127,7 @@ class ResourcePool(object):
'from the pool; No master found')
% locals())
- def _join_slave(self, aggregate_id, compute_uuid, url, user, passwd):
+ def _join_slave(self, aggregate_id, host, compute_uuid, url, user, passwd):
"""Joins a slave into a XenServer resource pool."""
try:
args = {'compute_uuid': compute_uuid,
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 31c525164..cde76642f 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -740,7 +740,6 @@ class VMHelper(xenapi.HelperBase):
Returns: A list of dictionaries that describe VDIs
"""
- instance_id = instance.id
LOG.debug(_("Asking xapi to fetch vhd image %(image)s")
% locals())
sr_ref = cls.safe_find_sr(session)
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index bacf46b02..309bd65f6 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -25,7 +25,6 @@ import functools
import json
import os
import pickle
-import random
import time
import uuid
@@ -699,7 +698,6 @@ class VMOps(object):
return
def _migrate_vhd(self, instance, vdi_uuid, dest, sr_path):
- instance_id = instance['id']
instance_uuid = instance['uuid']
params = {'host': dest,
'vdi_uuid': vdi_uuid,
@@ -1174,7 +1172,6 @@ class VMOps(object):
def _destroy_vm(self, instance, vm_ref):
"""Destroys a VM record."""
- instance_id = instance['id']
instance_uuid = instance['uuid']
try:
task = self._session.call_xenapi('Async.VM.destroy', vm_ref)
@@ -1624,7 +1621,6 @@ class VMOps(object):
Abstracts out the process of calling a method of a xenapi plugin.
Any errors raised by the plugin will in turn raise a RuntimeError here.
"""
- instance_id = vm['id']
instance_uuid = vm['uuid']
vm_ref = vm_ref or self._get_vm_opaque_ref(vm)
vm_rec = self._session.call_xenapi("VM.get_record", vm_ref)
diff --git a/nova/virt/xenapi_conn.py b/nova/virt/xenapi_conn.py
index dc7758bb6..d6d05e8f8 100644
--- a/nova/virt/xenapi_conn.py
+++ b/nova/virt/xenapi_conn.py
@@ -76,7 +76,6 @@ from nova.openstack.common import cfg
from nova.virt import driver
from nova.virt.xenapi import host
from nova.virt.xenapi import pool
-from nova.virt.xenapi import vm_utils
from nova.virt.xenapi import vmops
from nova.virt.xenapi import volumeops