git://git.onelab.eu
/
nodemanager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
414704c
)
Update host key in main loop.
author
David E. Eisenstat
<deisenst@cs.princeton.edu>
Mon, 25 Jun 2007 16:19:19 +0000
(16:19 +0000)
committer
David E. Eisenstat
<deisenst@cs.princeton.edu>
Mon, 25 Jun 2007 16:19:19 +0000
(16:19 +0000)
nm.py
patch
|
blob
|
history
diff --git
a/nm.py
b/nm.py
index
243a782
..
482f610
100644
(file)
--- a/
nm.py
+++ b/
nm.py
@@
-39,6
+39,12
@@
def GetSlivers(plc):
callback = getattr(module, 'GetSlivers')
callback(data)
callback = getattr(module, 'GetSlivers')
callback(data)
+def UpdateHostKey(plc):
+ logger.log('Trying to update ssh host key at PLC...')
+ ssh_host_key = open('/etc/ssh/ssh_host_rsa_key.pub').read().strip()
+ plc.BootUpdateNode(dict(ssh_host_key=ssh_host_key))
+ logger.log('Host key update succeeded')
+
def run():
try:
if options.daemon: tools.daemon()
def run():
try:
if options.daemon: tools.daemon()
@@
-73,6
+79,8
@@
def run():
plc = PLCAPI(config.plc_api_uri, config.cacert, session, timeout=options.period/2)
while True:
plc = PLCAPI(config.plc_api_uri, config.cacert, session, timeout=options.period/2)
while True:
+ try: UpdateHostKey(plc)
+ except: logger.log_exc()
try: GetSlivers(plc)
except: logger.log_exc()
time.sleep(options.period + random.randrange(0,301))
try: GetSlivers(plc)
except: logger.log_exc()
time.sleep(options.period + random.randrange(0,301))