@@ -177,12 +177,11 @@ def instance_create(
177177 a :any:`Type`, a :any:`Region`, and an :any:`Image`. All three of
178178 these fields may be provided as either the ID or the appropriate object.
179179 When an Image is provided, at least one of ``root_pass``, ``authorized_users``, or
180- ``authorized_keys`` must also be given. If ``root_pass`` is provided,
181- the Instance and the password are returned as a tuple.
180+ ``authorized_keys`` must also be given.
182181
183182 For example::
184183
185- new_linode, password = client.linode.instance_create(
184+ new_linode = client.linode.instance_create(
186185 "g6-standard-2",
187186 "us-east",
188187 image="linode/debian13",
@@ -198,9 +197,6 @@ def instance_create(
198197 image=image,
199198 authorized_keys="ssh-rsa AAAA")
200199
201- To output the password from the first example above:
202- print(password)
203-
204200 To output the first IPv4 address of the new Linode:
205201 print(new_linode.ipv4[0])
206202
@@ -217,7 +213,7 @@ def instance_create(
217213
218214 stackscript = StackScript(client, 10079)
219215
220- new_linode, password = client.linode.instance_create(
216+ new_linode = client.linode.instance_create(
221217 "g6-standard-2",
222218 "us-east",
223219 image="linode/debian13",
@@ -252,7 +248,7 @@ def instance_create(
252248 To create a new Instance with explicit interfaces, provide list of
253249 LinodeInterfaceOptions objects or dicts to the "interfaces" field::
254250
255- linode, password = client.linode.instance_create(
251+ linode = client.linode.instance_create(
256252 "g6-standard-1",
257253 "us-mia",
258254 image="linode/ubuntu24.04",
@@ -293,11 +289,9 @@ def instance_create(
293289 at least one of root_pass, authorized_users, or authorized_keys must also be
294290 provided.
295291 :type image: str or Image
296- :param root_pass: The root password for the new Instance. If an image is
297- provided and root_pass is given, the Instance and password
298- will be returned as a tuple. If all of root_pass, authorized_users, and
299- authorized_keys are not provided when an image is specified,
300- a ValueError will be raised.
292+ :param root_pass: The root password for the new Instance. Required when
293+ an image is provided and neither authorized_users nor
294+ authorized_keys are given.
301295 :type root_pass: str
302296 :param stackscript: The StackScript to deploy to the new Instance. If
303297 provided, "image" is required and must be compatible
@@ -363,9 +357,8 @@ def instance_create(
363357 the boot disk for the Instance.
364358 :type boot_size: int
365359
366- :returns: A new Instance object, or a tuple containing the new Instance and
367- the password if both image and root_pass were provided.
368- :rtype: Instance or tuple(Instance, str)
360+ :returns: A new Instance object
361+ :rtype: Instance
369362 :raises ApiError: If contacting the API fails
370363 :raises UnexpectedResponseError: If the API response is somehow malformed.
371364 This usually indicates that you are using
@@ -423,10 +416,7 @@ def instance_create(
423416 "Unexpected response when creating linode!" , json = result
424417 )
425418
426- l = Instance (self .client , result ["id" ], result )
427- if not (image and root_pass ):
428- return l
429- return l , root_pass
419+ return Instance (self .client , result ["id" ], result )
430420
431421 @staticmethod
432422 def build_instance_metadata (user_data = None , encode_user_data = True ):
@@ -435,7 +425,7 @@ def build_instance_metadata(user_data=None, encode_user_data=True):
435425 the :any:`instance_create` method. This helper can also be used
436426 when cloning and rebuilding Instances.
437427 **Creating an Instance with User Data**::
438- new_linode, password = client.linode.instance_create(
428+ new_linode = client.linode.instance_create(
439429 "g6-standard-2",
440430 "us-east",
441431 image="linode/ubuntu22.04",
0 commit comments