diff options
author | John Reese <johnr@ea2d.com> | 2012-03-23 14:06:48 -0700 |
---|---|---|
committer | Mitch Garnaat <mitch@garnaat.com> | 2012-03-27 10:23:41 -0700 |
commit | 5789491b87e6f7570d87527e6200cf317659827a (patch) | |
tree | 2222b2e99e78b2b21fada23a3662a8e16a40b405 | |
parent | 4781e7023a24837929cbb8222d542641056b27f8 (diff) | |
download | boto-5789491b87e6f7570d87527e6200cf317659827a.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': |