Repository: softlayer/softlayer-python
Pull request #965 (2018-04-16 20:37:57)

Issues904 - issues with locationGroupId
XMLRPC returns locationGroupId = '', but REST returns locationGroupId = None

+ locationGroupId now just checks for True/False since both None and '' == False
+ refactors a bit of the storage_utils manager to reduce duplicated code
+ fixed a problem with transactions not showing up on the slcli hw list page


Patch:
diff --git a/SoftLayer/CLI/hardware/list.py b/SoftLayer/CLI/hardware/list.py
index 92abddf7..2e264e3a 100644
--- a/SoftLayer/CLI/hardware/list.py
+++ b/SoftLayer/CLI/hardware/list.py
@@ -20,10 +20,7 @@
     column_helper.Column(
         'action',
         lambda server: formatting.active_txn(server),
-        mask='''
-        mask(SoftLayer_Hardware_Server)[activeTransaction[
-            id,transactionStatus[name,friendlyName]
-        ]]'''),
+        mask='activeTransaction[id, transactionStatus[name, friendlyName]]'),
     column_helper.Column('power_state', ('powerState', 'name')),
     column_helper.Column(
         'created_by',
@@ -52,22 +49,17 @@
 @click.option('--memory', '-m', help='Filter by memory in gigabytes')
 @click.option('--network', '-n', help='Filter by network port speed in Mbps')
 @helpers.multi_option('--tag', help='Filter by tags')
-@click.option('--sortby', help='Column to sort by',
-              default='hostname',
-              show_default=True)
+@click.option('--sortby', help='Column to sort by', default='hostname', show_default=True)
 @click.option('--columns',
               callback=column_helper.get_formatter(COLUMNS),
-              help='Columns to display. [options: %s]'
-              % ', '.join(column.name for column in COLUMNS),
+              help='Columns to display. [options: %s]' % ', '.join(column.name for column in COLUMNS),
               default=','.join(DEFAULT_COLUMNS),
               show_default=True)
 @environment.pass_env
-def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag,
-        columns):
+def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag, columns):
     """List hardware servers."""
 
     manager = SoftLayer.HardwareManager(env.client)
-
     servers = manager.list_hardware(hostname=hostname,
                                     domain=domain,
                                     cpus=cpu,
@@ -75,7 +67,7 @@ def cli(env, sortby, cpu, domain, datacenter, hostname, memory, network, tag,
                                     datacenter=datacenter,
                                     nic_speed=network,
                                     tags=tag,
-                                    mask=columns.mask())
+                                    mask="mask(SoftLayer_Hardware_Server)[%s]" % columns.mask())
 
     table = formatting.Table(columns.columns)
     table.sortby = sortby
diff --git a/SoftLayer/fixtures/SoftLayer_Location_Datacenter.py b/SoftLayer/fixtures/SoftLayer_Location_Datacenter.py
deleted file mode 100644
index 0dceb294..00000000
--- a/SoftLayer/fixtures/SoftLayer_Location_Datacenter.py
+++ /dev/null
@@ -1,4 +0,0 @@
-getDatacenters = [{
-    'id': 0,
-    'name': 'dal05'
-}]
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Vlan.py b/SoftLayer/fixtures/SoftLayer_Network_Vlan.py
index 1c54d697..5c7d7232 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_Vlan.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_Vlan.py
@@ -1,1 +1,9 @@
-getObject = {'primaryRouter': {'datacenter': {'id': 1234}}}
+getObject = {
+    'primaryRouter': {
+        'datacenter': {'id': 1234, 'longName': 'TestDC'},
+        'fullyQualifiedDomainName': 'fcr01.TestDC'
+    },
+    'id': 1234,
+    'vlanNumber': 4444,
+    'firewallInterfaces': None
+}
diff --git a/SoftLayer/fixtures/SoftLayer_Product_Package.py b/SoftLayer/fixtures/SoftLayer_Product_Package.py
index 9b891582..deef5825 100644
--- a/SoftLayer/fixtures/SoftLayer_Product_Package.py
+++ b/SoftLayer/fixtures/SoftLayer_Product_Package.py
@@ -666,6 +666,90 @@
     ]
 }
 
