Skip to content

Commit a86328f

Browse files
Address CoPilot suggestions
1 parent 71544fc commit a86328f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

linode_api4/groups/linode.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def instance_create(
358358
:type boot_size: int
359359
360360
:returns: A new Instance object, or a tuple containing the new Instance and
361-
the password if root_pass was provided.
361+
the password if both image and root_pass were provided.
362362
:rtype: Instance or tuple(Instance, str)
363363
:raises ApiError: If contacting the API fails
364364
:raises UnexpectedResponseError: If the API response is somehow malformed.
@@ -412,7 +412,7 @@ def instance_create(
412412
)
413413

414414
l = Instance(self.client, result["id"], result)
415-
if not root_pass:
415+
if not (image and root_pass):
416416
return l
417417
return l, root_pass
418418

@@ -427,7 +427,7 @@ def build_instance_metadata(user_data=None, encode_user_data=True):
427427
"g6-standard-2",
428428
"us-east",
429429
image="linode/ubuntu22.04",
430-
root_pass=""aComplex@Password123",
430+
root_pass="aComplex@Password123",
431431
metadata=client.linode.build_instance_metadata(user_data="myuserdata")
432432
)
433433
:param user_data: User-defined data to provide to the Linode Instance through

linode_api4/objects/linode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ def disk_create(
14151415
by its User Defined Fields.
14161416
14171417
:returns: A new Disk object, or a tuple containing the new Disk and the
1418-
password if root_pass was provided.
1418+
password if both image and root_pass were provided.
14191419
:rtype: Disk or tuple(Disk, str)
14201420
"""
14211421

@@ -1472,7 +1472,7 @@ def disk_create(
14721472

14731473
d = Disk(self._client, result["id"], self.id, result)
14741474

1475-
if root_pass:
1475+
if image and root_pass:
14761476
return d, root_pass
14771477
return d
14781478

0 commit comments

Comments
 (0)