def checkin(vm, background, all_, sequential, filter): """Checkin or "remove" a VM or series of VM broker instances COMMAND: broker checkin <vm hostname>|<local id>|all :param vm: Hostname or local id of host :param background: run a new broker subprocess to carry out command :param all_: Flag for whether to checkin everything :param sequential: Flag for whether to run checkins sequentially :param filter: a filter string matching broker's specification """ if background: helpers.fork_broker() inventory = helpers.load_inventory(filter=filter) to_remove = [] for num, host in enumerate(inventory): if str(num ) in vm or host["hostname"] in vm or host["name"] in vm or all_: to_remove.append(VMBroker().reconstruct_host(host)) broker_inst = VMBroker(hosts=to_remove) broker_inst.checkin(sequential=sequential)
def checkin(vm, all_): """Checkin or "remove" a VM or series of VM broker instances COMMAND: broker checkin <vm hostname>|<local id>|all :param vm: Hostname or local id of host """ inventory = helpers.load_inventory() to_remove = [] for num, host_export in enumerate(inventory): if str(num) in vm or host_export["hostname"] in vm or all_: to_remove.append(VMBroker.reconstruct_host(host_export)) broker_inst = VMBroker(hosts=to_remove) broker_inst.checkin()
def checkin(vm, background, all_): """Checkin or "remove" a VM or series of VM broker instances COMMAND: broker checkin <vm hostname>|<local id>|all :param vm: Hostname or local id of host :param background: run a new broker subprocess to carry out command """ if background: fork_broker() inventory = helpers.load_inventory() to_remove = [] for num, host_export in enumerate(inventory): if str(num) in vm or host_export["hostname"] in vm or all_: to_remove.append(VMBroker.reconstruct_host(host_export)) broker_inst = VMBroker(hosts=to_remove) broker_inst.checkin()