summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/bldcontrol
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-09 14:05:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-11 10:34:30 +0100
commit3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10 (patch)
tree363978673f3e06a03bc2f4a3cb629dd5011cf40a /bitbake/lib/toaster/bldcontrol
parenta9d90f74050e2129171da09ca3427720887f67ee (diff)
downloadpoky-3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10.tar.gz
bitbake: bin, toaster: Fix print and exception syntax
This updates the print "" syntax to print() and fixes some exception handling syntax such that its compatible with python v2 and v3. (Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/bldcontrol')
-rw-r--r--bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py18
-rw-r--r--bitbake/lib/toaster/bldcontrol/tests.py4
2 files changed, 11 insertions, 11 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
index 5e70437b24..6b1da1b103 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
+++ b/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
@@ -70,11 +70,11 @@ class Command(NoArgsCommand):
70 return True 70 return True
71 71
72 if len(be.sourcedir) == 0: 72 if len(be.sourcedir) == 0:
73 print "\n -- Validation: The layers checkout directory must be set." 73 print("\n -- Validation: The layers checkout directory must be set.")
74 is_changed = _update_sourcedir() 74 is_changed = _update_sourcedir()
75 75
76 if not be.sourcedir.startswith("/"): 76 if not be.sourcedir.startswith("/"):
77 print "\n -- Validation: The layers checkout directory must be set to an absolute path." 77 print("\n -- Validation: The layers checkout directory must be set to an absolute path.")
78 is_changed = _update_sourcedir() 78 is_changed = _update_sourcedir()
79 79
80 if is_changed: 80 if is_changed:
@@ -87,16 +87,16 @@ class Command(NoArgsCommand):
87 return True 87 return True
88 88
89 if len(be.builddir) == 0: 89 if len(be.builddir) == 0:
90 print "\n -- Validation: The build directory must be set." 90 print("\n -- Validation: The build directory must be set.")
91 is_changed = _update_builddir() 91 is_changed = _update_builddir()
92 92
93 if not be.builddir.startswith("/"): 93 if not be.builddir.startswith("/"):
94 print "\n -- Validation: The build directory must to be set to an absolute path." 94 print("\n -- Validation: The build directory must to be set to an absolute path.")
95 is_changed = _update_builddir() 95 is_changed = _update_builddir()
96 96
97 97
98 if is_changed: 98 if is_changed:
99 print "\nBuild configuration saved" 99 print("\nBuild configuration saved")
100 be.save() 100 be.save()
101 return True 101 return True
102 102
@@ -104,20 +104,20 @@ class Command(NoArgsCommand):
104 if be.needs_import: 104 if be.needs_import:
105 try: 105 try:
106 config_file = os.environ.get('TOASTER_CONF') 106 config_file = os.environ.get('TOASTER_CONF')
107 print "\nImporting file: %s" % config_file 107 print("\nImporting file: %s" % config_file)
108 from loadconf import Command as LoadConfigCommand 108 from loadconf import Command as LoadConfigCommand
109 109
110 LoadConfigCommand()._import_layer_config(config_file) 110 LoadConfigCommand()._import_layer_config(config_file)
111 # we run lsupdates after config update 111 # we run lsupdates after config update
112 print "\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates" 112 print("\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates")
113 from django.core.management import call_command 113 from django.core.management import call_command
114 call_command("lsupdates") 114 call_command("lsupdates")
115 115
116 # we don't look for any other config files 116 # we don't look for any other config files
117 return is_changed 117 return is_changed
118 except Exception as e: 118 except Exception as e:
119 print "Failure while trying to import the toaster config file %s: %s" %\ 119 print("Failure while trying to import the toaster config file %s: %s" %\
120 (config_file, e) 120 (config_file, e))
121 traceback.print_exc(e) 121 traceback.print_exc(e)
122 122
123 return is_changed 123 return is_changed
diff --git a/bitbake/lib/toaster/bldcontrol/tests.py b/bitbake/lib/toaster/bldcontrol/tests.py
index f20cc7d4b1..32985c3280 100644
--- a/bitbake/lib/toaster/bldcontrol/tests.py
+++ b/bitbake/lib/toaster/bldcontrol/tests.py
@@ -53,7 +53,7 @@ class BEControllerTests(object):
53 # setting layers, skip any layer info 53 # setting layers, skip any layer info
54 bc.setLayers(BITBAKE_LAYER, POKY_LAYERS) 54 bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
55 except NotImplementedError: 55 except NotImplementedError:
56 print "Test skipped due to command not implemented yet" 56 print("Test skipped due to command not implemented yet")
57 return True 57 return True
58 # We are ok with the exception as we're handling the git already exists 58 # We are ok with the exception as we're handling the git already exists
59 except BuildSetupException: 59 except BuildSetupException:
@@ -79,7 +79,7 @@ class BEControllerTests(object):
79 # setting layers, skip any layer info 79 # setting layers, skip any layer info
80 layerSet = bc.setLayers(BITBAKE_LAYER, POKY_LAYERS) 80 layerSet = bc.setLayers(BITBAKE_LAYER, POKY_LAYERS)
81 except NotImplementedError: 81 except NotImplementedError:
82 print "Test skipped due to command not implemented yet" 82 print("Test skipped due to command not implemented yet")
83 return True 83 return True
84 # We are ok with the exception as we're handling the git already exists 84 # We are ok with the exception as we're handling the git already exists
85 except BuildSetupException: 85 except BuildSetupException: