Repository: softlayer/softlayer-python
Pull request #986 (2018-06-22 20:44:25)

Fix issue 966 - order NETWORK_GATEWAY_APPLINCE with slcli but meet error Price does not have an id
Fix for #966 

It was tested on a QA environment for NETWORK_GATEWAY_APPLIANCE, 2U_NETWORK_GATEWAY_APPLIANCE_1O_GBPS, BARE_METAL_SERVER with preset D2620V4_64GB_2X1TB_SATA_RAID_1, CLOUD_SERVER, PORTABLE_STORAGE, DUAL_E52600_V4_12_DRIVES

Below examples for gateways:

**NETWORK_GATEWAY_APPLIANCE**

`$ slcli order place --verify --billing monthly NETWORK_GATEWAY_APPLIANCE DALLAS06 INTEL_SINGLE_XEON_1270_3_50 RAM_8_GB_DDR3_1333_ECC_NON_REG OS_VYATTA_5600_5_X_UP_TO_1GBPS_SUBSCRIPTION_EDITION_64_BIT DISK_CONTROLLER_NONRAID HARD_DRIVE_500GB_SATA_II BANDWIDTH_20000_GB 100_MBPS_PUBLIC_PRIVATE_NETWORK_UPLINKS 1_IPV6_ADDRESS MONITORING_HOST_PING AUTOMATED_NOTIFICATION UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT NESSUS_VULNERABILITY_ASSESSMENT_REPORTING 1_IP_ADDRESS NOTIFICATION_EMAIL_AND_TICKET REBOOT_KVM_OVER_IP --complex-type SoftLayer_Container_Product_Order_Hardware_Server_Gateway_Appliance --extras '{"hardware": [{"hostname" : "ajcbGateway01", "domain": "acamacho.com"}], "sshKeys" : [87634], "tags": "acamacho, test"}'`

```
:............................................................:..........................................................................:......:
:                          keyName                           :                               description                                : cost :
:............................................................:..........................................................................:......:
:                INTEL_SINGLE_XEON_1270_3_50                 :             Single Intel Xeon E3-1270 v3 (4 Cores, 3.50 GHz)             : 209  :
:               RAM_8_GB_DDR3_1333_ECC_NON_REG               :                              8 GB DDR3 1333                              :  48  :
: OS_VYATTA_5600_5_X_UP_TO_1GBPS_SUBSCRIPTION_EDITION_64_BIT : Virtual Router Appliance 5.x (up to 1Gbps) Subscription Edition (64 Bit) : 219  :
:                  DISK_CONTROLLER_NONRAID                   :                                 Non-RAID                                 :  0   :
:                  HARD_DRIVE_500GB_SATA_II                  :                               500 GB SATA                                :  0   :
:                     BANDWIDTH_20000_GB                     :                       20000 GB Bandwidth Allotment                       :  0   :
:          100_MBPS_PUBLIC_PRIVATE_NETWORK_UPLINKS           :                100 Mbps Public & Private Network Uplinks                 :  0   :
:                       1_IPV6_ADDRESS                       :                              1 IPv6 Address                              :  0   :
:                    MONITORING_HOST_PING                    :                                Host Ping                                 :  0   :
:                   AUTOMATED_NOTIFICATION                   :                          Automated Notification                          :  0   :
:    UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT     :          Unlimited SSL VPN Users & 1 PPTP VPN User per account           :  0   :
:         NESSUS_VULNERABILITY_ASSESSMENT_REPORTING          :               Nessus Vulnerability Assessment & Reporting                :  0   :
:                        1_IP_ADDRESS                        :                               1 IP Address                               :  0   :
:               NOTIFICATION_EMAIL_AND_TICKET                :                             Email and Ticket                             :  0   :
:                     REBOOT_KVM_OVER_IP                     :                           Reboot / KVM over IP                           :  0   :
:............................................................:..........................................................................:......:
```

**2U_NETWORK_GATEWAY_APPLIANCE_1O_GBPS**

