def ec2_id_to_id(ec2_id):
 try:
  return int(ec2_id.split('-')[(-1)], 16)
 except ValueError:
  raise exception.InvalidEc2Id(ec2_id=ec2_id)

def ec2_id_to_id ( ec2_id ) : try : return int ( ec2_id . split ( '-' ) [ ( - 1 ) ] , 16 ) except ValueError : raise exception . InvalidEc2Id ( ec2_id = ec2_id )
convert an ec2 id to an instance id .