The freezer.engine.tar.tar_builders Module

  1. Copyright 2014,2015 Hewlett-Packard Development Company, L.P.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Freezer Tar related functions

class freezer.engine.tar.tar_builders.TarCommandBuilder(filepath, compression_algo, is_windows, tar_path=None)[source]

Bases: object

Building a tar cmd command. To build command invoke method build.

DEREFERENCE_MODE = {'all': '--hard-dereference --dereference', 'hard': '--hard-dereference', 'soft': '--dereference'}
LISTED_TEMPLATE = '{tar_command} --listed-incremental={listed_incremental}'
UNIX_TEMPLATE = '{gnutar_path} --create {algo} --warning=none --no-check-device --one-file-system --preserve-permissions --same-owner --seek --ignore-failed-read'
WINDOWS_TEMPLATE = '{gnutar_path} -c {algo} --incremental --unlink-first --ignore-zeros'
build()[source]
set_dereference(mode)[source]
Dereference hard and soft links according option choices.
‘soft’ dereference soft links, ‘hard’ dereference hardlinks, ‘all’ dereference both. Default ‘none’.
set_encryption(encrypt_pass_file, openssl_path=None)[source]
set_exclude(exclude)[source]
set_listed_incremental(absolute_path)[source]
class freezer.engine.tar.tar_builders.TarCommandRestoreBuilder(restore_path, compression_algo, is_windows, tar_path=None)[source]

Bases: object

DRY_RUN_TEMPLATE = '{0} {1} --incremental --list --ignore-zeros --warning=none'
OPENSSL_DEC = '{openssl_path} enc -d -aes-256-cfb -pass file:{file}'
UNIX_TEMPLATE = '{0} {1} --incremental --extract --ignore-zeros --warning=none --overwrite --directory {2}'
WINDOWS_TEMPLATE = '{0} -x {1} --incremental --unlink-first --ignore-zeros'
build()[source]
set_dry_run()[source]
set_encryption(encrypt_pass_file, openssl_path=None)[source]
freezer.engine.tar.tar_builders.get_tar_flag_from_algo(compression)[source]