New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for juju-dhx for 2.0rc2 #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from my comments about anecdotal reactions, i've pulled this branch and tested its basic functionality on 2.0-rc3.
👍 LGTM
return get_env._env | ||
|
||
|
||
def _unit_errored(unit): | ||
if JUJU_2: | ||
return unit['WorkloadStatus']['Status'] == 'error' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this was early beta format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed.
@@ -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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
No description provided.