Catch client Exception when do client call

We should catch client Exception instead of nimble Exception

Change-Id: Ifb3fdb1fc7a7c607cbeabb03ffcc58146c4a89b2
This commit is contained in:
Shaohe Feng
2016-09-26 09:31:09 +08:00
parent b3163e049e
commit 13459a1773

View File

@@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from nimble.common import exception
from ironicclient import exceptions as client_e
from nimble.common import ironic
from nimble.engine.baremetal import ironic_states
@@ -94,6 +95,6 @@ def get_node_list(**kwargs):
ironicclient = ironic.IronicClientWrapper()
try:
node_list = ironicclient.call("node.list", **kwargs)
except exception.NimbleException:
except client_e.ClientException:
node_list = []
return node_list