def jailed_path(self, file_path, create=False):
    'Create a hard link owned by uid:gid.\n\n        Create a hard link to the specified file, changes the owner to\n        uid:gid, and returns a path to the link which is valid within the jail.\n        '
    file_name = os.path.basename(file_path)
    global_p = os.path.join(self.chroot_path(), file_name)
    jailed_p = os.path.join('/', file_name)
    if create:
        cmd = 'ln -f {} {}'.format(file_path, global_p)
        run(cmd, shell=True, check=True)
        cmd = 'chown {}:{} {}'.format(self.uid, self.gid, global_p)
        run(cmd, shell=True, check=True)
    return jailed_p
Create a hard link owned by uid:gid.

Create a hard link to the specified file, changes the owner to
uid:gid, and returns a path to the link which is valid within the jail.
def jailed_path(self, file_path, create=False):
    'Create a hard link owned by uid:gid.\n\n        Create a hard link to the specified file, changes the owner to\n        uid:gid, and returns a path to the link which is valid within the jail.\n        '
    file_name = os.path.basename(file_path)
    global_p = os.path.join(self.chroot_path(), file_name)
    jailed_p = os.path.join('/', file_name)
    if create:
        cmd = 'ln -f {} {}'.format(file_path, global_p)
        run(cmd, shell=True, check=True)
        cmd = 'chown {}:{} {}'.format(self.uid, self.gid, global_p)
        run(cmd, shell=True, check=True)
    return jailed_p