`$ slcli order place --billing monthly 2U_NETWORK_GATEWAY_APPLIANCE_1O_GBPS DALLAS06 INTEL_XEON_2620_2_40 OS_VYATTA_5600_5_X_UP_TO_20GBPS_SUBSCRIPTION_EDITION_64_BIT RAM_64_GB_DDR3_1333_REG_2 DISK_CONTROLLER_RAID HARD_DRIVE_1_00TB_SATA_II BANDWIDTH_UNLIMITED_100_MBPS_UPLINK 100_MBPS_PUBLIC_PRIVATE_NETWORK_UPLINKS REBOOT_KVM_OVER_IP 1_IP_ADDRESS REDUNDANT_POWER_SUPPLY MONITORING_HOST_PING  NOTIFICATION_EMAIL_AND_TICKET AUTOMATED_NOTIFICATION UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT NESSUS_VULNERABILITY_ASSESSMENT_REPORTING --complex-type SoftLayer_Container_Product_Order_Hardware_Server_Gateway_Appliance --extras '{"hardware": [{"hostname" : "ajcbGateway01", "domain": "acamacho.com"}], "sshKeys" : [87634], "tags": "acamacho, test"}'`
```
This action will incur charges on your account. Continue? [y/N]: y
:.........:...........................:
:    name : value                     :
:.........:...........................:
:      id : 22299768                  :
: created : 2018-06-22T16:29:00-04:00 :
:  status : PENDING_AUTO_APPROVAL     :
:.........:...........................:
```


Patch:
diff --git a/SoftLayer/CLI/block/detail.py b/SoftLayer/CLI/block/detail.py
index 6b1b7288..87c53a8d 100644
--- a/SoftLayer/CLI/block/detail.py
+++ b/SoftLayer/CLI/block/detail.py
@@ -29,7 +29,7 @@ def cli(env, volume_id):
     table.add_row(['LUN Id', "%s" % block_volume['lunId']])
 
     if block_volume.get('provisionedIops'):
