A  bit more data...
I'm fairly sure that the correct thing to do here is just to remove the 
following two lines from main() in euca-run-instances:
|        if user_data:
|            user_data = base64.urlsafe_b64encode(user_data)

Also 'import base64'  on line 37 could then be removed as this is the
only place base64 is used.

The reason we dont need this encoding is that boto is doing it for us.

In euca-run-instances, the following are the lines that matter:

| if user_data:
|     user_data = base64.urlsafe_b64encode(user_data)
| euca_conn = euca.make_connection()
| try:                    
|     reservation = euca_conn.run_instances(image_id = image_id,
|                                       min_count = min_count,
|                                       max_count = max_count,
|                                       key_name = keyname,
|                                       security_groups = group_names,
|                                       user_data = user_data,
...

euca.make_connection in euca2ools/euca2ools/__init__.py returns a connection 
that is created with:
   return boto.connect_ec2()

Then, we call euca_conn.run_instances.  run_instances in boto/ec2/connection.py 
does:
|  if user_data:
|     params['UserData'] = base64.b64encode(user_data)


So, the user data is getting encoded twice.


** Also affects: euca2ools (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: euca2ools (Ubuntu Karmic)
       Status: New => Triaged

** Changed in: euca2ools (Ubuntu Karmic)
   Importance: Undecided => High

** Changed in: eucalyptus (Ubuntu Karmic)
       Status: Triaged => Invalid

-- 
User data is not base64 decoded before being presented to the instance
https://bugs.launchpad.net/bugs/461156
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to eucalyptus in ubuntu.

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to