TODO check out CloudFiles to provision
[p5sagit/Oyster.git] / lib / Oyster / Provision / Rackspace.pm
index ed14944..fdfb7ab 100644 (file)
@@ -4,10 +4,14 @@ use Net::RackSpace::CloudServers;
 use Net::RackSpace::CloudServers::Server;
 use MIME::Base64;
 
+# TODO http://failverse.com/manually-creating-a-cloud-server-from-a-cloud-files-image/
+# in order to use an already created image to build the server, a la EC2 way
+
 requires 'config';
 
 has 'api_username' => ( is => 'ro', isa => 'Str', required => 1, lazy_build => 1);
 sub _build_api_username {
+    my $self = shift;
     return $ENV{CLOUDSERVERS_USER} if exists $ENV{CLOUDSERVERS_USER};
     return $self->config->{api_username}
         or die "Need api_username or CLOUDSERVERS_USER in environment";
@@ -15,6 +19,7 @@ sub _build_api_username {
 
 has 'api_password' => ( is => 'ro', isa => 'Str', required => 1, lazy_build => 1);
 sub _build_api_password {
+    my $self = shift;
     return $ENV{CLOUDSERVERS_KEY} if exists $ENV{CLOUDSERVERS_KEY};
     return $self->config->{api_password}
         or die "Need api_password or CLOUDSERVERS_KEY in environment";