summaryrefslogtreecommitdiff
path: root/ironic_python_agent/agent.py
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2020-07-20 14:24:06 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2020-07-20 14:24:06 -0700
commit2a56ee03b6ffb2d8c8f5ff553e90ecf6ee07f9af (patch)
treeb6f33829246cf19e6c2cd696f410a5927544ff7f /ironic_python_agent/agent.py
parentf9c03a8de29fd3b7c479a2b0c4343585b9f171e8 (diff)
downloadironic-python-agent-2a56ee03b6ffb2d8c8f5ff553e90ecf6ee07f9af.tar.gz
Prevent un-needed iscsi cleanup
When we added software raid support, we started calling bootloader installation. As time went on, we ehnanced that code path for non RAID cases in order to ensure that UEFI nvram was setup for the instance to boot properly. Somewhere in this process, we missed a possible failure case where the iscsi client tgtadm may return failures. Obviously, the correct path is to not call iscsi teardown if we don't need to. Since it was always semi-opportunistic teardown, we can't blindly catch any error, and if we started iSCSI and failed to tear the connection down, we might want to still fail, so this change moves the logic over to use a flag on the agent object which one extension to set the flag and the other to read it and take action based upon that. Change-Id: Id3b1ae5e59282f4109f6246d5614d44c93aefa7c Story: 2007937 Task: 40395
Diffstat (limited to 'ironic_python_agent/agent.py')
-rw-r--r--ironic_python_agent/agent.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/ironic_python_agent/agent.py b/ironic_python_agent/agent.py
index 207b9a45..c356f56e 100644
--- a/ironic_python_agent/agent.py
+++ b/ironic_python_agent/agent.py
@@ -213,6 +213,7 @@ class IronicPythonAgent(base.ExecuteCommandMixin):
# in the event of long running ramdisks where the conductor
# got upgraded somewhere along the way.
self.agent_token_required = cfg.CONF.agent_token_required
+ self.iscsi_started = False
def get_status(self):
"""Retrieve a serializable status.