Permalink
Browse files

Makes more sense ;)

  • Loading branch information...
1 parent 7857c3f commit fb3e1b1fdbf734315dc32557c8430a370c33b8d2 @mfontani committed Nov 18, 2009
Showing with 4 additions and 7 deletions.
  1. +4 −7 lib/Net/RackSpace/CloudServers.pm
@@ -152,10 +152,7 @@ sub get_server {
);
my $response = $self->_request($request);
return if $response->code == 204;
- confess 'Unknown error' . $response->code
- if (
- !$response->code ~~ ( 200, 203 ) # cached is 203 OK
- );
+ confess 'Unknown error' . $response->code unless ( $response->code ~~ [ 200, 203 ] );
my @servers;
my $hash_response = from_json( $response->content );
warn Dump($hash_response) if $DEBUG;
@@ -221,7 +218,7 @@ sub limits {
);
my $response = $self->_request($request);
return if $response->code == 204;
- confess 'Unknown error ' . $response->code if ( !$response->code ~~ ( 200, 203 ) );
+ confess 'Unknown error ' . $response->code unless ( $response->code ~~ [ 200, 203 ] );
my $hash_response = from_json( $response->content );
warn Dump($hash_response) if $DEBUG;
@@ -252,7 +249,7 @@ sub get_flavor {
);
my $response = $self->_request($request);
return if $response->code == 204;
- confess 'Unknown error ' . $response->code if ( !$response->code ~~ ( 200, 203 ) );
+ confess 'Unknown error ' . $response->code unless ( $response->code ~~ [ 200, 203 ] );
my $hash_response = from_json( $response->content );
warn Dump($hash_response) if $DEBUG;
@@ -305,7 +302,7 @@ sub get_image {
);
my $response = $self->_request($request);
return if $response->code == 204;
- confess 'Unknown error ' . $response->code if ( !$response->code ~~ ( 200, 203 ) );
+ confess 'Unknown error ' . $response->code unless ( $response->code ~~ [ 200, 203 ] );
my $hash_response = from_json( $response->content );
warn Dump($hash_response) if $DEBUG;

0 comments on commit fb3e1b1

Please sign in to comment.