Permalink
Browse files

Merge branch 'master' of p5sagit@git.shadowcat.co.uk:Oyster

  • Loading branch information...
2 parents 5ce3db7 + 6895749 commit ee7e66837fd3d662509cc214021efea9bc74d0c6 Paul Tipper committed Nov 20, 2010
Showing with 9 additions and 18 deletions.
  1. +2 −1 lib/Dist/Zilla/App/Command/provision.pm
  2. +7 −17 lib/Oyster/Provision/Rackspace.pm
@@ -35,14 +35,15 @@ sub execute {
my %hash = @hashes > 1 ? %{ merge( @hashes ) } : $hashes[0];
- $hash{provision_backend} = delete $hash{type} || 'Rackspace';
+ $hash{provision_backend} = delete $hash{type} || 'Oyster::Provision::Rackspace';
$hash{pub_ssh} ||= "$ENV{HOME}/.ssh/id_rsa.pub";
$hash{size} ||= 1; # id 1 - ram 256 MiB - disk 10 GiB
$hash{image} ||= 69; # id 69 - Ubuntu 10.10 (meerkat)
use Oyster::Provision;
my $server = Oyster::Provision->new(
name => $name,
+ config => \%hash,
%hash,
);
$server->create;
@@ -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;

0 comments on commit ee7e668

Please sign in to comment.