Skip to content
Snippets Groups Projects
Commit 4fc2efb7 authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Correctly report exit status from Python modules.

parent 87ee2b8b
No related branches found
No related tags found
No related merge requests found
......@@ -41,5 +41,4 @@ def run():
+ str( libcalamares.globalStorage.value( "item3" ) ) + "\n"
libcalamares.job.setprogress( 0.1 )
return accumulator
return ( "", accumulator )
......@@ -77,4 +77,4 @@ def run():
installGrub( rootMountPoint, bootLoader )
finally:
umountPartitions( rootMountPoint, extraMounts )
return "All done"
return None
......@@ -61,4 +61,4 @@ def run():
mountPartitions( rootMountPoint, libcalamares.globalStorage.value( "partitions" ) )
libcalamares.globalStorage.insert( "rootMountPoint", rootMountPoint )
return "All done, mounted at {}".format( rootMountPoint )
return None
......@@ -35,9 +35,9 @@ def listMounts( rootMountPoint ):
def run():
rootMountPoint = libcalamares.globalStorage.value( "rootMountPoint" )
if not rootMountPoint:
return "GlobalStorage does not contain a \"rootMountPoint\" key, doing nothing"
return ( "No mount point for root partition in GlobalStorage", "GlobalStorage does not contain a \"rootMountPoint\" key, doing nothing" )
if not os.path.exists( rootMountPoint ):
return "GlobalStorage[\"rootMountPoint\"] is \"{}\", which does not exist, doing nothing".format( rootMountPoint )
return ( "Bad mount point for root partition in GlobalStorage", "GlobalStorage[\"rootMountPoint\"] is \"{}\", which does not exist, doing nothing".format( rootMountPoint ) )
lst = listMounts( rootMountPoint )
# Sort the list by mount point in decreasing order. This way we can be sure
......@@ -48,4 +48,4 @@ def run():
subprocess.check_call( [ "umount", mountPoint ] )
os.rmdir( rootMountPoint )
return "All done"
return None
......@@ -106,7 +106,12 @@ def run():
# destination: ""
rootMountPoint = globalStorage.value( "rootMountPoint" )
if not rootMountPoint:
return ( "No mount point for root partition in GlobalStorage",
"GlobalStorage does not contain a \"rootMountPoint\" key, doing nothing" )
if not os.path.exists( rootMountPoint ):
return ( "Bad mount point for root partition in GlobalStorage",
"GlobalStorage[\"rootMountPoint\"] is \"{}\", which does not exist, doing nothing".format( rootMountPoint ) )
unpack = list()
for entry in job.configuration[ "unpack" ]:
......@@ -114,7 +119,8 @@ def run():
destination = os.path.abspath( os.path.join( rootMountPoint, entry[ "destination" ] ) )
if not os.path.isfile( source ) or not os.path.isdir( destination ):
return "Error: bad source or destination"
return ( "Bad source or destination",
"source=\"{}\"\ndestination=\"{}\"".format( source, destination ) )
unpack.append( UnpackEntry( source, destination ) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment