Correctly report exit status from Python modules.
This commit is contained in:
parent
87ee2b8b8c
commit
4fc2efb7fa
@ -41,5 +41,4 @@ def run():
|
|||||||
+ str( libcalamares.globalStorage.value( "item3" ) ) + "\n"
|
+ str( libcalamares.globalStorage.value( "item3" ) ) + "\n"
|
||||||
|
|
||||||
libcalamares.job.setprogress( 0.1 )
|
libcalamares.job.setprogress( 0.1 )
|
||||||
return accumulator
|
return ( "", accumulator )
|
||||||
|
|
||||||
|
@ -77,4 +77,4 @@ def run():
|
|||||||
installGrub( rootMountPoint, bootLoader )
|
installGrub( rootMountPoint, bootLoader )
|
||||||
finally:
|
finally:
|
||||||
umountPartitions( rootMountPoint, extraMounts )
|
umountPartitions( rootMountPoint, extraMounts )
|
||||||
return "All done"
|
return None
|
||||||
|
@ -61,4 +61,4 @@ def run():
|
|||||||
mountPartitions( rootMountPoint, libcalamares.globalStorage.value( "partitions" ) )
|
mountPartitions( rootMountPoint, libcalamares.globalStorage.value( "partitions" ) )
|
||||||
|
|
||||||
libcalamares.globalStorage.insert( "rootMountPoint", rootMountPoint )
|
libcalamares.globalStorage.insert( "rootMountPoint", rootMountPoint )
|
||||||
return "All done, mounted at {}".format( rootMountPoint )
|
return None
|
||||||
|
@ -35,9 +35,9 @@ def listMounts( rootMountPoint ):
|
|||||||
def run():
|
def run():
|
||||||
rootMountPoint = libcalamares.globalStorage.value( "rootMountPoint" )
|
rootMountPoint = libcalamares.globalStorage.value( "rootMountPoint" )
|
||||||
if not 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 ):
|
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 )
|
lst = listMounts( rootMountPoint )
|
||||||
# Sort the list by mount point in decreasing order. This way we can be sure
|
# 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 ] )
|
subprocess.check_call( [ "umount", mountPoint ] )
|
||||||
|
|
||||||
os.rmdir( rootMountPoint )
|
os.rmdir( rootMountPoint )
|
||||||
return "All done"
|
return None
|
||||||
|
@ -106,7 +106,12 @@ def run():
|
|||||||
# destination: ""
|
# destination: ""
|
||||||
|
|
||||||
rootMountPoint = globalStorage.value( "rootMountPoint" )
|
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()
|
unpack = list()
|
||||||
|
|
||||||
for entry in job.configuration[ "unpack" ]:
|
for entry in job.configuration[ "unpack" ]:
|
||||||
@ -114,7 +119,8 @@ def run():
|
|||||||
destination = os.path.abspath( os.path.join( rootMountPoint, entry[ "destination" ] ) )
|
destination = os.path.abspath( os.path.join( rootMountPoint, entry[ "destination" ] ) )
|
||||||
|
|
||||||
if not os.path.isfile( source ) or not os.path.isdir( 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 ) )
|
unpack.append( UnpackEntry( source, destination ) )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user