Skip to content

Commit 9246840

Browse files
fix: Resolve issue with creating arguments for objects without properties (#513)
1 parent c9eeb89 commit 9246840

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

linodecli/baked/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _parse_request_model(schema, prefix=None, list_of_objects=False):
9999

100100
if schema.properties is not None:
101101
for k, v in schema.properties.items():
102-
if v.type == "object":
102+
if v.type == "object" and not v.readOnly and v.properties:
103103
# nested objects receive a prefix and are otherwise parsed normally
104104
pref = prefix + "." + k if prefix else k
105105
args += _parse_request_model(v, prefix=pref)

tests/integration/stackscripts/test_stackscripts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def create_stackscript():
4545
+ [
4646
"create",
4747
"--script",
48-
"#!/bin/bash \n $EXAMPLE_SCRIPT",
48+
'#!/bin/bash\n# <UDF name="foo" Label="foo" example="bar" />\n $EXAMPLE_SCRIPT',
4949
"--image",
5050
"linode/debian9",
5151
"--label",
@@ -236,6 +236,8 @@ def test_deploy_linode_from_stackscript(create_stackscript):
236236
"create",
237237
"--stackscript_id",
238238
private_stackscript,
239+
"--stackscript_data",
240+
'{"foo": "bar"}',
239241
"--type",
240242
linode_plan,
241243
"--image",

0 commit comments

Comments
 (0)