def get_checksum(file_path, sum_type):
    """Returns md5, sha1 or sha256 checksum. Uses standard
    linux tools - [md5|sha1|sha256]sum.

    :param file_path: Path to file.
    :param sum_type: Type of checksum (md5 / sha1 / sha256)
    :returns: String containing calculated checksum.
    """
    p = subprocess.Popen([sum_type + 'sum', file_path],
                         stdout=subprocess.PIPE,
                         universal_newlines=True)
    out = p.communicate()[0]
    checksum = out.split()[0]
    return checksum
Returns md5, sha1 or sha256 checksum. Uses standard
    linux tools - [md5|sha1|sha256]sum.

    :param file_path: Path to file.
    :param sum_type: Type of checksum (md5 / sha1 / sha256)
    :returns: String containing calculated checksum.
    
lisa/core/base.py