Repository: softlayer/softlayer-python (python)

Issue:
Improve firewall cancel command
I can't seem to cancel this multiVlan firewall. I should be able to cancel it. The help message should also show the available types of firewalls. Also add that information to the detail command
```
$ slcli firewall cancel multiVlan:17438
This action will cancel a firewall from your account. Continue? [y/N]: y
Unknown firewall type: multiVlan

$ slcli firewall cancel 17438
Invalid ID 17438: ID should be of the form xxx:yyy

$ slcli firewall cancel --help
Usage: slcli firewall cancel [OPTIONS] IDENTIFIER

        Cancels a firewall.

┌────┬────────────┬─────────────────────────────┐
│    │ identifier │                             │
│ -h │ --help     │ Show this message and exit. │
└────┴────────────┴─────────────────────────────┘


$ slcli firewall list
             Single Server Firewalls
┌─────────────┬──────┬──────────┬────────────────┐
│ firewall id │ type │ features │ server/vlan id │
├─────────────┼──────┼──────────┼────────────────┤
└─────────────┴──────┴──────────┴────────────────┘
                                                                     Multi Vlan Firewall
┌───────┬─────────────────────┬───────────────────────────────────┬───────────────────┬──────────┬────────────────┬──────────────┬─────────────────┬────────┐
│  Id   │      firewall       │               type                │     Hostname      │ Location │   Public Ip    │  Private Ip  │ Associated vlan │ status │
├───────┼─────────────────────┼───────────────────────────────────┼───────────────────┼──────────┼────────────────┼──────────────┼─────────────────┼────────┤
│ 17438 │ testFirewall-cgallo │ fortigate-security-appliance-10gb │ dft03.pod03.dal13 │  dal13   │ 67.228.206.245 │ 10.37.115.70 │        0        │ ACTIVE │
└───────┴─────────────────────┴───────────────────────────────────┴───────────────────┴──────────┴────────────────┴──────────────┴─────────────────┴────────┘
```

Pull request description:
Fixes firewall cancel so it can properly do multiVlan firewalls
Fixes #1768

