Michael Pasternak has uploaded a new change for review.

Change subject: cli: remove history /connect entry even in case of unsuccessful 
connection
......................................................................

cli: remove history /connect entry even in case of unsuccessful connection

Change-Id: I7bcd15cf93e1a46eb07eacfb29e5f0751e021ace
Signed-off-by: Michael Pasternak <[email protected]>
---
M src/ovirtcli/command/connect.py
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/99/8099/1

diff --git a/src/ovirtcli/command/connect.py b/src/ovirtcli/command/connect.py
index 3cfcfce..52c5e08 100644
--- a/src/ovirtcli/command/connect.py
+++ b/src/ovirtcli/command/connect.py
@@ -106,13 +106,9 @@
                 self.testConnectivity()
 
             self.context._set_prompt()
-            stdout.write(OvirtCliSettings.CONNECTED_TEMPLATE % \
-            self.context.settings.get('ovirt-shell:version'))
             self.context.history.enable()
-
-            #do not log connect command details as it may be
-            #a subject for password stealing or DOS attack
-            self.__remove_history_entry()
+            stdout.write(OvirtCliSettings.CONNECTED_TEMPLATE % \
+                         self.context.settings.get('ovirt-shell:version'))
 
         except RequestError, e:
             self.__cleanContext()
@@ -127,6 +123,10 @@
         except Exception, e:
             self.__cleanContext()
             self.error(str(e))
+        finally:
+            #do not log connect command details as it may be
+            #a subject for password stealing or DOS attack
+            self.__remove_history_entry()
 
     def testConnectivity(self):
         self.context.connection.test(throw_exception=True)


--
To view, visit http://gerrit.ovirt.org/8099
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bcd15cf93e1a46eb07eacfb29e5f0751e021ace
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Michael Pasternak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to