|
15 | 15 |
|
16 | 16 | """Load Balancer pool action implementations""" |
17 | 17 |
|
| 18 | +from neutronclient.neutron.v2_0 import agentscheduler |
18 | 19 | from neutronclient.neutron.v2_0.lb import pool as neu2 |
19 | 20 | from openstackclient.network import v2_0 as v2_0 |
20 | 21 |
|
@@ -69,7 +70,28 @@ class DeletePool(v2_0.DeleteCommand): |
69 | 70 | class ListPool(v2_0.ListCommand): |
70 | 71 | """List load balancer pool""" |
71 | 72 |
|
72 | | - clazz = neu2.ListPool |
| 73 | + def get_parser(self, prog_name): |
| 74 | + parser = super(ListPool, self).get_parser(prog_name) |
| 75 | + parser.add_argument( |
| 76 | + '--lbaas-agent', |
| 77 | + help='ID of the LBaaS agent to query', |
| 78 | + ) |
| 79 | + return parser |
| 80 | + |
| 81 | + def take_action(self, parsed_args): |
| 82 | + self.log.debug('take_action(%s)' % parsed_args) |
| 83 | + parsed_args.request_format = 'json' |
| 84 | + parsed_args.fields = [] |
| 85 | + parsed_args.page_size = None |
| 86 | + parsed_args.sort_key = [] |
| 87 | + parsed_args.sort_dir = [] |
| 88 | + if parsed_args.lbaas_agent: |
| 89 | + neuter = agentscheduler.ListPoolsOnLbaasAgent(self.app, |
| 90 | + self.app_args) |
| 91 | + else: |
| 92 | + neuter = neu2.ListPool(self.app, self.app_args) |
| 93 | + neuter.get_client = self.get_client |
| 94 | + return neuter.take_action(parsed_args) |
73 | 95 |
|
74 | 96 |
|
75 | 97 | class SetPool(v2_0.SetCommand): |
|
0 commit comments