#5717 Consider removing our implementation of CalledProcessError
Closed: Fixed None Opened 8 years ago by mbabinsk.

ipapython.ipautil module contains the following code implementing CalledProcessError for Python 2.4 and earlier:

try:
    from subprocess import CalledProcessError
except ImportError:
    # Python 2.4 doesn't implement CalledProcessError
    class CalledProcessError(Exception):
        """This exception is raised when a process run by check_call() returns
        a non-zero exit status. The exit status will be stored in the
        returncode attribute."""
        def __init__(self, returncode, cmd, output=None):
            self.returncode = returncode
            self.cmd = cmd
            self.output = output
        def __str__(self):
            return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)

I think we may remove this code since Python versions prior to 2.5 are encountered extremely rarely on some legacy systems. If that is not the case close the ticket as WONTFIX.


triage comments:

  • ab: I'm fine with this particularly because we are moving to a different client implementation and the server side anyway will work on 2.7+ (Samba Python bindings require 2.6+)
  • mkosek: ok. We require Python 2.7+

master:

  • 51db938 Removed custom implementation of CalledProcessError

Metadata Update from @mbabinsk:
- Issue assigned to akasurde
- Issue set to the milestone: FreeIPA 4.4

7 years ago

Login to comment on this ticket.

Metadata