def _create_key_file(self, repo_name, data): key_path = self._get_key_path(repo_name) with open(key_path, 'w') as key_file: key_file.write(data) os.chmod(key_path, 0o600)