def image_ec2_id(image_id, image_type='ami'):
 template = (image_type + '-%08x')
 try:
  return id_to_ec2_id(image_id, template=template)
 except ValueError:
  return 'ami-00000000'

def image_ec2_id ( image_id , image_type = 'ami' ) : template = ( image_type + '-%08x' ) try : return id_to_ec2_id ( image_id , template = template ) except ValueError : return 'ami-00000000'
returns image ec2_id using id and three letter type .