Throw exceptions patch

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Makes it so you can ask func to throw exceptions in noglob mode by setting
noexceptions to False.
- --
Scott Henson
Red Hat System Release Engineer
WVU Alum BSAE/BSME
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHim+XcQOfHbe3DKARAn8bAJ40kFX3MQx9GvuX80SU+IfoiGoBIQCg1nZL
8rVgwmKncQ7c7F2YG25QYiI=
=Hi88
-----END PGP SIGNATURE-----
diff --git a/func/overlord/client.py b/func/overlord/client.py
index c6d8ab6..6bebaf8 100755
--- a/func/overlord/client.py
+++ b/func/overlord/client.py
@@ -114,7 +114,7 @@ def isServer(server_string):
 class Client(object):
 
     def __init__(self, server_spec, port=DEFAULT_PORT, interactive=False,
-        verbose=False, noglobs=False, nforks=1, config=None):
+        verbose=False, noglobs=False, nforks=1, config=None, noexceptions=True):
         """
         Constructor.
         @server_spec -- something like "*.example.org" or "foosball"
@@ -134,6 +134,7 @@ class Client(object):
         self.interactive = interactive
         self.noglobs     = noglobs
         self.nforks      = nforks
+        self.noexceptions= noexceptions
         
         self.servers     = expand_servers(self.server_spec, port=self.port, noglobs=self.noglobs,verbose=self.verbose)
 
@@ -203,6 +204,8 @@ class Client(object):
                 if self.interactive:
                     sys.stderr.write("remote exception on %s: %s\n" %
                         (server, str(e)))
+                if self.noglob and not self.noexceptions:
+                    raise(e)
 
             if self.noglobs:
                 return retval
_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux