[PATCH 2/4] mailman: Catch ctrl-c in fedora-mailing-list-setup

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

 



---
 configs/mailman/fedora-mailing-list-setup |   27 +++++++++++++++++----------
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/configs/mailman/fedora-mailing-list-setup b/configs/mailman/fedora-mailing-list-setup
index a2bffd2..471e77d 100755
--- a/configs/mailman/fedora-mailing-list-setup
+++ b/configs/mailman/fedora-mailing-list-setup
@@ -190,13 +190,20 @@ def ask_questions(listType):
 
     return listname, admin
 
-# work out where we are running fedorahosted lists require extra restrictions
-hostname = os.uname()[1]
-if hostname.startswith("hosted"):
-   listType = "hosted"
-else:
-   listType = "other"
-
-listname, admin = ask_questions(listType)
-switch_user()
-create_list(listname, '%s@xxxxxxxxxxxxxxxxx' % admin)
+def main():
+    # Check where we are.  Lists on fedorahosted.org have extra restrictions.
+    hostname = os.uname()[1]
+    if hostname.startswith("hosted"):
+        listType = "hosted"
+    else:
+        listType = "other"
+
+    listname, admin = ask_questions(listType)
+    switch_user()
+    create_list(listname, '%s@xxxxxxxxxxxxxxxxx' % admin)
+
+if __name__ == '__main__':
+    try:
+        main()
+    except KeyboardInterrupt:
+        sys.exit(1)
-- 
1.6.6

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux