def g_connect(method):
 def wrapped(self, *args, **kwargs):
  if (not self.initialized):
   display.vvvv(('Initial connection to galaxy_server: %s' % self._api_server))
   server_version = self._get_server_api_version()
   if (server_version not in self.SUPPORTED_VERSIONS):
    raise AnsibleError(('Unsupported Galaxy server API version: %s' % server_version))
   self.baseurl = ('%s/api/%s' % (self._api_server, server_version))
   self.version = server_version
   display.vvvv(('Base API: %s' % self.baseurl))
   self.initialized = True
  return method(self, *args, **kwargs)
 return wrapped

def g_connect ( method ) : def wrapped ( self , * args , ** kwargs ) : if ( not self . initialized ) : display . vvvv ( ( 'Initial connection to galaxy_server: %s' % self . _api_server ) ) server_version = self . _get_server_api_version ( ) if ( server_version not in self . SUPPORTED_VERSIONS ) : raise AnsibleError ( ( 'Unsupported Galaxy server API version: %s' % server_version ) ) self . baseurl = ( '%s/api/%s' % ( self . _api_server , server_version ) ) self . version = server_version display . vvvv ( ( 'Base API: %s' % self . baseurl ) ) self . initialized = True return method ( self , * args , ** kwargs ) return wrapped
wrapper to lazily initialize connection info to galaxy .