X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FOyster%2FProvision%2FRackspace.pm;h=6929a9a279016de4691e9c1afd3a5be08485252e;hb=6895749d358fc3388e5b52208725f5d0d6e35af6;hp=fff8bcdd3d8a5464119b7e2d114531c143c74bb0;hpb=189564ce3d11c6702de3f0ec72a30ad852186cd4;p=p5sagit%2FOyster.git diff --git a/lib/Oyster/Provision/Rackspace.pm b/lib/Oyster/Provision/Rackspace.pm index fff8bcd..6929a9a 100644 --- a/lib/Oyster/Provision/Rackspace.pm +++ b/lib/Oyster/Provision/Rackspace.pm @@ -11,7 +11,7 @@ has 'api_username' => ( is => 'ro', isa => 'Str', required => 1, lazy_build => 1 sub _build_api_username { return $ENV{CLOUDSERVERS_USER} if exists $ENV{CLOUDSERVERS_USER}; confess "Need api_username or CLOUDSERVERS_USER in environment"; -}); +} has 'api_password' => ( is => 'ro', isa => 'Str', required => 1, lazy_build => 1); sub _build_api_password { @@ -28,16 +28,6 @@ has '_rs' => ( is => 'rw', isa => 'Net::RackSpace::CloudServers', default => sub $rs; }); -after BUILD => sub { - my $self = shift; - # get api username and key from config? - my $config = $self->config; - - - - # ... -}; - sub create { my $self = shift; @@ -57,16 +47,16 @@ sub create { # Build the server my $server = Net::RackSpace::CloudServers::Server->new( - cloudservers => $self->_cs, - name => $self->name, - flavor => $self->size, - image => $self->image, - personality => [ + cloudservers => $self->_rs, + name => $self->name, + flavorid => $self->size, + imageid => $self->image, + personality => [ { path => $self->pub_ssh, contents => encode_base64($pub_ssh), }, - ], + ], ); $server->create_server;