-        table.add_row(['IOPs', float(block_volume['provisionedIops'])])
+        table.add_row(['IOPs', int(block_volume['provisionedIops'])])
 
     if block_volume.get('storageTierLevel'):
         table.add_row([
diff --git a/SoftLayer/CLI/order/place.py b/SoftLayer/CLI/order/place.py
index f042e251..1e21e544 100644
--- a/SoftLayer/CLI/order/place.py
+++ b/SoftLayer/CLI/order/place.py
@@ -88,7 +88,7 @@ def cli(env, package_keyname, location, preset, verify, billing, complex_type,
     if verify:
         table = formatting.Table(COLUMNS)
         order_to_place = manager.verify_order(*args, **kwargs)
-        for price in order_to_place['prices']:
+        for price in order_to_place['orderContainers'][0]['prices']:
             cost_key = 'hourlyRecurringFee' if billing == 'hourly' else 'recurringFee'
             table.add_row([
                 price['item']['keyName'],
diff --git a/SoftLayer/managers/block.py b/SoftLayer/managers/block.py
index b1efd033..74b5fb42 100644
--- a/SoftLayer/managers/block.py
+++ b/SoftLayer/managers/block.py
@@ -510,10 +510,6 @@ def cancel_block_volume(self, volume_id,
         block_volume = self.get_block_volume_details(
             volume_id,
             mask='mask[id,billingItem[id,hourlyFlag]]')
-
-        if 'billingItem' not in block_volume:
-            raise exceptions.SoftLayerError("Block Storage was already cancelled")
-
         billing_item_id = block_volume['billingItem']['id']
 
         if utils.lookup(block_volume, 'billingItem', 'hourlyFlag'):
diff --git a/SoftLayer/managers/ordering.py b/SoftLayer/managers/ordering.py
index 58860627..b4988488 100644
--- a/SoftLayer/managers/ordering.py
+++ b/SoftLayer/managers/ordering.py
@@ -445,6 +445,7 @@ def generate_order(self, package_keyname, location, item_keynames, complex_type=
         :param int quantity: The number of resources to order
 
         """
+        container = {}
         order = {}
         extras = extras or {}
 
@@ -470,7 +471,10 @@ def generate_order(self, package_keyname, location, item_keynames, complex_type=
 
         price_ids = self.get_price_id_list(package_keyname, item_keynames)
         order['prices'] = [{'id': price_id} for price_id in price_ids]
-        return order
+
+        container['orderContainers'] = [order]
+
+        return container
 
     def package_locations(self, package_keyname):
         """List datacenter locations for a package keyname


Test patch:
diff --git a/tests/CLI/modules/block_tests.py b/tests/CLI/modules/block_tests.py
index 2dcec997..50d18ad8 100644
--- a/tests/CLI/modules/block_tests.py
+++ b/tests/CLI/modules/block_tests.py
@@ -59,7 +59,6 @@ def test_volume_detail(self):
         result = self.run_command(['block', 'volume-detail', '1234'])
 
         self.assert_no_fail(result)
-        isinstance(json.loads(result.output)['IOPs'], float)
         self.assertEqual({
             'Username': 'username',
             'LUN Id': '2',
diff --git a/tests/CLI/modules/order_tests.py b/tests/CLI/modules/order_tests.py
index cde0abc3..a5eb58b7 100644
--- a/tests/CLI/modules/order_tests.py
+++ b/tests/CLI/modules/order_tests.py
@@ -133,7 +133,7 @@ def test_verify_hourly(self):
         self.assert_called_with('SoftLayer_Product_Order', 'verifyOrder')
         expected_results = []
 
-        for price in order['prices']:
+        for price in order['orderContainers'][0]['prices']:
             expected_results.append({'keyName': price['item']['keyName'],
                                      'description': price['item']['description'],
                                      'cost': price['hourlyRecurringFee']})
@@ -160,7 +160,7 @@ def test_verify_monthly(self):
         self.assert_called_with('SoftLayer_Product_Order', 'verifyOrder')
         expected_results = []
 
-        for price in order['prices']:
+        for price in order['orderContainers'][0]['prices']:
             expected_results.append({'keyName': price['item']['keyName'],
                                      'description': price['item']['description'],
                                      'cost': price['recurringFee']})
@@ -222,4 +222,4 @@ def _get_verified_order_return(self):
                   'recurringFee': '120'}
         price2 = {'item': item2, 'hourlyRecurringFee': '0.05',
                   'recurringFee': '150'}
-        return {'prices': [price1, price2]}
+        return {'orderContainers': [{'prices': [price1, price2]}]}
diff --git a/tests/CLI/modules/vs_tests.py b/tests/CLI/modules/vs_tests.py
index c7ce60be..0b488390 100644
--- a/tests/CLI/modules/vs_tests.py
+++ b/tests/CLI/modules/vs_tests.py
@@ -154,54 +154,6 @@ def test_list_vs(self):
                            'id': 104,
                            'backend_ip': '10.45.19.35'}])
 
-    @mock.patch('SoftLayer.utils.lookup')
-    def test_detail_vs_empty_billing(self, mock_lookup):
-        def mock_lookup_func(dic, key, *keys):
-            if key == 'billingItem':
-                return []
-            if keys:
-                return mock_lookup_func(dic.get(key, {}), keys[0], *keys[1:])
-            return dic.get(key)
-
-        mock_lookup.side_effect = mock_lookup_func
-
-        result = self.run_command(['vs', 'detail', '100', '--passwords', '--price'])
-
-        self.assert_no_fail(result)
-        self.assertEqual(json.loads(result.output),
-                         {'active_transaction': None,
-                          'cores': 2,
-                          'created': '2013-08-01 15:23:45',
-                          'datacenter': 'TEST00',
-                          'dedicated_host': 'test-dedicated',
-                          'dedicated_host_id': 37401,
-                          'hostname': 'vs-test1',
-                          'domain': 'test.sftlyr.ws',
-                          'fqdn': 'vs-test1.test.sftlyr.ws',
-                          'id': 100,
-                          'guid': '1a2b3c-1701',
-                          'memory': 1024,
-                          'modified': {},
-                          'os': 'Ubuntu',
-                          'os_version': '12.04-64 Minimal for VSI',
-                          'notes': 'notes',
-                          'price_rate': 0,
-                          'tags': ['production'],
-                          'private_cpu': {},
-                          'private_ip': '10.45.19.37',
-                          'private_only': {},
-                          'ptr': 'test.softlayer.com.',
-                          'public_ip': '172.16.240.2',
-                          'state': 'RUNNING',
-                          'status': 'ACTIVE',
-                          'users': [{'software': 'Ubuntu',
-                                     'password': 'pass',
-                                     'username': 'user'}],
-                          'vlans': [{'type': 'PUBLIC',
-                                     'number': 23,
-                                     'id': 1}],
-                          'owner': None})
-
     def test_detail_vs(self):
         result = self.run_command(['vs', 'detail', '100',
                                    '--passwords', '--price'])
@@ -305,7 +257,6 @@ def test_create_options(self):
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_create(self, confirm_mock):
         confirm_mock.return_value = True
-
         result = self.run_command(['vs', 'create',
                                    '--cpu=2',
                                    '--domain=example.com',
@@ -337,52 +288,6 @@ def test_create(self, confirm_mock):
         self.assert_called_with('SoftLayer_Virtual_Guest', 'createObject',
                                 args=args)
 
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_with_wait_ready(self, confirm_mock):
-        mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
-        mock.return_value = {
-            "provisionDate": "2018-06-10T12:00:00-05:00",
-            "id": 100
-        }
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create',
-                                   '--cpu=2',
-                                   '--domain=example.com',
-                                   '--hostname=host',
-                                   '--os=UBUNTU_LATEST',
-                                   '--memory=1',
-                                   '--network=100',
-                                   '--billing=hourly',
-                                   '--datacenter=dal05',
-                                   '--wait=1'])
-
-        self.assert_no_fail(result)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_with_wait_not_ready(self, confirm_mock):
-        mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject')
-        mock.return_value = {
-            "ready": False,
-            "guid": "1a2b3c-1701",
-            "id": 100,
-            "created": "2018-06-10 12:00:00"
-        }
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create',
-                                   '--cpu=2',
-                                   '--domain=example.com',
-                                   '--hostname=host',
-                                   '--os=UBUNTU_LATEST',
-                                   '--memory=1',
-                                   '--network=100',
-                                   '--billing=hourly',
-                                   '--datacenter=dal05',
-                                   '--wait=10'])
-
-        self.assertEqual(result.exit_code, 1)
-
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_create_with_integer_image_id(self, confirm_mock):
         confirm_mock.return_value = True
@@ -452,66 +357,6 @@ def test_create_with_flavor(self, confirm_mock):
         self.assert_called_with('SoftLayer_Virtual_Guest', 'createObject',
                                 args=args)
 
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_with_flavor_and_memory(self, confirm_mock):
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create',
-                                   '--domain=example.com',
-                                   '--hostname=host',
-                                   '--os=UBUNTU_LATEST',
-                                   '--network=100',
-                                   '--datacenter=TEST00',
-                                   '--flavor=BL_1X2X25',
-                                   '--memory=2048MB'])
-
-        self.assertEqual(result.exit_code, 2)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_with_dedicated_and_flavor(self, confirm_mock):
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create',
-                                   '--domain=example.com',
-                                   '--hostname=host',
-                                   '--os=UBUNTU_LATEST',
-                                   '--network=100',
-                                   '--datacenter=TEST00',
-                                   '--dedicated',
-                                   '--flavor=BL_1X2X25'])
-
-        self.assertEqual(result.exit_code, 2)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_with_hostid_and_flavor(self, confirm_mock):
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create',
-                                   '--domain=example.com',
-                                   '--hostname=host',
-                                   '--os=UBUNTU_LATEST',
-                                   '--network=100',
-                                   '--datacenter=dal05',
-                                   '--host-id=100',
-                                   '--flavor=BL_1X2X25'])
-
-        self.assertEqual(result.exit_code, 2)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_with_flavor_and_cpu(self, confirm_mock):
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create',
-                                   '--domain=example.com',
-                                   '--hostname=host',
-                                   '--os=UBUNTU_LATEST',
-                                   '--network=100',
-                                   '--datacenter=TEST00',
-                                   '--flavor=BL_1X2X25',
-                                   '--cpu=2'])
-
-        self.assertEqual(result.exit_code, 2)
-
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_create_with_host_id(self, confirm_mock):
         confirm_mock.return_value = True
