From 7f1639e77efb32be280f56983a22485f56e24718 Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 24 Mar 2017 14:03:56 +0000 Subject: [PATCH] Copy and append to static lists core_interfaces and standard_interfaces are both static members of BaseDriver we need to take a copy of them before appending to them. Change-Id: Ic6edc5e49a25849c7871dbc9e6e1d5a5eb229e57 Closes-Bug: #1672457 (cherry picked from commit 338651eae5b7c416f04970b9d60f09dc2dab8adb) --- ironic/drivers/base.py | 22 +++++++++---------- .../notes/bug-1672457-563d5354b41b060e.yaml | 3 +++ 2 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/bug-1672457-563d5354b41b060e.yaml diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index 90025ab486..6c7ca4dd88 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -131,7 +131,6 @@ class BaseDriver(object): """ standard_interfaces.append('raid') - @abc.abstractmethod def __init__(self): pass @@ -164,20 +163,19 @@ class BareDriver(BaseDriver): class, as well as appended to core_interfaces or standard_interfaces here. """ - def __init__(self): - self.network = None - """`Core` attribute for network connectivity. + network = None + """`Core` attribute for network connectivity. - A reference to an instance of :class:NetworkInterface. - """ - self.core_interfaces.append('network') + A reference to an instance of :class:NetworkInterface. + """ + core_interfaces = BaseDriver.core_interfaces + ['network'] - self.storage = None - """`Standard` attribute for (remote) storage interface. + storage = None + """`Standard` attribute for (remote) storage interface. - A reference to an instance of :class:StorageInterface. - """ - self.standard_interfaces.append('storage') + A reference to an instance of :class:StorageInterface. + """ + standard_interfaces = BaseDriver.standard_interfaces + ['storage'] ALL_INTERFACES = set(BareDriver().all_interfaces) diff --git a/releasenotes/notes/bug-1672457-563d5354b41b060e.yaml b/releasenotes/notes/bug-1672457-563d5354b41b060e.yaml new file mode 100644 index 0000000000..b686dfd169 --- /dev/null +++ b/releasenotes/notes/bug-1672457-563d5354b41b060e.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - Fixed a bug that was causing an increase in CPU usage over time.