#452: better missing network message

This commit is contained in:
Muayyad alsadi 2022-03-20 17:16:59 +03:00
parent 7b99b38f0e
commit ebb3dfe634

View File

@ -1480,7 +1480,11 @@ class PodmanCompose:
) )
allnets.update(srv_nets) allnets.update(srv_nets)
given_nets = set(nets.keys()) given_nets = set(nets.keys())
missing_nets = given_nets - allnets missing_nets = allnets - given_nets
unused_nets = given_nets - allnets - set(["default"])
if len(unused_nets):
unused_nets_str = ",".join(unused_nets)
log(f"WARNING: unused networks: {unused_nets_str}")
if len(missing_nets): if len(missing_nets):
missing_nets_str = ",".join(missing_nets) missing_nets_str = ",".join(missing_nets)
raise RuntimeError(f"missing networks: {missing_nets_str}") raise RuntimeError(f"missing networks: {missing_nets_str}")