[kernel-tests] 59/73: Add auto submit script for FAS users

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is an automated email from the git hooks/post-receive script.

jforbes pushed a commit to branch master
in repository kernel-tests.

commit de3640d7b970cf6720b5b574e203df1c307751a9
Author: Justin M. Forbes <jforbes@xxxxxxxxxx>
Date:   Fri Apr 10 14:27:41 2015 -0500

    Add auto submit script for FAS users
---
 fedora_submit.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/fedora_submit.py b/fedora_submit.py
new file mode 100644
index 0000000..0461f36
--- /dev/null
+++ b/fedora_submit.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# Licensed under the terms of the GNU GPL License version 2
+
+from fedora.client import OpenIdBaseClient
+import getpass
+import sys, getopt
+
+username = ''
+password = ''
+log = ''
+
+argv = sys.argv[1:]
+try:
+    opts, args = getopt.getopt(argv,"hu:p:l:",["user=","password=", "logfile="])
+except getopt.GetoptError:
+    print 'fedora_submit.py -u <fasuser> [-p <password>] -l <logfile>'
+    sys.exit(2)
+for opt, arg in opts:
+    if opt == '-h':
+        print 'fedora_submit.py -u <fasuser> [-p <password>] -l <logfile>'
+        sys.exit()
+    elif opt in ("-u", "--user"):
+        username = arg
+    elif opt in ("-p", "--password"):
+        password = arg
+    elif opt in ("-l", "--logfile"):
+        log = arg
+
+if username == '' or log == '':
+    print 'fedora_submit.py -u <fasuser> [-p <password>] -l <logfile>'
+    sys.exit(2)
+if password == '':
+    password = getpass.getpass('FAS password: ')
+
+submitclient = OpenIdBaseClient(
+    base_url='https://apps.fedoraproject.org/kerneltest/',
+    login_url='https://apps.fedoraproject.org/kerneltest/login',
+    username=username,
+)
+ 
+submitclient.login(
+    submitclient.username,
+    password=password
+)
+ 
+req = submitclient.send_request(
+    'https://apps.fedoraproject.org/kerneltest/upload/anonymous',
+    verb='POST',
+    auth=True,
+    files= { 'test_result': ('logfile', open(log, 'rb'), 'text/x-log'),}
+)
+ 
+print req.text

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
kernel mailing list
kernel@xxxxxxxxxxxxxxxxxxxxxxx
https://lists.fedoraproject.org/admin/lists/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux