Exemplo n.º 1
0
    def _get_secondary_zone(self, values=None, attributes=None, masters=None):
        attributes = attributes or []
        masters = masters or [{"host": "10.0.0.1", "port": 53}]
        fixture = self.get_zone_fixture("SECONDARY", values=values)
        fixture['email'] = cfg.CONF['service:central'].managed_resource_email

        zone = objects.Zone(**fixture)
        zone.attributes = objects.ZoneAttributeList().from_list(attributes)
        zone.masters = objects.ZoneMasterList().from_list(masters)
        return zone
Exemplo n.º 2
0
    def _parse_object(cls, values, object, *args, **kwargs):

        if 'masters' in values:

            object.masters = objects.adapters.DesignateAdapter.parse(
                cls.ADAPTER_FORMAT, values['masters'],
                objects.ZoneMasterList(), *args, **kwargs)

            del values['masters']

        if 'attributes' in values:

            object.attributes = objects.adapters.DesignateAdapter.parse(
                cls.ADAPTER_FORMAT, values['attributes'],
                objects.ZoneAttributeList(), *args, **kwargs)

            del values['attributes']

        return super(ZoneAPIv2Adapter,
                     cls)._parse_object(values, object, *args, **kwargs)