summaryrefslogtreecommitdiff
path: root/morphlib/builder.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/builder.py')
-rw-r--r--morphlib/builder.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 0bb21434..04ebd149 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -10,8 +10,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# with this program. If not, see <http://www.gnu.org/licenses/>.
import json
@@ -290,7 +289,7 @@ class ChunkBuilder(BuilderBase):
self.create_devices(destdir)
os.rename(temppath, logpath)
- except BaseException, e:
+ except BaseException as e:
logging.error('Caught exception: %s' % str(e))
logging.info('Cleaning up staging area')
self.staging_area.chroot_close()
@@ -376,7 +375,7 @@ class ChunkBuilder(BuilderBase):
if stdout:
stdout.flush()
- except cliapp.AppException, e:
+ except cliapp.AppException as e:
if not stdout:
with open(logfilepath, 'r') as log:
self.app.output.write("%s failed\n" % step)
@@ -406,7 +405,7 @@ class ChunkBuilder(BuilderBase):
with morphlib.savefile.SaveFile(script_path, 'w') as f:
f.write("#!/bin/sh\nset -xeu\n")
f.write(script)
- os.chmod(script_path, 0555)
+ os.chmod(script_path, 0o555)
rel_script_path = os.path.join(SYSTEM_INTEGRATION_PATH,
script_name)
@@ -624,7 +623,7 @@ class SystemBuilder(BuilderBase): # pragma: no cover
f.write('SUPPORT_URL="http://wiki.baserock.org/mailinglist"\n')
f.write('BUG_REPORT_URL="http://wiki.baserock.org/mailinglist"\n')
- os.chmod(os_release_file, 0644)
+ os.chmod(os_release_file, 0o644)
def run_system_integration_commands(self, rootdir): # pragma: no cover
''' Run the system integration commands '''
@@ -657,7 +656,7 @@ class SystemBuilder(BuilderBase): # pragma: no cover
msg = error_message_for_containerised_commandline(
argv, err, container_config)
raise cliapp.AppException(msg)
- except BaseException, e:
+ except BaseException as e:
self.app.status(
msg='Error while running system integration commands',
error=True)