Ejemplo 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': 'nova', 'host': 'fake_host'}
        return db.floating_ip_bulk_create(
            self.context, [dict(address=ip, **dict_) for ip in floating_ips],
        )
    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': 'nova', 'host': 'fake_host'}
        return db.floating_ip_bulk_create(
            self.context,
            [dict(address=ip, **dict_) for ip in floating_ips],
        )
Ejemplo 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)