|
1 | 1 | """Show all licenses.""" |
2 | 2 | # :license: MIT, see LICENSE for more details. |
3 | 3 | import click |
| 4 | + |
4 | 5 | from SoftLayer import utils |
5 | 6 |
|
6 | 7 | from SoftLayer.CLI import environment |
7 | 8 | from SoftLayer.CLI import formatting |
8 | | -from SoftLayer.managers.account import AccountManager |
| 9 | +from SoftLayer.managers import account |
9 | 10 |
|
10 | 11 |
|
11 | 12 | @click.command() |
12 | 13 | @environment.pass_env |
13 | 14 | def cli(env): |
14 | 15 | """Show all licenses.""" |
15 | 16 |
|
16 | | - manager = AccountManager(env.client) |
| 17 | + manager = account.AccountManager(env.client) |
17 | 18 |
|
18 | | - panel_control = manager.get_active_virtual_licenses() |
| 19 | + control_panel = manager.get_active_virtual_licenses() |
19 | 20 | vmwares = manager.get_active_account_licenses() |
20 | 21 |
|
21 | 22 | table_panel = formatting.KeyValueTable(['id', 'ip_address', 'manufacturer', 'software', |
22 | | - 'key', 'subnet', 'subnet notes']) |
| 23 | + 'key', 'subnet', 'subnet notes'], title="Control Panel Licenses") |
23 | 24 |
|
24 | 25 | table_vmware = formatting.KeyValueTable(['name', 'license_key', 'cpus', 'description', |
25 | | - 'manufacturer', 'requiredUser']) |
26 | | - for panel in panel_control: |
| 26 | + 'manufacturer', 'requiredUser'], title="VMware Licenses") |
| 27 | + for panel in control_panel: |
27 | 28 | table_panel.add_row([panel.get('id'), panel.get('ipAddress'), |
28 | 29 | utils.lookup(panel, 'softwareDescription', 'manufacturer'), |
29 | 30 | utils.trim_to(utils.lookup(panel, 'softwareDescription', 'longDescription'), 40), |
|
0 commit comments