blob: 7411df0d62d7e6bf5b84948b7dd67df2bdfdd818 [file] [log] [blame]
import base_section
from runtest import conditions
class Dns(base_section.BaseSection):
name = "dns"
options = [
'build_interval',
'build_timeout',
'catalog_type',
'endpoint_type',
'min_ttl',
'nameservers',
'query_timeout',
'zone_id',
]
@property
def build_interval(self):
pass
@property
def build_timeout(self):
pass
@property
def catalog_type(self):
pass
@property
def endpoint_type(self):
pass
@property
def min_ttl(self):
pass
@property
def nameservers(self):
pass
@property
def query_timeout(self):
pass
@property
def zone_id(self):
c = conditions.BaseRule(field='keystone.client.enabled', op='eq',
val=True)
nodes = self.get_nodes_where_condition_match(c)
zone_name = self.runtest_opts.get('convert_to_uuid', {}).get(
'dns', {}).get('zone_id')
keystone_profile_admin = self.runtest_opts.get('keystone_profile_admin', {})
res = self.authenticated_openstack_module_call(
nodes[0], 'designatev2.zone_list', cloud_name=keystone_profile_admin)[nodes[0]]
zones = [n['id'] for n in res['zones'] if n['name'] == zone_name]
if len(zones) != 1:
raise Exception("Error getting zones: {}".format(images))
return zones[0]