From 8daa98eaac8395cb8f45fd9d26e05b1f522b93bd Mon Sep 17 00:00:00 2001 From: zhubx007 Date: Wed, 8 Aug 2018 18:29:04 +0800 Subject: [PATCH] Refactor cell_type in compute/api.py TrivialFix Change-Id: I0dc9dada728105c744a23d18e47e0185c5e0d5c3 --- nova/compute/api.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index b8a74c0d366a..932959b07842 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -275,11 +275,7 @@ class API(base.Base): @property def cell_type(self): - try: - return getattr(self, '_cell_type') - except AttributeError: - self._cell_type = cells_opts.get_cell_type() - return self._cell_type + return getattr(self, '_cell_type', cells_opts.get_cell_type()) def _validate_cell(self, instance): if self.cell_type != 'api':