public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 08/10] netboot: convert to log module
Date: Sun, 11 Oct 2015 02:29:10 -0400	[thread overview]
Message-ID: <1444544952-32408-8-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1444544952-32408-1-git-send-email-vapier@gentoo.org>

---
 catalyst/targets/netboot.py  |  6 +++---
 catalyst/targets/netboot2.py | 19 ++++++++++---------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py
index 46ec4eb..333a230 100644
--- a/catalyst/targets/netboot.py
+++ b/catalyst/targets/netboot.py
@@ -6,7 +6,7 @@ netboot target, version 1
 import os
 import types
 
-
+from catalyst import log
 from catalyst.support import (CatalystError, normpath,
 	cmd, list_bashify, file_locate)
 
@@ -58,7 +58,7 @@ class netboot(StageBase):
 	def set_root_path(self):
 		# ROOT= variable for emerges
 		self.settings["root_path"]=normpath("/tmp/image")
-		print "netboot root path is "+self.settings["root_path"]
+		log.info('netboot root path is %s', self.settings['root_path'])
 
 #	def build_packages(self):
 #		# build packages
@@ -123,7 +123,7 @@ class netboot(StageBase):
 			raise CatalystError("netboot build aborting due to error.",
 				print_traceback=True)
 		# end
-		print "netboot: build finished !"
+		log.notice('netboot: build finished !')
 
 	def set_action_sequence(self):
 		self.settings["action_sequence"]=["unpack","unpack_snapshot",
diff --git a/catalyst/targets/netboot2.py b/catalyst/targets/netboot2.py
index 5508367..d882a06 100644
--- a/catalyst/targets/netboot2.py
+++ b/catalyst/targets/netboot2.py
@@ -8,6 +8,7 @@ import types
 import shutil
 from stat import ST_UID, ST_GID, ST_MODE
 
+from catalyst import log
 from catalyst.support import (CatalystError, normpath, cmd, list_bashify)
 from catalyst.fileops import ensure_dirs
 
@@ -53,7 +54,7 @@ class netboot2(StageBase):
 			self.settings["target_subpath"])
 		if "autoresume" in self.settings["options"] \
 			and self.resume.is_enabled("setup_target_path"):
-			print "Resume point detected, skipping target path setup operation..."
+			log.notice('Resume point detected, skipping target path setup operation...')
 		else:
 			# first clean up any existing target stuff
 			if os.path.isfile(self.settings["target_path"]):
@@ -69,7 +70,7 @@ class netboot2(StageBase):
 		# check for autoresume point
 		if "autoresume" in self.settings["options"] \
 			and self.resume.is_enabled("copy_files_to_image"):
-			print "Resume point detected, skipping target path setup operation..."
+			log.notice('Resume point detected, skipping target path setup operation...')
 		else:
 			if "netboot2/packages" in self.settings:
 				if type(self.settings["netboot2/packages"]) == types.StringType:
@@ -103,7 +104,7 @@ class netboot2(StageBase):
 	def setup_overlay(self):
 		if "autoresume" in self.settings["options"] \
 		and self.resume.is_enabled("setup_overlay"):
-			print "Resume point detected, skipping setup_overlay operation..."
+			log.notice('Resume point detected, skipping setup_overlay operation...')
 		else:
 			if "netboot2/overlay" in self.settings:
 				for x in self.settings["netboot2/overlay"]:
@@ -119,7 +120,7 @@ class netboot2(StageBase):
 		try:
 			cmd(self.settings["controller_file"]+\
 				" final",env=self.env)
-			print ">>> Netboot Build Finished!"
+			log.notice('Netboot Build Finished!')
 		except CatalystError:
 			self.unbind()
 			raise CatalystError("Failed to move kernel images!",
@@ -128,20 +129,20 @@ class netboot2(StageBase):
 	def remove(self):
 		if "autoresume" in self.settings["options"] \
 			and self.resume.is_enabled("remove"):
-			print "Resume point detected, skipping remove operation..."
+			log.notice('Resume point detected, skipping remove operation...')
 		else:
 			if self.settings["spec_prefix"]+"/rm" in self.settings:
 				for x in self.settings[self.settings["spec_prefix"]+"/rm"]:
 					# we're going to shell out for all these cleaning operations,
 					# so we get easy glob handling
-					print "netboot2: removing " + x
+					log.notice('netboot2: removing %s', x)
 					os.system("rm -rf " + self.settings["chroot_path"] +
 						self.settings["merge_path"] + x)
 
 	def empty(self):
 		if "autoresume" in self.settings["options"] \
 			and self.resume.is_enabled("empty"):
-			print "Resume point detected, skipping empty operation..."
+			log.notice('Resume point detected, skipping empty operation...')
 		else:
 			if "netboot2/empty" in self.settings:
 				if type(self.settings["netboot2/empty"])==types.StringType:
@@ -149,9 +150,9 @@ class netboot2(StageBase):
 				for x in self.settings["netboot2/empty"]:
 					myemp=self.settings["chroot_path"] + self.settings["merge_path"] + x
 					if not os.path.isdir(myemp):
-						print x,"not a directory or does not exist, skipping 'empty' operation."
+						log.warning('not a directory or does not exist, skipping "empty" operation: %s', x)
 						continue
-					print "Emptying directory", x
+					log.info('Emptying directory %s', x)
 					# stat the dir, delete the dir, recreate the dir and set
 					# the proper perms and ownership
 					mystat=os.stat(myemp)
-- 
2.5.2



  parent reply	other threads:[~2015-10-11  6:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11  6:29 [gentoo-catalyst] [PATCH 01/10] stage1: convert to log module Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 02/10] stage2: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 03/10] stage3: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 04/10] stagebase: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 05/10] clearbase: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 06/10] support: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 07/10] livecd_stage: " Mike Frysinger
2015-10-11  6:29 ` Mike Frysinger [this message]
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 09/10] embedded/grp: " Mike Frysinger
2015-10-11  6:29 ` [gentoo-catalyst] [PATCH 10/10] resume: " Mike Frysinger
2015-10-11 14:16   ` Anthony G. Basile
2015-10-11 17:38     ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444544952-32408-8-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox