def reparentHosts(self, hosts): """Moves the given hosts to the allocation @type hosts: list<HostInterfacePrx or Host or id or str hostname> @param hosts: The hosts to move to this allocation """ hostSeq = host_pb2.HostSeq() hostSeq.hosts.extend(hosts) self.stub.ReparentHosts(facility_pb2.AllocReparentHostsRequest( allocation=self.data, hosts=hostSeq), timeout=Cuebot.Timeout)
def reparentHosts(self, hosts): """Moves the given hosts to the allocation @type hosts: list<opencue.wrappers.host.Host> @param hosts: The hosts to move to this allocation """ hostSeq = host_pb2.HostSeq() hostSeq.hosts.extend([host.data for host in hosts]) self.stub.ReparentHosts( facility_pb2.AllocReparentHostsRequest(allocation=self.data, hosts=hostSeq), timeout=Cuebot.Timeout )
def reparentHosts(self, hosts): """Moves the given hosts into the allocation. :type hosts: list<opencue.wrappers.host.Host> :param hosts: the hosts to move to this allocation """ hostSeq = host_pb2.HostSeq() # pylint: disable=no-member hostSeq.hosts.extend([host.data for host in hosts]) # pylint: enable=no-member self.stub.ReparentHosts(facility_pb2.AllocReparentHostsRequest( allocation=self.data, hosts=hostSeq), timeout=Cuebot.Timeout)
def testReparentHostIds(self, getStubMock): stubMock = mock.Mock() stubMock.ReparentHosts.return_value = facility_pb2.AllocReparentHostsResponse() getStubMock.return_value = stubMock alloc = opencue.wrappers.allocation.Allocation( facility_pb2.Allocation(name=TEST_ALLOC_NAME)) hostIds = [TEST_HOST_ID] alloc.reparentHostIds(hostIds) hosts = [host_pb2.Host(id=TEST_HOST_ID)] stubMock.ReparentHosts.assert_called_with( facility_pb2.AllocReparentHostsRequest( allocation=alloc.data, hosts=host_pb2.HostSeq(hosts=hosts)), timeout=mock.ANY)