Fixes for juju-dhx for 2.0rc2 #70

Merged
merged 1 commit into from Oct 12, 2016

Conversation

Projects
None yet
2 participants
Member

johnsca commented Oct 4, 2016

No description provided.

Aside from my comments about anecdotal reactions, i've pulled this branch and tested its basic functionality on 2.0-rc3.

👍 LGTM

@@ -32,11 +34,29 @@ def call(*args):
sys.exit(e.returncode)
-JUJU_ENV = call('juju', 'switch').rstrip('\n').split(':')[-1]
+JUJU_ENV = call('juju', 'switch').rstrip('\n')
@chuckbutler

chuckbutler Oct 12, 2016

Contributor

praise the sun, we get to ditch the funky splits \o/

- annotations = env.get_annotation(machine, 'machine')
- if annotations['Annotations'].get('import-ids') != ','.join(import_ids):
+ annotations = env.get_annotation(machine, 'machine')['Annotations'] or {}
+ import_ids = ['lp:{}'.format(iid) if ':' not in iid else iid
@chuckbutler

chuckbutler Oct 12, 2016

Contributor

this line makes my head explode. 💣 I was looking for where iid is declared, and its on 208. Using a variable before assignment... oh my lambda.

@johnsca

johnsca Oct 12, 2016

Member

Yeah, that's a bit of an annoyance when you have to line-break list comprehensions. This might have been marginally clearer using map() instead.

return get_env._env
def _unit_errored(unit):
if JUJU_2:
- return unit['WorkloadStatus']['Status'] == 'error'
@chuckbutler

chuckbutler Oct 12, 2016

Contributor

I assume this was early beta format?

@johnsca

johnsca Oct 12, 2016

Member

Indeed.

@chuckbutler chuckbutler merged commit 38bb5eb into juju:master Oct 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment