Skip to content

Commit 63f9617

Browse files
autopep8 fixes
1 parent 1821bf8 commit 63f9617

File tree

16 files changed

+69
-63
lines changed

16 files changed

+69
-63
lines changed

SoftLayer/CLI/account/event_detail.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from SoftLayer.managers.account import AccountManager as AccountManager
1111
from SoftLayer import utils
1212

13+
1314
@click.command()
1415
@click.argument('identifier')
1516
@click.option('--ack', is_flag=True, default=False,
@@ -18,7 +19,7 @@
1819
def cli(env, identifier, ack):
1920
"""Details of a specific event, and ability to acknowledge event."""
2021

21-
# Print a list of all on going maintenance
22+
# Print a list of all on going maintenance
2223
manager = AccountManager(env.client)
2324
event = manager.get_event(identifier)
2425

@@ -29,6 +30,7 @@ def cli(env, identifier, ack):
2930
env.fout(impacted_table(event))
3031
env.fout(update_table(event))
3132

33+
3234
def basic_event_table(event):
3335
table = formatting.Table(["Id", "Status", "Type", "Start", "End"], title=event.get('subject'))
3436

@@ -42,6 +44,7 @@ def basic_event_table(event):
4244

4345
return table
4446

47+
4548
def impacted_table(event):
4649
table = formatting.Table([
4750
"Type", "Id", "hostname", "privateIp", "Label"
@@ -56,6 +59,7 @@ def impacted_table(event):
5659
])
5760
return table
5861

62+
5963
def update_table(event):
6064
update_number = 0
6165
for update in event.get('updates', []):

SoftLayer/CLI/account/events.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
from SoftLayer.managers.account import AccountManager as AccountManager
1111
from SoftLayer import utils
1212

13+
1314
@click.command()
1415
@click.option('--ack-all', is_flag=True, default=False,
1516
help="Acknowledge every upcoming event. Doing so will turn off the popup in the control portal")
1617
@environment.pass_env
1718
def cli(env, ack_all):
1819
"""Summary and acknowledgement of upcoming and ongoing maintenance events"""
1920

20-
# Print a list of all on going maintenance
21+
# Print a list of all on going maintenance
2122
manager = AccountManager(env.client)
2223
events = manager.get_upcoming_events()
2324

@@ -30,6 +31,7 @@ def cli(env, ack_all):
3031

3132
# Allow ack all, or ack specific maintenance
3233

34+
3335
def event_table(events):
3436
table = formatting.Table([
3537
"Id",
@@ -54,4 +56,4 @@ def event_table(events):
5456
event.get('updateCount'),
5557
event.get('impactedResourceCount')
5658
])
57-
return table
59+
return table

SoftLayer/CLI/account/invoice_detail.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from SoftLayer import utils
1212
from pprint import pprint as pp
1313

14+
1415
@click.command()
1516
@click.argument('identifier')
1617
@click.option('--details', is_flag=True, default=False, show_default=True,
@@ -23,7 +24,8 @@ def cli(env, identifier, details):
2324
top_items = manager.get_billing_items(identifier)
2425

2526
title = "Invoice %s" % identifier
26-
table = formatting.Table(["Item Id", "category", "description", "Single", "Monthly", "Create Date", "Location"], title=title)
27+
table = formatting.Table(["Item Id", "category", "description", "Single",
28+
"Monthly", "Create Date", "Location"], title=title)
2729
table.align['category'] = 'l'
2830
table.align['description'] = 'l'
2931
for item in top_items:
@@ -43,7 +45,7 @@ def cli(env, identifier, details):
4345
utils.lookup(item, 'location', 'name')
4446
])
4547
if details:
46-
for child in item.get('children',[]):
48+
for child in item.get('children', []):
4749
table.add_row([
4850
'>>>',
4951
utils.lookup(child, 'category', 'name'),
@@ -56,5 +58,6 @@ def cli(env, identifier, details):
5658

5759
env.fout(table)
5860

61+
5962
def nice_string(ugly_string, limit=100):
60-
return (ugly_string[:limit] + '..') if len(ugly_string) > limit else ugly_string
63+
return (ugly_string[:limit] + '..') if len(ugly_string) > limit else ugly_string

SoftLayer/CLI/account/invoices.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from SoftLayer.managers.account import AccountManager as AccountManager
1010
from SoftLayer import utils
1111

12+
1213
@click.command()
1314
@click.option('--limit', default=50, show_default=True,
1415
help="How many invoices to get back.")
@@ -43,4 +44,4 @@ def cli(env, limit, closed=False, get_all=False):
4344
invoice.get('invoiceTotalAmount'),
4445
invoice.get('itemCount')
4546
])
46-
env.fout(table)
47+
env.fout(table)

SoftLayer/CLI/account/summary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from SoftLayer.managers.account import AccountManager as AccountManager
1212
from SoftLayer import utils
1313

14-
@click.command()
1514

15+
@click.command()
1616
@environment.pass_env
1717
def cli(env):
1818
"""Prints some various bits of information about an account"""

SoftLayer/CLI/user/orders.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010

1111

1212
@click.command()
13-
1413
@environment.pass_env
1514
def cli(env):
1615
"""Lists each user and the servers they ordered"""
1716

1817
# Table = [user name, fqdn, cost]
1918
# maybe print ordered storage / network bits
20-
# if given a single user id, just print detailed info from that user
19+
# if given a single user id, just print detailed info from that user

SoftLayer/fixtures/SoftLayer_Account.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@
673673
'typeCode': 'RECURRING',
674674
'itemCount': 3317,
675675
'invoiceTotalAmount': '6230.66'
676-
},
676+
},
677677
{
678678
'id': 12345667,
679679
'modifyDate': '2019-03-05T00:17:42-06:00',
@@ -685,4 +685,4 @@
685685
'invoiceTotalAmount': '6230.66',
686686
'endingBalance': '12345.55'
687687
}
688-
]
688+
]

SoftLayer/fixtures/SoftLayer_Billing_Invoice.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
'createDate': '2018-04-04T23:15:20-06:00',
55
'description': '64 Portable Private IP Addresses',
66
'id': 724951323,
7-
'oneTimeAfterTaxAmount': '0',
8-
'recurringAfterTaxAmount': '0',
9-
'category': {'name': 'Private (only) Secondary VLAN IP Addresses'},
7+
'oneTimeAfterTaxAmount': '0',
8+
'recurringAfterTaxAmount': '0',
9+
'category': {'name': 'Private (only) Secondary VLAN IP Addresses'},
1010
'children': [
1111
{
1212
'id': 12345,
@@ -15,7 +15,7 @@
1515
'oneTimeAfterTaxAmount': 55.50,
1616
'recurringAfterTaxAmount': 0.10
1717
}
18-
],
18+
],
1919
'location': {'name': 'fra02'}
2020
}
2121
]

SoftLayer/fixtures/SoftLayer_Notification_Occurrence_Event.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
getObject = {
2-
'endDate': '2019-03-18T17:00:00-06:00',
3-
'id': 1234,
4-
'lastImpactedUserCount': 417756,
5-
'modifyDate': '2019-03-12T15:32:48-06:00',
6-
'recoveryTime': None,
7-
'startDate': '2019-03-18T16:00:00-06:00',
8-
'subject': 'Public Website Maintenance',
9-
'summary': 'Blah Blah Blah',
10-
'systemTicketId': 76057381,
2+
'endDate': '2019-03-18T17:00:00-06:00',
3+
'id': 1234,
4+
'lastImpactedUserCount': 417756,
5+
'modifyDate': '2019-03-12T15:32:48-06:00',
6+
'recoveryTime': None,
7+
'startDate': '2019-03-18T16:00:00-06:00',
8+
'subject': 'Public Website Maintenance',
9+
'summary': 'Blah Blah Blah',
10+
'systemTicketId': 76057381,
1111
'acknowledgedFlag': False,
12-
'attachments': [],
13-
'impactedResources': [],
14-
'notificationOccurrenceEventType': {'keyName': 'PLANNED'},
15-
'statusCode': {'keyName': 'PUBLISHED', 'name': 'Published'},
12+
'attachments': [],
13+
'impactedResources': [],
14+
'notificationOccurrenceEventType': {'keyName': 'PLANNED'},
15+
'statusCode': {'keyName': 'PUBLISHED', 'name': 'Published'},
1616
'updates': [{
17-
'contents': 'More Blah Blah',
18-
'createDate': '2019-03-12T13:07:22-06:00',
17+
'contents': 'More Blah Blah',
18+
'createDate': '2019-03-12T13:07:22-06:00',
1919
'endDate': None, 'startDate': '2019-03-12T13:07:22-06:00'
20-
}
20+
}
2121
]
2222
}
2323

SoftLayer/managers/account.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def get_upcoming_events(self):
6060
}
6161
return self.client.call('Notification_Occurrence_Event', 'getAllObjects', filter=_filter, mask=mask, iter=True)
6262

63-
6463
def ack_event(self, event_id):
6564
return self.client.call('Notification_Occurrence_Event', 'acknowledgeNotification', id=event_id)
6665

@@ -79,7 +78,7 @@ def get_invoices(self, limit=50, closed=False, get_all=False):
7978
mask = "mask[invoiceTotalAmount, itemCount]"
8079
_filter = {
8180
'invoices': {
82-
'createDate' : {
81+
'createDate': {
8382
'operation': 'orderBy',
8483
'options': [{
8584
'name': 'sort',

0 commit comments

Comments
 (0)