Skip to content

Commit 40a2898

Browse files
removed some debugging code
1 parent a1a9eb8 commit 40a2898

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

SoftLayer/managers/hardware.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,10 @@ def _get_ids_from_ip(self, ip): # pylint: disable=inconsistent-return-statement
532532
# Find the server via ip address. First try public ip, then private
533533
results = self.list_hardware(public_ip=ip, mask="id")
534534
if results:
535-
print("PUB")
536535
return [result['id'] for result in results]
537536

538537
results = self.list_hardware(private_ip=ip, mask="id")
539538
if results:
540-
print("Found privet")
541539
return [result['id'] for result in results]
542540

543541
def edit(self, hardware_id, userdata=None, hostname=None, domain=None,

SoftLayer/testing/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
from SoftLayer.CLI import core
1919
from SoftLayer.CLI import environment
2020
from SoftLayer.testing import xmlrpc
21-
from SoftLayer.transports import SoftLayerListResult
22-
2321

2422
FIXTURE_PATH = os.path.abspath(os.path.join(__file__, '..', '..', 'fixtures'))
2523

SoftLayer/transports.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def __init__(self):
122122

123123
def __repr__(self):
124124
"""Prints out what this call is all about"""
125-
param_list = ['identifier', 'mask', 'filter', 'args', 'limit', 'offset']
126125
pretty_mask = utils.clean_string(self.mask)
127126
pretty_filter = self.filter
128127
param_string = "id={id}, mask='{mask}', filter='{filter}', args={args}, limit={limit}, offset={offset}".format(
@@ -135,7 +134,7 @@ def __repr__(self):
135134
class SoftLayerListResult(list):
136135
"""A SoftLayer API list result."""
137136

138-
def __init__(self, items=[], total_count=0):
137+
def __init__(self, items=None, total_count=0):
139138

140139
#: total count of items that exist on the server. This is useful when
141140
#: paginating through a large list of objects.

SoftLayer/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ def is_ready(instance, pending=False):
212212

213213

214214
def clean_string(string):
215+
"""Returns a string with all newline and other whitespace garbage removed.
216+
217+
Mostly this method is used to print out objectMasks that have a lot of extra whitespace
218+
in them because making compact masks in python means they don't look nice in the IDE.
219+
220+
:param string: The string to clean.
221+
:returns string: A string without extra whitespace
222+
"""
215223
if string is None:
216224
return ''
217225
else:

0 commit comments

Comments
 (0)