This is necessary for authentication schemes on the backend (LDAP, etc.).
    
Signed-off-by: Nishanth Aravamudan <[email protected]>

---
I had to choose -U/--username because -u/--user is already in use.

diff --git a/cli/topic_common.py b/cli/topic_common.py
index dc057bf..57a6049 100644
--- a/cli/topic_common.py
+++ b/cli/topic_common.py
@@ -361,6 +361,7 @@ class atest(object):
         self.kill_on_failure = False
         self.web_server = ''
         self.verbose = False
+        self.username = ''
         self.topic_parse_info = item_parse_info(attribute_name='not_used')
 
         self.parser = optparse.OptionParser(self._get_usage())
@@ -384,6 +385,11 @@ class atest(object):
                                'to talk to',
                                action='store', type='string',
                                dest='web_server', default=None)
+        self.parser.add_option('-U', '--username',
+                               help='Specify the username to'
+                               'login with',
+                               action='store', type='string',
+                               dest='username', default=None)
 
 
     def _get_usage(self):
@@ -454,7 +460,7 @@ class atest(object):
         self.verbose = options.verbose
         self.web_server = options.web_server
         try:
-            self.afe = rpc.afe_comm(self.web_server)
+            self.afe = rpc.afe_comm(self.web_server, username=self.username)
         except rpc.AuthError, s:
             self.failure(str(s), fatal=True)

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to