Skip to content

Commit 7f67769

Browse files
committed
create connection on demand from session
1 parent 27b605f commit 7f67769

File tree

1 file changed

+4
-1
lines changed
  • python/neutron-understack/neutron_understack

1 file changed

+4
-1
lines changed

python/neutron-understack/neutron_understack/ironic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
class IronicClient:
1515
def __init__(self):
1616
LOG.debug("creating ironic client")
17-
self.irclient = self._get_ironic_client()
1817
LOG.debug("created ironic client")
1918

2019
def _get_session(self, group: str) -> ks_loading.session.Session:
@@ -27,6 +26,10 @@ def _get_ironic_client(self) -> BaremetalService:
2726
if not IRONIC_SESSION:
2827
IRONIC_SESSION = self._get_session("ironic")
2928

29+
LOG.debug("got session, making connection")
30+
31+
@property
32+
def irclient(self):
3033
return connection.Connection(
3134
session=IRONIC_SESSION,
3235
oslo_conf=cfg.CONF,

0 commit comments

Comments
 (0)