~ubuntu-branches/ubuntu/utopic/ceilometer/utopic-proposed

« back to all changes in this revision

Viewing changes to ceilometer/storage/sqlalchemy/migrate_repo/versions/016_simpler_alarm.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2014-10-16 14:07:11 UTC
  • mfrom: (1.2.1) (28.1.5 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20141016140711-95mki6bdkivvfr2x
Tags: 2014.2-0ubuntu1
New upstream release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
 
82
82
    for row in table.select().execute().fetchall():
83
83
        if row.type != 'threshold':
84
 
            #note: type insupported in previous version
 
84
            # note: type insupported in previous version
85
85
            table.delete().where(table.c.id == row.id).execute()
86
86
        else:
87
87
            rule = json.loads(row.rule)
93
93
                      'meter_name': int(rule['mater_name']),
94
94
                      'matching_metadata': {}}
95
95
 
96
 
            #note: op are ignored because previous format don't support it
 
96
            # note: op are ignored because previous format don't support it
97
97
            for q in rule['query']:
98
98
                values['matching_metadata'][q['field']] = q['value']
99
99
            values['matching_metadata'] = json.dumps(