project_id should remain in the response for v2 objects

Also, finally completely remove tenant_id!

Change-Id: I435ace4d2bffdf323238b57499eba39e03de90f3
This commit is contained in:
Adam Harwell 2017-05-01 15:45:01 +09:00
parent cb4261444d
commit 7f6c1b5016
9 changed files with 6 additions and 28 deletions

View File

@ -41,10 +41,7 @@ class HealthMonitorResponse(BaseHealthMonitorType):
url_path = wtypes.wsattr(wtypes.text)
expected_codes = wtypes.wsattr(wtypes.text)
admin_state_up = wtypes.wsattr(bool)
# TODO(johnsom) Remove after deprecation (R series)
project_id = wtypes.wsattr(wtypes.StringType())
# TODO(johnsom) Remove after deprecation (R series)
tenant_id = wtypes.wsattr(wtypes.StringType())
pools = wtypes.wsattr([MinimalPool])
provisioning_status = wtypes.wsattr(wtypes.StringType())
operating_status = wtypes.wsattr(wtypes.StringType())
@ -55,7 +52,6 @@ class HealthMonitorResponse(BaseHealthMonitorType):
def from_data_model(cls, data_model, children=False):
healthmonitor = super(HealthMonitorResponse, cls).from_data_model(
data_model, children=children)
healthmonitor.tenant_id = data_model.project_id
healthmonitor.pools = [
MinimalPool.from_data_model(data_model.pool)
]

View File

@ -34,10 +34,7 @@ class L7PolicyResponse(BaseL7PolicyType):
provisioning_status = wtypes.wsattr(wtypes.StringType())
operating_status = wtypes.wsattr(wtypes.StringType())
admin_state_up = wtypes.wsattr(bool)
# TODO(johnsom) Remove after deprecation (R series)
project_id = wtypes.wsattr(wtypes.StringType())
# TODO(johnsom) Remove after deprecation (R series)
tenant_id = wtypes.wsattr(wtypes.StringType())
action = wtypes.wsattr(wtypes.StringType())
listener_id = wtypes.wsattr(wtypes.UuidType())
redirect_pool_id = wtypes.wsattr(wtypes.UuidType())
@ -51,7 +48,6 @@ class L7PolicyResponse(BaseL7PolicyType):
def from_data_model(cls, data_model, children=False):
policy = super(L7PolicyResponse, cls).from_data_model(
data_model, children=children)
policy.tenant_id = data_model.project_id
if not policy.name:
policy.name = ""
if not policy.description:

View File

@ -34,18 +34,13 @@ class L7RuleResponse(BaseL7Type):
operating_status = wtypes.wsattr(wtypes.StringType())
created_at = wtypes.wsattr(wtypes.datetime.datetime)
updated_at = wtypes.wsattr(wtypes.datetime.datetime)
# TODO(johnsom) Remove after deprecation (R series)
project_id = wtypes.wsattr(wtypes.StringType())
# TODO(johnsom) Remove after deprecation (R series)
tenant_id = wtypes.wsattr(wtypes.StringType())
admin_state_up = wtypes.wsattr(bool)
@classmethod
def from_data_model(cls, data_model, children=False):
rule = super(L7RuleResponse, cls).from_data_model(
data_model, children=children)
rule.tenant_id = data_model.project_id
return rule

View File

@ -46,10 +46,7 @@ class ListenerResponse(BaseListenerType):
connection_limit = wtypes.wsattr(wtypes.IntegerType())
default_tls_container_ref = wtypes.wsattr(wtypes.StringType())
sni_container_refs = [wtypes.StringType()]
# TODO(johnsom) Remove after deprecation (R series)
project_id = wtypes.wsattr(wtypes.StringType())
# TODO(johnsom) Remove after deprecation (R series)
tenant_id = wtypes.wsattr(wtypes.StringType())
default_pool_id = wtypes.wsattr(wtypes.UuidType())
l7policies = wtypes.wsattr([MinimalL7Policy])
insert_headers = wtypes.wsattr(wtypes.DictType(str, str))
@ -61,7 +58,6 @@ class ListenerResponse(BaseListenerType):
def from_data_model(cls, data_model, children=False):
listener = super(ListenerResponse, cls).from_data_model(
data_model, children=children)
listener.tenant_id = data_model.project_id
listener.sni_container_refs = [
sni_c.tls_container_id for sni_c in data_model.sni_containers]

