From f76820a1eb4ace7bfdcf760009e399363fa24a11 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 16 Jun 2011 12:20:05 +0000 Subject: [PATCH] * Apply a patch to Net::Amazon::EC2 to get the describe_instances function to work with Nova. svn path=/nixpkgs/trunk/; revision=27480 --- .../perl-modules/net-amazon-ec2-nova-compat.patch | 12 ++++++++++++ pkgs/top-level/perl-packages.nix | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/perl-modules/net-amazon-ec2-nova-compat.patch diff --git a/pkgs/development/perl-modules/net-amazon-ec2-nova-compat.patch b/pkgs/development/perl-modules/net-amazon-ec2-nova-compat.patch new file mode 100644 index 000000000000..c08b3579fc3b --- /dev/null +++ b/pkgs/development/perl-modules/net-amazon-ec2-nova-compat.patch @@ -0,0 +1,12 @@ +diff -ru -x '*~' Net-Amazon-EC2-0.14-orig/lib/Net/Amazon/EC2.pm Net-Amazon-EC2-0.14/lib/Net/Amazon/EC2.pm +--- Net-Amazon-EC2-0.14-orig/lib/Net/Amazon/EC2.pm 2010-02-02 02:26:58.000000000 +0100 ++++ Net-Amazon-EC2-0.14/lib/Net/Amazon/EC2.pm 2011-06-16 14:18:19.874176129 +0200 +@@ -1552,6 +1552,8 @@ + $args{"InstanceId." . $count} = $instance_id; + $count++; + } ++ } else { ++ $args{"InstanceId.1"} = delete $args{InstanceId}; + } + + my $xml = $self->_sign(Action => 'DescribeInstances', %args); diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index e801f6ef8b6b..25a3c121b449 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -1974,6 +1974,12 @@ rec { url = "mirror://cpan/authors/id/J/JK/JKIM/${name}.tar.gz"; sha256 = "14am9m19ziyv12bjxljhfyl0zy120yf4gligsa9v26smb61fxyjr"; }; + patches = + [ # In DescribeInstance requests, say "InstanceId.1" instead of + # "InstanceId", as required by the Amazon spec. EC2 tolerates + # "InstanceId", but Nova doesn't. + ../development/perl-modules/net-amazon-ec2-nova-compat.patch + ]; propagatedBuildInputs = [ DigestHMAC LWP Moose URI ParamsValidate XMLSimple Moose CryptSSLeay ]; doCheck = false; # wants to create actual EC2 instances (for $$$)