def _blade_scan(ip_address): ssh = _connect_ssh(ip_address) lines = ssh.ibm_command('list -l a') tree = parse.tree(lines=lines) if 'system' not in tree: raise TreeError('"system" not found in the device tree') device = _prepare_devices(ssh, ip_address, '', 'system', tree['system']) return device
def run_ssh_bladecenter(ip): ssh = _connect_ssh(ip) lines = ssh.ibm_command('list -l a') tree = parse.tree(lines=lines) if 'system' not in tree: raise TreeError('"system" not found in the device tree') dev = _recursive_add_dev(ssh, ip, '', 'system', tree['system']) return dev.name