From 51d830cd4dcbeeef7a3dceb099f498f556de523a Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Fri, 11 Apr 2014 02:02:35 -0400 Subject: [PATCH] Deprecate first_address attribute of Server Currently we could use get_attr function to get necessary information about ip addresses. So attribute first_address could be deprecated. According to idea above mentioned attribute should have DEPRECATED status. Change-Id: I7aeac8d3a677bbb35d0140ca371def1d65ffd2cc Closes-Bug: #1302466 --- heat/engine/resources/server.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/heat/engine/resources/server.py b/heat/engine/resources/server.py index 41399a2f4a..b3a9d86bd2 100644 --- a/heat/engine/resources/server.py +++ b/heat/engine/resources/server.py @@ -17,6 +17,7 @@ from oslo.config import cfg import uuid from heat.common import exception +from heat.engine import attributes from heat.engine import clients from heat.engine import constraints from heat.engine import properties @@ -303,12 +304,18 @@ class Server(stack_user.StackUser): 'port_id.'), 'networks': _('A dict of assigned network addresses of the form: ' '{"public": [ip1, ip2...], "private": [ip3, ip4]}.'), - 'first_address': _('Convenience attribute to fetch the first ' - 'assigned network address, or an ' - 'empty string if nothing has been assigned ' - 'at this time. Result may not be predictable ' - 'if the server has addresses from more than one ' - 'network.'), + 'first_address': attributes.Schema( + _('Convenience attribute to fetch the first assigned network ' + 'address, or an empty string if nothing has been assigned at ' + 'this time. Result may not be predictable if the server has ' + 'addresses from more than one network.'), + support_status=support.SupportStatus( + status=support.DEPRECATED, + message=_('Use the networks attribute instead of ' + 'first_address. For example: "{get_attr: ' + '[, networks, , 0]}"') + ) + ), 'instance_name': _('AWS compatible instance name.'), 'accessIPv4': _('The manually assigned alternative public IPv4 ' 'address of the server.'),