MCPcopy Create free account
hub / github.com/StackStorm/st2 / register_opts

Function register_opts

st2common/st2common/content/bootstrap.py:53–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def register_opts():
54 content_opts = [
55 cfg.BoolOpt("all", default=False, help="Register sensors, actions and rules."),
56 cfg.BoolOpt("triggers", default=False, help="Register triggers."),
57 cfg.BoolOpt("sensors", default=False, help="Register sensors."),
58 cfg.BoolOpt("actions", default=False, help="Register actions."),
59 cfg.BoolOpt("runners", default=False, help="Register runners."),
60 cfg.BoolOpt("rules", default=False, help="Register rules."),
61 cfg.BoolOpt("aliases", default=False, help="Register aliases."),
62 cfg.BoolOpt("policies", default=False, help="Register policies."),
63 cfg.BoolOpt("configs", default=False, help="Register and load pack configs."),
64 cfg.StrOpt(
65 "pack", default=None, help="Directory to the pack to register content from."
66 ),
67 cfg.StrOpt("runner-dir", default=None, help="Directory to load runners from."),
68 cfg.BoolOpt(
69 "setup-virtualenvs",
70 default=False,
71 help=(
72 "Setup Python virtual environments " "all the Python runner actions."
73 ),
74 ),
75 cfg.BoolOpt(
76 "recreate-virtualenvs",
77 default=False,
78 help=(
79 "Recreate Python virtual "
80 "environments for all the Python "
81 "Python runner actions."
82 ),
83 ),
84 # General options
85 # Note: This value should default to False since we want fail on failure behavior by
86 # default.
87 cfg.BoolOpt(
88 "no-fail-on-failure",
89 default=False,
90 help=("Don't exit with non-zero if some resource registration fails."),
91 ),
92 # Note: Fail on failure is now a default behavior. This flag is only left here for backward
93 # compatibility reasons, but it's not actually used.
94 cfg.BoolOpt(
95 "fail-on-failure",
96 default=True,
97 help=("Exit with non-zero if some resource registration fails."),
98 ),
99 ]
100 try:
101 cfg.CONF.register_cli_opts(content_opts, group="register")
102 except:
103 sys.stderr.write("Failed registering opts.\n")
104
105
106register_opts()

Callers 1

bootstrap.pyFile · 0.70

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected