Skip to content

Commit

Permalink
Fix node.oci evaluating as "None" instead of either docker or podman
Browse files Browse the repository at this point in the history
If node.dbopensvc=None in the node.conf, chances are that this kw is
evaluated before node.oci during object actions.

In this case, the "None" value is stored in the dereference cache with
key="...None". Then when node.oci is evaluated the same key is formatted
and "None" is returned from the cache instead of the expected None
(NoneType).

This patch implements a shortcut for dereferencing None. In this case
alway return None, without looking at the cache.
  • Loading branch information
cvaroqui committed Apr 3, 2023
1 parent 71d392a commit d4a2c23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opensvc/core/extconfig.py
Expand Up @@ -873,6 +873,9 @@ def _handle_expressions(s):

def handle_references(self, s, scope=False, impersonate=None, cd=None,
section=None, stack=None):
if s is None:
# avoid cache key collision with "None" values (typically node.dbopensvc)
return
key = self.ref_cache_key(s, scope, impersonate)
if key and key in self.ref_cache:
return self.ref_cache[key]
Expand Down

0 comments on commit d4a2c23

Please sign in to comment.