`slcli firewall cancel` will now default to `vlan` firewalls, and have an option for server firewalls (which I haven't tested at the moment, but I assume works as it used to).

Also added output to the help for `click.Choices`
![image](https://user-images.githubusercontent.com/7408017/211685240-433fc737-e817-49c2-9a66-59c010ded983.png)


![image](https://user-images.githubusercontent.com/7408017/211685295-2871c838-bdf4-4d20-8727-f7df939991d4.png)


When we get around to #1820 well improve this further by not having to do the firewall type at all hopefully. But for now this should work.

Patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 85f99f15..5d0d1277 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,4 +1,4 @@
-name: Release Snapcraft and PyPi
+name: Release Snapcraft and PyPi (Testing)
 
 on:
   release:
@@ -9,7 +9,7 @@ jobs:
     runs-on: ubuntu-18.04
     strategy:
       matrix:
-        arch: ['armhf','amd64','arm64','ppc64el','s390x']
+        arch: ['armhf','amd64','arm64','ppc64el','s390x','i386']
     steps:
       - name: Install Snapcraft
         uses: samuelmeuli/action-snapcraft@v1.2.0
@@ -44,7 +44,7 @@ jobs:
         --outdir dist/
         .
     - name: Publish 📦 to Test PyPI
-      uses: pypa/gh-action-pypi-publish@release/v1
+      uses: pypa/gh-action-pypi-publish@master
       with:
         user: __token__
         password: ${{ secrets.CGALLO_PYPI }}
diff --git a/SoftLayer/CLI/call_api.py b/SoftLayer/CLI/call_api.py
index 70ff1553..7b23038f 100644
--- a/SoftLayer/CLI/call_api.py
+++ b/SoftLayer/CLI/call_api.py
@@ -150,9 +150,6 @@ def cli(env, service, method, parameters, _id, _filters, mask, limit, offset, or
             '[{"keyName": "NETWORK_MESSAGE_DELIVERY_MANAGE"}]'
         slcli call-api Account getVirtualGuests \\
             --orderBy virttualguests.id=ASC
-        slcli call-api SoftLayer_Notification_Occurrence_Event getAllObjects \\
-            --json-filter='{"endDate": {"operation": "greaterThanDate", \\
-            "options": [{"name":"date", "value": ["10/14/2022"]}]}}' --limit=50
     """
 
     if _filters and json_filter:
diff --git a/SoftLayer/CLI/command.py b/SoftLayer/CLI/command.py
index 5b44da1a..b38f89d7 100644
--- a/SoftLayer/CLI/command.py
+++ b/SoftLayer/CLI/command.py
@@ -19,11 +19,15 @@
 
 
 class OptionHighlighter(RegexHighlighter):
-    """Provides highlighter regex for the Command help"""
+    """Provides highlighter regex for the Command help.
+
+    Defined in SoftLayer\\utils.py console_color_themes()
+    """
     highlights = [
         r"(?P<switch>^\-\w)",  # single options like -v
         r"(?P<option>\-\-[\w\-]+)",  # long options like --verbose
         r"(?P<default_option>\[[^\]]+\])",  # anything between [], usually default options
+        r"(?P<option_choices>Choices: )",
     ]
 
 
@@ -223,6 +227,11 @@ def format_options(self, ctx, formatter):
             if help_record:
                 help_message = param.get_help_record(ctx)[-1]
 
+            # Add Click choices to help message
+            if isinstance(param.type, click.Choice):
+                choices = ", ".join(param.type.choices)
+                help_message += f" Choices: {choices}"
+
             if param.metavar:
                 options += f" {param.metavar}"
             options_table.add_row(opt1, opt2, self.highlighter(help_message))
diff --git a/SoftLayer/CLI/firewall/cancel.py b/SoftLayer/CLI/firewall/cancel.py
index 2bad5ce2..1be9f3a0 100644
--- a/SoftLayer/CLI/firewall/cancel.py
+++ b/SoftLayer/CLI/firewall/cancel.py
@@ -6,29 +6,27 @@
 import SoftLayer
 from SoftLayer.CLI import environment
 from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import firewall
 from SoftLayer.CLI import formatting
 
 
 @click.command(cls=SoftLayer.CLI.command.SLCommand, )
 @click.argument('identifier')
+@click.option('--firewall-type', required=True, show_default=True, default='vlan',
+              type=click.Choice(['vlan', 'server'], case_sensitive=False),
+              help='Firewall type.')
 @environment.pass_env
-def cli(env, identifier):
+def cli(env, identifier, firewall_type):
     """Cancels a firewall."""
 
     mgr = SoftLayer.FirewallManager(env.client)
-    firewall_type, firewall_id = firewall.parse_id(identifier)
 
     if not (env.skip_confirmations or
-            formatting.confirm("This action will cancel a firewall from your "
-                               "account. Continue?")):
+            formatting.confirm("This action will cancel a firewall from your account. Continue?")):
         raise exceptions.CLIAbort('Aborted.')
 
-    if firewall_type in ['vs', 'server']:
-        mgr.cancel_firewall(firewall_id, dedicated=False)
-    elif firewall_type == 'vlan':
-        mgr.cancel_firewall(firewall_id, dedicated=True)
+    if firewall_type == 'server':
+        mgr.cancel_firewall(identifier, dedicated=False)
     else:
-        raise exceptions.CLIAbort('Unknown firewall type: %s' % firewall_type)
+        mgr.cancel_firewall(identifier, dedicated=True)
 
     env.fout('Firewall with id %s is being cancelled!' % identifier)
diff --git a/SoftLayer/CLI/subnet/detail.py b/SoftLayer/CLI/subnet/detail.py
index fa2ff5c7..403f6f03 100644
--- a/SoftLayer/CLI/subnet/detail.py
+++ b/SoftLayer/CLI/subnet/detail.py
@@ -26,8 +26,7 @@ def cli(env, identifier, no_vs, no_hardware):
     subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier,
                                    name='subnet')
 
-    mask = 'mask[ipAddresses[id, ipAddress,note, hardware, virtualGuest], datacenter, virtualGuests, hardware,' \
-           ' networkVlan[networkSpace,primaryRouter]]'
+    mask = 'mask[ipAddresses[id, ipAddress,note], datacenter, virtualGuests, hardware, networkVlan[networkSpace]]'
 
     subnet = mgr.get_subnet(subnet_id, mask=mask)
 
@@ -39,7 +38,7 @@ def cli(env, identifier, no_vs, no_hardware):
     table.add_row(['identifier',
                    '%s/%s' % (subnet['networkIdentifier'],
                               str(subnet['cidr']))])
-    table.add_row(['subnet type', subnet.get('subnetType', formatting.blank())])
+    table.add_row(['subnet type', subnet['subnetType']])
     table.add_row(['network space',
                    utils.lookup(subnet, 'networkVlan', 'networkSpace')])
     table.add_row(['gateway', subnet.get('gateway', formatting.blank())])
@@ -57,13 +56,7 @@ def cli(env, identifier, no_vs, no_hardware):
 
     ip_table = formatting.KeyValueTable(['id', 'ip', 'note'])
     for address in ip_address:
-        description = '-'
-        if address.get('hardware') is not None:
-            description = address['hardware']['fullyQualifiedDomainName']
-        elif address.get('virtualGuest') is not None:
-            description = address['virtualGuest']['fullyQualifiedDomainName']
-        ip_table.add_row([address.get('id'),
-                          address.get('ipAddress') + '/' + description, address.get('note', '-')])
+        ip_table.add_row([address.get('id'), address.get('ipAddress'), address.get('note')])
 
     table.add_row(['ipAddresses', ip_table])
 
diff --git a/SoftLayer/CLI/subnet/list.py b/SoftLayer/CLI/subnet/list.py
index fbe89219..d8018fd7 100644
--- a/SoftLayer/CLI/subnet/list.py
+++ b/SoftLayer/CLI/subnet/list.py
@@ -35,8 +35,8 @@ def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, i
     mgr = SoftLayer.NetworkManager(env.client)
 
     table = formatting.Table([
-        'Id', 'Identifier', 'Network', 'Type', 'VLAN', 'Location', 'Target',
-        'IPs', 'Hardware', 'Vs', 'Tags', 'Note'
+        'id', 'identifier', 'type', 'network_space', 'datacenter', 'vlan_id',
+        'IPs', 'hardware', 'vs',
     ])
     table.sortby = sortby
 
@@ -55,36 +55,18 @@ def cli(env, sortby, datacenter, identifier, subnet_type, network_space, ipv4, i
     )
 
     for subnet in subnets:
-        subnet_type = subnet.get('subnetType', formatting.blank())
-        if subnet_type == 'PRIMARY' or subnet_type == 'PRIMARY_6' or subnet_type == 'ADDITIONAL_PRIMARY':
-            subnet_type = 'Primary'
-        if subnet_type == 'SECONDARY_ON_VLAN':
-            subnet_type = 'Portable'
-        if subnet_type == 'STATIC_IP_ROUTED':
-            subnet_type = 'Static'
-        if subnet_type == 'GLOBAL_IP':
-            subnet_type = 'Global'
-
-        network = subnet.get('addressSpace', formatting.blank())
-        if network is not None:
-            network = str(network).capitalize()
-
-        vlan = utils.lookup(subnet, 'networkVlan', 'fullyQualifiedName')
-        if vlan is None:
-            vlan = 'Unrouted'
         table.add_row([
             subnet['id'],
             '%s/%s' % (subnet['networkIdentifier'], str(subnet['cidr'])),
-            network,
-            subnet_type,
-            vlan,
-            utils.lookup(subnet, 'datacenter', 'name') or formatting.blank(),
-            utils.lookup(subnet, 'endPointIpAddress', 'ipAddress') or formatting.blank(),
+            subnet.get('subnetType', formatting.blank()),
+            utils.lookup(subnet,
+                         'networkVlan',
+                         'networkSpace') or formatting.blank(),
+            utils.lookup(subnet, 'datacenter', 'name',) or formatting.blank(),
+            subnet['networkVlanId'],
             subnet['ipAddressCount'],
             len(subnet['hardware']),
             len(subnet['virtualGuests']),
-            formatting.tags(subnet.get('tagReferences')),
-            utils.lookup(subnet, 'note') or formatting.blank(),
         ])
 
     env.fout(table)
diff --git a/SoftLayer/CLI/ticket/list.py b/SoftLayer/CLI/ticket/list.py
index ea0febfe..8ff27ad1 100644
--- a/SoftLayer/CLI/ticket/list.py
+++ b/SoftLayer/CLI/ticket/list.py
@@ -2,7 +2,6 @@
 # :license: MIT, see LICENSE for more details.
 
 import click
-from SoftLayer import utils
 
 import SoftLayer
 from SoftLayer.CLI import environment
@@ -31,7 +30,7 @@ def cli(env, is_open):
             ticket['serviceProviderResourceId'],
             user,
             click.wrap_text(ticket['title']),
-            utils.clean_time(ticket.get('lastEditDate'), out_format="%Y-%m-%d"),
+            ticket['lastEditDate'],
             ticket['status']['name'],
             ticket.get('updateCount', 0),
             ticket.get('priority', 0)
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Subnet.py b/SoftLayer/fixtures/SoftLayer_Network_Subnet.py
index 702f2207..1ce8f916 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_Subnet.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_Subnet.py
@@ -8,10 +8,7 @@
     'cidr': '26',
     'subnetType': 'ADDITIONAL_PRIMARY',
     'networkVlan': {
-        'networkSpace': 'PUBLIC',
-        'primaryRouter': {
-            'fullyQualifiedDomainName': 'fcr03a.dal13.softlayer.com'
-        }
+        'networkSpace': 'PUBLIC'
     },
     'gateway': '1.2.3.254',
     'broadcastAddress': '1.2.3.255',
diff --git a/SoftLayer/fixtures/SoftLayer_Product_Package.py b/SoftLayer/fixtures/SoftLayer_Product_Package.py
index 9c2b02ec..8ca1c408 100644
--- a/SoftLayer/fixtures/SoftLayer_Product_Package.py
+++ b/SoftLayer/fixtures/SoftLayer_Product_Package.py
@@ -2216,63 +2216,3 @@
         }
     ]
 }]
-
-getVSDiskItemPrices = [
-    {
-        "id": 2255,
-        "locationGroupId": None,
-        "categories": [
-            {
-                "categoryCode": "guest_disk1",
-                "id": 82,
-                "name": "Second Disk",
-                "quantityLimit": 0,
-                "sortOrder": None
-            },
-            {
-                "categoryCode": "guest_disk2",
-                "id": 92,
-                "name": "Third Disk",
-                "quantityLimit": 0,
-                "sortOrder": None
-            },
-            {
-                "categoryCode": "guest_disk3",
-                "id": 93,
-                "name": "Fourth Disk",
-                "quantityLimit": 0,
-                "sortOrder": None
-            },
-            {
-                "categoryCode": "guest_disk4",
-                "id": 116,
-                "name": "Fifth Disk",
-                "quantityLimit": 0,
-                "sortOrder": None
-            }
-        ],
-        "item": {
-            "capacity": "10",
-            "description": "10 GB (SAN)",
-            "keyName": "GUEST_DISK_10_GB_SAN"
-        }
-    },
-    {
-        "id": 1639,
-        "locationGroupId": None,
-        "categories": [
-            {
-                "categoryCode": "guest_disk0",
-                "id": 81,
-                "name": "First Disk",
-                "quantityLimit": 0,
-                "sortOrder": None
-            }
-        ],
-        "item": {
-            "capacity": "10",
-            "description": "10 GB (SAN)",
-            "keyName": "GUEST_DISK_10_GB_SAN"
-        }
-    }
-]
diff --git a/SoftLayer/managers/firewall.py b/SoftLayer/managers/firewall.py
index 0c4d10bb..d5b6136c 100644
--- a/SoftLayer/managers/firewall.py
+++ b/SoftLayer/managers/firewall.py
@@ -157,11 +157,9 @@ def _get_fwl_billing_item(self, firewall_id, dedicated=False):
             firewall_service = self.client['Network_Component_Firewall']
         firewall = firewall_service.getObject(id=firewall_id, mask=mask)
         if firewall is None:
-            raise exceptions.SoftLayerError(
-                "Unable to find firewall %d" % firewall_id)
+            raise exceptions.SoftLayerError(f"Unable to find firewall {firewall_id}")
         if firewall.get('billingItem') is None:
-            raise exceptions.SoftLayerError(
-                "Unable to find billing item for firewall %d" % firewall_id)
+            raise exceptions.SoftLayerError(f"Unable to find billing item for firewall {firewall_id}")
 
         return firewall['billingItem']
 
diff --git a/SoftLayer/managers/network.py b/SoftLayer/managers/network.py
index ab9e7164..327c1c80 100644
--- a/SoftLayer/managers/network.py
+++ b/SoftLayer/managers/network.py
@@ -34,10 +34,7 @@
                                 'usableIpAddressCount',
                                 'note',
                                 'tagReferences[tag]',
-                                'networkVlan[id, primaryRouter, networkSpace,fullyQualifiedName]',
-                                'addressSpace',
-                                'endPointIpAddress'
-                                ])
+                                'networkVlan[id,networkSpace]'])
 DEFAULT_VLAN_MASK = ','.join([
     'firewallInterfaces',
     'hardwareCount',
@@ -506,6 +503,9 @@ def list_subnets(self, identifier=None, datacenter=None, version=0,
             _filter['subnets']['version'] = utils.query_filter(version)
         if subnet_type:
             _filter['subnets']['subnetType'] = utils.query_filter(subnet_type)
+        else:
+            # This filters out global IPs from the subnet listing.
+            _filter['subnets']['subnetType'] = {'operation': '!= GLOBAL_IP'}
         if network_space:
             _filter['subnets']['networkVlan']['networkSpace'] = (
                 utils.query_filter(network_space))
diff --git a/SoftLayer/managers/ticket.py b/SoftLayer/managers/ticket.py
index 006ebb8a..bbd2eddd 100644
--- a/SoftLayer/managers/ticket.py
+++ b/SoftLayer/managers/ticket.py
@@ -39,7 +39,7 @@ def list_tickets(self, open_status=True, closed_status=True):
                 call = 'getClosedTickets'
             else:
                 raise ValueError("open_status and closed_status cannot both be False")
-        return self.client.call('Account', call, mask=mask, iter=False, limit=100)
+        return self.client.call('Account', call, mask=mask, iter=True)
 
     def list_subjects(self):
         """List all ticket subjects."""
diff --git a/SoftLayer/managers/vs.py b/SoftLayer/managers/vs.py
index c749e96c..92a37998 100644
--- a/SoftLayer/managers/vs.py
+++ b/SoftLayer/managers/vs.py
@@ -1068,11 +1068,8 @@ def upgrade(self, instance_id, cpus=None, memory=None, nic_speed=None, public=Tr
                                                        'Unable to find %s option with value %s' % (
                                                            ('disk', disk_guest.get('capacity'))))
 
-                category_id = self.get_disk_category_id_by_disk_number(disk_guest.get('capacity'), disk_number)
-                if category_id is None:
-                    raise exceptions.SoftLayerError('Invalid disk number to this disk capacity')
                 category = {'categories': [{
-                    'id': category_id,
+                    'categoryCode': 'guest_disk' + str(disk_number),
                     'complexType': "SoftLayer_Product_Item_Category"}],
                     'complexType': 'SoftLayer_Product_Item_Price',
                     'id': price_id}
@@ -1104,43 +1101,6 @@ def upgrade(self, instance_id, cpus=None, memory=None, nic_speed=None, public=Tr
             return True
         return False
 
-    def get_disk_category_id_by_disk_number(self, capacity, disk_number):
-        """Uses Product_Package::getItemPrices to get all disk items with its categories and
-
-        disk_key_names dictionary to convert disk numbers (int) to ordinal numbers (string)
-        """
-        disk_key_names = {
-            1: "First Disk",
-            2: "Second Disk",
-            3: "Third Disk",
-            4: "Fourth Disk",
-            5: "Fifth Disk",
-        }
-        category_to_request = disk_key_names.get(disk_number)
-        if category_to_request is None:
-            return None
-
-        key_name = "*= GUEST_DISK_"+str(capacity)+"_GB_SAN"
-        object_filter = {
-            "itemPrices": {
-                "locationGroupId": {"operation": "is null"},
-                "item": {
-                    "keyName": {"operation": key_name}
-                }
-            }
-        }
-        mask = "mask[id,locationGroupId,item[capacity,description,keyName],categories]"
-        disk_items = self.client.call(
-            'SoftLayer_Product_Package', 'getItemPrices', id=46, mask=mask, filter=object_filter
-        )
-        category_id = None
-        for disk_item in disk_items:
-            for category in disk_item.get('categories'):
-                if category.get('name') == category_to_request:
-                    category_id = category.get('id')
-                    break
-        return category_id
-
     def order_guest(self, guest_object, test=False):
         """Uses Product_Order::placeOrder to create a virtual guest.
 
diff --git a/SoftLayer/utils.py b/SoftLayer/utils.py
index df6d3438..fc0afedf 100644
--- a/SoftLayer/utils.py
+++ b/SoftLayer/utils.py
@@ -481,6 +481,7 @@ def console_color_themes(theme):
                 "default_option": "light_coral",
                 "option_keyword": "bold dark_cyan",
                 "args_keyword": "bold green4",
+                "option_choices": "gold3",
             })
         )
     return Console(theme=Theme(
@@ -497,6 +498,7 @@ def console_color_themes(theme):
             "default_option": "light_pink1",
             "option_keyword": "bold cyan",
             "args_keyword": "bold green",
+            "option_choices": "gold3",
         })
     )
 