View File

@ -39,7 +39,6 @@ class LoadBalancerResponse(BaseLoadBalancerType):
operating_status = wtypes.wsattr(wtypes.StringType())
admin_state_up = wtypes.wsattr(bool)
project_id = wtypes.wsattr(wtypes.StringType())
tenant_id = wtypes.wsattr(wtypes.StringType())
created_at = wtypes.wsattr(wtypes.datetime.datetime)
updated_at = wtypes.wsattr(wtypes.datetime.datetime)
vip_address = wtypes.wsattr(types.IPAddressType())
@ -60,7 +59,6 @@ class LoadBalancerResponse(BaseLoadBalancerType):
result.vip_network_id = data_model.vip.network_id
result.listeners = [
MinimalListener.from_data_model(i) for i in data_model.listeners]
result.tenant_id = data_model.project_id
if not result.description:
result.description = ""
if not result.name:

View File

@ -34,10 +34,7 @@ class MemberResponse(BaseMemberType):
protocol_port = wtypes.wsattr(wtypes.IntegerType())
weight = wtypes.wsattr(wtypes.IntegerType())
subnet_id = wtypes.wsattr(wtypes.UuidType())
# TODO(johnsom) Remove after deprecation (R series)
project_id = wtypes.wsattr(wtypes.StringType())
# TODO(johnsom) Remove after deprecation (R series)
tenant_id = wtypes.wsattr(wtypes.StringType())
created_at = wtypes.wsattr(wtypes.datetime.datetime)
updated_at = wtypes.wsattr(wtypes.datetime.datetime)
@ -45,7 +42,6 @@ class MemberResponse(BaseMemberType):
def from_data_model(cls, data_model, children=False):
member = super(MemberResponse, cls).from_data_model(
data_model, children=children)
member.tenant_id = data_model.project_id
if not member.name:
member.name = ""

View File

@ -70,10 +70,7 @@ class PoolResponse(BasePoolType):
protocol = wtypes.wsattr(wtypes.text)
lb_algorithm = wtypes.wsattr(wtypes.text)
session_persistence = wtypes.wsattr(SessionPersistenceResponse)
# TODO(johnsom) Remove after deprecation (R series)
project_id = wtypes.wsattr(wtypes.StringType())
# TODO(johnsom) Remove after deprecation (R series)
tenant_id = wtypes.wsattr(wtypes.StringType())
loadbalancers = wtypes.wsattr([MinimalLoadBalancer])
listeners = wtypes.wsattr([MinimalListener])
created_at = wtypes.wsattr(wtypes.datetime.datetime)
@ -85,7 +82,6 @@ class PoolResponse(BasePoolType):
def from_data_model(cls, data_model, children=False):
pool = super(PoolResponse, cls).from_data_model(
data_model, children=children)
pool.tenant_id = pool.project_id
if data_model.session_persistence:
pool.session_persistence = (
SessionPersistenceResponse.from_data_model(

View File

@ -306,7 +306,7 @@ class TestPool(base.BaseAPITest):
constants.PROTOCOL_HTTP,
constants.LB_ALGORITHM_ROUND_ROBIN,
**optionals).get(self.root_tag)
self.assertEqual(self.project_id, api_pool.get('tenant_id'))
self.assertEqual(self.project_id, api_pool.get('project_id'))
def test_bad_create(self):
pool = {'name': 'test1'}

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
Finally completely remove tenant_id, as it was deprecated along with the
keystone v2 API in Mitaka, which means we're free of it in Pike!