mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
Correctly report exit status from Python modules.
This commit is contained in:
parent
87ee2b8b8c
commit
4fc2efb7fa
5 changed files with 14 additions and 9 deletions
|
@ -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 ) )
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue