Skip to content

Commit 9eb6324

Browse files
Don't print mongodump stderr if the line is empty (date only), pt 2
1 parent 97a9dbf commit 9eb6324

File tree

1 file changed

+9
-0
lines changed
  • mongodb_consistent_backup/Common

1 file changed

+9
-0
lines changed

mongodb_consistent_backup/Common/Util.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import socket
22

3+
from dateutil import parser
4+
35
from mongodb_consistent_backup.Errors import OperationError
46

57

@@ -9,6 +11,13 @@ def config_to_string(config):
911
config_vars += "%s=%s, " % (key, config[key])
1012
return config_vars[:-1]
1113

14+
def is_datetime(string):
15+
try:
16+
parser.parse(string)
17+
return True
18+
except:
19+
return False
20+
1221
def parse_method(method):
1322
return method.rstrip().lower()
1423

0 commit comments

Comments
 (0)