Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
649c8ae
NETWORK-8987 - added createDate and modifyDate parameters to sg rule-…
Anjana-Rajagopal Nov 6, 2018
634cb64
#1067 fixed price lookup bug, and resolved/ignored a bunch of new pyl…
allmightyspiff Nov 6, 2018
5677c43
Merge pull request #1070 from allmightyspiff/1067
allmightyspiff Nov 7, 2018
4e2519a
v5.6.1 release
allmightyspiff Nov 7, 2018
34b8923
v5.6.1 correction to setup.py
allmightyspiff Nov 7, 2018
4876891
Merge pull request #1072 from allmightyspiff/master
allmightyspiff Nov 7, 2018
6d588e3
5.6.3 updates
allmightyspiff Nov 7, 2018
d2e81fe
Merge pull request #1073 from allmightyspiff/master
allmightyspiff Nov 7, 2018
6309d1d
NETWORK-8987 - modifying the rule class and test class to have the cr…
Anjana-Rajagopal Nov 8, 2018
b332392
NETWORK-8987 - fixing indentations within securitygroup_test to resol…
Anjana-Rajagopal Nov 8, 2018
477c3df
Merge branch 'feature/NETWORK-8987' of https://github.com/Anjana-Raja…
Anjana-Rajagopal Nov 9, 2018
c408939
NETWORK-8987 - fixing minor indentation to resolve pep8 error
Anjana-Rajagopal Nov 9, 2018
2e94a7b
NETWORK-8987 - fixing minor indentation to resolve pep8 error
Anjana-Rajagopal Nov 9, 2018
25ae8dd
Merge branch 'feature/NETWORK-8987' of https://github.com/Anjana-Raja…
Anjana-Rajagopal Nov 9, 2018
4790190
NETWORK-8987 - fixing minor indentation to resolve pep8 error
Anjana-Rajagopal Nov 9, 2018
543c06b
Merge branch 'feature/NETWORK-8987' of https://github.com/Anjana-Raja…
Anjana-Rajagopal Nov 9, 2018
d6821f3
Merge pull request #1071 from Anjana-Rajagopal/feature/NETWORK-8987
allmightyspiff Nov 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## [5.6.3] - 2018-11-07

- Changes: https://github.com/softlayer/softlayer-python/compare/v5.6.0...v5.6.3

+ #1065 Updated urllib3 and requests libraries due to CVE-2018-18074
+ #1070 Fixed an ordering bug
+ Updated release process and fab-file

## [5.6.0] - 2018-10-16
- Changes: https://github.com/softlayer/softlayer-python/compare/v5.5.3...v5.6.0

Expand Down
8 changes: 6 additions & 2 deletions SoftLayer/CLI/securitygroup/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
'ethertype',
'portRangeMin',
'portRangeMax',
'protocol']
'protocol',
'createDate',
'modifyDate']


@click.command()
Expand Down Expand Up @@ -49,7 +51,9 @@ def rule_list(env, securitygroup_id, sortby):
rule.get('ethertype') or formatting.blank(),
port_min,
port_max,
rule.get('protocol') or formatting.blank()
rule.get('protocol') or formatting.blank(),
rule.get('createDate') or formatting.blank(),
rule.get('modifyDate') or formatting.blank()
])

