Skip to content

Commit

Permalink
[AWS] remove comment blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Horvath committed Jan 8, 2015
1 parent 3d3cd37 commit 17ffe5b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 112 deletions.
10 changes: 5 additions & 5 deletions lib/component/AWS/AwsInstanceType.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ Class method for getting all type names.
=cut

sub getAllNames {
my $dbh = Kanopya::Database::dbh;
my ($class) = @_;

my @names = ();
my $results = $dbh->selectall_arrayref('SELECT name FROM aws_instance_type');
foreach my $data (@$results) {
push @names, $data->[0];
my @names;
foreach my $type ($class->search(hash => undef)) {
push @names, $type->name;
}

return \@names;
}

Expand Down
87 changes: 0 additions & 87 deletions lib/external/AWS/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -274,91 +274,4 @@ sub findErrors {
}


#
#
#
#my $api_version = {
# network => 'v2.0',
# image => 'v2.0',
# metering => 'v2',
#};
#
#sub _login {
# my ($self, %args) = @_;
#
# General::checkParams(args => \%args, required => [ 'credentials' ]);
#
# my $response = $self->identity->tokens->post(content => $args{credentials});
#
# $log->debug('Service Catalog ' . Dumper($response->{access}->{serviceCatalog}));
#
# if( ! exists $response->{access}->{serviceCatalog} ||
# ! keys %{$response->{access}->{serviceCatalog}} ) {
# throw Kanopya::Exception::Execution::API(
# error => 'Openstack API call returns no service catalog'
# )
# }
#
# for my $service (@{$response->{access}->{serviceCatalog}}) {
# my $name = $service->{type};
#
# $self->{config}->{$name}->{url} = $service->{endpoints}->[0]->{publicURL};
#
# if (! ($self->{config}->{$name}->{url} =~ /^http:\/\/.*\/v\d(\.\d)?(\/.*)?$/)) {
# $self->{config}->{$name}->{url} .= ((defined $api_version->{$name}) ? '/' . $api_version->{$name}
# : '/v1');
# }
#
# $self->{config}->{$name}->{adminURL} = $service->{endpoints}->[0]->{adminURL};
#
# $log->debug('Openstack::API login. Service name ' . $name . ' URL returned : '. $self->{config}->{$name}->{url});
# }
#
# $self->{token} = $response->{access}->{token}->{id};
# $self->{tenant} = $response->{access}->{token}->{tenant}->{id};
#
# # TODO process token expiration date (2013-01-25T16:21:38Z) => date_format()
# $self->{token_expiration} = $response->{access}->{token}->{expires};
#}
#
#sub logout {
#}
#
#sub AUTOLOAD {
# my ($self, %args) = @_;
#
# my @autoload = split(/::/, $AUTOLOAD);
# my $service = $autoload[-1];
#
# return OpenStack::Service->new(name => $service,
# api => $self);
#}
#
#sub DESTROY {
#}
#
#sub faults {
# my ($self, %args) = @_;
# return ('badRequest', 'itemNotFound', 'unauthorized', 'forbidden',
# 'badMethod', 'overLimit', 'badMediaType', 'unprocessableEntity',
# 'instanceFault', 'notImplemented');
#}
#
#
#sub handleOutput {
# my ($self, %args) = @_;
# # sometime api call return nothing (e.g. delete)
# if (! defined $args{output}) {
# return;
# }
#
# for my $f (OpenStack::API->faults) {
# if (defined $args{output}->{$f}) {
# die($args{output}->{$f}->{message});
# }
# }
#
# return $args{output};
#}

1;
19 changes: 0 additions & 19 deletions lib/external/AWS/EC2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -336,28 +336,9 @@ sub terminateInstance {
sub getInfrastructure {
my ($self) = @_;

# my $hypervisors = OpenStack::Hypervisor->detailList(%args);
# for my $hypervisor (@$hypervisors) {
# my $vms = OpenStack::Hypervisor->servers(%args, id => $hypervisor->{id});
# my @vm_details = ();
# for my $vm (@$vms) {
# my $detail = OpenStack::Server->detail(%args, id => $vm->{uuid}, flavor_detail => 1);
# push @vm_details, $detail->{server};
# }
# $hypervisor->{servers} = \@vm_details;
# }

return {
# 'hypervisors' => $hypervisors,
'images' => $self->getImages,
'instances' => $self->getInstances
# 'volumes' => OpenStack::Volume->list(%args, all_tenants => 1),
# 'volume_types' => OpenStack::VolumeType->list(%args),
# 'tenants' => OpenStack::Tenant->list(%args, all_tenants => 1),
# 'flavors' => OpenStack::Flavor->list(%args),
# 'networks' => OpenStack::Network->list(%args),
# 'availability_zones' => OpenStack::Zone->list(%args),
# 'subnets' => OpenStack::Subnet->list(%args),
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/service/EEntity/EOperation/EAddCluster.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ sub execute {
service_manager_id => $self->{context}->{service_manager}->id,
%{ $self->{params}->{cluster_params} }
);

# Execute create on the cluster
$self->{context}->{cluster} = EEntity->new(data => $cluster);
$self->{context}->{cluster}->create(managers => $self->{params}->{managers},
Expand Down

0 comments on commit 17ffe5b

Please sign in to comment.