Cory Johns [Fri, 29 Sep 2017 16:53:20 +0000 (12:53 -0400)]
Update VERSION and changelog for release
Cory Johns [Fri, 29 Sep 2017 16:48:19 +0000 (12:48 -0400)]
Fix test failures (#163)
* Update tox.ini to enable testing with other Py envs
* Remove invalid failing test
Fixes #162
* Fix error type when connecting
* Fix KeyError on model name during integration tests
* Fix model name collision
* Gracefully downgrade when controller supports newer facades than we do
Fixes #145
Sébastien Pattyn [Thu, 28 Sep 2017 19:52:31 +0000 (15:52 -0400)]
removing cli command to add ssh keys (#161)
* removing cli command to add ssh keys
* add ssh-key after model-creation
* awaiting method
* Update controller.py
* adding user ssh-key when model is created
* fixed wrong config placement
George Kraft [Thu, 28 Sep 2017 18:29:36 +0000 (13:29 -0500)]
Make Application.upgrade_charm upgrade resources (#158)
* Add Resource to client overrides due to missing 'origin' field
* Make Application.upgrade_charm upgrade resources
* Add test_upgrade_charm_resource
* upgrade_charm: Only call the charm store once
Adam Stokes [Wed, 12 Jul 2017 21:34:09 +0000 (17:34 -0400)]
Expand integration tests to use stable/edge versions of juju (#155)
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
Cory Johns [Thu, 29 Jun 2017 19:43:26 +0000 (15:43 -0400)]
Docs are build automatically by RTD, so remove from `make release`
Cory Johns [Thu, 29 Jun 2017 19:29:19 +0000 (15:29 -0400)]
Update README to point to RTD for docs instead of PythonHosted.org
Cory Johns [Thu, 29 Jun 2017 19:17:53 +0000 (15:17 -0400)]
Update docs requirement to fix RTD build
Cory Johns [Thu, 29 Jun 2017 19:17:02 +0000 (15:17 -0400)]
Update docs requirement to fix RTD build
Cory Johns [Thu, 29 Jun 2017 18:51:50 +0000 (14:51 -0400)]
Bump VERSION and changelog for release
Cynerva [Thu, 29 Jun 2017 18:48:40 +0000 (13:48 -0500)]
Implement scp functionality (#149)
* Redefine SCP interface
* Implement Machine.scp_to and Machine.scp_from
* Implement Unit.scp_to and Unit.scp_from
* Fix Unit.machine to better handle missing machines
* Use os.path.expanduser for scp key path
* Use local-cloud address if public address is not found
* Rename Machine.public_address to Machine.dns_name to match CLI
* fix scp tests not waiting long enough
Cynerva [Wed, 28 Jun 2017 20:58:54 +0000 (15:58 -0500)]
Add Unit.public_address property
Adam Stokes [Tue, 27 Jun 2017 20:08:41 +0000 (16:08 -0400)]
Adds support for getting/setting config on a model (#152)
* Adds support for getting/setting config on a model
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
* Fix docstring parameter
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
* Support ConfigValue type for interacting with model config
Cory Johns [Thu, 22 Jun 2017 20:20:50 +0000 (16:20 -0400)]
Bump version and update changelog for release
Cory Johns [Thu, 22 Jun 2017 20:19:19 +0000 (16:19 -0400)]
Improve handling of closed connections (#148)
* Prevent circular reference between Monitor and Connection
* Improve monitor status logic
* Stop watcher task cleanly on disconnect
Instead of the watcher task blowing up with an exception when the
connection is closed, it should exit cleanly and allow the Monitor to
report the connection error.
Fixes #147
* Raise ConnectionClosed exception in Model.block_until
Rather than blocking indefinitely when waiting on a model change that
will never happen if the connection gets closed out from under it, this
makes `Model.block_until` raise a `websockets.ConnectionClosed` error so
that it can be caught and dealt with by the client.
* Automatically reconnect lost websocket connections
The receiver or all_watcher should immediately reconnect a lost
connection, or it will be reconnected automatically upon issuance of the
next RPC call. However, there is still a small chance that the
disconnect could happen between sending a API call and receiving the
response, in which case a websockets.ConnectionClosed error will still
be raised to the caller. These should be quite rare, though.
* Gracefully handle add_signal_handler failing in a thread in loop.run
* Restart AllWatcher if controller stops it
Fixes conjure-up/conjure-up#965
* Explicitly let the controller know we're stopping the watcher
* Skip reconnect if close was requested
Cory Johns [Thu, 15 Jun 2017 15:55:24 +0000 (11:55 -0400)]
Configurable and larger max message size (#146)
The default max message / frame size for the websocket library is 1MB.
However, the initial AllWatcher response for large models can exceed
that. Increased the default to 4MB and made it configurable.
Fixes #136
Cory Johns [Wed, 14 Jun 2017 18:01:46 +0000 (14:01 -0400)]
Bump rev for release
Cory Johns [Wed, 14 Jun 2017 17:58:20 +0000 (13:58 -0400)]
Fix deploying non-stable channels and explicit revs (#144)
* Fix deploying non-stable channels and explicit revs
Fixes #143
* Bump timeout on status test
* Minor docstring fix
Cory Johns [Tue, 13 Jun 2017 19:23:35 +0000 (15:23 -0400)]
Bump VERSION and changelog for release
Adam Stokes [Tue, 13 Jun 2017 18:53:56 +0000 (14:53 -0400)]
Patch/update schema juju 2.3 alpha1 (#142)
* Adds latest 2.3 alpha1 schema
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
* Update doc to be consistent with existing schema filenames
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
* Update python code from `make client`
This verifies that integration tests pass locally on Juju 2.3-alpha1
Signed-off-by: Adam Stokes <battlemidget@users.noreply.github.com>
Cory Johns [Tue, 13 Jun 2017 17:51:43 +0000 (13:51 -0400)]
Improve API doc navigation and coverage (#141)
* Remove unused requirements.txt
* Clean up generated doc files
* Improve API doc coverage and navigation
Fixes #139
Cory Johns [Fri, 9 Jun 2017 16:55:13 +0000 (12:55 -0400)]
Add type info to Model.add_machine docs (#138)
Resolves #137
Cory Johns [Thu, 8 Jun 2017 15:18:38 +0000 (11:18 -0400)]
Bump VERSION and changelog for release
Cory Johns [Thu, 8 Jun 2017 15:17:09 +0000 (11:17 -0400)]
Changes from docs build
Cory Johns [Wed, 7 Jun 2017 14:11:50 +0000 (10:11 -0400)]
Fix formatting in docs
Cory Johns [Mon, 5 Jun 2017 14:28:16 +0000 (10:28 -0400)]
Add machine status properties (#133)
* Add machine status properties
Add properties to access the machine provisioning and Juju machine agent
status information.
Unfortunately, there seems to be a bug with the AllWatcher related to
these fields (https://bugs.launchpad.net/juju/+bug/1695335) that causes
the deltas to contain stale data, so this also includes a hack to work
around that by fetching newer data from the FullStatus API.
* Fixed test for AWS
simonklb [Fri, 2 Jun 2017 16:28:35 +0000 (18:28 +0200)]
Add model context manager (#128)
Cynerva [Fri, 2 Jun 2017 14:53:28 +0000 (09:53 -0500)]
Implement Application.upgrade_charm method (#132)
* Implement Application.upgrade_charm method
* Use model.block_until instead of a direct loop on asyncio.sleep
* Raise JujuError if upgrade_charm is a noop
Same behavior as Juju CLI here.
* Add integration tests for upgrade_charm
* Fix upgrade_charm hangs forever if switch arg does not start with 'cs:'
Cory Johns [Thu, 1 Jun 2017 18:32:14 +0000 (14:32 -0400)]
Bump version and changelog for release
Cory Johns [Thu, 1 Jun 2017 18:14:54 +0000 (14:14 -0400)]
Accept new / unknown API fields gracefully (#131)
* Accept new / unknown API fields gracefully
From discussions in Montreal, it seems that new fields in the Juju
schema definitions are expected to be handled gracefully even without a
bump to the facade version. That is, facade versions will only be bumped
if a field is removed or changed.
Fixes #130
* Update schema and generated code for juju-2.2-rc1
The agent-version field that was added to ModelInfo is of a type that
requires some special parsing and serialization logic. This type was
used before but not in an API that we were apparently exercising.
Tim Van Steenburgh [Mon, 15 May 2017 15:26:17 +0000 (11:26 -0400)]
s/pip/pip3/ in install instructions (#129)
simonklb [Thu, 11 May 2017 16:02:03 +0000 (18:02 +0200)]
Strip local:-prefix from local charm urls (#121)
Cory Johns [Wed, 10 May 2017 22:14:31 +0000 (18:14 -0400)]
Bump version and changelog for release
Cory Johns [Wed, 10 May 2017 22:12:58 +0000 (18:12 -0400)]
Support (and prefer) per-controller macaroon files (#125)
Juju 2.2-beta4 moved to per-controller macaroon files, which breaks auth.
Fixes #124
Tim Van Steenburgh [Fri, 28 Apr 2017 00:31:11 +0000 (20:31 -0400)]
Add missing version var (used in release target)
Cory Johns [Thu, 27 Apr 2017 21:58:20 +0000 (17:58 -0400)]
Update version and changelog for 0.4.1 release (#119)
Also add tagging logic to release target in Makefile
Cory Johns [Thu, 27 Apr 2017 20:45:28 +0000 (16:45 -0400)]
Remove VERSION_MAP and rely on facade list from controller (#118)
Based on feedback from core, the facades list is complete and accurate,
but does depend on the connection type. So, we don't need to maintain
our own mapping of it.
Tested with Juju 2.1.2 and Juju 2.2-beta3
Cory Johns [Thu, 27 Apr 2017 20:27:32 +0000 (16:27 -0400)]
Refactor connection task management to avoid cancels (#117)
Connections in libjuju require a few tasks to help manage the data
flowing through it. The model AllWatcher task, the connection packet
receiver, and the connection keep-alive pinger. Due to how these
connections were being managed, they had to be tracked and cancelled
externally, leading to exceptions being masked and the need to shield
AllWatcher notifier callbacks, making them entirely uncancellable. This
refactor cleans that up by using events to track when the connection is
being shutdown and cleanly stopping the tasks internally.
Cory Johns [Wed, 26 Apr 2017 22:23:13 +0000 (18:23 -0400)]
Refactored login code to better handle redirects (#116)
Fixes #114: build_facades not handling discharge-required results
Fixes #115: JAAS update broke controller connections
Also ensures that the receiver and pinger tasks get cleaned up properly
when a connection is closed.
Also makes the model AllWatcher share the model connection to reduce the
number of open connections required. The independent connection is no
longer needed since the websocket responses are properly paired with the
requests.
Cory Johns [Thu, 20 Apr 2017 15:33:06 +0000 (11:33 -0400)]
Update changelog for 0.4.0
Cory Johns [Wed, 19 Apr 2017 21:24:16 +0000 (17:24 -0400)]
Bump version for release
Pete Vander Giessen [Wed, 19 Apr 2017 21:21:38 +0000 (17:21 -0400)]
Feature/api version support (#109)
Set of changes that adds basic Facade Version support.
Instead of building a monolithic _client.py, we build a _client<version>.py for each integer Facade version, and put Facades there.
One issue is that we store the auxillary classes in a single, monolithic _definitions.py. We should probably refactor to split those up by Facade version. For now, they all seem to be backwards compatible, and all tests pass.
(I've tested against 2.0.2, 2.1.2, 2.2-alpha1 and 2.2-beta2.)
Also ninja'd in a call to the Pinger class, which should prevent timeouts in JaaS.
Cory Johns [Fri, 14 Apr 2017 16:09:57 +0000 (12:09 -0400)]
Fix exception messages and lint error
Cory Johns [Thu, 6 Apr 2017 17:59:52 +0000 (13:59 -0400)]
Bump rev of ghost charm in test to fix intermittent hook failure due to apt lock
Mathijs Moerman [Thu, 6 Apr 2017 17:58:12 +0000 (19:58 +0200)]
Expanding controller.py with basic user functions, get_models and destroy (#89)
* Added user functions to controller.py, as well as the get_models call
* Fixes in controller.py
* Added controller.py integration tests
* Small fix in integration test
* Removed typo
* Disabled=False in controller.get_user does not work
* Added grant calls for model and controller, add-ssh, remove-ssh, get-ssh and get-machines
* Added last calls
* Added model.revoke('username')
* Edited docstring
* Added integrationtest for controller.py
* Fixed indentation error
* Added async
* Fixed type
* Fixed typo
* Expanded model integration tests
* Fixed typo
* ssh-key
* Typo
* Fix in remove_ssh_key
* Disconnecting models
* Added missing awaits
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Fixes
* Removed await in model grant
* Corrected remarks
* Typo
* Fixed tab error
* Typo
* Removed typo's
* Removed list from await expression
* Removed not needed await
* Added missing import
* Test
* Added decorators
* Merged #102
* Typo
* Updated _client.py
* Merged another
Pete Vander Giessen [Wed, 5 Apr 2017 21:46:24 +0000 (17:46 -0400)]
Added Monitor class to Connection. (#105)
Added Monitor class to Connection.
Calling Monitor.status allows a client to determine whether the
connection is "connected", "disconnected" or in an "error" state, and
take appropriate action as a result.
This is meant to address the issue of watchers failing silently when the
websocket connection goes away due to a network issue.
Cory Johns [Mon, 3 Apr 2017 21:26:47 +0000 (17:26 -0400)]
Support placement lists (#103)
Cory Johns [Mon, 3 Apr 2017 19:05:04 +0000 (15:05 -0400)]
Include resources from store when deploying (#102)
simonklb [Mon, 3 Apr 2017 16:21:22 +0000 (18:21 +0200)]
Allow underscore to dash translation when accessing model attributes (#101)
Pete Vander Giessen [Fri, 31 Mar 2017 13:27:22 +0000 (09:27 -0400)]
Added controller to ssh fix. (#100)
If a user has established a link to a controller other than the one in
"focus" locally, our ssh key workaround doesn't work. This change fixes
the issue by adding the controler name to the model name when appropriate.
Pete Vander Giessen [Mon, 20 Mar 2017 13:32:41 +0000 (08:32 -0500)]
Merge pull request #92 from juju/bug/schemagen
Regen schema to pick up missing APIs
Cory Johns [Fri, 10 Mar 2017 18:08:28 +0000 (12:08 -0600)]
Regen schema to pick up missing APIs
Due to some portions of the API living in a different location in the
Juju source, they were missed. The schema gen code has been factored
out into its own repo (https://github.com/juju/schemagen) and the
missing APIs fixed.
Pete Vander Giessen [Fri, 17 Mar 2017 20:18:03 +0000 (15:18 -0500)]
Merge pull request #82 from juju/feature/examples-use-loop
Updated examples to use juju.loop
Pete Vander Giessen [Thu, 9 Mar 2017 18:08:32 +0000 (12:08 -0600)]
Updated examples to use juju.loop
Also updated the README.
Made a few other tweaks to make them more consistent in style.
Pete Vander Giessen [Wed, 8 Mar 2017 15:48:16 +0000 (09:48 -0600)]
Merge pull request #78 from juju/receiver-close
Don't raise ConnectionClosed error in receiver task
Cory Johns [Wed, 8 Mar 2017 14:39:56 +0000 (08:39 -0600)]
Don't raise ConnectionClosed error in receiver task
Cory Johns [Tue, 7 Mar 2017 23:00:49 +0000 (17:00 -0600)]
Merge pull request #76 from juju/bug/match-websocket-responses
Fix out-of-order websocket responses
Cory Johns [Tue, 7 Mar 2017 22:36:22 +0000 (16:36 -0600)]
Improve error handling
Cory Johns [Tue, 7 Mar 2017 22:04:37 +0000 (16:04 -0600)]
Added test for out of order receive and fix bug creating task
Cory Johns [Tue, 7 Mar 2017 21:29:26 +0000 (15:29 -0600)]
Refactor to use IdQueue pattern
Pete Vander Giessen [Tue, 7 Mar 2017 20:54:49 +0000 (14:54 -0600)]
Fix issue where we do not check to make sure that we are receiving the correct response.
Pete Vander Giessen [Tue, 7 Mar 2017 21:40:58 +0000 (15:40 -0600)]
Merge pull request #74 from petevg/bug/fix-invalid-annotations
Raise errors in a centralized fashion.
Pete Vander Giessen [Tue, 7 Mar 2017 21:20:39 +0000 (15:20 -0600)]
Merge branch 'master' into bug/fix-invalid-annotations
Cory Johns [Tue, 7 Mar 2017 21:12:57 +0000 (15:12 -0600)]
Merge pull request #63 from juju/feature/model_get_status
Fixes for conjure-up
Pete Vander Giessen [Tue, 7 Mar 2017 19:34:25 +0000 (13:34 -0600)]
Fixed up tests.
Cory Johns [Tue, 7 Mar 2017 20:35:23 +0000 (14:35 -0600)]
Unit test for series logic
Pete Vander Giessen [Tue, 7 Mar 2017 16:30:00 +0000 (10:30 -0600)]
Raise errors in a centralized fashion.
Fixes error with annotations that's exposed when we actually run tests
with the "raise errors" fix.
Added tests to verify that errors get raised.
Cory Johns [Tue, 7 Mar 2017 15:41:29 +0000 (09:41 -0600)]
Fixes based on review
Cory Johns [Fri, 3 Mar 2017 19:39:45 +0000 (14:39 -0500)]
Fix single app deploy not using config_yaml
Refactored to reduce duplicated code and ensure that both deploy paths
(bundle and single app) use new config_yaml param instead of config.
Cory Johns [Fri, 3 Mar 2017 16:30:49 +0000 (11:30 -0500)]
Improve constraints parsing for empty values
Cory Johns [Fri, 3 Mar 2017 16:16:04 +0000 (11:16 -0500)]
Retry calls to charmstore and increase timeout to 5s
Cory Johns [Thu, 2 Mar 2017 21:50:21 +0000 (16:50 -0500)]
Added integration test for explicit loop and threaded functionality
Cory Johns [Thu, 2 Mar 2017 21:41:49 +0000 (16:41 -0500)]
Make connect_model and deploy a bit more friendly
Cory Johns [Thu, 2 Mar 2017 16:02:10 +0000 (11:02 -0500)]
Fix self.loop reference in BundleHandler
Cory Johns [Thu, 2 Mar 2017 14:40:39 +0000 (09:40 -0500)]
Fix invalid model name if already contains username
Cory Johns [Wed, 1 Mar 2017 17:02:24 +0000 (12:02 -0500)]
Pass through event loop
There were several places where the default event loop was used instead
of the given event loop.
Cory Johns [Wed, 1 Mar 2017 16:49:58 +0000 (11:49 -0500)]
Fix model name not including user
The model names in models.yaml include the username prefix.
Also fixed a lint error.
Cory Johns [Wed, 1 Mar 2017 00:09:46 +0000 (19:09 -0500)]
Implement Model.get_status
Tim Van Steenburgh [Thu, 2 Mar 2017 21:26:02 +0000 (16:26 -0500)]
Merge pull request #66 from petevg/bug/fix-landscape-deploy
Use config-yaml by default when deploying a bundle.
Tim Van Steenburgh [Thu, 2 Mar 2017 18:03:13 +0000 (13:03 -0500)]
Merge pull request #68 from petevg/bug/fix-integration-tests-xenial
Explicitly set basepython=python3 for integration tests.
Pete Vander Giessen [Thu, 2 Mar 2017 17:09:49 +0000 (12:09 -0500)]
Explicitly set basepython=python3 for integration tests.
Fixes them on machines that don't have python3 set as the default.
Tim Van Steenburgh [Thu, 2 Mar 2017 15:40:54 +0000 (10:40 -0500)]
Merge pull request #64 from juju/issues/27
Add integration tests.
Pete Vander Giessen [Thu, 2 Mar 2017 14:25:10 +0000 (09:25 -0500)]
Use config-yaml by default when deploying a bundle.
This invokes better/more modern behavior for blank strings in the
options for a given charm in the bundle.yaml. Specifically, it allows us
to deploy landscap-dense-maas without running into a KeyError.
This has been tested by using matrix to successfully deploy
landscape-dense-maas, using the code in this PR.
Tim Van Steenburgh [Wed, 1 Mar 2017 05:44:06 +0000 (00:44 -0500)]
Add integration tests.
- Covers most of what is demonstrated in the examples/ directory.
- The integration tests are not run by default (with the 'tox' command),
but they are run by TravisCI.
- Each integration test gets its own clean model in which to run, which
is destroyed at the end of the test. See tests.base.CleanModel.
- Includes charmstore and local bundle tests (local bundle has machine
and placement directives).
Fixes #27.
Tim Van Steenburgh [Mon, 27 Feb 2017 15:12:52 +0000 (10:12 -0500)]
Update add_machine example in docs.
Add some missing constants and show how machines are destroyed.
Tim Van Steenburgh [Mon, 27 Feb 2017 15:01:29 +0000 (10:01 -0500)]
Update changelog for 0.3.0
Tim Van Steenburgh [Mon, 27 Feb 2017 14:44:40 +0000 (09:44 -0500)]
v0.3.0
Tim Van Steenburgh [Mon, 27 Feb 2017 14:41:10 +0000 (09:41 -0500)]
Merge pull request #59 from juju/issues/58
Replace pass with NotImplementedError in method stubs
Tim Van Steenburgh [Mon, 27 Feb 2017 14:20:17 +0000 (09:20 -0500)]
Replace pass with NotImplementedError in method stubs
This is arguably more user-friendly than silently passing when an
unimplemented method is called.
Fixes #58.
Tim Van Steenburgh [Fri, 24 Feb 2017 17:37:49 +0000 (12:37 -0500)]
Merge pull request #56 from juju/issues/51
Implement Model.add_machine()
Tim Van Steenburgh [Fri, 24 Feb 2017 15:01:11 +0000 (10:01 -0500)]
Enable parallel testing
Should help speed up tests, especially as more functional tests
are added in the future. Each can be run in parallel on a separate
model.
Also removed unused import from client/connection.py
Tim Van Steenburgh [Fri, 24 Feb 2017 14:39:08 +0000 (09:39 -0500)]
Make Machine.destroy() block
Block the current coro until the machine is actually removed
from the remote model. This follows the same pattern as other
operations, e.g. Model.deploy().
Also clean up tests, making each functional test run on its
own clean model.
Tim Van Steenburgh [Thu, 23 Feb 2017 22:28:36 +0000 (17:28 -0500)]
Add functional tests for Model.add_machine()
Clean up other tests, ensuring that connections are closed
and a new event loop is used for each test.
Update py.test args in tox.ini to properly on nocapture so
logging output can be seen when needed.
Tim Van Steenburgh [Wed, 22 Feb 2017 16:05:32 +0000 (11:05 -0500)]
Correct MB/GB constants
Tim Van Steenburgh [Tue, 21 Feb 2017 18:57:30 +0000 (13:57 -0500)]
Implement Model.add_machine()
Also fixes a bug that was causing the 'to' parameter to
Model.deploy() to not be handled correctly.
Add docs and examples for adding machines and containers
and deploying charms to them.
Fixes #51.
Tim Van Steenburgh [Fri, 17 Feb 2017 17:45:47 +0000 (12:45 -0500)]
Merge pull request #55 from petevg/bug/fix-placement-docstring
Updated docstring for placement directive in python-libjuju.
Pete Vander Giessen [Fri, 17 Feb 2017 17:10:58 +0000 (12:10 -0500)]
Updated docstring for placement directive in python-libjuju.
Tim Van Steenburgh [Thu, 16 Feb 2017 16:03:03 +0000 (11:03 -0500)]
Update changelog for 0.2.0
Tim Van Steenburgh [Thu, 16 Feb 2017 15:50:59 +0000 (10:50 -0500)]
v0.2.0
Tim Van Steenburgh [Mon, 30 Jan 2017 15:24:56 +0000 (10:24 -0500)]
Merge pull request #47 from petevg/feature/fix-juju-ssh
Dropped in fixes for juju ssh.