diff options
author | John Reese <johnr@ea2d.com> | 2012-03-23 14:06:48 -0700 |
---|---|---|
committer | John Reese <johnr@ea2d.com> | 2012-03-23 14:06:49 -0700 |
commit | 3d0ae77d842b2787a3e178804af6deb2d21c5636 (patch) | |
tree | d8de50ba3d2ac9056fe1a94579da7e638f71ac7f | |
parent | d21fc68da99c7aecfd7b13d16e50bb1ba540c5ea (diff) | |
download | boto-3d0ae77d842b2787a3e178804af6deb2d21c5636.tar.gz |
Fall back to plain text launch config user data
In cases where launch configurations aren't returned as base64-encoded
strings, Boto would raise an exception when b64decode() fails. This
patch catches that exception, and falls back to loading the user data
string as plain text.
-rw-r--r-- | boto/ec2/autoscale/launchconfig.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/boto/ec2/autoscale/launchconfig.py b/boto/ec2/autoscale/launchconfig.py index 8811fb6b..526f4686 100644 --- a/boto/ec2/autoscale/launchconfig.py +++ b/boto/ec2/autoscale/launchconfig.py @@ -173,7 +173,10 @@ class LaunchConfiguration(object): elif name == 'RamdiskId': self.ramdisk_id = value elif name == 'UserData': - self.user_data = base64.b64decode(value) + try: + self.user_data = base64.b64decode(value) + except TypeError: + self.user_data = value elif name == 'LaunchConfigurationARN': self.launch_configuration_arn = value elif name == 'InstanceMonitoring': |