patch
1 |
------------------------------------------------------------ |
---|---|
2 |
revno: 82 |
3 |
committer: Soren Hansen <soren@canonical.com> |
4 |
branch nick: one-1.2.hostspecificec2 |
5 |
timestamp: Fri 2009-02-13 11:53:46 +0100 |
6 |
message: |
7 |
Optionally look for an EC2:<hostname> attribute in the EC2 driver. |
8 |
|
9 |
This should make it possible to specify different AMI's depending on |
10 |
whether you're deploying to Amazon's EC2 or a local Eucalyptus cloud. |
11 |
=== modified file 'src/vmm/EC2Driver.cc' |
12 |
--- src/vmm/EC2Driver.cc 2009-01-22 16:37:36 +0000 |
13 |
+++ src/vmm/EC2Driver.cc 2009-02-13 10:53:46 +0000 |
14 |
@@ -33,6 +33,7 @@ |
15 |
string elasticip = ""; |
16 |
string a_ports = ""; |
17 |
string itype = ""; |
18 |
+ string attrname = ""; |
19 |
|
20 |
// ------------------------------------------------------------------------- |
21 |
|
22 |
@@ -45,9 +46,14 @@ |
23 |
|
24 |
// ------------------------------------------------------------------------- |
25 |
|
26 |
- if ( vm->get_template_attribute("EC2",attrs) == 0 ) |
27 |
+ attrname = "EC2:" + vm->get_hostname(); |
28 |
+ |
29 |
+ if ( vm->get_template_attribute(attrname,attrs) == 0 ) |
30 |
{ |
31 |
- goto error_ec2; |
32 |
+ if ( vm->get_template_attribute("EC2",attrs) == 0 ) |
33 |
+ { |
34 |
+ goto error_ec2; |
35 |
+ } |
36 |
} |
37 |
|
38 |
ec2 = static_cast<const VectorAttribute *>(attrs[0]); |
39 |
|