env.fout(table)
Expand Down
1 change: 1 addition & 0 deletions SoftLayer/CLI/virt/create_options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Virtual server order options."""
# :license: MIT, see LICENSE for more details.
# pylint: disable=too-many-statements
import os
import os.path

Expand Down
2 changes: 0 additions & 2 deletions SoftLayer/CLI/vpn/ipsec/translation/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@

@click.command()
@click.argument('context_id', type=int)
# todo: Update to utilize custom IP address type
@click.option('-s',
'--static-ip',
required=True,
help='Static IP address value')
# todo: Update to utilize custom IP address type
@click.option('-r',
'--remote-ip',
required=True,
Expand Down
2 changes: 0 additions & 2 deletions SoftLayer/CLI/vpn/ipsec/translation/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
required=True,
type=int,
help='Translation identifier to update')
# todo: Update to utilize custom IP address type
@click.option('-s',
'--static-ip',
default=None,
help='Static IP address value')
# todo: Update to utilize custom IP address type
@click.option('-r',
'--remote-ip',
default=None,
Expand Down
1 change: 0 additions & 1 deletion SoftLayer/CLI/vpn/ipsec/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@click.option('--friendly-name',
default=None,
help='Friendly name value')
# todo: Update to utilize custom IP address type
@click.option('--remote-peer',
default=None,
help='Remote peer IP address value')
Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

:license: MIT, see LICENSE for more details.
"""
VERSION = 'v5.6.0'
VERSION = 'v5.6.3'
API_PUBLIC_ENDPOINT = 'https://api.softlayer.com/xmlrpc/v3.1/'
API_PRIVATE_ENDPOINT = 'https://api.service.softlayer.com/xmlrpc/v3.1/'
API_PUBLIC_ENDPOINT_REST = 'https://api.softlayer.com/rest/v3.1/'
Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/managers/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def cancel_hardware(self, hardware_id, reason='unneeded', comment='', immediate=
billing_id = hw_billing['billingItem']['id']

if immediate and not hw_billing['hourlyBillingFlag']:
LOGGER.warning("Immediate cancelation of montly servers is not guaranteed. " +
LOGGER.warning("Immediate cancelation of montly servers is not guaranteed."
"Please check the cancelation ticket for updates.")

result = self.client.call('Billing_Item', 'cancelItem',
Expand Down
4 changes: 0 additions & 4 deletions SoftLayer/managers/ipsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,6 @@ def update_translation(self, context_id, translation_id, static_ip=None,
translation.pop('customerIpAddressId', None)
if notes is not None:
translation['notes'] = notes
# todo: Update this signature to return the updated translation
# once internal and customer IP addresses can be fetched
# and set on the translation object, i.e. that which is
# currently being handled in get_translations
self.context.editAddressTranslation(translation, id=context_id)
return True

Expand Down
2 changes: 1 addition & 1 deletion SoftLayer/managers/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def get_securitygroup(self, group_id, **kwargs):
'description,'
'''rules[id, remoteIp, remoteGroupId,
direction, ethertype, portRangeMin,
portRangeMax, protocol],'''
portRangeMax, protocol, createDate, modifyDate],'''
'''networkComponentBindings[
networkComponent[
id,
Expand Down
4 changes: 3 additions & 1 deletion SoftLayer/managers/ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,10 @@ def get_item_price_id(core, prices):
if not price['locationGroupId']:
capacity_min = int(price.get('capacityRestrictionMinimum', -1))
capacity_max = int(price.get('capacityRestrictionMaximum', -1))
if capacity_min == -1:
# return first match if no restirction, or no core to check
if capacity_min == -1 or core is None:
price_id = price['id']
# this check is mostly to work nicely with preset configs
elif capacity_min <= int(core) <= capacity_max:
price_id = price['id']
return price_id
Expand Down
15 changes: 7 additions & 8 deletions SoftLayer/managers/vs.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,16 @@ def verify_create_instance(self, **kwargs):
'domain': u'test01.labs.sftlyr.ws',
'hostname': u'minion05',
'datacenter': u'hkg02',
'flavor': 'BL1_1X2X100'
'dedicated': False,
'private': False,
'cpus': 1,
'os_code' : u'UBUNTU_LATEST',
'hourly': True,
'ssh_keys': [1234],
'disks': ('100','25'),
'local_disk': True,
'memory': 1024
'tags': 'test, pleaseCancel',
'public_security_groups': [12, 15]
}

vsi = mgr.verify_create_instance(**new_vsi)
Expand All @@ -536,15 +537,14 @@ def create_instance(self, **kwargs):
'domain': u'test01.labs.sftlyr.ws',
'hostname': u'minion05',
'datacenter': u'hkg02',
'flavor': 'BL1_1X2X100'
'dedicated': False,
'private': False,
'cpus': 1,
'os_code' : u'UBUNTU_LATEST',
'hourly': True,
'ssh_keys': [1234],
'disks': ('100','25'),
'local_disk': True,
'memory': 1024,
'tags': 'test, pleaseCancel',
'public_security_groups': [12, 15]
}
Expand Down Expand Up @@ -607,17 +607,16 @@ def create_instances(self, config_list):
# Define the instance we want to create.
new_vsi = {
'domain': u'test01.labs.sftlyr.ws',
'hostname': u'multi-test',
'hostname': u'minion05',
'datacenter': u'hkg02',
'flavor': 'BL1_1X2X100'
'dedicated': False,
'private': False,
'cpus': 1,
'os_code' : u'UBUNTU_LATEST',
'hourly': True,
'ssh_keys': [87634],
'ssh_keys': [1234],
'disks': ('100','25'),
'local_disk': True,
'memory': 1024,
'tags': 'test, pleaseCancel',
'public_security_groups': [12, 15]
}
Expand Down
4 changes: 2 additions & 2 deletions fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def make_html():

def upload():
"Upload distribution to PyPi"
local('python setup.py sdist upload')
local('python setup.py bdist_wheel upload')
local('python setup.py sdist bdist_wheel')
local('twine upload dist/*')


def clean():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name='SoftLayer',
version='5.6.1',
version='5.6.3',
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
author='SoftLayer Technologies, Inc.',
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: slcli # check to see if it's available
version: '5.6.0+git' # check versioning
version: '5.6.3+git' # check versioning
summary: Python based SoftLayer API Tool. # 79 char long summary
description: |
A command-line interface is also included and can be used to manage various SoftLayer products and services.
Expand Down
4 changes: 3 additions & 1 deletion tests/CLI/modules/securitygroup_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def test_securitygroup_rule_list(self):
'remoteGroupId': None,
'protocol': None,
'portRangeMin': None,
'portRangeMax': None}],
'portRangeMax': None,
'createDate': None,
'modifyDate': None}],
json.loads(result.output))

