Semicolon was missing, now found
[p5sagit/Oyster.git] / lib / Oyster / Provision / Rackspace.pm
index 9abae87..66d9ade 100644 (file)
@@ -8,29 +8,33 @@ use MIME::Base64;
 requires 'config';
 
 has 'api_username' => ( is => 'ro', isa => 'Str', required => 1, default => sub {
-    return $ENV{RACKSPACE_USER} if exists $ENV{RACKSPACE_USER};
-    confess "Need api_username or RACKSPACE_USER in environment";
+    return $ENV{CLOUDSERVERS_USER} if exists $ENV{CLOUDSERVERS_USER};
+    confess "Need api_username or CLOUDSERVERS_USER in environment";
 });
-has 'api_key' => ( is => 'ro', isa => 'Str', required => 1, default => sub {
-    return $ENV{RACKSPACE_KEY} if exists $ENV{RACKSPACE_KEY};
-    confess "Need api_key or RACKSPACE_KEY in environment";
+
+has 'api_password' => ( is => 'ro', isa => 'Str', required => 1, default => sub {
+    return $ENV{CLOUDSERVERS_KEY} if exists $ENV{CLOUDSERVERS_KEY};
+    confess "Need api_password or CLOUDSERVERS_KEY in environment";
 });
 
-has '_rs' => ( is => 'rw', isa => 'Net::RackSpace::CloudServers', lazy_build => 1, default => sub {
+has '_rs' => ( is => 'rw', isa => 'Net::RackSpace::CloudServers', default => sub {
     my $self = shift;
     my $rs = Net::RackSpace::CloudServers->new(
         user => $self->api_username,
-        key  => $self->api_key,
+        key  => $self->api_password,
     );
     $rs;
 });
 
-sub BUILD {
+after BUILD => sub {
     my $self = shift;
     # get api username and key from config?
     my $config = $self->config;
+    
+
+    
     # ...
-}
+};
 
 sub create {
    my $self = shift;
@@ -111,7 +115,9 @@ The following are required to instantiate a backend:
 The rackspace API username, or C<$ENV{RACKSPACE_USER}> will be used if that is
 not given
 
-=item api_key
+=item password
+
+This is your rackspace API Key
 
 The rackspace API key, or C<$ENV{RACKSPACE_KEY}> will be used if that is not
 given