From: Thierry Parmentelat Date: Wed, 2 Apr 2008 08:57:20 +0000 (+0000) Subject: get the right hostname for cleaning the known_hosts file X-Git-Tag: tests-4.2-4~102 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=98475e114facc2210190458ef12ae1c14281a418;p=tests.git get the right hostname for cleaning the known_hosts file scan the public keys from the right hostname and not from *nodename --- diff --git a/system/TestSlice.py b/system/TestSlice.py index 205c6ea..3448028 100644 --- a/system/TestSlice.py +++ b/system/TestSlice.py @@ -59,11 +59,14 @@ class TestSlice: def clear_known_hosts (self): utils.header("Messing with known_hosts for slice %s"%self.name()) + hostnames=[] # scan nodenames for nodename in self.slice_spec['nodenames']: - self.test_plc.run_in_guest("sed -i -e /^%s/d /root/.ssh/known_hosts"%nodename) + (site_spec,node_spec) = self.test_plc.locate_node(nodename) + hostnames.append(node_spec['node_fields']['hostname']) + self.test_plc.run_in_guest("sed -i -e /^%s/d /root/.ssh/known_hosts"%node_spec['node_fields']['hostname']) #scan public key and update the known_host file in the root image - self.test_plc.scan_publicKeys(self.slice_spec['nodenames']) + self.test_plc.scan_publicKeys(hostnames) def locate_key(self,slice_spec): # locate the first avail. key