diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-01-13 15:12:53 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-01-13 15:12:53 -0500 |
commit | 3d060b8d56775508f8ce463240525ed5a1280d48 (patch) | |
tree | 1d145b75edc3ea61303f0555e1975893a3c7b5b4 /func/overlord | |
parent | e87e62d301dbd8fe99ac74be7a38009b2e3748cb (diff) | |
parent | 962dbb643fdef4c6c071aeba6b29d372c965980d (diff) | |
download | func-3d060b8d56775508f8ce463240525ed5a1280d48.tar.gz func-3d060b8d56775508f8ce463240525ed5a1280d48.tar.xz func-3d060b8d56775508f8ce463240525ed5a1280d48.zip |
Merge branch 'master' of ssh://git.fedoraproject.org/git/hosted/func
Conflicts:
func/overlord/client.py
Diffstat (limited to 'func/overlord')
-rwxr-xr-x | func/overlord/client.py | 17 | ||||
-rw-r--r-- | func/overlord/cmd_modules/call.py | 2 | ||||
-rw-r--r-- | func/overlord/cmd_modules/copyfile.py | 3 | ||||
-rw-r--r-- | func/overlord/cmd_modules/listminions.py | 2 | ||||
-rw-r--r-- | func/overlord/cmd_modules/ping.py | 8 | ||||
-rw-r--r-- | func/overlord/cmd_modules/show.py | 5 | ||||
-rw-r--r-- | func/overlord/func_command.py | 2 | ||||
-rwxr-xr-x | func/overlord/inventory.py | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | func/overlord/sslclient.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | func/overlord/test_func.py | 0 |
10 files changed, 12 insertions, 33 deletions
diff --git a/func/overlord/client.py b/func/overlord/client.py index 5eb6ef0..e6ec590 100755 --- a/func/overlord/client.py +++ b/func/overlord/client.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - ## ## func command line interface & client lib ## @@ -63,10 +61,8 @@ class CommandAutomagic(object): method = ".".join(self.base[1:]) return self.clientref.run(module,method,args,nforks=self.nforks) -# =================================== - - +# =================================== # this is a module level def so we can use it and isServer() from # other modules with a Client class def expand_servers(spec, port=51234, noglobs=None, verbose=None, just_fqdns=False): @@ -105,6 +101,7 @@ def expand_servers(spec, port=51234, noglobs=None, verbose=None, just_fqdns=Fals return all_urls + # does the hostnamegoo actually expand to anything? def isServer(server_string): servers = expand_servers(server_string) @@ -112,10 +109,11 @@ def isServer(server_string): return True return False + class Client(object): def __init__(self, server_spec, port=DEFAULT_PORT, interactive=False, - verbose=False, noglobs=False, nforks=1, async=False, config=None): + verbose=False, noglobs=False, nforks=1, config=None, async=False, noexceptions=True): """ Constructor. @server_spec -- something like "*.example.org" or "foosball" @@ -136,8 +134,9 @@ class Client(object): self.noglobs = noglobs self.nforks = nforks self.async = async + self.noexceptions= noexceptions - self.servers = expand_servers(self.server_spec, port=self.port, noglobs=self.noglobs,verbose=self.verbose) + self.servers = expand_servers(self.server_spec, port=self.port, noglobs=self.noglobs,verbose=self.verbose) # default cert/ca/key is the same as the certmaster ca - need to # be able to change that on the cli @@ -211,6 +210,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 @@ -269,5 +270,3 @@ class Client(object): if x > max: max = x return max - - diff --git a/func/overlord/cmd_modules/call.py b/func/overlord/cmd_modules/call.py index b62131f..4828981 100644 --- a/func/overlord/cmd_modules/call.py +++ b/func/overlord/cmd_modules/call.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - """ call func method invoker diff --git a/func/overlord/cmd_modules/copyfile.py b/func/overlord/cmd_modules/copyfile.py index ff1f148..7950b7b 100644 --- a/func/overlord/cmd_modules/copyfile.py +++ b/func/overlord/cmd_modules/copyfile.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - """ copyfile command line @@ -73,4 +71,3 @@ class CopyFile(client.command.Command): data = xmlrpclib.Binary(fb) results = client_obj.run("copyfile", "copyfile", [self.options.remotepath, data, mode, uid, gid]) - diff --git a/func/overlord/cmd_modules/listminions.py b/func/overlord/cmd_modules/listminions.py index 95f0bc9..b34efe4 100644 --- a/func/overlord/cmd_modules/listminions.py +++ b/func/overlord/cmd_modules/listminions.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - """ copyfile command line diff --git a/func/overlord/cmd_modules/ping.py b/func/overlord/cmd_modules/ping.py index 29fa9d0..397adc8 100644 --- a/func/overlord/cmd_modules/ping.py +++ b/func/overlord/cmd_modules/ping.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - """ copyfile command line @@ -15,7 +13,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """ - import optparse import os import pprint @@ -28,11 +25,11 @@ from func.overlord import client # FIXME: this really should not be in each sub module. DEFAULT_PORT = 51234 + class Ping(client.command.Command): name = "ping" useage = "see what func minions are up/accessible" - def addOptions(self): """ Not too many options for you! (Seriously, it's a simple command ... func "*" ping) @@ -43,14 +40,12 @@ class Ping(client.command.Command): self.parser.add_option("-p", "--port", dest="port", default=DEFAULT_PORT) - def handleOptions(self, options): """ Nothing to do here... """ pass - def do(self, args): self.server_spec = self.parentCommand.server_spec @@ -72,4 +67,3 @@ class Ping(client.command.Command): print "[ FAILED ] %s" % server return 1 - diff --git a/func/overlord/cmd_modules/show.py b/func/overlord/cmd_modules/show.py index 9582e0d..4a26a75 100644 --- a/func/overlord/cmd_modules/show.py +++ b/func/overlord/cmd_modules/show.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - """ show introspection commandline @@ -73,6 +71,7 @@ class ShowHardware(client.command.Command): if arg in minion_data: print minion_data[arg] + class Show(client.command.Command): name = "show" useage = "various simple report stuff" @@ -98,5 +97,3 @@ class Show(client.command.Command): def do(self, args): pass - - diff --git a/func/overlord/func_command.py b/func/overlord/func_command.py index 7b491f7..76b4e95 100644 --- a/func/overlord/func_command.py +++ b/func/overlord/func_command.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - import glob import sys diff --git a/func/overlord/inventory.py b/func/overlord/inventory.py index f36ff69..aafc764 100755 --- a/func/overlord/inventory.py +++ b/func/overlord/inventory.py @@ -1,5 +1,4 @@ #!/usr/bin/python - ## ## func inventory app. ## use func to collect inventory data on anything, yes, anything @@ -30,6 +29,7 @@ import func.overlord.client as func_client DEFAULT_TREE = "/var/lib/func/inventory/" + class FuncInventory(object): def __init__(self): @@ -81,8 +81,6 @@ class FuncInventory(object): # see what modules each host provides (as well as what hosts we have) host_methods = func_client.Client(options.server_spec).system.list_methods() - - # call all remote info methods and handle them if options.verbose: # print "- DEBUG: %s" % host_methods @@ -186,8 +184,8 @@ class FuncInventory(object): # FIXME: check rc's os.chdir(cwd) + if __name__ == "__main__": inv = FuncInventory() inv.run(sys.argv) - diff --git a/func/overlord/sslclient.py b/func/overlord/sslclient.py index ccb2c9c..ccb2c9c 100644..100755 --- a/func/overlord/sslclient.py +++ b/func/overlord/sslclient.py diff --git a/func/overlord/test_func.py b/func/overlord/test_func.py index 2b3f041..2b3f041 100644..100755 --- a/func/overlord/test_func.py +++ b/func/overlord/test_func.py |