Exemple #1
0
 def global_client_object(cls):
     global global_client_object
     # Previously, KeepClient would change its behavior at runtime based
     # on these configuration settings.  We simulate that behavior here
     # by checking the values and returning a new KeepClient if any of
     # them have changed.
     key = (config.get('ARVADOS_API_HOST'), config.get('ARVADOS_API_TOKEN'),
            config.flag_is_true('ARVADOS_API_HOST_INSECURE'),
            config.get('ARVADOS_KEEP_PROXY'),
            config.get('ARVADOS_EXTERNAL_CLIENT') == 'true',
            os.environ.get('KEEP_LOCAL_STORE'))
     if (global_client_object is None) or (cls._last_key != key):
         global_client_object = KeepClient()
         cls._last_key = key
     return global_client_object
Exemple #2
0
 def global_client_object(cls):
     global global_client_object
     # Previously, KeepClient would change its behavior at runtime based
     # on these configuration settings.  We simulate that behavior here
     # by checking the values and returning a new KeepClient if any of
     # them have changed.
     key = (config.get('ARVADOS_API_HOST'),
            config.get('ARVADOS_API_TOKEN'),
            config.flag_is_true('ARVADOS_API_HOST_INSECURE'),
            config.get('ARVADOS_KEEP_PROXY'),
            config.get('ARVADOS_EXTERNAL_CLIENT') == 'true',
            os.environ.get('KEEP_LOCAL_STORE'))
     if (global_client_object is None) or (cls._last_key != key):
         global_client_object = KeepClient()
         cls._last_key = key
     return global_client_object