cleanup trailing spaces and extra-long lines
authorJF Ding <jian-feng.ding@intel.com>
Wed, 11 Jul 2012 06:48:42 +0000 (14:48 +0800)
committerJF Ding <jian-feng.ding@intel.com>
Wed, 11 Jul 2012 06:48:42 +0000 (14:48 +0800)
mic/imager/baseimager.py
mic/imager/fs.py
plugins/imager/fs_plugin.py
plugins/imager/livecd_plugin.py
plugins/imager/liveusb_plugin.py
plugins/imager/loop_plugin.py
plugins/imager/raw_plugin.py

index 949a39d..784d43f 100644 (file)
@@ -87,7 +87,7 @@ class BaseImageCreator(object):
                       "local_pkgs_path" : "_local_pkgs_path",
                       "copy_kernel" : "_need_copy_kernel",
                      }
-    
+
             # update setting from createopts
             for key in createopts.keys():
                 if key in optmap:
@@ -695,7 +695,9 @@ class BaseImageCreator(object):
                           ("/proc", None),
                           ("/proc/sys/fs/binfmt_misc", None),
                           ("/dev/pts", None)]:
-            self.__bindmounts.append(fs.BindChrootMount(f, self._instroot, dest))
+            self.__bindmounts.append(
+                    fs.BindChrootMount(
+                        f, self._instroot, dest))
 
         self._do_bindmounts()
 
@@ -1122,9 +1124,12 @@ class BaseImageCreator(object):
 
         if pkg == "tar":
             if comp:
-                dst = "%s/%s-%s.tar.%s" % (destdir, self.name, image_format, comp)
+                dst = "%s/%s-%s.tar.%s" %\
+                      (destdir, self.name, image_format, comp)
             else:
-                dst = "%s/%s-%s.tar" % (destdir, self.name, image_format)
+                dst = "%s/%s-%s.tar" %\
+                      (destdir, self.name, image_format)
+
             msger.info("creating %s" % dst)
             tar = tarfile.open(dst, "w:" + comp)
 
@@ -1159,7 +1164,7 @@ class BaseImageCreator(object):
         with open(config) as fr:
             with open(new_kspath, "w") as wf:
                 # When building a release we want to make sure the .ks
-                # file generates the same build even when --release= is not used.
+                # file generates the same build even when --release not used.
                 wf.write(fr.read().replace("@BUILD_ID@", release))
         outimages.append(new_kspath)
 
@@ -1194,7 +1199,7 @@ class BaseImageCreator(object):
 
                 md5sum = misc.get_md5sum(_rpath(f))
                 # There needs to be two spaces between the sum and
-                # filepath to match the syntax with md5sum. 
+                # filepath to match the syntax with md5sum.
                 # This way also md5sum -c MANIFEST can be used by users
                 wf.write("%s *%s\n" % (md5sum, f))
 
@@ -1207,7 +1212,6 @@ class BaseImageCreator(object):
 
     def copy_kernel(self):
         """ Copy kernel files to the outimage directory.
-        
         NOTE: This needs to be called before unmounting the instroot.
         """
 
@@ -1218,12 +1222,14 @@ class BaseImageCreator(object):
             os.makedirs(self.destdir)
 
         for kernel in glob.glob("%s/boot/vmlinuz-*" % self._instroot):
-            kernelfilename = "%s/%s-%s" % (self.destdir, self.name, os.path.basename(kernel))
-            msger.info('copy kernel file %s as %s' % (os.path.basename(kernel), kernelfilename))
+            kernelfilename = "%s/%s-%s" % (self.destdir,
+                                           self.name,
+                                           os.path.basename(kernel))
+            msger.info('copy kernel file %s as %s' % (os.path.basename(kernel),
+                                                      kernelfilename))
             shutil.copy(kernel, kernelfilename)
             self.outimage.append(kernelfilename)
 
