From b4f1a0b2d32fc21ede9460540128a2129dc733ea Mon Sep 17 00:00:00 2001 From: Ellen Hui Date: Fri, 30 May 2014 23:55:34 +0000 Subject: Tries to advertise valid default IP During the first heartbeat, the heartbeater asks the agent to check its advertised address; if the advertised IP is still the default (None), the agent tries to replace it with the IP of the first network interface it finds. If it fails to find either a network interface or an IP address, the agent raises an exception. Change-Id: I6d435d39e99ed0ff5c8b4883b6aa0b356f6cb4ae Closes-Bug: #1309110 --- ironic_python_agent/errors.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ironic_python_agent/errors.py') diff --git a/ironic_python_agent/errors.py b/ironic_python_agent/errors.py index 61d17b3b..a02b80b2 100644 --- a/ironic_python_agent/errors.py +++ b/ironic_python_agent/errors.py @@ -115,6 +115,24 @@ class LookupNodeError(IronicAPIError): super(LookupNodeError, self).__init__(details) +class LookupAgentIPError(IronicAPIError): + """Error raised when automatic IP lookup fails.""" + + message = 'Error finding IP for Ironic Agent' + + def __init__(self, details): + super(IronicAPIError, self).__init__(details) + + +class LookupAgentInterfaceError(IronicAPIError): + """Error raised when agent interface lookup fails.""" + + message = 'Error finding network interface for Ironic Agent' + + def __init__(self, details): + super(IronicAPIError, self).__init__(details) + + class ImageDownloadError(RESTError): """Error raised when an image cannot be downloaded.""" -- cgit v1.2.1