Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description: put the code "myDBConn = pymongo.MongoClient(myDB, 27017…
…)" out of the "if" statements, because if don't do this, the code in line number 174 will be not executed if user select the option that require credentials. lead test: Exception e is "local variable 'myDBConn' referenced before assignment". It indicates the code in line number 174 will be not executed if user select the option that require credentials. After modification Exception e is "command SON([('copydb', 1), ('username', 'youngyangyang04'), ('nonce', u'b9d5887c5f7cc17c'), ('fromdb', u'admin'), ('todb', u'admin_stolen'), ('key', u'dcfd7214988466b2f620809fd27015b4'), ('fromhost', '128.95.1.27')]) failed: unable to login { code: 18, ok: 0.0, errmsg: "auth fails” }" So the code in line number 174 works
- Loading branch information