[Kimchi-devel] [PATCH] Python: Do not allow lines longer than 79 characters

Crístian Viana vianac at linux.vnet.ibm.com
Wed Jan 22 12:56:53 UTC 2014


In order to make the code more consistent, set a maximum of 79
characters per line in Python files.

Signed-off-by: Crístian Viana <vianac at linux.vnet.ibm.com>
---
 src/kimchi/__init__.py    |  2 +-
 src/kimchi/mockmodel.py   | 26 ++++++++-----
 src/kimchi/model.py       | 99 ++++++++++++++++++++++++++++-------------------
 src/kimchi/objectstore.py |  5 ++-
 src/kimchi/osinfo.py      | 20 ++++++----
 src/kimchi/scan.py        | 13 ++++---
 src/kimchi/screenshot.py  |  5 ++-
 src/kimchi/sslcert.py     |  2 +-
 src/kimchi/template.py    |  5 ++-
 src/kimchi/utils.py       |  2 +-
 src/kimchi/vmtemplate.py  | 12 ++++--
 src/kimchi/vnc.py         |  2 +-
 tests/test_exception.py   |  2 +-
 tests/test_osinfo.py      |  5 ++-
 tests/test_server.py      |  2 +-
 tests/test_vmtemplate.py  |  2 +-
 16 files changed, 123 insertions(+), 81 deletions(-)

diff --git a/src/kimchi/__init__.py b/src/kimchi/__init__.py
index c6140fb..88db14f 100644
--- a/src/kimchi/__init__.py
+++ b/src/kimchi/__init__.py
@@ -19,4 +19,4 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 4ef3fa6..37507b8 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import cherrypy
 import copy
@@ -61,7 +61,8 @@ class MockModel(object):
         self.distros = self._get_distros()
 
     def get_capabilities(self):
