Browse Source

Remove deprecated root_disk_size

Change-Id: I647edc2bde4f78994dce57b4db2bb51fc099c056
Dmitry Tantsur 5 months ago
parent
commit
928dfaf636
2 changed files with 4 additions and 28 deletions
  1. 1
    6
      metalsmith/_provisioner.py
  2. 3
    22
      metalsmith/test/test_provisioner.py

+ 1
- 6
metalsmith/_provisioner.py View File

@@ -204,7 +204,7 @@ class Provisioner(object):
204 204
     def provision_node(self, node, image, nics=None, root_size_gb=None,
205 205
                        swap_size_mb=None, config=None, hostname=None,
206 206
                        netboot=False, capabilities=None, traits=None,
207
-                       wait=None, root_disk_size=None):
207
+                       wait=None):
208 208
         """Provision the node with the given image.
209 209
 
210 210
         Example::
@@ -245,7 +245,6 @@ class Provisioner(object):
245 245
             :meth:`reserve_node` for that.
246 246
         :param wait: How many seconds to wait for the deployment to finish,
247 247
             None to return immediately.
248
-        :param root_disk_size: DEPRECATED, use ``root_size_gb``.
249 248
         :return: :py:class:`metalsmith.Instance` object with the current
250 249
             status of provisioning. If ``wait`` is not ``None``, provisioning
251 250
             is already finished.
@@ -255,10 +254,6 @@ class Provisioner(object):
255 254
             config = _config.InstanceConfig()
256 255
         if isinstance(image, six.string_types):
257 256
             image = sources.GlanceImage(image)
258
-        if root_disk_size is not None:
259
-            warnings.warn("root_disk_size is deprecated, use root_size_gb "
260
-                          "instead", DeprecationWarning)
261
-            root_size_gb = root_disk_size
262 257
 
263 258
         node = self._check_node_for_deploy(node)
264 259
         nics = _nics.NICs(self._api, node, nics)

+ 3
- 22
metalsmith/test/test_provisioner.py View File

@@ -707,25 +707,6 @@ abcd  image
707 707
         self.assertFalse(self.api.release_node.called)
708 708
         self.assertFalse(self.conn.network.delete_port.called)
709 709
 
710
-    def test_with_deprecated_root_size(self):
711
-        self.updates['/instance_info/root_gb'] = 50
712
-
713
-        self.pr.provision_node(self.node, 'image', [{'network': 'network'}],
714
-                               root_disk_size=50)
715
-
716
-        self.conn.network.create_port.assert_called_once_with(
717
-            network_id=self.conn.network.find_network.return_value.id)
718
-        self.api.attach_port_to_node.assert_called_once_with(
719
-            self.node.uuid, self.conn.network.create_port.return_value.id)
720
-        self.api.update_node.assert_called_once_with(self.node, self.updates)
721
-        self.api.validate_node.assert_called_once_with(self.node,
722
-                                                       validate_deploy=True)
723
-        self.api.node_action.assert_called_once_with(self.node, 'active',
724
-                                                     configdrive=mock.ANY)
725
-        self.assertFalse(self.wait_mock.called)
726
-        self.assertFalse(self.api.release_node.called)
727
-        self.assertFalse(self.conn.network.delete_port.called)
728
-
729 710
     def test_with_swap_size(self):
730 711
         self.updates['/instance_info/swap_mb'] = 4096
731 712
 
@@ -1152,15 +1133,15 @@ abcd  and-not-image-again
1152 1133
         self.assertFalse(self.api.node_action.called)
1153 1134
         self.api.release_node.assert_called_with(self.node)
1154 1135
 
1155
-    def test_invalid_root_disk_size(self):
1136
+    def test_invalid_root_size_gb(self):
1156 1137
         self.assertRaises(TypeError,
1157 1138
                           self.pr.provision_node,
1158 1139
                           self.node, 'image', [{'network': 'network'}],
1159
-                          root_disk_size={})
1140
+                          root_size_gb={})
1160 1141
         self.assertRaises(ValueError,
1161 1142
                           self.pr.provision_node,
1162 1143
                           self.node, 'image', [{'network': 'network'}],
1163
-                          root_disk_size=0)
1144
+                          root_size_gb=0)
1164 1145
         self.assertFalse(self.conn.network.create_port.called)
1165 1146
         self.assertFalse(self.api.node_action.called)
1166 1147
         self.api.release_node.assert_called_with(self.node)

Loading…
Cancel
Save