summaryrefslogtreecommitdiff
path: root/ironic/conductor
diff options
context:
space:
mode:
authorJulia Kreger <juliaashleykreger@gmail.com>2020-09-02 09:37:16 -0700
committerJulia Kreger <juliaashleykreger@gmail.com>2020-09-29 10:02:10 -0700
commit68cea19d99e6f6016b17df87c186144ccda3de76 (patch)
tree5e577eee834d92e4783c9e55c22f914b9e8c8028 /ironic/conductor
parent87f3a84c8f55b270ec19e4a04de135d6ae7f2cfb (diff)
downloadironic-68cea19d99e6f6016b17df87c186144ccda3de76.tar.gz
Minor agent version code cleanup
Internal to the conductor, we have long determiend that if no agent version is submitted by the client, that the client is a version 3.0.0 agent. With agent token, we're effectively requiring 6.1.0 or later to be leveraged, so all agents should be sending versions. An agent not sending versions is thus unsupported and would no longer work without agent token support. Redudnant code has thus been removed. Additionally the conductor utility is_agent_token_supported has been removed since it is now redundant. Change-Id: Id6c8d1df08c3ac7af61ed7d05d274f3099003582
Diffstat (limited to 'ironic/conductor')
-rw-r--r--ironic/conductor/manager.py7
-rw-r--r--ironic/conductor/utils.py12
2 files changed, 6 insertions, 13 deletions
diff --git a/ironic/conductor/manager.py b/ironic/conductor/manager.py
index 7860a125c..4d5b0f608 100644
--- a/ironic/conductor/manager.py
+++ b/ironic/conductor/manager.py
@@ -3120,7 +3120,12 @@ class ConductorManager(base_manager.BaseConductorManager):
LOG.debug('RPC heartbeat called for node %s', node_id)
if agent_version is None:
- agent_version = '3.0.0'
+ LOG.error('Node %s transmitted no version information which '
+ 'indicates the agent is incompatible with the ironic '
+ 'services and must be upgraded.', node_id)
+ raise exception.InvalidParameterValue(
+ _('Agent did not transmit a version, and a version is '
+ 'required. Please update the agent being used.'))
# NOTE(dtantsur): we acquire a shared lock to begin with, drivers are
# free to promote it to an exclusive one.
diff --git a/ironic/conductor/utils.py b/ironic/conductor/utils.py
index ae481283c..473c3d478 100644
--- a/ironic/conductor/utils.py
+++ b/ironic/conductor/utils.py
@@ -15,7 +15,6 @@
import contextlib
import crypt
import datetime
-from distutils.version import StrictVersion
import functools
import os
import secrets
@@ -1173,17 +1172,6 @@ def is_agent_token_valid(node, token):
return known_token == token
-def is_agent_token_supported(agent_version):
- # NOTE(TheJulia): This is hoped that 6.x supports
- # agent token capabilities and realistically needs to be updated
- # once that version of IPA is out there in some shape or form.
- # This allows us to gracefully allow older agent's that were
- # launched via pre-generated agent_tokens, to still work
- # and could likely be removed at some point down the road.
- version = str(agent_version).replace('.dev', 'b', 1)
- return StrictVersion(version) > StrictVersion('6.1.0')
-
-
def is_agent_token_pregenerated(node):
"""Determines if the token was generated for out of band configuration.