diff --git a/setup.py b/setup.py
index 0ace6059..f1a53e70 100644
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,7 @@
         'prompt_toolkit >= 2',
         'pygments >= 2.0.0',
         'urllib3 >= 1.24',
-        'rich == 13.0.0'
+        'rich == 12.6.0'
     ],
     keywords=['softlayer', 'cloud', 'slcli'],
     classifiers=[
diff --git a/tools/requirements.txt b/tools/requirements.txt
index d57b36ad..95597deb 100644
--- a/tools/requirements.txt
+++ b/tools/requirements.txt
@@ -4,6 +4,6 @@ requests >= 2.20.0
 prompt_toolkit >= 2
 pygments >= 2.0.0
 urllib3 >= 1.24
-rich == 13.0.0
+rich == 12.6.0
 # only used for soap transport
 # softlayer-zeep >= 5.0.0


Test patch:
diff --git a/tests/CLI/modules/account_tests.py b/tests/CLI/modules/account_tests.py
index b8932a8f..b02b7303 100644
--- a/tests/CLI/modules/account_tests.py
+++ b/tests/CLI/modules/account_tests.py
@@ -71,9 +71,8 @@ def test_invoice_detail_csv_output_format(self):
         result_output = result.output.replace('\r', '').split('\n')
         self.assert_no_fail(result)
         self.assertEqual(result_output[0], 'Item Id,Category,Description,Single,Monthly,Create Date,Location')
-        self.assertEqual(result_output[1], '724951323,Private (only) Secondary VLAN IP Addresses,'
-                                           '64 Portable Private IP Addresses (bleg.beh.com),'
-                                           '$0.00,$0.00,2018-04-04,fra02')
+        self.assertEqual(result_output[1], '724951323,Private (only) Secondary VLAN IP Addresses,64 Portable Private'
+                                           ' IP Addresses (bleg.beh.com),$0.00,$0.00,2018-04-04,fra02')
 
     # slcli account invoices
     def test_invoices(self):
diff --git a/tests/CLI/modules/ticket_tests.py b/tests/CLI/modules/ticket_tests.py
index fb5ff8ec..4fbdbff0 100644
--- a/tests/CLI/modules/ticket_tests.py
+++ b/tests/CLI/modules/ticket_tests.py
@@ -39,7 +39,7 @@ def test_list(self):
             'assigned_user': 'John Smith',
             'Case_Number': 'CS123456',
             'id': 102,
-            'last_edited': '2013-08-01',
+            'last_edited': '2013-08-01T14:16:47-07:00',
             'priority': 0,
             'status': 'Open',
             'title': 'Cloud Instance Cancellation - 08/01/13',
diff --git a/tests/CLI/modules/vs/vs_tests.py b/tests/CLI/modules/vs/vs_tests.py
index 029fea99..86d9c5ee 100644
--- a/tests/CLI/modules/vs/vs_tests.py
+++ b/tests/CLI/modules/vs/vs_tests.py
@@ -10,7 +10,6 @@
 from unittest import mock as mock
 
 from SoftLayer.CLI import exceptions
-from SoftLayer.fixtures import SoftLayer_Product_Package
 from SoftLayer.fixtures import SoftLayer_Virtual_Guest as SoftLayer_Virtual_Guest
 from SoftLayer import SoftLayerAPIError
 from SoftLayer import SoftLayerError
@@ -566,8 +565,6 @@ def test_upgrade(self, confirm_mock):
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_upgrade_disk(self, confirm_mock):
         confirm_mock.return_value = True
-        mock = self.set_mock('SoftLayer_Product_Package', 'getItemPrices')
-        mock.return_value = SoftLayer_Product_Package.getVSDiskItemPrices
         result = self.run_command(['vs', 'upgrade', '100', '--flavor=M1_64X512X100',
                                    '--resize-disk=10', '1', '--resize-disk=10', '2'])
         self.assert_no_fail(result)
@@ -601,8 +598,6 @@ def test_upgrade_with_flavor(self, confirm_mock):
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_upgrade_with_add_disk(self, confirm_mock):
         confirm_mock.return_value = True
-        mock = self.set_mock('SoftLayer_Product_Package', 'getItemPrices')
-        mock.return_value = SoftLayer_Product_Package.getVSDiskItemPrices
         result = self.run_command(['vs', 'upgrade', '100', '--add-disk=10', '--add-disk=10'])
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Product_Order', 'placeOrder')
diff --git a/tests/managers/network_tests.py b/tests/managers/network_tests.py
index aa86fe24..12cee4bc 100644
--- a/tests/managers/network_tests.py
+++ b/tests/managers/network_tests.py
@@ -310,6 +310,15 @@ def test_list_global_ips_with_filter(self):
                                 filter=_filter)
 
     def test_list_subnets_default(self):
