Ejemplo n.º 1
0
    def __init__(self,
                 name=None,
                 network=None,
                 interface=None,
                 port=None,
                 protocol=None,
                 dh_param_bits=None,
                 mode=None,
                 local_networks=None,
                 dns_servers=None,
                 search_domain=None,
                 public_address=None,
                 otp_auth=None,
                 lzo_compression=None,
                 debug=None,
                 **kwargs):
        mongo.MongoObject.__init__(self, **kwargs)

        self._cur_event = None
        self._last_event = 0
        self._orig_network = self.network
        self._orgs_changed = False
        self._clients = None
        self._temp_path = utils.get_temp_path()
        self._instance_id = str(bson.ObjectId())
        self.ip_pool = ServerIpPool(self)

        if name is not None:
            self.name = name
        if network is not None:
            self.network = network
        if interface is not None:
            self.interface = interface
        if port is not None:
            self.port = port
        if protocol is not None:
            self.protocol = protocol
        if dh_param_bits is not None:
            self.dh_param_bits = dh_param_bits
        if mode is not None:
            self.mode = mode
        if local_networks is not None:
            self.local_networks = local_networks
        if dns_servers is not None:
            self.dns_servers = dns_servers
        if search_domain is not None:
            self.search_domain = search_domain
        if public_address is not None:
            self.public_address = public_address
        if otp_auth is not None:
            self.otp_auth = otp_auth
        if lzo_compression is not None:
            self.lzo_compression = lzo_compression
        if debug is not None:
            self.debug = debug
Ejemplo n.º 2
0
 def ip_pool(self):
     return ServerIpPool(self)