Skip to content

Commit

Permalink
Fix pylint errors in rescue.py.
Browse files Browse the repository at this point in the history
Redefine open to iutil's better open, fix the passing of format
parameters to a translated string, use iutil.setenv to add environment
variables for future child processes instead of modifying the current
process's environment, and ignore the warning about catching Exception.
  • Loading branch information
dashea committed Jul 20, 2015
1 parent 767cda7 commit 96333e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyanaconda/rescue.py
Expand Up @@ -34,6 +34,8 @@

from pykickstart.constants import KS_REBOOT, KS_SHUTDOWN

from pyanaconda.iutil import open # pylint: disable=redefined-builtin

import os
import shutil
import time
Expand Down Expand Up @@ -341,8 +343,8 @@ def refresh(self, args=None):
else:
text = TextWidget(_("Your system has been mounted under %s.\n\nIf "
"you would like to make your system the root "
"environment, run the command:\n\n\tchroot %s\n"
% (iutil.getSysroot(), iutil.getSysroot())))
"environment, run the command:\n\n\tchroot %s\n")
% (iutil.getSysroot(), iutil.getSysroot()))
self._window.append(text)
rootmounted = True

Expand All @@ -366,7 +368,7 @@ def refresh(self, args=None):
# set a libpath to use mounted fs
libdirs = os.environ.get("LD_LIBRARY_PATH", "").split(":")
mounted = list(map(lambda dir: "/mnt/sysimage%s" % dir, libdirs))
os.environ["LD_LIBRARY_PATH"] = ":".join(libdirs + mounted)
iutil.setenv("LD_LIBRARY_PATH", ":".join(libdirs + mounted))

# do we have bash?
try:
Expand All @@ -376,7 +378,7 @@ def refresh(self, args=None):
pass
except (ValueError, LookupError, SyntaxError, NameError):
pass
except Exception as e:
except Exception as e: # pylint: disable=broad-except
if flags.automatedInstall:
msg = _("Run %s to unmount the system when you are finished.\n") % ANACONDA_CLEANUP

Expand Down

0 comments on commit 96333e1

Please sign in to comment.