@@ -62,7 +62,7 @@ class HostedAgents {
6262 reload ( ) {
6363 // start agents for all existing cloud pools
6464 const agents_to_start = system_store . data . pools . filter ( pool =>
65- ( ! _ . isUndefined ( pool . cloud_pool_info ) || ! _ . isUndefined ( pool . mongo_pool_info ) )
65+ ( ! _ . isUndefined ( pool . cloud_pool_info ) )
6666 ) ;
6767 dbg . log0 ( `will start agents for these pools: ${ util . inspect ( agents_to_start ) } ` ) ;
6868 return P . map ( agents_to_start , pool => this . _start_pool_agent ( pool ) ) ;
@@ -114,8 +114,7 @@ class HostedAgents {
114114
115115 const host_id = config . HOSTED_AGENTS_HOST_ID + pool_id ;
116116 const storage_path = path . join ( process . cwd ( ) , 'noobaa_storage' , node_name ) ;
117- const pool_property_path = pool . resource_type === 'INTERNAL' ?
118- 'mongo_pool_info.agent_info.mongo_path' : 'cloud_pool_info.agent_info.cloud_path' ;
117+ const pool_property_path = 'cloud_pool_info.agent_info.cloud_path' ;
119118 const pool_path = _ . get ( pool , pool_property_path , `noobaa_blocks/${ pool_id } ` ) ;
120119 const pool_path_property = pool . resource_type === 'INTERNAL' ? 'mongo_path' : 'cloud_path' ;
121120 const pool_info_property = pool . resource_type === 'INTERNAL' ? 'mongo_info' : 'cloud_info' ;
@@ -131,12 +130,10 @@ class HostedAgents {
131130 role : 'create_node'
132131 } ) ;
133132 const { token_wrapper, create_node_token_wrapper } = _get_pool_token_wrapper ( pool ) ;
134- const info = pool . resource_type === 'INTERNAL' ?
135- pool . mongo_pool_info : pool . cloud_pool_info ;
133+ const info = pool . cloud_pool_info ;
136134 if ( ! info . agent_info || ! info . agent_info . create_node_token ) {
137135 const existing_token = info . agent_info ? info . agent_info . node_token : null ;
138- const pool_agent_path = pool . resource_type === 'INTERNAL' ?
139- 'mongo_pool_info' : 'cloud_pool_info' ;
136+ const pool_agent_path = 'cloud_pool_info' ;
140137 const update = {
141138 pools : [ {
142139 _id : pool . _id ,
@@ -377,8 +374,7 @@ function _get_pool_and_path_for_token(token_pool) {
377374 const sys = system_store . data . systems [ 0 ] ;
378375 const pool = sys . pools_by_name [ token_pool . name ] ;
379376 if ( ! pool ) throw new Error ( `Pool ${ token_pool . name } , ${ token_pool . _id } does not exist` ) ;
380- const pool_property_path = pool . resource_type === 'INTERNAL' ?
381- 'mongo_pool_info.agent_info' : 'cloud_pool_info.agent_info' ;
377+ const pool_property_path = 'cloud_pool_info.agent_info' ;
382378 return {
383379 pool_property_path,
384380 pool
0 commit comments