diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-06-26 11:01:22 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-06-26 11:01:22 +0100 |
commit | c2587cf3aac2e9c734e040de86f07e950042c112 (patch) | |
tree | c58ff9ef03dbb15d78c8e43659f468b10cfc30ea | |
parent | 7df187961636a4b7c990576f089b3d1d8de3b325 (diff) | |
download | morph-c2587cf3aac2e9c734e040de86f07e950042c112.tar.gz |
Fix problems found by Richard in review
-rwxr-xr-x | morphlib/app.py | 17 | ||||
-rw-r--r-- | morphlib/builder2.py | 6 |
2 files changed, 9 insertions, 14 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index 6cc165d5..5fa268b5 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -932,20 +932,13 @@ class Morph(cliapp.Application): ''' - if 'msg' in kwargs: - text = kwargs['msg'] % kwargs - else: - text = 'Morph tried to say something, but couldn\'t decide what' - - timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime()) - text = '%s %s' % (timestamp, text) - + assert 'msg' in kwargs + text = kwargs['msg'] % kwargs + error = kwargs.get('error', False) chatty = kwargs.get('chatty', False) quiet = self.settings['quiet'] verbose = self.settings['verbose'] - - ok = verbose or (quiet and error) or (not quiet and not chatty) if error: logging.error(text) @@ -954,8 +947,10 @@ class Morph(cliapp.Application): else: logging.info(text) + ok = verbose or error or (not quiet and not chatty) if ok: - self.output.write('%s\n' % text) + timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime()) + self.output.write('%s %s\n' % (timestamp, text)) self.output.flush() def runcmd(self, argv, *args, **kwargs): diff --git a/morphlib/builder2.py b/morphlib/builder2.py index 6dc55d15..aaff29d3 100644 --- a/morphlib/builder2.py +++ b/morphlib/builder2.py @@ -570,7 +570,7 @@ class SystemBuilder(BuilderBase): # pragma: no cover self.local_artifact_cache) if len(overlaps) > 0: self.app.status(msg='Overlaps in system artifact ' - '%(artifact_name)detected', + '%(artifact_name)s detected', artifact_name=self.artifact.name, error=True) log_overlaps(overlaps) @@ -632,10 +632,10 @@ class SystemBuilder(BuilderBase): # pragma: no cover cwd=path) def _install_boot_files(self, arch, sourcefs, targetfs): - self.app.status(msg='Installing boot files into root volume', - chatty=True) with self.build_watch('install-boot-files'): if arch in ('x86', 'x86_64', None): + self.app.status(msg='Installing boot files into root volume', + chatty=True) shutil.copy2(os.path.join(sourcefs, 'extlinux.conf'), os.path.join(targetfs, 'extlinux.conf')) os.mkdir(os.path.join(targetfs, 'boot')) |