Exemplo n.º 1
0
    def _create_floating_ips(self, floating_ips=None):
        """Create a floating ip object."""
        if floating_ips is None:
            floating_ips = [self.floating_ip]
        elif not isinstance(floating_ips, (list, tuple)):
            floating_ips = [floating_ips]

        dict_ = {'pool': 'patron', 'host': 'fake_host'}
        return db.floating_ip_bulk_create(
            self.context, [dict(address=ip, **dict_) for ip in floating_ips],
        )
Exemplo n.º 2
0
    def _create_floating_ips(self, floating_ips=None):
        """Create a floating ip object."""
        if floating_ips is None:
            floating_ips = [self.floating_ip]
        elif not isinstance(floating_ips, (list, tuple)):
            floating_ips = [floating_ips]

        dict_ = {'pool': 'patron', 'host': 'fake_host'}
        return db.floating_ip_bulk_create(
            self.context,
            [dict(address=ip, **dict_) for ip in floating_ips],
        )
Exemplo n.º 3
0
 def create(cls, context, ip_info, want_result=False):
     db_floatingips = db.floating_ip_bulk_create(context, ip_info,
                                                 want_result=want_result)
     if want_result:
         return obj_base.obj_make_list(context, cls(), FloatingIP,
                                       db_floatingips)