fix authentication setup in interactive mode and improve error handling so tracebacks are not printed twice

Change-Id: I59fb07369edad3b2f2abddba3c0d0f6bbce1eab1
This commit is contained in:
Doug Hellmann
2012-05-14 10:50:25 -04:00
parent fa4a4a37d6
commit 8939d26a5b

View File

@@ -196,9 +196,11 @@ class OpenStackShell(App):
# If the user is not asking for help, make sure they
# have given us auth.
cmd_name = None
if argv:
cmd_info = self.command_manager.find_command(argv)
cmd_factory, cmd_name, sub_argv = cmd_info
if cmd_name != 'help':
if self.interactive_mode or cmd_name != 'help':
self.authenticate_user()
def prepare_to_run_command(self, cmd):
@@ -215,7 +217,10 @@ class OpenStackShell(App):
def main(argv=sys.argv[1:]):
try:
return OpenStackShell().run(argv)
except:
return 1
if __name__ == "__main__":