@@ -638,25 +483,6 @@ def test_create_like_flavor(self, confirm_mock):
         self.assert_called_with('SoftLayer_Virtual_Guest', 'createObject',
                                 args=args)
 
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_create_vs_test(self, confirm_mock):
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'create', '--test', '--hostname', 'TEST',
-                                   '--domain', 'TESTING', '--cpu', '1',
-                                   '--memory', '2048MB', '--datacenter',
-                                   'TEST00', '--os', 'UBUNTU_LATEST'])
-
-        self.assertEqual(result.exit_code, -1)
-
-    def test_create_vs_bad_memory(self):
-        result = self.run_command(['vs', 'create', '--hostname', 'TEST',
-                                   '--domain', 'TESTING', '--cpu', '1',
-                                   '--memory', '2034MB', '--flavor',
-                                   'UBUNTU', '--datacenter', 'TEST00'])
-
-        self.assertEqual(result.exit_code, 2)
-
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_dns_sync_both(self, confirm_mock):
         confirm_mock.return_value = True
@@ -975,17 +801,3 @@ def test_reload_no_confirm(self, confirm_mock):
 
         result = self.run_command(['vs', 'reload', '--postinstall', '100', '--key', '100', '--image', '100', '100'])
         self.assertEqual(result.exit_code, 2)
