components/openstack/neutron/files/agent/solaris/dhcp.py
branchs11u3-sru
changeset 6444 bf62eba2612a
parent 6035 c9748fcc32de
equal deleted inserted replaced
6443:54dc57734e1c 6444:bf62eba2612a
     1 # vim: tabstop=4 shiftwidth=4 softtabstop=4
     1 # vim: tabstop=4 shiftwidth=4 softtabstop=4
     2 
     2 
     3 # Copyright 2012 OpenStack Foundation
     3 # Copyright 2012 OpenStack Foundation
     4 # All Rights Reserved.
     4 # All Rights Reserved.
     5 #
     5 #
     6 # Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
     6 # Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
     7 #
     7 #
     8 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
     8 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
     9 #    not use this file except in compliance with the License. You may obtain
     9 #    not use this file except in compliance with the License. You may obtain
    10 #    a copy of the License at
    10 #    a copy of the License at
    11 #
    11 #
    54             '--except-interface=lo0',
    54             '--except-interface=lo0',
    55             '--pid-file=%s' % pid_file,
    55             '--pid-file=%s' % pid_file,
    56             '--dhcp-hostsfile=%s' % self.get_conf_file_name('host'),
    56             '--dhcp-hostsfile=%s' % self.get_conf_file_name('host'),
    57             '--addn-hosts=%s' % self.get_conf_file_name('addn_hosts'),
    57             '--addn-hosts=%s' % self.get_conf_file_name('addn_hosts'),
    58             '--dhcp-optsfile=%s' % self.get_conf_file_name('opts'),
    58             '--dhcp-optsfile=%s' % self.get_conf_file_name('opts'),
    59             '--leasefile-ro',
    59             '--dhcp-leasefile=%s' % self.get_conf_file_name('leases')
    60             '--dhcp-authoritative'
       
    61         ]
    60         ]
    62 
    61 
    63         possible_leases = 0
    62         possible_leases = 0
    64         for i, subnet in enumerate(self.network.subnets):
    63         for i, subnet in enumerate(self.network.subnets):
    65             mode = None
    64             mode = None
   264                 ip_cidr = '%s/%s' % (fixed_ip.ip_address, net.prefixlen)
   263                 ip_cidr = '%s/%s' % (fixed_ip.ip_address, net.prefixlen)
   265                 ip_cidrs.append(ip_cidr)
   264                 ip_cidrs.append(ip_cidr)
   266             else:
   265             else:
   267                 addrconf = True
   266                 addrconf = True
   268 
   267 
   269             self.driver.init_l3(interface_name, ip_cidrs, addrconf=addrconf)
   268         self.driver.init_l3(interface_name, ip_cidrs, addrconf=addrconf)
   270 
   269 
   271         return interface_name
   270         return interface_name
   272 
   271 
   273     def destroy(self, network, device_name):
   272     def destroy(self, network, device_name):
   274         """Destroy the device used for the network's DHCP on this host."""
   273         """Destroy the device used for the network's DHCP on this host."""