Skip to content

Commit

Permalink
Fix pylint errors in the new driver disk code.
Browse files Browse the repository at this point in the history
Related: rhbz#1084197
  • Loading branch information
clumens committed Jul 13, 2015
1 parent 6e6ba58 commit 0b6aded
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dracut/driver_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

# py2 compat
try:
from subprocess import DEVNULL
from subprocess import DEVNULL # pylint: disable=no-name-in-module
except ImportError:
DEVNULL = open("/dev/null", 'a+')
try:
Expand Down
9 changes: 4 additions & 5 deletions tests/dracut_tests/test_driver_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import unittest
try:
import unittest.mock as mock
import unittest.mock as mock # pylint: disable=import-error,no-name-in-module
except ImportError:
import mock

Expand Down Expand Up @@ -231,7 +231,7 @@ class TestSaveRepo(FileTestCaseBase):
def test_basic(self):
"""save_repo: copies a directory to /run/install/DD-X"""
makerepo(self.srcdir)
[repo] = find_repos(self.srcdir)
repo = find_repos(self.srcdir)[0]
makefile(repo+'/fake-something.rpm')
saved = save_repo(repo, target=self.destdir)
self.assertEqual(set(os.listdir(saved)), set(["fake-something.rpm"]))
Expand Down Expand Up @@ -547,7 +547,7 @@ def test_finish(self):
'''
disk_labels = {
'/dev/sdb1': 'metroid_srv',
'/dev/loop0': 'I\\x20\u262d\\x20COMMUNISM',
'/dev/loop0': u'I\\x20\u262d\\x20COMMUNISM',
'/dev/sda3': 'metroid_root'
}
devicelist = [
Expand All @@ -558,7 +558,7 @@ def test_finish(self):
DeviceInfo(DEVNAME='/dev/sda3', TYPE='btrfs', LABEL='metroid_root',
UUID='4126dbb6-c7d3-47b4-b1fc-9bb461df0067'),
DeviceInfo(DEVNAME='/dev/loop0', TYPE='ext4',
LABEL='I\\x20\u262d\\x20COMMUNISM',
LABEL=u'I\\x20\u262d\\x20COMMUNISM',
UUID='6f16967e-0388-4276-bd8d-b88e5b217a55'),
]
# also covers blkid, get_disk_labels, DeviceInfo
Expand All @@ -584,7 +584,6 @@ def test_shortdev(self):
# TODO: test TextMenu itself

# py2/3 compat
import sys
if sys.version_info.major == 3:
from io import StringIO
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ fi
: "${top_builddir:=$top_srcdir}"

if [ -z "$PYTHONPATH" ]; then
PYTHONPATH="${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib"
PYTHONPATH="${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib:${top_srcdir}/dracut"
else
PYTHONPATH="${PYTHONPATH}:${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib"
PYTHONPATH="${PYTHONPATH}:${top_builddir}/pyanaconda/isys/.libs:${top_srcdir}/pyanaconda:${top_srcdir}:${top_srcdir}/tests/lib:${top_srcdir}/dracut"
fi

if [ -z "$LD_LIBRARY_PATH" ]; then
Expand Down

0 comments on commit 0b6aded

Please sign in to comment.