def get_fc_hba_descriptors(vmhbaname, executor): exec_ = command.get_exec_fn(executor) vmkmgmt_keyval_cls = vmkmgmt_keyval.find(executor) vmkmgmt_keyval_impl = vmkmgmt_keyval_cls() cmd = vmkmgmt_keyval_impl.instance('%s/Emulex' % vmhbaname).key('adapter') key_descriptor = exec_(cmd) if key_descriptor: return _parse(key_descriptor)
def get_fc_hba_descriptors(vmhbaname, executor): exec_ = command.get_exec_fn(executor) vmkmgmt_keyval_cls = vmkmgmt_keyval.find(executor) vmkmgmt_keyval_impl = vmkmgmt_keyval_cls() instances = exec_(vmkmgmt_keyval_impl.dumpInstances) fn = comp(methodcaller('startswith', 'qlnativefc'), methodcaller('lower')) for instance in ifilter(fn, instances): key_descriptors = exec_(vmkmgmt_keyval_impl.instance(instance).list) for descriptor in key_descriptors: if vmhbaname in descriptor.value: return _parse(vmhbaname, descriptor)
def _isapplicable(**context): drivername = context.get('drivername') if drivername and drivername.lower() == 'qlnativefc': executor = context.get('executor') if executor: return bool(vmkmgmt_keyval.find(executor))