Merge juju-bmc:libjuju-increase-frame-size into juju-bmc:master

Proposed by Jose Guedez
Status: Merged
Approved by: Jose Guedez
Approved revision: c072ceb7173671ab1526abab276424cd33e3cb9c
Merged at revision: 3165081c49d869ced1245cd650a51ed0b02e8a6e
Proposed branch: juju-bmc:libjuju-increase-frame-size
Merge into: juju-bmc:master
Diff against target: 36 lines (+6/-3)
2 files modified
juju-bmc/juju-bmc (+5/-2)
setup.py (+1/-1)
Reviewer Review Type Date Requested Status
Joe Guo (community) Approve
Review via email: mp+385340@code.launchpad.net

Commit message

increase libjuju max_frame_size to deal with large production models

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Joe Guo (guoqiao) wrote :

LGTM, +1.

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 3165081c49d869ced1245cd650a51ed0b02e8a6e

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/juju-bmc/juju-bmc b/juju-bmc/juju-bmc
2index 70a1953..1659bb4 100755
3--- a/juju-bmc/juju-bmc
4+++ b/juju-bmc/juju-bmc
5@@ -75,13 +75,16 @@ def parse_args():
6 return parser.parse_args()
7
8
9-async def get_machine_instance_id(machine_id):
10+async def get_machine_instance_id(machine_id, max_frame_size=2 ** 25):
11 """
12 Connects to the juju controller using default credentials in $HOME
13 to obtain the instance id of the provided machine_id
14 """
15 # connect to the current juju controller/model
16- model = Model()
17+ # for some production clouds the messages can be larger than the
18+ # default of 4MB, so we increase the frame size with a larger value
19+ # for details see https://github.com/juju/python-libjuju/issues/136
20+ model = Model(max_frame_size=max_frame_size)
21 await model.connect()
22
23 machine = model.machines.get(machine_id)
24diff --git a/setup.py b/setup.py
25index 3dd7f92..a874b6d 100644
26--- a/setup.py
27+++ b/setup.py
28@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
29
30 setup(
31 name='juju-bmc',
32- version='0.11',
33+ version='0.2.0',
34 url='https://launchpad.net/juju-bmc',
35 author='Canonical Bootstack',
36 author_email="bootstack@canonical.com",

Subscribers

People subscribed via source and target branches

to all changes: