~0x44/nova/extdoc

« back to all changes in this revision

Viewing changes to nova/api/openstack/views/images.py

  • Committer: Brian Waldon
  • Date: 2011-09-12 21:52:29 UTC
  • mfrom: (1558 nova)
  • mto: This revision was merged to the branch mainline in revision 1561.
  • Revision ID: brian.waldon@rackspace.com-20110912215229-5xab1wvvd11rft6g
merging trunk; resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    def _format_status(self, image):
38
38
        """Update the status field to standardize format."""
39
39
        status_mapping = {
40
 
            'pending': 'QUEUED',
41
 
            'decrypting': 'PREPARING',
42
 
            'untarring': 'SAVING',
43
 
            'available': 'ACTIVE',
44
 
            'killed': 'FAILED',
 
40
            'active': 'ACTIVE',
 
41
            'queued': 'SAVING',
 
42
            'saving': 'SAVING',
 
43
            'deleted': 'DELETED',
 
44
            'pending_delete': 'DELETED',
 
45
            'killed': 'ERROR',
45
46
        }
46
47
 
47
48
        try:
48
 
            image['status'] = status_mapping[image['status']].upper()
 
49
            image['status'] = status_mapping[image['status']]
49
50
        except KeyError:
50
 
            image['status'] = image['status'].upper()
 
51
            image['status'] = 'UNKNOWN'
51
52
 
52
53
    def _build_server(self, image, image_obj):
53
54
        """Indicates that you must use a ViewBuilder subclass."""