c...@rocks-127.sdsc.edu
unread,Feb 13, 2013, 6:16:51 PM2/13/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rocks-clusters-de...@googlegroups.com, anoop.r...@gmail.com, greg....@gmail.com, mason...@gmail.com, philip.pa...@gmail.com, luca.c...@gmail.com
clem 13/02/13 15:16:51
Modified: src/roll/base/src/command/commands/report/knownhosts
__init__.py
Log:
do not throw an exception when the ssh keys are not yet in the database
prevent the rocks report knownhosts from failing if there are no key in the db
Revision Changes Path
1.7 +6 -3 rocks/src/roll/base/src/command/commands/report/knownhosts/__init__.py
Index: __init__.py
===================================================================
RCS file: /home/cvs/CVSROOT/rocks/src/roll/base/src/command/commands/report/knownhosts/__init__.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -t -w -r1.6 -r1.7
--- __init__.py 21 Dec 2012 02:36:36 -0000 1.6
+++ __init__.py 13 Feb 2013 23:16:51 -0000 1.7
@@ -1,4 +1,4 @@
-#$Id: __init__.py,v 1.6 2012/12/21 02:36:36 clem Exp $
+#$Id: __init__.py,v 1.7 2013/02/13 23:16:51 clem Exp $
#
# @Copyright@
#
@@ -118,8 +118,11 @@
# now the cluster-wide public key
cmd = """SELECT s.value FROM sec_global_attributes s
WHERE s.attr = 'ssh_host_rsa_key.pub';"""
- self.db.execute(cmd)
+ row = self.db.execute(cmd)
+ if row > 0:
pubkey, = self.db.fetchone()
+ else:
+ pubkey = None
if pubkey is not None:
pubkey = pubkey.rstrip('\n')