@@ -221,7 +221,7 @@ class Network:
221221
222222 def __init__ (
223223 self ,
224- hosts ,
224+ hosts = None ,
225225 binary_dir = "." ,
226226 dbg_nodes = None ,
227227 existing_network = None ,
@@ -242,34 +242,35 @@ def __init__(
242242 if existing_network is None :
243243 self .consortium = None
244244 self .users = []
245- self .hosts = hosts
245+ self .hosts = hosts or []
246246 self .next_node_id = next_node_id
247247 self .txs = txs
248248 self .jwt_issuer = jwt_issuer
249249 self .service_load = service_load
250250 self .recovery_count = 0
251+ self .common_dir = None
251252 else :
252253 self .consortium = existing_network .consortium
253254 self .users = existing_network .users
255+ self .hosts = hosts or infra .e2e_args .nodes (
256+ existing_network .args , len (existing_network .nodes )
257+ )
254258 self .next_node_id = existing_network .next_node_id
255259 self .txs = existing_network .txs
256260 self .jwt_issuer = existing_network .jwt_issuer
257- self .hosts = infra .e2e_args .nodes (
258- existing_network .args , len (existing_network .nodes )
259- )
260261 self .service_load = None
261262 if existing_network .service_load :
262263 self .service_load = existing_network .service_load
263264 self .service_load .set_network (self )
264265 self .recovery_count = existing_network .recovery_count
266+ self .common_dir = existing_network .common_dir
265267
266268 self .ignoring_shutdown_errors = False
267269 self .ignore_error_patterns = []
268270 self .nodes = []
269271 self .status = ServiceStatus .CLOSED
270272 self .binary_dir = binary_dir
271273 self .library_dir = library_dir
272- self .common_dir = None
273274 self .election_duration = None
274275 self .observed_election_duration = None
275276 self .key_generator = os .path .join (binary_dir , self .KEY_GEN )
@@ -695,8 +696,10 @@ def start_in_recovery(
695696 :param snapshots_dir: snapshot directory to recover from.
696697 :param common_dir: common directory containing member and user keys and certs.
697698 """
698- self .common_dir = common_dir or get_common_folder_name (
699- args .workspace , args .label
699+ self .common_dir = (
700+ common_dir
701+ or self .common_dir
702+ or get_common_folder_name (args .workspace , args .label )
700703 )
701704 committed_ledger_dirs = committed_ledger_dirs or []
702705
@@ -785,8 +788,10 @@ def start_in_self_healing_open(
785788 suspend_after_start = False ,
786789 ** kwargs ,
787790 ):
788- self .common_dir = common_dir or get_common_folder_name (
789- args .workspace , args .label
791+ self .common_dir = (
792+ common_dir
793+ or self .common_dir
794+ or get_common_folder_name (args .workspace , args .label )
790795 )
791796
792797 self .per_node_args_override = self .per_node_args_override or {
0 commit comments