def add_host(self, ip, mac):
		"""Create a host object with given ip address and and mac address.

		@type ip: str
		@type mac: str
		@raises ValueError:
		@raises OmapiError:
		@raises socket.error:
		"""
		msg = OmapiMessage.open(b"host")
		msg.message.append((b"create", struct.pack("!I", 1)))
		msg.message.append((b"exclusive", struct.pack("!I", 1)))
		msg.obj.append((b"hardware-address", pack_mac(mac)))
		msg.obj.append((b"hardware-type", struct.pack("!I", 1)))
		msg.obj.append((b"ip-address", pack_ip(ip)))
		response = self.query_server(msg)
		if response.opcode != OMAPI_OP_UPDATE:
			raise OmapiError("add failed")
def add_host ( self , ip , mac ) : msg = OmapiMessage . open ( b"host" ) msg . message . append ( ( b"create" , struct . pack ( "!I" , 1 ) ) ) msg . message . append ( ( b"exclusive" , struct . pack ( "!I" , 1 ) ) ) msg . obj . append ( ( b"hardware-address" , pack_mac ( mac ) ) ) msg . obj . append ( ( b"hardware-type" , struct . pack ( "!I" , 1 ) ) ) msg . obj . append ( ( b"ip-address" , pack_ip ( ip ) ) ) response = self . query_server ( msg ) if response . opcode != OMAPI_OP_UPDATE : raise OmapiError ( "add failed" )
Create a host object with given ip address and and mac address.

		@type ip: str
		@type mac: str
		@raises ValueError:
		@raises OmapiError:
		@raises socket.error: