예제 #1
0
def generateCramFSImage(expandedPath, imagePath):
    """
    Creates a CramFS based image
    """
    program_exists ('mkfs.cramfs')
    ret = subprocess.call(["mkfs.cramfs", expandedPath, imagePath], stdout=fdnull, stderr=fdnull)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expandedPath)
    except:
        # error handling
        pass

    return True
예제 #2
0
def generate_cramfs_image(expand_path, image_path):
    """
    Creates a CramFS based image
    """
    program_exists('mkfs.cramfs')
    cmd = ["mkfs.cramfs", expand_path, image_path]
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        # error handling
        pass

    return True
예제 #3
0
파일: converters.py 프로젝트: bne86/shifter
def generate_cramfs_image(expand_path, image_path):
    """
    Creates a CramFS based image
    """
    program_exists('mkfs.cramfs')
    cmd = ["mkfs.cramfs", expand_path, image_path]
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        # error handling
        pass

    return True
예제 #4
0
def generate_squashfs_image(expand_path, image_path):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    ret = subprocess.call(["mksquashfs", expand_path, image_path, "-all-root"])
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        pass

    return True
예제 #5
0
파일: converters.py 프로젝트: bne86/shifter
def generate_squashfs_image(expand_path, image_path):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    ret = subprocess.call(["mksquashfs", expand_path, image_path, "-all-root"])
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        pass

    return True
예제 #6
0
def generate_cramfs_image(expand_path, image_path, options):
    """
    Creates a CramFS based image
    """
    program_exists('mkfs.cramfs')
    cmd = ["mkfs.cramfs", expand_path, image_path]
    if options is not None:
        cmd.extend(options)
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        rmtree(expand_path)
    except:
        # error handling
        pass

    return True
예제 #7
0
파일: converters.py 프로젝트: NERSC/shifter
def generate_squashfs_image(expand_path, image_path, options):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    cmd = ["mksquashfs", expand_path, image_path, "-all-root"]

    if options is not None:
        cmd.extend(options)
    else:
        cmd.append('-no-xattrs')
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        shutil.rmtree(expand_path)
    except:
        pass

    return True
예제 #8
0
def generate_squashfs_image(expand_path, image_path, options):
    """
    Creates a SquashFS based image
    """
    # This will raise an exception if mksquashfs tool is not found
    # it should be handled by the calling function
    program_exists('mksquashfs')

    cmd = ["mksquashfs", expand_path, image_path, "-all-root"]

    if options is not None:
        cmd.extend(options)
    else:
        cmd.append('-no-xattrs')
    ret = subprocess.call(cmd)
    if ret != 0:
        # error handling
        pass
    try:
        rmtree(expand_path)
    except:
        pass

    return True