def _make_backup(backup_path, source_file_path):
 inventory_backup_file = os.path.join(backup_path, 'backup_openstack_inventory.tar')
 with tarfile.open(inventory_backup_file, 'a') as tar:
  basename = os.path.basename(source_file_path)
  backup_name = _get_backup_name(basename)
  tar.add(source_file_path, arcname=backup_name)
 logger.debug('Backup written to {}'.format(inventory_backup_file))

def _make_backup ( backup_path , source_file_path ) : inventory_backup_file = os . path . join ( backup_path , 'backup_openstack_inventory.tar' ) with tarfile . open ( inventory_backup_file , 'a' ) as tar : basename = os . path . basename ( source_file_path ) backup_name = _get_backup_name ( basename ) tar . add ( source_file_path , arcname = backup_name ) logger . debug ( 'Backup written to {}' . format ( inventory_backup_file ) )
create a backup of all previous inventory files as a tar archive .