-
-    @mock.patch('SoftLayer.CLI.formatting.no_going_back')
-    def test_cancel(self, confirm_mock):
-        confirm_mock.return_value = True
-
-        result = self.run_command(['vs', 'cancel', '100'])
-        self.assert_no_fail(result)
-
-    @mock.patch('SoftLayer.CLI.formatting.no_going_back')
-    def test_cancel_no_confirm(self, confirm_mock):
-        confirm_mock.return_value = False
-
-        result = self.run_command(['vs', 'cancel', '100'])
-        self.assertEqual(result.exit_code, 2)
diff --git a/tests/managers/block_tests.py b/tests/managers/block_tests.py
index fa5dacb2..6f2e5eb6 100644
--- a/tests/managers/block_tests.py
+++ b/tests/managers/block_tests.py
@@ -41,72 +41,33 @@ def test_cancel_block_volume_immediately_hourly_billing(self):
             identifier=449,
         )
 
-    def test_cancel_block_volume_exception_billing_item_not_found(self):
-        mock = self.set_mock('SoftLayer_Network_Storage', 'getObject')
-        mock.return_value = {
-            'capacityGb': 20,
-            'createDate': '2017-06-20T14:24:21-06:00',
-            'nasType': 'ISCSI',
-            'storageTypeId': '7',
-            'serviceResourceName': 'PerfStor Aggr aggr_staasdal0601_pc01'
-        }
-        exception = self.assertRaises(
-            exceptions.SoftLayerError,
-            self.block.cancel_block_volume,
-            12345,
-            immediate=True
-        )
-        self.assertEqual(
-            'Block Storage was already cancelled',
-            str(exception)
-        )
-
-    def test_cancel_block_volume_billing_item_found(self):
-        mock = self.set_mock('SoftLayer_Network_Storage', 'getObject')
-        mock.return_value = {
-            'capacityGb': 20,
-            'createDate': '2017-06-20T14:24:21-06:00',
-            'nasType': 'ISCSI',
-            'storageTypeId': '7',
-            'serviceResourceName': 'PerfStor Aggr aggr_staasdal0601_pc01',
-            'billingItem': {'hourlyFlag': True, 'id': 449},
-        }
-        self.block.cancel_block_volume(123, immediate=False)
-
-        self.assert_called_with(
-            'SoftLayer_Billing_Item',
-            'cancelItem',
-            args=(True, True, 'No longer needed'),
-            identifier=449,
-        )
-
     def test_get_block_volume_details(self):
         result = self.block.get_block_volume_details(100)
 
         self.assertEqual(fixtures.SoftLayer_Network_Storage.getObject, result)
 
-        expected_mask = 'id,' \
-                        'username,' \
-                        'password,' \
-                        'capacityGb,' \
-                        'snapshotCapacityGb,' \
-                        'parentVolume.snapshotSizeBytes,' \
-                        'storageType.keyName,' \
-                        'serviceResource.datacenter[name],' \
-                        'serviceResourceBackendIpAddress,' \
-                        'storageTierLevel,' \
-                        'provisionedIops,' \
-                        'lunId,' \
-                        'originalVolumeName,' \
-                        'originalSnapshotName,' \
-                        'originalVolumeSize,' \
-                        'activeTransactionCount,' \
-                        'activeTransactions.transactionStatus[friendlyName],' \
-                        'replicationPartnerCount,' \
-                        'replicationStatus,' \
-                        'replicationPartners[id,username,' \
-                        'serviceResourceBackendIpAddress,' \
-                        'serviceResource[datacenter[name]],' \
+        expected_mask = 'id,'\
+                        'username,'\
+                        'password,'\
+                        'capacityGb,'\
+                        'snapshotCapacityGb,'\
+                        'parentVolume.snapshotSizeBytes,'\
+                        'storageType.keyName,'\
+                        'serviceResource.datacenter[name],'\
+                        'serviceResourceBackendIpAddress,'\
+                        'storageTierLevel,'\
+                        'provisionedIops,'\
+                        'lunId,'\
+                        'originalVolumeName,'\
+                        'originalSnapshotName,'\
+                        'originalVolumeSize,'\
+                        'activeTransactionCount,'\
+                        'activeTransactions.transactionStatus[friendlyName],'\
+                        'replicationPartnerCount,'\
+                        'replicationStatus,'\
+                        'replicationPartners[id,username,'\
+                        'serviceResourceBackendIpAddress,'\
+                        'serviceResource[datacenter[name]],'\
                         'replicationSchedule[type[keyname]]]'
 
         self.assert_called_with(
@@ -114,7 +75,7 @@ def test_get_block_volume_details(self):
             'getObject',
             identifier=100,
             mask='mask[%s]' % expected_mask
-        )
+            )
 
     def test_list_block_volumes(self):
         result = self.block.list_block_volumes()
