Skip to content

Commit

Permalink
Return channel from construct if desired
Browse files Browse the repository at this point in the history
  • Loading branch information
remingtonc committed May 27, 2020
1 parent e7e85f2 commit 1542839
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cisco_gnmi/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def set_channel_option(self, name, value):
self.__channel_options.append(new_option)
return self

def construct(self):
def construct(self, return_channel=False):
"""Constructs and returns the desired Client object.
The instance of this class will reset to default values for further building.
Expand Down Expand Up @@ -315,7 +315,10 @@ def construct(self):
self.set_os()
client = self.__client_class(channel)
self._reset()
return client
if return_channel:
return client, channel
else:
return client

def _reset(self):
"""Resets the builder.
Expand Down

0 comments on commit 1542839

Please sign in to comment.