cleanup: removed old files

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Fixed few bugs in chef-install-script

* Running chef-server-ctl using sudo
* Running knife configure and knife user create commands using
  "sudo -E" to preserver HOME and USER env variables.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Disabled Chef WebUI and setup hostname

* The web UI has default credentials. Since, it will be accessible
  publicly, disabled it in the script.
* Added hostname setup and resolution.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Added docstrings in ec2.py

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Updated conf.sample files with user/chef info

* 'user' option identifies the default username to be used with the
image.
* 'chef_server_ip' and 'chef_server_hostname' is to identify the
chef-server.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Added function to setup chef hostname resolution

* Added setup_chefserver_hostanme() in configure.py to enable
  hostname resolution in all instances. It adds a static entry in
  /etc/hosts.
* Updated cluster.create and scheduler.schedule() to pass required
  parameters for the same.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Fixed cloud conf identification part in config.py

This function splits the filename and checks whether the extension is
'conf'. Updated the extension fetching function to check the last
element by spliting the filename instead of the second.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Fixed call to configure_slave from add_nodes

Updated the number of arguments to be passed to configure_cluster
from cluster.add_nodes().

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Using instane.update() in ec2.boot_instances()

Instead of fetching the complete list of reservations, using
instance.update() to update the instance object.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Associating IP with every instance

Updated ec2.boot_instances() to associate public_ip with every
instance.

Removed call to associate_public_ip() from cluster.spawn().

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Using EIP to bootstrap instead of private

Saving 'ip_address' attribute in node object.

Updated configure.py to use node['ip_address], elastic IP,
instead of node['private_ip_address'].

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
changed instance attribute to state from status

No 'status' attribute in Instance object. Changed it to 'state'.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
IP disass. added to ec2.release_public_ips

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Rewrote cluster.delete()

Now, delete instances immediately. Due to some difference between
openstack and AWS EC2 response, I used security groups to identify
an instance state and delete keypairs if they are only associated
with terminated instances(in case of AWS) or with no one(openstack).

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
applied filter to ec2.release_public_ips()

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Updated release_public_ips and boot_instances

Comparing addr.instance_id with null string to verify available
address.

Added 4 second timeout in boot_instances() while checking for
instance status.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Updated security group removal in cluster.delete()

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Removed addr disassoc from release_public_ips

Instance object doesn't survive in openstack unlike EC2, hence
disassociate fails.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Error handling and update response in job.info()

Added error handling in job_info and updated its return type to a
list - Bool, response.

Updated job.delete() and v1.info() to call job.info() correctly.

Signed-off-by: Shashank Sahni <shredder12@gmail.com>
Error handling in cluster.delete()

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