def test_securitygroup_rule_add(self):
Expand Down
28 changes: 28 additions & 0 deletions tests/managers/ordering_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,3 +569,31 @@ def test_get_item_price_id_with_capacity_restriction(self):
price_id = self.ordering.get_item_price_id("8", price1)

self.assertEqual(1234, price_id)

def test_issues1067(self):
# https://github.com/softlayer/softlayer-python/issues/1067
item_mock = self.set_mock('SoftLayer_Product_Package', 'getItems')
item_mock_return = [
{
'id': 10453,
'itemCategory': {'categoryCode': 'server'},
'keyName': 'INTEL_INTEL_XEON_4110_2_10',
'prices': [
{
'capacityRestrictionMaximum': '2',
'capacityRestrictionMinimum': '2',
'capacityRestrictionType': 'PROCESSOR',
'categories': [{'categoryCode': 'os'}],
'id': 201161,
'locationGroupId': None,
'recurringFee': '250',
'setupFee': '0'
}
]
}
]
item_mock.return_value = item_mock_return
item_keynames = ['INTEL_INTEL_XEON_4110_2_10']
package = 'DUAL_INTEL_XEON_PROCESSOR_SCALABLE_FAMILY_4_DRIVES'
result = self.ordering.get_price_id_list(package, item_keynames, None)
self.assertIn(201161, result)
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ commands =
-d locally-disabled \
-d no-else-return \
-d len-as-condition \
-d useless-object-inheritance \
-d consider-using-in \
-d consider-using-dict-comprehension \
-d useless-import-alias \
--max-args=25 \
--max-branches=20 \
--max-statements=65 \
Expand Down