From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6D96113888F for ; Fri, 9 Oct 2015 21:06:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ED45621C012; Fri, 9 Oct 2015 21:06:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 805CB21C00D for ; Fri, 9 Oct 2015 21:06:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AC50A3402A2 for ; Fri, 9 Oct 2015 21:06:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 08295DD0 for ; Fri, 9 Oct 2015 21:06:47 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1444405178.3c638ffc9886f8c8fd98aa130a47c2d42ff985af.vapier@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/targets/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/targets/snapshot.py X-VCS-Directories: catalyst/targets/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 3c638ffc9886f8c8fd98aa130a47c2d42ff985af X-VCS-Branch: master Date: Fri, 9 Oct 2015 21:06:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8a2480aa-8315-41a9-9ce1-9814701eb45a X-Archives-Hash: 05ad40281d24147fa7a395941edc7f1f commit: 3c638ffc9886f8c8fd98aa130a47c2d42ff985af Author: Mike Frysinger gentoo org> AuthorDate: Fri Oct 9 15:39:38 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Oct 9 15:39:38 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3c638ffc snapshot: convert to log module catalyst/targets/snapshot.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/catalyst/targets/snapshot.py b/catalyst/targets/snapshot.py index e1ca7b7..d19f4ef 100644 --- a/catalyst/targets/snapshot.py +++ b/catalyst/targets/snapshot.py @@ -8,6 +8,7 @@ from stat import ST_UID, ST_GID, ST_MODE from DeComp.compress import CompressMap +from catalyst import log from catalyst.support import normpath, cmd from catalyst.base.targetbase import TargetBase from catalyst.base.genbase import GenBase @@ -49,8 +50,8 @@ class snapshot(TargetBase, GenBase): success = True self.setup() - print "Creating Portage tree snapshot "+self.settings["version_stamp"]+\ - " from "+self.settings["portdir"]+"..." + log.notice('Creating Portage tree snapshot %s from %s ...', + self.settings['version_stamp'], self.settings['portdir']) mytmp=self.settings["tmp_path"] ensure_dirs(mytmp) @@ -61,7 +62,7 @@ class snapshot(TargetBase, GenBase): target_snapshot, "Snapshot failure", env=self.env) - print "Compressing Portage snapshot tarball..." + log.notice('Compressing Portage snapshot tarball ...') compressor = CompressMap(self.settings["compress_definitions"], env=self.env, default_mode=self.settings['compression_mode']) infodict = compressor.create_infodict( @@ -74,17 +75,17 @@ class snapshot(TargetBase, GenBase): ) if not compressor.compress(infodict): success = False - print "Snapshot compression failure" + log.error('Snapshot compression failure') else: filename = '.'.join([self.settings["snapshot_path"], compressor.extension(self.settings["compression_mode"])]) - print "COMPRESSOR success!!!! filename", filename + log.notice('Snapshot successfully written to %s', filename) self.gen_contents_file(filename) self.gen_digest_file(filename) self.cleanup() if success: - print "snapshot: complete!" + log.info('snapshot: complete!') return success def kill_chroot_pids(self): @@ -92,12 +93,12 @@ class snapshot(TargetBase, GenBase): @staticmethod def cleanup(): - print "Cleaning up..." + log.info('Cleaning up ...') def purge(self): myemp=self.settings["tmp_path"] if os.path.isdir(myemp): - print "Emptying directory",myemp + log.notice('Emptying directory %s', myemp) # stat the dir, delete the dir, recreate the dir and set # the proper perms and ownership mystat=os.stat(myemp)