File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
mongodb_consistent_backup Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,16 @@ def parse_mongodump_version(self):
5757 raise OperationError ("Could not parse mongodump --version output!" )
5858
5959 def choose_compression (self ):
60- if self .can_gzip ():
60+ if self .can_compress ():
6161 if self .compression () == 'auto' :
6262 logging .info ("Mongodump binary supports gzip compression, auto-enabling gzip compression" )
6363 self .compression ('gzip' )
6464 elif self .compression () == 'gzip' :
6565 raise OperationError ("mongodump gzip compression requested on binary that does not support gzip!" )
6666
67- def can_gzip (self ):
67+ def can_compress (self ):
6868 if os .path .isfile (self .binary ) and os .access (self .binary , os .X_OK ):
69- logging .debug ("Mongodump binary supports gzip" )
69+ logging .debug ("Mongodump binary supports gzip compression " )
7070 if tuple ("3.2.0" .split ("." )) <= tuple (self .version .split ("." )):
7171 return True
7272 return False
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def close(self):
6464 def is_compressed (self ):
6565 if self .has_task () and hasattr (self ._task , "is_compressed" ):
6666 return self ._task .is_compressed ()
67+ return False
6768
6869 def compression (self , task = None ):
6970 if self .has_task () and hasattr (self ._task , "compression" ):
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ def compression(self, method=None):
3939 return parse_method (self .compression_method )
4040
4141 def is_compressed (self ):
42+ if self .compression () == 'auto' and hasattr (self , "can_compress" ):
43+ return self .can_compress ()
4244 if self .compression () != 'none' :
4345 return True
4446 return False
You can’t perform that action at this time.
0 commit comments