@@ -135,14 +96,14 @@ def test_list_block_volumes(self):
             }
         }
 
-        expected_mask = 'id,' \
-                        'username,' \
-                        'lunId,' \
-                        'capacityGb,' \
-                        'bytesUsed,' \
-                        'serviceResource.datacenter[name],' \
-                        'serviceResourceBackendIpAddress,' \
-                        'activeTransactionCount,' \
+        expected_mask = 'id,'\
+                        'username,'\
+                        'lunId,'\
+                        'capacityGb,'\
+                        'bytesUsed,'\
+                        'serviceResource.datacenter[name],'\
+                        'serviceResourceBackendIpAddress,'\
+                        'activeTransactionCount,'\
                         'replicationPartnerCount'
 
         self.assert_called_with(
@@ -177,14 +138,14 @@ def test_list_block_volumes_with_additional_filters(self):
             }
         }
 
-        expected_mask = 'id,' \
-                        'username,' \
-                        'lunId,' \
-                        'capacityGb,' \
-                        'bytesUsed,' \
-                        'serviceResource.datacenter[name],' \
-                        'serviceResourceBackendIpAddress,' \
-                        'activeTransactionCount,' \
+        expected_mask = 'id,'\
+                        'username,'\
+                        'lunId,'\
+                        'capacityGb,'\
+                        'bytesUsed,'\
+                        'serviceResource.datacenter[name],'\
+                        'serviceResourceBackendIpAddress,'\
+                        'activeTransactionCount,'\
                         'replicationPartnerCount'
 
         self.assert_called_with(
@@ -396,22 +357,22 @@ def test_order_block_volume_performance(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 190113},
-                          {'id': 190173}
-                      ],
-                      'volumeSize': 1000,
-                      'quantity': 1,
-                      'location': 449494,
-                      'iops': 2000,
-                      'useHourlyPricing': False,
-                      'osFormatType': {'keyName': 'LINUX'}
-                  },)
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 190113},
+                    {'id': 190173}
+                ],
+                'volumeSize': 1000,
+                'quantity': 1,
+                'location': 449494,
+                'iops': 2000,
+                'useHourlyPricing': False,
+                'osFormatType': {'keyName': 'LINUX'}
+            },)
         )
 
     def test_order_block_volume_endurance(self):
@@ -440,21 +401,21 @@ def test_order_block_volume_endurance(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 194763},
-                          {'id': 194703}
-                      ],
-                      'volumeSize': 1000,
-                      'quantity': 1,
-                      'location': 449494,
-                      'useHourlyPricing': False,
-                      'osFormatType': {'keyName': 'LINUX'}
-                  },)
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 194763},
+                    {'id': 194703}
+                ],
+                'volumeSize': 1000,
+                'quantity': 1,
+                'location': 449494,
+                'useHourlyPricing': False,
+                'osFormatType': {'keyName': 'LINUX'}
+            },)
         )
 
     def test_authorize_host_to_volume(self):
@@ -564,17 +525,17 @@ def test_order_block_snapshot_space_upgrade(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_Network_'
-                                     'Storage_Enterprise_SnapshotSpace_Upgrade',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 193853}
-                      ],
-                      'quantity': 1,
-                      'location': 449500,
-                      'volumeId': 102,
-                      'useHourlyPricing': False
-                  },)
+                'complexType': 'SoftLayer_Container_Product_Order_Network_'
+                               'Storage_Enterprise_SnapshotSpace_Upgrade',
+                'packageId': 759,
+                'prices': [
+                    {'id': 193853}
+                ],
+                'quantity': 1,
+                'location': 449500,
+                'volumeId': 102,
+                'useHourlyPricing': False
+            },)
         )
 
     def test_order_block_snapshot_space(self):
@@ -593,17 +554,17 @@ def test_order_block_snapshot_space(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_Network_'
-                                     'Storage_Enterprise_SnapshotSpace',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 193613}
-                      ],
-                      'quantity': 1,
-                      'location': 449500,
-                      'volumeId': 102,
-                      'useHourlyPricing': False
-                  },)
+                'complexType': 'SoftLayer_Container_Product_Order_Network_'
+                               'Storage_Enterprise_SnapshotSpace',
+                'packageId': 759,
+                'prices': [
+                    {'id': 193613}
+                ],
+                'quantity': 1,
+                'location': 449500,
+                'volumeId': 102,
+                'useHourlyPricing': False
+            },)
         )
 
     def test_order_block_replicant_os_type_not_found(self):
