Removed unneeded files

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Create base class for handling cloud providers

Defined in providers module in base.py, this class provides
general interface for handling multiple cloud providers.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Added ec2 provider class

Refactored previous ec2 implementation to create a new EC2 class
derieved from BaseProvider.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Added provider option in cloud configuration file

The provider option will signify the provider to use. Multiple
clouds can have one provider, e.g. AWS, Eucalyptus etc.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Added methods to dynamically import/init provider

Declared two functions in providers/__init__.py
* get_cloud_provider() loads the concerned provider's class
dynamically.
* initiate_cloud() initializes the provider class instance.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Updated baseprovider class with four more methods

Removed release_public_ips() and added 4 new methods
* terminate_instances()
* release_public_ip()
* delete_keypair()
* delete_security_groups()

The __init__() method of BaseProvider class creates the cloud
entities - keypair name, SG name etc. using job's name instead of
an ec2_entities() as before.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Added 4 new functions to ec2 module

Added the following functions:
* terminate_instances()
* release_public_ip()
* delete_keypair()
* delete_security_groups()

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
cluster.create/delete() use abstracted provider

Updated create() and delete() in cluster.py to support the new
provider abstraction.

The cloud instance object is retrieved from current_app.cloud.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Assigning and removing EIP before/after conf_slave

Instead of assigning public IPs to slave instances, its assigned
right before calling configure_slave and disassociated once its
done.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Updated get_node_object to use prov. abstraction

get_node_objects() now uses cloud conn object from app context

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
plugin cloud provider support added for scaling

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
security groups deletion improved

Due to some unexplainable dependency error while deleting idle security
groups, the current ec2.delete_security_groups() implementation tries the
deletion in loop and keeps on removing the deleted security group from
the list.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Releasing Elastic IPs at the beginning of delete

Moved snippet of releasing elastic IPs to the beginning of
cluster.delete()

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Pulled Merge from shredder12

Signed-off-by: Shashank Sahni <shredder12@gmail.com>