17
17
18
18
@click .command (cls = SoftLayer .CLI .command .SLCommand , )
19
19
@click .argument ('identifier' )
20
- @click .option ('--passwords' ,
21
- is_flag = True ,
20
+ @click .option ('--passwords' , is_flag = True ,
22
21
help = 'Show passwords (check over your shoulder!)' )
23
22
@click .option ('--price' , is_flag = True , help = 'Show associated prices' )
24
23
@environment .pass_env
@@ -53,10 +52,7 @@ def cli(env, identifier, passwords=False, price=False):
53
52
table .add_row (['active_transaction' , formatting .active_txn (result )])
54
53
table .add_row (['datacenter' , result ['datacenter' ]['name' ] or formatting .blank ()])
55
54
_cli_helper_dedicated_host (env , result , table )
56
- operating_system = utils .lookup (result ,
57
- 'operatingSystem' ,
58
- 'softwareLicense' ,
59
- 'softwareDescription' ) or {}
55
+ operating_system = utils .lookup (result , 'operatingSystem' , 'softwareLicense' , 'softwareDescription' ) or {}
60
56
table .add_row (['os' , operating_system .get ('name' , '-' )])
61
57
table .add_row (['os_version' , operating_system .get ('version' , '-' )])
62
58
table .add_row (['cores' , result ['maxCpu' ]])
@@ -76,10 +72,7 @@ def cli(env, identifier, passwords=False, price=False):
76
72
77
73
table .add_row (['last_transaction' , last_transaction ])
78
74
table .add_row (['billing' , 'Hourly' if result ['hourlyBillingFlag' ] else 'Monthly' ])
79
- table .add_row (['preset' , utils .lookup (result , 'billingItem' ,
80
- 'orderItem' ,
81
- 'preset' ,
82
- 'keyName' ) or '-' ])
75
+ table .add_row (['preset' , utils .lookup (result , 'billingItem' , 'orderItem' , 'preset' , 'keyName' ) or '-' ])
83
76
84
77
table .add_row (_get_owner_row (result ))
85
78
table .add_row (_get_vlan_table (result ))
@@ -94,9 +87,7 @@ def cli(env, identifier, passwords=False, price=False):
94
87
table .add_row (['notes' , result .get ('notes' , '-' )])
95
88
96
89
if price :
97
- total_price = utils .lookup (result ,
98
- 'billingItem' ,
99
- 'nextInvoiceTotalRecurringAmount' ) or 0
90
+ total_price = utils .lookup (result , 'billingItem' , 'nextInvoiceTotalRecurringAmount' ) or 0
100
91
if total_price != 0 :
101
92
table .add_row (['Prices' , _price_table (utils .lookup (result , 'billingItem' ), total_price )])
102
93
table .add_row (['Price rate' , total_price ])
@@ -107,10 +98,7 @@ def cli(env, identifier, passwords=False, price=False):
107
98
for component in result ['softwareComponents' ]:
108
99
for item in component ['passwords' ]:
109
100
pass_table .add_row ([
110
- utils .lookup (component ,
111
- 'softwareLicense' ,
112
- 'softwareDescription' ,
113
- 'name' ),
101
+ utils .lookup (component , 'softwareLicense' , 'softwareDescription' , 'name' ),
114
102
item ['username' ],
115
103
item ['password' ],
116
104
])
@@ -122,10 +110,7 @@ def cli(env, identifier, passwords=False, price=False):
122
110
# Test to see if this actually has a primary (public) ip address
123
111
try :
124
112
if not result ['privateNetworkOnlyFlag' ]:
125
- ptr_domains = env .client .call (
126
- 'Virtual_Guest' , 'getReverseDomainRecords' ,
127
- id = vs_id ,
128
- )
113
+ ptr_domains = env .client .call ('Virtual_Guest' , 'getReverseDomainRecords' , id = vs_id )
129
114
130
115
for ptr_domain in ptr_domains :
131
116
for ptr in ptr_domain ['resourceRecords' ]:
@@ -196,8 +181,7 @@ def _get_vlan_table(result):
196
181
197
182
vlan_table = formatting .Table (['type' , 'number' , 'id' ])
198
183
for vlan in result ['networkVlans' ]:
199
- vlan_table .add_row ([
200
- vlan ['networkSpace' ], vlan ['vlanNumber' ], vlan ['id' ]])
184
+ vlan_table .add_row ([vlan ['networkSpace' ], vlan ['vlanNumber' ], vlan ['id' ]])
201
185
return ['vlans' , vlan_table ]
202
186
203
187
0 commit comments