~rlane/nova/lp773690

« back to all changes in this revision

Viewing changes to nova/api/ec2/ec2utils.py

  • Committer: rlane at wikimedia
  • Date: 2011-04-29 22:30:40 UTC
  • mfrom: (382.1.655 nova)
  • Revision ID: rlane@wikimedia.org-20110429223040-i0x3ds9eqwrabyru
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
def ec2_id_to_id(ec2_id):
23
23
    """Convert an ec2 ID (i-[base 16 number]) to an instance id (int)"""
24
 
    try:
25
 
        return int(ec2_id.split('-')[-1], 16)
26
 
    except ValueError:
27
 
        raise exception.NotFound(_("Id %s Not Found") % ec2_id)
 
24
    return int(ec2_id.split('-')[-1], 16)
28
25
 
29
26
 
30
27
def id_to_ec2_id(instance_id, template='i-%08x'):