Removing obsolete parameters from freezer args (swift related).

Resolves bug: 1522511

Change-Id: Ia01961e8236718bf75fe931bb8aa13c3fb8fe8ac
This commit is contained in:
eldar nugaev 2015-12-03 17:42:12 +00:00
parent b6397636dc
commit 90d9805f03
4 changed files with 77 additions and 115 deletions

View File

@ -720,8 +720,7 @@ Available options::
usage: freezerc [-h] [--config CONFIG] usage: freezerc [-h] [--config CONFIG]
[--action {backup,restore,info,admin,exec}] [--action {backup,restore,info,admin,exec}]
[-F PATH_TO_BACKUP] [-N BACKUP_NAME] [-m MODE] [-C CONTAINER] [-F PATH_TO_BACKUP] [-N BACKUP_NAME] [-m MODE] [-C CONTAINER]
[-L] [-l] [-o GET_OBJECT] [-d DST_FILE] [-s] [-s] [--lvm-auto-snap LVM_AUTO_SNAP] [--lvm-srcvol LVM_SRCVOL]
[--lvm-auto-snap LVM_AUTO_SNAP] [--lvm-srcvol LVM_SRCVOL]
[--lvm-snapname LVM_SNAPNAME] [--lvm-snap-perm {ro,rw}] [--lvm-snapname LVM_SNAPNAME] [--lvm-snap-perm {ro,rw}]
[--lvm-snapsize LVM_SNAPSIZE] [--lvm-dirmount LVM_DIRMOUNT] [--lvm-snapsize LVM_SNAPSIZE] [--lvm-dirmount LVM_DIRMOUNT]
[--lvm-volgroup LVM_VOLGROUP] [--max-level MAX_LEVEL] [--lvm-volgroup LVM_VOLGROUP] [--max-level MAX_LEVEL]
@ -731,7 +730,7 @@ Available options::
[--no-incremental] [--hostname HOSTNAME] [--no-incremental] [--hostname HOSTNAME]
[--mysql-conf MYSQL_CONF] [--metadata-out METADATA_OUT] [--mysql-conf MYSQL_CONF] [--metadata-out METADATA_OUT]
[--log-file LOG_FILE] [--exclude EXCLUDE] [--log-file LOG_FILE] [--exclude EXCLUDE]
[--dereference-symlink {none,soft,hard,all}] [-U] [--dereference-symlink {none,soft,hard,all}]
[--encrypt-pass-file ENCRYPT_PASS_FILE] [-M MAX_SEGMENT_SIZE] [--encrypt-pass-file ENCRYPT_PASS_FILE] [-M MAX_SEGMENT_SIZE]
[--restore-abs-path RESTORE_ABS_PATH] [--restore-abs-path RESTORE_ABS_PATH]
[--restore-from-host HOSTNAME] [--restore-from-host HOSTNAME]
@ -741,88 +740,77 @@ Available options::
[--cinder-vol-id CINDER_VOL_ID] [--nova-inst-id NOVA_INST_ID] [--cinder-vol-id CINDER_VOL_ID] [--nova-inst-id NOVA_INST_ID]
[--cindernative-vol-id CINDERNATIVE_VOL_ID] [--cindernative-vol-id CINDERNATIVE_VOL_ID]
[--download-limit DOWNLOAD_LIMIT] [--download-limit DOWNLOAD_LIMIT]
[--sql-server-conf SQL_SERVER_CONF] [--vssadmin VSSADMIN] [--sql-server-conf SQL_SERVER_CONF] [--vssadmin]
[--command COMMAND] [--compression {gzip,bzip2,xz}] [--command COMMAND] [--compression {gzip,bzip2,xz}]
[--storage {local,swift,ssh}] [--ssh-key SSH_KEY] [--storage {local,swift,ssh}] [--ssh-key SSH_KEY]
[--ssh-username SSH_USERNAME] [--ssh-host SSH_HOST] [--ssh-username SSH_USERNAME] [--ssh-host SSH_HOST]
[--ssh-port SSH_PORT] [--ssh-port SSH_PORT]
optional arguments: optional arguments:
-h, --help show this help message and exit -h, --help show this help message and exit
--config CONFIG Config file abs path. Option arguments are provided --config CONFIG Config file abs path. Option arguments are provided
from config file. When config file is used any option from config file. When config file is used any option
from command line provided take precedence. from command line provided take precedence.
--action {backup,restore,info,admin,exec} --action {backup,restore,info,admin,exec}
Set the action to be taken. backup and restore are Set the action to be taken. backup and restore are
self explanatory, info is used to retrieve info from self explanatory, info is used to retrieve info from
the storage media, exec is used to execute a script, the storage media, exec is used to execute a script,
while admin is used to delete old backups and other while admin is used to delete old backups and other
admin actions. Default backup. admin actions. Default backup.
-F PATH_TO_BACKUP, --path-to-backup PATH_TO_BACKUP, --file-to-backup PATH_TO_BACKUP -F PATH_TO_BACKUP, --path-to-backup PATH_TO_BACKUP, --file-to-backup PATH_TO_BACKUP
The file or directory you want to back up to Swift The file or directory you want to back up to Swift
-N BACKUP_NAME, --backup-name BACKUP_NAME -N BACKUP_NAME, --backup-name BACKUP_NAME
The backup name you want to use to identify your The backup name you want to use to identify your
backup on Swift backup on Swift
-m MODE, --mode MODE Set the technology to back from. Options are, fs -m MODE, --mode MODE Set the technology to back from. Options are, fs
(filesystem), mongo (MongoDB), mysql (MySQL), (filesystem), mongo (MongoDB), mysql (MySQL),
sqlserver (SQL Server) Default set to fs sqlserver (SQL Server) Default set to fs
-C CONTAINER, --container CONTAINER -C CONTAINER, --container CONTAINER
The Swift container (or path to local storage) used to The Swift container (or path to local storage) used to
upload files to upload files to
-L, --list-containers -s, --snapshot Create a snapshot of the fs containing the resource to
List the Swift containers on remote Object Storage backup. When used, the lvm parameters will be guessed
Server and/or the default values will be used
-l, --list-objects List the Swift objects stored in a container on remote --lvm-auto-snap LVM_AUTO_SNAP
Object Storage Server. Automatically guess the volume group and volume name
-o GET_OBJECT, --get-object GET_OBJECT for given PATH.
The Object name you want to download on the local file --lvm-srcvol LVM_SRCVOL
system. Set the lvm volume you want to take a snaphost from.
-d DST_FILE, --dst-file DST_FILE Default no volume
The file name used to save the object on your local --lvm-snapname LVM_SNAPNAME
disk and upload file in swift Set the lvm snapshot name to use. If the snapshot name
-s, --snapshot Create a snapshot of the fs containing the resource to already exists, the old one will be used a no new one
backup. When used, the lvm parameters will be guessed will be created. Default freezer_backup_snap.
and/or the default values will be used --lvm-snap-perm {ro,rw}
--lvm-auto-snap LVM_AUTO_SNAP Set the lvm snapshot permission to use. If the
Automatically guess the volume group and volume name permission is set to ro The snapshot will be immutable
for given PATH. - read only -. If the permission is set to rw it will
--lvm-srcvol LVM_SRCVOL be mutable
Set the lvm volume you want to take a snaphost from. --lvm-snapsize LVM_SNAPSIZE
Default no volume Set the lvm snapshot size when creating a new
--lvm-snapname LVM_SNAPNAME snapshot. Please add G for Gigabytes or M for
Set the lvm snapshot name to use. If the snapshot name Megabytes, i.e. 500M or 8G. Default 1G.
already exists, the old one will be used a no new one --lvm-dirmount LVM_DIRMOUNT
will be created. Default freezer_backup_snap. Set the directory you want to mount the lvm snapshot
--lvm-snap-perm {ro,rw} to. Default to /var/lib/freezer
Set the lvm snapshot permission to use. If the --lvm-volgroup LVM_VOLGROUP
permission is set to ro The snapshot will be immutable Specify the volume group of your logical volume. This
- read only -. If the permission is set to rw it will is important to mount your snapshot volume. Default
be mutable not set
--lvm-snapsize LVM_SNAPSIZE --max-level MAX_LEVEL
Set the lvm snapshot size when creating a new Set the backup level used with tar to implement
snapshot. Please add G for Gigabytes or M for incremental backup. If a level 1 is specified but no
Megabytes, i.e. 500M or 8G. Default 1G. level 0 is already available, a level 0 will be done
--lvm-dirmount LVM_DIRMOUNT and subsequently backs to level 1. Default 0 (No
Set the directory you want to mount the lvm snapshot Incremental)
to. Default to /var/lib/freezer --always-level ALWAYS_LEVEL
--lvm-volgroup LVM_VOLGROUP Set backup maximum level used with tar to implement
Specify the volume group of your logical volume. This incremental backup. If a level 3 is specified, the
is important to mount your snapshot volume. Default backup will be executed from level 0 to level 3 and to
not set that point always a backup level 3 will be executed.
--max-level MAX_LEVEL It will not restart from level 0. This option has
Set the backup level used with tar to implement precedence over --max-backup-level. Default False
incremental backup. If a level 1 is specified but no (Disabled)
level 0 is already available, a level 0 will be done
and subsequently backs to level 1. Default 0 (No
Incremental)
--always-level ALWAYS_LEVEL
Set backup maximum level used with tar to implement
incremental backup. If a level 3 is specified, the
backup will be executed from level 0 to level 3 and to
that point always a backup level 3 will be executed.
It will not restart from level 0. This option has
precedence over --max-backup-level. Default False
(Disabled)
--restart-always-level RESTART_ALWAYS_LEVEL --restart-always-level RESTART_ALWAYS_LEVEL
Restart the backup from level 0 after n days. Valid Restart the backup from level 0 after n days. Valid
only if --always-level option if set. If --always- only if --always-level option if set. If --always-
@ -868,15 +856,13 @@ Available options::
--dereference-symlink {none,soft,hard,all} --dereference-symlink {none,soft,hard,all}
Follow hard and soft links and archive and dump the Follow hard and soft links and archive and dump the
files they refer to. Default False. files they refer to. Default False.
-U, --upload Upload to Swift the destination file passed to the -d
option. Default upload the data
--encrypt-pass-file ENCRYPT_PASS_FILE --encrypt-pass-file ENCRYPT_PASS_FILE
Passing a private key to this option, allow you to Passing a private key to this option, allow you to
encrypt the files before to be uploaded in Swift. encrypt the files before to be uploaded in Swift.
Default do not encrypt. Default do not encrypt.
-M MAX_SEGMENT_SIZE, --max-segment-size MAX_SEGMENT_SIZE -M MAX_SEGMENT_SIZE, --max-segment-size MAX_SEGMENT_SIZE
Set the maximum file chunk size in bytes to upload to Set the maximum file chunk size in bytes to upload to
swift Default 67108864 bytes (64MB) swift Default 33554432 bytes (32MB)
--restore-abs-path RESTORE_ABS_PATH --restore-abs-path RESTORE_ABS_PATH
Set the absolute path where you want your data Set the absolute path where you want your data
restored. Default False. restored. Default False.
@ -886,7 +872,7 @@ Available options::
host where the backup was executed just type from your host where the backup was executed just type from your
shell: "$ hostname" and the output is the value that shell: "$ hostname" and the output is the value that
needs to be passed to this option. Mandatory with needs to be passed to this option. Mandatory with
Restore Default False. (Deprecated use "hostname" Restore Default False. (Deprecated use "hostname"
instead) instead)
--restore-from-date RESTORE_FROM_DATE --restore-from-date RESTORE_FROM_DATE
Set the absolute path where you want your data Set the absolute path where you want your data
@ -922,7 +908,7 @@ Available options::
Set the SQL Server configuration file where freezer Set the SQL Server configuration file where freezer
retrieve the sql server instance. Following is an retrieve the sql server instance. Following is an
example of config file: instance = <db-instance> example of config file: instance = <db-instance>
--vssadmin VSSADMIN Create a backup using a snapshot on windows using --vssadmin Create a backup using a snapshot on windows using
vssadmin. Options are: True and False, default is True vssadmin. Options are: True and False, default is True
--command COMMAND Command executed by exec action --command COMMAND Command executed by exec action
--compression {gzip,bzip2,xz} --compression {gzip,bzip2,xz}

