module ForemanMaintain::Cli::BackupCommon::ClassMethods
Public Instance Methods
common_backup_options()
click to toggle source
rubocop:disable Metrics/MethodLength
# File lib/foreman_maintain/cli/backup_command.rb, line 33 def common_backup_options # TODO: BACKUP_DIR in f-m config - should be default? parameter 'BACKUP_DIR', 'Path to backup dir', :completion => { :type => :directory }, :attribute_name => :backup_root_dir do |dir| File.expand_path(dir) end option ['-s', '--skip-pulp-content'], :flag, 'Do not backup Pulp content' option ['-p', '--preserve-directory'], :flag, 'Do not create a time-stamped subdirectory' option ['-t', '--split-pulp-tar'], 'SPLIT_SIZE', 'Split pulp data into files of a specified size, i.e. (100M, 50G). ' \ "See '--tape-length' in 'info tar' for all sizes" do |size| self.class.valid_tape_size(size) end option ['-i', '--incremental'], 'PREVIOUS_BACKUP_DIR', 'Backup changes since previous backup', :completion => { :type => :directory } do |dir| unless File.directory?(dir) raise ArgumentError, "Previous backup directory does not exist: #{dir}" end dir end proxy_name = ForemanMaintain.detector.feature(:capsule) ? 'Capsule' : 'Foreman Proxy' option '--features', 'FEATURES', "#{proxy_name} features to include in the backup. " \ 'Valid features are tftp, dns, dhcp, openscap, and all.', :multivalued => true option '--wait-for-tasks', :flag, 'Wait for running tasks to complete instead of aborting' end
valid_tape_size(size)
click to toggle source
rubocop:enable Metrics/MethodLength
# File lib/foreman_maintain/cli/backup_command.rb, line 64 def valid_tape_size(size) begin ForemanMaintain.detector.feature(:tar).validate_volume_size(size) rescue ForemanMaintain::Error::Validation => e raise ArgumentError, e.message end size end