-        return {'libvirt_stream_protocols': ['http', 'https', 'ftp', 'ftps', 'tftp'],
+        return {'libvirt_stream_protocols': ['http', 'https', 'ftp', 'ftps',
+                                             'tftp'],
                 'qemu_stream': True,
                 'screenshot': True,
                 'system_report_tool': True}
@@ -208,10 +209,12 @@ class MockModel(object):
         ident = name
 
         new_storagepool = new_t.get(u'storagepool', '')
+        new_name = kimchi.model.pool_name_from_uri(new_storagepool)
         try:
-            self._get_storagepool(kimchi.model.pool_name_from_uri(new_storagepool))
+            self._get_storagepool(new_name)
         except Exception as e:
-            raise InvalidParameter("Storagepool specified is not valid: %s." % e.message)
+            raise InvalidParameter("Storagepool specified is not valid: %s." %
+                                   e.message)
 
         for net_name in params.get(u'networks', []):
             try:
@@ -303,7 +306,8 @@ class MockModel(object):
                 pool.info['autostart'] = False
         except KeyError, item:
             raise MissingParameter(item)
-        if name in self._mock_storagepools or name in (kimchi.model.ISO_POOL_NAME,):
+        if (name in self._mock_storagepools or
+            name in (kimchi.model.ISO_POOL_NAME,)):
             raise InvalidOperation("StoragePool already exists")
         self._mock_storagepools[name] = pool
         return name
@@ -605,9 +609,11 @@ class MockVMTemplate(VMTemplate):
         try:
             pool = self.model._get_storagepool(pool_name)
         except NotFoundError:
-            raise InvalidParameter('Storage specified by template does not exist')
+            raise InvalidParameter('Storage specified by template does '
+                                   'not exist')
         if pool.info['state'] != 'active':
-            raise InvalidParameter('Storage specified by template is not active')
+            raise InvalidParameter('Storage specified by template is '
+                                   'not active')
 
         return pool
 
@@ -634,13 +640,15 @@ class MockVM(object):
         self.networks = template_info['networks']
         self.info = {'state': 'shutoff',
                      'stats': "{'cpu_utilization': 20, 'net_throughput' : 35, \
-                                'net_throughput_peak': 100, 'io_throughput': 45, \
+                                'net_throughput_peak': 100, \
+                                'io_throughput': 45, \
                                 'io_throughput_peak': 100}",
                      'uuid': self.uuid,
                      'memory': template_info['memory'],
                      'cpus': template_info['cpus'],
                      'icon': None,
-                     'graphics': {'type': 'vnc', 'listen': '0.0.0.0', 'port': None}
+                     'graphics': {'type': 'vnc', 'listen': '0.0.0.0',
+                                  'port': None}
                      }
         self.info['graphics'].update(template_info['graphics'])
 
diff --git a/src/kimchi/model.py b/src/kimchi/model.py
index ea528c6..60cc092 100644
--- a/src/kimchi/model.py
+++ b/src/kimchi/model.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import cherrypy
 import copy
@@ -64,7 +64,8 @@ from kimchi import xmlutils
 from kimchi.asynctask import AsyncTask
 from kimchi.distroloader import DistroLoader
 from kimchi.exception import InvalidOperation, InvalidParameter, IsoFormatError
-from kimchi.exception import MissingParameter, NotFoundError, OperationFailed, TimeoutExpired
+from kimchi.exception import MissingParameter, NotFoundError, OperationFailed
+from kimchi.exception import TimeoutExpired
 from kimchi.featuretests import FeatureTests
 from kimchi.iscsi import TargetClient
 from kimchi.isoinfo import IsoImage
@@ -155,7 +156,8 @@ class Model(object):
         # Please add new possible debug report command here
         # and implement the report generating function
         # based on the new report command
-        self.report_tools = ({'cmd': 'sosreport --help', 'fn': self._sosreport_generate},
+        self.report_tools = ({'cmd': 'sosreport --help',
+                              'fn': self._sosreport_generate},
                              {'cmd': 'supportconfig -h', 'fn':None},
                              {'cmd': 'linuxexplorers --help', 'fn':None})
 
@@ -185,18 +187,18 @@ class Model(object):
             try:
                 net = conn.networkDefineXML(xml)
             except libvirt.libvirtError, e:
-                cherrypy.log.error(
-                    "Fatal: Cannot create default network because of %s, exit kimchid" % e.message,
-                    severity=logging.ERROR)
+                cherrypy.log.error("Fatal: Cannot create default network "
+                                   "because of %s, exit kimchid" %
+                                   e.message, severity=logging.ERROR)
                 sys.exit(1)
 
         if net.isActive() == 0:
             try:
                 net.create()
             except libvirt.libvirtError, e:
-                cherrypy.log.error(
-                    "Fatal: Cannot activate default network because of %s, exit kimchid" % e.message,
-                    severity=logging.ERROR)
+                cherrypy.log.error("Fatal: Cannot activate default network "
+                                   "because of %s, exit kimchid" %
+                                   e.message, severity=logging.ERROR)
                 sys.exit(1)
 
     def _default_pool_check(self):
@@ -210,9 +212,9 @@ class Model(object):
             pass
         except OperationFailed as e:
             # path used by other pool or other reasons of failure, exit
-            cherrypy.log.error(
-                "Fatal: Cannot create default pool because of %s, exit kimchid" % e.message,
-                severity=logging.ERROR)
+            cherrypy.log.error("Fatal: Cannot create default pool because of "
+                               "%s, exit kimchid" %
+                               e.message, severity=logging.ERROR)
             sys.exit(1)
 
         if self.storagepool_lookup('default')['state'] == 'inactive':
@@ -349,8 +351,10 @@ class Model(object):
         rate = rd_stats + wr_stats
         max_disk_io = round(max(currentMaxDiskRate, int(rate)), 1)
 
-        self.stats[vm_uuid].update({'disk_io': rate, 'max_disk_io': max_disk_io,
-                                 'diskRdKB': diskRdKB, 'diskWrKB': diskWrKB})
+        self.stats[vm_uuid].update({'disk_io': rate,
+                                   'max_disk_io': max_disk_io,
+                                   'diskRdKB': diskRdKB,
+                                   'diskWrKB': diskWrKB})
 
     def debugreport_lookup(self, name):
         path = config.get_debugreports_path()
@@ -477,12 +481,14 @@ class Model(object):
 
         for key, val in params.items():
             if key in VM_STATIC_UPDATE_PARAMS:
-                new_xml = xmlutils.xml_item_update(new_xml, VM_STATIC_UPDATE_PARAMS[key], val)
+                staticVal = VM_STATIC_UPDATE_PARAMS[key]
+                new_xml = xmlutils.xml_item_update(new_xml, staticVal, val)
 
         try:
             if 'name' in params:
                 if state == 'running':
-                    raise InvalidParameter("vm name can just updated when vm shutoff")
+                    raise InvalidParameter("vm name can just updated when "
+                                           "vm shutoff")
                 else:
                     dom.undefine()
             conn = self.conn.get()
@@ -506,7 +512,8 @@ class Model(object):
         info = dom.info()
         state = Model.dom_state_map[info[0]]
         screenshot = None
-        graphics_type, graphics_listen, graphics_port = self._vm_get_graphics(name)
+        graphics = self._vm_get_graphics(name)
+        graphics_type, graphics_listen, graphics_port = graphics
         graphics_port = graphics_port if state == 'running' else None
         try:
             if state == 'running':
@@ -628,7 +635,8 @@ class Model(object):
         t = self._get_template(t_name, vm_overrides)
 
         if not self.qemu_stream and t.info.get('iso_stream', False):
-            raise InvalidOperation("Remote ISO image is not supported by this server.")
+            raise InvalidOperation("Remote ISO image is not supported by "
+                                   "this server.")
 
         t.validate()
         vol_list = t.fork_vm_storage(vm_uuid)
@@ -639,7 +647,7 @@ class Model(object):
             with self.objstore as session:
                 session.store('vm', vm_uuid, {'icon': icon})
 
-        libvirt_stream = False if len(self.libvirt_stream_protocols) == 0 else True
+        libvirt_stream = len(self.libvirt_stream_protocols) != 0
         graphics = params.get('graphics')
 
         xml = t.to_vm_xml(name, vm_uuid,
@@ -718,7 +726,8 @@ class Model(object):
         try:
             self._get_storagepool(pool_name_from_uri(new_storagepool))
         except Exception as e:
-            raise InvalidParameter("Storagepool specified is not valid: %s." % e.message)
+            raise InvalidParameter("Storagepool specified is not valid: %s." %
+                                   e.message)
 
         for net_name in params.get(u'networks', []):
             try:
@@ -1041,7 +1050,8 @@ class Model(object):
             with self.objstore as session:
                 session.delete('scanning', pool_name)
         except Exception, e:
-            kimchi_log.debug("Exception %s occured when cleaning scan result" % e.message)
+            kimchi_log.debug("Exception %s occured when cleaning scan result" %
+                             e.message)
 
     def _do_deep_scan(self, params):
         scan_params = dict(ignore_list=[])
@@ -1054,10 +1064,11 @@ class Model(object):
                 if res['state'] == 'active':
                     scan_params['ignore_list'].append(res['path'])
             except Exception, e:
-                kimchi_log.debug("Exception %s occured when get ignore path" % e.message)
+                kimchi_log.debug("Exception %s occured when get ignore path" %
+                                 e.message)
 
-        params['path'] = scan_params['pool_path'] = self.scanner.scan_dir_prepare(
-            params['name'])
+        path = self.scanner.scan_dir_prepare(params['name'])
+        params['path'] = scan_params['pool_path'] = path
         task_id = self.add_task('', self.scanner.start_scan, scan_params)
         # Record scanning-task/storagepool mapping for future querying
         with self.objstore as session:
@@ -1252,8 +1263,8 @@ class Model(object):
                 bootable = True
             except IsoFormatError:
                 bootable = False
-            res.update(
-                dict(os_distro=os_distro, os_version=os_version, path=path, bootable=bootable))
+            res.update(dict(os_distro=os_distro, os_version=os_version,
+                            path=path, bootable=bootable))
 
         return res
 
@@ -1315,7 +1326,8 @@ class Model(object):
     def _sosreport_generate(self, cb, name):
         command = 'sosreport --batch --name "%s"' % name
         try:
-            retcode = subprocess.call(command, shell=True, stdout=subprocess.PIPE)
+            retcode = subprocess.call(command, shell=True,
+                                      stdout=subprocess.PIPE)
             if retcode < 0:
                 raise OperationFailed('Command terminated with signal')
             elif retcode > 0:
@@ -1360,7 +1372,8 @@ class Model(object):
         for helper_tool in self.report_tools:
             try:
                 retcode = subprocess.call(helper_tool['cmd'], shell=True,
-                                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+                                          stdout=subprocess.PIPE,
+                                          stderr=subprocess.PIPE)
                 if retcode == 0:
                     return helper_tool['fn']
             except Exception, e:
@@ -1450,9 +1463,11 @@ class LibvirtVMTemplate(VMTemplate):
             conn = self.conn.get()
             pool = conn.storagePoolLookupByName(pool_name)
         except libvirt.libvirtError:
-            raise InvalidParameter('Storage specified by template does not exist')
+            raise InvalidParameter('Storage specified by template does '
+                                   'not exist')
         if not pool.isActive():
-            raise InvalidParameter('Storage specified by template is not active')
+            raise InvalidParameter('Storage specified by template is '
+                                   'not active')
 
         return pool
 
@@ -1463,9 +1478,11 @@ class LibvirtVMTemplate(VMTemplate):
                 conn = self.conn.get()
                 network = conn.networkLookupByName(name)
             except libvirt.libvirtError:
-                raise InvalidParameter('Network specified by template does not exist')
+                raise InvalidParameter('Network specified by template does '
+                                       'not exist')
             if not network.isActive():
-                raise InvalidParameter('Network specified by template is not active')
+                raise InvalidParameter('Network specified by template is '
+                                       'not active')
 
     def _get_storage_path(self):
         pool = self._storage_validate()
@@ -1582,7 +1599,8 @@ class NetfsPoolDef(StoragePoolDef):
                 run_command(mount_cmd, 30)
                 rollback.prependDefer(run_command, umount_cmd)
             except TimeoutExpired:
-                raise InvalidParameter("Export path %s may block during nfs mount" % export_path)
+                raise InvalidParameter("Export path %s may block during "
+                                       "nfs mount" % export_path)
 
             with open("/proc/mounts" , "rb") as f:
                 rawMounts = f.read()
@@ -1593,8 +1611,8 @@ class NetfsPoolDef(StoragePoolDef):
                     mounted =  True
 
             if not mounted:
-                raise InvalidParameter(
-                    "Export path %s mount failed during nfs mount" % export_path)
+                raise InvalidParameter("Export path %s mount failed during "
+                                       "nfs mount" % export_path)
 
     @property
     def xml(self):
@@ -1773,8 +1791,8 @@ class LibvirtConnection(object):
     def get_wrappable_objects(self):
         """
         When a wrapped function returns an instance of another libvirt object,
-        we also want to wrap that object so we can catch errors that happen when
-        calling its methods.
+        we also want to wrap that object so we can catch errors that happen
+        when calling its methods.
         """
         objs = []
         for name in ('virDomain', 'virDomainSnapshot', 'virInterface',
@@ -1830,7 +1848,8 @@ class LibvirtConnection(object):
                     except libvirt.libvirtError:
                         kimchi_log.error('Unable to connect to libvirt.')
                         if not retries:
-                            kimchi_log.error('Libvirt is not available, exiting.')
+                            kimchi_log.error('Libvirt is not available, '
+                                             'exiting.')
                             cherrypy.engine.stop()
                             raise
                     time.sleep(2)
@@ -1847,8 +1866,8 @@ class LibvirtConnection(object):
                             setattr(cls, name, wrapMethod(method))
 
                 self._connections[conn_id] = conn
-                # In case we're running into troubles with keeping the connections
-                # alive we should place here:
+                # In case we're running into troubles with keeping the
+                # connections alive we should place here:
                 # conn.setKeepAlive(interval=5, count=3)
                 # However the values need to be considered wisely to not affect
                 # hosts which are hosting a lot of virtual machines
diff --git a/src/kimchi/objectstore.py b/src/kimchi/objectstore.py
index 7b567f3..cd25338 100644
--- a/src/kimchi/objectstore.py
+++ b/src/kimchi/objectstore.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import json
 import sqlite3
@@ -107,7 +107,8 @@ class ObjectStore(object):
         try:
             return self._connections[ident]
         except KeyError:
-            self._connections[ident] = sqlite3.connect(self.location, timeout=10)
+            self._connections[ident] = sqlite3.connect(self.location,
+                                                       timeout=10)
             if len(self._connections.keys()) > 10:
                 id, conn = self._connections.popitem(last=False)
                 conn.interrupt()
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index f92db3d..d4807f6 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import copy
 import os
@@ -56,18 +56,24 @@ modern_version_bases = {'debian': '6.0', 'ubuntu': '7.10', 'opensuse': '10.3',
 
 isolinks = {
     'debian': {
-        'squeeze': 'http://cdimage.debian.org/debian-cd/6.0.7-live/amd64/iso-hybrid/debian-live-6.0.7-amd64-gnome-desktop.iso',
+        'squeeze': 'http://cdimage.debian.org/debian-cd/6.0.7-live/amd64/'
+                   'iso-hybrid/debian-live-6.0.7-amd64-gnome-desktop.iso',
     },
     'ubuntu': {
-        'raring': 'http://ubuntu-releases.cs.umn.edu/13.04/ubuntu-13.04-desktop-amd64.iso',
+        'raring': 'http://ubuntu-releases.cs.umn.edu/13.04/'
+                  'ubuntu-13.04-desktop-amd64.iso',
     },
     'opensuse': {
-        '12.3': 'http://suse.mirrors.tds.net/pub/opensuse/distribution/12.3/iso/openSUSE-12.3-DVD-x86_64.iso',
+        '12.3': 'http://suse.mirrors.tds.net/pub/opensuse/distribution/12.3/'
+                'iso/openSUSE-12.3-DVD-x86_64.iso',
     },
     'fedora': {
-        '16': 'http://fedora.mirrors.tds.net/pub/fedora/releases/16/Live/x86_64/Fedora-16-x86_64-Live-Desktop.iso',
-        '17': 'http://fedora.mirrors.tds.net/pub/fedora/releases/17/Live/x86_64/Fedora-17-x86_64-Live-Desktop.iso',
-        '18': 'http://fedora.mirrors.tds.net/pub/fedora/releases/18/Live/x86_64/Fedora-18-x86_64-Live-Desktop.iso',
+        '16': 'http://fedora.mirrors.tds.net/pub/fedora/releases/16/Live/'
+              'x86_64/Fedora-16-x86_64-Live-Desktop.iso',
+        '17': 'http://fedora.mirrors.tds.net/pub/fedora/releases/17/Live/'
+              'x86_64/Fedora-17-x86_64-Live-Desktop.iso',
+        '18': 'http://fedora.mirrors.tds.net/pub/fedora/releases/18/Live/'
+              'x86_64/Fedora-18-x86_64-Live-Desktop.iso',
     },
 }
 
diff --git a/src/kimchi/scan.py b/src/kimchi/scan.py
index e192f01..5a642b4 100644
--- a/src/kimchi/scan.py
+++ b/src/kimchi/scan.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
 import glob
@@ -59,8 +59,8 @@ class Scanner(object):
                     shutil.rmtree(d)
                     self.clean_cb(transient_pool)
         except OSError as e:
-            kimchi_log.debug(
-                    "Exception %s occured when cleaning stale pool, ignore" % e.message)
+            kimchi_log.debug("Exception %s occured when cleaning stale pool, "
+                             "ignore" % e.message)
 
     def scan_dir_prepare(self, name):
         # clean stale scan storage pools
@@ -73,11 +73,12 @@ class Scanner(object):
 
             duplicates = "%s/%s*" % (params['pool_path'], iso_name)
             for f in glob.glob(duplicates):
-                iso_img = IsoImage(f)
-                if (iso_info['distro'], iso_info['version']) == iso_img.probe():
+                img = IsoImage(f)
+                if (iso_info['distro'], iso_info['version']) == img.probe():
                     return
 
-            iso_path = iso_name + hashlib.md5(iso_info['path']).hexdigest() + '.iso'
+            iso_path = (iso_name + hashlib.md5(iso_info['path']).hexdigest() +
+                       '.iso')
             link_name = os.path.join(params['pool_path'],
                                      os.path.basename(iso_path))
             os.symlink(iso_info['path'], link_name)
diff --git a/src/kimchi/screenshot.py b/src/kimchi/screenshot.py
index 5cfea96..b886153 100644
--- a/src/kimchi/screenshot.py
+++ b/src/kimchi/screenshot.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
 import glob
@@ -70,7 +70,8 @@ class VMScreenshot(object):
         if now - last_update > self.OUTDATED_SECS:
             self._clean_extra(self.LIVE_WINDOW)
             self._generate_thumbnail()
-        return '/data/screenshots/%s' % os.path.basename(self.info['thumbnail'])
+        return ('/data/screenshots/%s' %
+               os.path.basename(self.info['thumbnail']))
 
 
     def _clean_extra(self, window=-1):
diff --git a/src/kimchi/sslcert.py b/src/kimchi/sslcert.py
index 529699d..45f1d4d 100644
--- a/src/kimchi/sslcert.py
+++ b/src/kimchi/sslcert.py
@@ -23,7 +23,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import time
 
diff --git a/src/kimchi/template.py b/src/kimchi/template.py
index 1f19c4a..b611051 100644
--- a/src/kimchi/template.py
+++ b/src/kimchi/template.py
@@ -19,7 +19,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import cherrypy
 import errno
@@ -83,7 +83,8 @@ def can_accept_html():
 
 def render(resource, data):
     if can_accept('application/json'):
-        cherrypy.response.headers['Content-Type'] = 'application/json;charset=utf-8'
+        cherrypy.response.headers['Content-Type'] = ('application/json;'
+                                                    'charset=utf-8')
         return json.dumps(data, indent=2,
                           separators=(',', ':'),
                           encoding='iso-8859-1')
diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index 5d6e8ea..b99aa46 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
 import cherrypy
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 58147e3..c12a286 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import os
 import string
@@ -58,7 +58,8 @@ class VMTemplate(object):
 
             iso_prefixes = ['/', 'http', 'https', 'ftp', 'ftps', 'tftp']
             if len(filter(iso.startswith, iso_prefixes)) == 0:
-                raise InvalidParameter("Invalid parameter specified for cdrom.")
+                raise InvalidParameter("Invalid parameter specified "
+                                       "for cdrom.")
 
             if not iso.startswith('/'):
                 self.info.update({'iso_stream': True})
@@ -111,9 +112,12 @@ class VMTemplate(object):
         qemu_stream_cmdline = """
             <qemu:commandline>
               <qemu:arg value='-drive'/>
-              <qemu:arg value='file=%(url)s,if=none,id=drive-%(bus)s0-1-0,readonly=on,format=raw'/>
+              <qemu:arg value='file=%(url)s,
+                               if=none,id=drive-%(bus)s0-1-0,readonly=on,
+                               format=raw'/>
               <qemu:arg value='-device'/>
-              <qemu:arg value='%(bus)s-cd,bus=%(bus)s.1,unit=0,drive=drive-%(bus)s0-1-0,id=%(bus)s0-1-0'/>
+              <qemu:arg value='%(bus)s-cd,bus=%(bus)s.1,unit=0,
+                               drive=drive-%(bus)s0-1-0,id=%(bus)s0-1-0'/>
             </qemu:commandline>
         """
 
diff --git a/src/kimchi/vnc.py b/src/kimchi/vnc.py
index 780be70..129f3b1 100644
--- a/src/kimchi/vnc.py
+++ b/src/kimchi/vnc.py
@@ -19,7 +19,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import errno
 import os
diff --git a/tests/test_exception.py b/tests/test_exception.py
index df1f507..e83d6b4 100644
--- a/tests/test_exception.py
+++ b/tests/test_exception.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import json
 import os
diff --git a/tests/test_osinfo.py b/tests/test_osinfo.py
index 0f88a35..38344c1 100644
--- a/tests/test_osinfo.py
+++ b/tests/test_osinfo.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import unittest
 
@@ -34,7 +34,8 @@ class OSInfoTests(unittest.TestCase):
         self.assertEquals(['default'], entry['networks'])
 
     def test_fedora_lookup(self):
-        cd = 'http://fedora.mirrors.tds.net/pub/fedora/releases/17/Live/x86_64/Fedora-17-x86_64-Live-Desktop.iso'
+        cd = ('http://fedora.mirrors.tds.net/pub/fedora/releases/17/Live/'
+              'x86_64/Fedora-17-x86_64-Live-Desktop.iso')
         entry = lookup('fedora', '17')
         self.assertEquals(10, entry['disks'][0]['size'])
         self.assertEquals(cd, entry['cdrom'])
diff --git a/tests/test_server.py b/tests/test_server.py
index 734a618..6299850 100644
--- a/tests/test_server.py
+++ b/tests/test_server.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import json
 import os
diff --git a/tests/test_vmtemplate.py b/tests/test_vmtemplate.py
index ee20dbf..bb74169 100644
--- a/tests/test_vmtemplate.py
+++ b/tests/test_vmtemplate.py
@@ -18,7 +18,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 
 import unittest
 import uuid
-- 
1.8.4.2




More information about the Kimchi-devel mailing list