+        result = self.network.list_subnets()
+
+        self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
+        _filter = {'subnets': {'subnetType': {'operation': '!= GLOBAL_IP'}}}
+        self.assert_called_with('SoftLayer_Account', 'getSubnets',
+                                mask='mask[%s]' % network.DEFAULT_SUBNET_MASK,
+                                filter=_filter)
+
+    def test_list_subnets_with_filters(self):
         result = self.network.list_subnets(
             identifier='10.0.0.1',
             datacenter='dal00',
@@ -317,6 +326,7 @@ def test_list_subnets_default(self):
             subnet_type='PRIMARY',
             network_space='PUBLIC',
         )
+
         self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
         _filter = {
             'subnets': {
@@ -334,14 +344,6 @@ def test_list_subnets_default(self):
                                 mask='mask[%s]' % network.DEFAULT_SUBNET_MASK,
                                 filter=_filter)
 
-    def test_list_subnets_with_filters(self):
-        result = self.network.list_subnets()
-
-        self.assertEqual(result, fixtures.SoftLayer_Account.getSubnets)
-
-        self.assert_called_with('SoftLayer_Account', 'getSubnets',
-                                mask='mask[%s]' % network.DEFAULT_SUBNET_MASK)
-
     def test_list_vlans_default(self):
         result = self.network.list_vlans()