Skip to content

Commit efa6177

Browse files
authored
Merge pull request #577 from ukkopahis/menu-empty-override
menu: fix error on empty compose-override.yml
2 parents dc59101 + aedde3c commit efa6177

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

scripts/buildstack_menu.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def main():
1111
import math
1212
import sys
1313
import subprocess
14+
import traceback
1415
from deps.chars import specialChars, commonTopBorder, commonBottomBorder, commonEmptyLine, padText
1516
from deps.consts import servicesDirectory, templatesDirectory, volumesDirectory, buildCache, envFile, dockerPathOutput, servicesFileName, composeOverrideFile
1617
from deps.yaml_merge import mergeYaml
@@ -85,7 +86,7 @@ def buildServices(): # TODO: Move this into a dependency so that it can be execu
8586
return True
8687
except Exception as err:
8788
print("Issue running build:")
88-
print(err)
89+
traceback.print_exc()
8990
input("Press Enter to continue...")
9091
return False
9192

@@ -311,7 +312,7 @@ def mainRender(menu, selection, renderType = 1):
311312

312313
except Exception as err:
313314
print("There was an error rendering the menu:")
314-
print(err)
315+
traceback.print_exc()
315316
print("Press [Esc] to go back")
316317
return
317318

@@ -398,13 +399,13 @@ def checkForIssues():
398399
menu[getMenuItemIndexByService(checkedMenuItem)][1]["issues"] = []
399400
except Exception as err:
400401
print("Error running checkForIssues on '%s'" % checkedMenuItem)
401-
print(err)
402+
traceback.print_exc()
402403
input("Press Enter to continue...")
403404
else:
404405
menu[getMenuItemIndexByService(checkedMenuItem)][1]["issues"] = []
405406
except Exception as err:
406407
print("Error running checkForIssues on '%s'" % checkedMenuItem)
407-
print(err)
408+
traceback.print_exc()
408409
input("Press any key to exit...")
409410
sys.exit(1)
410411

@@ -430,7 +431,7 @@ def checkForOptions():
430431
menu[getMenuItemIndexByService(menuItem[0])][1]["buildHooks"]["options"] = True
431432
except Exception as err:
432433
print("Error running checkForOptions on '%s'" % menuItem[0])
433-
print(err)
434+
traceback.print_exc()
434435
input("Press any key to exit...")
435436
sys.exit(1)
436437

@@ -459,7 +460,7 @@ def runPrebuildHook():
459460
exec(code, execGlobals, execLocals)
460461
except Exception as err:
461462
print("Error running PreBuildHook on '%s'" % checkedMenuItem)
462-
print(err)
463+
traceback.print_exc()
463464
input("Press Enter to continue...")
464465
try: # If the prebuild hook modified the docker-compose object, pull it from the script back to here.
465466
dockerComposeServicesYaml = execGlobals["dockerComposeServicesYaml"]
@@ -490,7 +491,7 @@ def runPostBuildHook():
490491
exec(code, execGlobals, execLocals)
491492
except Exception as err:
492493
print("Error running PostBuildHook on '%s'" % checkedMenuItem)
493-
print(err)
494+
traceback.print_exc()
494495
input("Press Enter to continue...")
495496

496497
def executeServiceOptions():

scripts/deps/yaml_merge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
def mergeYaml(priorityYaml, defaultYaml):
3+
if not priorityYaml:
4+
return defaultYaml
35
finalYaml = {}
46
if isinstance(defaultYaml, dict):
57
for dk, dv in defaultYaml.items():

0 commit comments

Comments
 (0)