pyzkiln_core/zutils/fsutils.py
def bpxwmigf(source_zfs_name: str, target_zfs_name: str, source_zfs_renamed: str):
    """
    Issue bpxwmigf command to migrate one ZFS to another.

        Parameters:
               source_zfs_name (str): name of the ZFS currently in use that needs changed
               target_zfs_name (str): name of the ZFS to copy the contents of source_zfs_name into
            source_zfs_renamed (str): the new name of source_zfs_name after the swap
        Returns:
            Resulting output of bpxwmigf command
        Note:
            This command requires superuser authority.
            It will also rename target_zfs_name to source_zfs_name automatically and
            complete the content swap for you. Naming changes will be transparent to the user.
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=SSLTBW_2.4.0/com.ibm.zos.v2r4.bpxa500/shell_bpxwmigf.htm
    """
    logging.info("bpxwmigf will run as follows: ")
    logging.info(f"bpxwmigf -source {source_zfs_name} -target {target_zfs_name} " +
          f"-srename {source_zfs_renamed} -trename {source_zfs_name} -swap")

    if dry_run_flag:
        logging.info("DRY RUN COMMAND: see above")
        return 0
    else:
        bpxwmigf_cmd = subprocess.run(
            [
                "bpxwmigf",
                "-source",
                source_zfs_name,
                "-target",
                target_zfs_name,
                "-srename",
                source_zfs_renamed,
                "-trename",
                source_zfs_name,
                "-swap"
            ],
            capture_output=True
        )

        time.sleep(int(config.get('TimingSection', 'time.bpxwmigf_sleep')))
        if bpxwmigf_cmd.returncode != 0:
            logging.error(f"RC={bpxwmigf_cmd.returncode}")
            logging.error("The bpxwmigf command's return code was non-zero indicating an error.")
            logging.error("Please refer to the output below for an explanation of the error.")
        bpxwmigf_cmd = str(bpxwmigf_cmd.stdout)
        return bpxwmigf_cmd

    Issue bpxwmigf command to migrate one ZFS to another.

        Parameters:
               source_zfs_name (str): name of the ZFS currently in use that needs changed
               target_zfs_name (str): name of the ZFS to copy the contents of source_zfs_name into
            source_zfs_renamed (str): the new name of source_zfs_name after the swap
        Returns:
            Resulting output of bpxwmigf command
        Note:
            This command requires superuser authority.
            It will also rename target_zfs_name to source_zfs_name automatically and
            complete the content swap for you. Naming changes will be transparent to the user.
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=SSLTBW_2.4.0/com.ibm.zos.v2r4.bpxa500/shell_bpxwmigf.htm
    
Issue bpxwmigf command to migrate one ZFS to another.
Issue bpxwmigf command to migrate one ZFS to another .
def bpxwmigf(source_zfs_name: str, target_zfs_name: str, source_zfs_renamed: str):
    logging.info("bpxwmigf will run as follows: ")
    logging.info(f"bpxwmigf -source {source_zfs_name} -target {target_zfs_name} " +
          f"-srename {source_zfs_renamed} -trename {source_zfs_name} -swap")
    if dry_run_flag:
        logging.info("DRY RUN COMMAND: see above")
        return 0
    else:
        bpxwmigf_cmd = subprocess.run(
            [
                "bpxwmigf",
                "-source",
                source_zfs_name,
                "-target",
                target_zfs_name,
                "-srename",
                source_zfs_renamed,
                "-trename",
                source_zfs_name,
                "-swap"
            ],
            capture_output=True
        )
        time.sleep(int(config.get('TimingSection', 'time.bpxwmigf_sleep')))
        if bpxwmigf_cmd.returncode != 0:
            logging.error(f"RC={bpxwmigf_cmd.returncode}")
            logging.error("The bpxwmigf command's return code was non-zero indicating an error.")
            logging.error("Please refer to the output below for an explanation of the error.")
        bpxwmigf_cmd = str(bpxwmigf_cmd.stdout)
        return bpxwmigf_cmd
def bpxwmigf ( source_zfs_name : str , target_zfs_name : str , source_zfs_renamed : str ) : logging . info ( "bpxwmigf will run as follows: " ) logging . info ( f"bpxwmigf -source {source_zfs_name} -target {target_zfs_name} " + f"-srename {source_zfs_renamed} -trename {source_zfs_name} -swap" ) if dry_run_flag : logging . info ( "DRY RUN COMMAND: see above" ) return 0 else : bpxwmigf_cmd = subprocess . run ( [ "bpxwmigf" , "-source" , source_zfs_name , "-target" , target_zfs_name , "-srename" , source_zfs_renamed , "-trename" , source_zfs_name , "-swap" ] , capture_output = True ) time . sleep ( int ( config . get ( 'TimingSection' , 'time.bpxwmigf_sleep' ) ) ) if bpxwmigf_cmd . returncode != 0 : logging . error ( f"RC={bpxwmigf_cmd.returncode}" ) logging . error ( "The bpxwmigf command's return code was non-zero indicating an error." ) logging . error ( "Please refer to the output below for an explanation of the error." ) bpxwmigf_cmd = str ( bpxwmigf_cmd . stdout ) return bpxwmigf_cmd
Issue bpxwmigf command to migrate one ZFS to another.
Issue bpxwmigf command to migrate one ZFS to another .
"""
    Issue bpxwmigf command to migrate one ZFS to another.

        Parameters:
               source_zfs_name (str): name of the ZFS currently in use that needs changed
               target_zfs_name (str): name of the ZFS to copy the contents of source_zfs_name into
            source_zfs_renamed (str): the new name of source_zfs_name after the swap
        Returns:
            Resulting output of bpxwmigf command
        Note:
            This command requires superuser authority.
            It will also rename target_zfs_name to source_zfs_name automatically and
            complete the content swap for you. Naming changes will be transparent to the user.
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=SSLTBW_2.4.0/com.ibm.zos.v2r4.bpxa500/shell_bpxwmigf.htm
    """
source_zfs_name
str
target_zfs_name
str
source_zfs_renamed
str