@@ -649,26 +610,26 @@ def test_order_block_replicant_performance_os_type_given(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 189993},
-                          {'id': 190053},
-                          {'id': 191193},
-                          {'id': 192033}
-                      ],
-                      'volumeSize': 500,
-                      'quantity': 1,
-                      'location': 449494,
-                      'iops': 1000,
-                      'originVolumeId': 102,
-                      'originVolumeScheduleId': 978,
-                      'useHourlyPricing': False,
-                      'osFormatType': {'keyName': 'XEN'}
-                  },)
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 189993},
+                    {'id': 190053},
+                    {'id': 191193},
+                    {'id': 192033}
+                ],
+                'volumeSize': 500,
+                'quantity': 1,
+                'location': 449494,
+                'iops': 1000,
+                'originVolumeId': 102,
+                'originVolumeScheduleId': 978,
+                'useHourlyPricing': False,
+                'osFormatType': {'keyName': 'XEN'}
+            },)
         )
 
     def test_order_block_replicant_endurance(self):
@@ -690,25 +651,25 @@ def test_order_block_replicant_endurance(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 193433},
-                          {'id': 193373},
-                          {'id': 193613},
-                          {'id': 194693}
-                      ],
-                      'volumeSize': 500,
-                      'quantity': 1,
-                      'location': 449494,
-                      'originVolumeId': 102,
-                      'originVolumeScheduleId': 978,
-                      'useHourlyPricing': False,
-                      'osFormatType': {'keyName': 'LINUX'}
-                  },)
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 193433},
+                    {'id': 193373},
+                    {'id': 193613},
+                    {'id': 194693}
+                ],
+                'volumeSize': 500,
+                'quantity': 1,
+                'location': 449494,
+                'originVolumeId': 102,
+                'originVolumeScheduleId': 978,
+                'useHourlyPricing': False,
+                'osFormatType': {'keyName': 'LINUX'}
+            },)
         )
 
     def test_order_block_duplicate_origin_os_type_not_found(self):
@@ -748,23 +709,23 @@ def test_order_block_duplicate_performance_no_duplicate_snapshot(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 189993},
-                          {'id': 190053}
-                      ],
-                      'volumeSize': 500,
-                      'quantity': 1,
-                      'location': 449500,
-                      'duplicateOriginVolumeId': 102,
-                      'osFormatType': {'keyName': 'LINUX'},
-                      'iops': 1000,
-                      'useHourlyPricing': False
-                  },))
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 189993},
+                    {'id': 190053}
+                ],
+                'volumeSize': 500,
+                'quantity': 1,
+                'location': 449500,
+                'duplicateOriginVolumeId': 102,
+                'osFormatType': {'keyName': 'LINUX'},
+                'iops': 1000,
+                'useHourlyPricing': False
+            },))
 
     def test_order_block_duplicate_performance(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
@@ -782,7 +743,7 @@ def test_order_block_duplicate_performance(self):
             duplicate_iops=2000,
             duplicate_tier_level=None,
             duplicate_snapshot_size=10
-        )
+            )
 
         self.assertEqual(fixtures.SoftLayer_Product_Order.placeOrder, result)
 
@@ -790,25 +751,25 @@ def test_order_block_duplicate_performance(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 190113},
-                          {'id': 190173},
-                          {'id': 191193}
-                      ],
-                      'volumeSize': 1000,
-                      'quantity': 1,
-                      'location': 449500,
-                      'duplicateOriginVolumeId': 102,
-                      'osFormatType': {'keyName': 'LINUX'},
-                      'duplicateOriginSnapshotId': 470,
-                      'iops': 2000,
-                      'useHourlyPricing': False
-                  },))
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 190113},
+                    {'id': 190173},
+                    {'id': 191193}
+                ],
+                'volumeSize': 1000,
+                'quantity': 1,
+                'location': 449500,
+                'duplicateOriginVolumeId': 102,
+                'osFormatType': {'keyName': 'LINUX'},
+                'duplicateOriginSnapshotId': 470,
+                'iops': 2000,
+                'useHourlyPricing': False
+            },))
 
     def test_order_block_duplicate_endurance_no_duplicate_snapshot(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
@@ -828,22 +789,22 @@ def test_order_block_duplicate_endurance_no_duplicate_snapshot(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 193433},
-                          {'id': 193373}
-                      ],
-                      'volumeSize': 500,
-                      'quantity': 1,
-                      'location': 449500,
-                      'duplicateOriginVolumeId': 102,
-                      'osFormatType': {'keyName': 'LINUX'},
-                      'useHourlyPricing': False
-                  },))
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 193433},
+                    {'id': 193373}
+                ],
+                'volumeSize': 500,
+                'quantity': 1,
+                'location': 449500,
+                'duplicateOriginVolumeId': 102,
+                'osFormatType': {'keyName': 'LINUX'},
+                'useHourlyPricing': False
+            },))
 
     def test_order_block_duplicate_endurance(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
@@ -860,7 +821,7 @@ def test_order_block_duplicate_endurance(self):
             duplicate_iops=None,
             duplicate_tier_level=4,
             duplicate_snapshot_size=10
-        )
+            )
 
         self.assertEqual(fixtures.SoftLayer_Product_Order.placeOrder, result)
 
