summaryrefslogtreecommitdiff
path: root/cloudinit/cmd/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/cmd/main.py')
-rw-r--r--cloudinit/cmd/main.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
index 9c0ac864..5b467979 100644
--- a/cloudinit/cmd/main.py
+++ b/cloudinit/cmd/main.py
@@ -705,7 +705,6 @@ def main(sysv_args=None):
subparsers.required = True
# Each action and its sub-options (if any)
-
parser_init = subparsers.add_parser('init',
help=('initializes cloud-init and'
' performs initial modules'))
@@ -762,12 +761,20 @@ def main(sysv_args=None):
parser_analyze = subparsers.add_parser(
'analyze', help='Devel tool: Analyze cloud-init logs and data')
- if sysv_args and sysv_args[0] == 'analyze':
- # Only load this parser if analyze is specified to avoid file load cost
- # FIXME put this under 'devel' subcommand (coming in next branch)
- from cloudinit.analyze.__main__ import get_parser as analyze_parser
- # Construct analyze subcommand parser
- analyze_parser(parser_analyze)
+
+ parser_devel = subparsers.add_parser(
+ 'devel', help='Run development tools')
+
+ if sysv_args:
+ # Only load subparsers if subcommand is specified to avoid load cost
+ if sysv_args[0] == 'analyze':
+ from cloudinit.analyze.__main__ import get_parser as analyze_parser
+ # Construct analyze subcommand parser
+ analyze_parser(parser_analyze)
+ if sysv_args[0] == 'devel':
+ from cloudinit.cmd.devel.parser import get_parser as devel_parser
+ # Construct devel subcommand parser
+ devel_parser(parser_devel)
args = parser.parse_args(args=sysv_args)