Skip to content

Commit fe4d7d2

Browse files
tox cleanup
1 parent b7b70f1 commit fe4d7d2

File tree

14 files changed

+36
-62
lines changed

14 files changed

+36
-62
lines changed

SoftLayer/CLI/account/event_detail.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
import click
55

6-
import SoftLayer
76
from SoftLayer.CLI import environment
8-
from SoftLayer.CLI import exceptions
97
from SoftLayer.CLI import formatting
108
from SoftLayer.managers.account import AccountManager as AccountManager
119
from SoftLayer import utils
@@ -24,7 +22,7 @@ def cli(env, identifier, ack):
2422
event = manager.get_event(identifier)
2523

2624
if ack:
27-
result = manager.ack_event(identifier)
25+
manager.ack_event(identifier)
2826

2927
env.fout(basic_event_table(event))
3028
env.fout(impacted_table(event))

SoftLayer/CLI/account/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# :license: MIT, see LICENSE for more details.
33
import click
44

5-
import SoftLayer
65
from SoftLayer.CLI import environment
76
from SoftLayer.CLI import formatting
87
from SoftLayer.managers.account import AccountManager as AccountManager
@@ -27,6 +26,7 @@ def cli(env, ack_all):
2726

2827

2928
def event_table(events):
29+
"""Formats a table for events"""
3030
table = formatting.Table([
3131
"Id",
3232
"Start Date",

SoftLayer/CLI/account/invoice_detail.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import click
55

6-
import SoftLayer
76
from SoftLayer.CLI import environment
87
from SoftLayer.CLI import formatting
98
from SoftLayer.managers.account import AccountManager as AccountManager

SoftLayer/CLI/account/invoices.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import click
55

6-
import SoftLayer
76
from SoftLayer.CLI import environment
87
from SoftLayer.CLI import formatting
98
from SoftLayer.managers.account import AccountManager as AccountManager

SoftLayer/CLI/account/summary.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"""Account Summary page"""
22
# :license: MIT, see LICENSE for more details.
3-
from pprint import pprint as pp
4-
53
import click
64

7-
import SoftLayer
85
from SoftLayer.CLI import environment
9-
from SoftLayer.CLI import exceptions
106
from SoftLayer.CLI import formatting
117
from SoftLayer.managers.account import AccountManager as AccountManager
128
from SoftLayer import utils

SoftLayer/CLI/user/orders.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

SoftLayer/fixtures/SoftLayer_Billing_Invoice.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
'id': 724951323,
77
'oneTimeAfterTaxAmount': '0',
88
'recurringAfterTaxAmount': '0',
9+
'hostName': 'bleg',
10+
'domainName': 'beh.com',
911
'category': {'name': 'Private (only) Secondary VLAN IP Addresses'},
1012
'children': [
1113
{

SoftLayer/fixtures/SoftLayer_Notification_Occurrence_Event.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@
1010
'systemTicketId': 76057381,
1111
'acknowledgedFlag': False,
1212
'attachments': [],
13-
'impactedResources': [],
13+
'impactedResources': [{
14+
'resourceType': 'Server',
15+
'resourceTableId': 12345,
16+
'hostname': 'test',
17+
'privateIp': '10.0.0.1',
18+
'filterLable': 'Server'
19+
}],
1420
'notificationOccurrenceEventType': {'keyName': 'PLANNED'},
1521
'statusCode': {'keyName': 'PUBLISHED', 'name': 'Published'},
1622
'updates': [{
1723
'contents': 'More Blah Blah',
1824
'createDate': '2019-03-12T13:07:22-06:00',
1925
'endDate': None, 'startDate': '2019-03-12T13:07:22-06:00'
20-
}
21-
]
26+
}]
2227
}
2328

2429
getAllObjects = [getObject]

SoftLayer/managers/account.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"""
88

99
import logging
10-
import SoftLayer
1110

1211
from SoftLayer import utils
1312

@@ -80,7 +79,7 @@ def get_event(self, event_id):
8079
"""Gets details about a maintenance event
8180
8281
:param int event_id: Notification_Occurrence_Event ID
83-
:return: Notification_Occurrence_Event
82+
:return: Notification_Occurrence_Event
8483
"""
8584
mask = """mask[
8685
acknowledgedFlag,
@@ -120,16 +119,16 @@ def get_invoices(self, limit=50, closed=False, get_all=False):
120119

121120
def get_billing_items(self, identifier):
122121
"""Gets all topLevelBillingItems from a specific invoice
123-
122+
124123
:param int identifier: Invoice Id
125124
:return: Billing_Invoice_Item
126125
"""
127126

128127
mask = """mask[
129128
id, description, hostName, domainName, oneTimeAfterTaxAmount, recurringAfterTaxAmount, createDate,
130-
categoryCode,
131-
category[name],
132-
location[name],
129+
categoryCode,
130+
category[name],
131+
location[name],
133132
children[id, category[name], description, oneTimeAfterTaxAmount, recurringAfterTaxAmount]
134133
]"""
135134
return self.client.call(

SoftLayer/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ def format_event_log_date(date_string, utc):
142142
utc = "+0000"
143143

144144
iso_time_zone = utc[:3] + ':' + utc[3:]
145-
clean_time = "{}.000000{}".format(dirty_time, iso_time_zone)
145+
cleaned_time = "{}.000000{}".format(dirty_time, iso_time_zone)
146146

147-
return clean_time
147+
return cleaned_time
148148

149149

150150
def event_log_filter_between_date(start, end, utc):

0 commit comments

Comments
 (0)