X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Fjuju%2Fclient%2Fconnection.py;h=13770a5343d841bbb8369034c03499eaf7d8bc5e;hp=bdd1c3f3e2a6a92287a546f3cd8075652f2e3b15;hb=refs%2Fchanges%2F94%2F6394%2F1;hpb=c3e6c2ec9a1fddfc8e9bd31509b366e633b6d99e diff --git a/modules/libjuju/juju/client/connection.py b/modules/libjuju/juju/client/connection.py index bdd1c3f..13770a5 100644 --- a/modules/libjuju/juju/client/connection.py +++ b/modules/libjuju/juju/client/connection.py @@ -109,20 +109,22 @@ class Connection: If uuid is None, the connection will be to the controller. Otherwise it will be to the model. - :param str endpoint The hostname:port of the controller to connect to. - :param str uuid The model UUID to connect to (None for a + + :param str endpoint: The hostname:port of the controller to connect to. + :param str uuid: The model UUID to connect to (None for a controller-only connection). - :param str username The username for controller-local users (or None + :param str username: The username for controller-local users (or None to use macaroon-based login.) - :param str password The password for controller-local users. - :param str cacert The CA certificate of the controller (PEM formatted). - :param httpbakery.Client bakery_client The macaroon bakery client to + :param str password: The password for controller-local users. + :param str cacert: The CA certificate of the controller + (PEM formatted). + :param httpbakery.Client bakery_client: The macaroon bakery client to to use when performing macaroon-based login. Macaroon tokens acquired when logging will be saved to bakery_client.cookies. If this is None, a default bakery_client will be used. - :param loop asyncio.BaseEventLoop The event loop to use for async + :param asyncio.BaseEventLoop loop: The event loop to use for async operations. - :param max_frame_size The maximum websocket frame size to allow. + :param int max_frame_size: The maximum websocket frame size to allow. """ self = cls() if endpoint is None: @@ -519,8 +521,8 @@ class Connection: async def login(self): params = {} + params['auth-tag'] = self.usertag if self.password: - params['auth-tag'] = self.usertag params['credentials'] = self.password else: macaroons = _macaroons_for_domain(self.bakery_client.cookies,