original_docstring: Creates a glance client if doesn't exists and calls the function.
docstring: Creates a glance client if doesn't exists and calls the function.
docstring_tokens: Creates a glance client if doesn ' t exists and calls the function .
code: def check_image_service(func):
      """Creates a glance client if doesn't exists and calls the function."""
      @six.wraps(func)
      def wrapper(self, *args, **kwargs):
          """Wrapper around methods calls.
  
          :param image_href: href that describes the location of an image
          """
  
          if self.client:
              return func(self, *args, **kwargs)
  
          image_href = kwargs.get('image_href')
          _id, self.endpoint, use_ssl = service_utils.parse_image_ref(image_href)
  
          params = {}
          params['insecure'] = CONF.glance.glance_api_insecure
          if (not params['insecure'] and CONF.glance.glance_cafile
                  and use_ssl):
              params['cacert'] = CONF.glance.glance_cafile
          if CONF.glance.auth_strategy == 'keystone':
              params['token'] = self.context.auth_token
          self.client = client.Client(self.version,
                                      self.endpoint, **params)
          return func(self, *args, **kwargs)
      return wrapper
code_tokens: def check_image_service ( func ) : @ six . wraps ( func ) def wrapper ( self , * args , ** kwargs ) : """Wrapper around methods calls.
  
          :param image_href: href that describes the location of an image
          """ if self . client : return func ( self , * args , ** kwargs ) image_href = kwargs . get ( 'image_href' ) _id , self . endpoint , use_ssl = service_utils . parse_image_ref ( image_href ) params = { } params [ 'insecure' ] = CONF . glance . glance_api_insecure if ( not params [ 'insecure' ] and CONF . glance . glance_cafile and use_ssl ) : params [ 'cacert' ] = CONF . glance . glance_cafile if CONF . glance . auth_strategy == 'keystone' : params [ 'token' ] = self . context . auth_token self . client = client . Client ( self . version , self . endpoint , ** params ) return func ( self , * args , ** kwargs ) return wrapper
short_docstring: Creates a glance client if doesn't exists and calls the function.
short_docstring_tokens: Creates a glance client if doesn ' t exists and calls the function .
comment: """Creates a glance client if doesn't exists and calls the function."""$SEP$"""Wrapper around methods calls.
  
          :param image_href: href that describes the location of an image
          """