Cleaned up some pylint errors
This commit is contained in:
commit
259e725ee9
@ -35,7 +35,7 @@ class Versions(wsgi.Resource):
|
||||
'application/xml': wsgi.XMLDictSerializer(metadata=metadata),
|
||||
}
|
||||
|
||||
super(Versions, self).__init__(None, serializers=serializers)
|
||||
wsgi.Resource.__init__(self, None, serializers=serializers)
|
||||
|
||||
def dispatch(self, request, *args):
|
||||
"""Respond to a request for all OpenStack API versions."""
|
||||
|
@ -139,7 +139,7 @@ class LdapDriver(object):
|
||||
self.__cache = None
|
||||
return False
|
||||
|
||||
def __local_cache(key_fmt):
|
||||
def __local_cache(key_fmt): # pylint: disable=E0213
|
||||
"""Wrap function to cache it's result in self.__cache.
|
||||
Works only with functions with one fixed argument.
|
||||
"""
|
||||
|
@ -114,7 +114,7 @@ def get_instance_type(id):
|
||||
ctxt = context.get_admin_context()
|
||||
return db.instance_type_get_by_id(ctxt, id)
|
||||
except exception.DBError:
|
||||
raise exception.ApiError(_("Unknown instance type: %s") % name)
|
||||
raise exception.ApiError(_("Unknown instance type: %s") % id)
|
||||
|
||||
|
||||
def get_instance_type_by_name(name):
|
||||
|
@ -36,6 +36,7 @@ from twisted.application import service
|
||||
|
||||
from nova import flags
|
||||
from nova import log as logging
|
||||
from nova import utils
|
||||
from nova.virt import connection as virt_connection
|
||||
|
||||
|
||||
|
@ -119,7 +119,7 @@ class VMRCSessionConsole(VMRCConsole):
|
||||
"""
|
||||
vms = vim_session._call_method(vim_util, 'get_objects',
|
||||
'VirtualMachine', ['name'])
|
||||
vm_ref = NoneV
|
||||
vm_ref = None
|
||||
for vm in vms:
|
||||
if vm.propSet[0].val == instance_name:
|
||||
vm_ref = vm.obj
|
||||
|
@ -69,7 +69,7 @@ class VMWareAPIVMTestCase(test.TestCase):
|
||||
'instance_type': 'm1.large',
|
||||
'mac_address': 'aa:bb:cc:dd:ee:ff',
|
||||
}
|
||||
self.instance = db.instance_create(values)
|
||||
self.instance = db.instance_create(None, values)
|
||||
|
||||
def _create_vm(self):
|
||||
"""Create and spawn the VM."""
|
||||
|
@ -52,7 +52,7 @@ def stub_out_db_instance_api(stubs):
|
||||
else:
|
||||
raise NotImplementedError()
|
||||
|
||||
def fake_instance_create(values):
|
||||
def fake_instance_create(context, values):
|
||||
"""Stubs out the db.instance_create method."""
|
||||
|
||||
type_data = INSTANCE_TYPES[values['instance_type']]
|
||||
|
@ -101,7 +101,7 @@ class VMOps(object):
|
||||
if not vm_ref:
|
||||
vm_ref = VMHelper.lookup(self._session, instance.name)
|
||||
if vm_ref is None:
|
||||
raise exception(_('Attempted to power on non-existent instance'
|
||||
raise Exception(_('Attempted to power on non-existent instance'
|
||||
' bad instance id %s') % instance.id)
|
||||
LOG.debug(_("Starting instance %s"), instance.name)
|
||||
self._session.call_xenapi('VM.start', vm_ref, False, False)
|
||||
|
Loading…
Reference in New Issue
Block a user