@@ -868,24 +829,24 @@ def test_order_block_duplicate_endurance(self):
             'SoftLayer_Product_Order',
             'placeOrder',
             args=({
-                      'complexType': 'SoftLayer_Container_Product_Order_'
-                                     'Network_Storage_AsAService',
-                      'packageId': 759,
-                      'prices': [
-                          {'id': 189433},
-                          {'id': 189443},
-                          {'id': 194763},
-                          {'id': 194703},
-                          {'id': 194943}
-                      ],
-                      'volumeSize': 1000,
-                      'quantity': 1,
-                      'location': 449500,
-                      'duplicateOriginVolumeId': 102,
-                      'osFormatType': {'keyName': 'LINUX'},
-                      'duplicateOriginSnapshotId': 470,
-                      'useHourlyPricing': False
-                  },))
+                'complexType': 'SoftLayer_Container_Product_Order_'
+                               'Network_Storage_AsAService',
+                'packageId': 759,
+                'prices': [
+                    {'id': 189433},
+                    {'id': 189443},
+                    {'id': 194763},
+                    {'id': 194703},
+                    {'id': 194943}
+                ],
+                'volumeSize': 1000,
+                'quantity': 1,
+                'location': 449500,
+                'duplicateOriginVolumeId': 102,
+                'osFormatType': {'keyName': 'LINUX'},
+                'duplicateOriginSnapshotId': 470,
+                'useHourlyPricing': False
+            },))
 
     def test_order_block_modified_performance(self):
         mock = self.set_mock('SoftLayer_Product_Package', 'getAllObjects')
diff --git a/tests/managers/ordering_tests.py b/tests/managers/ordering_tests.py
index c27a9ce7..8836ca0a 100644
--- a/tests/managers/ordering_tests.py
+++ b/tests/managers/ordering_tests.py
@@ -321,13 +321,15 @@ def test_generate_order_with_preset(self):
         complex_type = 'SoftLayer_Container_Foo'
         items = ['ITEM1', 'ITEM2']
         preset = 'PRESET_KEYNAME'
-        expected_order = {'complexType': 'SoftLayer_Container_Foo',
-                          'location': 1854895,
-                          'packageId': 1234,
-                          'presetId': 5678,
-                          'prices': [{'id': 1111}, {'id': 2222}],
-                          'quantity': 1,
-                          'useHourlyPricing': True}
+        expected_order = {'orderContainers': [
+                            {'complexType': 'SoftLayer_Container_Foo',
+                             'location': 1854895,
+                             'packageId': 1234,
+                             'presetId': 5678,
+                             'prices': [{'id': 1111}, {'id': 2222}],
+                             'quantity': 1,
+                             'useHourlyPricing': True}
+                         ]}
 
         mock_pkg, mock_preset, mock_get_ids = self._patch_for_generate()
 
@@ -342,12 +344,14 @@ def test_generate_order(self):
         pkg = 'PACKAGE_KEYNAME'
         items = ['ITEM1', 'ITEM2']
         complex_type = 'My_Type'
-        expected_order = {'complexType': 'My_Type',
-                          'location': 1854895,
-                          'packageId': 1234,
-                          'prices': [{'id': 1111}, {'id': 2222}],
-                          'quantity': 1,
-                          'useHourlyPricing': True}
+        expected_order = {'orderContainers': [
+                            {'complexType': 'My_Type',
+                             'location': 1854895,
+                             'packageId': 1234,
+                             'prices': [{'id': 1111}, {'id': 2222}],
+                             'quantity': 1,
+                             'useHourlyPricing': True}
+                         ]}
 
         mock_pkg, mock_preset, mock_get_ids = self._patch_for_generate()