File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
mongodb_consistent_backup Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -56,16 +56,16 @@ def parse_mongodump_version(self):
5656 raise OperationError ("Could not parse mongodump --version output!" )
5757
5858 def choose_compression (self ):
59- if self .can_gzip ():
59+ if self .can_compress ():
6060 if self .compression () == 'auto' :
6161 logging .info ("Mongodump binary supports gzip compression, auto-enabling gzip compression" )
6262 self .compression ('gzip' )
6363 elif self .compression () == 'gzip' :
6464 raise OperationError ("mongodump gzip compression requested on binary that does not support gzip!" )
6565
66- def can_gzip (self ):
66+ def can_compress (self ):
6767 if os .path .isfile (self .binary ) and os .access (self .binary , os .X_OK ):
68- logging .debug ("Mongodump binary supports gzip" )
68+ logging .debug ("Mongodump binary supports gzip compression " )
6969 if tuple ("3.2.0" .split ("." )) <= tuple (self .version .split ("." )):
7070 return True
7171 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,7 +39,9 @@ def compression(self, method=None):
3939 return parse_method (self .compression_method )
4040
4141 def is_compressed (self ):
42- if self .compression () != 'none' :
42+ if self .compression () == 'auto' and hasattr (self , "can_compress" ):
43+ return self .can_compress ()
44+ elif self .compression () != 'none' :
4345 return True
4446 return False
4547
You can’t perform that action at this time.
0 commit comments