Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Expanding controller.py with basic user functions, get_models and destroy #89
Conversation
mhmoerma
added some commits
Mar 16, 2017
|
Thanks for the contribution. All of the new Controller methods need to be |
mhmoerma
added some commits
Mar 17, 2017
|
Added integration tests for Add-user, disable user and enable user. All the controller methods now are async and facades are awaited for. |
mhmoerma
added some commits
Mar 20, 2017
|
I've added, the add-ssh, get-ssh and remove-ssh calls, as well as the grant calls on both controllers and models. The integration tests have been expanded accordingly. |
mhmoerma
added some commits
Mar 27, 2017
johnsca
requested changes
Apr 3, 2017
This looks really good, thanks! A few comments below, mainly about test coverage. The merge conflict should be easy to resolve; it's just the conflicting addition of additional new tests.
| @@ -207,15 +225,18 @@ def kill(self): | ||
| cloud = list(result.clouds.keys())[0] # only lives on one cloud | ||
| return tag.untag('cloud-', cloud) | ||
| - def get_models(self, all_=False, username=None): | ||
| + async def get_models(self, all_=False, username=None): |
| @@ -1178,14 +1191,13 @@ def import_ssh_key(self, identity): | ||
| raise NotImplementedError() | ||
| import_ssh_keys = import_ssh_key | ||
| - def get_machines(self, machine, utc=False): | ||
| + async def get_machines(self): |
| - raise NotImplementedError() | ||
| + model_facade = client.ModelManagerFacade() | ||
| + model_facade.connect(self.connection) | ||
| + return await list(self.state.machines.keys()) |
| @@ -120,6 +120,7 @@ | ||
| _deploy_in_loop(new_loop, model_name)) | ||
| await model._wait_for_new('application', 'ubuntu') | ||
| assert 'ubuntu' in model.applications | ||
| + await model.disconnect() |
johnsca
Apr 3, 2017
Member
Why was this added? The CleanModel context handler ought to disconnect this for us. Did you run across an issue with it not being disconnected?
| + | ||
| +# @base.bootstrapped | ||
| +# @pytest.mark.asyncio | ||
| +# async def test_grant(event_loop) |
mhmoerma
Apr 4, 2017
Contributor
Because currently there is no possibility to request the model access of a user using the api, so it cannot be tested. But I should be included in the test asap, when model access is callable.
mhmoerma
added some commits
Apr 4, 2017
|
The |
|
@mhmoerma It looks like you are somehow missing the |
|
I don't find this directory in the current master branch? |
|
@mhmoerma Sorry, I meant
That request should not happen because it should get caught by the |
mhmoerma
added some commits
Apr 5, 2017
|
Indeed, after a merge with the master branch, everything works as it should. I've added in all the requested changes. |
|
Strange, the build runs locally raw_log, but fails on the test_store_resources_charm in the libjuju CI |
|
@mhmoerma That failure is spurious. It's due to juju-solutions/layer-basic#92 and was fixed in rev 19 of the ghost charm. I'm going to merge this and update the pinned rev in the test. |
johnsca
merged commit d23810d
into
juju:master
Apr 6, 2017
1 check failed
|
Awesome, thanks! |
|
@mhmoerma Really appreciate your contribution, thank you! |
mhmoerma commentedMar 16, 2017
Added several functions in controller.py:
Issues:
Missing:
the login, logout and get_model have no matching functions in _client.py