Merge "use deleted=False instead of deleted=0 in queries"

This commit is contained in:
Jenkins 2012-11-19 17:36:23 +00:00 committed by Gerrit Code Review
commit 2c1c54d5fe
2 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ class ImagesWhiteboxTest(whitebox.ComputeWhiteboxTest, base.BaseComputeTest):
cls.image_ids.remove(image_id)
@classmethod
def update_state(self, server_id, vm_state, task_state, deleted=0):
def update_state(self, server_id, vm_state, task_state, deleted=False):
"""Update states of an instance in database for validation"""
if not task_state:
task_state = "NULL"
@ -63,7 +63,7 @@ class ImagesWhiteboxTest(whitebox.ComputeWhiteboxTest, base.BaseComputeTest):
self.connection.execute(stmt, autocommit=True)
def _test_create_image_409_base(self, vm_state, task_state, deleted=0):
def _test_create_image_409_base(self, vm_state, task_state, deleted=False):
"""Base method for create image tests based on vm and task states"""
try:
self.update_state(self.shared_server['id'], vm_state,

View File

@ -63,7 +63,7 @@ class ServersWhiteboxTest(whitebox.ComputeWhiteboxTest):
# Set vcpu quota for tenant if not already set
if not result:
cores_hard_limit = 2
stmt = quotas.insert().values(deleted=0,
stmt = quotas.insert().values(deleted=False,
project_id=self.tenant_id,
resource='cores',
hard_limit=cores_hard_limit)
@ -95,7 +95,7 @@ class ServersWhiteboxTest(whitebox.ComputeWhiteboxTest):
# Set memory quota for tenant if not already set
if not result:
ram_hard_limit = 1024
stmt = quotas.insert().values(deleted=0,
stmt = quotas.insert().values(deleted=False,
project_id=self.tenant_id,
resource='ram',
hard_limit=ram_hard_limit)
@ -116,7 +116,7 @@ class ServersWhiteboxTest(whitebox.ComputeWhiteboxTest):
stmt = quotas.delete()
self.connection.execute(stmt, autocommit=True)
def update_state(self, server_id, vm_state, task_state, deleted=0):
def update_state(self, server_id, vm_state, task_state, deleted=False):
"""Update states of an instance in database for validation"""
if not task_state:
task_state = 'NULL'