def save(self, cred_file): """Save credentials to an external file.""" self.check_credentials() storage = Storage(cred_file) storage.put(self.credentials) logger.info('Saved credentials to %s', cred_file)