def _metric_alarm_to_dict(alarm):
 d = odict.OrderedDict()
 fields = ['name', 'metric', 'namespace', 'statistic', 'comparison', 'threshold', 'period', 'evaluation_periods', 'unit', 'description', 'dimensions', 'alarm_actions', 'insufficient_data_actions', 'ok_actions']
 for f in fields:
  if hasattr(alarm, f):
   d[f] = getattr(alarm, f)
 return d

def _metric_alarm_to_dict ( alarm ) : d = odict . OrderedDict ( ) fields = [ 'name' , 'metric' , 'namespace' , 'statistic' , 'comparison' , 'threshold' , 'period' , 'evaluation_periods' , 'unit' , 'description' , 'dimensions' , 'alarm_actions' , 'insufficient_data_actions' , 'ok_actions' ] for f in fields : if hasattr ( alarm , f ) : d [ f ] = getattr ( alarm , f ) return d
convert a boto .