-
     def copy_attachment(self):
         """ Subclass implement it to handle attachment files
 
@@ -1232,4 +1238,6 @@ class BaseImageCreator(object):
         pass
 
     def get_pkg_manager(self):
-        return self.pkgmgr(target_arch = self.target_arch, instroot = self._instroot, cachedir = self.cachedir)
+        return self.pkgmgr(target_arch = self.target_arch,
+                           instroot = self._instroot,
+                           cachedir = self.cachedir)
index 9cc4a70..e9ef00e 100644 (file)
@@ -25,8 +25,8 @@ from subprocess import call
 
 class FsImageCreator(BaseImageCreator):
     def __init__(self, cfgmgr = None, pkgmgr = None):
-        self.zips = { 
-            "tar.bz2" : "" 
+        self.zips = {
+            "tar.bz2" : ""
         }
         BaseImageCreator.__init__(self, cfgmgr, pkgmgr)
         self._fstype = None
index ebfd7a2..5988b73 100644 (file)
@@ -58,7 +58,7 @@ class FsPlugin(ImagerPlugin):
         recording_pkgs = []
         if len(creatoropts['record_pkgs']) > 0:
             recording_pkgs = creatoropts['record_pkgs']
-        
+
         if creatoropts['release'] is not None:
             if 'name' not in recording_pkgs:
                 recording_pkgs.append('name')
@@ -68,7 +68,7 @@ class FsPlugin(ImagerPlugin):
                                        creatoropts['arch'])
 
         configmgr._ksconf = ksconf
-    
+
         # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
         if creatoropts['release'] is not None:
             creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
index 01d4349..d62b20c 100644 (file)
@@ -68,7 +68,7 @@ class LiveCDPlugin(ImagerPlugin):
                                        creatoropts['arch'])
 
         configmgr._ksconf = ksconf
-    
+
         # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
         if creatoropts['release'] is not None:
             creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
index 86d1e44..97fc0bd 100644 (file)
@@ -70,7 +70,7 @@ class LiveUSBPlugin(ImagerPlugin):
                                        creatoropts['arch'])
 
         configmgr._ksconf = ksconf
-    
+
         # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
         if creatoropts['release'] is not None:
             creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
@@ -156,7 +156,7 @@ class LiveUSBPlugin(ImagerPlugin):
                 cmdline = "%s HOME=/root /bin/bash" % envcmd
             else:
                 cmdline = "/bin/bash"
-            chroot.chroot(extmnt, None, cmdline) 
+            chroot.chroot(extmnt, None, cmdline)
         except:
             raise errors.CreatorError("Failed to chroot to %s." %target)
         finally:
index 34e4563..5733453 100644 (file)
@@ -115,12 +115,12 @@ class LoopPlugin(ImagerPlugin):
             creator.mount(None, creatoropts["cachedir"])
             creator.install()
             creator.configure(creatoropts["repomd"])
-            creator.copy_kernel()            
+            creator.copy_kernel()
             creator.unmount()
             creator.package(creatoropts["outdir"])
 
             if creatoropts['release'] is not None:
-                creator.release_output(ksconf, 
+                creator.release_output(ksconf,
                                        creatoropts['outdir'],
                                        creatoropts['release'])
             creator.print_outimage_info()
index 1e481e7..30850d7 100644 (file)
@@ -73,7 +73,7 @@ class RawPlugin(ImagerPlugin):
                                        creatoropts['arch'])
 
         configmgr._ksconf = ksconf
-    
+
         # Called After setting the configmgr._ksconf as the creatoropts['name'] is reset there.
         if creatoropts['release'] is not None:
             creatoropts['outdir'] = "%s/%s/images/%s/" % (creatoropts['outdir'], creatoropts['release'], creatoropts['name'])
@@ -223,7 +223,7 @@ class RawPlugin(ImagerPlugin):
                 cmdline = "%s HOME=/root /bin/bash" % envcmd
             else:
                 cmdline = "/bin/bash"
-            chroot.chroot(imgmnt, None, cmdline) 
+            chroot.chroot(imgmnt, None, cmdline)
         except:
             raise errors.CreatorError("Failed to chroot to %s." %img)
         finally: