pyzkiln_core/zutils/fsutils.py
def display_filesystem_info(path_name: str):
    """
    Issue df -kvP command on the system to get relevant filesystem info.

        Parameters:
            path_name (str): file name or directory to get information for
        Returns:
            Python dictionary containing results of the df -kvP omvs command
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=scd-df-display-amount-free-space-in-file-system
    """
    fsinfo_results_dic = {}

    fsinfo_cmd = subprocess.run(
        ["df", "-kvP", path_name], capture_output=True
    )

    if fsinfo_cmd.returncode != 0:
        logging.error(f"RC={fsinfo_cmd.returncode}")
        logging.error("The df -kvP command's return code was non-zero indicating an error.")
        logging.error("Please refer to the output below for an explanation of the error.")
        fsinfo_cmd = str(fsinfo_cmd.stderr)
        logging.error(fsinfo_cmd)
        return fsinfo_cmd

    fsinfo_cmd = str(fsinfo_cmd.stdout)
    fsinfo = fsinfo_cmd.strip().split("\\n")
    # Iterate over each line of the output to make adjustments to
    # turn into a Python dictionary
    for linew in fsinfo[3:]:
        linew = re.split(r": |\s\s\s", linew)

        # remove empty entries in the list
        while "" in linew:
            linew.remove("")

        # add to Python dictionary
        fsinfo_results_dic.update(dict(zip(linew[::2], linew[1::2])))

    return fsinfo_results_dic

    Issue df -kvP command on the system to get relevant filesystem info.

        Parameters:
            path_name (str): file name or directory to get information for
        Returns:
            Python dictionary containing results of the df -kvP omvs command
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=scd-df-display-amount-free-space-in-file-system
    
Issue df -kvP command on the system to get relevant filesystem info.
Issue df - kvP command on the system to get relevant filesystem info .
def display_filesystem_info(path_name: str):
    fsinfo_results_dic = {}
    fsinfo_cmd = subprocess.run(
        ["df", "-kvP", path_name], capture_output=True
    )
    if fsinfo_cmd.returncode != 0:
        logging.error(f"RC={fsinfo_cmd.returncode}")
        logging.error("The df -kvP command's return code was non-zero indicating an error.")
        logging.error("Please refer to the output below for an explanation of the error.")
        fsinfo_cmd = str(fsinfo_cmd.stderr)
        logging.error(fsinfo_cmd)
        return fsinfo_cmd
    fsinfo_cmd = str(fsinfo_cmd.stdout)
    fsinfo = fsinfo_cmd.strip().split("\\n")
    for linew in fsinfo[3:]:
        linew = re.split(r": |\s\s\s", linew)
        while "" in linew:
            linew.remove("")
        fsinfo_results_dic.update(dict(zip(linew[::2], linew[1::2])))
    return fsinfo_results_dic
def display_filesystem_info ( path_name : str ) : fsinfo_results_dic = { } fsinfo_cmd = subprocess . run ( [ "df" , "-kvP" , path_name ] , capture_output = True ) if fsinfo_cmd . returncode != 0 : logging . error ( f"RC={fsinfo_cmd.returncode}" ) logging . error ( "The df -kvP command's return code was non-zero indicating an error." ) logging . error ( "Please refer to the output below for an explanation of the error." ) fsinfo_cmd = str ( fsinfo_cmd . stderr ) logging . error ( fsinfo_cmd ) return fsinfo_cmd fsinfo_cmd = str ( fsinfo_cmd . stdout ) fsinfo = fsinfo_cmd . strip ( ) . split ( "\\n" ) for linew in fsinfo [ 3 : ] : linew = re . split ( r": |\s\s\s" , linew ) while "" in linew : linew . remove ( "" ) fsinfo_results_dic . update ( dict ( zip ( linew [ : : 2 ] , linew [ 1 : : 2 ] ) ) ) return fsinfo_results_dic
Issue df -kvP command on the system to get relevant filesystem info.
Issue df - kvP command on the system to get relevant filesystem info .
"""
    Issue df -kvP command on the system to get relevant filesystem info.

        Parameters:
            path_name (str): file name or directory to get information for
        Returns:
            Python dictionary containing results of the df -kvP omvs command
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=scd-df-display-amount-free-space-in-file-system
    """ # Iterate over each line of the output to make adjustments to # turn into a Python dictionary # remove empty entries in the list # add to Python dictionary
path_name
str