@@ -13,7 +13,7 @@ class RemoteKernelProviderBase(KernelSpecProvider):
13
13
# The following must be overridden by subclasses
14
14
id = None
15
15
kernel_file = None
16
- lifecycle_manager_class = None
16
+ lifecycle_manager_classes = []
17
17
18
18
def launch (self , kernelspec_name , cwd = None , kernel_params = None ):
19
19
"""Launch a kernel, return (connection_info, kernel_manager).
@@ -64,20 +64,20 @@ def _get_lifecycle_info(self, kernel_spec):
64
64
if lifecycle_info :
65
65
class_name = lifecycle_info .get ('class_name' , None )
66
66
if class_name is not None :
67
- if class_name != self .lifecycle_manager_class : # Legacy check...
67
+ if class_name not in self .lifecycle_manager_classes : # Legacy check...
68
68
legacy_detected = True
69
- lifecycle_info .update ({'class_name' : self .lifecycle_manager_class })
69
+ lifecycle_info .update ({'class_name' : self .lifecycle_manager_classes [ 0 ] })
70
70
if 'config' not in lifecycle_info : # if no config stanza, add one for consistency
71
71
lifecycle_info .update ({"config" : {}})
72
72
73
73
if lifecycle_info is None : # Be sure to have a class_name with empty config
74
- lifecycle_info = {'class_name' : self .lifecycle_manager_class , 'config' : {}}
74
+ lifecycle_info = {'class_name' : self .lifecycle_manager_classes [ 0 ] , 'config' : {}}
75
75
76
76
if legacy_detected :
77
77
self .log .warn ("Legacy kernelspec detected with at '{resource_dir}'. Ensure the contents of "
78
78
"'{kernel_json}' contain a 'lifecycle_info' stanza within 'metadata' with field "
79
- "' class_name: {expected_class }'" .
79
+ "class_name in '{expected_classes }'" .
80
80
format (resource_dir = kernel_spec .resource_dir , kernel_json = self .kernel_file ,
81
- expected_class = self .lifecycle_manager_class ))
81
+ expected_classes = self .lifecycle_manager_classes ))
82
82
83
83
return lifecycle_info
0 commit comments