def _create_ip_range_from_xml(self, subnet_id, network_name, ip_address, start_ip, end_ip): lib_utils = XMLUtils() net_xml = '<network><name>' + \ network_name + '</name><forward mode=\'nat\'/><ip address=\' ' + \ ip_address + \ '\' netmask=\'255.255.255.0\'><dhcp><range start=\'' + \ start_ip + '\' end=\'' + end_ip + '\'/>''</dhcp></ip></network>' ipRange = IpAddressRange() if lib_utils.parseXML(net_xml, '//network/ip/dhcp') is not None: startIpAddress = IpAddress() startIpAddress.set_address(lib_utils.parseXMLAttributes( net_xml, '//network/ip/dhcp/range', 'start')) ipRange.set_id(startIpAddress.get_address()) startIpAddress.set_id(startIpAddress.get_address()) startIpAddress.set_allocationType('DHCP') ipRange.set_startAddress(startIpAddress) endIpAddress = IpAddress() endIpAddress.set_address(lib_utils.parseXMLAttributes( net_xml, '//network/ip/dhcp/range', 'end')) endIpAddress.set_id(endIpAddress.get_address()) endIpAddress.set_allocationType('DHCP') ipRange.set_endAddress(endIpAddress) ipRange.set_allocationType('DHCP') else: ipRange.set_id(subnet_id + '_AUTO_STATIC') ipRange.set_allocationType('AUTO_STATIC') return ipRange
def setUp(self): self.utils = XMLUtils() self.ipProfile = IpProfile() self.ip_profile_list = [] self.ipProfile.set_ipAddress('10.10.0.0') self.ipProfile.set_hostname('LOCALHOST') self.ipProfile.set_ipType("IPV4") self.ip_profile_list.append(self.ipProfile)
def __init__(self, conn, uuid): self.conn = conn self.libvirtconn = conn self.uuid = uuid self.domainObj = None self.old_stats = None self.new_stats = None self.temp_stats = Stats() self.utils = XMLUtils()
def setUp(self): self.utils = XMLUtils()