diff --git a/juju/client/connection.py b/juju/client/connection.py index a295bd6e..5a1f12c3 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -433,7 +433,6 @@ def _exit_tasks(): max_size=self.max_frame_size, server_hostname=server_hostname, sock=sock, - close_timeout=1, )), url, endpoint, cacert async def close(self, to_reconnect=False): @@ -645,7 +644,7 @@ async def rpc(self, msg, encoder=None): if "version" not in msg: msg['version'] = self.facades[msg['type']] outgoing = json.dumps(msg, indent=2, cls=encoder) - log.debug('connection id: {} -- sending {}'.format(id(self), outgoing)) + log.debug('connection id: {} ---> {}'.format(id(self), outgoing)) for attempt in range(3): if self.monitor.status == Monitor.DISCONNECTED: # closed cleanly; shouldn't try to reconnect @@ -668,7 +667,7 @@ async def rpc(self, msg, encoder=None): log.error('RPC: Automatic reconnect failed') raise result = await self._recv(msg['request-id']) - log.debug('connection id : {} -- receiving {}'.format(id(self), result)) + log.debug('connection id : {} <--- {}'.format(id(self), result)) if not result: return result diff --git a/juju/model.py b/juju/model.py index e6183a06..dcc86b6f 100644 --- a/juju/model.py +++ b/juju/model.py @@ -771,7 +771,7 @@ async def watch_received_waiter(): raise JujuError("AllWatcher task is finished abruptly without an exception.") raise self._watcher_task.exception() - if self.info is None: + if self._info is None: # TODO (cderici): See if this can be optimized away, or at least # be done lazily (i.e. not everytime after_connect, but whenever # self.info is needed -- which here can be bypassed if model_uuid @@ -799,7 +799,7 @@ async def disconnect(self): self._watch_stopping.clear() if self.is_connected(): - await self._connector.disconnect(entity='Model') + await self._connector.disconnect(entity='model') self._info = None async def add_local_charm_dir(self, charm_dir, series):