Skip to content

Commit 1542839

Browse files
committed
Return channel from construct if desired
1 parent e7e85f2 commit 1542839

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cisco_gnmi/builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def set_channel_option(self, name, value):
267267
self.__channel_options.append(new_option)
268268
return self
269269

270-
def construct(self):
270+
def construct(self, return_channel=False):
271271
"""Constructs and returns the desired Client object.
272272
The instance of this class will reset to default values for further building.
273273
@@ -315,7 +315,10 @@ def construct(self):
315315
self.set_os()
316316
client = self.__client_class(channel)
317317
self._reset()
318-
return client
318+
if return_channel:
319+
return client, channel
320+
else:
321+
return client
319322

320323
def _reset(self):
321324
"""Resets the builder.

0 commit comments

Comments
 (0)