Repository: softlayer/softlayer-python

Issue:
Modernize pypi stuff
This project is still uploading things to pypi.org/legacy... so figure out how to not be legacy.

Also fix the auto publish: https://github.com/softlayer/softlayer-python/actions/runs/2885493658

Discussion:

Patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5d0d1277..85f99f15 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,4 +1,4 @@
-name: Release Snapcraft and PyPi (Testing)
+name: Release Snapcraft and PyPi
 
 on:
   release:
@@ -9,7 +9,7 @@ jobs:
     runs-on: ubuntu-18.04
     strategy:
       matrix:
-        arch: ['armhf','amd64','arm64','ppc64el','s390x','i386']
+        arch: ['armhf','amd64','arm64','ppc64el','s390x']
     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@master
+      uses: pypa/gh-action-pypi-publish@release/v1
       with:
         user: __token__
         password: ${{ secrets.CGALLO_PYPI }}
diff --git a/SoftLayer/CLI/subnet/detail.py b/SoftLayer/CLI/subnet/detail.py
index 905f8e0b..403f6f03 100644
--- a/SoftLayer/CLI/subnet/detail.py
+++ b/SoftLayer/CLI/subnet/detail.py
@@ -38,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())])
diff --git a/SoftLayer/managers/network.py b/SoftLayer/managers/network.py
index 5e73e0b4..327c1c80 100644
--- a/SoftLayer/managers/network.py
+++ b/SoftLayer/managers/network.py
@@ -503,7 +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))
@@ -696,7 +698,7 @@ def _list_subnets_by_identifier(self, identifier):
         """
         identifier = identifier.split('/', 1)[0]
 
-        results = self.list_subnets()
+        results = self.list_subnets(identifier=identifier, mask='id')
         return [result['id'] for result in results]
 
     def _list_vlans_by_name(self, name):


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/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()