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:
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)
A bit more data... urlsafe_ b64encode( user_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.
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: urlsafe_ b64encode( user_data) connection( ) run_instances( image_id = image_id,
| user_data = base64.
| euca_conn = euca.make_
| try:
| reservation = euca_conn.
| 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: b64encode( user_data)
| if user_data:
| params['UserData'] = base64.
So, the user data is getting encoded twice.