+
+SAAS_REST_PACKAGE = {
+    'categories': [
+        {'categoryCode': 'storage_as_a_service'}
+    ],
+    'id': 759,
+    'name': 'Storage As A Service (StaaS)',
+    'items': [
+        {
+            'capacity': '0',
+            'keyName': '',
+            'prices': [
+                {
+                    'id': 189433,
+                    'categories': [
+                        {'categoryCode': 'storage_as_a_service'}
+                    ],
+                    'locationGroupId': None
+                }
+            ]
+        }, {
+            'capacity': '20',
+            'keyName': '',
+            'prices': [
+                {
+                    'capacityRestrictionMaximum': '200',
+                    'capacityRestrictionMinimum': '200',
+                    'capacityRestrictionType': 'STORAGE_TIER_LEVEL',
+                    'categories': [
+                        {'categoryCode': 'storage_snapshot_space'}
+                    ],
+                    'id': 193853,
+                    'locationGroupId': None
+                }
+            ]
+        }, {
+            'capacity': '0',
+            'capacityMaximum': '1999',
+            'capacityMinimum': '1000',
+            'itemCategory': {'categoryCode': 'performance_storage_space'},
+            'keyName': '1000_1999_GBS',
+            'prices': [
+                {
+                    'id': 190113,
+                    'categories': [
+                        {'categoryCode': 'performance_storage_space'}
+                    ],
+                    'locationGroupId': None
+                }
+            ]
+        }, {
+            'capacity': '0',
+            'capacityMaximum': '20000',
+            'capacityMinimum': '100',
+            'keyName': '',
+            'itemCategory': {'categoryCode': 'performance_storage_iops'},
+            'prices': [
+                {
+                    'capacityRestrictionMaximum': '1999',
+                    'capacityRestrictionMinimum': '1000',
+                    'capacityRestrictionType': 'STORAGE_SPACE',
+                    'categories': [
+                        {'categoryCode': 'performance_storage_iops'}
+                    ],
+                    'id': 190173,
+                    'locationGroupId': None
+                }
+            ]
+        }, {
+            'capacity': '0',
+            'keyName': '',
+            'prices': [
+                {
+                    'categories': [
+                        {'categoryCode': 'storage_file'}
+                    ],
+                    'id': 189453,
+                    'locationGroupId': None
+                }
+            ]
+        }
+    ]
+}
+
 activePreset1 = {
     'description': 'Single Xeon 1270, 8GB Ram, 2x1TB SATA disks, Non-RAID',
     'id': 64,
diff --git a/SoftLayer/managers/ordering.py b/SoftLayer/managers/ordering.py
index 4ac1b150..58860627 100644
--- a/SoftLayer/managers/ordering.py
+++ b/SoftLayer/managers/ordering.py
@@ -354,7 +354,7 @@ def get_price_id_list(self, package_keyname, item_keynames):
             # can take that ID and create the proper price for us in the location
             # in which the order is made
             price_id = [p['id'] for p in matching_item['prices']
-                        if p['locationGroupId'] is None][0]
+                        if not p['locationGroupId']][0]
             prices.append(price_id)
 
         return prices
