Bug/fixes for null cases #28

Merged
merged 2 commits into from Nov 30, 2016

Conversation

Projects
None yet
2 participants
Collaborator

petevg commented Nov 30, 2016

@tvansteenburgh @johnsca This fixes a few more edge/null cases when deploying bundles. I've verified by running matrix on wiki-simple and hadoop-processing with a local build of python-libjuju based on this branch.

The two issues are:

  1. Checking for leadership on a subordinate breaks. I believe the correct thing to do is just to assume that the subordinate is not the leader. (Pls reject if this assumption is false.)
  2. Deploying a unit with a placement directive of [null] creates a null pointer exception in juju core. Deploying with a placement directive of null seems to work a lot better.

petevg added some commits Nov 30, 2016

Fixed two "null case" bugs:
add_unit no longer fails when we pass "None" for our placement
directive.

checking leadership on a subordinate no longer fails, as we are more
careful about pull stuff out of the full status map.
addUnits no longer attempts to send [None] for `placement`.
This happens when we attempt to parse_placement on a null or blank
directive, and it leads to a null pointer error in the API. Instead, we
pass a simple None for `placement` if we don't have a placement
directive.
Member

tvansteenburgh commented Nov 30, 2016

LGTM.

@tvansteenburgh tvansteenburgh merged commit 8d1b4db into juju:master Nov 30, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment