# Path: libcloud/utils.py
# def get_driver(drivers, provider):
#     """
#     Get a driver.
# 
#     @param drivers: Dictionary containing valid providers.
#     @param provider: Id of provider to get driver
#     @type provider: L{libcloud.types.Provider}
#     """
#     if provider in drivers:
#         mod_name, driver_name = drivers[provider]
#         _mod = __import__(mod_name, globals(), locals(), [driver_name])
#         return getattr(_mod, driver_name)
# 
#     raise AttributeError('Provider %s does not exist' % (provider))
# 
# Path: libcloud/compute/types.py
# class Provider(object):
#     """
#     Defines for each of the supported providers
# 
#     @cvar DUMMY: Example provider
#     @cvar EC2_US_EAST: Amazon AWS US N. Virgina
#     @cvar EC2_US_WEST: Amazon AWS US N. California
#     @cvar EC2_EU_WEST: Amazon AWS EU Ireland
#     @cvar RACKSPACE: Rackspace Cloud Servers
#     @cvar RACKSPACE_UK: Rackspace UK Cloud Servers
#     @cvar SLICEHOST: Slicehost.com
#     @cvar GOGRID: GoGrid
#     @cvar VPSNET: VPS.net
#     @cvar LINODE: Linode.com
#     @cvar VCLOUD: vmware vCloud
#     @cvar RIMUHOSTING: RimuHosting.com
#     @cvar ECP: Enomaly
#     @cvar IBM: IBM Developer Cloud
#     @cvar OPENNEBULA: OpenNebula.org
#     @cvar DREAMHOST: DreamHost Private Server
#     @cvar CLOUDSIGMA: CloudSigma
#     """
#     DUMMY = 0
#     EC2 = 1  # deprecated name
#     EC2_US_EAST = 1
#     EC2_EU = 2 # deprecated name
#     EC2_EU_WEST = 2
#     RACKSPACE = 3
#     SLICEHOST = 4
#     GOGRID = 5
#     VPSNET = 6
#     LINODE = 7
#     VCLOUD = 8
#     RIMUHOSTING = 9
#     EC2_US_WEST = 10
#     VOXEL = 11
#     SOFTLAYER = 12
#     EUCALYPTUS = 13
#     ECP = 14
#     IBM = 15
#     OPENNEBULA = 16
#     DREAMHOST = 17
#     ELASTICHOSTS = 18
#     ELASTICHOSTS_UK1 = 19
#     ELASTICHOSTS_UK2 = 20
#     ELASTICHOSTS_US1 = 21
#     EC2_AP_SOUTHEAST = 22
#     RACKSPACE_UK = 23
#     BRIGHTBOX = 24
#     CLOUDSIGMA = 25
#     EC2_AP_NORTHEAST = 26


from libcloud.utils import get_driver as get_provider_driver
from libcloud.compute.types import Provider
        ('libcloud.compute.drivers.gogrid', 'GoGridNodeDriver'),
    Provider.RACKSPACE:
        ('libcloud.compute.drivers.rackspace', 'RackspaceNodeDriver'),
    Provider.RACKSPACE_UK:
        ('libcloud.compute.drivers.rackspace', 'RackspaceUKNodeDriver'),
    Provider.SLICEHOST:
        ('libcloud.compute.drivers.slicehost', 'SlicehostNodeDriver'),
    Provider.VPSNET:
        ('libcloud.compute.drivers.vpsnet', 'VPSNetNodeDriver'),
    Provider.LINODE:
        ('libcloud.compute.drivers.linode', 'LinodeNodeDriver'),
    Provider.RIMUHOSTING:
        ('libcloud.compute.drivers.rimuhosting', 'RimuHostingNodeDriver'),
    Provider.VOXEL:
        ('libcloud.compute.drivers.voxel', 'VoxelNodeDriver'),
    Provider.SOFTLAYER:
        ('libcloud.compute.drivers.softlayer', 'SoftLayerNodeDriver'),
    Provider.EUCALYPTUS:
        ('libcloud.compute.drivers.ec2', 'EucNodeDriver'),
    Provider.IBM:
        ('libcloud.compute.drivers.ibm_sbc', 'IBMNodeDriver'),
    Provider.OPENNEBULA:
        ('libcloud.compute.drivers.opennebula', 'OpenNebulaNodeDriver'),
    Provider.DREAMHOST:
        ('libcloud.compute.drivers.dreamhost', 'DreamhostNodeDriver'),
    Provider.BRIGHTBOX:
        ('libcloud.compute.drivers.brightbox', 'BrightboxNodeDriver'),
}

def get_driver(provider):

# Path: libcloud/utils.py
# def get_driver(drivers, provider):
#     """
#     Get a driver.
# 
#     @param drivers: Dictionary containing valid providers.
#     @param provider: Id of provider to get driver
#     @type provider: L{libcloud.types.Provider}
#     """
#     if provider in drivers:
#         mod_name, driver_name = drivers[provider]
#         _mod = __import__(mod_name, globals(), locals(), [driver_name])
#         return getattr(_mod, driver_name)
# 
#     raise AttributeError('Provider %s does not exist' % (provider))
# 
# Path: libcloud/compute/types.py
# class Provider(object):
#     """
#     Defines for each of the supported providers
# 
#     @cvar DUMMY: Example provider
#     @cvar EC2_US_EAST: Amazon AWS US N. Virgina
#     @cvar EC2_US_WEST: Amazon AWS US N. California
#     @cvar EC2_EU_WEST: Amazon AWS EU Ireland
#     @cvar RACKSPACE: Rackspace Cloud Servers
#     @cvar RACKSPACE_UK: Rackspace UK Cloud Servers
#     @cvar SLICEHOST: Slicehost.com
#     @cvar GOGRID: GoGrid
#     @cvar VPSNET: VPS.net
#     @cvar LINODE: Linode.com
#     @cvar VCLOUD: vmware vCloud
#     @cvar RIMUHOSTING: RimuHosting.com
#     @cvar ECP: Enomaly
#     @cvar IBM: IBM Developer Cloud
#     @cvar OPENNEBULA: OpenNebula.org
#     @cvar DREAMHOST: DreamHost Private Server
#     @cvar CLOUDSIGMA: CloudSigma
#     """
#     DUMMY = 0
#     EC2 = 1  # deprecated name
#     EC2_US_EAST = 1
#     EC2_EU = 2 # deprecated name
#     EC2_EU_WEST = 2
#     RACKSPACE = 3
#     SLICEHOST = 4
#     GOGRID = 5
#     VPSNET = 6
#     LINODE = 7
#     VCLOUD = 8
#     RIMUHOSTING = 9
#     EC2_US_WEST = 10
#     VOXEL = 11
#     SOFTLAYER = 12
#     EUCALYPTUS = 13
#     ECP = 14
#     IBM = 15
#     OPENNEBULA = 16
#     DREAMHOST = 17
#     ELASTICHOSTS = 18
#     ELASTICHOSTS_UK1 = 19
#     ELASTICHOSTS_UK2 = 20
#     ELASTICHOSTS_US1 = 21
#     EC2_AP_SOUTHEAST = 22
#     RACKSPACE_UK = 23
#     BRIGHTBOX = 24
#     CLOUDSIGMA = 25
#     EC2_AP_NORTHEAST = 26


# Path: libcloud/compute/providers.py
from libcloud.utils import get_driver as get_provider_driver
from libcloud.compute.types import Provider

        ('libcloud.compute.drivers.gogrid', 'GoGridNodeDriver'),
    Provider.RACKSPACE:
        ('libcloud.compute.drivers.rackspace', 'RackspaceNodeDriver'),
    Provider.RACKSPACE_UK:
        ('libcloud.compute.drivers.rackspace', 'RackspaceUKNodeDriver'),
    Provider.SLICEHOST:
        ('libcloud.compute.drivers.slicehost', 'SlicehostNodeDriver'),
    Provider.VPSNET:
        ('libcloud.compute.drivers.vpsnet', 'VPSNetNodeDriver'),
    Provider.LINODE:
        ('libcloud.compute.drivers.linode', 'LinodeNodeDriver'),
    Provider.RIMUHOSTING:
        ('libcloud.compute.drivers.rimuhosting', 'RimuHostingNodeDriver'),
    Provider.VOXEL:
        ('libcloud.compute.drivers.voxel', 'VoxelNodeDriver'),
    Provider.SOFTLAYER:
        ('libcloud.compute.drivers.softlayer', 'SoftLayerNodeDriver'),
    Provider.EUCALYPTUS:
        ('libcloud.compute.drivers.ec2', 'EucNodeDriver'),
    Provider.IBM:
        ('libcloud.compute.drivers.ibm_sbc', 'IBMNodeDriver'),
    Provider.OPENNEBULA:
        ('libcloud.compute.drivers.opennebula', 'OpenNebulaNodeDriver'),
    Provider.DREAMHOST:
        ('libcloud.compute.drivers.dreamhost', 'DreamhostNodeDriver'),
    Provider.BRIGHTBOX:
        ('libcloud.compute.drivers.brightbox', 'BrightboxNodeDriver'),
}

def get_driver(provider):

    return get_provider_driver(DRIVERS, provider)