diff --git a/SoftLayer/managers/storage_utils.py b/SoftLayer/managers/storage_utils.py
index b6e1a3d4..07f19bd7 100644
--- a/SoftLayer/managers/storage_utils.py
+++ b/SoftLayer/managers/storage_utils.py
@@ -112,17 +112,11 @@ def find_price_by_category(package, price_category):
     :return: Returns the price for the given category, or an error if not found
     """
     for item in package['items']:
-        for price in item['prices']:
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'], price_category):
-                continue
+        price_id = _find_price_id(item['prices'], price_category)
+        if price_id:
+            return price_id
 
-            return {'id': price['id']}
-
-    raise ValueError("Could not find price with the category, %s"
-                     % price_category)
+    raise ValueError("Could not find price with the category, %s" % price_category)
 
 
 def find_ent_space_price(package, category, size, tier_level):
@@ -141,25 +135,14 @@ def find_ent_space_price(package, category, size, tier_level):
     else:  # category == 'endurance'
         category_code = 'performance_storage_space'
 
+    level = ENDURANCE_TIERS.get(tier_level)
+
     for item in package['items']:
         if int(item['capacity']) != size:
             continue
-
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            level = ENDURANCE_TIERS.get(tier_level)
-            if price['capacityRestrictionType'] != 'STORAGE_TIER_LEVEL'\
-                    or level < int(price['capacityRestrictionMinimum'])\
-                    or level > int(price['capacityRestrictionMaximum']):
-                continue
-
-            if not _has_category(price['categories'], category_code):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], category_code, 'STORAGE_TIER_LEVEL', level)
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for %s storage space" % category)
 
@@ -178,15 +161,9 @@ def find_ent_endurance_tier_price(package, tier_level):
         else:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'], 'storage_tier_level'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'storage_tier_level')
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for endurance tier level")
 
@@ -225,16 +202,9 @@ def find_perf_space_price(package, size):
         if int(item['capacity']) != size:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'],
-                                 'performance_storage_space'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'performance_storage_space')
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find performance space price for this volume")
 
@@ -251,21 +221,9 @@ def find_perf_iops_price(package, size, iops):
         if int(item['capacity']) != int(iops):
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'],
-                                 'performance_storage_iops'):
-                continue
-
-            if price['capacityRestrictionType'] != 'STORAGE_SPACE'\
-                    or size < int(price['capacityRestrictionMinimum'])\
-                    or size > int(price['capacityRestrictionMaximum']):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'performance_storage_iops', 'STORAGE_SPACE', size)
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for iops for the given volume")
 
@@ -294,16 +252,9 @@ def find_saas_endurance_space_price(package, size, tier_level):
         if size < capacity_minimum or size > capacity_maximum:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'],
-                                 'performance_storage_space'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'performance_storage_space')
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for endurance storage space")
 
@@ -326,15 +277,9 @@ def find_saas_endurance_tier_price(package, tier_level):
         if int(item['capacity']) != target_capacity:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'], 'storage_tier_level'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'storage_tier_level')
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for endurance tier level")
 
@@ -364,17 +309,9 @@ def find_saas_perform_space_price(package, size):
         key_name = '{0}_{1}_GBS'.format(capacity_minimum, capacity_maximum)
         if item['keyName'] != key_name:
             continue
-
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'],
-                                 'performance_storage_space'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'performance_storage_space')
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for performance storage space")
 
@@ -402,21 +339,9 @@ def find_saas_perform_iops_price(package, size, iops):
         if iops < capacity_minimum or iops > capacity_maximum:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if not _has_category(price['categories'],
-                                 'performance_storage_iops'):
-                continue
-
-            if price['capacityRestrictionType'] != 'STORAGE_SPACE'\
-                    or size < int(price['capacityRestrictionMinimum'])\
-                    or size > int(price['capacityRestrictionMaximum']):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'performance_storage_iops', 'STORAGE_SPACE', size)
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for iops for the given volume")
 
@@ -441,21 +366,9 @@ def find_saas_snapshot_space_price(package, size, tier=None, iops=None):
         if int(item['capacity']) != size:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if target_restriction_type != price['capacityRestrictionType']\
-                    or target_value < int(price['capacityRestrictionMinimum'])\
-                    or target_value > int(price['capacityRestrictionMaximum']):
-                continue
-
-            if not _has_category(price['categories'],
-                                 'storage_snapshot_space'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(item['prices'], 'storage_snapshot_space', target_restriction_type, target_value)
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for snapshot space")
 
@@ -481,21 +394,14 @@ def find_saas_replication_price(package, tier=None, iops=None):
         if item['keyName'] != target_item_keyname:
             continue
 
-        for price in item['prices']:
-            # Only collect prices from valid location groups.
-            if price['locationGroupId'] != '':
-                continue
-
-            if target_restriction_type != price['capacityRestrictionType']\
-                    or target_value < int(price['capacityRestrictionMinimum'])\
-                    or target_value > int(price['capacityRestrictionMaximum']):
-                continue
-
-            if not _has_category(price['categories'],
-                                 'performance_storage_replication'):
-                continue
-
-            return {'id': price['id']}
+        price_id = _find_price_id(
+            item['prices'],
+            'performance_storage_replication',
+            target_restriction_type,
+            target_value
+        )
+        if price_id:
+            return price_id
 
     raise ValueError("Could not find price for replicant volume")
 
@@ -1090,3 +996,21 @@ def _has_category(categories, category_code):
 
 def _staas_version_is_v2_or_above(volume):
     return int(volume['staasVersion']) > 1 and volume['hasEncryptionAtRest']
+
+
+def _find_price_id(prices, category, restriction_type=None, restriction_value=None):
+    for price in prices:
+        # Only collect prices from valid location groups.
+        if price['locationGroupId']:
+            continue
+
+        if restriction_type is not None and restriction_value is not None:
+            if restriction_type != price['capacityRestrictionType']\
+                    or restriction_value < int(price['capacityRestrictionMinimum'])\
+                    or restriction_value > int(price['capacityRestrictionMaximum']):
+                continue
+
+        if not _has_category(price['categories'], category):
+            continue
+
+        return {'id': price['id']}


Test patch:
diff --git a/tests/CLI/modules/vlan_tests.py b/tests/CLI/modules/vlan_tests.py
new file mode 100644
index 00000000..d77f935e
--- /dev/null
+++ b/tests/CLI/modules/vlan_tests.py
@@ -0,0 +1,49 @@
+"""
+    SoftLayer.tests.CLI.modules.vlan_tests
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    :license: MIT, see LICENSE for more details.
+"""
+from SoftLayer import testing
+
+
+class VlanTests(testing.TestCase):
+
+    def test_detail(self):
+        result = self.run_command(['vlan', 'detail', '1234'])
+        self.assert_no_fail(result)
+
+    def test_detail_no_vs(self):
+        result = self.run_command(['vlan', 'detail', '1234', '--no-vs'])
+        self.assert_no_fail(result)
+
+    def test_detail_no_hardware(self):
+        result = self.run_command(['vlan', 'detail', '1234', '--no-hardware'])
+        self.assert_no_fail(result)
+
+    def test_subnet_list(self):
+        vlan_mock = self.set_mock('SoftLayer_Network_Vlan', 'getObject')
+        getObject = {
+            'primaryRouter': {
+                'datacenter': {'id': 1234, 'longName': 'TestDC'},
+                'fullyQualifiedDomainName': 'fcr01.TestDC'
+            },
+            'id': 1234,
+            'vlanNumber': 4444,
+            'firewallInterfaces': None,
+            'subnets': [
+                {
+                    'id': 99,
+                    'networkIdentifier': 1111111,
+                    'netmask': '255.255.255.0',
+                    'gateway': '12.12.12.12',
+                    'subnetType': 'TEST',
+                    'usableIpAddressCount': 1
+
+                }
+
+            ]
+        }
+        vlan_mock.return_value = getObject
+        result = self.run_command(['vlan', 'detail', '1234'])
+        self.assert_no_fail(result)
diff --git a/tests/managers/ordering_tests.py b/tests/managers/ordering_tests.py
index f3ccfaaa..c27a9ce7 100644
--- a/tests/managers/ordering_tests.py
+++ b/tests/managers/ordering_tests.py
@@ -102,7 +102,21 @@ def test_verify_quote(self):
         self.assertEqual(result, fixtures.SoftLayer_Product_Order.verifyOrder)
         self.assert_called_with('SoftLayer_Product_Order', 'verifyOrder')
 
-    def test_order_quote(self):
+    def test_order_quote_virtual_guest(self):
+        guest_quote = {
+            'orderContainers': [{
+                'presetId': '',
+                'prices': [{
+                    'id': 1921
+                }],
+                'quantity': 1,
+                'packageId': 46,
+                'useHourlyPricing': '',
+            }],
+        }
+
+        mock = self.set_mock('SoftLayer_Billing_Order_Quote', 'getRecalculatedOrderContainer')
+        mock.return_value = guest_quote
         result = self.ordering.order_quote(1234,
                                            [{'hostname': 'test1',
                                              'domain': 'example.com'}],
@@ -122,6 +136,17 @@ def test_generate_order_template(self):
                                   'prices': [{'id': 1921}],
                                   'quantity': 1})
 
+    def test_generate_order_template_virtual(self):
+        result = self.ordering.generate_order_template(
+            1234, [{'hostname': 'test1', 'domain': 'example.com'}], quantity=1)
+        self.assertEqual(result, {'presetId': None,
+                                  'hardware': [{'domain': 'example.com',
+                                                'hostname': 'test1'}],
+                                  'useHourlyPricing': '',
+                                  'packageId': 50,
+                                  'prices': [{'id': 1921}],
+                                  'quantity': 1})
+
     def test_generate_order_template_extra_quantity(self):
         self.assertRaises(ValueError,
                           self.ordering.generate_order_template,
@@ -150,6 +175,18 @@ def test_list_categories(self):
         mock_get_pkg.assert_called_once_with('PACKAGE_KEYNAME', mask='id')
         self.assertEqual(p_mock.return_value, cats)
 
+    def test_list_categories_filters(self):
+        p_mock = self.set_mock('SoftLayer_Product_Package', 'getConfiguration')
+        p_mock.return_value = ['cat1', 'cat2']
+        fake_filter = {'test': {'operation': 1234}}
+        with mock.patch.object(self.ordering, 'get_package_by_key') as mock_get_pkg:
+            mock_get_pkg.return_value = {'id': 1234}
+
+            cats = self.ordering.list_categories('PACKAGE_KEYNAME', filter=fake_filter)
+
+        self.assert_called_with('SoftLayer_Product_Package', 'getConfiguration', filter=fake_filter)
+        self.assertEqual(p_mock.return_value, cats)
+
     def test_list_items(self):
         p_mock = self.set_mock('SoftLayer_Product_Package', 'getItems')
         p_mock.return_value = ['item1', 'item2']
@@ -412,3 +449,37 @@ def test_get_location_id_exception(self):
         locations = self.set_mock('SoftLayer_Location', 'getDatacenters')
         locations.return_value = []
         self.assertRaises(exceptions.SoftLayerError,  self.ordering.get_location_id, "BURMUDA")
+
+    def test_get_location_id_int(self):
+        dc_id = self.ordering.get_location_id(1234)
+        self.assertEqual(1234, dc_id)
+
+    def test_location_group_id_none(self):
+        # RestTransport uses None for empty locationGroupId
+        price1 = {'id': 1234, 'locationGroupId': None}
+        item1 = {'id': 1111, 'keyName': 'ITEM1', 'prices': [price1]}
+        price2 = {'id': 5678, 'locationGroupId': None}
+        item2 = {'id': 2222, 'keyName': 'ITEM2', 'prices': [price2]}
+
+        with mock.patch.object(self.ordering, 'list_items') as list_mock:
+            list_mock.return_value = [item1, item2]
+
+            prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM2'])
+
+        list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, keyName, prices')
+        self.assertEqual([price1['id'], price2['id']], prices)
+
+    def test_location_groud_id_empty(self):
+        # XMLRPCtransport uses '' for empty locationGroupId
+        price1 = {'id': 1234, 'locationGroupId': ''}
+        item1 = {'id': 1111, 'keyName': 'ITEM1', 'prices': [price1]}
+        price2 = {'id': 5678, 'locationGroupId': ""}
+        item2 = {'id': 2222, 'keyName': 'ITEM2', 'prices': [price2]}
+
+        with mock.patch.object(self.ordering, 'list_items') as list_mock:
+            list_mock.return_value = [item1, item2]
+
+            prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM2'])
+
+        list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, keyName, prices')
+        self.assertEqual([price1['id'], price2['id']], prices)
diff --git a/tests/managers/storage_utils_tests.py b/tests/managers/storage_utils_tests.py
index 7c32e083..f6934eda 100644
--- a/tests/managers/storage_utils_tests.py
+++ b/tests/managers/storage_utils_tests.py
@@ -8,7 +8,8 @@
 import copy
 import SoftLayer
 from SoftLayer import exceptions
-from SoftLayer import fixtures
+from SoftLayer.fixtures import SoftLayer_Network_Storage
+from SoftLayer.fixtures import SoftLayer_Product_Package
 from SoftLayer.managers import storage_utils
 from SoftLayer import testing
 
@@ -83,8 +84,8 @@ def test_get_package_no_packages_found(self):
     def test_get_package_more_than_one_package_found(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.SAAS_PACKAGE,
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.SAAS_PACKAGE,
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
         exception = self.assertRaises(
@@ -100,12 +101,12 @@ def test_get_package_more_than_one_package_found(self):
 
     def test_get_package(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
         result = storage_utils.get_package(self.block, 'storage_as_a_service')
 
         self.assertEqual(
-            fixtures.SoftLayer_Product_Package.SAAS_PACKAGE,
+            SoftLayer_Product_Package.SAAS_PACKAGE,
             result
         )
 
@@ -241,7 +242,7 @@ def test_find_price_by_category_category_not_found(self):
                          "Could not find price with the category, "
                          "storage_as_a_service")
 
-    def test_find_price_by_category(self):
+    def test_find_price_by_category_empty(self):
         package = {
             'items': [
                 {'capacity': '0',
@@ -259,6 +260,24 @@ def test_find_price_by_category(self):
 
         self.assertEqual({'id': 189433}, result)
 
+    def test_find_price_by_category_none(self):
+        package = {
+            'items': [
+                {'capacity': '0',
+                 'prices': [
+                     {'id': 189433,
+                      'categories': [
+                          {'categoryCode': 'storage_as_a_service'}
+                      ],
+                      'locationGroupId': None}
+                 ]}
+            ]}
+
+        result = storage_utils.find_price_by_category(
+            package, 'storage_as_a_service')
+
+        self.assertEqual({'id': 189433}, result)
+
     # ---------------------------------------------------------------------
     # Tests for find_ent_space_price()
     # ---------------------------------------------------------------------
@@ -2673,7 +2692,7 @@ def test_find_snapshot_schedule_id(self):
     # Tests for prepare_snapshot_order_object()
     # ---------------------------------------------------------------------
     def test_prep_snapshot_order_billing_item_cancelled(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['billingItem']
 
         exception = self.assertRaises(
@@ -2688,7 +2707,7 @@ def test_prep_snapshot_order_billing_item_cancelled(self):
         )
 
     def test_prep_snapshot_order_invalid_billing_item_category_code(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['billingItem']['categoryCode'] = 'invalid_type_ninja_cat'
 
         exception = self.assertRaises(
@@ -2705,9 +2724,9 @@ def test_prep_snapshot_order_invalid_billing_item_category_code(self):
 
     def test_prep_snapshot_order_saas_endurance_tier_is_not_none(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME
+        mock_volume = SoftLayer_Network_Storage.STAAS_TEST_VOLUME
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -2728,9 +2747,9 @@ def test_prep_snapshot_order_saas_endurance_tier_is_not_none(self):
 
     def test_prep_snapshot_order_saas_endurance_upgrade(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME
+        mock_volume = SoftLayer_Network_Storage.STAAS_TEST_VOLUME
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -2751,9 +2770,9 @@ def test_prep_snapshot_order_saas_endurance_upgrade(self):
 
     def test_prep_snapshot_order_saas_performance_volume_below_staas_v2(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
         mock_volume['staasVersion'] = '1'
 
@@ -2771,9 +2790,9 @@ def test_prep_snapshot_order_saas_performance_volume_below_staas_v2(self):
 
     def test_prep_snapshot_order_saas_performance(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
 
         expected_object = {
@@ -2795,9 +2814,9 @@ def test_prep_snapshot_order_saas_performance(self):
 
     def test_prep_snapshot_order_saas_invalid_storage_type(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'TASTY_PASTA_STORAGE'
 
         exception = self.assertRaises(
@@ -2816,10 +2835,10 @@ def test_prep_snapshot_order_saas_invalid_storage_type(self):
     def test_prep_snapshot_order_enterprise_tier_is_not_none(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.getObject
+        mock_volume = SoftLayer_Network_Storage.getObject
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -2841,10 +2860,10 @@ def test_prep_snapshot_order_enterprise_tier_is_not_none(self):
     def test_prep_snapshot_order_enterprise(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.getObject
+        mock_volume = SoftLayer_Network_Storage.getObject
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -2865,9 +2884,9 @@ def test_prep_snapshot_order_enterprise(self):
 
     def test_prep_snapshot_order_hourly_billing(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['billingItem']['hourlyFlag'] = True
 
         expected_object = {
@@ -2975,7 +2994,37 @@ def test_prep_volume_order_saas_performance(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
+
+        expected_object = {
+            'complexType': 'SoftLayer_Container_Product_Order_'
+                           'Network_Storage_AsAService',
+            'packageId': 759,
+            'prices': [
+                {'id': 189433},
+                {'id': 189453},
+                {'id': 190113},
+                {'id': 190173}
+            ],
+            'quantity': 1,
+            'location': 29,
+            'volumeSize': 1000,
+            'iops': 800,
+            'useHourlyPricing': False
+        }
+
+        result = storage_utils.prepare_volume_order_object(
+            self.file, 'performance', 'dal09', 1000,
+            800, None, None, 'storage_as_a_service', 'file'
+        )
+
+        self.assertEqual(expected_object, result)
+
+    def test_prep_volume_order_saas_performance_rest(self):
+        mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
+        mock.return_value = [{'id': 29, 'name': 'dal09'}]
+        mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
+        mock.return_value = [SoftLayer_Product_Package.SAAS_REST_PACKAGE]
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3005,7 +3054,7 @@ def test_prep_volume_order_saas_performance_with_snapshot(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3036,7 +3085,7 @@ def test_prep_volume_order_saas_endurance(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3065,7 +3114,7 @@ def test_prep_volume_order_saas_endurance_with_snapshot(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3096,7 +3145,7 @@ def test_prep_volume_order_perf_performance_block(self):
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.PERFORMANCE_PACKAGE
+            SoftLayer_Product_Package.PERFORMANCE_PACKAGE
         ]
 
         expected_object = {
@@ -3125,7 +3174,7 @@ def test_prep_volume_order_perf_performance_file(self):
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.PERFORMANCE_PACKAGE
+            SoftLayer_Product_Package.PERFORMANCE_PACKAGE
         ]
 
         expected_object = {
@@ -3154,7 +3203,7 @@ def test_prep_volume_order_ent_endurance(self):
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
         expected_object = {
@@ -3184,7 +3233,7 @@ def test_prep_volume_order_ent_endurance_with_snapshot(self):
         mock.return_value = [{'id': 29, 'name': 'dal09'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
         expected_object = {
@@ -3214,7 +3263,7 @@ def test_prep_volume_order_ent_endurance_with_snapshot(self):
     # Tests for prepare_replicant_order_object()
     # ---------------------------------------------------------------------
     def test_prep_replicant_order_volume_cancelled(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['billingItem']
 
         exception = self.assertRaises(
@@ -3230,7 +3279,7 @@ def test_prep_replicant_order_volume_cancelled(self):
         )
 
     def test_prep_replicant_order_volume_cancellation_date_set(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['billingItem']['cancellationDate'] = 'y2k, oh nooooo'
 
         exception = self.assertRaises(
@@ -3246,7 +3295,7 @@ def test_prep_replicant_order_volume_cancellation_date_set(self):
         )
 
     def test_prep_replicant_order_snapshot_space_cancelled(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         snapshot_billing_item = mock_volume['billingItem']['activeChildren'][0]
         snapshot_billing_item['cancellationDate'] = 'daylight saving time, no!'
 
@@ -3266,7 +3315,7 @@ def test_prep_replicant_order_invalid_location(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = []
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME
+        mock_volume = SoftLayer_Network_Storage.STAAS_TEST_VOLUME
 
         exception = self.assertRaises(
             exceptions.SoftLayerError,
@@ -3284,7 +3333,7 @@ def test_prep_replicant_order_enterprise_offering_invalid_type(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['billingItem']['categoryCode'] = 'invalid_type_ninja_cat'
 
         exception = self.assertRaises(
@@ -3303,7 +3352,7 @@ def test_prep_replicant_order_snapshot_capacity_not_found(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['snapshotCapacityGb']
 
         exception = self.assertRaises(
@@ -3321,9 +3370,9 @@ def test_prep_replicant_order_saas_endurance(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME
+        mock_volume = SoftLayer_Network_Storage.STAAS_TEST_VOLUME
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3355,9 +3404,9 @@ def test_prep_replicant_order_saas_endurance_tier_is_not_none(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME
+        mock_volume = SoftLayer_Network_Storage.STAAS_TEST_VOLUME
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3389,9 +3438,9 @@ def test_prep_replicant_order_saas_performance_volume_below_staas_v2(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
         mock_volume['hasEncryptionAtRest'] = 0
 
@@ -3411,9 +3460,9 @@ def test_prep_replicant_order_saas_performance(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
 
         expected_object = {
@@ -3447,9 +3496,9 @@ def test_prep_replicant_order_saas_invalid_storage_type(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'CATS_LIKE_PIANO_MUSIC'
 
         exception = self.assertRaises(
@@ -3470,10 +3519,10 @@ def test_prep_replicant_order_ent_endurance(self):
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.getObject
+        mock_volume = SoftLayer_Network_Storage.getObject
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3505,10 +3554,10 @@ def test_prep_replicant_order_ent_endurance_tier_is_not_none(self):
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
         mock.return_value = [
-            fixtures.SoftLayer_Product_Package.ENTERPRISE_PACKAGE
+            SoftLayer_Product_Package.ENTERPRISE_PACKAGE
         ]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.getObject
+        mock_volume = SoftLayer_Network_Storage.getObject
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3539,9 +3588,9 @@ def test_prep_replicant_order_hourly_billing(self):
         mock = self.set_mock('SoftLayer_Location_Datacenter', 'getDatacenters')
         mock.return_value = [{'id': 51, 'name': 'wdc04'}]
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['billingItem']['hourlyFlag'] = True
 
         expected_object = {
@@ -3575,9 +3624,9 @@ def test_prep_replicant_order_hourly_billing(self):
     # ---------------------------------------------------------------------
     def test_prep_duplicate_order_origin_volume_cancelled(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['billingItem']
 
         exception = self.assertRaises(
@@ -3592,9 +3641,9 @@ def test_prep_duplicate_order_origin_volume_cancelled(self):
 
     def test_prep_duplicate_order_origin_snapshot_capacity_not_found(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['snapshotCapacityGb']
 
         exception = self.assertRaises(
@@ -3609,9 +3658,9 @@ def test_prep_duplicate_order_origin_snapshot_capacity_not_found(self):
 
     def test_prep_duplicate_order_origin_volume_location_not_found(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['billingItem']['location']
 
         exception = self.assertRaises(
@@ -3625,9 +3674,9 @@ def test_prep_duplicate_order_origin_volume_location_not_found(self):
 
     def test_prep_duplicate_order_origin_volume_staas_version_below_v2(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['staasVersion'] = 1
 
         exception = self.assertRaises(
@@ -3642,9 +3691,9 @@ def test_prep_duplicate_order_origin_volume_staas_version_below_v2(self):
 
     def test_prep_duplicate_order_performance_origin_iops_not_found(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE_REPLICANT'
         del mock_volume['provisionedIops']
 
@@ -3659,9 +3708,9 @@ def test_prep_duplicate_order_performance_origin_iops_not_found(self):
 
     def test_prep_duplicate_order_performance_use_default_origin_values(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_FILE_STORAGE_REPLICANT'
 
         expected_object = {
@@ -3689,9 +3738,9 @@ def test_prep_duplicate_order_performance_use_default_origin_values(self):
 
     def test_prep_duplicate_order_performance_block(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
 
         expected_object = {
@@ -3719,9 +3768,9 @@ def test_prep_duplicate_order_performance_block(self):
 
     def test_prep_duplicate_order_performance_file(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_FILE_STORAGE'
 
         expected_object = {
@@ -3749,9 +3798,9 @@ def test_prep_duplicate_order_performance_file(self):
 
     def test_prep_duplicate_order_endurance_use_default_origin_values(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'ENDURANCE_FILE_'\
                                                 'STORAGE_REPLICANT'
 
@@ -3779,9 +3828,9 @@ def test_prep_duplicate_order_endurance_use_default_origin_values(self):
 
     def test_prep_duplicate_order_endurance_block(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME
+        mock_volume = SoftLayer_Network_Storage.STAAS_TEST_VOLUME
 
         expected_object = {
             'complexType': 'SoftLayer_Container_Product_Order_'
@@ -3807,9 +3856,9 @@ def test_prep_duplicate_order_endurance_block(self):
 
     def test_prep_duplicate_order_endurance_file(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'ENDURANCE_FILE_STORAGE'
 
         expected_object = {
@@ -3836,9 +3885,9 @@ def test_prep_duplicate_order_endurance_file(self):
 
     def test_prep_duplicate_order_invalid_origin_storage_type(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'NINJA_CATS'
 
         exception = self.assertRaises(
@@ -3856,7 +3905,7 @@ def test_prep_duplicate_order_invalid_origin_storage_type(self):
     # Tests for prepare_modify_order_object()
     # ---------------------------------------------------------------------
     def test_prep_modify_order_origin_volume_cancelled(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         del mock_volume['billingItem']
 
         exception = self.assertRaises(exceptions.SoftLayerError, storage_utils.prepare_modify_order_object,
@@ -3865,7 +3914,7 @@ def test_prep_modify_order_origin_volume_cancelled(self):
         self.assertEqual("The volume has been cancelled; unable to modify volume.", str(exception))
 
     def test_prep_modify_order_origin_volume_staas_version_below_v2(self):
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['staasVersion'] = 1
 
         exception = self.assertRaises(exceptions.SoftLayerError, storage_utils.prepare_modify_order_object,
@@ -3876,9 +3925,9 @@ def test_prep_modify_order_origin_volume_staas_version_below_v2(self):
 
     def test_prep_modify_order_performance_values_not_given(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
 
         exception = self.assertRaises(exceptions.SoftLayerError, storage_utils.prepare_modify_order_object,
@@ -3888,9 +3937,9 @@ def test_prep_modify_order_performance_values_not_given(self):
 
     def test_prep_modify_order_performance_iops_not_found(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
         del mock_volume['provisionedIops']
 
@@ -3901,9 +3950,9 @@ def test_prep_modify_order_performance_iops_not_found(self):
 
     def test_prep_modify_order_performance_use_existing_iops(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_FILE_STORAGE'
 
         expected_object = {
@@ -3920,9 +3969,9 @@ def test_prep_modify_order_performance_use_existing_iops(self):
 
     def test_prep_modify_order_performance_use_existing_size(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_BLOCK_STORAGE'
 
         expected_object = {
@@ -3939,9 +3988,9 @@ def test_prep_modify_order_performance_use_existing_size(self):
 
     def test_prep_modify_order_performance(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'PERFORMANCE_FILE_STORAGE'
 
         expected_object = {
@@ -3958,9 +4007,9 @@ def test_prep_modify_order_performance(self):
 
     def test_prep_modify_order_endurance_values_not_given(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'ENDURANCE_BLOCK_STORAGE'
 
         exception = self.assertRaises(exceptions.SoftLayerError, storage_utils.prepare_modify_order_object,
@@ -3970,9 +4019,9 @@ def test_prep_modify_order_endurance_values_not_given(self):
 
     def test_prep_modify_order_endurance_use_existing_tier(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'ENDURANCE_FILE_STORAGE'
 
         expected_object = {
@@ -3988,9 +4037,9 @@ def test_prep_modify_order_endurance_use_existing_tier(self):
 
     def test_prep_modify_order_endurance_use_existing_size(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'ENDURANCE_BLOCK_STORAGE'
 
         expected_object = {
@@ -4006,9 +4055,9 @@ def test_prep_modify_order_endurance_use_existing_size(self):
 
     def test_prep_modify_order_endurance(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'ENDURANCE_FILE_STORAGE'
 
         expected_object = {
@@ -4024,9 +4073,9 @@ def test_prep_modify_order_endurance(self):
 
     def test_prep_modify_order_invalid_volume_storage_type(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
-        mock.return_value = [fixtures.SoftLayer_Product_Package.SAAS_PACKAGE]
+        mock.return_value = [SoftLayer_Product_Package.SAAS_PACKAGE]
 
-        mock_volume = copy.deepcopy(fixtures.SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
+        mock_volume = copy.deepcopy(SoftLayer_Network_Storage.STAAS_TEST_VOLUME)
         mock_volume['storageType']['keyName'] = 'NINJA_PENGUINS'
 
         exception = self.assertRaises(exceptions.SoftLayerError, storage_utils.prepare_modify_order_object,