cas-admin | 28 +++++++++++++++-------------
lib/cas/db.py | 1 +
2 files changed, 16 insertions(+), 13 deletions(-)
New commits:
commit 2ba2ee78201e01451b5de0dde18d3fa6285fdd65
Author: adam stokes <ajs(a)redhat.com>
Date: Wed Apr 29 10:43:55 2009 -0400
add commit routine to addServer()
diff --git a/lib/cas/db.py b/lib/cas/db.py
index 6d1d01a..9b46158 100644
--- a/lib/cas/db.py
+++ b/lib/cas/db.py
@@ -125,6 +125,7 @@ class CasStorage(object):
if not self.cursor.fetchone():
self.cursor.execute('''INSERT into server (hostname, arch)
values ("%s","%s")''' % values)
+ self.commit()
return
def getServers(self):
commit 27cc1674d99ba13b95f9fb0cd42156b0ff10f3cd
Author: adam stokes <ajs(a)redhat.com>
Date: Wed Apr 29 10:43:38 2009 -0400
make sure func clients are reachable when building server db
diff --git a/cas-admin b/cas-admin
index 7ee4551..193427e 100755
--- a/cas-admin
+++ b/cas-admin
@@ -116,19 +116,21 @@ class CasServerHandler(object):
scheme, netloc, path, query, frag = urlparse.urlsplit(i)
hostname, port = netloc.split(":")
client = fc.Overlord(hostname)
- # Returns as
{"hostname":['sts','stdout','stderr']}
- # what a pain
- client_dict = client.command.run("/bin/uname -m")
- # silly magic to get output from command module
- # since we are doing one host at a time we just pull the first
- # key from the dict and parse its return
- sts, arch, err = client_dict[client_dict.keys()[0]]
- if sts:
- self.casLog.debug(err)
- # clean up arch string
- arch = arch.strip()
- self.db.addServer(hostname, arch)
- hostname_count = hostname_count + 1
+ isClientReachable = client.run("test","ping", [])
+ if isClientReachable == 1:
+ # Returns as
{"hostname":['sts','stdout','stderr']}
+ # what a pain
+ client_dict = client.command.run("/bin/uname -m")
+ # silly magic to get output from command module
+ # since we are doing one host at a time we just pull the first
+ # key from the dict and parse its return
+ sts, arch, err = client_dict[client_dict.keys()[0]]
+ if sts:
+ self.casLog.debug(err)
+ # clean up arch string
+ arch = arch.strip()
+ self.db.addServer(hostname, arch)
+ hostname_count = hostname_count + 1
self.casLog.info("Server database built with %d server(s) added." %
(hostname_count,))
except ImportError:
self.casLog.debug("Please install func (
http://fedorahosted.org/func)
for " \