From 4dbfc55a6c90aee390ab981b0d4775d8b94e4803 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 14 Jun 2016 15:00:40 -0700 Subject: Don't continue running with no action --- cloudinit/cmd/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py index c8916e03..2bd75328 100755 --- a/cloudinit/cmd/main.py +++ b/cloudinit/cmd/main.py @@ -646,6 +646,11 @@ def main(sysv_args=None): args = parser.parse_args(args=sysv_args) + try: + (name, functor) = args.action + except AttributeError: + parser.error('too few arguments') + # Setup basic logging to start (until reinitialized) # iff in debug mode... if args.debug: @@ -654,11 +659,6 @@ def main(sysv_args=None): # Setup signal handlers before running signal_handler.attach_handlers() - try: - (name, functor) = args.action - except AttributeError: - parser.error('too few arguments') - if name in ("modules", "init"): functor = status_wrapper -- cgit v1.2.3