Skip to content

Commit b7bb6ea

Browse files
attempt at fixing issue #193
1 parent 3572889 commit b7bb6ea

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

mongodb_consistent_backup/Backup/Mongodump/Mongodump.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

mongodb_consistent_backup/Pipeline/Stage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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"):

mongodb_consistent_backup/Pipeline/Task.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)