def _save_user_xml(self, random_password): user_xml = os.path.expanduser("~/.faraday/config/user.xml") if not os.path.exists(user_xml): shutil.copy(FARADAY_BASE_CONFIG_XML, user_xml) conf = Configuration(user_xml) conf.setAPIUrl('http://localhost:5985') conf.setAPIUsername('faraday') conf.setAPIPassword(random_password) conf.saveConfig()