Esempio n. 1
0
 def api_v1(self):
     ge = conditions.BaseRule('*.glance.server.enabled', 'eq', True,
                              multiple='any').check(self.pillar)
     if not ge:
         return
     c = conditions.BaseRule('glance.server.enabled', 'eq', True)
     gv = self.get_item_when_condition_match(
         'glance.server.version', c)
     # starting from Ocata glance_v1 is disable - hardcoded
     if gv not in ['juno', 'kilo', 'liberty', 'mitaka', 'newton']:
        return True
Esempio n. 2
0
 def uri_v3(self):
     c = conditions.BaseRule('keystone.server.enabled', 'eq', True)
     vip = self.get_item_when_condition_match(
         '_param.cluster_vip_address', c)
     port = self.get_item_when_condition_match(
         'keystone.server.bind.private_port', c)
     return "http://{}:{}/v3".format(vip, port)
 def resize(self):
     # NOTE(vsaienko) allow_resize_to_same_host is hardcoded to True in
     # nova formula, update when value is configurable.
     res = conditions.BaseRule('*.nova.compute.enabled',
                               'eq',
                               True,
                               multiple='any').check(self.pillar)
     return res
Esempio n. 4
0
    def port_security(self):
        c = conditions.BaseRule('neutron.server.enabled', 'eq', True)
        ext = self.get_item_when_condition_match(
            'neutron.server.backend.extension', c)

        if 'port_security' in ext:
            return ext['port_security'].get('enabled', False)

        return True
Esempio n. 5
0
    def public_network_id(self):
        c = conditions.BaseRule(field='keystone.client.enabled', op='eq',
                                val=True)
        nodes = self.get_nodes_where_condition_match(c)
        network_name = self.runtest_opts.get(
            'convert_to_uuid', {}).get('public_network_id')

        if not network_name:
          return

        res = self.authenticated_openstack_module_call(
            nodes[0], 'neutronng.list_netowkrs')[nodes[0]]['networks']
        networks = [n['id'] for n in res if n['name'] == network_name]

        if len(networks) != 1:
            raise Exception("Error getting networks: {}".format(networks))

        return networks[0]
 def live_migration(self):
     return conditions.BaseRule('*.nova.compute.enabled',
                                'eq',
                                True,
                                multiple='multiple').check(self.pillar)
Esempio n. 7
0
 def admin_username(self):
     c = conditions.BaseRule('keystone.server.enabled', 'eq', True)
     return self.get_item_when_condition_match('keystone.server.admin_name',
                                               c)
Esempio n. 8
0
 def region(self):
     c = conditions.BaseRule('keystone.server.enabled', 'eq', True)
     return self.get_item_when_condition_match(
         'keystone.server.region', c)
Esempio n. 9
0
 def ca_certificates_file(self):
     c = conditions.BaseRule('keystone.server.enabled', 'eq', True)
     return self.get_item_when_condition_match(
         'keystone.server.cacert', c)