File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -997,7 +997,14 @@ def mount_root(self) -> str:
997997
998998def export_mount_info (self ) -> None :
999999 """Exports mount info based on the config to /run/MOUNTS_ROOT_{option}"""
1000- self ["exports" ]["MOUNTS_ROOT_SOURCE" ] = _get_mount_str (self , self ["mounts" ]["root" ])
1000+ try :
1001+ self ["exports" ]["MOUNTS_ROOT_SOURCE" ] = _get_mount_str (self , self ["mounts" ]["root" ])
1002+ except ValueError as e :
1003+ self .logger .critical (f"Failed to get source info for the root mount: { e } " )
1004+ if not self ["hostonly" ]:
1005+ self .logger .info ("Root mount infomrmation can be defined under the '[mounts.root]' section." )
1006+ raise ValidationError ("Root mount source information is not set, when hostonly mode is disabled, it must be manually defined." )
1007+ raise ValidationError ("Root mount source information is not set even though hostonly mode is enabled. Please report a bug." )
10011008 self ["exports" ]["MOUNTS_ROOT_TYPE" ] = self ["mounts" ]["root" ].get ("type" , "auto" )
10021009 self ["exports" ]["MOUNTS_ROOT_OPTIONS" ] = "," .join (self ["mounts" ]["root" ]["options" ])
10031010 self ["exports" ]["MOUNTS_ROOT_TARGET" ] = self ["mounts" ]["root" ]["destination" ]
You can’t perform that action at this time.
0 commit comments