~soren/nova/get-console-log-fixes

« back to all changes in this revision

Viewing changes to nova/db/api.py

  • Committer: Tarmac
  • Author(s): Vishvananda Ishaya
  • Date: 2010-10-14 08:38:37 UTC
  • mfrom: (276.8.19 concurrency)
  • Revision ID: hudson@openstack.org-20101014083837-tegvi69q8ytdks34
Fixes a few concurrency issues with creating volumes and instances. Most importantly it adds retries to a number of the volume shell commands and it adds a unique constraint on export_devices and a safe create so that there aren't multiple copies of export devices in the database.

Show diffs side-by-side

added added

removed removed

Lines of Context:
466
466
    return IMPL.export_device_count(context)
467
467
 
468
468
 
469
 
def export_device_create(context, values):
470
 
    """Create an export_device from the values dictionary."""
471
 
    return IMPL.export_device_create(context, values)
 
469
def export_device_create_safe(context, values):
 
470
    """Create an export_device from the values dictionary.
 
471
 
 
472
    The device is not returned. If the create violates the unique
 
473
    constraints because the shelf_id and blade_id already exist,
 
474
    no exception is raised."""
 
475
    return IMPL.export_device_create_safe(context, values)
472
476
 
473
477
 
474
478
###################
475
479
 
 
480
 
476
481
def auth_destroy_token(context, token):
477
482
    """Destroy an auth token"""
478
483
    return IMPL.auth_destroy_token(context, token)