'Ensure we self heal an orphaned sql registration.'

def test_orphaned_registration_does_not_prevent_getting_sql_driver(self):

    domain = unit.new_domain_ref()
    domain = self.resource_api.create_domain(domain['id'], domain)
    new_config = {'identity': {'driver': 'sql'}}
    self.domain_config_api.create_config(domain['id'], new_config)
    self.identity_api.domain_configs.get_domain_conf(domain['id'])
    self.domain_config_api.create_config(self.domains['domain1']['id'], new_config)
    self.assertRaises(exception.MultipleSQLDriversInConfig, self.identity_api.domain_configs.get_domain_conf, self.domains['domain1']['id'])
    self.resource_api.driver.delete_project(domain['id'])
    self.resource_api.get_domain.invalidate(self.resource_api, domain['id'])
    self.domain_config_api.create_config(self.domains['domain1']['id'], new_config)
    self.identity_api.domain_configs.get_domain_conf(self.domains['domain1']['id'])
