MCPcopy
hub / github.com/trailofbits/algo / stackscript_available

Function stackscript_available

library/linode_stackscript_v4.py:28–39  ·  view source on GitHub ↗

Try to retrieve a stackscript.

(module, client)

Source from the content-addressed store, hash-verified

26
27
28def stackscript_available(module, client):
29 """Try to retrieve a stackscript."""
30 try:
31 label = module.params["label"]
32 desc = module.params["description"]
33
34 result = client.linode.stackscripts(StackScript.label == label, StackScript.description == desc, mine_only=True)
35 return result[0]
36 except IndexError:
37 return None
38 except Exception as exception:
39 module.fail_json(msg="Unable to query the Linode API. Saw: %s" % exception)
40
41
42def initialise_module():

Callers 1

mainFunction · 0.85

Calls 1

fail_jsonMethod · 0.80

Tested by

no test coverage detected