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 43FB813888F for ; Fri, 9 Oct 2015 19:36:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9659821C017; Fri, 9 Oct 2015 19:36:12 +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 25ACC21C015 for ; Fri, 9 Oct 2015 19:36:12 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 621CE3406C2 for ; Fri, 9 Oct 2015 19:36:11 +0000 (UTC) From: Mike Frysinger To: gentoo-catalyst@lists.gentoo.org Subject: [gentoo-catalyst] [PATCH 3/4] snapshot: convert to log module Date: Fri, 9 Oct 2015 15:36:06 -0400 Message-Id: <1444419367-779-3-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.5.2 In-Reply-To: <1444419367-779-1-git-send-email-vapier@gentoo.org> References: <1444419367-779-1-git-send-email-vapier@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 38459128-a1a2-4663-a4fc-a9dadfdfdb29 X-Archives-Hash: 76deea5293f12c8ffe1e90d58671e1b6 --- 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) -- 2.5.2