optimizations of get topology check

Change-Id: I80ea9a2f4ba8c887aa840b8bd726142b815eb1f9
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
This commit is contained in:
dongwenjuan
2016-06-15 10:51:52 +08:00
parent e14ae69639
commit b2d65a8783

View File

@@ -11,6 +11,7 @@
# under the License.
from cliff import show
from vitrageclient.common.exc import CommandException
# noinspection PyAbstractClass
@@ -46,12 +47,11 @@ class TopologyShow(show.ShowOne):
root = parsed_args.root
if graph_type == 'graph' and limit is not None and root is None:
print("Graph-type 'graph' requires a 'root' with 'limit'.")
topology = {}
else:
topology = self.app.client.topology.get(limit=limit,
graph_type=graph_type,
query=query,
root=root)
raise CommandException(
message="Graph-type 'graph' requires a 'root' with 'limit'.")
topology = self.app.client.topology.get(limit=limit,
graph_type=graph_type,
query=query,
root=root)
return self.dict2columns(topology)