code
stringlengths
3
6.57k
_check_dns_nameservers(self, dns_nameservers)
dns_nameservers.split('\n')
ns.strip()
self._convert_ip_address(ns, "dns_nameservers")
_check_host_routes(self, host_routes)
host_routes.split('\n')
r.strip()
r.split(',')
len(route)
forms.ValidationError(msg)
self._convert_ip_network(route[0], "host_routes")
self._convert_ip_address(route[1], "host_routes")
clean(self)
super(CreateSubnetDetailAction, self)
clean()
self._check_allocation_pools(cleaned_data.get('allocation_pools')
self._check_host_routes(cleaned_data.get('host_routes')
self._check_dns_nameservers(cleaned_data.get('dns_nameservers')
CreateSubnetDetail(workflows.Step)
CreateNetwork(workflows.Workflow)
_("Create Network")
_("Create")
_('Created network "%s".')
_('Unable to create network "%s".')
get_success_url(self)
reverse("horizon:project:networks:index")
get_failure_url(self)
reverse("horizon:project:networks:index")
format_status_message(self, message)
self.context.get('net_name')
self.context.get('net_id', '')
_create_network(self, request, data)
api.neutron.is_port_profiles_supported()
api.neutron.network_create(request, **params)
network.set_id_as_name_if_empty()
_('Network "%s" was successfully created.')
LOG.debug(msg)
_('Failed to create network "%(network)
LOG.info(msg)
self.get_failure_url()
exceptions.handle(request, msg, redirect=redirect)
_setup_subnet_parameters(self, params, data, is_create=True)
dict(zip(['start', 'end'], pool.strip()
split(',')
split('\n')
pool.strip()
route.strip()
split(',')
split('\n')
route.strip()
ns.strip()
split('\n')
ns.strip()
self.context.get('network_id')
self.context.get('network_name')
int(data['ip_version'])
self._setup_subnet_parameters(params, data)
api.neutron.subnet_create(request, **params)
_('Subnet "%s" was successfully created.')
LOG.debug(msg)
_('Failed to create subnet "%(sub)
self.get_failure_url()
_delete_network(self, request, network)
api.neutron.network_delete(request, network.id)
LOG.debug(msg)
self.get_failure_url()
messages.info(request, msg)
exceptions.Http302(redirect)
_('Failed to delete network "%s"')
LOG.info(msg)
self.get_failure_url()
exceptions.handle(request, msg, redirect=redirect)
handle(self, request, data)
self._create_network(request, data)
self._create_subnet(request, data, network, no_redirect=True)
self._delete_network(request, network)
print()
print()
Copyright (c)
ResourceLockTests(ScenarioTest)
test_list_locks(self)
self.cmd('az lock list')
get_output_in_json()
record_only()
test_subscription_locks(self)
self.create_random_name('cli-test-lock', 48)
self.cmd('az lock create -n {} --lock-type {}'.format(lock_name, lock_type)
get_output_in_json()
lock.get('id')
self._sleep_for_lock_operation()
self.cmd('az lock list')
get_output_in_json()
self.assertTrue(locks_list)
self.assertIn(lock_name, [l['name'] for l in locks_list])
self.cmd('az lock show -n {}'.format(lock_name)
get_output_in_json()
self.cmd('az lock show --ids {}'.format(lock_id)
get_output_in_json()
self.assertEqual(lock.get('name', None)
self.assertEqual(lock_from_id.get('name', None)