1 ##############################################################################
2 # Copyright (c) 2016 ZTE Corporation
3 # feng.xiaowei@zte.com.cn
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from utils import execute, main, get_abspath
13 parser = argparse.ArgumentParser(description='Restore MongoDBs')
15 parser.add_argument('-u', '--url',
18 default='mongodb://127.0.0.1:27017/',
19 help='Mongo DB URL for Backup')
20 parser.add_argument('-i', '--input_dir',
23 help='Input directory for the Restore.')
24 parser.add_argument('-d', '--db',
27 default='test_results_collection',
28 help='database name after the restore.')
32 input_dir = get_abspath(args.input_dir)
33 cmd = ['mongorestore', '%s' % input_dir]
37 if __name__ == '__main__':