Skip to content

Commit 65baab0

Browse files
Merge branch 'master' of github.com:allmightyspiff/softlayer-python
2 parents a303dd7 + cb51390 commit 65baab0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+94
-119
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ matrix:
1111
- python: "3.7"
1212
env: TOX_ENV=py37
1313
- python: "pypy3.5"
14-
env: TOX_ENV=pypy
14+
env: TOX_ENV=pypy3
1515
- python: "3.6"
1616
env: TOX_ENV=analysis
1717
- python: "3.6"

README.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ If you are using the library directly in python, you can do something like this.
124124
125125
System Requirements
126126
-------------------
127-
* Python 2.7, 3.3, 3.4, 3.5, 3.6, or 3.7.
127+
* Python 3.5, 3.6, or 3.7.
128128
* A valid SoftLayer API username and key.
129129
* A connection to SoftLayer's private network is required to use
130130
our private network API endpoints.
131131

132132
Python Packages
133133
---------------
134-
* six >= 1.7.0
135134
* ptable >= 0.9.2
136135
* click >= 7
137136
* requests >= 2.20.0

SoftLayer/API.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
:license: MIT, see LICENSE for more details.
77
"""
88
# pylint: disable=invalid-name
9-
from __future__ import generators
109
import warnings
1110

1211

SoftLayer/CLI/config/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Setup CLI configuration."""
22
# :license: MIT, see LICENSE for more details.
3+
import configparser
34
import os.path
45

56
import click
@@ -9,7 +10,6 @@
910
from SoftLayer.CLI import environment
1011
from SoftLayer.CLI import exceptions
1112
from SoftLayer.CLI import formatting
12-
from SoftLayer import utils
1313

1414

1515
def get_api_key(client, username, secret):
@@ -65,11 +65,11 @@ def cli(env):
6565

6666
# Persist the config file. Read the target config file in before
6767
# setting the values to avoid clobbering settings
68-
parsed_config = utils.configparser.RawConfigParser()
68+
parsed_config = configparser.RawConfigParser()
6969
parsed_config.read(config_path)
7070
try:
7171
parsed_config.add_section('softlayer')
72-
except utils.configparser.DuplicateSectionError:
72+
except configparser.DuplicateSectionError:
7373
pass
7474

7575
parsed_config.set('softlayer', 'username', username)

SoftLayer/CLI/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
66
:license: MIT, see LICENSE for more details.
77
"""
8-
from __future__ import print_function
98
import logging
109
import os
1110
import sys
1211
import time
12+
import traceback
1313
import types
1414

1515
import click
@@ -197,7 +197,6 @@ def main(reraise_exceptions=False, **kwargs):
197197
if reraise_exceptions:
198198
raise
199199

200-
import traceback
201200
print("An unexpected error has occured:")
202201
print(str(traceback.format_exc()))
203202
print("Feel free to report this error as it is likely a bug:")

SoftLayer/CLI/deprecated.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
Handles usage of the deprecated command name, 'sl'.
55
:license: MIT, see LICENSE for more details.
66
"""
7-
from __future__ import print_function
87
import sys
98

109

1110
def main():
1211
"""Main function for the deprecated 'sl' command."""
1312
print("ERROR: Use the 'slcli' command instead.", file=sys.stderr)
1413
print("> slcli %s" % ' '.join(sys.argv[1:]), file=sys.stderr)
15-
exit(-1)
14+
sys.exit(-1)

SoftLayer/CLI/firewall/edit.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,9 @@ def cli(env, identifier):
154154
try:
155155
rules = parse_rules(edited_rules)
156156
if firewall_type == 'vlan':
157-
rules = mgr.edit_dedicated_fwl_rules(firewall_id,
158-
rules)
157+
mgr.edit_dedicated_fwl_rules(firewall_id, rules)
159158
else:
160-
rules = mgr.edit_standard_fwl_rules(firewall_id,
161-
rules)
159+
mgr.edit_standard_fwl_rules(firewall_id, rules)
162160
break
163161
except (SoftLayer.SoftLayerError, ValueError) as error:
164162
env.out("Unexpected error({%s})" % (error))
@@ -169,10 +167,8 @@ def cli(env, identifier):
169167
if formatting.confirm("Would you like to submit the "
170168
"rules. Continue?"):
171169
continue
172-
else:
173-
raise exceptions.CLIAbort('Aborted.')
174-
else:
175170
raise exceptions.CLIAbort('Aborted.')
176-
env.fout('Firewall updated!')
171+
raise exceptions.CLIAbort('Aborted.')
172+
env.fout('Firewall updated!')
177173
else:
178174
raise exceptions.CLIAbort('Aborted.')

SoftLayer/CLI/formatting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def format_output(data, fmt='table'): # pylint: disable=R0911,R0912
3030
SequentialOutput
3131
:param string fmt (optional): One of: table, raw, json, python
3232
"""
33-
if isinstance(data, utils.string_types):
33+
if isinstance(data, str):
3434
if fmt in ('json', 'jsonraw'):
3535
return json.dumps(data)
3636
return data

SoftLayer/CLI/loadbal/pools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def l7pool_add(env, identifier, **args):
177177
'protocol': args.get('protocol')
178178
}
179179

180-
pool_members = [member for member in args.get('server')]
180+
pool_members = list(args.get('server'))
181181

182182
pool_health = {
183183
'interval': args.get('healthinterval'),

SoftLayer/CLI/report/bandwidth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""Metric Utilities"""
2-
from __future__ import print_function
32
import datetime
43
import itertools
54
import sys

0 commit comments

Comments
 (0)