From d564ff00d5a7dd7413eaafb026a8df8838e50536 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 31 Dec 2015 13:05:19 +0000 Subject: Fixup pylint issues --- vmdebootstrap/filesystem.py | 4 ++-- vmdebootstrap/network.py | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'vmdebootstrap') diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py index ad7575c..c38534e 100644 --- a/vmdebootstrap/filesystem.py +++ b/vmdebootstrap/filesystem.py @@ -70,6 +70,7 @@ class Filesystem(Base): runcmd(["chown", "-R", self.settings["owner"], filename]) def update_initramfs(self): + rootdir = self.devices['rootdir'] if not rootdir: raise cliapp.AppException("rootdir not set") if not os.path.exists( @@ -78,7 +79,6 @@ class Filesystem(Base): return if not self.settings['no-update-initramfs']: return - rootdir = self.devices['rootdir'] cmd = os.path.join('usr', 'sbin', 'update-initramfs') if os.path.exists(os.path.join(str(rootdir), cmd)): self.message("Updating the initramfs") @@ -299,4 +299,4 @@ class Filesystem(Base): tmpname = self.settings['image'] + '.raw' os.rename(self.settings['image'], tmpname) runcmd(['qemu-img', 'convert', '-O', 'qcow2', - tmpname, self.settings['image']]) + tmpname, self.settings['image']]) diff --git a/vmdebootstrap/network.py b/vmdebootstrap/network.py index 740dede..115b5c3 100644 --- a/vmdebootstrap/network.py +++ b/vmdebootstrap/network.py @@ -4,25 +4,25 @@ # -*- coding: utf-8 -*- # # network.py -# +# # Copyright 2015 Neil Williams -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -# -# +# +# import os from vmdebootstrap.base import ( @@ -41,6 +41,7 @@ class Networking(Base): self.message('Setting up networking') ifc_d = os.path.join(rootdir, 'etc', 'network', 'interfaces.d') ifc_file = os.path.join(rootdir, 'etc', 'network', 'interfaces') + ethpath = os.path.join(ifc_d, 'setup') with open(ifc_file, 'w') as netfile: netfile.write(line) if not os.path.exists(ifc_d): -- cgit v1.2.1