Fix outstanding pep8 errors for a clean trunk.
Also, add an option to run_tests.sh to skip running pep8. We have a separate job in Jenkins which runs pep8, so there's no need to spin our wheels on it during the test run. Change-Id: I552330994e55a36fa96b63658493ed30e2720c85
This commit is contained in:
parent
37100f5653
commit
21dcf669c7
@ -1,5 +1,6 @@
|
||||
from nova import datastore
|
||||
|
||||
|
||||
class RackspaceAPIIdTranslator(object):
|
||||
"""
|
||||
Converts Rackspace API ids to and from the id format for a given
|
||||
@ -21,7 +22,7 @@ class RackspaceAPIIdTranslator(object):
|
||||
def to_rs_id(self, opaque_id):
|
||||
"""Convert an id from a strategy-specific one to a Rackspace one."""
|
||||
result = self._store.hget(self._fwd_key, str(opaque_id))
|
||||
if result: # we have a mapping from opaque to RS for this strategy
|
||||
if result: # we have a mapping from opaque to RS for this strategy
|
||||
return int(result)
|
||||
else:
|
||||
# Store the mapping.
|
||||
|
@ -109,7 +109,7 @@ class IPXMLSerializer(wsgi.XMLDictSerializer):
|
||||
def __init__(self, xmlns=wsgi.XMLNS_V11):
|
||||
super(IPXMLSerializer, self).__init__(xmlns=xmlns)
|
||||
|
||||
def populate_addresses_node(self, addresses_elem, addresses_dict):
|
||||
def populate_addresses_node(self, addresses_elem, addresses_dict):
|
||||
for (network_id, ip_dicts) in addresses_dict.items():
|
||||
network_elem = self._create_network_node(network_id, ip_dicts)
|
||||
addresses_elem.append(network_elem)
|
||||
@ -143,7 +143,7 @@ def create_resource(version):
|
||||
|
||||
metadata = {
|
||||
'list_collections': {
|
||||
'public': {'item_name': 'ip', 'item_key': 'addr'},
|
||||
'public': {'item_name': 'ip', 'item_key': 'addr'},
|
||||
'private': {'item_name': 'ip', 'item_key': 'addr'},
|
||||
},
|
||||
}
|
||||
|
@ -980,10 +980,10 @@ class ComputeManager(manager.SchedulerDependentManager):
|
||||
{'instance_uuid': instance_ref['uuid'],
|
||||
'source_compute': instance_ref['host'],
|
||||
'dest_compute': FLAGS.host,
|
||||
'dest_host': self.driver.get_host_ip_addr(),
|
||||
'dest_host': self.driver.get_host_ip_addr(),
|
||||
'old_instance_type_id': old_instance_type['id'],
|
||||
'new_instance_type_id': instance_type_id,
|
||||
'status': 'pre-migrating'})
|
||||
'status': 'pre-migrating'})
|
||||
|
||||
LOG.audit(_('instance %s: migrating'), instance_ref['uuid'],
|
||||
context=context)
|
||||
|
@ -52,7 +52,7 @@ export_devices = Table('export_devices', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('shelf_id', Integer()),
|
||||
Column('blade_id', Integer()),
|
||||
Column('volume_id',
|
||||
@ -67,7 +67,7 @@ fixed_ips = Table('fixed_ips', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('address',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -90,7 +90,7 @@ floating_ips = Table('floating_ips', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('address',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -112,7 +112,7 @@ instances = Table('instances', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('internal_id', Integer()),
|
||||
Column('admin_pass',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
@ -184,7 +184,7 @@ key_pairs = Table('key_pairs', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('name',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -205,7 +205,7 @@ networks = Table('networks', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('injected', Boolean(create_constraint=True, name=None)),
|
||||
Column('cidr',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
@ -273,7 +273,7 @@ quotas = Table('quotas', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('project_id',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -290,7 +290,7 @@ security_groups = Table('security_groups', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('name',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -324,7 +324,7 @@ security_group_rules = Table('security_group_rules', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('parent_group_id',
|
||||
Integer(),
|
||||
ForeignKey('security_groups.id')),
|
||||
@ -347,7 +347,7 @@ services = Table('services', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('host',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -357,7 +357,7 @@ services = Table('services', meta,
|
||||
Column('topic',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
Column('report_count', Integer(), nullable=False),
|
||||
Column('report_count', Integer(), nullable=False),
|
||||
Column('disabled', Boolean(create_constraint=True, name=None)),
|
||||
)
|
||||
|
||||
@ -456,7 +456,7 @@ volumes = Table('volumes', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('ec2_id',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
|
@ -25,21 +25,21 @@ meta = MetaData()
|
||||
# Just for the ForeignKey and column creation to succeed, these are not the
|
||||
# actual definitions of instances or services.
|
||||
instances = Table('instances', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
services = Table('services', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
networks = Table('networks', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
volumes = Table('volumes', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ certificates = Table('certificates', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('user_id',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -69,7 +69,7 @@ consoles = Table('consoles', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('instance_name',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -89,7 +89,7 @@ console_pools = Table('console_pools', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('address',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
@ -119,7 +119,7 @@ instance_actions = Table('instance_actions', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('instance_id',
|
||||
Integer(),
|
||||
ForeignKey('instances.id')),
|
||||
@ -137,7 +137,7 @@ iscsi_targets = Table('iscsi_targets', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('target_num', Integer()),
|
||||
Column('host',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
|
@ -20,7 +20,7 @@ from sqlalchemy import Column, Integer, MetaData, String, Table
|
||||
meta = MetaData()
|
||||
|
||||
networks = Table('networks', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ zones = Table('zones', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('api_url',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
|
@ -28,7 +28,7 @@ instances = Table('instances', meta,
|
||||
)
|
||||
|
||||
quotas = Table('quotas', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
|
@ -32,14 +32,14 @@ instance_types = Table('instance_types', meta,
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False),
|
||||
unique=True),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('memory_mb', Integer(), nullable=False),
|
||||
Column('vcpus', Integer(), nullable=False),
|
||||
Column('local_gb', Integer(), nullable=False),
|
||||
Column('flavorid', Integer(), nullable=False, unique=True),
|
||||
Column('swap', Integer(), nullable=False, default=0),
|
||||
Column('rxtx_quota', Integer(), nullable=False, default=0),
|
||||
Column('rxtx_cap', Integer(), nullable=False, default=0))
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('memory_mb', Integer(), nullable=False),
|
||||
Column('vcpus', Integer(), nullable=False),
|
||||
Column('local_gb', Integer(), nullable=False),
|
||||
Column('flavorid', Integer(), nullable=False, unique=True),
|
||||
Column('swap', Integer(), nullable=False, default=0),
|
||||
Column('rxtx_quota', Integer(), nullable=False, default=0),
|
||||
Column('rxtx_cap', Integer(), nullable=False, default=0))
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
@ -24,7 +24,7 @@ meta = MetaData()
|
||||
# Just for the ForeignKey and column creation to succeed, these are not the
|
||||
# actual definitions of instances or services.
|
||||
instances = Table('instances', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
#
|
||||
|
@ -19,7 +19,7 @@ from sqlalchemy import Column, Integer, MetaData, String, Table
|
||||
meta = MetaData()
|
||||
|
||||
instances = Table('instances', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
instances_os_type = Column('os_type',
|
||||
|
@ -23,7 +23,7 @@ from nova import log as logging
|
||||
meta = MetaData()
|
||||
|
||||
instances = Table('instances', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
#
|
||||
@ -35,7 +35,7 @@ compute_nodes = Table('compute_nodes', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('service_id', Integer(), nullable=False),
|
||||
|
||||
Column('vcpus', Integer(), nullable=False),
|
||||
|
@ -23,7 +23,7 @@ meta = MetaData()
|
||||
# actual definitions of instances or services.
|
||||
#
|
||||
instances = Table('instances', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
#
|
||||
@ -34,7 +34,7 @@ networks = Table('networks', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('injected', Boolean(create_constraint=True, name=None)),
|
||||
Column('cidr',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
@ -89,7 +89,7 @@ fixed_ips = Table('fixed_ips', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('address',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
|
@ -32,7 +32,7 @@ c_instance_type_id = Column('instance_type_id',
|
||||
nullable=True)
|
||||
|
||||
instance_types = Table('instance_types', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('name',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False),
|
||||
|
@ -27,7 +27,7 @@ snapshots = Table('snapshots', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('volume_id', Integer(), nullable=False),
|
||||
Column('user_id',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
|
@ -27,11 +27,11 @@ instances = Table('instances', meta,
|
||||
)
|
||||
|
||||
volumes = Table('volumes', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
snapshots = Table('snapshots', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ builds = Table('agent_builds', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('hypervisor',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
|
@ -28,17 +28,17 @@ meta = MetaData()
|
||||
# Just for the ForeignKey and column creation to succeed, these are not the
|
||||
# actual definitions of instances or services.
|
||||
instances = Table('instances', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
services = Table('services', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
networks = Table('networks', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ provider_fw_rules = Table('provider_fw_rules', meta,
|
||||
Column('updated_at', DateTime(timezone=False)),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('protocol',
|
||||
String(length=5, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False)),
|
||||
|
@ -17,7 +17,7 @@ from sqlalchemy import Column, Float, Integer, MetaData, Table
|
||||
meta = MetaData()
|
||||
|
||||
zones = Table('zones', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
weight_offset = Column('weight_offset', Float(), default=0.0)
|
||||
|
@ -31,7 +31,7 @@ virtual_interfaces = Table('virtual_interfaces', meta,
|
||||
onupdate=utils.utcnow()),
|
||||
Column('deleted_at', DateTime(timezone=False)),
|
||||
Column('deleted', Boolean(create_constraint=True, name=None)),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('address',
|
||||
String(length=255, convert_unicode=False, assert_unicode=None,
|
||||
unicode_error=None, _warn_on_bytestring=False),
|
||||
|
@ -27,7 +27,7 @@ meta = MetaData()
|
||||
#
|
||||
|
||||
volumes = Table('volumes', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
volume_type_id = Column('volume_type_id', Integer(), nullable=True)
|
||||
|
@ -17,7 +17,7 @@ from sqlalchemy import Column, Integer, MetaData, String, Table
|
||||
meta = MetaData()
|
||||
|
||||
zones = Table('zones', meta,
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
Column('id', Integer(), primary_key=True, nullable=False),
|
||||
)
|
||||
|
||||
name = Column('name', String(255))
|
||||
|
@ -641,7 +641,8 @@ class FlavorsXMLSerializationTest(test.TestCase):
|
||||
"href": "http://localhost/fake/flavors/23",
|
||||
},
|
||||
],
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"id": "13",
|
||||
"name": "flavor 13",
|
||||
"ram": "256",
|
||||
@ -706,7 +707,8 @@ class FlavorsXMLSerializationTest(test.TestCase):
|
||||
"href": "http://localhost/fake/flavors/23",
|
||||
},
|
||||
],
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"id": "13",
|
||||
"name": "flavor 13",
|
||||
"ram": "256",
|
||||
|
@ -738,7 +738,7 @@ class ServersTest(test.TestCase):
|
||||
self.assertEquals(ip.getAttribute('addr'), '1.2.3.4')
|
||||
(private,) = server.getElementsByTagName('private')
|
||||
(ip,) = private.getElementsByTagName('ip')
|
||||
self.assertEquals(ip.getAttribute('addr'), '192.168.0.3')
|
||||
self.assertEquals(ip.getAttribute('addr'), '192.168.0.3')
|
||||
|
||||
def test_get_server_by_id_with_addresses(self):
|
||||
private = "192.168.0.3"
|
||||
|
@ -72,7 +72,7 @@ class FakeNetworkManager(network_manager.NetworkManager):
|
||||
|
||||
class FakeDB:
|
||||
def fixed_ip_get_by_instance(self, context, instance_id):
|
||||
return [dict(address='10.0.0.0'), dict(address='10.0.0.1'),
|
||||
return [dict(address='10.0.0.0'), dict(address='10.0.0.1'),
|
||||
dict(address='10.0.0.2')]
|
||||
|
||||
def network_get_by_cidr(self, context, cidr):
|
||||
|
@ -1069,7 +1069,7 @@ class ZoneRedirectTest(test.TestCase):
|
||||
self.assertEquals(decorator.get_collection_context_and_id(
|
||||
(None, 10, 20), {}), ("servers", 10, 20))
|
||||
self.assertEquals(decorator.get_collection_context_and_id(
|
||||
(None, 11,), dict(instance_id=21)), ("servers", 11, 21))
|
||||
(None, 11,), dict(instance_id=21)), ("servers", 11, 21))
|
||||
self.assertEquals(decorator.get_collection_context_and_id(
|
||||
(None,), dict(context=12, instance_id=22)), ("servers", 12, 22))
|
||||
|
||||
|
@ -159,14 +159,14 @@ class LibvirtConnTestCase(test.TestCase):
|
||||
self.flags(instances_path='')
|
||||
self.call_libvirt_dependant_setup = False
|
||||
|
||||
test_instance = {'memory_kb': '1024000',
|
||||
'basepath': '/some/path',
|
||||
'bridge_name': 'br100',
|
||||
'vcpus': 2,
|
||||
'project_id': 'fake',
|
||||
'bridge': 'br101',
|
||||
'image_ref': '123456',
|
||||
'local_gb': 20,
|
||||
test_instance = {'memory_kb': '1024000',
|
||||
'basepath': '/some/path',
|
||||
'bridge_name': 'br100',
|
||||
'vcpus': 2,
|
||||
'project_id': 'fake',
|
||||
'bridge': 'br101',
|
||||
'image_ref': '123456',
|
||||
'local_gb': 20,
|
||||
'instance_type_id': '5'} # m1.small
|
||||
|
||||
def lazy_load_library_exists(self):
|
||||
|
10
run_tests.sh
10
run_tests.sh
@ -13,6 +13,7 @@ function usage {
|
||||
echo " -x, --stop Stop running tests after the first error or failure."
|
||||
echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added."
|
||||
echo " -p, --pep8 Just run pep8"
|
||||
echo " -P, --no-pep8 Don't run pep8"
|
||||
echo " -c, --coverage Generate coverage report"
|
||||
echo " -h, --help Print this usage message"
|
||||
echo " --hide-elapsed Don't print the elapsed time for each test along with slow test list"
|
||||
@ -32,6 +33,7 @@ function process_option {
|
||||
-n|--no-recreate-db) recreate_db=0;;
|
||||
-f|--force) force=1;;
|
||||
-p|--pep8) just_pep8=1;;
|
||||
-P|--no-pep8) no_pep8=1;;
|
||||
-c|--coverage) coverage=1;;
|
||||
-*) noseopts="$noseopts $1";;
|
||||
*) noseargs="$noseargs $1"
|
||||
@ -47,6 +49,7 @@ noseargs=
|
||||
noseopts=
|
||||
wrapper=""
|
||||
just_pep8=0
|
||||
no_pep8=0
|
||||
coverage=0
|
||||
recreate_db=1
|
||||
|
||||
@ -87,7 +90,8 @@ function run_pep8 {
|
||||
srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance"
|
||||
# Just run PEP8 in current environment
|
||||
${wrapper} pep8 --repeat --show-pep8 --show-source \
|
||||
--exclude=vcsversion.py ${srcfiles}
|
||||
--ignore=E202 \
|
||||
--exclude=vcsversion.py ${srcfiles}
|
||||
}
|
||||
|
||||
NOSETESTS="python run_tests.py $noseopts $noseargs"
|
||||
@ -139,7 +143,9 @@ run_tests
|
||||
# distinguish between options (noseopts), which begin with a '-', and
|
||||
# arguments (noseargs).
|
||||
if [ -z "$noseargs" ]; then
|
||||
run_pep8
|
||||
if [ $no_pep8 -eq 0 ]; then
|
||||
run_pep8
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $coverage -eq 1 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user