def get_remote_image_service(context, image_href):
 if ('/' not in str(image_href)):
  image_service = get_default_image_service()
  return (image_service, image_href)
 try:
  (image_id, glance_netloc, use_ssl) = _parse_image_ref(image_href)
  glance_client = GlanceClientWrapper(context=context, netloc=glance_netloc, use_ssl=use_ssl)
 except ValueError:
  raise exception.InvalidImageRef(image_href=image_href)
 image_service = GlanceImageService(client=glance_client)
 return (image_service, image_id)

def get_remote_image_service ( context , image_href ) : if ( '/' not in str ( image_href ) ) : image_service = get_default_image_service ( ) return ( image_service , image_href ) try : ( image_id , glance_netloc , use_ssl ) = _parse_image_ref ( image_href ) glance_client = GlanceClientWrapper ( context = context , netloc = glance_netloc , use_ssl = use_ssl ) except ValueError : raise exception . InvalidImageRef ( image_href = image_href ) image_service = GlanceImageService ( client = glance_client ) return ( image_service , image_id )
create an image_service and parse the id from the given image_href .