X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=juju%2Fcontroller.py;h=9b452c7c88b0fa3c086d3263217da3973dc08674;hb=fbd25b458d70f0ca0743be60ff3d6ab21335707f;hp=e279a74461a2b25adf0ba14e10aa29115c315e78;hpb=1a3cee44420e79fda92943edf636eaddb393145e;p=osm%2FN2VC.git diff --git a/juju/controller.py b/juju/controller.py index e279a74..9b452c7 100644 --- a/juju/controller.py +++ b/juju/controller.py @@ -11,7 +11,8 @@ log = logging.getLogger(__name__) class Controller(object): - def __init__(self, loop=None): + def __init__(self, loop=None, + max_frame_size=connection.Connection.DEFAULT_FRAME_SIZE): """Instantiate a new Controller. One of the connect_* methods will need to be called before this @@ -21,6 +22,7 @@ class Controller(object): """ self.loop = loop or asyncio.get_event_loop() + self.max_frame_size = None self.connection = None self.controller_name = None @@ -30,21 +32,24 @@ class Controller(object): """ self.connection = await connection.Connection.connect( - endpoint, None, username, password, cacert, macaroons) + endpoint, None, username, password, cacert, macaroons, + max_frame_size=self.max_frame_size) async def connect_current(self): """Connect to the current Juju controller. """ self.connection = ( - await connection.Connection.connect_current_controller()) + await connection.Connection.connect_current_controller( + max_frame_size=self.max_frame_size)) async def connect_controller(self, controller_name): """Connect to a Juju controller by name. """ self.connection = ( - await connection.Connection.connect_controller(controller_name)) + await connection.Connection.connect_controller( + controller_name, max_frame_size=self.max_frame_size)) self.controller_name = controller_name async def disconnect(self): @@ -238,7 +243,6 @@ class Controller(object): self.connection) return await controller_facade.AllModels() - def get_payloads(self, *patterns): """Return list of known payloads. @@ -297,7 +301,8 @@ class Controller(object): client_facade = client.UserManagerFacade.from_connection( self.connection) user = tag.user(username) - return await client_facade.UserInfo([client.Entity(user)], include_disabled) + return await client_facade.UserInfo([client.Entity(user)], + include_disabled) async def grant(self, username, acl='login'): """Set access level of the given user on the controller