optimizations of get topology check
Change-Id: I80ea9a2f4ba8c887aa840b8bd726142b815eb1f9 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user