View File

@ -41,27 +41,27 @@ DEFAULT_LVM_SNAPSIZE = '1G'
DEFAULT_LVM_DIRMOUNT = '/var/lib/freezer' DEFAULT_LVM_DIRMOUNT = '/var/lib/freezer'
DEFAULT_PARAMS = { DEFAULT_PARAMS = {
'os_identity_api_version': None, 'list_objects': False, 'os_identity_api_version': None,
'get_object': False, 'lvm_auto_snap': False, 'lvm_volgroup': False, 'lvm_auto_snap': False, 'lvm_volgroup': False,
'exclude': False, 'sql_server_conf': False, 'exclude': False, 'sql_server_conf': False,
'backup_name': False, 'quiet': False, 'backup_name': False, 'quiet': False,
'container': 'freezer_backups', 'no_incremental': False, 'container': 'freezer_backups', 'no_incremental': False,
'max_segment_size': 67108864, 'lvm_srcvol': False, 'max_segment_size': 67108864, 'lvm_srcvol': False,
'download_limit': None, 'hostname': False, 'remove_from_date': False, 'download_limit': None, 'hostname': False, 'remove_from_date': False,
'restart_always_level': False, 'lvm_dirmount': DEFAULT_LVM_DIRMOUNT, 'restart_always_level': False, 'lvm_dirmount': DEFAULT_LVM_DIRMOUNT,
'dst_file': False, 'dereference_symlink': '', 'dereference_symlink': '',
'restore_from_host': False, 'config': False, 'mysql_conf': False, 'restore_from_host': False, 'config': False, 'mysql_conf': False,
'insecure': False, 'lvm_snapname': DEFAULT_LVM_SNAPNAME, 'insecure': False, 'lvm_snapname': DEFAULT_LVM_SNAPNAME,
'lvm_snapperm': 'ro', 'snapshot': False, 'lvm_snapperm': 'ro', 'snapshot': False,
'max_priority': False, 'max_level': False, 'path_to_backup': False, 'max_priority': False, 'max_level': False, 'path_to_backup': False,
'encrypt_pass_file': False, 'volume': False, 'proxy': False, 'encrypt_pass_file': False, 'volume': False, 'proxy': False,
'cinder_vol_id': '', 'cindernative_vol_id': '', 'cinder_vol_id': '', 'cindernative_vol_id': '',
'nova_inst_id': '', 'list_containers': False, 'nova_inst_id': '',
'remove_older_than': None, 'restore_from_date': False, 'remove_older_than': None, 'restore_from_date': False,
'upload_limit': None, 'always_level': False, 'version': False, 'upload_limit': None, 'always_level': False, 'version': False,
'dry_run': False, 'lvm_snapsize': DEFAULT_LVM_SNAPSIZE, 'dry_run': False, 'lvm_snapsize': DEFAULT_LVM_SNAPSIZE,
'restore_abs_path': False, 'log_file': None, 'restore_abs_path': False, 'log_file': None,
'upload': True, 'mode': 'fs', 'action': 'backup', 'mode': 'fs', 'action': 'backup',
'vssadmin': False, 'shadow': '', 'shadow_path': '', 'vssadmin': False, 'shadow': '', 'shadow_path': '',
'windows_volume': '', 'command': None, 'metadata_out': False, 'windows_volume': '', 'command': None, 'metadata_out': False,
'storage': 'swift', 'ssh_key': '', 'ssh_username': '', 'ssh_host': '', 'storage': 'swift', 'ssh_key': '', 'ssh_username': '', 'ssh_host': '',
@ -141,22 +141,6 @@ def backup_arguments(args_dict={}):
help="The Swift container (or path to local storage) " help="The Swift container (or path to local storage) "
"used to upload files to", "used to upload files to",
dest='container', default='freezer_backups') dest='container', default='freezer_backups')
arg_parser.add_argument(
'-L', '--list-containers', action='store_true',
help='''List the Swift containers on remote Object Storage Server''',
dest='list_containers', default=False)
arg_parser.add_argument(
'-l', '--list-objects', action='store_true',
help='''List the Swift objects stored in a container on remote Object\
Storage Server.''', dest='list_objects', default=False)
arg_parser.add_argument(
'-o', '--get-object', action='store',
help="The Object name you want to download on the local file system.",
dest='get_object', default=False)
arg_parser.add_argument(
'-d', '--dst-file', action='store',
help="The file name used to save the object on your local disk and\
upload file in swift", dest='dst_file', default=False)
arg_parser.add_argument( arg_parser.add_argument(
'-s', '--snapshot', action='store_true', '-s', '--snapshot', action='store_true',
help=('Create a snapshot of the fs containing the resource to backup.' help=('Create a snapshot of the fs containing the resource to backup.'
@ -293,10 +277,6 @@ def backup_arguments(args_dict={}):
"Follow hard and soft links and archive and dump the files they " "Follow hard and soft links and archive and dump the files they "
" refer to. Default False."), " refer to. Default False."),
dest='dereference_symlink', default='') dest='dereference_symlink', default='')
arg_parser.add_argument(
'-U', '--upload', action='store_true',
help="Upload to Swift the destination file passed to the -d option.\
Default upload the data", dest='upload', default=True)
arg_parser.add_argument( arg_parser.add_argument(
'--encrypt-pass-file', action='store', '--encrypt-pass-file', action='store',
help="Passing a private key to this option, allow you to encrypt the \ help="Passing a private key to this option, allow you to encrypt the \

View File

@ -325,7 +325,6 @@ class BackupOpt1:
self.time_stamp = 123456789 self.time_stamp = 123456789
self.container = 'test-container' self.container = 'test-container'
self.work_dir = '/tmp' self.work_dir = '/tmp'
self.upload = 'true'
self.sw_connector = fakeswclient self.sw_connector = fakeswclient
self.max_level = '20' self.max_level = '20'
self.encrypt_pass_file = '/dev/random' self.encrypt_pass_file = '/dev/random'
@ -333,8 +332,6 @@ class BackupOpt1:
self.remove_from_date = '2014-12-03T23:23:23' self.remove_from_date = '2014-12-03T23:23:23'
self.restart_always_level = 100000 self.restart_always_level = 100000
self.restore_abs_path = '/tmp' self.restore_abs_path = '/tmp'
self.list_containers = False
self.list_objects = False
self.restore_from_date = '2014-12-03T23:23:23' self.restore_from_date = '2014-12-03T23:23:23'
self.restore_from_host = 'test-hostname' self.restore_from_host = 'test-hostname'
self.action = 'info' self.action = 'info'

View File

@ -44,7 +44,6 @@ class TestInfoJob(TestJob):
def test_execute_list_containers(self): def test_execute_list_containers(self):
backup_opt = BackupOpt1() backup_opt = BackupOpt1()
backup_opt.list_containers = True
job = InfoJob(backup_opt, backup_opt.storage) job = InfoJob(backup_opt, backup_opt.storage)
job.execute() job.execute()