Permalink
Browse files

Merge pull request #1240 from DataDog/fix_alarm_timestamp

Support timestamps without microseconds in Cloudwatch alarms.
  • Loading branch information...
2 parents c1a8026 + 7912bfa commit 8702c8030073d1483a8576b8b994b5dc3e822eab @garnaat garnaat committed Jan 31, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 boto/ec2/cloudwatch/alarm.py
@@ -308,5 +308,9 @@ def endElement(self, name, value, connection):
elif name == 'HistorySummary':
self.summary = value
elif name == 'Timestamp':
- self.timestamp = datetime.strptime(value, '%Y-%m-%dT%H:%M:%S.%fZ')
+ try:
+ self.timestamp = datetime.strptime(value,
+ '%Y-%m-%dT%H:%M:%S.%fZ')
+ except ValueError:
+ self.timestamp = datetime.strptime(value, '%Y-%m-%dT%H:%M:%SZ')

0 comments on commit 8702c80

Please sign in to comment.