Revision a5310c2a lib/masterd/instance.py

b/lib/masterd/instance.py
743 743

  
744 744
class _TransferInstCbBase(ImportExportCbBase):
745 745
  def __init__(self, lu, feedback_fn, instance, timeouts, src_node, src_cbs,
746
               dest_node, dest_ip):
746
               dest_node, dest_ip, export_opts):
747 747
    """Initializes this class.
748 748

  
749 749
    """
......
757 757
    self.src_cbs = src_cbs
758 758
    self.dest_node = dest_node
759 759
    self.dest_ip = dest_ip
760
    self.export_opts = export_opts
760 761

  
761 762

  
762 763
class _TransferInstSourceCb(_TransferInstCbBase):
......
808 809

  
809 810
    self.feedback_fn("%s is now listening, starting export" % dtp.data.name)
810 811

  
811
    opts = objects.ImportExportOptions(key_name=None, ca_pem=None)
812

  
813 812
    # Start export on source node
814
    de = DiskExport(self.lu, self.src_node, opts, self.dest_ip, ie.listen_port,
813
    de = DiskExport(self.lu, self.src_node, self.export_opts,
814
                    self.dest_ip, ie.listen_port,
815 815
                    self.instance, dtp.data.src_io, dtp.data.src_ioargs,
816 816
                    self.timeouts, self.src_cbs, private=dtp)
817 817
    ie.loop.Add(de)
......
914 914
           each transfer
915 915

  
916 916
  """
917
  opts = objects.ImportExportOptions(key_name=None, ca_pem=None)
917
  # Compress only if transfer is to another node
918
  if src_node == dest_node:
919
    compress = constants.IEC_NONE
920
  else:
921
    compress = constants.IEC_GZIP
922

  
923
  logging.debug("Source node %s, destination node %s, compression '%s'",
924
                src_node, dest_node, compress)
925

  
926
  opts = objects.ImportExportOptions(key_name=None, ca_pem=None,
927
                                     compress=compress)
928

  
918 929
  timeouts = ImportExportTimeouts(constants.DISK_TRANSFER_CONNECT_TIMEOUT)
919 930
  src_cbs = _TransferInstSourceCb(lu, feedback_fn, instance, timeouts,
920
                                  src_node, None, dest_node, dest_ip)
931
                                  src_node, None, dest_node, dest_ip, opts)
921 932
  dest_cbs = _TransferInstDestCb(lu, feedback_fn, instance, timeouts,
922
                                 src_node, src_cbs, dest_node, dest_ip)
933
                                 src_node, src_cbs, dest_node, dest_ip, opts)
923 934

  
924 935
  all_dtp = []
925 936

  

Also available in: Unified diff